@angular/common 20.3.10 → 20.3.12

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/README.md CHANGED
@@ -1,5 +1,4 @@
1
- Angular
2
- =======
1
+ # Angular
3
2
 
4
3
  The sources for this package are in the main [Angular](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
5
4
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.3.10
2
+ * @license Angular v20.3.12
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1249,6 +1249,8 @@ declare class NgPluralCase {
1249
1249
  *
1250
1250
  * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
1251
1251
  *
1252
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1253
+ *
1252
1254
  * @publicApi
1253
1255
  */
1254
1256
  declare class AsyncPipe implements OnDestroy, PipeTransform {
@@ -1284,6 +1286,8 @@ declare class AsyncPipe implements OnDestroy, PipeTransform {
1284
1286
  *
1285
1287
  * {@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe'}
1286
1288
  *
1289
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1290
+ *
1287
1291
  * @ngModule CommonModule
1288
1292
  * @publicApi
1289
1293
  */
@@ -1311,6 +1315,8 @@ declare class LowerCasePipe implements PipeTransform {
1311
1315
  *
1312
1316
  * {@example common/pipes/ts/titlecase_pipe.ts region='TitleCasePipe'}
1313
1317
  *
1318
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1319
+ *
1314
1320
  * @ngModule CommonModule
1315
1321
  * @publicApi
1316
1322
  */
@@ -1328,6 +1334,7 @@ declare class TitleCasePipe implements PipeTransform {
1328
1334
  * Transforms text to all upper case.
1329
1335
  * @see {@link LowerCasePipe}
1330
1336
  * @see {@link TitleCasePipe}
1337
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1331
1338
  *
1332
1339
  * @ngModule CommonModule
1333
1340
  * @publicApi
@@ -1356,6 +1363,8 @@ declare class UpperCasePipe implements PipeTransform {
1356
1363
  *
1357
1364
  * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
1358
1365
  *
1366
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1367
+ *
1359
1368
  * @publicApi
1360
1369
  */
1361
1370
  declare class JsonPipe implements PipeTransform {
@@ -1400,6 +1409,8 @@ declare class JsonPipe implements PipeTransform {
1400
1409
  *
1401
1410
  * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
1402
1411
  *
1412
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1413
+ *
1403
1414
  * @publicApi
1404
1415
  */
1405
1416
  declare class SlicePipe implements PipeTransform {
@@ -1488,6 +1499,8 @@ declare class SlicePipe implements PipeTransform {
1488
1499
  *
1489
1500
  * {@example common/pipes/ts/number_pipe.ts region='NumberPipe'}
1490
1501
  *
1502
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1503
+ *
1491
1504
  * @publicApi
1492
1505
  */
1493
1506
  declare class DecimalPipe implements PipeTransform {
@@ -1524,6 +1537,8 @@ declare class DecimalPipe implements PipeTransform {
1524
1537
  *
1525
1538
  * {@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}
1526
1539
  *
1540
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1541
+ *
1527
1542
  * @publicApi
1528
1543
  */
1529
1544
  declare class PercentPipe implements PipeTransform {
@@ -1554,6 +1569,8 @@ declare class PercentPipe implements PipeTransform {
1554
1569
  *
1555
1570
  * {@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}
1556
1571
  *
1572
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1573
+ *
1557
1574
  * @publicApi
1558
1575
  */
1559
1576
  declare class CurrencyPipe implements PipeTransform {
@@ -1808,6 +1825,8 @@ declare const DATE_PIPE_DEFAULT_OPTIONS: InjectionToken<DatePipeConfig>;
1808
1825
  * }
1809
1826
  * ```
1810
1827
  *
1828
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1829
+ *
1811
1830
  * @publicApi
1812
1831
  */
1813
1832
  declare class DatePipe implements PipeTransform {
@@ -1853,6 +1872,8 @@ declare class DatePipe implements PipeTransform {
1853
1872
  *
1854
1873
  * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
1855
1874
  *
1875
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1876
+ *
1856
1877
  * @publicApi
1857
1878
  */
1858
1879
  declare class I18nPluralPipe implements PipeTransform {
@@ -1887,6 +1908,8 @@ declare class I18nPluralPipe implements PipeTransform {
1887
1908
  *
1888
1909
  * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
1889
1910
  *
1911
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1912
+ *
1890
1913
  * @publicApi
1891
1914
  */
1892
1915
  declare class I18nSelectPipe implements PipeTransform {
@@ -1931,6 +1954,8 @@ interface KeyValue<K, V> {
1931
1954
  *
1932
1955
  * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
1933
1956
  *
1957
+ * @see [Built-in Pipes](guide/templates/pipes#built-in-pipes)
1958
+ *
1934
1959
  * @publicApi
1935
1960
  */
1936
1961
  declare class KeyValuePipe implements PipeTransform {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.3.10
2
+ * @license Angular v20.3.12
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -51,7 +51,7 @@ function isPlatformServer(platformId) {
51
51
  /**
52
52
  * @publicApi
53
53
  */
54
- const VERSION = new Version('20.3.10');
54
+ const VERSION = /* @__PURE__ */ new Version('20.3.12');
55
55
 
56
56
  /**
57
57
  * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
@@ -674,10 +674,10 @@ class LCPImageObserver {
674
674
  this.observer.disconnect();
675
675
  this.images.clear();
676
676
  }
677
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
678
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
677
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
678
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
679
679
  }
680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: LCPImageObserver, decorators: [{
680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LCPImageObserver, decorators: [{
681
681
  type: Injectable,
682
682
  args: [{ providedIn: 'root' }]
683
683
  }], ctorParameters: () => [] });
@@ -795,10 +795,10 @@ class PreconnectLinkChecker {
795
795
  this.preconnectLinks?.clear();
796
796
  this.alreadySeen.clear();
797
797
  }
798
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
799
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
798
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
799
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
800
800
  }
801
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
802
802
  type: Injectable,
803
803
  args: [{ providedIn: 'root' }]
804
804
  }], ctorParameters: () => [] });
@@ -886,10 +886,10 @@ class PreloadLinkCreator {
886
886
  }
887
887
  renderer.appendChild(this.document.head, preload);
888
888
  }
889
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
890
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
889
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
890
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
891
891
  }
892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PreloadLinkCreator, decorators: [{
892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PreloadLinkCreator, decorators: [{
893
893
  type: Injectable,
894
894
  args: [{ providedIn: 'root' }]
895
895
  }] });
@@ -1084,6 +1084,7 @@ class NgOptimizedImage {
1084
1084
  renderer = inject(Renderer2);
1085
1085
  imgElement = inject(ElementRef).nativeElement;
1086
1086
  injector = inject(Injector);
1087
+ destroyRef = inject(DestroyRef);
1087
1088
  // An LCP image observer should be injected only in development mode.
1088
1089
  // Do not assign it to `null` to avoid having a redundant property in the production bundle.
1089
1090
  lcpObserver;
@@ -1190,10 +1191,7 @@ class NgOptimizedImage {
1190
1191
  constructor() {
1191
1192
  if (ngDevMode) {
1192
1193
  this.lcpObserver = this.injector.get(LCPImageObserver);
1193
- // Using `DestroyRef` to avoid having an empty `ngOnDestroy` method since this
1194
- // is only run in development mode.
1195
- const destroyRef = inject(DestroyRef);
1196
- destroyRef.onDestroy(() => {
1194
+ this.destroyRef.onDestroy(() => {
1197
1195
  if (!this.priority && this._renderedSrc !== null) {
1198
1196
  this.lcpObserver.unregisterImage(this._renderedSrc);
1199
1197
  }
@@ -1217,7 +1215,7 @@ class NgOptimizedImage {
1217
1215
  assertEmptyWidthAndHeight(this);
1218
1216
  // This leaves the Angular zone to avoid triggering unnecessary change detection cycles when
1219
1217
  // `load` tasks are invoked on images.
1220
- ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
1218
+ ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef));
1221
1219
  }
1222
1220
  else {
1223
1221
  assertNonEmptyWidthAndHeight(this);
@@ -1229,7 +1227,7 @@ class NgOptimizedImage {
1229
1227
  }
1230
1228
  // Only check for distorted images when not in fill mode, where
1231
1229
  // images may be intentionally stretched, cropped or letterboxed.
1232
- ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
1230
+ ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef));
1233
1231
  }
1234
1232
  assertValidLoadingInput(this);
1235
1233
  assertValidDecodingInput(this);
@@ -1479,15 +1477,22 @@ class NgOptimizedImage {
1479
1477
  };
1480
1478
  const removeLoadListenerFn = this.renderer.listen(img, 'load', callback);
1481
1479
  const removeErrorListenerFn = this.renderer.listen(img, 'error', callback);
1480
+ // Clean up listeners once the view is destroyed, before the image
1481
+ // loads or fails to load, to avoid element from being captured
1482
+ // in memory and redundant change detection.
1483
+ this.destroyRef.onDestroy(() => {
1484
+ removeLoadListenerFn();
1485
+ removeErrorListenerFn();
1486
+ });
1482
1487
  callOnLoadIfImageIsLoaded(img, callback);
1483
1488
  }
1484
1489
  setHostAttribute(name, value) {
1485
1490
  this.renderer.setAttribute(this.imgElement, name, value);
1486
1491
  }
1487
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgOptimizedImage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1488
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.10", type: NgOptimizedImage, isStandalone: true, selector: "img[ngSrc]", inputs: { ngSrc: ["ngSrc", "ngSrc", unwrapSafeUrl], ngSrcset: "ngSrcset", sizes: "sizes", width: ["width", "width", numberAttribute], height: ["height", "height", numberAttribute], decoding: "decoding", loading: "loading", priority: ["priority", "priority", booleanAttribute], loaderParams: "loaderParams", disableOptimizedSrcset: ["disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute], fill: ["fill", "fill", booleanAttribute], placeholder: ["placeholder", "placeholder", booleanOrUrlAttribute], placeholderConfig: "placeholderConfig", src: "src", srcset: "srcset" }, host: { properties: { "style.position": "fill ? \"absolute\" : null", "style.width": "fill ? \"100%\" : null", "style.height": "fill ? \"100%\" : null", "style.inset": "fill ? \"0\" : null", "style.background-size": "placeholder ? \"cover\" : null", "style.background-position": "placeholder ? \"50% 50%\" : null", "style.background-repeat": "placeholder ? \"no-repeat\" : null", "style.background-image": "placeholder ? generatePlaceholder(placeholder) : null", "style.filter": "placeholder && shouldBlurPlaceholder(placeholderConfig) ? \"blur(15px)\" : null" } }, usesOnChanges: true, ngImport: i0 });
1492
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptimizedImage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1493
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.12", type: NgOptimizedImage, isStandalone: true, selector: "img[ngSrc]", inputs: { ngSrc: ["ngSrc", "ngSrc", unwrapSafeUrl], ngSrcset: "ngSrcset", sizes: "sizes", width: ["width", "width", numberAttribute], height: ["height", "height", numberAttribute], decoding: "decoding", loading: "loading", priority: ["priority", "priority", booleanAttribute], loaderParams: "loaderParams", disableOptimizedSrcset: ["disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute], fill: ["fill", "fill", booleanAttribute], placeholder: ["placeholder", "placeholder", booleanOrUrlAttribute], placeholderConfig: "placeholderConfig", src: "src", srcset: "srcset" }, host: { properties: { "style.position": "fill ? \"absolute\" : null", "style.width": "fill ? \"100%\" : null", "style.height": "fill ? \"100%\" : null", "style.inset": "fill ? \"0\" : null", "style.background-size": "placeholder ? \"cover\" : null", "style.background-position": "placeholder ? \"50% 50%\" : null", "style.background-repeat": "placeholder ? \"no-repeat\" : null", "style.background-image": "placeholder ? generatePlaceholder(placeholder) : null", "style.filter": "placeholder && shouldBlurPlaceholder(placeholderConfig) ? \"blur(15px)\" : null" } }, usesOnChanges: true, ngImport: i0 });
1489
1494
  }
1490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgOptimizedImage, decorators: [{
1495
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: NgOptimizedImage, decorators: [{
1491
1496
  type: Directive,
1492
1497
  args: [{
1493
1498
  selector: 'img[ngSrc]',
@@ -1761,7 +1766,7 @@ function assertGreaterThanZero(dir, inputValue, inputName) {
1761
1766
  * - Whether the "width" and "height" attributes reflect the actual dimensions of the image.
1762
1767
  * - Whether image styling is "correct" (see below for a longer explanation).
1763
1768
  */
1764
- function assertNoImageDistortion(dir, img, renderer) {
1769
+ function assertNoImageDistortion(dir, img, renderer, destroyRef) {
1765
1770
  const callback = () => {
1766
1771
  removeLoadListenerFn();
1767
1772
  removeErrorListenerFn();
@@ -1840,6 +1845,13 @@ function assertNoImageDistortion(dir, img, renderer) {
1840
1845
  removeLoadListenerFn();
1841
1846
  removeErrorListenerFn();
1842
1847
  });
1848
+ // Clean up listeners once the view is destroyed, before the image
1849
+ // loads or fails to load, to avoid element from being captured
1850
+ // in memory and redundant change detection.
1851
+ destroyRef.onDestroy(() => {
1852
+ removeLoadListenerFn();
1853
+ removeErrorListenerFn();
1854
+ });
1843
1855
  callOnLoadIfImageIsLoaded(img, callback);
1844
1856
  }
1845
1857
  /**
@@ -1874,7 +1886,7 @@ function assertEmptyWidthAndHeight(dir) {
1874
1886
  * Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides
1875
1887
  * guidance that this can be caused by the containing element's CSS position property.
1876
1888
  */
1877
- function assertNonZeroRenderedHeight(dir, img, renderer) {
1889
+ function assertNonZeroRenderedHeight(dir, img, renderer, destroyRef) {
1878
1890
  const callback = () => {
1879
1891
  removeLoadListenerFn();
1880
1892
  removeErrorListenerFn();
@@ -1893,6 +1905,13 @@ function assertNonZeroRenderedHeight(dir, img, renderer) {
1893
1905
  removeLoadListenerFn();
1894
1906
  removeErrorListenerFn();
1895
1907
  });
1908
+ // Clean up listeners once the view is destroyed, before the image
1909
+ // loads or fails to load, to avoid element from being captured
1910
+ // in memory and redundant change detection.
1911
+ destroyRef.onDestroy(() => {
1912
+ removeLoadListenerFn();
1913
+ removeErrorListenerFn();
1914
+ });
1896
1915
  callOnLoadIfImageIsLoaded(img, callback);
1897
1916
  }
1898
1917
  /**