@angular/core 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/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +36 -32
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +1 -1
- package/fesm2022/_linked_signal-chunk.mjs +1 -1
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_resource-chunk.mjs +1 -1
- package/fesm2022/_untracked-chunk.mjs +10 -5
- package/fesm2022/_untracked-chunk.mjs.map +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +5 -5
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -1
- package/fesm2022/primitives-signals.mjs +1 -1
- package/fesm2022/primitives-signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +2 -2
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
- package/schematics/bundles/application-config-core.cjs +1 -1
- package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
- package/schematics/bundles/bootstrap-options-migration.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/common-to-standalone-migration.cjs +9 -5
- package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/imports-CVmcbVA9.cjs +1 -1
- package/schematics/bundles/index-BtLcQH8g.cjs +1 -1
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
- package/schematics/bundles/migrate_ts_type_references-CV7qdt5t.cjs +1 -1
- package/schematics/bundles/ng_component_template-BOuKAnQd.cjs +1 -1
- package/schematics/bundles/ng_decorators-DYy6II6x.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
- package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
- package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +1 -1
- package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
- package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
- package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +1 -1
- package/schematics/bundles/router-current-navigation.cjs +1 -1
- package/schematics/bundles/router-last-successful-navigation.cjs +1 -1
- package/schematics/bundles/router-testing-module-migration.cjs +1 -1
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +1 -1
- package/schematics/bundles/signal-queries-migration.cjs +1 -1
- package/schematics/bundles/signals.cjs +1 -1
- package/schematics/bundles/standalone-migration.cjs +1 -1
- package/schematics/bundles/symbol-DZeHSR-V.cjs +1 -1
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
- package/types/_discovery-chunk.d.ts +1 -1
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +1 -1
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +430 -417
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +1 -1
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
|
@@ -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
|
*/
|
|
@@ -8116,7 +8116,7 @@ function controlBinding(binding, tNode) {
|
|
|
8116
8116
|
return directive[ɵCONTROL];
|
|
8117
8117
|
}
|
|
8118
8118
|
function inputBinding(publicName, value) {
|
|
8119
|
-
if (publicName === '
|
|
8119
|
+
if (publicName === 'formField') {
|
|
8120
8120
|
const binding = {
|
|
8121
8121
|
[BINDING]: FIELD_BINDING_METADATA,
|
|
8122
8122
|
create: () => {
|
|
@@ -8313,7 +8313,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
8313
8313
|
}
|
|
8314
8314
|
}
|
|
8315
8315
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
8316
|
-
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.1.0
|
|
8316
|
+
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.1.0'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
8317
8317
|
let creationBindings = null;
|
|
8318
8318
|
let updateBindings = null;
|
|
8319
8319
|
let varsToAllocate = 0;
|
|
@@ -13278,21 +13278,21 @@ function ɵɵcontrolCreate() {
|
|
|
13278
13278
|
if (tView.firstCreatePass) {
|
|
13279
13279
|
initializeControlFirstCreatePass(tView, tNode, lView);
|
|
13280
13280
|
}
|
|
13281
|
-
const
|
|
13282
|
-
if (!
|
|
13281
|
+
const fieldDirective = getFieldDirective(tNode, lView);
|
|
13282
|
+
if (!fieldDirective) {
|
|
13283
13283
|
return;
|
|
13284
13284
|
}
|
|
13285
13285
|
performanceMarkFeature('NgSignalForms');
|
|
13286
13286
|
if (tNode.flags & 1024) {
|
|
13287
|
-
|
|
13287
|
+
initializeCustomControl(lView, tNode, fieldDirective, 'value');
|
|
13288
13288
|
} else if (tNode.flags & 2048) {
|
|
13289
|
-
|
|
13289
|
+
initializeCustomControl(lView, tNode, fieldDirective, 'checked');
|
|
13290
13290
|
} else if (tNode.flags & 4096) {
|
|
13291
|
-
|
|
13292
|
-
} else {
|
|
13293
|
-
|
|
13291
|
+
initializeInteropControl(fieldDirective);
|
|
13292
|
+
} else if (tNode.flags & 8192) {
|
|
13293
|
+
initializeNativeControl(lView, tNode, fieldDirective);
|
|
13294
13294
|
}
|
|
13295
|
-
|
|
13295
|
+
fieldDirective.ɵregister();
|
|
13296
13296
|
}
|
|
13297
13297
|
function ɵɵcontrol(value, name, sanitizer) {
|
|
13298
13298
|
const lView = getLView();
|
|
@@ -13311,24 +13311,24 @@ function ɵcontrolUpdate() {
|
|
|
13311
13311
|
updateControl(lView, tNode);
|
|
13312
13312
|
}
|
|
13313
13313
|
function updateControl(lView, tNode) {
|
|
13314
|
-
const
|
|
13315
|
-
if (
|
|
13316
|
-
updateControlClasses(lView, tNode,
|
|
13314
|
+
const fieldDirective = getFieldDirective(tNode, lView);
|
|
13315
|
+
if (fieldDirective) {
|
|
13316
|
+
updateControlClasses(lView, tNode, fieldDirective);
|
|
13317
13317
|
if (tNode.flags & 1024) {
|
|
13318
|
-
updateCustomControl(tNode, lView,
|
|
13318
|
+
updateCustomControl(tNode, lView, fieldDirective, 'value');
|
|
13319
13319
|
} else if (tNode.flags & 2048) {
|
|
13320
|
-
updateCustomControl(tNode, lView,
|
|
13320
|
+
updateCustomControl(tNode, lView, fieldDirective, 'checked');
|
|
13321
13321
|
} else if (tNode.flags & 4096) {
|
|
13322
|
-
updateInteropControl(tNode, lView,
|
|
13322
|
+
updateInteropControl(tNode, lView, fieldDirective);
|
|
13323
13323
|
} else {
|
|
13324
|
-
updateNativeControl(tNode, lView,
|
|
13324
|
+
updateNativeControl(tNode, lView, fieldDirective);
|
|
13325
13325
|
}
|
|
13326
13326
|
}
|
|
13327
13327
|
nextBindingIndex();
|
|
13328
13328
|
}
|
|
13329
13329
|
function initializeControlFirstCreatePass(tView, tNode, lView) {
|
|
13330
13330
|
ngDevMode && assertFirstCreatePass(tView);
|
|
13331
|
-
const directiveIndices = tNode.inputs?.['
|
|
13331
|
+
const directiveIndices = tNode.inputs?.['formField'];
|
|
13332
13332
|
if (!directiveIndices) {
|
|
13333
13333
|
return;
|
|
13334
13334
|
}
|
|
@@ -13344,7 +13344,7 @@ function initializeControlFirstCreatePass(tView, tNode, lView) {
|
|
|
13344
13344
|
if (isNativeControlFirstCreatePass(tNode) || foundControl) {
|
|
13345
13345
|
return;
|
|
13346
13346
|
}
|
|
13347
|
-
throw new RuntimeError(318, ngDevMode && `${describeElement(tView, tNode)} is an invalid [
|
|
13347
|
+
throw new RuntimeError(318, ngDevMode && `${describeElement(tView, tNode)} is an invalid [formField] directive host. The host must be a native form control ` + `(such as <input>', '<select>', or '<textarea>') or a custom form control with a 'value' or ` + `'checked' model.`);
|
|
13348
13348
|
}
|
|
13349
13349
|
function describeElement(tView, tNode) {
|
|
13350
13350
|
if (ngDevMode && isComponentHost(tNode)) {
|
|
@@ -13391,7 +13391,7 @@ function isNativeControlFirstCreatePass(tNode) {
|
|
|
13391
13391
|
}
|
|
13392
13392
|
return true;
|
|
13393
13393
|
}
|
|
13394
|
-
function
|
|
13394
|
+
function getFieldDirective(tNode, lView) {
|
|
13395
13395
|
const index = tNode.fieldIndex;
|
|
13396
13396
|
return index === -1 ? null : lView[index];
|
|
13397
13397
|
}
|
|
@@ -13404,21 +13404,24 @@ function hasInput(directiveDef, name) {
|
|
|
13404
13404
|
function hasOutput(directiveDef, name) {
|
|
13405
13405
|
return name in directiveDef.outputs;
|
|
13406
13406
|
}
|
|
13407
|
-
function
|
|
13407
|
+
function initializeCustomControl(lView, tNode, fieldDirective, modelName) {
|
|
13408
13408
|
const tView = getTView();
|
|
13409
13409
|
const directiveIndex = tNode.customControlIndex;
|
|
13410
13410
|
const outputName = modelName + 'Change';
|
|
13411
|
-
listenToOutput(tNode, lView, directiveIndex, outputName, outputName, wrapListener(tNode, lView, value =>
|
|
13411
|
+
listenToOutput(tNode, lView, directiveIndex, outputName, outputName, wrapListener(tNode, lView, value => fieldDirective.state().setControlValue(value)));
|
|
13412
13412
|
const directiveDef = tView.data[directiveIndex];
|
|
13413
13413
|
const touchedOutputName = 'touchedChange';
|
|
13414
13414
|
if (hasOutput(directiveDef, touchedOutputName)) {
|
|
13415
|
-
listenToOutput(tNode, lView, directiveIndex, touchedOutputName, touchedOutputName, wrapListener(tNode, lView, () =>
|
|
13415
|
+
listenToOutput(tNode, lView, directiveIndex, touchedOutputName, touchedOutputName, wrapListener(tNode, lView, () => fieldDirective.state().markAsTouched()));
|
|
13416
13416
|
}
|
|
13417
|
+
const customControl = lView[directiveIndex];
|
|
13418
|
+
fieldDirective.focus = () => customControl.focus ? customControl.focus() : fieldDirective.element.focus();
|
|
13417
13419
|
}
|
|
13418
|
-
function
|
|
13419
|
-
const interopControl =
|
|
13420
|
-
interopControl.registerOnChange(value =>
|
|
13421
|
-
interopControl.registerOnTouched(() =>
|
|
13420
|
+
function initializeInteropControl(fieldDirective) {
|
|
13421
|
+
const interopControl = fieldDirective.ɵinteropControl;
|
|
13422
|
+
interopControl.registerOnChange(value => fieldDirective.state().setControlValue(value));
|
|
13423
|
+
interopControl.registerOnTouched(() => fieldDirective.state().markAsTouched());
|
|
13424
|
+
fieldDirective.focus = () => fieldDirective.element.focus();
|
|
13422
13425
|
}
|
|
13423
13426
|
function isNativeControl(tNode) {
|
|
13424
13427
|
if (tNode.type !== 2) {
|
|
@@ -13427,23 +13430,24 @@ function isNativeControl(tNode) {
|
|
|
13427
13430
|
const tagName = tNode.value;
|
|
13428
13431
|
return tagName === 'input' || tagName === 'textarea' || tagName === 'select';
|
|
13429
13432
|
}
|
|
13430
|
-
function
|
|
13433
|
+
function initializeNativeControl(lView, tNode, fieldDirective) {
|
|
13431
13434
|
const tView = getTView();
|
|
13432
13435
|
const renderer = lView[RENDERER];
|
|
13433
13436
|
const element = getNativeByTNode(tNode, lView);
|
|
13434
13437
|
const inputListener = () => {
|
|
13435
|
-
const state =
|
|
13438
|
+
const state = fieldDirective.state();
|
|
13436
13439
|
state.setControlValue(getNativeControlValue(element, state.value));
|
|
13437
13440
|
};
|
|
13438
13441
|
listenToDomEvent(tNode, tView, lView, undefined, renderer, 'input', inputListener, wrapListener(tNode, lView, inputListener));
|
|
13439
13442
|
const blurListener = () => {
|
|
13440
|
-
|
|
13443
|
+
fieldDirective.state().markAsTouched();
|
|
13441
13444
|
};
|
|
13442
13445
|
listenToDomEvent(tNode, tView, lView, undefined, renderer, 'blur', blurListener, wrapListener(tNode, lView, blurListener));
|
|
13443
13446
|
if (tNode.type === 2 && tNode.value === 'select' && typeof MutationObserver === 'function') {
|
|
13444
|
-
const observer = observeSelectMutations(element,
|
|
13447
|
+
const observer = observeSelectMutations(element, fieldDirective);
|
|
13445
13448
|
storeCleanupWithContext(tView, lView, observer, observer.disconnect);
|
|
13446
13449
|
}
|
|
13450
|
+
fieldDirective.focus = () => element.focus();
|
|
13447
13451
|
}
|
|
13448
13452
|
function observeSelectMutations(select, controlDirective) {
|
|
13449
13453
|
const observer = new MutationObserver(mutations => {
|