@angular/forms 19.0.0-next.9 → 19.0.0-rc.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/fesm2022/forms.mjs +778 -447
- package/fesm2022/forms.mjs.map +1 -1
- package/index.d.ts +4 -4
- package/package.json +4 -4
package/fesm2022/forms.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.0.0-
|
|
2
|
+
* @license Angular v19.0.0-rc.1
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { Directive, InjectionToken, forwardRef, Optional, Inject, ɵisPromise, ɵisSubscribable, ɵRuntimeError, Self, computed, signal,
|
|
8
|
+
import { Directive, InjectionToken, forwardRef, Optional, Inject, ɵisPromise, ɵisSubscribable, ɵRuntimeError, Self, untracked, computed, signal, EventEmitter, Input, Host, SkipSelf, booleanAttribute, ChangeDetectorRef, Output, Injectable, inject, NgModule, Version } from '@angular/core';
|
|
9
9
|
import { ɵgetDOM } from '@angular/common';
|
|
10
10
|
import { from, forkJoin, Subject } from 'rxjs';
|
|
11
11
|
import { map } from 'rxjs/operators';
|
|
@@ -18,20 +18,22 @@ import { map } from 'rxjs/operators';
|
|
|
18
18
|
* applications code.
|
|
19
19
|
*/
|
|
20
20
|
class BaseControlValueAccessor {
|
|
21
|
+
_renderer;
|
|
22
|
+
_elementRef;
|
|
23
|
+
/**
|
|
24
|
+
* The registered callback function called when a change or input event occurs on the input
|
|
25
|
+
* element.
|
|
26
|
+
* @nodoc
|
|
27
|
+
*/
|
|
28
|
+
onChange = (_) => { };
|
|
29
|
+
/**
|
|
30
|
+
* The registered callback function called when a blur event occurs on the input element.
|
|
31
|
+
* @nodoc
|
|
32
|
+
*/
|
|
33
|
+
onTouched = () => { };
|
|
21
34
|
constructor(_renderer, _elementRef) {
|
|
22
35
|
this._renderer = _renderer;
|
|
23
36
|
this._elementRef = _elementRef;
|
|
24
|
-
/**
|
|
25
|
-
* The registered callback function called when a change or input event occurs on the input
|
|
26
|
-
* element.
|
|
27
|
-
* @nodoc
|
|
28
|
-
*/
|
|
29
|
-
this.onChange = (_) => { };
|
|
30
|
-
/**
|
|
31
|
-
* The registered callback function called when a blur event occurs on the input element.
|
|
32
|
-
* @nodoc
|
|
33
|
-
*/
|
|
34
|
-
this.onTouched = () => { };
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* Helper method that sets a property on a target element using the current Renderer
|
|
@@ -62,10 +64,10 @@ class BaseControlValueAccessor {
|
|
|
62
64
|
setDisabledState(isDisabled) {
|
|
63
65
|
this.setProperty('disabled', isDisabled);
|
|
64
66
|
}
|
|
65
|
-
static
|
|
66
|
-
static
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: BaseControlValueAccessor, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
68
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: BaseControlValueAccessor, isStandalone: true, ngImport: i0 });
|
|
67
69
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: BaseControlValueAccessor, decorators: [{
|
|
69
71
|
type: Directive
|
|
70
72
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }] });
|
|
71
73
|
/**
|
|
@@ -78,10 +80,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
78
80
|
* applications code.
|
|
79
81
|
*/
|
|
80
82
|
class BuiltInControlValueAccessor extends BaseControlValueAccessor {
|
|
81
|
-
static
|
|
82
|
-
static
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: BuiltInControlValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
84
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: BuiltInControlValueAccessor, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
83
85
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: BuiltInControlValueAccessor, decorators: [{
|
|
85
87
|
type: Directive
|
|
86
88
|
}] });
|
|
87
89
|
/**
|
|
@@ -129,15 +131,16 @@ class CheckboxControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
129
131
|
writeValue(value) {
|
|
130
132
|
this.setProperty('checked', value);
|
|
131
133
|
}
|
|
132
|
-
static
|
|
133
|
-
static
|
|
134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CheckboxControlValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
135
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: CheckboxControlValueAccessor, isStandalone: false, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]", host: { listeners: { "change": "onChange($event.target.checked)", "blur": "onTouched()" } }, providers: [CHECKBOX_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
134
136
|
}
|
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CheckboxControlValueAccessor, decorators: [{
|
|
136
138
|
type: Directive,
|
|
137
139
|
args: [{
|
|
138
140
|
selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',
|
|
139
141
|
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
140
142
|
providers: [CHECKBOX_VALUE_ACCESSOR],
|
|
143
|
+
standalone: false,
|
|
141
144
|
}]
|
|
142
145
|
}] });
|
|
143
146
|
|
|
@@ -196,11 +199,12 @@ const COMPOSITION_BUFFER_MODE = new InjectionToken(ngDevMode ? 'CompositionEvent
|
|
|
196
199
|
* @publicApi
|
|
197
200
|
*/
|
|
198
201
|
class DefaultValueAccessor extends BaseControlValueAccessor {
|
|
202
|
+
_compositionMode;
|
|
203
|
+
/** Whether the user is creating a composition string (IME events). */
|
|
204
|
+
_composing = false;
|
|
199
205
|
constructor(renderer, elementRef, _compositionMode) {
|
|
200
206
|
super(renderer, elementRef);
|
|
201
207
|
this._compositionMode = _compositionMode;
|
|
202
|
-
/** Whether the user is creating a composition string (IME events). */
|
|
203
|
-
this._composing = false;
|
|
204
208
|
if (this._compositionMode == null) {
|
|
205
209
|
this._compositionMode = !_isAndroid();
|
|
206
210
|
}
|
|
@@ -228,10 +232,10 @@ class DefaultValueAccessor extends BaseControlValueAccessor {
|
|
|
228
232
|
this._composing = false;
|
|
229
233
|
this._compositionMode && this.onChange(value);
|
|
230
234
|
}
|
|
231
|
-
static
|
|
232
|
-
static
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: DefaultValueAccessor, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: COMPOSITION_BUFFER_MODE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
236
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: DefaultValueAccessor, isStandalone: false, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]", host: { listeners: { "input": "$any(this)._handleInput($event.target.value)", "blur": "onTouched()", "compositionstart": "$any(this)._compositionStart()", "compositionend": "$any(this)._compositionEnd($event.target.value)" } }, providers: [DEFAULT_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
233
237
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: DefaultValueAccessor, decorators: [{
|
|
235
239
|
type: Directive,
|
|
236
240
|
args: [{
|
|
237
241
|
selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',
|
|
@@ -245,6 +249,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
245
249
|
'(compositionend)': '$any(this)._compositionEnd($event.target.value)',
|
|
246
250
|
},
|
|
247
251
|
providers: [DEFAULT_VALUE_ACCESSOR],
|
|
252
|
+
standalone: false,
|
|
248
253
|
}]
|
|
249
254
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
250
255
|
type: Optional
|
|
@@ -932,23 +937,6 @@ function removeValidators(validators, currentValidators) {
|
|
|
932
937
|
* @publicApi
|
|
933
938
|
*/
|
|
934
939
|
class AbstractControlDirective {
|
|
935
|
-
constructor() {
|
|
936
|
-
/**
|
|
937
|
-
* Set of synchronous validators as they were provided while calling `setValidators` function.
|
|
938
|
-
* @internal
|
|
939
|
-
*/
|
|
940
|
-
this._rawValidators = [];
|
|
941
|
-
/**
|
|
942
|
-
* Set of asynchronous validators as they were provided while calling `setAsyncValidators`
|
|
943
|
-
* function.
|
|
944
|
-
* @internal
|
|
945
|
-
*/
|
|
946
|
-
this._rawAsyncValidators = [];
|
|
947
|
-
/*
|
|
948
|
-
* The set of callbacks to be invoked when directive instance is being destroyed.
|
|
949
|
-
*/
|
|
950
|
-
this._onDestroyCallbacks = [];
|
|
951
|
-
}
|
|
952
940
|
/**
|
|
953
941
|
* @description
|
|
954
942
|
* Reports the value of the control if it is present, otherwise null.
|
|
@@ -1072,6 +1060,27 @@ class AbstractControlDirective {
|
|
|
1072
1060
|
get path() {
|
|
1073
1061
|
return null;
|
|
1074
1062
|
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Contains the result of merging synchronous validators into a single validator function
|
|
1065
|
+
* (combined using `Validators.compose`).
|
|
1066
|
+
*/
|
|
1067
|
+
_composedValidatorFn;
|
|
1068
|
+
/**
|
|
1069
|
+
* Contains the result of merging asynchronous validators into a single validator function
|
|
1070
|
+
* (combined using `Validators.composeAsync`).
|
|
1071
|
+
*/
|
|
1072
|
+
_composedAsyncValidatorFn;
|
|
1073
|
+
/**
|
|
1074
|
+
* Set of synchronous validators as they were provided while calling `setValidators` function.
|
|
1075
|
+
* @internal
|
|
1076
|
+
*/
|
|
1077
|
+
_rawValidators = [];
|
|
1078
|
+
/**
|
|
1079
|
+
* Set of asynchronous validators as they were provided while calling `setAsyncValidators`
|
|
1080
|
+
* function.
|
|
1081
|
+
* @internal
|
|
1082
|
+
*/
|
|
1083
|
+
_rawAsyncValidators = [];
|
|
1075
1084
|
/**
|
|
1076
1085
|
* Sets synchronous validators for this directive.
|
|
1077
1086
|
* @internal
|
|
@@ -1104,6 +1113,10 @@ class AbstractControlDirective {
|
|
|
1104
1113
|
get asyncValidator() {
|
|
1105
1114
|
return this._composedAsyncValidatorFn || null;
|
|
1106
1115
|
}
|
|
1116
|
+
/*
|
|
1117
|
+
* The set of callbacks to be invoked when directive instance is being destroyed.
|
|
1118
|
+
*/
|
|
1119
|
+
_onDestroyCallbacks = [];
|
|
1107
1120
|
/**
|
|
1108
1121
|
* Internal function to register callbacks that should be invoked
|
|
1109
1122
|
* when directive instance is being destroyed.
|
|
@@ -1202,6 +1215,12 @@ class AbstractControlDirective {
|
|
|
1202
1215
|
* @publicApi
|
|
1203
1216
|
*/
|
|
1204
1217
|
class ControlContainer extends AbstractControlDirective {
|
|
1218
|
+
/**
|
|
1219
|
+
* @description
|
|
1220
|
+
* The name for the control
|
|
1221
|
+
*/
|
|
1222
|
+
// TODO(issue/24571): remove '!'.
|
|
1223
|
+
name;
|
|
1205
1224
|
/**
|
|
1206
1225
|
* @description
|
|
1207
1226
|
* The top-level form directive for the control.
|
|
@@ -1226,26 +1245,23 @@ class ControlContainer extends AbstractControlDirective {
|
|
|
1226
1245
|
* @publicApi
|
|
1227
1246
|
*/
|
|
1228
1247
|
class NgControl extends AbstractControlDirective {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
*/
|
|
1247
|
-
this.valueAccessor = null;
|
|
1248
|
-
}
|
|
1248
|
+
/**
|
|
1249
|
+
* @description
|
|
1250
|
+
* The parent form for the control.
|
|
1251
|
+
*
|
|
1252
|
+
* @internal
|
|
1253
|
+
*/
|
|
1254
|
+
_parent = null;
|
|
1255
|
+
/**
|
|
1256
|
+
* @description
|
|
1257
|
+
* The name for the control
|
|
1258
|
+
*/
|
|
1259
|
+
name = null;
|
|
1260
|
+
/**
|
|
1261
|
+
* @description
|
|
1262
|
+
* The value accessor for the control
|
|
1263
|
+
*/
|
|
1264
|
+
valueAccessor = null;
|
|
1249
1265
|
}
|
|
1250
1266
|
|
|
1251
1267
|
// DO NOT REFACTOR!
|
|
@@ -1253,6 +1269,7 @@ class NgControl extends AbstractControlDirective {
|
|
|
1253
1269
|
// advanced Closure Compiler optimizations related to property renaming
|
|
1254
1270
|
// can work correctly.
|
|
1255
1271
|
class AbstractControlStatus {
|
|
1272
|
+
_cd;
|
|
1256
1273
|
constructor(cd) {
|
|
1257
1274
|
this._cd = cd;
|
|
1258
1275
|
}
|
|
@@ -1334,12 +1351,16 @@ class NgControlStatus extends AbstractControlStatus {
|
|
|
1334
1351
|
constructor(cd) {
|
|
1335
1352
|
super(cd);
|
|
1336
1353
|
}
|
|
1337
|
-
static
|
|
1338
|
-
static
|
|
1354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgControlStatus, deps: [{ token: NgControl, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1355
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgControlStatus, isStandalone: false, selector: "[formControlName],[ngModel],[formControl]", host: { properties: { "class.ng-untouched": "isUntouched", "class.ng-touched": "isTouched", "class.ng-pristine": "isPristine", "class.ng-dirty": "isDirty", "class.ng-valid": "isValid", "class.ng-invalid": "isInvalid", "class.ng-pending": "isPending" } }, usesInheritance: true, ngImport: i0 });
|
|
1339
1356
|
}
|
|
1340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
1357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgControlStatus, decorators: [{
|
|
1341
1358
|
type: Directive,
|
|
1342
|
-
args: [{
|
|
1359
|
+
args: [{
|
|
1360
|
+
selector: '[formControlName],[ngModel],[formControl]',
|
|
1361
|
+
host: ngControlStatusHost,
|
|
1362
|
+
standalone: false,
|
|
1363
|
+
}]
|
|
1343
1364
|
}], ctorParameters: () => [{ type: NgControl, decorators: [{
|
|
1344
1365
|
type: Self
|
|
1345
1366
|
}] }] });
|
|
@@ -1359,14 +1380,15 @@ class NgControlStatusGroup extends AbstractControlStatus {
|
|
|
1359
1380
|
constructor(cd) {
|
|
1360
1381
|
super(cd);
|
|
1361
1382
|
}
|
|
1362
|
-
static
|
|
1363
|
-
static
|
|
1383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgControlStatusGroup, deps: [{ token: ControlContainer, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1384
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgControlStatusGroup, isStandalone: false, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]", host: { properties: { "class.ng-untouched": "isUntouched", "class.ng-touched": "isTouched", "class.ng-pristine": "isPristine", "class.ng-dirty": "isDirty", "class.ng-valid": "isValid", "class.ng-invalid": "isInvalid", "class.ng-pending": "isPending", "class.ng-submitted": "isSubmitted" } }, usesInheritance: true, ngImport: i0 });
|
|
1364
1385
|
}
|
|
1365
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
1386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgControlStatusGroup, decorators: [{
|
|
1366
1387
|
type: Directive,
|
|
1367
1388
|
args: [{
|
|
1368
1389
|
selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',
|
|
1369
1390
|
host: ngGroupStatusHost,
|
|
1391
|
+
standalone: false,
|
|
1370
1392
|
}]
|
|
1371
1393
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
1372
1394
|
type: Optional
|
|
@@ -1575,6 +1597,8 @@ class ControlEvent {
|
|
|
1575
1597
|
* @publicApi
|
|
1576
1598
|
*/
|
|
1577
1599
|
class ValueChangeEvent extends ControlEvent {
|
|
1600
|
+
value;
|
|
1601
|
+
source;
|
|
1578
1602
|
constructor(value, source) {
|
|
1579
1603
|
super();
|
|
1580
1604
|
this.value = value;
|
|
@@ -1586,6 +1610,8 @@ class ValueChangeEvent extends ControlEvent {
|
|
|
1586
1610
|
*
|
|
1587
1611
|
* @publicApi */
|
|
1588
1612
|
class PristineChangeEvent extends ControlEvent {
|
|
1613
|
+
pristine;
|
|
1614
|
+
source;
|
|
1589
1615
|
constructor(pristine, source) {
|
|
1590
1616
|
super();
|
|
1591
1617
|
this.pristine = pristine;
|
|
@@ -1598,6 +1624,8 @@ class PristineChangeEvent extends ControlEvent {
|
|
|
1598
1624
|
* @publicApi
|
|
1599
1625
|
*/
|
|
1600
1626
|
class TouchedChangeEvent extends ControlEvent {
|
|
1627
|
+
touched;
|
|
1628
|
+
source;
|
|
1601
1629
|
constructor(touched, source) {
|
|
1602
1630
|
super();
|
|
1603
1631
|
this.touched = touched;
|
|
@@ -1610,6 +1638,8 @@ class TouchedChangeEvent extends ControlEvent {
|
|
|
1610
1638
|
* @publicApi
|
|
1611
1639
|
*/
|
|
1612
1640
|
class StatusChangeEvent extends ControlEvent {
|
|
1641
|
+
status;
|
|
1642
|
+
source;
|
|
1613
1643
|
constructor(status, source) {
|
|
1614
1644
|
super();
|
|
1615
1645
|
this.status = status;
|
|
@@ -1622,6 +1652,7 @@ class StatusChangeEvent extends ControlEvent {
|
|
|
1622
1652
|
* @publicApi
|
|
1623
1653
|
*/
|
|
1624
1654
|
class FormSubmittedEvent extends ControlEvent {
|
|
1655
|
+
source;
|
|
1625
1656
|
constructor(source) {
|
|
1626
1657
|
super();
|
|
1627
1658
|
this.source = source;
|
|
@@ -1633,6 +1664,7 @@ class FormSubmittedEvent extends ControlEvent {
|
|
|
1633
1664
|
* @publicApi
|
|
1634
1665
|
*/
|
|
1635
1666
|
class FormResetEvent extends ControlEvent {
|
|
1667
|
+
source;
|
|
1636
1668
|
constructor(source) {
|
|
1637
1669
|
super();
|
|
1638
1670
|
this.source = source;
|
|
@@ -1709,6 +1741,68 @@ function assertAllValuesPresent(control, isGroup, value) {
|
|
|
1709
1741
|
* @publicApi
|
|
1710
1742
|
*/
|
|
1711
1743
|
class AbstractControl {
|
|
1744
|
+
/** @internal */
|
|
1745
|
+
_pendingDirty = false;
|
|
1746
|
+
/**
|
|
1747
|
+
* Indicates that a control has its own pending asynchronous validation in progress.
|
|
1748
|
+
* It also stores if the control should emit events when the validation status changes.
|
|
1749
|
+
*
|
|
1750
|
+
* @internal
|
|
1751
|
+
*/
|
|
1752
|
+
_hasOwnPendingAsyncValidator = null;
|
|
1753
|
+
/** @internal */
|
|
1754
|
+
_pendingTouched = false;
|
|
1755
|
+
/** @internal */
|
|
1756
|
+
_onCollectionChange = () => { };
|
|
1757
|
+
/** @internal */
|
|
1758
|
+
_updateOn;
|
|
1759
|
+
_parent = null;
|
|
1760
|
+
_asyncValidationSubscription;
|
|
1761
|
+
/**
|
|
1762
|
+
* Contains the result of merging synchronous validators into a single validator function
|
|
1763
|
+
* (combined using `Validators.compose`).
|
|
1764
|
+
*
|
|
1765
|
+
* @internal
|
|
1766
|
+
*/
|
|
1767
|
+
_composedValidatorFn;
|
|
1768
|
+
/**
|
|
1769
|
+
* Contains the result of merging asynchronous validators into a single validator function
|
|
1770
|
+
* (combined using `Validators.composeAsync`).
|
|
1771
|
+
*
|
|
1772
|
+
* @internal
|
|
1773
|
+
*/
|
|
1774
|
+
_composedAsyncValidatorFn;
|
|
1775
|
+
/**
|
|
1776
|
+
* Synchronous validators as they were provided:
|
|
1777
|
+
* - in `AbstractControl` constructor
|
|
1778
|
+
* - as an argument while calling `setValidators` function
|
|
1779
|
+
* - while calling the setter on the `validator` field (e.g. `control.validator = validatorFn`)
|
|
1780
|
+
*
|
|
1781
|
+
* @internal
|
|
1782
|
+
*/
|
|
1783
|
+
_rawValidators;
|
|
1784
|
+
/**
|
|
1785
|
+
* Asynchronous validators as they were provided:
|
|
1786
|
+
* - in `AbstractControl` constructor
|
|
1787
|
+
* - as an argument while calling `setAsyncValidators` function
|
|
1788
|
+
* - while calling the setter on the `asyncValidator` field (e.g. `control.asyncValidator =
|
|
1789
|
+
* asyncValidatorFn`)
|
|
1790
|
+
*
|
|
1791
|
+
* @internal
|
|
1792
|
+
*/
|
|
1793
|
+
_rawAsyncValidators;
|
|
1794
|
+
/**
|
|
1795
|
+
* The current value of the control.
|
|
1796
|
+
*
|
|
1797
|
+
* * For a `FormControl`, the current value.
|
|
1798
|
+
* * For an enabled `FormGroup`, the values of enabled controls as an object
|
|
1799
|
+
* with a key-value pair for each member of the group.
|
|
1800
|
+
* * For a disabled `FormGroup`, the values of all controls as an object
|
|
1801
|
+
* with a key-value pair for each member of the group.
|
|
1802
|
+
* * For a `FormArray`, the values of enabled controls as an array.
|
|
1803
|
+
*
|
|
1804
|
+
*/
|
|
1805
|
+
value;
|
|
1712
1806
|
/**
|
|
1713
1807
|
* Initialize the AbstractControl instance.
|
|
1714
1808
|
*
|
|
@@ -1718,50 +1812,6 @@ class AbstractControl {
|
|
|
1718
1812
|
* this control asynchronously.
|
|
1719
1813
|
*/
|
|
1720
1814
|
constructor(validators, asyncValidators) {
|
|
1721
|
-
/** @internal */
|
|
1722
|
-
this._pendingDirty = false;
|
|
1723
|
-
/**
|
|
1724
|
-
* Indicates that a control has its own pending asynchronous validation in progress.
|
|
1725
|
-
* It also stores if the control should emit events when the validation status changes.
|
|
1726
|
-
*
|
|
1727
|
-
* @internal
|
|
1728
|
-
*/
|
|
1729
|
-
this._hasOwnPendingAsyncValidator = null;
|
|
1730
|
-
/** @internal */
|
|
1731
|
-
this._pendingTouched = false;
|
|
1732
|
-
/** @internal */
|
|
1733
|
-
this._onCollectionChange = () => { };
|
|
1734
|
-
this._parent = null;
|
|
1735
|
-
/** @internal */
|
|
1736
|
-
this._status = computed(() => this.statusReactive());
|
|
1737
|
-
this.statusReactive = signal(undefined);
|
|
1738
|
-
/** @internal */
|
|
1739
|
-
this._pristine = computed(() => this.pristineReactive());
|
|
1740
|
-
this.pristineReactive = signal(true);
|
|
1741
|
-
/** @internal */
|
|
1742
|
-
this._touched = computed(() => this.touchedReactive());
|
|
1743
|
-
this.touchedReactive = signal(false);
|
|
1744
|
-
/**
|
|
1745
|
-
* Exposed as observable, see below.
|
|
1746
|
-
*
|
|
1747
|
-
* @internal
|
|
1748
|
-
*/
|
|
1749
|
-
this._events = new Subject();
|
|
1750
|
-
/**
|
|
1751
|
-
* A multicasting observable that emits an event every time the state of the control changes.
|
|
1752
|
-
* It emits for value, status, pristine or touched changes.
|
|
1753
|
-
*
|
|
1754
|
-
* **Note**: On value change, the emit happens right after a value of this control is updated. The
|
|
1755
|
-
* value of a parent control (for example if this FormControl is a part of a FormGroup) is updated
|
|
1756
|
-
* later, so accessing a value of a parent control (using the `value` property) from the callback
|
|
1757
|
-
* of this event might result in getting a value that has not been updated yet. Subscribe to the
|
|
1758
|
-
* `events` of the parent control instead.
|
|
1759
|
-
* For other event types, the events are emitted after the parent control has been updated.
|
|
1760
|
-
*
|
|
1761
|
-
*/
|
|
1762
|
-
this.events = this._events.asObservable();
|
|
1763
|
-
/** @internal */
|
|
1764
|
-
this._onDisabledChange = [];
|
|
1765
1815
|
this._assignValidators(validators);
|
|
1766
1816
|
this._assignAsyncValidators(asyncValidators);
|
|
1767
1817
|
}
|
|
@@ -1807,6 +1857,9 @@ class AbstractControl {
|
|
|
1807
1857
|
set status(v) {
|
|
1808
1858
|
untracked(() => this.statusReactive.set(v));
|
|
1809
1859
|
}
|
|
1860
|
+
/** @internal */
|
|
1861
|
+
_status = computed(() => this.statusReactive());
|
|
1862
|
+
statusReactive = signal(undefined);
|
|
1810
1863
|
/**
|
|
1811
1864
|
* A control is `valid` when its `status` is `VALID`.
|
|
1812
1865
|
*
|
|
@@ -1866,6 +1919,11 @@ class AbstractControl {
|
|
|
1866
1919
|
get enabled() {
|
|
1867
1920
|
return this.status !== DISABLED;
|
|
1868
1921
|
}
|
|
1922
|
+
/**
|
|
1923
|
+
* An object containing any errors generated by failing validation,
|
|
1924
|
+
* or null if there are no errors.
|
|
1925
|
+
*/
|
|
1926
|
+
errors;
|
|
1869
1927
|
/**
|
|
1870
1928
|
* A control is `pristine` if the user has not yet changed
|
|
1871
1929
|
* the value in the UI.
|
|
@@ -1879,6 +1937,9 @@ class AbstractControl {
|
|
|
1879
1937
|
set pristine(v) {
|
|
1880
1938
|
untracked(() => this.pristineReactive.set(v));
|
|
1881
1939
|
}
|
|
1940
|
+
/** @internal */
|
|
1941
|
+
_pristine = computed(() => this.pristineReactive());
|
|
1942
|
+
pristineReactive = signal(true);
|
|
1882
1943
|
/**
|
|
1883
1944
|
* A control is `dirty` if the user has changed the value
|
|
1884
1945
|
* in the UI.
|
|
@@ -1901,6 +1962,9 @@ class AbstractControl {
|
|
|
1901
1962
|
set touched(v) {
|
|
1902
1963
|
untracked(() => this.touchedReactive.set(v));
|
|
1903
1964
|
}
|
|
1965
|
+
/** @internal */
|
|
1966
|
+
_touched = computed(() => this.touchedReactive());
|
|
1967
|
+
touchedReactive = signal(false);
|
|
1904
1968
|
/**
|
|
1905
1969
|
* True if the control has not been marked as touched
|
|
1906
1970
|
*
|
|
@@ -1910,6 +1974,49 @@ class AbstractControl {
|
|
|
1910
1974
|
get untouched() {
|
|
1911
1975
|
return !this.touched;
|
|
1912
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Exposed as observable, see below.
|
|
1979
|
+
*
|
|
1980
|
+
* @internal
|
|
1981
|
+
*/
|
|
1982
|
+
_events = new Subject();
|
|
1983
|
+
/**
|
|
1984
|
+
* A multicasting observable that emits an event every time the state of the control changes.
|
|
1985
|
+
* It emits for value, status, pristine or touched changes.
|
|
1986
|
+
*
|
|
1987
|
+
* **Note**: On value change, the emit happens right after a value of this control is updated. The
|
|
1988
|
+
* value of a parent control (for example if this FormControl is a part of a FormGroup) is updated
|
|
1989
|
+
* later, so accessing a value of a parent control (using the `value` property) from the callback
|
|
1990
|
+
* of this event might result in getting a value that has not been updated yet. Subscribe to the
|
|
1991
|
+
* `events` of the parent control instead.
|
|
1992
|
+
* For other event types, the events are emitted after the parent control has been updated.
|
|
1993
|
+
*
|
|
1994
|
+
*/
|
|
1995
|
+
events = this._events.asObservable();
|
|
1996
|
+
/**
|
|
1997
|
+
* A multicasting observable that emits an event every time the value of the control changes, in
|
|
1998
|
+
* the UI or programmatically. It also emits an event each time you call enable() or disable()
|
|
1999
|
+
* without passing along {emitEvent: false} as a function argument.
|
|
2000
|
+
*
|
|
2001
|
+
* **Note**: the emit happens right after a value of this control is updated. The value of a
|
|
2002
|
+
* parent control (for example if this FormControl is a part of a FormGroup) is updated later, so
|
|
2003
|
+
* accessing a value of a parent control (using the `value` property) from the callback of this
|
|
2004
|
+
* event might result in getting a value that has not been updated yet. Subscribe to the
|
|
2005
|
+
* `valueChanges` event of the parent control instead.
|
|
2006
|
+
*
|
|
2007
|
+
* TODO: this should be piped from events() but is breaking in G3
|
|
2008
|
+
*/
|
|
2009
|
+
valueChanges;
|
|
2010
|
+
/**
|
|
2011
|
+
* A multicasting observable that emits an event every time the validation `status` of the control
|
|
2012
|
+
* recalculates.
|
|
2013
|
+
*
|
|
2014
|
+
* @see {@link FormControlStatus}
|
|
2015
|
+
* @see {@link AbstractControl.status}
|
|
2016
|
+
*
|
|
2017
|
+
* TODO: this should be piped from events() but is breaking in G3
|
|
2018
|
+
*/
|
|
2019
|
+
statusChanges;
|
|
1913
2020
|
/**
|
|
1914
2021
|
* Reports the update strategy of the `AbstractControl` (meaning
|
|
1915
2022
|
* the event on which the control updates itself).
|
|
@@ -2473,6 +2580,8 @@ class AbstractControl {
|
|
|
2473
2580
|
}
|
|
2474
2581
|
}
|
|
2475
2582
|
/** @internal */
|
|
2583
|
+
_onDisabledChange = [];
|
|
2584
|
+
/** @internal */
|
|
2476
2585
|
_registerOnCollectionChange(fn) {
|
|
2477
2586
|
this._onCollectionChange = fn;
|
|
2478
2587
|
}
|
|
@@ -2657,6 +2766,7 @@ class FormGroup extends AbstractControl {
|
|
|
2657
2766
|
emitEvent: !!this.asyncValidator,
|
|
2658
2767
|
});
|
|
2659
2768
|
}
|
|
2769
|
+
controls;
|
|
2660
2770
|
registerControl(name, control) {
|
|
2661
2771
|
if (this.controls[name])
|
|
2662
2772
|
return this.controls[name];
|
|
@@ -3405,6 +3515,7 @@ const resolvedPromise$1 = (() => Promise.resolve())();
|
|
|
3405
3515
|
* @publicApi
|
|
3406
3516
|
*/
|
|
3407
3517
|
class NgForm extends ControlContainer {
|
|
3518
|
+
callSetDisabledState;
|
|
3408
3519
|
/**
|
|
3409
3520
|
* @description
|
|
3410
3521
|
* Returns whether the form submission has been triggered.
|
|
@@ -3412,18 +3523,34 @@ class NgForm extends ControlContainer {
|
|
|
3412
3523
|
get submitted() {
|
|
3413
3524
|
return untracked(this.submittedReactive);
|
|
3414
3525
|
}
|
|
3526
|
+
/** @internal */
|
|
3527
|
+
_submitted = computed(() => this.submittedReactive());
|
|
3528
|
+
submittedReactive = signal(false);
|
|
3529
|
+
_directives = new Set();
|
|
3530
|
+
/**
|
|
3531
|
+
* @description
|
|
3532
|
+
* The `FormGroup` instance created for this form.
|
|
3533
|
+
*/
|
|
3534
|
+
form;
|
|
3535
|
+
/**
|
|
3536
|
+
* @description
|
|
3537
|
+
* Event emitter for the "ngSubmit" event
|
|
3538
|
+
*/
|
|
3539
|
+
ngSubmit = new EventEmitter();
|
|
3540
|
+
/**
|
|
3541
|
+
* @description
|
|
3542
|
+
* Tracks options for the `NgForm` instance.
|
|
3543
|
+
*
|
|
3544
|
+
* **updateOn**: Sets the default `updateOn` value for all child `NgModels` below it
|
|
3545
|
+
* unless explicitly set by a child `NgModel` using `ngModelOptions`). Defaults to 'change'.
|
|
3546
|
+
* Possible values: `'change'` | `'blur'` | `'submit'`.
|
|
3547
|
+
*
|
|
3548
|
+
*/
|
|
3549
|
+
// TODO(issue/24571): remove '!'.
|
|
3550
|
+
options;
|
|
3415
3551
|
constructor(validators, asyncValidators, callSetDisabledState) {
|
|
3416
3552
|
super();
|
|
3417
3553
|
this.callSetDisabledState = callSetDisabledState;
|
|
3418
|
-
/** @internal */
|
|
3419
|
-
this._submitted = computed(() => this.submittedReactive());
|
|
3420
|
-
this.submittedReactive = signal(false);
|
|
3421
|
-
this._directives = new Set();
|
|
3422
|
-
/**
|
|
3423
|
-
* @description
|
|
3424
|
-
* Event emitter for the "ngSubmit" event
|
|
3425
|
-
*/
|
|
3426
|
-
this.ngSubmit = new EventEmitter();
|
|
3427
3554
|
this.form = new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));
|
|
3428
3555
|
}
|
|
3429
3556
|
/** @nodoc */
|
|
@@ -3599,10 +3726,10 @@ class NgForm extends ControlContainer {
|
|
|
3599
3726
|
path.pop();
|
|
3600
3727
|
return path.length ? this.form.get(path) : this.form;
|
|
3601
3728
|
}
|
|
3602
|
-
static
|
|
3603
|
-
static
|
|
3729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgForm, deps: [{ token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: CALL_SET_DISABLED_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3730
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgForm, isStandalone: false, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: { options: ["ngFormOptions", "options"] }, outputs: { ngSubmit: "ngSubmit" }, host: { listeners: { "submit": "onSubmit($event)", "reset": "onReset()" } }, providers: [formDirectiveProvider$1], exportAs: ["ngForm"], usesInheritance: true, ngImport: i0 });
|
|
3604
3731
|
}
|
|
3605
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
3732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgForm, decorators: [{
|
|
3606
3733
|
type: Directive,
|
|
3607
3734
|
args: [{
|
|
3608
3735
|
selector: 'form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]',
|
|
@@ -3610,6 +3737,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
3610
3737
|
host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
|
|
3611
3738
|
outputs: ['ngSubmit'],
|
|
3612
3739
|
exportAs: 'ngForm',
|
|
3740
|
+
standalone: false,
|
|
3613
3741
|
}]
|
|
3614
3742
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3615
3743
|
type: Optional
|
|
@@ -3649,16 +3777,18 @@ function isFormControlState(formState) {
|
|
|
3649
3777
|
'disabled' in formState);
|
|
3650
3778
|
}
|
|
3651
3779
|
const FormControl = class FormControl extends AbstractControl {
|
|
3780
|
+
/** @publicApi */
|
|
3781
|
+
defaultValue = null;
|
|
3782
|
+
/** @internal */
|
|
3783
|
+
_onChange = [];
|
|
3784
|
+
/** @internal */
|
|
3785
|
+
_pendingValue;
|
|
3786
|
+
/** @internal */
|
|
3787
|
+
_pendingChange = false;
|
|
3652
3788
|
constructor(
|
|
3653
3789
|
// formState and defaultValue will only be null if T is nullable
|
|
3654
3790
|
formState = null, validatorOrOpts, asyncValidator) {
|
|
3655
3791
|
super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
|
|
3656
|
-
/** @publicApi */
|
|
3657
|
-
this.defaultValue = null;
|
|
3658
|
-
/** @internal */
|
|
3659
|
-
this._onChange = [];
|
|
3660
|
-
/** @internal */
|
|
3661
|
-
this._pendingChange = false;
|
|
3662
3792
|
this._applyFormState(formState);
|
|
3663
3793
|
this._setUpdateStrategy(validatorOrOpts);
|
|
3664
3794
|
this._initObservables();
|
|
@@ -3765,6 +3895,14 @@ const isFormControl = (control) => control instanceof FormControl;
|
|
|
3765
3895
|
* @publicApi
|
|
3766
3896
|
*/
|
|
3767
3897
|
class AbstractFormGroupDirective extends ControlContainer {
|
|
3898
|
+
/**
|
|
3899
|
+
* @description
|
|
3900
|
+
* The parent control for the group
|
|
3901
|
+
*
|
|
3902
|
+
* @internal
|
|
3903
|
+
*/
|
|
3904
|
+
// TODO(issue/24571): remove '!'.
|
|
3905
|
+
_parent;
|
|
3768
3906
|
/** @nodoc */
|
|
3769
3907
|
ngOnInit() {
|
|
3770
3908
|
this._checkParentType();
|
|
@@ -3801,11 +3939,14 @@ class AbstractFormGroupDirective extends ControlContainer {
|
|
|
3801
3939
|
}
|
|
3802
3940
|
/** @internal */
|
|
3803
3941
|
_checkParentType() { }
|
|
3804
|
-
static
|
|
3805
|
-
static
|
|
3942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AbstractFormGroupDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3943
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: AbstractFormGroupDirective, isStandalone: false, usesInheritance: true, ngImport: i0 });
|
|
3806
3944
|
}
|
|
3807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
3808
|
-
type: Directive
|
|
3945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AbstractFormGroupDirective, decorators: [{
|
|
3946
|
+
type: Directive,
|
|
3947
|
+
args: [{
|
|
3948
|
+
standalone: false,
|
|
3949
|
+
}]
|
|
3809
3950
|
}] });
|
|
3810
3951
|
|
|
3811
3952
|
function modelParentException() {
|
|
@@ -3884,14 +4025,14 @@ const modelGroupProvider = {
|
|
|
3884
4025
|
* @publicApi
|
|
3885
4026
|
*/
|
|
3886
4027
|
class NgModelGroup extends AbstractFormGroupDirective {
|
|
4028
|
+
/**
|
|
4029
|
+
* @description
|
|
4030
|
+
* Tracks the name of the `NgModelGroup` bound to the directive. The name corresponds
|
|
4031
|
+
* to a key in the parent `NgForm`.
|
|
4032
|
+
*/
|
|
4033
|
+
name = '';
|
|
3887
4034
|
constructor(parent, validators, asyncValidators) {
|
|
3888
4035
|
super();
|
|
3889
|
-
/**
|
|
3890
|
-
* @description
|
|
3891
|
-
* Tracks the name of the `NgModelGroup` bound to the directive. The name corresponds
|
|
3892
|
-
* to a key in the parent `NgForm`.
|
|
3893
|
-
*/
|
|
3894
|
-
this.name = '';
|
|
3895
4036
|
this._parent = parent;
|
|
3896
4037
|
this._setValidators(validators);
|
|
3897
4038
|
this._setAsyncValidators(asyncValidators);
|
|
@@ -3904,12 +4045,17 @@ class NgModelGroup extends AbstractFormGroupDirective {
|
|
|
3904
4045
|
throw modelGroupParentException();
|
|
3905
4046
|
}
|
|
3906
4047
|
}
|
|
3907
|
-
static
|
|
3908
|
-
static
|
|
4048
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgModelGroup, deps: [{ token: ControlContainer, host: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4049
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgModelGroup, isStandalone: false, selector: "[ngModelGroup]", inputs: { name: ["ngModelGroup", "name"] }, providers: [modelGroupProvider], exportAs: ["ngModelGroup"], usesInheritance: true, ngImport: i0 });
|
|
3909
4050
|
}
|
|
3910
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgModelGroup, decorators: [{
|
|
3911
4052
|
type: Directive,
|
|
3912
|
-
args: [{
|
|
4053
|
+
args: [{
|
|
4054
|
+
selector: '[ngModelGroup]',
|
|
4055
|
+
providers: [modelGroupProvider],
|
|
4056
|
+
exportAs: 'ngModelGroup',
|
|
4057
|
+
standalone: false,
|
|
4058
|
+
}]
|
|
3913
4059
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
3914
4060
|
type: Host
|
|
3915
4061
|
}, {
|
|
@@ -4041,25 +4187,69 @@ const resolvedPromise = (() => Promise.resolve())();
|
|
|
4041
4187
|
* @publicApi
|
|
4042
4188
|
*/
|
|
4043
4189
|
class NgModel extends NgControl {
|
|
4190
|
+
_changeDetectorRef;
|
|
4191
|
+
callSetDisabledState;
|
|
4192
|
+
control = new FormControl();
|
|
4193
|
+
// At runtime we coerce arbitrary values assigned to the "disabled" input to a "boolean".
|
|
4194
|
+
// This is not reflected in the type of the property because outside of templates, consumers
|
|
4195
|
+
// should only deal with booleans. In templates, a string is allowed for convenience and to
|
|
4196
|
+
// match the native "disabled attribute" semantics which can be observed on input elements.
|
|
4197
|
+
// This static member tells the compiler that values of type "string" can also be assigned
|
|
4198
|
+
// to the input in a template.
|
|
4199
|
+
/** @nodoc */
|
|
4200
|
+
static ngAcceptInputType_isDisabled;
|
|
4201
|
+
/** @internal */
|
|
4202
|
+
_registered = false;
|
|
4203
|
+
/**
|
|
4204
|
+
* Internal reference to the view model value.
|
|
4205
|
+
* @nodoc
|
|
4206
|
+
*/
|
|
4207
|
+
viewModel;
|
|
4208
|
+
/**
|
|
4209
|
+
* @description
|
|
4210
|
+
* Tracks the name bound to the directive. If a parent form exists, it
|
|
4211
|
+
* uses this name as a key to retrieve this control's value.
|
|
4212
|
+
*/
|
|
4213
|
+
name = '';
|
|
4214
|
+
/**
|
|
4215
|
+
* @description
|
|
4216
|
+
* Tracks whether the control is disabled.
|
|
4217
|
+
*/
|
|
4218
|
+
// TODO(issue/24571): remove '!'.
|
|
4219
|
+
isDisabled;
|
|
4220
|
+
/**
|
|
4221
|
+
* @description
|
|
4222
|
+
* Tracks the value bound to this directive.
|
|
4223
|
+
*/
|
|
4224
|
+
model;
|
|
4225
|
+
/**
|
|
4226
|
+
* @description
|
|
4227
|
+
* Tracks the configuration options for this `ngModel` instance.
|
|
4228
|
+
*
|
|
4229
|
+
* **name**: An alternative to setting the name attribute on the form control element. See
|
|
4230
|
+
* the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel`
|
|
4231
|
+
* as a standalone control.
|
|
4232
|
+
*
|
|
4233
|
+
* **standalone**: When set to true, the `ngModel` will not register itself with its parent form,
|
|
4234
|
+
* and acts as if it's not in the form. Defaults to false. If no parent form exists, this option
|
|
4235
|
+
* has no effect.
|
|
4236
|
+
*
|
|
4237
|
+
* **updateOn**: Defines the event upon which the form control value and validity update.
|
|
4238
|
+
* Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`.
|
|
4239
|
+
*
|
|
4240
|
+
*/
|
|
4241
|
+
// TODO(issue/24571): remove '!'.
|
|
4242
|
+
options;
|
|
4243
|
+
/**
|
|
4244
|
+
* @description
|
|
4245
|
+
* Event emitter for producing the `ngModelChange` event after
|
|
4246
|
+
* the view model updates.
|
|
4247
|
+
*/
|
|
4248
|
+
update = new EventEmitter();
|
|
4044
4249
|
constructor(parent, validators, asyncValidators, valueAccessors, _changeDetectorRef, callSetDisabledState) {
|
|
4045
4250
|
super();
|
|
4046
4251
|
this._changeDetectorRef = _changeDetectorRef;
|
|
4047
4252
|
this.callSetDisabledState = callSetDisabledState;
|
|
4048
|
-
this.control = new FormControl();
|
|
4049
|
-
/** @internal */
|
|
4050
|
-
this._registered = false;
|
|
4051
|
-
/**
|
|
4052
|
-
* @description
|
|
4053
|
-
* Tracks the name bound to the directive. If a parent form exists, it
|
|
4054
|
-
* uses this name as a key to retrieve this control's value.
|
|
4055
|
-
*/
|
|
4056
|
-
this.name = '';
|
|
4057
|
-
/**
|
|
4058
|
-
* @description
|
|
4059
|
-
* Event emitter for producing the `ngModelChange` event after
|
|
4060
|
-
* the view model updates.
|
|
4061
|
-
*/
|
|
4062
|
-
this.update = new EventEmitter();
|
|
4063
4253
|
this._parent = parent;
|
|
4064
4254
|
this._setValidators(validators);
|
|
4065
4255
|
this._setAsyncValidators(asyncValidators);
|
|
@@ -4183,15 +4373,16 @@ class NgModel extends NgControl {
|
|
|
4183
4373
|
_getPath(controlName) {
|
|
4184
4374
|
return this._parent ? controlPath(controlName, this._parent) : [controlName];
|
|
4185
4375
|
}
|
|
4186
|
-
static
|
|
4187
|
-
static
|
|
4376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgModel, deps: [{ token: ControlContainer, host: true, optional: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: NG_VALUE_ACCESSOR, optional: true, self: true }, { token: ChangeDetectorRef, optional: true }, { token: CALL_SET_DISABLED_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4377
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgModel, isStandalone: false, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: { name: "name", isDisabled: ["disabled", "isDisabled"], model: ["ngModel", "model"], options: ["ngModelOptions", "options"] }, outputs: { update: "ngModelChange" }, providers: [formControlBinding$1], exportAs: ["ngModel"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
4188
4378
|
}
|
|
4189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgModel, decorators: [{
|
|
4190
4380
|
type: Directive,
|
|
4191
4381
|
args: [{
|
|
4192
4382
|
selector: '[ngModel]:not([formControlName]):not([formControl])',
|
|
4193
4383
|
providers: [formControlBinding$1],
|
|
4194
4384
|
exportAs: 'ngModel',
|
|
4385
|
+
standalone: false,
|
|
4195
4386
|
}]
|
|
4196
4387
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
4197
4388
|
type: Optional
|
|
@@ -4262,14 +4453,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
4262
4453
|
* @ngModule FormsModule
|
|
4263
4454
|
*/
|
|
4264
4455
|
class ɵNgNoValidate {
|
|
4265
|
-
static
|
|
4266
|
-
static
|
|
4456
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵNgNoValidate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4457
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: ɵNgNoValidate, isStandalone: false, selector: "form:not([ngNoForm]):not([ngNativeValidate])", host: { attributes: { "novalidate": "" } }, ngImport: i0 });
|
|
4267
4458
|
}
|
|
4268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵNgNoValidate, decorators: [{
|
|
4269
4460
|
type: Directive,
|
|
4270
4461
|
args: [{
|
|
4271
4462
|
selector: 'form:not([ngNoForm]):not([ngNativeValidate])',
|
|
4272
4463
|
host: { 'novalidate': '' },
|
|
4464
|
+
standalone: false,
|
|
4273
4465
|
}]
|
|
4274
4466
|
}] });
|
|
4275
4467
|
|
|
@@ -4321,15 +4513,16 @@ class NumberValueAccessor extends BuiltInControlValueAccessor {
|
|
|
4321
4513
|
fn(value == '' ? null : parseFloat(value));
|
|
4322
4514
|
};
|
|
4323
4515
|
}
|
|
4324
|
-
static
|
|
4325
|
-
static
|
|
4516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NumberValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4517
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NumberValueAccessor, isStandalone: false, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]", host: { listeners: { "input": "onChange($event.target.value)", "blur": "onTouched()" } }, providers: [NUMBER_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
4326
4518
|
}
|
|
4327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NumberValueAccessor, decorators: [{
|
|
4328
4520
|
type: Directive,
|
|
4329
4521
|
args: [{
|
|
4330
4522
|
selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',
|
|
4331
4523
|
host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
4332
4524
|
providers: [NUMBER_VALUE_ACCESSOR],
|
|
4525
|
+
standalone: false,
|
|
4333
4526
|
}]
|
|
4334
4527
|
}] });
|
|
4335
4528
|
|
|
@@ -4349,9 +4542,7 @@ function throwNameError() {
|
|
|
4349
4542
|
* Class used by Angular to track radio buttons. For internal use only.
|
|
4350
4543
|
*/
|
|
4351
4544
|
class RadioControlRegistry {
|
|
4352
|
-
|
|
4353
|
-
this._accessors = [];
|
|
4354
|
-
}
|
|
4545
|
+
_accessors = [];
|
|
4355
4546
|
/**
|
|
4356
4547
|
* @description
|
|
4357
4548
|
* Adds a control to the internal registry. For internal use only.
|
|
@@ -4387,10 +4578,10 @@ class RadioControlRegistry {
|
|
|
4387
4578
|
return false;
|
|
4388
4579
|
return (controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name);
|
|
4389
4580
|
}
|
|
4390
|
-
static
|
|
4391
|
-
static
|
|
4581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RadioControlRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4582
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RadioControlRegistry, providedIn: 'root' });
|
|
4392
4583
|
}
|
|
4393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RadioControlRegistry, decorators: [{
|
|
4394
4585
|
type: Injectable,
|
|
4395
4586
|
args: [{ providedIn: 'root' }]
|
|
4396
4587
|
}] });
|
|
@@ -4415,20 +4606,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
4415
4606
|
* @publicApi
|
|
4416
4607
|
*/
|
|
4417
4608
|
class RadioControlValueAccessor extends BuiltInControlValueAccessor {
|
|
4609
|
+
_registry;
|
|
4610
|
+
_injector;
|
|
4611
|
+
/** @internal */
|
|
4612
|
+
// TODO(issue/24571): remove '!'.
|
|
4613
|
+
_state;
|
|
4614
|
+
/** @internal */
|
|
4615
|
+
// TODO(issue/24571): remove '!'.
|
|
4616
|
+
_control;
|
|
4617
|
+
/** @internal */
|
|
4618
|
+
// TODO(issue/24571): remove '!'.
|
|
4619
|
+
_fn;
|
|
4620
|
+
setDisabledStateFired = false;
|
|
4621
|
+
/**
|
|
4622
|
+
* The registered callback function called when a change event occurs on the input element.
|
|
4623
|
+
* Note: we declare `onChange` here (also used as host listener) as a function with no arguments
|
|
4624
|
+
* to override the `onChange` function (which expects 1 argument) in the parent
|
|
4625
|
+
* `BaseControlValueAccessor` class.
|
|
4626
|
+
* @nodoc
|
|
4627
|
+
*/
|
|
4628
|
+
onChange = () => { };
|
|
4629
|
+
/**
|
|
4630
|
+
* @description
|
|
4631
|
+
* Tracks the name of the radio input element.
|
|
4632
|
+
*/
|
|
4633
|
+
// TODO(issue/24571): remove '!'.
|
|
4634
|
+
name;
|
|
4635
|
+
/**
|
|
4636
|
+
* @description
|
|
4637
|
+
* Tracks the name of the `FormControl` bound to the directive. The name corresponds
|
|
4638
|
+
* to a key in the parent `FormGroup` or `FormArray`.
|
|
4639
|
+
*/
|
|
4640
|
+
// TODO(issue/24571): remove '!'.
|
|
4641
|
+
formControlName;
|
|
4642
|
+
/**
|
|
4643
|
+
* @description
|
|
4644
|
+
* Tracks the value of the radio input element
|
|
4645
|
+
*/
|
|
4646
|
+
value;
|
|
4647
|
+
callSetDisabledState = inject(CALL_SET_DISABLED_STATE, { optional: true }) ?? setDisabledStateDefault;
|
|
4418
4648
|
constructor(renderer, elementRef, _registry, _injector) {
|
|
4419
4649
|
super(renderer, elementRef);
|
|
4420
4650
|
this._registry = _registry;
|
|
4421
4651
|
this._injector = _injector;
|
|
4422
|
-
this.setDisabledStateFired = false;
|
|
4423
|
-
/**
|
|
4424
|
-
* The registered callback function called when a change event occurs on the input element.
|
|
4425
|
-
* Note: we declare `onChange` here (also used as host listener) as a function with no arguments
|
|
4426
|
-
* to override the `onChange` function (which expects 1 argument) in the parent
|
|
4427
|
-
* `BaseControlValueAccessor` class.
|
|
4428
|
-
* @nodoc
|
|
4429
|
-
*/
|
|
4430
|
-
this.onChange = () => { };
|
|
4431
|
-
this.callSetDisabledState = inject(CALL_SET_DISABLED_STATE, { optional: true }) ?? setDisabledStateDefault;
|
|
4432
4652
|
}
|
|
4433
4653
|
/** @nodoc */
|
|
4434
4654
|
ngOnInit() {
|
|
@@ -4504,15 +4724,16 @@ class RadioControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
4504
4724
|
if (!this.name && this.formControlName)
|
|
4505
4725
|
this.name = this.formControlName;
|
|
4506
4726
|
}
|
|
4507
|
-
static
|
|
4508
|
-
static
|
|
4727
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RadioControlValueAccessor, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: RadioControlRegistry }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4728
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: RadioControlValueAccessor, isStandalone: false, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: { name: "name", formControlName: "formControlName", value: "value" }, host: { listeners: { "change": "onChange()", "blur": "onTouched()" } }, providers: [RADIO_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
4509
4729
|
}
|
|
4510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RadioControlValueAccessor, decorators: [{
|
|
4511
4731
|
type: Directive,
|
|
4512
4732
|
args: [{
|
|
4513
4733
|
selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',
|
|
4514
4734
|
host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },
|
|
4515
4735
|
providers: [RADIO_VALUE_ACCESSOR],
|
|
4736
|
+
standalone: false,
|
|
4516
4737
|
}]
|
|
4517
4738
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: RadioControlRegistry }, { type: i0.Injector }], propDecorators: { name: [{
|
|
4518
4739
|
type: Input
|
|
@@ -4568,10 +4789,10 @@ class RangeValueAccessor extends BuiltInControlValueAccessor {
|
|
|
4568
4789
|
fn(value == '' ? null : parseFloat(value));
|
|
4569
4790
|
};
|
|
4570
4791
|
}
|
|
4571
|
-
static
|
|
4572
|
-
static
|
|
4792
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RangeValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4793
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: RangeValueAccessor, isStandalone: false, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]", host: { listeners: { "change": "onChange($event.target.value)", "input": "onChange($event.target.value)", "blur": "onTouched()" } }, providers: [RANGE_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
4573
4794
|
}
|
|
4574
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RangeValueAccessor, decorators: [{
|
|
4575
4796
|
type: Directive,
|
|
4576
4797
|
args: [{
|
|
4577
4798
|
selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',
|
|
@@ -4581,6 +4802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
4581
4802
|
'(blur)': 'onTouched()',
|
|
4582
4803
|
},
|
|
4583
4804
|
providers: [RANGE_VALUE_ACCESSOR],
|
|
4805
|
+
standalone: false,
|
|
4584
4806
|
}]
|
|
4585
4807
|
}] });
|
|
4586
4808
|
|
|
@@ -4614,6 +4836,19 @@ const formControlBinding = {
|
|
|
4614
4836
|
* @publicApi
|
|
4615
4837
|
*/
|
|
4616
4838
|
class FormControlDirective extends NgControl {
|
|
4839
|
+
_ngModelWarningConfig;
|
|
4840
|
+
callSetDisabledState;
|
|
4841
|
+
/**
|
|
4842
|
+
* Internal reference to the view model value.
|
|
4843
|
+
* @nodoc
|
|
4844
|
+
*/
|
|
4845
|
+
viewModel;
|
|
4846
|
+
/**
|
|
4847
|
+
* @description
|
|
4848
|
+
* Tracks the `FormControl` instance bound to the directive.
|
|
4849
|
+
*/
|
|
4850
|
+
// TODO(issue/24571): remove '!'.
|
|
4851
|
+
form;
|
|
4617
4852
|
/**
|
|
4618
4853
|
* @description
|
|
4619
4854
|
* Triggers a warning in dev mode that this input should not be used with reactive forms.
|
|
@@ -4623,6 +4858,11 @@ class FormControlDirective extends NgControl {
|
|
|
4623
4858
|
console.warn(disabledAttrWarning);
|
|
4624
4859
|
}
|
|
4625
4860
|
}
|
|
4861
|
+
// TODO(kara): remove next 4 properties once deprecation period is over
|
|
4862
|
+
/** @deprecated as of v6 */
|
|
4863
|
+
model;
|
|
4864
|
+
/** @deprecated as of v6 */
|
|
4865
|
+
update = new EventEmitter();
|
|
4626
4866
|
/**
|
|
4627
4867
|
* @description
|
|
4628
4868
|
* Static property used to track whether any ngModel warnings have been sent across
|
|
@@ -4630,21 +4870,19 @@ class FormControlDirective extends NgControl {
|
|
|
4630
4870
|
*
|
|
4631
4871
|
* @internal
|
|
4632
4872
|
*/
|
|
4633
|
-
static
|
|
4873
|
+
static _ngModelWarningSentOnce = false;
|
|
4874
|
+
/**
|
|
4875
|
+
* @description
|
|
4876
|
+
* Instance property used to track whether an ngModel warning has been sent out for this
|
|
4877
|
+
* particular `FormControlDirective` instance. Used to support warning config of "always".
|
|
4878
|
+
*
|
|
4879
|
+
* @internal
|
|
4880
|
+
*/
|
|
4881
|
+
_ngModelWarningSent = false;
|
|
4634
4882
|
constructor(validators, asyncValidators, valueAccessors, _ngModelWarningConfig, callSetDisabledState) {
|
|
4635
4883
|
super();
|
|
4636
4884
|
this._ngModelWarningConfig = _ngModelWarningConfig;
|
|
4637
4885
|
this.callSetDisabledState = callSetDisabledState;
|
|
4638
|
-
/** @deprecated as of v6 */
|
|
4639
|
-
this.update = new EventEmitter();
|
|
4640
|
-
/**
|
|
4641
|
-
* @description
|
|
4642
|
-
* Instance property used to track whether an ngModel warning has been sent out for this
|
|
4643
|
-
* particular `FormControlDirective` instance. Used to support warning config of "always".
|
|
4644
|
-
*
|
|
4645
|
-
* @internal
|
|
4646
|
-
*/
|
|
4647
|
-
this._ngModelWarningSent = false;
|
|
4648
4886
|
this._setValidators(validators);
|
|
4649
4887
|
this._setAsyncValidators(asyncValidators);
|
|
4650
4888
|
this.valueAccessor = selectValueAccessor(this, valueAccessors);
|
|
@@ -4701,12 +4939,17 @@ class FormControlDirective extends NgControl {
|
|
|
4701
4939
|
_isControlChanged(changes) {
|
|
4702
4940
|
return changes.hasOwnProperty('form');
|
|
4703
4941
|
}
|
|
4704
|
-
static
|
|
4705
|
-
static
|
|
4942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormControlDirective, deps: [{ token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: NG_VALUE_ACCESSOR, optional: true, self: true }, { token: NG_MODEL_WITH_FORM_CONTROL_WARNING, optional: true }, { token: CALL_SET_DISABLED_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4943
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: FormControlDirective, isStandalone: false, selector: "[formControl]", inputs: { form: ["formControl", "form"], isDisabled: ["disabled", "isDisabled"], model: ["ngModel", "model"] }, outputs: { update: "ngModelChange" }, providers: [formControlBinding], exportAs: ["ngForm"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
4706
4944
|
}
|
|
4707
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
4945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormControlDirective, decorators: [{
|
|
4708
4946
|
type: Directive,
|
|
4709
|
-
args: [{
|
|
4947
|
+
args: [{
|
|
4948
|
+
selector: '[formControl]',
|
|
4949
|
+
providers: [formControlBinding],
|
|
4950
|
+
exportAs: 'ngForm',
|
|
4951
|
+
standalone: false,
|
|
4952
|
+
}]
|
|
4710
4953
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4711
4954
|
type: Optional
|
|
4712
4955
|
}, {
|
|
@@ -4781,6 +5024,7 @@ const formDirectiveProvider = {
|
|
|
4781
5024
|
* @publicApi
|
|
4782
5025
|
*/
|
|
4783
5026
|
class FormGroupDirective extends ControlContainer {
|
|
5027
|
+
callSetDisabledState;
|
|
4784
5028
|
/**
|
|
4785
5029
|
* @description
|
|
4786
5030
|
* Reports whether the form submission has been triggered.
|
|
@@ -4792,32 +5036,37 @@ class FormGroupDirective extends ControlContainer {
|
|
|
4792
5036
|
set submitted(value) {
|
|
4793
5037
|
this._submittedReactive.set(value);
|
|
4794
5038
|
}
|
|
5039
|
+
/** @internal */
|
|
5040
|
+
_submitted = computed(() => this._submittedReactive());
|
|
5041
|
+
_submittedReactive = signal(false);
|
|
5042
|
+
/**
|
|
5043
|
+
* Reference to an old form group input value, which is needed to cleanup
|
|
5044
|
+
* old instance in case it was replaced with a new one.
|
|
5045
|
+
*/
|
|
5046
|
+
_oldForm;
|
|
5047
|
+
/**
|
|
5048
|
+
* Callback that should be invoked when controls in FormGroup or FormArray collection change
|
|
5049
|
+
* (added or removed). This callback triggers corresponding DOM updates.
|
|
5050
|
+
*/
|
|
5051
|
+
_onCollectionChange = () => this._updateDomValue();
|
|
5052
|
+
/**
|
|
5053
|
+
* @description
|
|
5054
|
+
* Tracks the list of added `FormControlName` instances
|
|
5055
|
+
*/
|
|
5056
|
+
directives = [];
|
|
5057
|
+
/**
|
|
5058
|
+
* @description
|
|
5059
|
+
* Tracks the `FormGroup` bound to this directive.
|
|
5060
|
+
*/
|
|
5061
|
+
form = null;
|
|
5062
|
+
/**
|
|
5063
|
+
* @description
|
|
5064
|
+
* Emits an event when the form submission has been triggered.
|
|
5065
|
+
*/
|
|
5066
|
+
ngSubmit = new EventEmitter();
|
|
4795
5067
|
constructor(validators, asyncValidators, callSetDisabledState) {
|
|
4796
5068
|
super();
|
|
4797
5069
|
this.callSetDisabledState = callSetDisabledState;
|
|
4798
|
-
/** @internal */
|
|
4799
|
-
this._submitted = computed(() => this._submittedReactive());
|
|
4800
|
-
this._submittedReactive = signal(false);
|
|
4801
|
-
/**
|
|
4802
|
-
* Callback that should be invoked when controls in FormGroup or FormArray collection change
|
|
4803
|
-
* (added or removed). This callback triggers corresponding DOM updates.
|
|
4804
|
-
*/
|
|
4805
|
-
this._onCollectionChange = () => this._updateDomValue();
|
|
4806
|
-
/**
|
|
4807
|
-
* @description
|
|
4808
|
-
* Tracks the list of added `FormControlName` instances
|
|
4809
|
-
*/
|
|
4810
|
-
this.directives = [];
|
|
4811
|
-
/**
|
|
4812
|
-
* @description
|
|
4813
|
-
* Tracks the `FormGroup` bound to this directive.
|
|
4814
|
-
*/
|
|
4815
|
-
this.form = null;
|
|
4816
|
-
/**
|
|
4817
|
-
* @description
|
|
4818
|
-
* Emits an event when the form submission has been triggered.
|
|
4819
|
-
*/
|
|
4820
|
-
this.ngSubmit = new EventEmitter();
|
|
4821
5070
|
this._setValidators(validators);
|
|
4822
5071
|
this._setAsyncValidators(asyncValidators);
|
|
4823
5072
|
}
|
|
@@ -5058,16 +5307,17 @@ class FormGroupDirective extends ControlContainer {
|
|
|
5058
5307
|
throw missingFormException();
|
|
5059
5308
|
}
|
|
5060
5309
|
}
|
|
5061
|
-
static
|
|
5062
|
-
static
|
|
5310
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormGroupDirective, deps: [{ token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: CALL_SET_DISABLED_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5311
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: FormGroupDirective, isStandalone: false, selector: "[formGroup]", inputs: { form: ["formGroup", "form"] }, outputs: { ngSubmit: "ngSubmit" }, host: { listeners: { "submit": "onSubmit($event)", "reset": "onReset()" } }, providers: [formDirectiveProvider], exportAs: ["ngForm"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
5063
5312
|
}
|
|
5064
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
5313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormGroupDirective, decorators: [{
|
|
5065
5314
|
type: Directive,
|
|
5066
5315
|
args: [{
|
|
5067
5316
|
selector: '[formGroup]',
|
|
5068
5317
|
providers: [formDirectiveProvider],
|
|
5069
5318
|
host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
|
|
5070
5319
|
exportAs: 'ngForm',
|
|
5320
|
+
standalone: false,
|
|
5071
5321
|
}]
|
|
5072
5322
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
5073
5323
|
type: Optional
|
|
@@ -5147,18 +5397,18 @@ const formGroupNameProvider = {
|
|
|
5147
5397
|
* @publicApi
|
|
5148
5398
|
*/
|
|
5149
5399
|
class FormGroupName extends AbstractFormGroupDirective {
|
|
5400
|
+
/**
|
|
5401
|
+
* @description
|
|
5402
|
+
* Tracks the name of the `FormGroup` bound to the directive. The name corresponds
|
|
5403
|
+
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5404
|
+
* Accepts a name as a string or a number.
|
|
5405
|
+
* The name in the form of a string is useful for individual forms,
|
|
5406
|
+
* while the numerical form allows for form groups to be bound
|
|
5407
|
+
* to indices when iterating over groups in a `FormArray`.
|
|
5408
|
+
*/
|
|
5409
|
+
name = null;
|
|
5150
5410
|
constructor(parent, validators, asyncValidators) {
|
|
5151
5411
|
super();
|
|
5152
|
-
/**
|
|
5153
|
-
* @description
|
|
5154
|
-
* Tracks the name of the `FormGroup` bound to the directive. The name corresponds
|
|
5155
|
-
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5156
|
-
* Accepts a name as a string or a number.
|
|
5157
|
-
* The name in the form of a string is useful for individual forms,
|
|
5158
|
-
* while the numerical form allows for form groups to be bound
|
|
5159
|
-
* to indices when iterating over groups in a `FormArray`.
|
|
5160
|
-
*/
|
|
5161
|
-
this.name = null;
|
|
5162
5412
|
this._parent = parent;
|
|
5163
5413
|
this._setValidators(validators);
|
|
5164
5414
|
this._setAsyncValidators(asyncValidators);
|
|
@@ -5169,12 +5419,16 @@ class FormGroupName extends AbstractFormGroupDirective {
|
|
|
5169
5419
|
throw groupParentException();
|
|
5170
5420
|
}
|
|
5171
5421
|
}
|
|
5172
|
-
static
|
|
5173
|
-
static
|
|
5422
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormGroupName, deps: [{ token: ControlContainer, host: true, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5423
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: FormGroupName, isStandalone: false, selector: "[formGroupName]", inputs: { name: ["formGroupName", "name"] }, providers: [formGroupNameProvider], usesInheritance: true, ngImport: i0 });
|
|
5174
5424
|
}
|
|
5175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
5425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormGroupName, decorators: [{
|
|
5176
5426
|
type: Directive,
|
|
5177
|
-
args: [{
|
|
5427
|
+
args: [{
|
|
5428
|
+
selector: '[formGroupName]',
|
|
5429
|
+
providers: [formGroupNameProvider],
|
|
5430
|
+
standalone: false,
|
|
5431
|
+
}]
|
|
5178
5432
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
5179
5433
|
type: Optional
|
|
5180
5434
|
}, {
|
|
@@ -5228,18 +5482,20 @@ const formArrayNameProvider = {
|
|
|
5228
5482
|
* @publicApi
|
|
5229
5483
|
*/
|
|
5230
5484
|
class FormArrayName extends ControlContainer {
|
|
5485
|
+
/** @internal */
|
|
5486
|
+
_parent;
|
|
5487
|
+
/**
|
|
5488
|
+
* @description
|
|
5489
|
+
* Tracks the name of the `FormArray` bound to the directive. The name corresponds
|
|
5490
|
+
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5491
|
+
* Accepts a name as a string or a number.
|
|
5492
|
+
* The name in the form of a string is useful for individual forms,
|
|
5493
|
+
* while the numerical form allows for form arrays to be bound
|
|
5494
|
+
* to indices when iterating over arrays in a `FormArray`.
|
|
5495
|
+
*/
|
|
5496
|
+
name = null;
|
|
5231
5497
|
constructor(parent, validators, asyncValidators) {
|
|
5232
5498
|
super();
|
|
5233
|
-
/**
|
|
5234
|
-
* @description
|
|
5235
|
-
* Tracks the name of the `FormArray` bound to the directive. The name corresponds
|
|
5236
|
-
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5237
|
-
* Accepts a name as a string or a number.
|
|
5238
|
-
* The name in the form of a string is useful for individual forms,
|
|
5239
|
-
* while the numerical form allows for form arrays to be bound
|
|
5240
|
-
* to indices when iterating over arrays in a `FormArray`.
|
|
5241
|
-
*/
|
|
5242
|
-
this.name = null;
|
|
5243
5499
|
this._parent = parent;
|
|
5244
5500
|
this._setValidators(validators);
|
|
5245
5501
|
this._setAsyncValidators(asyncValidators);
|
|
@@ -5289,12 +5545,16 @@ class FormArrayName extends ControlContainer {
|
|
|
5289
5545
|
throw arrayParentException();
|
|
5290
5546
|
}
|
|
5291
5547
|
}
|
|
5292
|
-
static
|
|
5293
|
-
static
|
|
5548
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormArrayName, deps: [{ token: ControlContainer, host: true, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5549
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: FormArrayName, isStandalone: false, selector: "[formArrayName]", inputs: { name: ["formArrayName", "name"] }, providers: [formArrayNameProvider], usesInheritance: true, ngImport: i0 });
|
|
5294
5550
|
}
|
|
5295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
5551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormArrayName, decorators: [{
|
|
5296
5552
|
type: Directive,
|
|
5297
|
-
args: [{
|
|
5553
|
+
args: [{
|
|
5554
|
+
selector: '[formArrayName]',
|
|
5555
|
+
providers: [formArrayNameProvider],
|
|
5556
|
+
standalone: false,
|
|
5557
|
+
}]
|
|
5298
5558
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
5299
5559
|
type: Optional
|
|
5300
5560
|
}, {
|
|
@@ -5362,6 +5622,29 @@ const controlNameBinding = {
|
|
|
5362
5622
|
* @publicApi
|
|
5363
5623
|
*/
|
|
5364
5624
|
class FormControlName extends NgControl {
|
|
5625
|
+
_ngModelWarningConfig;
|
|
5626
|
+
_added = false;
|
|
5627
|
+
/**
|
|
5628
|
+
* Internal reference to the view model value.
|
|
5629
|
+
* @internal
|
|
5630
|
+
*/
|
|
5631
|
+
viewModel;
|
|
5632
|
+
/**
|
|
5633
|
+
* @description
|
|
5634
|
+
* Tracks the `FormControl` instance bound to the directive.
|
|
5635
|
+
*/
|
|
5636
|
+
// TODO(issue/24571): remove '!'.
|
|
5637
|
+
control;
|
|
5638
|
+
/**
|
|
5639
|
+
* @description
|
|
5640
|
+
* Tracks the name of the `FormControl` bound to the directive. The name corresponds
|
|
5641
|
+
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5642
|
+
* Accepts a name as a string or a number.
|
|
5643
|
+
* The name in the form of a string is useful for individual forms,
|
|
5644
|
+
* while the numerical form allows for form controls to be bound
|
|
5645
|
+
* to indices when iterating over controls in a `FormArray`.
|
|
5646
|
+
*/
|
|
5647
|
+
name = null;
|
|
5365
5648
|
/**
|
|
5366
5649
|
* @description
|
|
5367
5650
|
* Triggers a warning in dev mode that this input should not be used with reactive forms.
|
|
@@ -5371,6 +5654,11 @@ class FormControlName extends NgControl {
|
|
|
5371
5654
|
console.warn(disabledAttrWarning);
|
|
5372
5655
|
}
|
|
5373
5656
|
}
|
|
5657
|
+
// TODO(kara): remove next 4 properties once deprecation period is over
|
|
5658
|
+
/** @deprecated as of v6 */
|
|
5659
|
+
model;
|
|
5660
|
+
/** @deprecated as of v6 */
|
|
5661
|
+
update = new EventEmitter();
|
|
5374
5662
|
/**
|
|
5375
5663
|
* @description
|
|
5376
5664
|
* Static property used to track whether any ngModel warnings have been sent across
|
|
@@ -5378,31 +5666,18 @@ class FormControlName extends NgControl {
|
|
|
5378
5666
|
*
|
|
5379
5667
|
* @internal
|
|
5380
5668
|
*/
|
|
5381
|
-
static
|
|
5669
|
+
static _ngModelWarningSentOnce = false;
|
|
5670
|
+
/**
|
|
5671
|
+
* @description
|
|
5672
|
+
* Instance property used to track whether an ngModel warning has been sent out for this
|
|
5673
|
+
* particular FormControlName instance. Used to support warning config of "always".
|
|
5674
|
+
*
|
|
5675
|
+
* @internal
|
|
5676
|
+
*/
|
|
5677
|
+
_ngModelWarningSent = false;
|
|
5382
5678
|
constructor(parent, validators, asyncValidators, valueAccessors, _ngModelWarningConfig) {
|
|
5383
5679
|
super();
|
|
5384
5680
|
this._ngModelWarningConfig = _ngModelWarningConfig;
|
|
5385
|
-
this._added = false;
|
|
5386
|
-
/**
|
|
5387
|
-
* @description
|
|
5388
|
-
* Tracks the name of the `FormControl` bound to the directive. The name corresponds
|
|
5389
|
-
* to a key in the parent `FormGroup` or `FormArray`.
|
|
5390
|
-
* Accepts a name as a string or a number.
|
|
5391
|
-
* The name in the form of a string is useful for individual forms,
|
|
5392
|
-
* while the numerical form allows for form controls to be bound
|
|
5393
|
-
* to indices when iterating over controls in a `FormArray`.
|
|
5394
|
-
*/
|
|
5395
|
-
this.name = null;
|
|
5396
|
-
/** @deprecated as of v6 */
|
|
5397
|
-
this.update = new EventEmitter();
|
|
5398
|
-
/**
|
|
5399
|
-
* @description
|
|
5400
|
-
* Instance property used to track whether an ngModel warning has been sent out for this
|
|
5401
|
-
* particular FormControlName instance. Used to support warning config of "always".
|
|
5402
|
-
*
|
|
5403
|
-
* @internal
|
|
5404
|
-
*/
|
|
5405
|
-
this._ngModelWarningSent = false;
|
|
5406
5681
|
this._parent = parent;
|
|
5407
5682
|
this._setValidators(validators);
|
|
5408
5683
|
this._setAsyncValidators(asyncValidators);
|
|
@@ -5469,12 +5744,16 @@ class FormControlName extends NgControl {
|
|
|
5469
5744
|
this.control = this.formDirective.addControl(this);
|
|
5470
5745
|
this._added = true;
|
|
5471
5746
|
}
|
|
5472
|
-
static
|
|
5473
|
-
static
|
|
5747
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormControlName, deps: [{ token: ControlContainer, host: true, 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 }, { token: NG_MODEL_WITH_FORM_CONTROL_WARNING, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5748
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: FormControlName, isStandalone: false, selector: "[formControlName]", inputs: { name: ["formControlName", "name"], isDisabled: ["disabled", "isDisabled"], model: ["ngModel", "model"] }, outputs: { update: "ngModelChange" }, providers: [controlNameBinding], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
5474
5749
|
}
|
|
5475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
5750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormControlName, decorators: [{
|
|
5476
5751
|
type: Directive,
|
|
5477
|
-
args: [{
|
|
5752
|
+
args: [{
|
|
5753
|
+
selector: '[formControlName]',
|
|
5754
|
+
providers: [controlNameBinding],
|
|
5755
|
+
standalone: false,
|
|
5756
|
+
}]
|
|
5478
5757
|
}], ctorParameters: () => [{ type: ControlContainer, decorators: [{
|
|
5479
5758
|
type: Optional
|
|
5480
5759
|
}, {
|
|
@@ -5593,14 +5872,12 @@ function _extractId$1(valueString) {
|
|
|
5593
5872
|
* @publicApi
|
|
5594
5873
|
*/
|
|
5595
5874
|
class SelectControlValueAccessor extends BuiltInControlValueAccessor {
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
this._compareWith = Object.is;
|
|
5603
|
-
}
|
|
5875
|
+
/** @nodoc */
|
|
5876
|
+
value;
|
|
5877
|
+
/** @internal */
|
|
5878
|
+
_optionMap = new Map();
|
|
5879
|
+
/** @internal */
|
|
5880
|
+
_idCounter = 0;
|
|
5604
5881
|
/**
|
|
5605
5882
|
* @description
|
|
5606
5883
|
* Tracks the option comparison algorithm for tracking identities when
|
|
@@ -5612,6 +5889,7 @@ class SelectControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
5612
5889
|
}
|
|
5613
5890
|
this._compareWith = fn;
|
|
5614
5891
|
}
|
|
5892
|
+
_compareWith = Object.is;
|
|
5615
5893
|
/**
|
|
5616
5894
|
* Sets the "value" property on the select element.
|
|
5617
5895
|
* @nodoc
|
|
@@ -5649,15 +5927,16 @@ class SelectControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
5649
5927
|
const id = _extractId$1(valueString);
|
|
5650
5928
|
return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
|
|
5651
5929
|
}
|
|
5652
|
-
static
|
|
5653
|
-
static
|
|
5930
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SelectControlValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
5931
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: SelectControlValueAccessor, isStandalone: false, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: { compareWith: "compareWith" }, host: { listeners: { "change": "onChange($event.target.value)", "blur": "onTouched()" } }, providers: [SELECT_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
5654
5932
|
}
|
|
5655
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
5933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SelectControlValueAccessor, decorators: [{
|
|
5656
5934
|
type: Directive,
|
|
5657
5935
|
args: [{
|
|
5658
5936
|
selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',
|
|
5659
5937
|
host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
5660
5938
|
providers: [SELECT_VALUE_ACCESSOR],
|
|
5939
|
+
standalone: false,
|
|
5661
5940
|
}]
|
|
5662
5941
|
}], propDecorators: { compareWith: [{
|
|
5663
5942
|
type: Input
|
|
@@ -5673,6 +5952,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
5673
5952
|
* @publicApi
|
|
5674
5953
|
*/
|
|
5675
5954
|
class NgSelectOption {
|
|
5955
|
+
_element;
|
|
5956
|
+
_renderer;
|
|
5957
|
+
_select;
|
|
5958
|
+
/**
|
|
5959
|
+
* @description
|
|
5960
|
+
* ID of the option element
|
|
5961
|
+
*/
|
|
5962
|
+
// TODO(issue/24571): remove '!'.
|
|
5963
|
+
id;
|
|
5676
5964
|
constructor(_element, _renderer, _select) {
|
|
5677
5965
|
this._element = _element;
|
|
5678
5966
|
this._renderer = _renderer;
|
|
@@ -5713,12 +6001,15 @@ class NgSelectOption {
|
|
|
5713
6001
|
this._select.writeValue(this._select.value);
|
|
5714
6002
|
}
|
|
5715
6003
|
}
|
|
5716
|
-
static
|
|
5717
|
-
static
|
|
6004
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgSelectOption, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SelectControlValueAccessor, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6005
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: NgSelectOption, isStandalone: false, selector: "option", inputs: { ngValue: "ngValue", value: "value" }, ngImport: i0 });
|
|
5718
6006
|
}
|
|
5719
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NgSelectOption, decorators: [{
|
|
5720
6008
|
type: Directive,
|
|
5721
|
-
args: [{
|
|
6009
|
+
args: [{
|
|
6010
|
+
selector: 'option',
|
|
6011
|
+
standalone: false,
|
|
6012
|
+
}]
|
|
5722
6013
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SelectControlValueAccessor, decorators: [{
|
|
5723
6014
|
type: Optional
|
|
5724
6015
|
}, {
|
|
@@ -5750,6 +6041,8 @@ function _extractId(valueString) {
|
|
|
5750
6041
|
}
|
|
5751
6042
|
/** Mock interface for HTMLCollection */
|
|
5752
6043
|
class HTMLCollection {
|
|
6044
|
+
// TODO(issue/24571): remove '!'.
|
|
6045
|
+
length;
|
|
5753
6046
|
}
|
|
5754
6047
|
/**
|
|
5755
6048
|
* @description
|
|
@@ -5787,14 +6080,15 @@ class HTMLCollection {
|
|
|
5787
6080
|
* @publicApi
|
|
5788
6081
|
*/
|
|
5789
6082
|
class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor {
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
6083
|
+
/**
|
|
6084
|
+
* The current value.
|
|
6085
|
+
* @nodoc
|
|
6086
|
+
*/
|
|
6087
|
+
value;
|
|
6088
|
+
/** @internal */
|
|
6089
|
+
_optionMap = new Map();
|
|
6090
|
+
/** @internal */
|
|
6091
|
+
_idCounter = 0;
|
|
5798
6092
|
/**
|
|
5799
6093
|
* @description
|
|
5800
6094
|
* Tracks the option comparison algorithm for tracking identities when
|
|
@@ -5806,6 +6100,7 @@ class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
5806
6100
|
}
|
|
5807
6101
|
this._compareWith = fn;
|
|
5808
6102
|
}
|
|
6103
|
+
_compareWith = Object.is;
|
|
5809
6104
|
/**
|
|
5810
6105
|
* Sets the "value" property on one or of more of the select's options.
|
|
5811
6106
|
* @nodoc
|
|
@@ -5880,15 +6175,16 @@ class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor {
|
|
|
5880
6175
|
const id = _extractId(valueString);
|
|
5881
6176
|
return this._optionMap.has(id) ? this._optionMap.get(id)._value : valueString;
|
|
5882
6177
|
}
|
|
5883
|
-
static
|
|
5884
|
-
static
|
|
6178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SelectMultipleControlValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6179
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: SelectMultipleControlValueAccessor, isStandalone: false, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: { compareWith: "compareWith" }, host: { listeners: { "change": "onChange($event.target)", "blur": "onTouched()" } }, providers: [SELECT_MULTIPLE_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0 });
|
|
5885
6180
|
}
|
|
5886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SelectMultipleControlValueAccessor, decorators: [{
|
|
5887
6182
|
type: Directive,
|
|
5888
6183
|
args: [{
|
|
5889
6184
|
selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',
|
|
5890
6185
|
host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },
|
|
5891
6186
|
providers: [SELECT_MULTIPLE_VALUE_ACCESSOR],
|
|
6187
|
+
standalone: false,
|
|
5892
6188
|
}]
|
|
5893
6189
|
}], propDecorators: { compareWith: [{
|
|
5894
6190
|
type: Input
|
|
@@ -5904,6 +6200,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
5904
6200
|
* @publicApi
|
|
5905
6201
|
*/
|
|
5906
6202
|
class ɵNgSelectMultipleOption {
|
|
6203
|
+
_element;
|
|
6204
|
+
_renderer;
|
|
6205
|
+
_select;
|
|
6206
|
+
// TODO(issue/24571): remove '!'.
|
|
6207
|
+
id;
|
|
6208
|
+
/** @internal */
|
|
6209
|
+
_value;
|
|
5907
6210
|
constructor(_element, _renderer, _select) {
|
|
5908
6211
|
this._element = _element;
|
|
5909
6212
|
this._renderer = _renderer;
|
|
@@ -5954,12 +6257,15 @@ class ɵNgSelectMultipleOption {
|
|
|
5954
6257
|
this._select.writeValue(this._select.value);
|
|
5955
6258
|
}
|
|
5956
6259
|
}
|
|
5957
|
-
static
|
|
5958
|
-
static
|
|
6260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵNgSelectMultipleOption, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SelectMultipleControlValueAccessor, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6261
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: ɵNgSelectMultipleOption, isStandalone: false, selector: "option", inputs: { ngValue: "ngValue", value: "value" }, ngImport: i0 });
|
|
5959
6262
|
}
|
|
5960
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵNgSelectMultipleOption, decorators: [{
|
|
5961
6264
|
type: Directive,
|
|
5962
|
-
args: [{
|
|
6265
|
+
args: [{
|
|
6266
|
+
selector: 'option',
|
|
6267
|
+
standalone: false,
|
|
6268
|
+
}]
|
|
5963
6269
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SelectMultipleControlValueAccessor, decorators: [{
|
|
5964
6270
|
type: Optional
|
|
5965
6271
|
}, {
|
|
@@ -5997,9 +6303,16 @@ function toFloat(value) {
|
|
|
5997
6303
|
* For internal use only, this class is not intended for use outside of the Forms package.
|
|
5998
6304
|
*/
|
|
5999
6305
|
class AbstractValidatorDirective {
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6306
|
+
_validator = nullValidator;
|
|
6307
|
+
_onChange;
|
|
6308
|
+
/**
|
|
6309
|
+
* A flag that tracks whether this validator is enabled.
|
|
6310
|
+
*
|
|
6311
|
+
* Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of
|
|
6312
|
+
* directive classes that extend this base class.
|
|
6313
|
+
* @internal
|
|
6314
|
+
*/
|
|
6315
|
+
_enabled;
|
|
6003
6316
|
/** @nodoc */
|
|
6004
6317
|
ngOnChanges(changes) {
|
|
6005
6318
|
if (this.inputName in changes) {
|
|
@@ -6029,10 +6342,10 @@ class AbstractValidatorDirective {
|
|
|
6029
6342
|
enabled(input) {
|
|
6030
6343
|
return input != null /* both `null` and `undefined` */;
|
|
6031
6344
|
}
|
|
6032
|
-
static
|
|
6033
|
-
static
|
|
6345
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AbstractValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6346
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: AbstractValidatorDirective, isStandalone: true, usesOnChanges: true, ngImport: i0 });
|
|
6034
6347
|
}
|
|
6035
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AbstractValidatorDirective, decorators: [{
|
|
6036
6349
|
type: Directive
|
|
6037
6350
|
}] });
|
|
6038
6351
|
/**
|
|
@@ -6066,24 +6379,27 @@ const MAX_VALIDATOR = {
|
|
|
6066
6379
|
* @publicApi
|
|
6067
6380
|
*/
|
|
6068
6381
|
class MaxValidator extends AbstractValidatorDirective {
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
}
|
|
6081
|
-
i0.ɵɵ
|
|
6382
|
+
/**
|
|
6383
|
+
* @description
|
|
6384
|
+
* Tracks changes to the max bound to this directive.
|
|
6385
|
+
*/
|
|
6386
|
+
max;
|
|
6387
|
+
/** @internal */
|
|
6388
|
+
inputName = 'max';
|
|
6389
|
+
/** @internal */
|
|
6390
|
+
normalizeInput = (input) => toFloat(input);
|
|
6391
|
+
/** @internal */
|
|
6392
|
+
createValidator = (max) => maxValidator(max);
|
|
6393
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MaxValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6394
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: MaxValidator, isStandalone: false, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: { max: "max" }, host: { properties: { "attr.max": "_enabled ? max : null" } }, providers: [MAX_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6395
|
+
}
|
|
6396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MaxValidator, decorators: [{
|
|
6082
6397
|
type: Directive,
|
|
6083
6398
|
args: [{
|
|
6084
6399
|
selector: 'input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]',
|
|
6085
6400
|
providers: [MAX_VALIDATOR],
|
|
6086
6401
|
host: { '[attr.max]': '_enabled ? max : null' },
|
|
6402
|
+
standalone: false,
|
|
6087
6403
|
}]
|
|
6088
6404
|
}], propDecorators: { max: [{
|
|
6089
6405
|
type: Input
|
|
@@ -6119,24 +6435,27 @@ const MIN_VALIDATOR = {
|
|
|
6119
6435
|
* @publicApi
|
|
6120
6436
|
*/
|
|
6121
6437
|
class MinValidator extends AbstractValidatorDirective {
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
}
|
|
6134
|
-
i0.ɵɵ
|
|
6438
|
+
/**
|
|
6439
|
+
* @description
|
|
6440
|
+
* Tracks changes to the min bound to this directive.
|
|
6441
|
+
*/
|
|
6442
|
+
min;
|
|
6443
|
+
/** @internal */
|
|
6444
|
+
inputName = 'min';
|
|
6445
|
+
/** @internal */
|
|
6446
|
+
normalizeInput = (input) => toFloat(input);
|
|
6447
|
+
/** @internal */
|
|
6448
|
+
createValidator = (min) => minValidator(min);
|
|
6449
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MinValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6450
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: MinValidator, isStandalone: false, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: { min: "min" }, host: { properties: { "attr.min": "_enabled ? min : null" } }, providers: [MIN_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6451
|
+
}
|
|
6452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MinValidator, decorators: [{
|
|
6135
6453
|
type: Directive,
|
|
6136
6454
|
args: [{
|
|
6137
6455
|
selector: 'input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]',
|
|
6138
6456
|
providers: [MIN_VALIDATOR],
|
|
6139
6457
|
host: { '[attr.min]': '_enabled ? min : null' },
|
|
6458
|
+
standalone: false,
|
|
6140
6459
|
}]
|
|
6141
6460
|
}], propDecorators: { min: [{
|
|
6142
6461
|
type: Input
|
|
@@ -6179,28 +6498,31 @@ const CHECKBOX_REQUIRED_VALIDATOR = {
|
|
|
6179
6498
|
* @publicApi
|
|
6180
6499
|
*/
|
|
6181
6500
|
class RequiredValidator extends AbstractValidatorDirective {
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6501
|
+
/**
|
|
6502
|
+
* @description
|
|
6503
|
+
* Tracks changes to the required attribute bound to this directive.
|
|
6504
|
+
*/
|
|
6505
|
+
required;
|
|
6506
|
+
/** @internal */
|
|
6507
|
+
inputName = 'required';
|
|
6508
|
+
/** @internal */
|
|
6509
|
+
normalizeInput = booleanAttribute;
|
|
6510
|
+
/** @internal */
|
|
6511
|
+
createValidator = (input) => requiredValidator;
|
|
6191
6512
|
/** @nodoc */
|
|
6192
6513
|
enabled(input) {
|
|
6193
6514
|
return input;
|
|
6194
6515
|
}
|
|
6195
|
-
static
|
|
6196
|
-
static
|
|
6516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6517
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: RequiredValidator, isStandalone: false, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: { required: "required" }, host: { properties: { "attr.required": "_enabled ? \"\" : null" } }, providers: [REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6197
6518
|
}
|
|
6198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: RequiredValidator, decorators: [{
|
|
6199
6520
|
type: Directive,
|
|
6200
6521
|
args: [{
|
|
6201
6522
|
selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',
|
|
6202
6523
|
providers: [REQUIRED_VALIDATOR],
|
|
6203
6524
|
host: { '[attr.required]': '_enabled ? "" : null' },
|
|
6525
|
+
standalone: false,
|
|
6204
6526
|
}]
|
|
6205
6527
|
}], propDecorators: { required: [{
|
|
6206
6528
|
type: Input
|
|
@@ -6227,20 +6549,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
6227
6549
|
* @ngModule ReactiveFormsModule
|
|
6228
6550
|
*/
|
|
6229
6551
|
class CheckboxRequiredValidator extends RequiredValidator {
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
}
|
|
6235
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.9", ngImport: i0, type: CheckboxRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6236
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.9", type: CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]", host: { properties: { "attr.required": "_enabled ? \"\" : null" } }, providers: [CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 }); }
|
|
6552
|
+
/** @internal */
|
|
6553
|
+
createValidator = (input) => requiredTrueValidator;
|
|
6554
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CheckboxRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6555
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: CheckboxRequiredValidator, isStandalone: false, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]", host: { properties: { "attr.required": "_enabled ? \"\" : null" } }, providers: [CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6237
6556
|
}
|
|
6238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6557
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CheckboxRequiredValidator, decorators: [{
|
|
6239
6558
|
type: Directive,
|
|
6240
6559
|
args: [{
|
|
6241
6560
|
selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',
|
|
6242
6561
|
providers: [CHECKBOX_REQUIRED_VALIDATOR],
|
|
6243
6562
|
host: { '[attr.required]': '_enabled ? "" : null' },
|
|
6563
|
+
standalone: false,
|
|
6244
6564
|
}]
|
|
6245
6565
|
}] });
|
|
6246
6566
|
/**
|
|
@@ -6280,27 +6600,30 @@ const EMAIL_VALIDATOR = {
|
|
|
6280
6600
|
* @ngModule ReactiveFormsModule
|
|
6281
6601
|
*/
|
|
6282
6602
|
class EmailValidator extends AbstractValidatorDirective {
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6603
|
+
/**
|
|
6604
|
+
* @description
|
|
6605
|
+
* Tracks changes to the email attribute bound to this directive.
|
|
6606
|
+
*/
|
|
6607
|
+
email;
|
|
6608
|
+
/** @internal */
|
|
6609
|
+
inputName = 'email';
|
|
6610
|
+
/** @internal */
|
|
6611
|
+
normalizeInput = booleanAttribute;
|
|
6612
|
+
/** @internal */
|
|
6613
|
+
createValidator = (input) => emailValidator;
|
|
6292
6614
|
/** @nodoc */
|
|
6293
6615
|
enabled(input) {
|
|
6294
6616
|
return input;
|
|
6295
6617
|
}
|
|
6296
|
-
static
|
|
6297
|
-
static
|
|
6618
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EmailValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6619
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: EmailValidator, isStandalone: false, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: { email: "email" }, providers: [EMAIL_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6298
6620
|
}
|
|
6299
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EmailValidator, decorators: [{
|
|
6300
6622
|
type: Directive,
|
|
6301
6623
|
args: [{
|
|
6302
6624
|
selector: '[email][formControlName],[email][formControl],[email][ngModel]',
|
|
6303
6625
|
providers: [EMAIL_VALIDATOR],
|
|
6626
|
+
standalone: false,
|
|
6304
6627
|
}]
|
|
6305
6628
|
}], propDecorators: { email: [{
|
|
6306
6629
|
type: Input
|
|
@@ -6336,24 +6659,27 @@ const MIN_LENGTH_VALIDATOR = {
|
|
|
6336
6659
|
* @publicApi
|
|
6337
6660
|
*/
|
|
6338
6661
|
class MinLengthValidator extends AbstractValidatorDirective {
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
}
|
|
6351
|
-
i0.ɵɵ
|
|
6662
|
+
/**
|
|
6663
|
+
* @description
|
|
6664
|
+
* Tracks changes to the minimum length bound to this directive.
|
|
6665
|
+
*/
|
|
6666
|
+
minlength;
|
|
6667
|
+
/** @internal */
|
|
6668
|
+
inputName = 'minlength';
|
|
6669
|
+
/** @internal */
|
|
6670
|
+
normalizeInput = (input) => toInteger(input);
|
|
6671
|
+
/** @internal */
|
|
6672
|
+
createValidator = (minlength) => minLengthValidator(minlength);
|
|
6673
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MinLengthValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6674
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: MinLengthValidator, isStandalone: false, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: { minlength: "minlength" }, host: { properties: { "attr.minlength": "_enabled ? minlength : null" } }, providers: [MIN_LENGTH_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6675
|
+
}
|
|
6676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MinLengthValidator, decorators: [{
|
|
6352
6677
|
type: Directive,
|
|
6353
6678
|
args: [{
|
|
6354
6679
|
selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',
|
|
6355
6680
|
providers: [MIN_LENGTH_VALIDATOR],
|
|
6356
6681
|
host: { '[attr.minlength]': '_enabled ? minlength : null' },
|
|
6682
|
+
standalone: false,
|
|
6357
6683
|
}]
|
|
6358
6684
|
}], propDecorators: { minlength: [{
|
|
6359
6685
|
type: Input
|
|
@@ -6389,24 +6715,27 @@ const MAX_LENGTH_VALIDATOR = {
|
|
|
6389
6715
|
* @publicApi
|
|
6390
6716
|
*/
|
|
6391
6717
|
class MaxLengthValidator extends AbstractValidatorDirective {
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
}
|
|
6404
|
-
i0.ɵɵ
|
|
6718
|
+
/**
|
|
6719
|
+
* @description
|
|
6720
|
+
* Tracks changes to the maximum length bound to this directive.
|
|
6721
|
+
*/
|
|
6722
|
+
maxlength;
|
|
6723
|
+
/** @internal */
|
|
6724
|
+
inputName = 'maxlength';
|
|
6725
|
+
/** @internal */
|
|
6726
|
+
normalizeInput = (input) => toInteger(input);
|
|
6727
|
+
/** @internal */
|
|
6728
|
+
createValidator = (maxlength) => maxLengthValidator(maxlength);
|
|
6729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MaxLengthValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6730
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: MaxLengthValidator, isStandalone: false, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: { maxlength: "maxlength" }, host: { properties: { "attr.maxlength": "_enabled ? maxlength : null" } }, providers: [MAX_LENGTH_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6731
|
+
}
|
|
6732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: MaxLengthValidator, decorators: [{
|
|
6405
6733
|
type: Directive,
|
|
6406
6734
|
args: [{
|
|
6407
6735
|
selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',
|
|
6408
6736
|
providers: [MAX_LENGTH_VALIDATOR],
|
|
6409
6737
|
host: { '[attr.maxlength]': '_enabled ? maxlength : null' },
|
|
6738
|
+
standalone: false,
|
|
6410
6739
|
}]
|
|
6411
6740
|
}], propDecorators: { maxlength: [{
|
|
6412
6741
|
type: Input
|
|
@@ -6444,24 +6773,27 @@ const PATTERN_VALIDATOR = {
|
|
|
6444
6773
|
* @publicApi
|
|
6445
6774
|
*/
|
|
6446
6775
|
class PatternValidator extends AbstractValidatorDirective {
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
}
|
|
6459
|
-
i0.ɵɵ
|
|
6776
|
+
/**
|
|
6777
|
+
* @description
|
|
6778
|
+
* Tracks changes to the pattern bound to this directive.
|
|
6779
|
+
*/
|
|
6780
|
+
pattern; // This input is always defined, since the name matches selector.
|
|
6781
|
+
/** @internal */
|
|
6782
|
+
inputName = 'pattern';
|
|
6783
|
+
/** @internal */
|
|
6784
|
+
normalizeInput = (input) => input;
|
|
6785
|
+
/** @internal */
|
|
6786
|
+
createValidator = (input) => patternValidator(input);
|
|
6787
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: PatternValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
6788
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.1", type: PatternValidator, isStandalone: false, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: { pattern: "pattern" }, host: { properties: { "attr.pattern": "_enabled ? pattern : null" } }, providers: [PATTERN_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
6789
|
+
}
|
|
6790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: PatternValidator, decorators: [{
|
|
6460
6791
|
type: Directive,
|
|
6461
6792
|
args: [{
|
|
6462
6793
|
selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',
|
|
6463
6794
|
providers: [PATTERN_VALIDATOR],
|
|
6464
6795
|
host: { '[attr.pattern]': '_enabled ? pattern : null' },
|
|
6796
|
+
standalone: false,
|
|
6465
6797
|
}]
|
|
6466
6798
|
}], propDecorators: { pattern: [{
|
|
6467
6799
|
type: Input
|
|
@@ -6501,8 +6833,8 @@ const REACTIVE_DRIVEN_DIRECTIVES = [
|
|
|
6501
6833
|
* Internal module used for sharing directives between FormsModule and ReactiveFormsModule
|
|
6502
6834
|
*/
|
|
6503
6835
|
class ɵInternalFormsSharedModule {
|
|
6504
|
-
static
|
|
6505
|
-
static
|
|
6836
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵInternalFormsSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6837
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵInternalFormsSharedModule, declarations: [ɵNgNoValidate,
|
|
6506
6838
|
NgSelectOption,
|
|
6507
6839
|
ɵNgSelectMultipleOption,
|
|
6508
6840
|
DefaultValueAccessor,
|
|
@@ -6540,10 +6872,10 @@ class ɵInternalFormsSharedModule {
|
|
|
6540
6872
|
CheckboxRequiredValidator,
|
|
6541
6873
|
EmailValidator,
|
|
6542
6874
|
MinValidator,
|
|
6543
|
-
MaxValidator] });
|
|
6544
|
-
static
|
|
6875
|
+
MaxValidator] });
|
|
6876
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵInternalFormsSharedModule });
|
|
6545
6877
|
}
|
|
6546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
6878
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ɵInternalFormsSharedModule, decorators: [{
|
|
6547
6879
|
type: NgModule,
|
|
6548
6880
|
args: [{
|
|
6549
6881
|
declarations: SHARED_FORM_DIRECTIVES,
|
|
@@ -6647,6 +6979,7 @@ class FormArray extends AbstractControl {
|
|
|
6647
6979
|
emitEvent: !!this.asyncValidator,
|
|
6648
6980
|
});
|
|
6649
6981
|
}
|
|
6982
|
+
controls;
|
|
6650
6983
|
/**
|
|
6651
6984
|
* Get the `AbstractControl` at the given `index` in the array.
|
|
6652
6985
|
*
|
|
@@ -7023,9 +7356,7 @@ function isAbstractControlOptions(options) {
|
|
|
7023
7356
|
* @publicApi
|
|
7024
7357
|
*/
|
|
7025
7358
|
class FormBuilder {
|
|
7026
|
-
|
|
7027
|
-
this.useNonNullable = false;
|
|
7028
|
-
}
|
|
7359
|
+
useNonNullable = false;
|
|
7029
7360
|
/**
|
|
7030
7361
|
* @description
|
|
7031
7362
|
* Returns a FormBuilder in which automatically constructed `FormControl` elements
|
|
@@ -7197,10 +7528,10 @@ class FormBuilder {
|
|
|
7197
7528
|
return this.control(controls);
|
|
7198
7529
|
}
|
|
7199
7530
|
}
|
|
7200
|
-
static
|
|
7201
|
-
static
|
|
7531
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7532
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormBuilder, providedIn: 'root' });
|
|
7202
7533
|
}
|
|
7203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
7534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormBuilder, decorators: [{
|
|
7204
7535
|
type: Injectable,
|
|
7205
7536
|
args: [{ providedIn: 'root' }]
|
|
7206
7537
|
}] });
|
|
@@ -7212,10 +7543,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
7212
7543
|
* @publicApi
|
|
7213
7544
|
*/
|
|
7214
7545
|
class NonNullableFormBuilder {
|
|
7215
|
-
static
|
|
7216
|
-
static
|
|
7546
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NonNullableFormBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7547
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NonNullableFormBuilder, providedIn: 'root', useFactory: () => inject(FormBuilder).nonNullable });
|
|
7217
7548
|
}
|
|
7218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
7549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: NonNullableFormBuilder, decorators: [{
|
|
7219
7550
|
type: Injectable,
|
|
7220
7551
|
args: [{
|
|
7221
7552
|
providedIn: 'root',
|
|
@@ -7241,10 +7572,10 @@ class UntypedFormBuilder extends FormBuilder {
|
|
|
7241
7572
|
array(controlsConfig, validatorOrOpts, asyncValidator) {
|
|
7242
7573
|
return super.array(controlsConfig, validatorOrOpts, asyncValidator);
|
|
7243
7574
|
}
|
|
7244
|
-
static
|
|
7245
|
-
static
|
|
7575
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UntypedFormBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
7576
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UntypedFormBuilder, providedIn: 'root' });
|
|
7246
7577
|
}
|
|
7247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
7578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UntypedFormBuilder, decorators: [{
|
|
7248
7579
|
type: Injectable,
|
|
7249
7580
|
args: [{ providedIn: 'root' }]
|
|
7250
7581
|
}] });
|
|
@@ -7257,7 +7588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.9",
|
|
|
7257
7588
|
/**
|
|
7258
7589
|
* @publicApi
|
|
7259
7590
|
*/
|
|
7260
|
-
const VERSION = new Version('19.0.0-
|
|
7591
|
+
const VERSION = new Version('19.0.0-rc.1');
|
|
7261
7592
|
|
|
7262
7593
|
/**
|
|
7263
7594
|
* Exports the required providers and directives for template-driven forms,
|
|
@@ -7288,11 +7619,11 @@ class FormsModule {
|
|
|
7288
7619
|
],
|
|
7289
7620
|
};
|
|
7290
7621
|
}
|
|
7291
|
-
static
|
|
7292
|
-
static
|
|
7293
|
-
static
|
|
7622
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7623
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormsModule, declarations: [NgModel, NgModelGroup, NgForm], exports: [ɵInternalFormsSharedModule, NgModel, NgModelGroup, NgForm] });
|
|
7624
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormsModule, imports: [ɵInternalFormsSharedModule] });
|
|
7294
7625
|
}
|
|
7295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
7626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: FormsModule, decorators: [{
|
|
7296
7627
|
type: NgModule,
|
|
7297
7628
|
args: [{
|
|
7298
7629
|
declarations: TEMPLATE_DRIVEN_DIRECTIVES,
|
|
@@ -7334,11 +7665,11 @@ class ReactiveFormsModule {
|
|
|
7334
7665
|
],
|
|
7335
7666
|
};
|
|
7336
7667
|
}
|
|
7337
|
-
static
|
|
7338
|
-
static
|
|
7339
|
-
static
|
|
7668
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ReactiveFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7669
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ReactiveFormsModule, declarations: [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName], exports: [ɵInternalFormsSharedModule, FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName] });
|
|
7670
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ReactiveFormsModule, imports: [ɵInternalFormsSharedModule] });
|
|
7340
7671
|
}
|
|
7341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
7672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ReactiveFormsModule, decorators: [{
|
|
7342
7673
|
type: NgModule,
|
|
7343
7674
|
args: [{
|
|
7344
7675
|
declarations: [REACTIVE_DRIVEN_DIRECTIVES],
|