@rxap/forms 12.7.3 → 13.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/index.mjs +53 -0
- package/esm2020/lib/control-actions.mjs +77 -0
- package/esm2020/lib/control-value-accessor.mjs +14 -0
- package/esm2020/lib/decorators/control-async-validator.mjs +10 -0
- package/esm2020/lib/decorators/control-change.mjs +10 -0
- package/esm2020/lib/decorators/control-set-value.mjs +11 -0
- package/esm2020/lib/decorators/control-validator.mjs +10 -0
- package/esm2020/lib/decorators/form.mjs +7 -0
- package/esm2020/lib/decorators/metadata-keys.mjs +12 -0
- package/esm2020/lib/decorators/use-form-array.mjs +13 -0
- package/esm2020/lib/decorators/use-form-control.mjs +8 -0
- package/esm2020/lib/decorators/use-form-group.mjs +8 -0
- package/esm2020/lib/directives/form-control-error.directive.mjs +59 -0
- package/esm2020/lib/directives/form-control-mark-dirty.directive.mjs +31 -0
- package/esm2020/lib/directives/form-control-mark-pristine.directive.mjs +31 -0
- package/esm2020/lib/directives/form-control-mark-touched.directive.mjs +24 -0
- package/esm2020/lib/directives/form-control-mark-untouched.directive.mjs +31 -0
- package/esm2020/lib/directives/form-control-name.directive.mjs +64 -0
- package/esm2020/lib/directives/form-group-name.directive.mjs +61 -0
- package/esm2020/lib/directives/form-loaded.directive.mjs +41 -0
- package/esm2020/lib/directives/form-loading-error.directive.mjs +41 -0
- package/esm2020/lib/directives/form-loading.directive.mjs +41 -0
- package/esm2020/lib/directives/form-submit-failed.directive.mjs +41 -0
- package/esm2020/lib/directives/form-submit-invalid.directive.mjs +39 -0
- package/esm2020/lib/directives/form-submit-successful.directive.mjs +39 -0
- package/esm2020/lib/directives/form-submit.directive.mjs +74 -0
- package/esm2020/lib/directives/form-submitting.directive.mjs +41 -0
- package/esm2020/lib/directives/form.directive.mjs +541 -0
- package/esm2020/lib/directives/forms.module.mjs +100 -0
- package/esm2020/lib/directives/models.mjs +12 -0
- package/esm2020/lib/directives/parent-control-container.directive.mjs +25 -0
- package/esm2020/lib/directives/tokens.mjs +10 -0
- package/esm2020/lib/form-array.mjs +225 -0
- package/esm2020/lib/form-builder.mjs +374 -0
- package/esm2020/lib/form-control.mjs +169 -0
- package/esm2020/lib/form-group.mjs +181 -0
- package/esm2020/lib/model.mjs +2 -0
- package/esm2020/lib/tokens.mjs +4 -0
- package/esm2020/lib/types.mjs +2 -0
- package/esm2020/lib/validators/index.mjs +29 -0
- package/esm2020/lib/validators/is-array.mjs +18 -0
- package/esm2020/lib/validators/is-boolean.mjs +18 -0
- package/esm2020/lib/validators/is-complex.mjs +87 -0
- package/esm2020/lib/validators/is-date.mjs +18 -0
- package/esm2020/lib/validators/is-email.mjs +19 -0
- package/esm2020/lib/validators/is-enum.mjs +18 -0
- package/esm2020/lib/validators/is-int.mjs +19 -0
- package/esm2020/lib/validators/is-ip.mjs +19 -0
- package/esm2020/lib/validators/is-number.mjs +56 -0
- package/esm2020/lib/validators/is-object.mjs +18 -0
- package/esm2020/lib/validators/is-phone-number.mjs +19 -0
- package/esm2020/lib/validators/is-string.mjs +18 -0
- package/esm2020/lib/validators/is-url.mjs +19 -0
- package/esm2020/rxap-forms.mjs +5 -0
- package/fesm2015/rxap-forms.mjs +2721 -0
- package/fesm2015/rxap-forms.mjs.map +1 -0
- package/{fesm2015/rxap-forms.js → fesm2020/rxap-forms.mjs} +161 -147
- package/fesm2020/rxap-forms.mjs.map +1 -0
- package/package.json +35 -21
- package/src/schematics/ng-add/index.js +1 -1
- package/src/schematics/ng-add/index.js.map +1 -1
- package/bundles/rxap-forms.umd.js +0 -3521
- package/bundles/rxap-forms.umd.js.map +0 -1
- package/esm2015/index.js +0 -53
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/control-actions.js +0 -80
- package/esm2015/lib/control-actions.js.map +0 -1
- package/esm2015/lib/control-value-accessor.js +0 -14
- package/esm2015/lib/control-value-accessor.js.map +0 -1
- package/esm2015/lib/decorators/control-async-validator.js +0 -10
- package/esm2015/lib/decorators/control-async-validator.js.map +0 -1
- package/esm2015/lib/decorators/control-change.js +0 -10
- package/esm2015/lib/decorators/control-change.js.map +0 -1
- package/esm2015/lib/decorators/control-set-value.js +0 -8
- package/esm2015/lib/decorators/control-set-value.js.map +0 -1
- package/esm2015/lib/decorators/control-validator.js +0 -10
- package/esm2015/lib/decorators/control-validator.js.map +0 -1
- package/esm2015/lib/decorators/form.js +0 -7
- package/esm2015/lib/decorators/form.js.map +0 -1
- package/esm2015/lib/decorators/metadata-keys.js +0 -12
- package/esm2015/lib/decorators/metadata-keys.js.map +0 -1
- package/esm2015/lib/decorators/use-form-array.js +0 -13
- package/esm2015/lib/decorators/use-form-array.js.map +0 -1
- package/esm2015/lib/decorators/use-form-control.js +0 -8
- package/esm2015/lib/decorators/use-form-control.js.map +0 -1
- package/esm2015/lib/decorators/use-form-group.js +0 -8
- package/esm2015/lib/decorators/use-form-group.js.map +0 -1
- package/esm2015/lib/directives/form-control-error.directive.js +0 -61
- package/esm2015/lib/directives/form-control-error.directive.js.map +0 -1
- package/esm2015/lib/directives/form-control-mark-dirty.directive.js +0 -31
- package/esm2015/lib/directives/form-control-mark-dirty.directive.js.map +0 -1
- package/esm2015/lib/directives/form-control-mark-pristine.directive.js +0 -31
- package/esm2015/lib/directives/form-control-mark-pristine.directive.js.map +0 -1
- package/esm2015/lib/directives/form-control-mark-touched.directive.js +0 -25
- package/esm2015/lib/directives/form-control-mark-touched.directive.js.map +0 -1
- package/esm2015/lib/directives/form-control-mark-untouched.directive.js +0 -31
- package/esm2015/lib/directives/form-control-mark-untouched.directive.js.map +0 -1
- package/esm2015/lib/directives/form-control-name.directive.js +0 -64
- package/esm2015/lib/directives/form-control-name.directive.js.map +0 -1
- package/esm2015/lib/directives/form-group-name.directive.js +0 -61
- package/esm2015/lib/directives/form-group-name.directive.js.map +0 -1
- package/esm2015/lib/directives/form-loaded.directive.js +0 -42
- package/esm2015/lib/directives/form-loaded.directive.js.map +0 -1
- package/esm2015/lib/directives/form-loading-error.directive.js +0 -42
- package/esm2015/lib/directives/form-loading-error.directive.js.map +0 -1
- package/esm2015/lib/directives/form-loading.directive.js +0 -42
- package/esm2015/lib/directives/form-loading.directive.js.map +0 -1
- package/esm2015/lib/directives/form-submit-failed.directive.js +0 -42
- package/esm2015/lib/directives/form-submit-failed.directive.js.map +0 -1
- package/esm2015/lib/directives/form-submit-invalid.directive.js +0 -40
- package/esm2015/lib/directives/form-submit-invalid.directive.js.map +0 -1
- package/esm2015/lib/directives/form-submit-successful.directive.js +0 -40
- package/esm2015/lib/directives/form-submit-successful.directive.js.map +0 -1
- package/esm2015/lib/directives/form-submit.directive.js +0 -75
- package/esm2015/lib/directives/form-submit.directive.js.map +0 -1
- package/esm2015/lib/directives/form-submitting.directive.js +0 -42
- package/esm2015/lib/directives/form-submitting.directive.js.map +0 -1
- package/esm2015/lib/directives/form.directive.js +0 -544
- package/esm2015/lib/directives/form.directive.js.map +0 -1
- package/esm2015/lib/directives/forms.module.js +0 -100
- package/esm2015/lib/directives/forms.module.js.map +0 -1
- package/esm2015/lib/directives/models.js +0 -12
- package/esm2015/lib/directives/models.js.map +0 -1
- package/esm2015/lib/directives/parent-control-container.directive.js +0 -25
- package/esm2015/lib/directives/parent-control-container.directive.js.map +0 -1
- package/esm2015/lib/directives/tokens.js +0 -10
- package/esm2015/lib/directives/tokens.js.map +0 -1
- package/esm2015/lib/form-array.js +0 -217
- package/esm2015/lib/form-array.js.map +0 -1
- package/esm2015/lib/form-builder.js +0 -349
- package/esm2015/lib/form-builder.js.map +0 -1
- package/esm2015/lib/form-control.js +0 -170
- package/esm2015/lib/form-control.js.map +0 -1
- package/esm2015/lib/form-group.js +0 -183
- package/esm2015/lib/form-group.js.map +0 -1
- package/esm2015/lib/model.js +0 -2
- package/esm2015/lib/model.js.map +0 -1
- package/esm2015/lib/tokens.js +0 -4
- package/esm2015/lib/tokens.js.map +0 -1
- package/esm2015/lib/types.js +0 -2
- package/esm2015/lib/types.js.map +0 -1
- package/esm2015/lib/validators/index.js +0 -29
- package/esm2015/lib/validators/index.js.map +0 -1
- package/esm2015/lib/validators/is-array.js +0 -18
- package/esm2015/lib/validators/is-array.js.map +0 -1
- package/esm2015/lib/validators/is-boolean.js +0 -18
- package/esm2015/lib/validators/is-boolean.js.map +0 -1
- package/esm2015/lib/validators/is-complex.js +0 -87
- package/esm2015/lib/validators/is-complex.js.map +0 -1
- package/esm2015/lib/validators/is-date.js +0 -18
- package/esm2015/lib/validators/is-date.js.map +0 -1
- package/esm2015/lib/validators/is-email.js +0 -19
- package/esm2015/lib/validators/is-email.js.map +0 -1
- package/esm2015/lib/validators/is-enum.js +0 -18
- package/esm2015/lib/validators/is-enum.js.map +0 -1
- package/esm2015/lib/validators/is-int.js +0 -19
- package/esm2015/lib/validators/is-int.js.map +0 -1
- package/esm2015/lib/validators/is-ip.js +0 -19
- package/esm2015/lib/validators/is-ip.js.map +0 -1
- package/esm2015/lib/validators/is-number.js +0 -57
- package/esm2015/lib/validators/is-number.js.map +0 -1
- package/esm2015/lib/validators/is-object.js +0 -18
- package/esm2015/lib/validators/is-object.js.map +0 -1
- package/esm2015/lib/validators/is-phone-number.js +0 -19
- package/esm2015/lib/validators/is-phone-number.js.map +0 -1
- package/esm2015/lib/validators/is-string.js +0 -18
- package/esm2015/lib/validators/is-string.js.map +0 -1
- package/esm2015/lib/validators/is-url.js +0 -19
- package/esm2015/lib/validators/is-url.js.map +0 -1
- package/esm2015/rxap-forms.js +0 -5
- package/esm2015/rxap-forms.js.map +0 -1
- package/fesm2015/rxap-forms.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { map, distinctUntilChanged, debounceTime, filter, tap, startWith, take }
|
|
|
4
4
|
import { merge, defer, of, EMPTY, Subject, isObservable, BehaviorSubject, Subscription } from 'rxjs';
|
|
5
5
|
import { equals, coerceArray, HasRxapOnInitMethod, assertIsArray, assertIsObject, assertIsFunction, isPromise, isObject, clone, Required, hasIndexSignature, coerceBoolean } from '@rxap/utilities';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import {
|
|
7
|
+
import { isDevMode, Injector, InjectionToken, EventEmitter, ChangeDetectorRef, forwardRef, Directive, Inject, Optional, SkipSelf, Input, Output, HostBinding, TemplateRef, ViewContainerRef, Host, HostListener, Self, NgModule } from '@angular/core';
|
|
8
8
|
import { GetDefinitionMetadata, DefinitionMetadata } from '@rxap/definition';
|
|
9
9
|
import { getMetadata, setMetadataMapSet, setMetadataMap } from '@rxap/utilities/reflect-metadata';
|
|
10
10
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -26,16 +26,13 @@ function controlValueChanges$(control) {
|
|
|
26
26
|
return merge(defer(() => of(getControlValue(control))), control.valueChanges.pipe(map(() => getControlValue(control))));
|
|
27
27
|
}
|
|
28
28
|
function controlDisabled$(control) {
|
|
29
|
-
|
|
30
|
-
return merge(defer(() => of(control.disabled)), merge(control.statusChanges, (_a = control.stateChanges) !== null && _a !== void 0 ? _a : EMPTY).pipe(map(() => control.disabled), distinctUntilChanged()));
|
|
29
|
+
return merge(defer(() => of(control.disabled)), merge(control.statusChanges, control.stateChanges ?? EMPTY).pipe(map(() => control.disabled), distinctUntilChanged()));
|
|
31
30
|
}
|
|
32
31
|
function controlEnabled$(control) {
|
|
33
|
-
|
|
34
|
-
return merge(defer(() => of(control.enabled)), merge(control.statusChanges, (_a = control.stateChanges) !== null && _a !== void 0 ? _a : EMPTY).pipe(map(() => control.enabled), distinctUntilChanged()));
|
|
32
|
+
return merge(defer(() => of(control.enabled)), merge(control.statusChanges, control.stateChanges ?? EMPTY).pipe(map(() => control.enabled), distinctUntilChanged()));
|
|
35
33
|
}
|
|
36
34
|
function controlReadonly$(control) {
|
|
37
|
-
|
|
38
|
-
return merge(defer(() => { var _a; return of((_a = control.readonly) !== null && _a !== void 0 ? _a : false); }), merge(control.statusChanges, (_a = control.stateChanges) !== null && _a !== void 0 ? _a : EMPTY).pipe(map(() => { var _a; return (_a = control.readonly) !== null && _a !== void 0 ? _a : false; }), distinctUntilChanged()));
|
|
35
|
+
return merge(defer(() => of(control.readonly ?? false)), merge(control.statusChanges, control.stateChanges ?? EMPTY).pipe(map(() => control.readonly ?? false), distinctUntilChanged()));
|
|
39
36
|
}
|
|
40
37
|
function controlStatusChanges$(control) {
|
|
41
38
|
return merge(defer(() => of(control.status)), control.statusChanges.pipe(map(() => control.status), distinctUntilChanged()));
|
|
@@ -117,12 +114,11 @@ class RxapFormArray extends FormArray {
|
|
|
117
114
|
this._controlRemovedFn = options.controlRemovedFn;
|
|
118
115
|
}
|
|
119
116
|
get readonly() {
|
|
120
|
-
|
|
121
|
-
return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.readonly) !== null && _b !== void 0 ? _b : this._readonly;
|
|
117
|
+
return this.parent?.readonly ?? this._readonly;
|
|
122
118
|
}
|
|
123
119
|
set readonly(value) {
|
|
124
120
|
this._readonly = value;
|
|
125
|
-
this.controls.forEach(control =>
|
|
121
|
+
this.controls.forEach(control => control.stateChanges?.next());
|
|
126
122
|
}
|
|
127
123
|
/**
|
|
128
124
|
* @internal
|
|
@@ -163,7 +159,9 @@ class RxapFormArray extends FormArray {
|
|
|
163
159
|
return super.getRawValue();
|
|
164
160
|
}
|
|
165
161
|
insert(index, control) {
|
|
166
|
-
|
|
162
|
+
if (isDevMode()) {
|
|
163
|
+
console.warn('It is not recommend to use the FormArray.insert method');
|
|
164
|
+
}
|
|
167
165
|
return super.insert(index, control);
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
@@ -174,7 +172,7 @@ class RxapFormArray extends FormArray {
|
|
|
174
172
|
* @param state (optional) the initial state of the new control
|
|
175
173
|
*/
|
|
176
174
|
insertAt(index, state) {
|
|
177
|
-
const insertIndex = index
|
|
175
|
+
const insertIndex = index ?? this.controls.length;
|
|
178
176
|
const controlOrDefinition = this._builder(state, {
|
|
179
177
|
controlId: insertIndex.toFixed(0),
|
|
180
178
|
});
|
|
@@ -245,7 +243,9 @@ class RxapFormArray extends FormArray {
|
|
|
245
243
|
return hasErrorAndDirty(this, errorCode, path);
|
|
246
244
|
}
|
|
247
245
|
removeAt(index) {
|
|
248
|
-
|
|
246
|
+
if (isDevMode()) {
|
|
247
|
+
console.warn('It is not recommend to use the FormArray.removeAt method');
|
|
248
|
+
}
|
|
249
249
|
super.removeAt(index);
|
|
250
250
|
this._controlRemovedFn(index);
|
|
251
251
|
}
|
|
@@ -253,14 +253,18 @@ class RxapFormArray extends FormArray {
|
|
|
253
253
|
enableControl(this, enable, opts);
|
|
254
254
|
}
|
|
255
255
|
push(control) {
|
|
256
|
-
|
|
256
|
+
if (isDevMode()) {
|
|
257
|
+
console.warn('It is not recommend to use the FormArray.push method');
|
|
258
|
+
}
|
|
257
259
|
return super.push(control);
|
|
258
260
|
}
|
|
259
261
|
setDisable(disable = true, opts) {
|
|
260
262
|
disableControl(this, disable, opts);
|
|
261
263
|
}
|
|
262
264
|
setControl(index, control) {
|
|
263
|
-
|
|
265
|
+
if (isDevMode()) {
|
|
266
|
+
console.warn('It is not recommend to use the FormArray.setControl method');
|
|
267
|
+
}
|
|
264
268
|
return super.setControl(index, control);
|
|
265
269
|
}
|
|
266
270
|
markAsTouched(opts) {
|
|
@@ -346,13 +350,11 @@ class RxapFormGroup extends FormGroup {
|
|
|
346
350
|
return this.parent.rxapFormDefinition;
|
|
347
351
|
}
|
|
348
352
|
get readonly() {
|
|
349
|
-
|
|
350
|
-
return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.readonly) !== null && _b !== void 0 ? _b : this._readonly;
|
|
353
|
+
return this.parent?.readonly ?? this._readonly;
|
|
351
354
|
}
|
|
352
355
|
set readonly(value) {
|
|
353
|
-
var _a;
|
|
354
356
|
this._readonly = value;
|
|
355
|
-
Object.values(
|
|
357
|
+
Object.values(this.controls ?? {}).forEach(control => control.stateChanges?.next());
|
|
356
358
|
}
|
|
357
359
|
get controlPath() {
|
|
358
360
|
const parent = this.parent;
|
|
@@ -525,8 +527,7 @@ class RxapFormControl extends FormControl {
|
|
|
525
527
|
return this.parent.rxapFormDefinition;
|
|
526
528
|
}
|
|
527
529
|
get readonly() {
|
|
528
|
-
|
|
529
|
-
return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.readonly) !== null && _b !== void 0 ? _b : this._readonly;
|
|
530
|
+
return this.parent?.readonly ?? this._readonly;
|
|
530
531
|
}
|
|
531
532
|
set readonly(value) {
|
|
532
533
|
this._readonly = value;
|
|
@@ -608,7 +609,7 @@ class RxapFormControl extends FormControl {
|
|
|
608
609
|
this.markAsDirty({ onlySelf: true });
|
|
609
610
|
}
|
|
610
611
|
reset(formState, options) {
|
|
611
|
-
const newState = formState
|
|
612
|
+
const newState = formState ?? this.initialState;
|
|
612
613
|
if (typeof newState === 'function') {
|
|
613
614
|
super.reset(newState(), options);
|
|
614
615
|
}
|
|
@@ -686,7 +687,6 @@ class FormArrayControlManager {
|
|
|
686
687
|
}
|
|
687
688
|
class RxapFormBuilder {
|
|
688
689
|
constructor(definition, injector = Injector.NULL, providers = []) {
|
|
689
|
-
var _a;
|
|
690
690
|
this.definition = definition;
|
|
691
691
|
this.injector = injector;
|
|
692
692
|
this.formArrayGroups = this.extractArrayGroups();
|
|
@@ -701,12 +701,11 @@ class RxapFormBuilder {
|
|
|
701
701
|
// merge the providers from the from options with the providers from the
|
|
702
702
|
// constructor. If the provider is defined in the form options and constructor
|
|
703
703
|
// then the provider from the constructor will be used.
|
|
704
|
-
this.providers = [...providers, ...(
|
|
704
|
+
this.providers = [...providers, ...(formOptions.providers ?? [])].filter((provider, index, self) => provider.hasOwnProperty('provide') &&
|
|
705
705
|
self.findIndex((selfProvider) => selfProvider.hasOwnProperty('provide') &&
|
|
706
706
|
selfProvider.provide === provider.provide) === index);
|
|
707
707
|
}
|
|
708
708
|
build(state = {}, options = {}) {
|
|
709
|
-
var _a, _b;
|
|
710
709
|
const injector = Injector.create({
|
|
711
710
|
name: `rxap/form-builder/${this.formOptions.id}`,
|
|
712
711
|
parent: this.injector,
|
|
@@ -730,7 +729,11 @@ class RxapFormBuilder {
|
|
|
730
729
|
this.buildGroups(state, form, controls);
|
|
731
730
|
this.buildArrayGroups(state, form, controls);
|
|
732
731
|
this.buildArrayControls(state, form, controls);
|
|
733
|
-
const formOptions =
|
|
732
|
+
const formOptions = {
|
|
733
|
+
...this.formOptions,
|
|
734
|
+
controlId: options.controlId ?? (options.id ? options.id : this.formOptions.id),
|
|
735
|
+
...options,
|
|
736
|
+
};
|
|
734
737
|
form.rxapFormGroup = new RxapFormGroup(controls, formOptions);
|
|
735
738
|
Reflect.set(form.rxapFormGroup, '_rxapFormDefinition', form);
|
|
736
739
|
form.rxapMetadata = this.formOptions;
|
|
@@ -739,7 +742,7 @@ class RxapFormBuilder {
|
|
|
739
742
|
}
|
|
740
743
|
for (const control of Object.values(form.rxapFormGroup.controls)) {
|
|
741
744
|
if (control.controlId) {
|
|
742
|
-
const controlSetValueOnInit = Array.from(
|
|
745
|
+
const controlSetValueOnInit = Array.from(this.controlSetValue.get(control.controlId) ?? []).filter((controlSetValueOptions) => controlSetValueOptions.initial);
|
|
743
746
|
for (const onSetValue of this.coerceToFnArray(form, controlSetValueOnInit)) {
|
|
744
747
|
onSetValue(control.value, { initial: true });
|
|
745
748
|
}
|
|
@@ -757,7 +760,15 @@ class RxapFormBuilder {
|
|
|
757
760
|
controls[controlId] =
|
|
758
761
|
new RxapFormArray(
|
|
759
762
|
// TODO : add the formControlOptions property. To definition the form control options
|
|
760
|
-
formControls,
|
|
763
|
+
formControls, {
|
|
764
|
+
...options,
|
|
765
|
+
controlId,
|
|
766
|
+
validators: [],
|
|
767
|
+
asyncValidators: [],
|
|
768
|
+
controlInsertedFn: manager.inserted.bind(manager),
|
|
769
|
+
controlRemovedFn: manager.removed.bind(manager),
|
|
770
|
+
builder: (state, controlOptions) => new RxapFormControl(state, controlOptions),
|
|
771
|
+
}));
|
|
761
772
|
// TODO : add support for injectable validators
|
|
762
773
|
formArray.setValidators(this.coerceToValidatorArray(form, options.validators, this.validators.get(controlId)), false);
|
|
763
774
|
formArray.setAsyncValidators(this.coerceToValidatorArray(form, options.asyncValidators, this.asyncValidators.get(controlId)), false);
|
|
@@ -774,7 +785,15 @@ class RxapFormBuilder {
|
|
|
774
785
|
const manager = new FormArrayControlManager(form, controlId);
|
|
775
786
|
const formArray = (formGroupDefinitions.rxapFormArray =
|
|
776
787
|
controls[controlId] =
|
|
777
|
-
new RxapFormArray(formGroupDefinitions.map((fgd) => fgd.rxapFormGroup),
|
|
788
|
+
new RxapFormArray(formGroupDefinitions.map((fgd) => fgd.rxapFormGroup), {
|
|
789
|
+
...options,
|
|
790
|
+
builder: formGroupBuilder.build.bind(formGroupBuilder),
|
|
791
|
+
controlId,
|
|
792
|
+
validators: [],
|
|
793
|
+
asyncValidators: [],
|
|
794
|
+
controlInsertedFn: manager.inserted.bind(manager),
|
|
795
|
+
controlRemovedFn: manager.removed.bind(manager)
|
|
796
|
+
}));
|
|
778
797
|
// TODO : add support for injectable validators
|
|
779
798
|
formArray.setValidators(this.coerceToValidatorArray(form, options.validators, this.validators.get(controlId)), false);
|
|
780
799
|
formArray.setAsyncValidators(this.coerceToValidatorArray(form, options.asyncValidators, this.asyncValidators.get(controlId)), false);
|
|
@@ -785,7 +804,11 @@ class RxapFormBuilder {
|
|
|
785
804
|
for (const [controlId, options] of this.formGroups.entries()) {
|
|
786
805
|
const formState = this.coerceToGroupFormState(controlId, {}, builderFormState, options.state);
|
|
787
806
|
assertIsObject(formState);
|
|
788
|
-
const formGroupDefinition = new RxapFormBuilder(options.definition, this.injector, this.providers).build(formState,
|
|
807
|
+
const formGroupDefinition = new RxapFormBuilder(options.definition, this.injector, this.providers).build(formState, {
|
|
808
|
+
...options,
|
|
809
|
+
validators: [],
|
|
810
|
+
asyncValidators: [],
|
|
811
|
+
});
|
|
789
812
|
controls[controlId] = formGroupDefinition.rxapFormGroup;
|
|
790
813
|
const formGroup = formGroupDefinition.rxapFormGroup;
|
|
791
814
|
// TODO : add support for injectable validators
|
|
@@ -796,12 +819,17 @@ class RxapFormBuilder {
|
|
|
796
819
|
}
|
|
797
820
|
}
|
|
798
821
|
buildControls(builderFormState, form, controls) {
|
|
799
|
-
var _a, _b;
|
|
800
822
|
for (const [controlId, options] of this.formControls.entries()) {
|
|
801
|
-
const control = (controls[controlId] = new (
|
|
823
|
+
const control = (controls[controlId] = new (options.controlType ??
|
|
824
|
+
RxapFormControl)(this.coerceToControlFormState(controlId, null, builderFormState, options.state), {
|
|
825
|
+
...options,
|
|
826
|
+
controlId,
|
|
827
|
+
validators: [],
|
|
828
|
+
asyncValidators: [],
|
|
829
|
+
}));
|
|
802
830
|
const injectValidators = [];
|
|
803
831
|
const injectAsyncValidators = [];
|
|
804
|
-
for (const injectValidator of
|
|
832
|
+
for (const injectValidator of options.injectValidators ?? []) {
|
|
805
833
|
const injectableValidator = this.injector.get(injectValidator);
|
|
806
834
|
if (injectableValidator.validate) {
|
|
807
835
|
injectValidators.push(injectableValidator.validate.bind(injectableValidator));
|
|
@@ -887,7 +915,7 @@ class RxapFormBuilder {
|
|
|
887
915
|
formState = builderFormState[controlId];
|
|
888
916
|
}
|
|
889
917
|
else if (optionsFormState !== undefined) {
|
|
890
|
-
formState = optionsFormState
|
|
918
|
+
formState = optionsFormState ?? null;
|
|
891
919
|
}
|
|
892
920
|
if (typeof formState === 'function') {
|
|
893
921
|
formState = formState();
|
|
@@ -957,36 +985,34 @@ class RxapFormBuilder {
|
|
|
957
985
|
return formState;
|
|
958
986
|
}
|
|
959
987
|
extractControlChanges() {
|
|
960
|
-
|
|
961
|
-
|
|
988
|
+
return (getMetadata(MetadataKeys.CONTROL_CHANGES, this.definition.prototype) ??
|
|
989
|
+
new Map());
|
|
962
990
|
}
|
|
963
991
|
extractControlSetValue() {
|
|
964
|
-
|
|
965
|
-
|
|
992
|
+
return (getMetadata(MetadataKeys.CONTROL_SET_VALUE, this.definition.prototype) ??
|
|
993
|
+
new Map());
|
|
966
994
|
}
|
|
967
995
|
extractValidators() {
|
|
968
|
-
|
|
969
|
-
|
|
996
|
+
return (getMetadata(MetadataKeys.CONTROL_VALIDATORS, this.definition.prototype) ??
|
|
997
|
+
new Map());
|
|
970
998
|
}
|
|
971
999
|
extractAsyncValidators() {
|
|
972
|
-
|
|
973
|
-
return ((_a = getMetadata(MetadataKeys.CONTROL_ASYNC_VALIDATORS, this.definition.prototype)) !== null && _a !== void 0 ? _a : new Map());
|
|
1000
|
+
return (getMetadata(MetadataKeys.CONTROL_ASYNC_VALIDATORS, this.definition.prototype) ?? new Map());
|
|
974
1001
|
}
|
|
975
1002
|
extractArrayGroups() {
|
|
976
|
-
|
|
977
|
-
|
|
1003
|
+
return (getMetadata(MetadataKeys.FORM_ARRAY_GROUPS, this.definition.prototype) ??
|
|
1004
|
+
new Map());
|
|
978
1005
|
}
|
|
979
1006
|
extractArrayControls() {
|
|
980
|
-
|
|
981
|
-
return ((_a = getMetadata(MetadataKeys.FORM_ARRAY_CONTROLS, this.definition.prototype)) !== null && _a !== void 0 ? _a : new Map());
|
|
1007
|
+
return (getMetadata(MetadataKeys.FORM_ARRAY_CONTROLS, this.definition.prototype) ?? new Map());
|
|
982
1008
|
}
|
|
983
1009
|
extractGroups() {
|
|
984
|
-
|
|
985
|
-
|
|
1010
|
+
return (getMetadata(MetadataKeys.FORM_GROUPS, this.definition.prototype) ??
|
|
1011
|
+
new Map());
|
|
986
1012
|
}
|
|
987
1013
|
extractControls() {
|
|
988
|
-
|
|
989
|
-
|
|
1014
|
+
return (getMetadata(MetadataKeys.FORM_CONTROLS, this.definition.prototype) ??
|
|
1015
|
+
new Map());
|
|
990
1016
|
}
|
|
991
1017
|
extractFormOptions() {
|
|
992
1018
|
const options = GetDefinitionMetadata(this.definition);
|
|
@@ -1035,7 +1061,10 @@ function ControlChange(...controlIds) {
|
|
|
1035
1061
|
|
|
1036
1062
|
function ControlSetValue(controlId, options = {}) {
|
|
1037
1063
|
return function (target, propertyKey) {
|
|
1038
|
-
setMetadataMapSet(controlId,
|
|
1064
|
+
setMetadataMapSet(controlId, {
|
|
1065
|
+
...options,
|
|
1066
|
+
propertyKey
|
|
1067
|
+
}, MetadataKeys.CONTROL_SET_VALUE, target);
|
|
1039
1068
|
};
|
|
1040
1069
|
}
|
|
1041
1070
|
|
|
@@ -1049,7 +1078,7 @@ function ControlValidator(...controlIds) {
|
|
|
1049
1078
|
|
|
1050
1079
|
function UseFormArrayGroup(definition, options = {}) {
|
|
1051
1080
|
return function (target, propertyKey) {
|
|
1052
|
-
setMetadataMap(propertyKey,
|
|
1081
|
+
setMetadataMap(propertyKey, { ...options, definition }, MetadataKeys.FORM_ARRAY_GROUPS, target);
|
|
1053
1082
|
};
|
|
1054
1083
|
}
|
|
1055
1084
|
function UseFormArrayControl(options = {}) {
|
|
@@ -1066,7 +1095,7 @@ function UseFormControl(options = {}) {
|
|
|
1066
1095
|
|
|
1067
1096
|
function UseFormGroup(definition, options = {}) {
|
|
1068
1097
|
return function (target, propertyKey) {
|
|
1069
|
-
setMetadataMap(propertyKey,
|
|
1098
|
+
setMetadataMap(propertyKey, { ...options, definition }, MetadataKeys.FORM_GROUPS, target);
|
|
1070
1099
|
};
|
|
1071
1100
|
}
|
|
1072
1101
|
|
|
@@ -1101,7 +1130,6 @@ class FormDirective extends FormGroupDirective {
|
|
|
1101
1130
|
submitSuccessfulMethod = null,
|
|
1102
1131
|
// skip self, bc the token is set to null
|
|
1103
1132
|
formDefinitionBuilder = null, loadingIndicatorService = null) {
|
|
1104
|
-
var _a, _b;
|
|
1105
1133
|
super([], []);
|
|
1106
1134
|
this.cdr = cdr;
|
|
1107
1135
|
this.loadMethod = loadMethod;
|
|
@@ -1138,8 +1166,8 @@ class FormDirective extends FormGroupDirective {
|
|
|
1138
1166
|
this._formDefinition = formDefinition;
|
|
1139
1167
|
this.form = formDefinition.rxapFormGroup;
|
|
1140
1168
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1169
|
+
this.loadingIndicatorService?.attachLoading(this.loading$);
|
|
1170
|
+
this.loadingIndicatorService?.attachLoading(this.submitting$);
|
|
1143
1171
|
}
|
|
1144
1172
|
get submitting() {
|
|
1145
1173
|
return this.submitting$.value;
|
|
@@ -1326,11 +1354,10 @@ class FormDirective extends FormGroupDirective {
|
|
|
1326
1354
|
}
|
|
1327
1355
|
}
|
|
1328
1356
|
loadFailed(error) {
|
|
1329
|
-
var _a;
|
|
1330
1357
|
console.debug('Load Error:', error);
|
|
1331
1358
|
console.error('Load Error:', error.message);
|
|
1332
1359
|
if (this.loadFailedMethod) {
|
|
1333
|
-
|
|
1360
|
+
this.loadFailedMethod?.call(error);
|
|
1334
1361
|
}
|
|
1335
1362
|
else if (isDevMode()) {
|
|
1336
1363
|
console.warn('The form loading failed for: ' + this.form.controlId);
|
|
@@ -1344,7 +1371,7 @@ class FormDirective extends FormGroupDirective {
|
|
|
1344
1371
|
else if (typeof this._formDefinition['toJSON'] === 'function') {
|
|
1345
1372
|
value = this._formDefinition.toJSON();
|
|
1346
1373
|
}
|
|
1347
|
-
value = value
|
|
1374
|
+
value = value ?? this.form.value;
|
|
1348
1375
|
return clone(value);
|
|
1349
1376
|
}
|
|
1350
1377
|
submit() {
|
|
@@ -1414,9 +1441,8 @@ class FormDirective extends FormGroupDirective {
|
|
|
1414
1441
|
}
|
|
1415
1442
|
}
|
|
1416
1443
|
ngOnDestroy() {
|
|
1417
|
-
var _a;
|
|
1418
1444
|
super.ngOnDestroy();
|
|
1419
|
-
|
|
1445
|
+
this._autoSubmitSubscription?.unsubscribe();
|
|
1420
1446
|
function HasNgOnDestroyMethod(obj) {
|
|
1421
1447
|
return obj && typeof obj.ngOnDestroy === 'function';
|
|
1422
1448
|
}
|
|
@@ -1425,8 +1451,8 @@ class FormDirective extends FormGroupDirective {
|
|
|
1425
1451
|
}
|
|
1426
1452
|
}
|
|
1427
1453
|
}
|
|
1428
|
-
FormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1429
|
-
FormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1454
|
+
FormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", 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 });
|
|
1455
|
+
FormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormDirective, 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: [
|
|
1430
1456
|
{
|
|
1431
1457
|
provide: ControlContainer,
|
|
1432
1458
|
// ignore coverage
|
|
@@ -1473,7 +1499,7 @@ __decorate([
|
|
|
1473
1499
|
Required,
|
|
1474
1500
|
__metadata("design:type", Object)
|
|
1475
1501
|
], FormDirective.prototype, "_formDefinition", void 0);
|
|
1476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormDirective, decorators: [{
|
|
1477
1503
|
type: Directive,
|
|
1478
1504
|
args: [{
|
|
1479
1505
|
selector: 'form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]',
|
|
@@ -1632,13 +1658,12 @@ class FormSubmitFailedDirective {
|
|
|
1632
1658
|
})).subscribe();
|
|
1633
1659
|
}
|
|
1634
1660
|
ngOnDestroy() {
|
|
1635
|
-
|
|
1636
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1661
|
+
this.subscription?.unsubscribe();
|
|
1637
1662
|
}
|
|
1638
1663
|
}
|
|
1639
|
-
FormSubmitFailedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1640
|
-
FormSubmitFailedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1641
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1664
|
+
FormSubmitFailedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1665
|
+
FormSubmitFailedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]", ngImport: i0 });
|
|
1666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
|
|
1642
1667
|
type: Directive,
|
|
1643
1668
|
args: [{
|
|
1644
1669
|
selector: '[rxapFormSubmitFailed]'
|
|
@@ -1669,13 +1694,12 @@ class FormLoadingDirective {
|
|
|
1669
1694
|
})).subscribe();
|
|
1670
1695
|
}
|
|
1671
1696
|
ngOnDestroy() {
|
|
1672
|
-
|
|
1673
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1697
|
+
this.subscription?.unsubscribe();
|
|
1674
1698
|
}
|
|
1675
1699
|
}
|
|
1676
|
-
FormLoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1677
|
-
FormLoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1700
|
+
FormLoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1701
|
+
FormLoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormLoadingDirective, selector: "[rxapFormLoading]", ngImport: i0 });
|
|
1702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadingDirective, decorators: [{
|
|
1679
1703
|
type: Directive,
|
|
1680
1704
|
args: [{
|
|
1681
1705
|
selector: '[rxapFormLoading]'
|
|
@@ -1706,13 +1730,12 @@ class FormSubmittingDirective {
|
|
|
1706
1730
|
})).subscribe();
|
|
1707
1731
|
}
|
|
1708
1732
|
ngOnDestroy() {
|
|
1709
|
-
|
|
1710
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1733
|
+
this.subscription?.unsubscribe();
|
|
1711
1734
|
}
|
|
1712
1735
|
}
|
|
1713
|
-
FormSubmittingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1714
|
-
FormSubmittingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1736
|
+
FormSubmittingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1737
|
+
FormSubmittingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]", ngImport: i0 });
|
|
1738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmittingDirective, decorators: [{
|
|
1716
1739
|
type: Directive,
|
|
1717
1740
|
args: [{
|
|
1718
1741
|
selector: '[rxapFormSubmitting]'
|
|
@@ -1743,13 +1766,12 @@ class FormLoadedDirective {
|
|
|
1743
1766
|
})).subscribe();
|
|
1744
1767
|
}
|
|
1745
1768
|
ngOnDestroy() {
|
|
1746
|
-
|
|
1747
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1769
|
+
this.subscription?.unsubscribe();
|
|
1748
1770
|
}
|
|
1749
1771
|
}
|
|
1750
|
-
FormLoadedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1751
|
-
FormLoadedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1752
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1772
|
+
FormLoadedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1773
|
+
FormLoadedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormLoadedDirective, selector: "[rxapFormLoaded]", ngImport: i0 });
|
|
1774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadedDirective, decorators: [{
|
|
1753
1775
|
type: Directive,
|
|
1754
1776
|
args: [{
|
|
1755
1777
|
selector: '[rxapFormLoaded]'
|
|
@@ -1780,13 +1802,12 @@ class FormLoadingErrorDirective {
|
|
|
1780
1802
|
})).subscribe();
|
|
1781
1803
|
}
|
|
1782
1804
|
ngOnDestroy() {
|
|
1783
|
-
|
|
1784
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1805
|
+
this.subscription?.unsubscribe();
|
|
1785
1806
|
}
|
|
1786
1807
|
}
|
|
1787
|
-
FormLoadingErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1788
|
-
FormLoadingErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1789
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1808
|
+
FormLoadingErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1809
|
+
FormLoadingErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormLoadingErrorDirective, selector: "[rxapFormLoadingError]", ngImport: i0 });
|
|
1810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
|
|
1790
1811
|
type: Directive,
|
|
1791
1812
|
args: [{
|
|
1792
1813
|
selector: '[rxapFormLoadingError]'
|
|
@@ -1812,8 +1833,7 @@ class FormControlErrorDirective {
|
|
|
1812
1833
|
this.viewContainerRef = viewContainerRef;
|
|
1813
1834
|
}
|
|
1814
1835
|
ngOnInit() {
|
|
1815
|
-
|
|
1816
|
-
const control = (_a = this.parent.control) === null || _a === void 0 ? void 0 : _a.get(this.name);
|
|
1836
|
+
const control = this.parent.control?.get(this.name);
|
|
1817
1837
|
if (!control) {
|
|
1818
1838
|
throw new Error('Could not extract form control instance');
|
|
1819
1839
|
}
|
|
@@ -1825,12 +1845,11 @@ class FormControlErrorDirective {
|
|
|
1825
1845
|
})).subscribe();
|
|
1826
1846
|
}
|
|
1827
1847
|
ngOnDestroy() {
|
|
1828
|
-
|
|
1829
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1848
|
+
this.subscription?.unsubscribe();
|
|
1830
1849
|
}
|
|
1831
1850
|
}
|
|
1832
|
-
FormControlErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1833
|
-
FormControlErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1851
|
+
FormControlErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlErrorDirective, deps: [{ token: i0.TemplateRef }, { token: i1.ControlContainer, host: true, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1852
|
+
FormControlErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlErrorDirective, selector: "[rxapFormControlError]", inputs: { name: ["rxapFormControlErrorFrom", "name"], errorKey: ["rxapFormControlErrorIf", "errorKey"] }, ngImport: i0 });
|
|
1834
1853
|
__decorate([
|
|
1835
1854
|
Required,
|
|
1836
1855
|
__metadata("design:type", String)
|
|
@@ -1839,7 +1858,7 @@ __decorate([
|
|
|
1839
1858
|
Required,
|
|
1840
1859
|
__metadata("design:type", String)
|
|
1841
1860
|
], FormControlErrorDirective.prototype, "errorKey", void 0);
|
|
1842
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlErrorDirective, decorators: [{
|
|
1843
1862
|
type: Directive,
|
|
1844
1863
|
args: [{
|
|
1845
1864
|
selector: '[rxapFormControlError]'
|
|
@@ -1866,13 +1885,13 @@ class FormControlMarkDirtyDirective {
|
|
|
1866
1885
|
control.markAllAsDirty();
|
|
1867
1886
|
}
|
|
1868
1887
|
else {
|
|
1869
|
-
control
|
|
1888
|
+
control?.markAsDirty();
|
|
1870
1889
|
}
|
|
1871
1890
|
}
|
|
1872
1891
|
}
|
|
1873
|
-
FormControlMarkDirtyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1874
|
-
FormControlMarkDirtyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1875
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1892
|
+
FormControlMarkDirtyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkDirtyDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1893
|
+
FormControlMarkDirtyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlMarkDirtyDirective, selector: "[rxapFormControlMarkDirty]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkDirtyDirective, decorators: [{
|
|
1876
1895
|
type: Directive,
|
|
1877
1896
|
args: [{
|
|
1878
1897
|
selector: '[rxapFormControlMarkDirty]'
|
|
@@ -1887,13 +1906,12 @@ class FormControlMarkTouchedDirective {
|
|
|
1887
1906
|
this.parent = parent;
|
|
1888
1907
|
}
|
|
1889
1908
|
onClick() {
|
|
1890
|
-
|
|
1891
|
-
(_a = this.parent.control) === null || _a === void 0 ? void 0 : _a.markAllAsTouched();
|
|
1909
|
+
this.parent.control?.markAllAsTouched();
|
|
1892
1910
|
}
|
|
1893
1911
|
}
|
|
1894
|
-
FormControlMarkTouchedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1895
|
-
FormControlMarkTouchedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1896
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1912
|
+
FormControlMarkTouchedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkTouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1913
|
+
FormControlMarkTouchedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlMarkTouchedDirective, selector: "[rxapFormControlMarkTouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkTouchedDirective, decorators: [{
|
|
1897
1915
|
type: Directive,
|
|
1898
1916
|
args: [{
|
|
1899
1917
|
selector: '[rxapFormControlMarkTouched]'
|
|
@@ -1913,13 +1931,13 @@ class FormControlMarkUntouchedDirective {
|
|
|
1913
1931
|
control.markAllAsUntouched();
|
|
1914
1932
|
}
|
|
1915
1933
|
else {
|
|
1916
|
-
control
|
|
1934
|
+
control?.markAsUntouched();
|
|
1917
1935
|
}
|
|
1918
1936
|
}
|
|
1919
1937
|
}
|
|
1920
|
-
FormControlMarkUntouchedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1921
|
-
FormControlMarkUntouchedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1922
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1938
|
+
FormControlMarkUntouchedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkUntouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1939
|
+
FormControlMarkUntouchedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlMarkUntouchedDirective, selector: "[rxapFormControlMarkUntouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkUntouchedDirective, decorators: [{
|
|
1923
1941
|
type: Directive,
|
|
1924
1942
|
args: [{
|
|
1925
1943
|
selector: '[rxapFormControlMarkUntouched]'
|
|
@@ -1939,13 +1957,13 @@ class FormControlMarkPristineDirective {
|
|
|
1939
1957
|
control.markAllAsPristine();
|
|
1940
1958
|
}
|
|
1941
1959
|
else {
|
|
1942
|
-
control
|
|
1960
|
+
control?.markAsPristine();
|
|
1943
1961
|
}
|
|
1944
1962
|
}
|
|
1945
1963
|
}
|
|
1946
|
-
FormControlMarkPristineDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1947
|
-
FormControlMarkPristineDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1948
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1964
|
+
FormControlMarkPristineDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkPristineDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1965
|
+
FormControlMarkPristineDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlMarkPristineDirective, selector: "[rxapFormControlMarkPristine]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlMarkPristineDirective, decorators: [{
|
|
1949
1967
|
type: Directive,
|
|
1950
1968
|
args: [{
|
|
1951
1969
|
selector: '[rxapFormControlMarkPristine]'
|
|
@@ -1984,13 +2002,12 @@ class FormSubmitDirective extends ConfirmClick {
|
|
|
1984
2002
|
this.formDirective.onSubmit(new Event('submit'));
|
|
1985
2003
|
}
|
|
1986
2004
|
ngOnDestroy() {
|
|
1987
|
-
|
|
1988
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
2005
|
+
this.subscription?.unsubscribe();
|
|
1989
2006
|
}
|
|
1990
2007
|
}
|
|
1991
|
-
FormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1992
|
-
FormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1993
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2008
|
+
FormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitDirective, deps: [{ token: FormDirective }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2009
|
+
FormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormSubmitDirective, 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 });
|
|
2010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitDirective, decorators: [{
|
|
1994
2011
|
type: Directive,
|
|
1995
2012
|
args: [{
|
|
1996
2013
|
selector: '[rxapFormSubmit]',
|
|
@@ -2036,14 +2053,14 @@ class FormGroupNameDirective extends FormGroupName {
|
|
|
2036
2053
|
return this.formDirective.getFormGroup(this);
|
|
2037
2054
|
}
|
|
2038
2055
|
}
|
|
2039
|
-
FormGroupNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2040
|
-
FormGroupNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2056
|
+
FormGroupNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", 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 });
|
|
2057
|
+
FormGroupNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormGroupNameDirective, selector: "[rxapFormGroupName]", inputs: { name: ["rxapFormGroupName", "name"] }, providers: [
|
|
2041
2058
|
{
|
|
2042
2059
|
provide: ControlContainer,
|
|
2043
2060
|
useExisting: forwardRef(() => FormGroupNameDirective)
|
|
2044
2061
|
}
|
|
2045
2062
|
], exportAs: ["rxapFormGroup"], usesInheritance: true, ngImport: i0 });
|
|
2046
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormGroupNameDirective, decorators: [{
|
|
2047
2064
|
type: Directive,
|
|
2048
2065
|
args: [{
|
|
2049
2066
|
selector: '[rxapFormGroupName]',
|
|
@@ -2089,14 +2106,14 @@ class FormControlNameDirective extends FormControlName {
|
|
|
2089
2106
|
super(parent, validators, asyncValidators, valueAccessors, null);
|
|
2090
2107
|
}
|
|
2091
2108
|
}
|
|
2092
|
-
FormControlNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2093
|
-
FormControlNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2109
|
+
FormControlNameDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", 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 });
|
|
2110
|
+
FormControlNameDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormControlNameDirective, selector: "[rxapFormControlName]", inputs: { name: ["rxapFormControlName", "name"] }, providers: [
|
|
2094
2111
|
{
|
|
2095
2112
|
provide: NgControl,
|
|
2096
2113
|
useExisting: forwardRef(() => FormControlNameDirective)
|
|
2097
2114
|
}
|
|
2098
2115
|
], exportAs: ["rxapFormControl"], usesInheritance: true, ngImport: i0 });
|
|
2099
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormControlNameDirective, decorators: [{
|
|
2100
2117
|
type: Directive,
|
|
2101
2118
|
args: [{
|
|
2102
2119
|
selector: '[rxapFormControlName]',
|
|
@@ -2140,14 +2157,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImpor
|
|
|
2140
2157
|
|
|
2141
2158
|
class ParentControlContainerDirective {
|
|
2142
2159
|
}
|
|
2143
|
-
ParentControlContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2144
|
-
ParentControlContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2160
|
+
ParentControlContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2161
|
+
ParentControlContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ParentControlContainerDirective, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
|
|
2145
2162
|
{
|
|
2146
2163
|
provide: ControlContainer,
|
|
2147
2164
|
useExisting: ControlContainer
|
|
2148
2165
|
}
|
|
2149
2166
|
], ngImport: i0 });
|
|
2150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
|
|
2151
2168
|
type: Directive,
|
|
2152
2169
|
args: [{
|
|
2153
2170
|
selector: '[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]',
|
|
@@ -2173,13 +2190,12 @@ class FormSubmitSuccessfulDirective {
|
|
|
2173
2190
|
})).subscribe();
|
|
2174
2191
|
}
|
|
2175
2192
|
ngOnDestroy() {
|
|
2176
|
-
|
|
2177
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
2193
|
+
this.subscription?.unsubscribe();
|
|
2178
2194
|
}
|
|
2179
2195
|
}
|
|
2180
|
-
FormSubmitSuccessfulDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2181
|
-
FormSubmitSuccessfulDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2196
|
+
FormSubmitSuccessfulDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2197
|
+
FormSubmitSuccessfulDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormSubmitSuccessfulDirective, selector: "[rxapFormSubmitSuccessful]", ngImport: i0 });
|
|
2198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitSuccessfulDirective, decorators: [{
|
|
2183
2199
|
type: Directive,
|
|
2184
2200
|
args: [{
|
|
2185
2201
|
selector: '[rxapFormSubmitSuccessful]'
|
|
@@ -2208,13 +2224,12 @@ class FormSubmitInvalidDirective {
|
|
|
2208
2224
|
})).subscribe();
|
|
2209
2225
|
}
|
|
2210
2226
|
ngOnDestroy() {
|
|
2211
|
-
|
|
2212
|
-
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
2227
|
+
this.subscription?.unsubscribe();
|
|
2213
2228
|
}
|
|
2214
2229
|
}
|
|
2215
|
-
FormSubmitInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2216
|
-
FormSubmitInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2230
|
+
FormSubmitInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2231
|
+
FormSubmitInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FormSubmitInvalidDirective, selector: "[rxapFormSubmitInvalid]", ngImport: i0 });
|
|
2232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormSubmitInvalidDirective, decorators: [{
|
|
2218
2233
|
type: Directive,
|
|
2219
2234
|
args: [{
|
|
2220
2235
|
selector: '[rxapFormSubmitInvalid]'
|
|
@@ -2232,8 +2247,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImpor
|
|
|
2232
2247
|
|
|
2233
2248
|
class RxapFormsModule {
|
|
2234
2249
|
}
|
|
2235
|
-
RxapFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2236
|
-
RxapFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
2250
|
+
RxapFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RxapFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2251
|
+
RxapFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RxapFormsModule, declarations: [FormDirective,
|
|
2237
2252
|
FormSubmitFailedDirective,
|
|
2238
2253
|
FormLoadingDirective,
|
|
2239
2254
|
FormSubmittingDirective,
|
|
@@ -2266,8 +2281,8 @@ RxapFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
2266
2281
|
ParentControlContainerDirective,
|
|
2267
2282
|
FormSubmitSuccessfulDirective,
|
|
2268
2283
|
FormSubmitInvalidDirective] });
|
|
2269
|
-
RxapFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2284
|
+
RxapFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RxapFormsModule });
|
|
2285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RxapFormsModule, decorators: [{
|
|
2271
2286
|
type: NgModule,
|
|
2272
2287
|
args: [{
|
|
2273
2288
|
declarations: [
|
|
@@ -2327,15 +2342,14 @@ function ToFormSubmitMethod(call) {
|
|
|
2327
2342
|
* Checks if a given value is a number.
|
|
2328
2343
|
*/
|
|
2329
2344
|
function isNumber(value, options = {}) {
|
|
2330
|
-
var _a, _b;
|
|
2331
2345
|
if (typeof value !== 'number') {
|
|
2332
2346
|
return false;
|
|
2333
2347
|
}
|
|
2334
2348
|
if (value === Infinity || value === -Infinity) {
|
|
2335
|
-
return
|
|
2349
|
+
return options.allowInfinity ?? false;
|
|
2336
2350
|
}
|
|
2337
2351
|
if (Number.isNaN(value)) {
|
|
2338
|
-
return
|
|
2352
|
+
return options.allowNaN ?? false;
|
|
2339
2353
|
}
|
|
2340
2354
|
if (options.maxDecimalPlaces !== undefined) {
|
|
2341
2355
|
let decimalPlaces = 0;
|
|
@@ -2367,7 +2381,7 @@ function _IsNumber({ message, options } = {}) {
|
|
|
2367
2381
|
if (control.value === null) {
|
|
2368
2382
|
return null;
|
|
2369
2383
|
}
|
|
2370
|
-
if (!isNumber(!
|
|
2384
|
+
if (!isNumber(!options?.strict && typeof control.value === 'string' ? Number(control.value) : control.value, options)) {
|
|
2371
2385
|
return {
|
|
2372
2386
|
isNumber: {
|
|
2373
2387
|
expected: 'A number value',
|
|
@@ -2653,7 +2667,7 @@ function IsIP({ message, version } = {}) {
|
|
|
2653
2667
|
if (!(typeof control.value === 'string' && isIP(control.value, version))) {
|
|
2654
2668
|
return {
|
|
2655
2669
|
isIp: {
|
|
2656
|
-
expected: `A valid IPv${version
|
|
2670
|
+
expected: `A valid IPv${version ?? '4'} value`,
|
|
2657
2671
|
actual: control.value,
|
|
2658
2672
|
message
|
|
2659
2673
|
}
|
|
@@ -2686,4 +2700,4 @@ const RxapValidators = {
|
|
|
2686
2700
|
*/
|
|
2687
2701
|
|
|
2688
2702
|
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, IsDate, IsEnum, IsInt, IsNumber, IsObject, IsString, 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 };
|
|
2689
|
-
//# sourceMappingURL=rxap-forms.
|
|
2703
|
+
//# sourceMappingURL=rxap-forms.mjs.map
|