@angular/forms 21.1.0-rc.0 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_structure-chunk.mjs +15 -1
- package/fesm2022/_structure-chunk.mjs.map +1 -1
- package/fesm2022/forms.mjs +128 -128
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals-compat.mjs +1 -1
- package/fesm2022/signals.mjs +5 -109
- package/fesm2022/signals.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/code-examples.db +0 -0
- package/types/_structure-chunk.d.ts +29 -57
- package/types/forms.d.ts +1 -1
- package/types/signals-compat.d.ts +1 -1
- package/types/signals.d.ts +2 -2
package/fesm2022/signals.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.1.0
|
|
2
|
+
* @license Angular v21.1.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -93,110 +93,6 @@ class InteropNgControl {
|
|
|
93
93
|
updateValueAndValidity() {}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const FIELD = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'FIELD' : '');
|
|
97
|
-
const controlInstructions$1 = {
|
|
98
|
-
create: __controlCreate,
|
|
99
|
-
update: _controlUpdate
|
|
100
|
-
};
|
|
101
|
-
class Field {
|
|
102
|
-
element = inject(ElementRef).nativeElement;
|
|
103
|
-
injector = inject(Injector);
|
|
104
|
-
field = input.required(...(ngDevMode ? [{
|
|
105
|
-
debugName: "field"
|
|
106
|
-
}] : []));
|
|
107
|
-
state = computed(() => this.field()(), ...(ngDevMode ? [{
|
|
108
|
-
debugName: "state"
|
|
109
|
-
}] : []));
|
|
110
|
-
[_CONTROL] = controlInstructions$1;
|
|
111
|
-
config = inject(SIGNAL_FORMS_CONFIG, {
|
|
112
|
-
optional: true
|
|
113
|
-
});
|
|
114
|
-
classes = Object.entries(this.config?.classes ?? {}).map(([className, computation]) => [className, computed(() => computation(this))]);
|
|
115
|
-
controlValueAccessors = inject(NG_VALUE_ACCESSOR, {
|
|
116
|
-
optional: true,
|
|
117
|
-
self: true
|
|
118
|
-
});
|
|
119
|
-
interopNgControl;
|
|
120
|
-
get ɵinteropControl() {
|
|
121
|
-
return this.controlValueAccessors?.[0] ?? this.interopNgControl?.valueAccessor ?? undefined;
|
|
122
|
-
}
|
|
123
|
-
getOrCreateNgControl() {
|
|
124
|
-
return this.interopNgControl ??= new InteropNgControl(this.state);
|
|
125
|
-
}
|
|
126
|
-
ɵregister() {
|
|
127
|
-
effect(onCleanup => {
|
|
128
|
-
const fieldNode = this.state();
|
|
129
|
-
fieldNode.nodeState.formFieldBindings.update(controls => [...controls, this]);
|
|
130
|
-
onCleanup(() => {
|
|
131
|
-
fieldNode.nodeState.formFieldBindings.update(controls => controls.filter(c => c !== this));
|
|
132
|
-
});
|
|
133
|
-
}, {
|
|
134
|
-
injector: this.injector
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
138
|
-
minVersion: "12.0.0",
|
|
139
|
-
version: "21.1.0-rc.0",
|
|
140
|
-
ngImport: i0,
|
|
141
|
-
type: Field,
|
|
142
|
-
deps: [],
|
|
143
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
144
|
-
});
|
|
145
|
-
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
146
|
-
minVersion: "17.1.0",
|
|
147
|
-
version: "21.1.0-rc.0",
|
|
148
|
-
type: Field,
|
|
149
|
-
isStandalone: true,
|
|
150
|
-
selector: "[field]",
|
|
151
|
-
inputs: {
|
|
152
|
-
field: {
|
|
153
|
-
classPropertyName: "field",
|
|
154
|
-
publicName: "field",
|
|
155
|
-
isSignal: true,
|
|
156
|
-
isRequired: true,
|
|
157
|
-
transformFunction: null
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
providers: [{
|
|
161
|
-
provide: FIELD,
|
|
162
|
-
useExisting: Field
|
|
163
|
-
}, {
|
|
164
|
-
provide: NgControl,
|
|
165
|
-
useFactory: () => inject(Field).getOrCreateNgControl()
|
|
166
|
-
}],
|
|
167
|
-
ngImport: i0
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
171
|
-
minVersion: "12.0.0",
|
|
172
|
-
version: "21.1.0-rc.0",
|
|
173
|
-
ngImport: i0,
|
|
174
|
-
type: Field,
|
|
175
|
-
decorators: [{
|
|
176
|
-
type: Directive,
|
|
177
|
-
args: [{
|
|
178
|
-
selector: '[field]',
|
|
179
|
-
providers: [{
|
|
180
|
-
provide: FIELD,
|
|
181
|
-
useExisting: Field
|
|
182
|
-
}, {
|
|
183
|
-
provide: NgControl,
|
|
184
|
-
useFactory: () => inject(Field).getOrCreateNgControl()
|
|
185
|
-
}]
|
|
186
|
-
}]
|
|
187
|
-
}],
|
|
188
|
-
propDecorators: {
|
|
189
|
-
field: [{
|
|
190
|
-
type: i0.Input,
|
|
191
|
-
args: [{
|
|
192
|
-
isSignal: true,
|
|
193
|
-
alias: "field",
|
|
194
|
-
required: true
|
|
195
|
-
}]
|
|
196
|
-
}]
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
|
|
200
96
|
const FORM_FIELD = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'FORM_FIELD' : '');
|
|
201
97
|
const controlInstructions = {
|
|
202
98
|
create: __controlCreate,
|
|
@@ -240,7 +136,7 @@ class FormField {
|
|
|
240
136
|
}
|
|
241
137
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
242
138
|
minVersion: "12.0.0",
|
|
243
|
-
version: "21.1.0
|
|
139
|
+
version: "21.1.0",
|
|
244
140
|
ngImport: i0,
|
|
245
141
|
type: FormField,
|
|
246
142
|
deps: [],
|
|
@@ -248,7 +144,7 @@ class FormField {
|
|
|
248
144
|
});
|
|
249
145
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
250
146
|
minVersion: "17.1.0",
|
|
251
|
-
version: "21.1.0
|
|
147
|
+
version: "21.1.0",
|
|
252
148
|
type: FormField,
|
|
253
149
|
isStandalone: true,
|
|
254
150
|
selector: "[formField]",
|
|
@@ -273,7 +169,7 @@ class FormField {
|
|
|
273
169
|
}
|
|
274
170
|
i0.ɵɵngDeclareClassMetadata({
|
|
275
171
|
minVersion: "12.0.0",
|
|
276
|
-
version: "21.1.0
|
|
172
|
+
version: "21.1.0",
|
|
277
173
|
ngImport: i0,
|
|
278
174
|
type: FormField,
|
|
279
175
|
decorators: [{
|
|
@@ -745,5 +641,5 @@ function debounceForDuration(durationInMilliseconds) {
|
|
|
745
641
|
}
|
|
746
642
|
function immediate() {}
|
|
747
643
|
|
|
748
|
-
export { EmailValidationError,
|
|
644
|
+
export { EmailValidationError, FORM_FIELD, FormField, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, RequiredValidationError, StandardSchemaValidationError, createManagedMetadataKey, createMetadataKey, debounce, disabled, email, emailError, hidden, max, maxError, maxLength, maxLengthError, metadata, min, minError, minLength, minLengthError, pattern, patternError, provideSignalFormsConfig, readonly, required, requiredError, standardSchemaError, validate, validateAsync, validateHttp, validateStandardSchema, validateTree };
|
|
749
645
|
//# sourceMappingURL=signals.mjs.map
|