@angular/common 20.0.6 → 20.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{common_module.d.d.ts → common_module.d-Cpp8wYHt.d.ts} +11 -11
- package/fesm2022/common.mjs +59 -31
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/{common_module.mjs → common_module-D4mHDfs1.mjs} +97 -97
- package/fesm2022/common_module-D4mHDfs1.mjs.map +1 -0
- package/fesm2022/http/testing.mjs +13 -10
- package/fesm2022/http/testing.mjs.map +1 -1
- package/fesm2022/http.mjs +19 -24
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/{location.mjs → location-BIEtBxGx.mjs} +17 -17
- package/fesm2022/location-BIEtBxGx.mjs.map +1 -0
- package/fesm2022/{module.mjs → module-CBsxN_3E.mjs} +40 -46
- package/fesm2022/module-CBsxN_3E.mjs.map +1 -0
- package/fesm2022/{platform_navigation.mjs → platform_navigation-B45Jeakb.mjs} +5 -5
- package/fesm2022/platform_navigation-B45Jeakb.mjs.map +1 -0
- package/fesm2022/testing.mjs +18 -18
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +7 -7
- package/fesm2022/upgrade.mjs.map +1 -1
- package/fesm2022/{xhr.mjs → xhr-CEmSPUGj.mjs} +2 -2
- package/fesm2022/xhr-CEmSPUGj.mjs.map +1 -0
- package/http/index.d.ts +4 -4
- package/http/testing/index.d.ts +2 -2
- package/index.d.ts +19 -7
- package/{module.d.d.ts → module.d-yNBsZ8gb.d.ts} +1 -1
- package/package.json +2 -2
- package/{platform_location.d.d.ts → platform_location.d-Lbv6Ueec.d.ts} +1 -1
- package/testing/index.d.ts +2 -2
- package/upgrade/index.d.ts +3 -3
- package/{xhr.d.d.ts → xhr.d-D_1kTQR5.d.ts} +1 -1
- package/fesm2022/common_module.mjs.map +0 -1
- package/fesm2022/location.mjs.map +0 -1
- package/fesm2022/module.mjs.map +0 -1
- package/fesm2022/platform_navigation.mjs.map +0 -1
- package/fesm2022/xhr.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { InjectionToken, OnDestroy, DoCheck, ElementRef, Renderer2, OnChanges, Type, Injector, NgModuleFactory, ViewContainerRef, SimpleChanges, NgIterable, TrackByFunction, TemplateRef, IterableDiffers, KeyValueDiffers, PipeTransform, ChangeDetectorRef } from '@angular/core';
|
|
9
9
|
import { SubscriptionLike, Observable, Subscribable } from 'rxjs';
|
|
10
|
-
import { LocationChangeListener, PlatformLocation } from './platform_location.d.js';
|
|
10
|
+
import { LocationChangeListener, PlatformLocation } from './platform_location.d-Lbv6Ueec.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Enables the `Location` service to read route state from the browser's URL.
|
|
@@ -812,7 +812,7 @@ declare class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> implements DoC
|
|
|
812
812
|
* @publicApi
|
|
813
813
|
*
|
|
814
814
|
* @deprecated 20.0
|
|
815
|
-
* Use the
|
|
815
|
+
* Use the @if block instead. Intent to remove in v22
|
|
816
816
|
*/
|
|
817
817
|
declare class NgIf<T = unknown> {
|
|
818
818
|
private _viewContainer;
|
|
@@ -824,17 +824,17 @@ declare class NgIf<T = unknown> {
|
|
|
824
824
|
constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext<T>>);
|
|
825
825
|
/**
|
|
826
826
|
* The Boolean expression to evaluate as the condition for showing a template.
|
|
827
|
-
* @deprecated Use the
|
|
827
|
+
* @deprecated Use the @if block instead. Intent to remove in v22
|
|
828
828
|
*/
|
|
829
829
|
set ngIf(condition: T);
|
|
830
830
|
/**
|
|
831
831
|
* A template to show if the condition expression evaluates to true.
|
|
832
|
-
* @deprecated Use the
|
|
832
|
+
* @deprecated Use the @if block instead. Intent to remove in v22
|
|
833
833
|
*/
|
|
834
834
|
set ngIfThen(templateRef: TemplateRef<NgIfContext<T>> | null);
|
|
835
835
|
/**
|
|
836
836
|
* A template to show if the condition expression evaluates to false.
|
|
837
|
-
* @deprecated Use the
|
|
837
|
+
* @deprecated Use the @if block instead. Intent to remove in v22
|
|
838
838
|
*/
|
|
839
839
|
set ngIfElse(templateRef: TemplateRef<NgIfContext<T>> | null);
|
|
840
840
|
private _updateView;
|
|
@@ -1059,7 +1059,7 @@ declare class SwitchView {
|
|
|
1059
1059
|
* @see [Structural Directives](guide/directives/structural-directives)
|
|
1060
1060
|
*
|
|
1061
1061
|
* @deprecated 20.0
|
|
1062
|
-
* Use the
|
|
1062
|
+
* Use the @switch block instead. Intent to remove in v22
|
|
1063
1063
|
*/
|
|
1064
1064
|
declare class NgSwitch {
|
|
1065
1065
|
private _defaultViews;
|
|
@@ -1068,7 +1068,7 @@ declare class NgSwitch {
|
|
|
1068
1068
|
private _lastCaseCheckIndex;
|
|
1069
1069
|
private _lastCasesMatched;
|
|
1070
1070
|
private _ngSwitch;
|
|
1071
|
-
/** @deprecated Use the
|
|
1071
|
+
/** @deprecated Use the @switch block instead. Intent to remove in v22 */
|
|
1072
1072
|
set ngSwitch(newValue: any);
|
|
1073
1073
|
private _updateDefaultCases;
|
|
1074
1074
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitch, never>;
|
|
@@ -1107,14 +1107,14 @@ declare class NgSwitch {
|
|
|
1107
1107
|
* @see {@link NgSwitchDefault}
|
|
1108
1108
|
*
|
|
1109
1109
|
* @deprecated 20.0
|
|
1110
|
-
* Use the
|
|
1110
|
+
* Use the @case block within a @switch block instead. Intent to remove in v22
|
|
1111
1111
|
*/
|
|
1112
1112
|
declare class NgSwitchCase implements DoCheck {
|
|
1113
1113
|
private ngSwitch;
|
|
1114
1114
|
private _view;
|
|
1115
1115
|
/**
|
|
1116
1116
|
* Stores the HTML template to be selected on match.
|
|
1117
|
-
* @deprecated Use the
|
|
1117
|
+
* @deprecated Use the @case block within a @switch block instead. Intent to remove in v22
|
|
1118
1118
|
*/
|
|
1119
1119
|
ngSwitchCase: any;
|
|
1120
1120
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
|
|
@@ -1140,7 +1140,7 @@ declare class NgSwitchCase implements DoCheck {
|
|
|
1140
1140
|
* @see {@link NgSwitchCase}
|
|
1141
1141
|
*
|
|
1142
1142
|
* @deprecated 20.0
|
|
1143
|
-
* Use the
|
|
1143
|
+
* Use the @default block within a @switch block instead. Intent to remove in v22
|
|
1144
1144
|
*/
|
|
1145
1145
|
declare class NgSwitchDefault {
|
|
1146
1146
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
|
package/fesm2022/common.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export { AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PercentPipe, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits } from './common_module.mjs';
|
|
7
|
+
export { AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PercentPipe, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits } from './common_module-D4mHDfs1.mjs';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { ɵregisterLocaleData as _registerLocaleData, Version, ɵɵdefineInjectable as __defineInjectable, inject, DOCUMENT,
|
|
9
|
+
import { ɵregisterLocaleData as _registerLocaleData, Version, ɵɵdefineInjectable as __defineInjectable, inject, DOCUMENT, InjectionToken, ɵRuntimeError as _RuntimeError, ɵformatRuntimeError as _formatRuntimeError, Injectable, ɵIMAGE_CONFIG as _IMAGE_CONFIG, Renderer2, ElementRef, Injector, DestroyRef, ɵperformanceMarkFeature as _performanceMarkFeature, NgZone, ApplicationRef, numberAttribute, booleanAttribute, Directive, Input, ɵIMAGE_CONFIG_DEFAULTS as _IMAGE_CONFIG_DEFAULTS, ɵunwrapSafeValue as _unwrapSafeValue, ChangeDetectorRef } from '@angular/core';
|
|
10
10
|
export { DOCUMENT, ɵIMAGE_CONFIG as IMAGE_CONFIG } from '@angular/core';
|
|
11
|
-
export { XhrFactory, parseCookieValue as ɵparseCookieValue } from './xhr.mjs';
|
|
12
|
-
export { APP_BASE_HREF, BrowserPlatformLocation, LOCATION_INITIALIZED, Location, LocationStrategy, PathLocationStrategy, PlatformLocation, DomAdapter as ɵDomAdapter, getDOM as ɵgetDOM, normalizeQueryParams as ɵnormalizeQueryParams, setRootDomAdapter as ɵsetRootDomAdapter } from './location.mjs';
|
|
13
|
-
export { PlatformNavigation as ɵPlatformNavigation } from './platform_navigation.mjs';
|
|
11
|
+
export { XhrFactory, parseCookieValue as ɵparseCookieValue } from './xhr-CEmSPUGj.mjs';
|
|
12
|
+
export { APP_BASE_HREF, BrowserPlatformLocation, LOCATION_INITIALIZED, Location, LocationStrategy, PathLocationStrategy, PlatformLocation, DomAdapter as ɵDomAdapter, getDOM as ɵgetDOM, normalizeQueryParams as ɵnormalizeQueryParams, setRootDomAdapter as ɵsetRootDomAdapter } from './location-BIEtBxGx.mjs';
|
|
13
|
+
export { PlatformNavigation as ɵPlatformNavigation } from './platform_navigation-B45Jeakb.mjs';
|
|
14
14
|
import 'rxjs';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -51,7 +51,7 @@ function isPlatformServer(platformId) {
|
|
|
51
51
|
/**
|
|
52
52
|
* @publicApi
|
|
53
53
|
*/
|
|
54
|
-
const VERSION = new Version('20.0.
|
|
54
|
+
const VERSION = new Version('20.1.0-next.1');
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
|
|
@@ -137,18 +137,7 @@ class BrowserViewportScroller {
|
|
|
137
137
|
* Disables automatic scroll restoration provided by the browser.
|
|
138
138
|
*/
|
|
139
139
|
setHistoryScrollRestoration(scrollRestoration) {
|
|
140
|
-
|
|
141
|
-
this.window.history.scrollRestoration = scrollRestoration;
|
|
142
|
-
}
|
|
143
|
-
catch {
|
|
144
|
-
console.warn(_formatRuntimeError(2400 /* RuntimeErrorCode.SCROLL_RESTORATION_UNSUPPORTED */, ngDevMode &&
|
|
145
|
-
'Failed to set `window.history.scrollRestoration`. ' +
|
|
146
|
-
'This may occur when:\n' +
|
|
147
|
-
'• The script is running inside a sandboxed iframe\n' +
|
|
148
|
-
'• The window is partially navigated or inactive\n' +
|
|
149
|
-
'• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)\n' +
|
|
150
|
-
'Scroll position may not be preserved across navigation.'));
|
|
151
|
-
}
|
|
140
|
+
this.window.history.scrollRestoration = scrollRestoration;
|
|
152
141
|
}
|
|
153
142
|
/**
|
|
154
143
|
* Scrolls to an element using the native offset and the specified offset set on this scroller.
|
|
@@ -674,10 +663,10 @@ class LCPImageObserver {
|
|
|
674
663
|
this.observer.disconnect();
|
|
675
664
|
this.images.clear();
|
|
676
665
|
}
|
|
677
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
678
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.
|
|
666
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
667
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
|
|
679
668
|
}
|
|
680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: LCPImageObserver, decorators: [{
|
|
681
670
|
type: Injectable,
|
|
682
671
|
args: [{ providedIn: 'root' }]
|
|
683
672
|
}], ctorParameters: () => [] });
|
|
@@ -795,10 +784,10 @@ class PreconnectLinkChecker {
|
|
|
795
784
|
this.preconnectLinks?.clear();
|
|
796
785
|
this.alreadySeen.clear();
|
|
797
786
|
}
|
|
798
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
799
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.
|
|
787
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
788
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
800
789
|
}
|
|
801
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
802
791
|
type: Injectable,
|
|
803
792
|
args: [{ providedIn: 'root' }]
|
|
804
793
|
}], ctorParameters: () => [] });
|
|
@@ -886,10 +875,10 @@ class PreloadLinkCreator {
|
|
|
886
875
|
}
|
|
887
876
|
renderer.appendChild(this.document.head, preload);
|
|
888
877
|
}
|
|
889
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
890
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.
|
|
878
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
879
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
|
|
891
880
|
}
|
|
892
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
881
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: PreloadLinkCreator, decorators: [{
|
|
893
882
|
type: Injectable,
|
|
894
883
|
args: [{ providedIn: 'root' }]
|
|
895
884
|
}] });
|
|
@@ -1126,6 +1115,17 @@ class NgOptimizedImage {
|
|
|
1126
1115
|
* For fixed size images: the desired rendered height of the image in pixels.
|
|
1127
1116
|
*/
|
|
1128
1117
|
height;
|
|
1118
|
+
/**
|
|
1119
|
+
* The desired decoding behavior for the image. Defaults to `auto`
|
|
1120
|
+
* if not explicitly set, matching native browser behavior.
|
|
1121
|
+
*
|
|
1122
|
+
* Use `async` to decode the image off the main thread (non-blocking),
|
|
1123
|
+
* `sync` for immediate decoding (blocking), or `auto` to let the
|
|
1124
|
+
* browser decide the optimal strategy.
|
|
1125
|
+
*
|
|
1126
|
+
* [Spec](https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint)
|
|
1127
|
+
*/
|
|
1128
|
+
decoding;
|
|
1129
1129
|
/**
|
|
1130
1130
|
* The desired loading behavior (lazy, eager, or auto). Defaults to `lazy`,
|
|
1131
1131
|
* which is recommended for most images.
|
|
@@ -1220,6 +1220,7 @@ class NgOptimizedImage {
|
|
|
1220
1220
|
ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
|
|
1221
1221
|
}
|
|
1222
1222
|
assertValidLoadingInput(this);
|
|
1223
|
+
assertValidDecodingInput(this);
|
|
1223
1224
|
if (!this.ngSrcset) {
|
|
1224
1225
|
assertNoComplexSizes(this);
|
|
1225
1226
|
}
|
|
@@ -1256,6 +1257,7 @@ class NgOptimizedImage {
|
|
|
1256
1257
|
}
|
|
1257
1258
|
this.setHostAttribute('loading', this.getLoadingBehavior());
|
|
1258
1259
|
this.setHostAttribute('fetchpriority', this.getFetchPriority());
|
|
1260
|
+
this.setHostAttribute('decoding', this.getDecoding());
|
|
1259
1261
|
// The `data-ng-img` attribute flags an image as using the directive, to allow
|
|
1260
1262
|
// for analysis of the directive's performance.
|
|
1261
1263
|
this.setHostAttribute('ng-img', 'true');
|
|
@@ -1333,6 +1335,19 @@ class NgOptimizedImage {
|
|
|
1333
1335
|
getFetchPriority() {
|
|
1334
1336
|
return this.priority ? 'high' : 'auto';
|
|
1335
1337
|
}
|
|
1338
|
+
getDecoding() {
|
|
1339
|
+
if (this.priority) {
|
|
1340
|
+
// `sync` means the image is decoded immediately when it's loaded,
|
|
1341
|
+
// reducing the risk of content shifting later (important for LCP).
|
|
1342
|
+
// If we're marking an image as priority, we want it decoded and
|
|
1343
|
+
// painted as early as possible.
|
|
1344
|
+
return 'sync';
|
|
1345
|
+
}
|
|
1346
|
+
// Returns the value of the `decoding` attribute, defaulting to `auto`
|
|
1347
|
+
// if not explicitly provided. This mimics native browser behavior and
|
|
1348
|
+
// avoids breaking changes when no decoding strategy is specified.
|
|
1349
|
+
return this.decoding ?? 'auto';
|
|
1350
|
+
}
|
|
1336
1351
|
getRewrittenSrc() {
|
|
1337
1352
|
// ImageLoaderConfig supports setting a width property. However, we're not setting width here
|
|
1338
1353
|
// because if the developer uses rendered width instead of intrinsic width in the HTML width
|
|
@@ -1457,10 +1472,10 @@ class NgOptimizedImage {
|
|
|
1457
1472
|
setHostAttribute(name, value) {
|
|
1458
1473
|
this.renderer.setAttribute(this.imgElement, name, value);
|
|
1459
1474
|
}
|
|
1460
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
1461
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.
|
|
1475
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: NgOptimizedImage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1476
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.1.0-next.1", 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 });
|
|
1462
1477
|
}
|
|
1463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
1478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.1", ngImport: i0, type: NgOptimizedImage, decorators: [{
|
|
1464
1479
|
type: Directive,
|
|
1465
1480
|
args: [{
|
|
1466
1481
|
selector: 'img[ngSrc]',
|
|
@@ -1489,6 +1504,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
1489
1504
|
}], height: [{
|
|
1490
1505
|
type: Input,
|
|
1491
1506
|
args: [{ transform: numberAttribute }]
|
|
1507
|
+
}], decoding: [{
|
|
1508
|
+
type: Input
|
|
1492
1509
|
}], loading: [{
|
|
1493
1510
|
type: Input
|
|
1494
1511
|
}], priority: [{
|
|
@@ -1885,6 +1902,17 @@ function assertValidLoadingInput(dir) {
|
|
|
1885
1902
|
`To fix this, provide a valid value ("lazy", "eager", or "auto").`);
|
|
1886
1903
|
}
|
|
1887
1904
|
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Verifies that the `decoding` attribute is set to a valid input.
|
|
1907
|
+
*/
|
|
1908
|
+
function assertValidDecodingInput(dir) {
|
|
1909
|
+
const validInputs = ['sync', 'async', 'auto'];
|
|
1910
|
+
if (typeof dir.decoding === 'string' && !validInputs.includes(dir.decoding)) {
|
|
1911
|
+
throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute ` +
|
|
1912
|
+
`has an invalid value (\`${dir.decoding}\`). ` +
|
|
1913
|
+
`To fix this, provide a valid value ("sync", "async", or "auto").`);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1888
1916
|
/**
|
|
1889
1917
|
* Warns if NOT using a loader (falling back to the generic loader) and
|
|
1890
1918
|
* the image appears to be hosted on one of the image CDNs for which
|