@angular/common 14.2.11 → 14.3.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/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +3 -3
- package/esm2020/http/src/jsonp.mjs +6 -6
- package/esm2020/http/src/module.mjs +15 -15
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +6 -6
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +4 -4
- package/esm2020/src/common_module.mjs +4 -4
- package/esm2020/src/directives/ng_class.mjs +3 -3
- package/esm2020/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2020/src/directives/ng_for_of.mjs +3 -3
- package/esm2020/src/directives/ng_if.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.mjs +1 -6
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.mjs +15 -6
- package/esm2020/src/directives/ng_optimized_image/image_loaders/image_loader.mjs +3 -8
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imagekit_loader.mjs +15 -6
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imgix_loader.mjs +15 -6
- package/esm2020/src/directives/ng_optimized_image/index.mjs +2 -2
- package/esm2020/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/ng_optimized_image.mjs +307 -53
- package/esm2020/src/directives/ng_optimized_image/preconnect_link_checker.mjs +10 -12
- package/esm2020/src/directives/ng_optimized_image/preload-link-creator.mjs +75 -0
- package/esm2020/src/directives/ng_optimized_image/tokens.mjs +24 -0
- package/esm2020/src/directives/ng_plural.mjs +6 -6
- package/esm2020/src/directives/ng_style.mjs +3 -3
- package/esm2020/src/directives/ng_switch.mjs +9 -9
- package/esm2020/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/localization.mjs +6 -6
- package/esm2020/src/location/hash_location_strategy.mjs +3 -3
- package/esm2020/src/location/location.mjs +3 -3
- package/esm2020/src/location/location_strategy.mjs +6 -6
- package/esm2020/src/location/platform_location.mjs +6 -6
- package/esm2020/src/pipes/async_pipe.mjs +3 -3
- package/esm2020/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2020/src/pipes/date_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/json_pipe.mjs +3 -3
- package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2020/src/pipes/number_pipe.mjs +9 -9
- package/esm2020/src/pipes/slice_pipe.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/location_mock.mjs +3 -3
- package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2020/testing/src/mock_platform_location.mjs +3 -3
- package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2015/common.mjs +707 -347
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +8 -8
- package/fesm2015/http.mjs +37 -37
- package/fesm2015/testing.mjs +10 -10
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2020/common.mjs +705 -346
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +8 -8
- package/fesm2020/http.mjs +37 -37
- package/fesm2020/testing.mjs +10 -10
- package/fesm2020/upgrade.mjs +5 -5
- package/http/index.d.ts +1 -1
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +58 -55
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2020/common.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.
|
|
2
|
+
* @license Angular v14.3.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { InjectionToken, Injectable, ɵɵinject, Inject, inject, Optional, EventEmitter, ɵfindLocaleData, ɵLocaleDataIndex, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, LOCALE_ID, ɵregisterLocaleData, ɵisListLikeIterable, ɵstringify, Directive, Input, createNgModule, NgModuleRef, ɵRuntimeError, Host, Attribute, RendererStyleFlags2, ɵisPromise, ɵisSubscribable, Pipe, DEFAULT_CURRENCY_CODE, NgModule, Version, ɵɵdefineInjectable, ɵformatRuntimeError, Renderer2, ElementRef, Injector, NgZone } from '@angular/core';
|
|
8
|
+
import { InjectionToken, Injectable, ɵɵinject, Inject, inject, Optional, EventEmitter, ɵfindLocaleData, ɵLocaleDataIndex, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, LOCALE_ID, ɵregisterLocaleData, ɵisListLikeIterable, ɵstringify, Directive, Input, createNgModule, NgModuleRef, ɵRuntimeError, Host, Attribute, RendererStyleFlags2, ɵisPromise, ɵisSubscribable, Pipe, DEFAULT_CURRENCY_CODE, NgModule, Version, ɵɵdefineInjectable, ɵformatRuntimeError, Renderer2, ElementRef, Injector, PLATFORM_ID, NgZone } from '@angular/core';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -87,9 +87,9 @@ class PlatformLocation {
|
|
|
87
87
|
throw new Error('Not implemented');
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
PlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
91
|
-
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
90
|
+
PlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PlatformLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
+
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PlatformLocation, providedIn: 'platform', useFactory: useBrowserPlatformLocation });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PlatformLocation, decorators: [{
|
|
93
93
|
type: Injectable,
|
|
94
94
|
args: [{
|
|
95
95
|
providedIn: 'platform',
|
|
@@ -190,9 +190,9 @@ class BrowserPlatformLocation extends PlatformLocation {
|
|
|
190
190
|
return this._history.state;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
BrowserPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
194
|
-
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
193
|
+
BrowserPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BrowserPlatformLocation, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
194
|
+
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BrowserPlatformLocation, providedIn: 'platform', useFactory: createBrowserPlatformLocation });
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BrowserPlatformLocation, decorators: [{
|
|
196
196
|
type: Injectable,
|
|
197
197
|
args: [{
|
|
198
198
|
providedIn: 'platform',
|
|
@@ -311,9 +311,9 @@ class LocationStrategy {
|
|
|
311
311
|
throw new Error('Not implemented');
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
315
|
-
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
314
|
+
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LocationStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
315
|
+
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LocationStrategy, providedIn: 'root', useFactory: () => inject(PathLocationStrategy) });
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LocationStrategy, decorators: [{
|
|
317
317
|
type: Injectable,
|
|
318
318
|
args: [{ providedIn: 'root', useFactory: () => inject(PathLocationStrategy) }]
|
|
319
319
|
}] });
|
|
@@ -421,9 +421,9 @@ class PathLocationStrategy extends LocationStrategy {
|
|
|
421
421
|
this._platformLocation.historyGo?.(relativePosition);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
425
|
-
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
424
|
+
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PathLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
425
|
+
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PathLocationStrategy, providedIn: 'root' });
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PathLocationStrategy, decorators: [{
|
|
427
427
|
type: Injectable,
|
|
428
428
|
args: [{ providedIn: 'root' }]
|
|
429
429
|
}], ctorParameters: function () { return [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
@@ -519,9 +519,9 @@ class HashLocationStrategy extends LocationStrategy {
|
|
|
519
519
|
this._platformLocation.historyGo?.(relativePosition);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
523
|
-
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
522
|
+
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HashLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
523
|
+
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HashLocationStrategy });
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HashLocationStrategy, decorators: [{
|
|
525
525
|
type: Injectable
|
|
526
526
|
}], ctorParameters: function () { return [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
527
527
|
type: Optional
|
|
@@ -772,9 +772,9 @@ Location.joinWithSlash = joinWithSlash;
|
|
|
772
772
|
* @returns The URL string, modified if needed.
|
|
773
773
|
*/
|
|
774
774
|
Location.stripTrailingSlash = stripTrailingSlash;
|
|
775
|
-
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
776
|
-
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
775
|
+
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Location, deps: [{ token: LocationStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
776
|
+
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Location, providedIn: 'root', useFactory: createLocation });
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Location, decorators: [{
|
|
778
778
|
type: Injectable,
|
|
779
779
|
args: [{
|
|
780
780
|
providedIn: 'root',
|
|
@@ -2590,9 +2590,9 @@ function parseIntAutoRadix(text) {
|
|
|
2590
2590
|
*/
|
|
2591
2591
|
class NgLocalization {
|
|
2592
2592
|
}
|
|
2593
|
-
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
2594
|
-
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
2595
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
2593
|
+
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocalization, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2594
|
+
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocalization, providedIn: 'root', useFactory: (locale) => new NgLocaleLocalization(locale), deps: [{ token: LOCALE_ID }] });
|
|
2595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocalization, decorators: [{
|
|
2596
2596
|
type: Injectable,
|
|
2597
2597
|
args: [{
|
|
2598
2598
|
providedIn: 'root',
|
|
@@ -2647,9 +2647,9 @@ class NgLocaleLocalization extends NgLocalization {
|
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
|
-
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
2651
|
-
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
2652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
2650
|
+
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocaleLocalization, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2651
|
+
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocaleLocalization });
|
|
2652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgLocaleLocalization, decorators: [{
|
|
2653
2653
|
type: Injectable
|
|
2654
2654
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2655
2655
|
type: Inject,
|
|
@@ -2842,9 +2842,9 @@ class NgClass {
|
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
2844
2844
|
}
|
|
2845
|
-
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
2846
|
-
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
2847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
2845
|
+
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgClass, deps: [{ token: i0.IterableDiffers }, { token: i0.KeyValueDiffers }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2846
|
+
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgClass, isStandalone: true, selector: "[ngClass]", inputs: { klass: ["class", "klass"], ngClass: "ngClass" }, ngImport: i0 });
|
|
2847
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgClass, decorators: [{
|
|
2848
2848
|
type: Directive,
|
|
2849
2849
|
args: [{
|
|
2850
2850
|
selector: '[ngClass]',
|
|
@@ -2963,9 +2963,9 @@ class NgComponentOutlet {
|
|
|
2963
2963
|
this._moduleRef.destroy();
|
|
2964
2964
|
}
|
|
2965
2965
|
}
|
|
2966
|
-
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
2967
|
-
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
2968
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
2966
|
+
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgComponentOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2967
|
+
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgComponentOutlet, isStandalone: true, selector: "[ngComponentOutlet]", inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModule: "ngComponentOutletNgModule", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, usesOnChanges: true, ngImport: i0 });
|
|
2968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgComponentOutlet, decorators: [{
|
|
2969
2969
|
type: Directive,
|
|
2970
2970
|
args: [{
|
|
2971
2971
|
selector: '[ngComponentOutlet]',
|
|
@@ -3255,9 +3255,9 @@ class NgForOf {
|
|
|
3255
3255
|
return true;
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3259
|
-
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3258
|
+
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3259
|
+
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgForOf, isStandalone: true, selector: "[ngFor][ngForOf]", inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" }, ngImport: i0 });
|
|
3260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgForOf, decorators: [{
|
|
3261
3261
|
type: Directive,
|
|
3262
3262
|
args: [{
|
|
3263
3263
|
selector: '[ngFor][ngForOf]',
|
|
@@ -3490,9 +3490,9 @@ class NgIf {
|
|
|
3490
3490
|
return true;
|
|
3491
3491
|
}
|
|
3492
3492
|
}
|
|
3493
|
-
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3494
|
-
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3493
|
+
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgIf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3494
|
+
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgIf, isStandalone: true, selector: "[ngIf]", inputs: { ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" }, ngImport: i0 });
|
|
3495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgIf, decorators: [{
|
|
3496
3496
|
type: Directive,
|
|
3497
3497
|
args: [{
|
|
3498
3498
|
selector: '[ngIf]',
|
|
@@ -3663,9 +3663,9 @@ class NgSwitch {
|
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
3666
|
-
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3667
|
-
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3668
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3666
|
+
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3667
|
+
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgSwitch, isStandalone: true, selector: "[ngSwitch]", inputs: { ngSwitch: "ngSwitch" }, ngImport: i0 });
|
|
3668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitch, decorators: [{
|
|
3669
3669
|
type: Directive,
|
|
3670
3670
|
args: [{
|
|
3671
3671
|
selector: '[ngSwitch]',
|
|
@@ -3724,9 +3724,9 @@ class NgSwitchCase {
|
|
|
3724
3724
|
this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
|
|
3725
3725
|
}
|
|
3726
3726
|
}
|
|
3727
|
-
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3728
|
-
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3727
|
+
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitchCase, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3728
|
+
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgSwitchCase, isStandalone: true, selector: "[ngSwitchCase]", inputs: { ngSwitchCase: "ngSwitchCase" }, ngImport: i0 });
|
|
3729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitchCase, decorators: [{
|
|
3730
3730
|
type: Directive,
|
|
3731
3731
|
args: [{
|
|
3732
3732
|
selector: '[ngSwitchCase]',
|
|
@@ -3761,9 +3761,9 @@ class NgSwitchDefault {
|
|
|
3761
3761
|
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
|
|
3762
3762
|
}
|
|
3763
3763
|
}
|
|
3764
|
-
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3765
|
-
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3766
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3764
|
+
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitchDefault, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3765
|
+
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgSwitchDefault, isStandalone: true, selector: "[ngSwitchDefault]", ngImport: i0 });
|
|
3766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgSwitchDefault, decorators: [{
|
|
3767
3767
|
type: Directive,
|
|
3768
3768
|
args: [{
|
|
3769
3769
|
selector: '[ngSwitchDefault]',
|
|
@@ -3847,9 +3847,9 @@ class NgPlural {
|
|
|
3847
3847
|
}
|
|
3848
3848
|
}
|
|
3849
3849
|
}
|
|
3850
|
-
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3851
|
-
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3852
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3850
|
+
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgPlural, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3851
|
+
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgPlural, isStandalone: true, selector: "[ngPlural]", inputs: { ngPlural: "ngPlural" }, ngImport: i0 });
|
|
3852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgPlural, decorators: [{
|
|
3853
3853
|
type: Directive,
|
|
3854
3854
|
args: [{
|
|
3855
3855
|
selector: '[ngPlural]',
|
|
@@ -3885,9 +3885,9 @@ class NgPluralCase {
|
|
|
3885
3885
|
ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
|
|
3886
3886
|
}
|
|
3887
3887
|
}
|
|
3888
|
-
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3889
|
-
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3890
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3888
|
+
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgPluralCase, deps: [{ token: 'ngPluralCase', attribute: true }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: NgPlural, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3889
|
+
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgPluralCase, isStandalone: true, selector: "[ngPluralCase]", ngImport: i0 });
|
|
3890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgPluralCase, decorators: [{
|
|
3891
3891
|
type: Directive,
|
|
3892
3892
|
args: [{
|
|
3893
3893
|
selector: '[ngPluralCase]',
|
|
@@ -3981,9 +3981,9 @@ class NgStyle {
|
|
|
3981
3981
|
changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
|
|
3982
3982
|
}
|
|
3983
3983
|
}
|
|
3984
|
-
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
3985
|
-
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
3986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
3984
|
+
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgStyle, deps: [{ token: i0.ElementRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3985
|
+
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgStyle, isStandalone: true, selector: "[ngStyle]", inputs: { ngStyle: "ngStyle" }, ngImport: i0 });
|
|
3986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgStyle, decorators: [{
|
|
3987
3987
|
type: Directive,
|
|
3988
3988
|
args: [{
|
|
3989
3989
|
selector: '[ngStyle]',
|
|
@@ -4063,9 +4063,9 @@ class NgTemplateOutlet {
|
|
|
4063
4063
|
}
|
|
4064
4064
|
}
|
|
4065
4065
|
}
|
|
4066
|
-
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4067
|
-
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
4068
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4066
|
+
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgTemplateOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4067
|
+
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgTemplateOutlet, isStandalone: true, selector: "[ngTemplateOutlet]", inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet", ngTemplateOutletInjector: "ngTemplateOutletInjector" }, usesOnChanges: true, ngImport: i0 });
|
|
4068
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgTemplateOutlet, decorators: [{
|
|
4069
4069
|
type: Directive,
|
|
4070
4070
|
args: [{
|
|
4071
4071
|
selector: '[ngTemplateOutlet]',
|
|
@@ -4237,9 +4237,9 @@ class AsyncPipe {
|
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
4239
|
}
|
|
4240
|
-
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4241
|
-
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4240
|
+
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AsyncPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4241
|
+
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AsyncPipe, isStandalone: true, name: "async", pure: false });
|
|
4242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AsyncPipe, decorators: [{
|
|
4243
4243
|
type: Pipe,
|
|
4244
4244
|
args: [{
|
|
4245
4245
|
name: 'async',
|
|
@@ -4280,9 +4280,9 @@ class LowerCasePipe {
|
|
|
4280
4280
|
return value.toLowerCase();
|
|
4281
4281
|
}
|
|
4282
4282
|
}
|
|
4283
|
-
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4284
|
-
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4283
|
+
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LowerCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4284
|
+
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: LowerCasePipe, isStandalone: true, name: "lowercase" });
|
|
4285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LowerCasePipe, decorators: [{
|
|
4286
4286
|
type: Pipe,
|
|
4287
4287
|
args: [{
|
|
4288
4288
|
name: 'lowercase',
|
|
@@ -4325,9 +4325,9 @@ class TitleCasePipe {
|
|
|
4325
4325
|
return value.replace(unicodeWordMatch, (txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase()));
|
|
4326
4326
|
}
|
|
4327
4327
|
}
|
|
4328
|
-
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4329
|
-
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4328
|
+
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4329
|
+
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TitleCasePipe, isStandalone: true, name: "titlecase" });
|
|
4330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleCasePipe, decorators: [{
|
|
4331
4331
|
type: Pipe,
|
|
4332
4332
|
args: [{
|
|
4333
4333
|
name: 'titlecase',
|
|
@@ -4352,9 +4352,9 @@ class UpperCasePipe {
|
|
|
4352
4352
|
return value.toUpperCase();
|
|
4353
4353
|
}
|
|
4354
4354
|
}
|
|
4355
|
-
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4356
|
-
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4357
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4355
|
+
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UpperCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4356
|
+
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UpperCasePipe, isStandalone: true, name: "uppercase" });
|
|
4357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UpperCasePipe, decorators: [{
|
|
4358
4358
|
type: Pipe,
|
|
4359
4359
|
args: [{
|
|
4360
4360
|
name: 'uppercase',
|
|
@@ -4549,9 +4549,9 @@ class DatePipe {
|
|
|
4549
4549
|
}
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
|
-
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4553
|
-
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4552
|
+
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4553
|
+
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DatePipe, isStandalone: true, name: "date" });
|
|
4554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatePipe, decorators: [{
|
|
4555
4555
|
type: Pipe,
|
|
4556
4556
|
args: [{
|
|
4557
4557
|
name: 'date',
|
|
@@ -4611,9 +4611,9 @@ class I18nPluralPipe {
|
|
|
4611
4611
|
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
|
|
4612
4612
|
}
|
|
4613
4613
|
}
|
|
4614
|
-
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4615
|
-
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4616
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4614
|
+
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: I18nPluralPipe, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4615
|
+
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: I18nPluralPipe, isStandalone: true, name: "i18nPlural" });
|
|
4616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: I18nPluralPipe, decorators: [{
|
|
4617
4617
|
type: Pipe,
|
|
4618
4618
|
args: [{
|
|
4619
4619
|
name: 'i18nPlural',
|
|
@@ -4667,9 +4667,9 @@ class I18nSelectPipe {
|
|
|
4667
4667
|
return '';
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
4670
|
-
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4671
|
-
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4672
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4670
|
+
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: I18nSelectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4671
|
+
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: I18nSelectPipe, isStandalone: true, name: "i18nSelect" });
|
|
4672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: I18nSelectPipe, decorators: [{
|
|
4673
4673
|
type: Pipe,
|
|
4674
4674
|
args: [{
|
|
4675
4675
|
name: 'i18nSelect',
|
|
@@ -4708,9 +4708,9 @@ class JsonPipe {
|
|
|
4708
4708
|
return JSON.stringify(value, null, 2);
|
|
4709
4709
|
}
|
|
4710
4710
|
}
|
|
4711
|
-
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4712
|
-
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4713
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4711
|
+
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: JsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4712
|
+
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: JsonPipe, isStandalone: true, name: "json", pure: false });
|
|
4713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: JsonPipe, decorators: [{
|
|
4714
4714
|
type: Pipe,
|
|
4715
4715
|
args: [{
|
|
4716
4716
|
name: 'json',
|
|
@@ -4778,9 +4778,9 @@ class KeyValuePipe {
|
|
|
4778
4778
|
return this.keyValues;
|
|
4779
4779
|
}
|
|
4780
4780
|
}
|
|
4781
|
-
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4782
|
-
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4781
|
+
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KeyValuePipe, deps: [{ token: i0.KeyValueDiffers }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4782
|
+
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: KeyValuePipe, isStandalone: true, name: "keyvalue", pure: false });
|
|
4783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: KeyValuePipe, decorators: [{
|
|
4784
4784
|
type: Pipe,
|
|
4785
4785
|
args: [{
|
|
4786
4786
|
name: 'keyvalue',
|
|
@@ -4913,9 +4913,9 @@ class DecimalPipe {
|
|
|
4913
4913
|
}
|
|
4914
4914
|
}
|
|
4915
4915
|
}
|
|
4916
|
-
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4917
|
-
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4918
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4916
|
+
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DecimalPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4917
|
+
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DecimalPipe, isStandalone: true, name: "number" });
|
|
4918
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DecimalPipe, decorators: [{
|
|
4919
4919
|
type: Pipe,
|
|
4920
4920
|
args: [{
|
|
4921
4921
|
name: 'number',
|
|
@@ -4978,9 +4978,9 @@ class PercentPipe {
|
|
|
4978
4978
|
}
|
|
4979
4979
|
}
|
|
4980
4980
|
}
|
|
4981
|
-
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
4982
|
-
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
4983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
4981
|
+
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PercentPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4982
|
+
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: PercentPipe, isStandalone: true, name: "percent" });
|
|
4983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PercentPipe, decorators: [{
|
|
4984
4984
|
type: Pipe,
|
|
4985
4985
|
args: [{
|
|
4986
4986
|
name: 'percent',
|
|
@@ -5096,9 +5096,9 @@ class CurrencyPipe {
|
|
|
5096
5096
|
}
|
|
5097
5097
|
}
|
|
5098
5098
|
}
|
|
5099
|
-
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
5100
|
-
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
5101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
5099
|
+
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyPipe, deps: [{ token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5100
|
+
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CurrencyPipe, isStandalone: true, name: "currency" });
|
|
5101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyPipe, decorators: [{
|
|
5102
5102
|
type: Pipe,
|
|
5103
5103
|
args: [{
|
|
5104
5104
|
name: 'currency',
|
|
@@ -5183,9 +5183,9 @@ class SlicePipe {
|
|
|
5183
5183
|
return typeof obj === 'string' || Array.isArray(obj);
|
|
5184
5184
|
}
|
|
5185
5185
|
}
|
|
5186
|
-
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
5187
|
-
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
5188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
5186
|
+
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SlicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5187
|
+
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SlicePipe, isStandalone: true, name: "slice", pure: false });
|
|
5188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SlicePipe, decorators: [{
|
|
5189
5189
|
type: Pipe,
|
|
5190
5190
|
args: [{
|
|
5191
5191
|
name: 'slice',
|
|
@@ -5239,10 +5239,10 @@ const COMMON_PIPES = [
|
|
|
5239
5239
|
*/
|
|
5240
5240
|
class CommonModule {
|
|
5241
5241
|
}
|
|
5242
|
-
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
5243
|
-
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
5244
|
-
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
5245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
5242
|
+
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5243
|
+
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CommonModule, imports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe], exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe] });
|
|
5244
|
+
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonModule });
|
|
5245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CommonModule, decorators: [{
|
|
5246
5246
|
type: NgModule,
|
|
5247
5247
|
args: [{
|
|
5248
5248
|
imports: [COMMON_DIRECTIVES, COMMON_PIPES],
|
|
@@ -5300,7 +5300,7 @@ function isPlatformWorkerUi(platformId) {
|
|
|
5300
5300
|
/**
|
|
5301
5301
|
* @publicApi
|
|
5302
5302
|
*/
|
|
5303
|
-
const VERSION = new Version('14.
|
|
5303
|
+
const VERSION = new Version('14.3.0');
|
|
5304
5304
|
|
|
5305
5305
|
/**
|
|
5306
5306
|
* @license
|
|
@@ -5525,38 +5525,6 @@ class NullViewportScroller {
|
|
|
5525
5525
|
class XhrFactory {
|
|
5526
5526
|
}
|
|
5527
5527
|
|
|
5528
|
-
/**
|
|
5529
|
-
* @license
|
|
5530
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5531
|
-
*
|
|
5532
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5533
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5534
|
-
*/
|
|
5535
|
-
/**
|
|
5536
|
-
* Asserts that the application is in development mode. Throws an error if the application is in
|
|
5537
|
-
* production mode. This assert can be used to make sure that there is no dev-mode code invoked in
|
|
5538
|
-
* the prod mode accidentally.
|
|
5539
|
-
*/
|
|
5540
|
-
function assertDevMode(checkName) {
|
|
5541
|
-
if (!ngDevMode) {
|
|
5542
|
-
throw new ɵRuntimeError(2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` +
|
|
5543
|
-
`Please make sure that the prod mode is enabled for production builds.`);
|
|
5544
|
-
}
|
|
5545
|
-
}
|
|
5546
|
-
|
|
5547
|
-
/**
|
|
5548
|
-
* @license
|
|
5549
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5550
|
-
*
|
|
5551
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5552
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5553
|
-
*/
|
|
5554
|
-
// Assembles directive details string, useful for error messages.
|
|
5555
|
-
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
5556
|
-
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : '';
|
|
5557
|
-
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
5558
|
-
}
|
|
5559
|
-
|
|
5560
5528
|
/**
|
|
5561
5529
|
* @license
|
|
5562
5530
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5599,138 +5567,6 @@ function normalizeSrc(src) {
|
|
|
5599
5567
|
return src.startsWith('/') ? src.slice(1) : src;
|
|
5600
5568
|
}
|
|
5601
5569
|
|
|
5602
|
-
/**
|
|
5603
|
-
* @license
|
|
5604
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5605
|
-
*
|
|
5606
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5607
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5608
|
-
*/
|
|
5609
|
-
// Set of origins that are always excluded from the preconnect checks.
|
|
5610
|
-
const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
|
|
5611
|
-
/**
|
|
5612
|
-
* Multi-provider injection token to configure which origins should be excluded
|
|
5613
|
-
* from the preconnect checks. It can either be a single string or an array of strings
|
|
5614
|
-
* to represent a group of origins, for example:
|
|
5615
|
-
*
|
|
5616
|
-
* ```typescript
|
|
5617
|
-
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true, useValue: 'https://your-domain.com'}
|
|
5618
|
-
* ```
|
|
5619
|
-
*
|
|
5620
|
-
* or:
|
|
5621
|
-
*
|
|
5622
|
-
* ```typescript
|
|
5623
|
-
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true,
|
|
5624
|
-
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
5625
|
-
* ```
|
|
5626
|
-
*
|
|
5627
|
-
* @publicApi
|
|
5628
|
-
* @developerPreview
|
|
5629
|
-
*/
|
|
5630
|
-
const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
|
|
5631
|
-
/**
|
|
5632
|
-
* Contains the logic to detect whether an image, marked with the "priority" attribute
|
|
5633
|
-
* has a corresponding `<link rel="preconnect">` tag in the `document.head`.
|
|
5634
|
-
*
|
|
5635
|
-
* Note: this is a dev-mode only class, which should not appear in prod bundles,
|
|
5636
|
-
* thus there is no `ngDevMode` use in the code.
|
|
5637
|
-
*/
|
|
5638
|
-
class PreconnectLinkChecker {
|
|
5639
|
-
constructor() {
|
|
5640
|
-
this.document = inject(DOCUMENT);
|
|
5641
|
-
/**
|
|
5642
|
-
* Set of <link rel="preconnect"> tags found on this page.
|
|
5643
|
-
* The `null` value indicates that there was no DOM query operation performed.
|
|
5644
|
-
*/
|
|
5645
|
-
this.preconnectLinks = null;
|
|
5646
|
-
/*
|
|
5647
|
-
* Keep track of all already seen origin URLs to avoid repeating the same check.
|
|
5648
|
-
*/
|
|
5649
|
-
this.alreadySeen = new Set();
|
|
5650
|
-
this.window = null;
|
|
5651
|
-
this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
5652
|
-
assertDevMode('preconnect link checker');
|
|
5653
|
-
const win = this.document.defaultView;
|
|
5654
|
-
if (typeof win !== 'undefined') {
|
|
5655
|
-
this.window = win;
|
|
5656
|
-
}
|
|
5657
|
-
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, { optional: true });
|
|
5658
|
-
if (blocklist) {
|
|
5659
|
-
this.populateBlocklist(blocklist);
|
|
5660
|
-
}
|
|
5661
|
-
}
|
|
5662
|
-
populateBlocklist(origins) {
|
|
5663
|
-
if (Array.isArray(origins)) {
|
|
5664
|
-
deepForEach(origins, origin => {
|
|
5665
|
-
this.blocklist.add(extractHostname(origin));
|
|
5666
|
-
});
|
|
5667
|
-
}
|
|
5668
|
-
else {
|
|
5669
|
-
throw new ɵRuntimeError(2957 /* RuntimeErrorCode.INVALID_PRECONNECT_CHECK_BLOCKLIST */, `The blocklist for the preconnect check was not provided as an array. ` +
|
|
5670
|
-
`Check that the \`PRECONNECT_CHECK_BLOCKLIST\` token is configured as a \`multi: true\` provider.`);
|
|
5671
|
-
}
|
|
5672
|
-
}
|
|
5673
|
-
/**
|
|
5674
|
-
* Checks that a preconnect resource hint exists in the head fo rthe
|
|
5675
|
-
* given src.
|
|
5676
|
-
*
|
|
5677
|
-
* @param rewrittenSrc src formatted with loader
|
|
5678
|
-
* @param originalNgSrc ngSrc value
|
|
5679
|
-
*/
|
|
5680
|
-
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
5681
|
-
if (!this.window)
|
|
5682
|
-
return;
|
|
5683
|
-
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
5684
|
-
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
5685
|
-
return;
|
|
5686
|
-
// Register this origin as seen, so we don't check it again later.
|
|
5687
|
-
this.alreadySeen.add(imgUrl.origin);
|
|
5688
|
-
if (!this.preconnectLinks) {
|
|
5689
|
-
// Note: we query for preconnect links only *once* and cache the results
|
|
5690
|
-
// for the entire lifespan of an application, since it's unlikely that the
|
|
5691
|
-
// list would change frequently. This allows to make sure there are no
|
|
5692
|
-
// performance implications of making extra DOM lookups for each image.
|
|
5693
|
-
this.preconnectLinks = this.queryPreconnectLinks();
|
|
5694
|
-
}
|
|
5695
|
-
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
5696
|
-
console.warn(ɵformatRuntimeError(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +
|
|
5697
|
-
`image. Preconnecting to the origin(s) that serve priority images ensures that these ` +
|
|
5698
|
-
`images are delivered as soon as possible. To fix this, please add the following ` +
|
|
5699
|
-
`element into the <head> of the document:\n` +
|
|
5700
|
-
` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
5701
|
-
}
|
|
5702
|
-
}
|
|
5703
|
-
queryPreconnectLinks() {
|
|
5704
|
-
const preconnectUrls = new Set();
|
|
5705
|
-
const selector = 'link[rel=preconnect]';
|
|
5706
|
-
const links = Array.from(this.document.querySelectorAll(selector));
|
|
5707
|
-
for (let link of links) {
|
|
5708
|
-
const url = getUrl(link.href, this.window);
|
|
5709
|
-
preconnectUrls.add(url.origin);
|
|
5710
|
-
}
|
|
5711
|
-
return preconnectUrls;
|
|
5712
|
-
}
|
|
5713
|
-
ngOnDestroy() {
|
|
5714
|
-
this.preconnectLinks?.clear();
|
|
5715
|
-
this.alreadySeen.clear();
|
|
5716
|
-
}
|
|
5717
|
-
}
|
|
5718
|
-
PreconnectLinkChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5719
|
-
PreconnectLinkChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
5720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
5721
|
-
type: Injectable,
|
|
5722
|
-
args: [{ providedIn: 'root' }]
|
|
5723
|
-
}], ctorParameters: function () { return []; } });
|
|
5724
|
-
/**
|
|
5725
|
-
* Invokes a callback for each element in the array. Also invokes a callback
|
|
5726
|
-
* recursively for each nested array.
|
|
5727
|
-
*/
|
|
5728
|
-
function deepForEach(input, fn) {
|
|
5729
|
-
for (let value of input) {
|
|
5730
|
-
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
5731
|
-
}
|
|
5732
|
-
}
|
|
5733
|
-
|
|
5734
5570
|
/**
|
|
5735
5571
|
* @license
|
|
5736
5572
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5752,7 +5588,6 @@ const noopImageLoader = (config) => config.src;
|
|
|
5752
5588
|
* @see `ImageLoader`
|
|
5753
5589
|
* @see `NgOptimizedImage`
|
|
5754
5590
|
* @publicApi
|
|
5755
|
-
* @developerPreview
|
|
5756
5591
|
*/
|
|
5757
5592
|
const IMAGE_LOADER = new InjectionToken('ImageLoader', {
|
|
5758
5593
|
providedIn: 'root',
|
|
@@ -5768,7 +5603,7 @@ const IMAGE_LOADER = new InjectionToken('ImageLoader', {
|
|
|
5768
5603
|
* @returns a set of DI providers corresponding to the configured image loader
|
|
5769
5604
|
*/
|
|
5770
5605
|
function createImageLoader(buildUrlFn, exampleUrls) {
|
|
5771
|
-
return function provideImageLoader(path
|
|
5606
|
+
return function provideImageLoader(path) {
|
|
5772
5607
|
if (!isValidPath(path)) {
|
|
5773
5608
|
throwInvalidPathError(path, exampleUrls || []);
|
|
5774
5609
|
}
|
|
@@ -5787,9 +5622,6 @@ function createImageLoader(buildUrlFn, exampleUrls) {
|
|
|
5787
5622
|
return buildUrlFn(path, { ...config, src: normalizeSrc(config.src) });
|
|
5788
5623
|
};
|
|
5789
5624
|
const providers = [{ provide: IMAGE_LOADER, useValue: loaderFn }];
|
|
5790
|
-
if (ngDevMode && options.ensurePreconnect === false) {
|
|
5791
|
-
providers.push({ provide: PRECONNECT_CHECK_BLOCKLIST, useValue: [path], multi: true });
|
|
5792
|
-
}
|
|
5793
5625
|
return providers;
|
|
5794
5626
|
};
|
|
5795
5627
|
}
|
|
@@ -5821,14 +5653,9 @@ function throwUnexpectedAbsoluteUrlError(path, url) {
|
|
|
5821
5653
|
* Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
|
|
5822
5654
|
*
|
|
5823
5655
|
* @param path Your domain name, e.g. https://mysite.com
|
|
5824
|
-
* @param options An object with extra configuration:
|
|
5825
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5826
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5827
|
-
* present in the document's `<head>`.
|
|
5828
5656
|
* @returns Provider that provides an ImageLoader function
|
|
5829
5657
|
*
|
|
5830
5658
|
* @publicApi
|
|
5831
|
-
* @developerPreview
|
|
5832
5659
|
*/
|
|
5833
5660
|
const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>'] : undefined);
|
|
5834
5661
|
function createCloudflareUrl(path, config) {
|
|
@@ -5848,6 +5675,20 @@ function createCloudflareUrl(path, config) {
|
|
|
5848
5675
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5849
5676
|
* found in the LICENSE file at https://angular.io/license
|
|
5850
5677
|
*/
|
|
5678
|
+
/**
|
|
5679
|
+
* Name and URL tester for Cloudinary.
|
|
5680
|
+
*/
|
|
5681
|
+
const cloudinaryLoaderInfo = {
|
|
5682
|
+
name: 'Cloudinary',
|
|
5683
|
+
testUrl: isCloudinaryUrl
|
|
5684
|
+
};
|
|
5685
|
+
const CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
|
|
5686
|
+
/**
|
|
5687
|
+
* Tests whether a URL is from Cloudinary CDN.
|
|
5688
|
+
*/
|
|
5689
|
+
function isCloudinaryUrl(url) {
|
|
5690
|
+
return CLOUDINARY_LOADER_REGEX.test(url);
|
|
5691
|
+
}
|
|
5851
5692
|
/**
|
|
5852
5693
|
* Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.
|
|
5853
5694
|
*
|
|
@@ -5856,14 +5697,9 @@ function createCloudflareUrl(path, config) {
|
|
|
5856
5697
|
* https://res.cloudinary.com/mysite
|
|
5857
5698
|
* https://mysite.cloudinary.com
|
|
5858
5699
|
* https://subdomain.mysite.com
|
|
5859
|
-
* @param options An object with extra configuration:
|
|
5860
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5861
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5862
|
-
* present in the document's `<head>`.
|
|
5863
5700
|
* @returns Set of providers to configure the Cloudinary loader.
|
|
5864
5701
|
*
|
|
5865
5702
|
* @publicApi
|
|
5866
|
-
* @developerPreview
|
|
5867
5703
|
*/
|
|
5868
5704
|
const provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ?
|
|
5869
5705
|
[
|
|
@@ -5890,6 +5726,20 @@ function createCloudinaryUrl(path, config) {
|
|
|
5890
5726
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5891
5727
|
* found in the LICENSE file at https://angular.io/license
|
|
5892
5728
|
*/
|
|
5729
|
+
/**
|
|
5730
|
+
* Name and URL tester for ImageKit.
|
|
5731
|
+
*/
|
|
5732
|
+
const imageKitLoaderInfo = {
|
|
5733
|
+
name: 'ImageKit',
|
|
5734
|
+
testUrl: isImageKitUrl
|
|
5735
|
+
};
|
|
5736
|
+
const IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
|
|
5737
|
+
/**
|
|
5738
|
+
* Tests whether a URL is from ImageKit CDN.
|
|
5739
|
+
*/
|
|
5740
|
+
function isImageKitUrl(url) {
|
|
5741
|
+
return IMAGE_KIT_LOADER_REGEX.test(url);
|
|
5742
|
+
}
|
|
5893
5743
|
/**
|
|
5894
5744
|
* Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.
|
|
5895
5745
|
*
|
|
@@ -5897,14 +5747,9 @@ function createCloudinaryUrl(path, config) {
|
|
|
5897
5747
|
* This URL should match one of the following formats:
|
|
5898
5748
|
* https://ik.imagekit.io/myaccount
|
|
5899
5749
|
* https://subdomain.mysite.com
|
|
5900
|
-
* @param options An object with extra configuration:
|
|
5901
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5902
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5903
|
-
* present in the document's `<head>`.
|
|
5904
5750
|
* @returns Set of providers to configure the ImageKit loader.
|
|
5905
5751
|
*
|
|
5906
5752
|
* @publicApi
|
|
5907
|
-
* @developerPreview
|
|
5908
5753
|
*/
|
|
5909
5754
|
const provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined);
|
|
5910
5755
|
function createImagekitUrl(path, config) {
|
|
@@ -5924,19 +5769,28 @@ function createImagekitUrl(path, config) {
|
|
|
5924
5769
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5925
5770
|
* found in the LICENSE file at https://angular.io/license
|
|
5926
5771
|
*/
|
|
5772
|
+
/**
|
|
5773
|
+
* Name and URL tester for Imgix.
|
|
5774
|
+
*/
|
|
5775
|
+
const imgixLoaderInfo = {
|
|
5776
|
+
name: 'Imgix',
|
|
5777
|
+
testUrl: isImgixUrl
|
|
5778
|
+
};
|
|
5779
|
+
const IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
|
|
5780
|
+
/**
|
|
5781
|
+
* Tests whether a URL is from Imgix CDN.
|
|
5782
|
+
*/
|
|
5783
|
+
function isImgixUrl(url) {
|
|
5784
|
+
return IMGIX_LOADER_REGEX.test(url);
|
|
5785
|
+
}
|
|
5927
5786
|
/**
|
|
5928
5787
|
* Function that generates an ImageLoader for Imgix and turns it into an Angular provider.
|
|
5929
5788
|
*
|
|
5930
5789
|
* @param path path to the desired Imgix origin,
|
|
5931
5790
|
* e.g. https://somepath.imgix.net or https://images.mysite.com
|
|
5932
|
-
* @param options An object with extra configuration:
|
|
5933
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5934
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5935
|
-
* present in the document's `<head>`.
|
|
5936
5791
|
* @returns Set of providers to configure the Imgix loader.
|
|
5937
5792
|
*
|
|
5938
5793
|
* @publicApi
|
|
5939
|
-
* @developerPreview
|
|
5940
5794
|
*/
|
|
5941
5795
|
const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined);
|
|
5942
5796
|
function createImgixUrl(path, config) {
|
|
@@ -5949,6 +5803,38 @@ function createImgixUrl(path, config) {
|
|
|
5949
5803
|
return url.href;
|
|
5950
5804
|
}
|
|
5951
5805
|
|
|
5806
|
+
/**
|
|
5807
|
+
* @license
|
|
5808
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5809
|
+
*
|
|
5810
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5811
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5812
|
+
*/
|
|
5813
|
+
// Assembles directive details string, useful for error messages.
|
|
5814
|
+
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
5815
|
+
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : '';
|
|
5816
|
+
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
5817
|
+
}
|
|
5818
|
+
|
|
5819
|
+
/**
|
|
5820
|
+
* @license
|
|
5821
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5822
|
+
*
|
|
5823
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5824
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5825
|
+
*/
|
|
5826
|
+
/**
|
|
5827
|
+
* Asserts that the application is in development mode. Throws an error if the application is in
|
|
5828
|
+
* production mode. This assert can be used to make sure that there is no dev-mode code invoked in
|
|
5829
|
+
* the prod mode accidentally.
|
|
5830
|
+
*/
|
|
5831
|
+
function assertDevMode(checkName) {
|
|
5832
|
+
if (!ngDevMode) {
|
|
5833
|
+
throw new ɵRuntimeError(2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` +
|
|
5834
|
+
`Please make sure that the prod mode is enabled for production builds.`);
|
|
5835
|
+
}
|
|
5836
|
+
}
|
|
5837
|
+
|
|
5952
5838
|
/**
|
|
5953
5839
|
* @license
|
|
5954
5840
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6028,9 +5914,9 @@ class LCPImageObserver {
|
|
|
6028
5914
|
this.alreadyWarned.clear();
|
|
6029
5915
|
}
|
|
6030
5916
|
}
|
|
6031
|
-
LCPImageObserver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
6032
|
-
LCPImageObserver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
6033
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
5917
|
+
LCPImageObserver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5918
|
+
LCPImageObserver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
|
|
5919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LCPImageObserver, decorators: [{
|
|
6034
5920
|
type: Injectable,
|
|
6035
5921
|
args: [{ providedIn: 'root' }]
|
|
6036
5922
|
}], ctorParameters: function () { return []; } });
|
|
@@ -6042,6 +5928,230 @@ function logMissingPriorityWarning(ngSrc) {
|
|
|
6042
5928
|
`To fix this, add the "priority" attribute.`));
|
|
6043
5929
|
}
|
|
6044
5930
|
|
|
5931
|
+
/**
|
|
5932
|
+
* @license
|
|
5933
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5934
|
+
*
|
|
5935
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5936
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5937
|
+
*/
|
|
5938
|
+
// Set of origins that are always excluded from the preconnect checks.
|
|
5939
|
+
const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
|
|
5940
|
+
/**
|
|
5941
|
+
* Injection token to configure which origins should be excluded
|
|
5942
|
+
* from the preconnect checks. It can either be a single string or an array of strings
|
|
5943
|
+
* to represent a group of origins, for example:
|
|
5944
|
+
*
|
|
5945
|
+
* ```typescript
|
|
5946
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}
|
|
5947
|
+
* ```
|
|
5948
|
+
*
|
|
5949
|
+
* or:
|
|
5950
|
+
*
|
|
5951
|
+
* ```typescript
|
|
5952
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST,
|
|
5953
|
+
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
5954
|
+
* ```
|
|
5955
|
+
*
|
|
5956
|
+
* @publicApi
|
|
5957
|
+
*/
|
|
5958
|
+
const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
|
|
5959
|
+
/**
|
|
5960
|
+
* Contains the logic to detect whether an image, marked with the "priority" attribute
|
|
5961
|
+
* has a corresponding `<link rel="preconnect">` tag in the `document.head`.
|
|
5962
|
+
*
|
|
5963
|
+
* Note: this is a dev-mode only class, which should not appear in prod bundles,
|
|
5964
|
+
* thus there is no `ngDevMode` use in the code.
|
|
5965
|
+
*/
|
|
5966
|
+
class PreconnectLinkChecker {
|
|
5967
|
+
constructor() {
|
|
5968
|
+
this.document = inject(DOCUMENT);
|
|
5969
|
+
/**
|
|
5970
|
+
* Set of <link rel="preconnect"> tags found on this page.
|
|
5971
|
+
* The `null` value indicates that there was no DOM query operation performed.
|
|
5972
|
+
*/
|
|
5973
|
+
this.preconnectLinks = null;
|
|
5974
|
+
/*
|
|
5975
|
+
* Keep track of all already seen origin URLs to avoid repeating the same check.
|
|
5976
|
+
*/
|
|
5977
|
+
this.alreadySeen = new Set();
|
|
5978
|
+
this.window = null;
|
|
5979
|
+
this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
5980
|
+
assertDevMode('preconnect link checker');
|
|
5981
|
+
const win = this.document.defaultView;
|
|
5982
|
+
if (typeof win !== 'undefined') {
|
|
5983
|
+
this.window = win;
|
|
5984
|
+
}
|
|
5985
|
+
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, { optional: true });
|
|
5986
|
+
if (blocklist) {
|
|
5987
|
+
this.populateBlocklist(blocklist);
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
populateBlocklist(origins) {
|
|
5991
|
+
if (Array.isArray(origins)) {
|
|
5992
|
+
deepForEach(origins, origin => {
|
|
5993
|
+
this.blocklist.add(extractHostname(origin));
|
|
5994
|
+
});
|
|
5995
|
+
}
|
|
5996
|
+
else {
|
|
5997
|
+
this.blocklist.add(extractHostname(origins));
|
|
5998
|
+
}
|
|
5999
|
+
}
|
|
6000
|
+
/**
|
|
6001
|
+
* Checks that a preconnect resource hint exists in the head for the
|
|
6002
|
+
* given src.
|
|
6003
|
+
*
|
|
6004
|
+
* @param rewrittenSrc src formatted with loader
|
|
6005
|
+
* @param originalNgSrc ngSrc value
|
|
6006
|
+
*/
|
|
6007
|
+
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
6008
|
+
if (!this.window)
|
|
6009
|
+
return;
|
|
6010
|
+
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
6011
|
+
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
6012
|
+
return;
|
|
6013
|
+
// Register this origin as seen, so we don't check it again later.
|
|
6014
|
+
this.alreadySeen.add(imgUrl.origin);
|
|
6015
|
+
if (!this.preconnectLinks) {
|
|
6016
|
+
// Note: we query for preconnect links only *once* and cache the results
|
|
6017
|
+
// for the entire lifespan of an application, since it's unlikely that the
|
|
6018
|
+
// list would change frequently. This allows to make sure there are no
|
|
6019
|
+
// performance implications of making extra DOM lookups for each image.
|
|
6020
|
+
this.preconnectLinks = this.queryPreconnectLinks();
|
|
6021
|
+
}
|
|
6022
|
+
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
6023
|
+
console.warn(ɵformatRuntimeError(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +
|
|
6024
|
+
`image. Preconnecting to the origin(s) that serve priority images ensures that these ` +
|
|
6025
|
+
`images are delivered as soon as possible. To fix this, please add the following ` +
|
|
6026
|
+
`element into the <head> of the document:\n` +
|
|
6027
|
+
` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
queryPreconnectLinks() {
|
|
6031
|
+
const preconnectUrls = new Set();
|
|
6032
|
+
const selector = 'link[rel=preconnect]';
|
|
6033
|
+
const links = Array.from(this.document.querySelectorAll(selector));
|
|
6034
|
+
for (let link of links) {
|
|
6035
|
+
const url = getUrl(link.href, this.window);
|
|
6036
|
+
preconnectUrls.add(url.origin);
|
|
6037
|
+
}
|
|
6038
|
+
return preconnectUrls;
|
|
6039
|
+
}
|
|
6040
|
+
ngOnDestroy() {
|
|
6041
|
+
this.preconnectLinks?.clear();
|
|
6042
|
+
this.alreadySeen.clear();
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6045
|
+
PreconnectLinkChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6046
|
+
PreconnectLinkChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
6047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
6048
|
+
type: Injectable,
|
|
6049
|
+
args: [{ providedIn: 'root' }]
|
|
6050
|
+
}], ctorParameters: function () { return []; } });
|
|
6051
|
+
/**
|
|
6052
|
+
* Invokes a callback for each element in the array. Also invokes a callback
|
|
6053
|
+
* recursively for each nested array.
|
|
6054
|
+
*/
|
|
6055
|
+
function deepForEach(input, fn) {
|
|
6056
|
+
for (let value of input) {
|
|
6057
|
+
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
6058
|
+
}
|
|
6059
|
+
}
|
|
6060
|
+
|
|
6061
|
+
/**
|
|
6062
|
+
* @license
|
|
6063
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6064
|
+
*
|
|
6065
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6066
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6067
|
+
*/
|
|
6068
|
+
/**
|
|
6069
|
+
* In SSR scenarios, a preload `<link>` element is generated for priority images.
|
|
6070
|
+
* Having a large number of preload tags may negatively affect the performance,
|
|
6071
|
+
* so we warn developers (by throwing an error) if the number of preloaded images
|
|
6072
|
+
* is above a certain threshold. This const specifies this threshold.
|
|
6073
|
+
*/
|
|
6074
|
+
const DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
|
|
6075
|
+
/**
|
|
6076
|
+
* Helps to keep track of priority images that already have a corresponding
|
|
6077
|
+
* preload tag (to avoid generating multiple preload tags with the same URL).
|
|
6078
|
+
*
|
|
6079
|
+
* This Set tracks the original src passed into the `ngSrc` input not the src after it has been
|
|
6080
|
+
* run through the specified `IMAGE_LOADER`.
|
|
6081
|
+
*/
|
|
6082
|
+
const PRELOADED_IMAGES = new InjectionToken('NG_OPTIMIZED_PRELOADED_IMAGES', { providedIn: 'root', factory: () => new Set() });
|
|
6083
|
+
|
|
6084
|
+
/**
|
|
6085
|
+
* @license
|
|
6086
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6087
|
+
*
|
|
6088
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6089
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6090
|
+
*/
|
|
6091
|
+
/**
|
|
6092
|
+
* @description Contains the logic needed to track and add preload link tags to the `<head>` tag. It
|
|
6093
|
+
* will also track what images have already had preload link tags added so as to not duplicate link
|
|
6094
|
+
* tags.
|
|
6095
|
+
*
|
|
6096
|
+
* In dev mode this service will validate that the number of preloaded images does not exceed the
|
|
6097
|
+
* configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.
|
|
6098
|
+
*/
|
|
6099
|
+
class PreloadLinkCreator {
|
|
6100
|
+
constructor() {
|
|
6101
|
+
this.preloadedImages = inject(PRELOADED_IMAGES);
|
|
6102
|
+
this.document = inject(DOCUMENT);
|
|
6103
|
+
}
|
|
6104
|
+
/**
|
|
6105
|
+
* @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the
|
|
6106
|
+
* server while using Angular Universal and SSR to kick off image loads for high priority images.
|
|
6107
|
+
*
|
|
6108
|
+
* The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
|
|
6109
|
+
* properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
|
|
6110
|
+
* respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from
|
|
6111
|
+
* the CDN.
|
|
6112
|
+
*
|
|
6113
|
+
* {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
|
|
6114
|
+
*
|
|
6115
|
+
* @param renderer The `Renderer2` passed in from the directive
|
|
6116
|
+
* @param src The original src of the image that is set on the `ngSrc` input.
|
|
6117
|
+
* @param srcset The parsed and formatted srcset created from the `ngSrcset` input
|
|
6118
|
+
* @param sizes The value of the `sizes` attribute passed in to the `<img>` tag
|
|
6119
|
+
*/
|
|
6120
|
+
createPreloadLinkTag(renderer, src, srcset, sizes) {
|
|
6121
|
+
if (ngDevMode) {
|
|
6122
|
+
if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
|
|
6123
|
+
throw new ɵRuntimeError(2961 /* RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES */, ngDevMode &&
|
|
6124
|
+
`The \`NgOptimizedImage\` directive has detected that more than ` +
|
|
6125
|
+
`${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` +
|
|
6126
|
+
`This might negatively affect an overall performance of the page. ` +
|
|
6127
|
+
`To fix this, remove the "priority" attribute from images with less priority.`);
|
|
6128
|
+
}
|
|
6129
|
+
}
|
|
6130
|
+
if (this.preloadedImages.has(src)) {
|
|
6131
|
+
return;
|
|
6132
|
+
}
|
|
6133
|
+
this.preloadedImages.add(src);
|
|
6134
|
+
const preload = renderer.createElement('link');
|
|
6135
|
+
renderer.setAttribute(preload, 'as', 'image');
|
|
6136
|
+
renderer.setAttribute(preload, 'href', src);
|
|
6137
|
+
renderer.setAttribute(preload, 'rel', 'preload');
|
|
6138
|
+
renderer.setAttribute(preload, 'fetchpriority', 'high');
|
|
6139
|
+
if (sizes) {
|
|
6140
|
+
renderer.setAttribute(preload, 'imageSizes', sizes);
|
|
6141
|
+
}
|
|
6142
|
+
if (srcset) {
|
|
6143
|
+
renderer.setAttribute(preload, 'imageSrcset', srcset);
|
|
6144
|
+
}
|
|
6145
|
+
renderer.appendChild(this.document.head, preload);
|
|
6146
|
+
}
|
|
6147
|
+
}
|
|
6148
|
+
PreloadLinkCreator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6149
|
+
PreloadLinkCreator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
|
|
6150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreloadLinkCreator, decorators: [{
|
|
6151
|
+
type: Injectable,
|
|
6152
|
+
args: [{ providedIn: 'root' }]
|
|
6153
|
+
}] });
|
|
6154
|
+
|
|
6045
6155
|
/**
|
|
6046
6156
|
* @license
|
|
6047
6157
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6078,6 +6188,14 @@ const ABSOLUTE_SRCSET_DENSITY_CAP = 3;
|
|
|
6078
6188
|
* only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.
|
|
6079
6189
|
*/
|
|
6080
6190
|
const RECOMMENDED_SRCSET_DENSITY_CAP = 2;
|
|
6191
|
+
/**
|
|
6192
|
+
* Used in generating automatic density-based srcsets
|
|
6193
|
+
*/
|
|
6194
|
+
const DENSITY_SRCSET_MULTIPLIERS = [1, 2];
|
|
6195
|
+
/**
|
|
6196
|
+
* Used to determine which breakpoints to use on full-width images
|
|
6197
|
+
*/
|
|
6198
|
+
const VIEWPORT_BREAKPOINT_CUTOFF = 640;
|
|
6081
6199
|
/**
|
|
6082
6200
|
* Used to determine whether two aspect ratios are similar in value.
|
|
6083
6201
|
*/
|
|
@@ -6088,6 +6206,25 @@ const ASPECT_RATIO_TOLERANCE = .1;
|
|
|
6088
6206
|
* into account a typical device pixel ratio). In pixels.
|
|
6089
6207
|
*/
|
|
6090
6208
|
const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
6209
|
+
/**
|
|
6210
|
+
* Used to limit automatic srcset generation of very large sources for
|
|
6211
|
+
* fixed-size images. In pixels.
|
|
6212
|
+
*/
|
|
6213
|
+
const FIXED_SRCSET_WIDTH_LIMIT = 1920;
|
|
6214
|
+
const FIXED_SRCSET_HEIGHT_LIMIT = 1080;
|
|
6215
|
+
/** Info about built-in loaders we can test for. */
|
|
6216
|
+
const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo];
|
|
6217
|
+
const defaultConfig = {
|
|
6218
|
+
breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
6219
|
+
};
|
|
6220
|
+
/**
|
|
6221
|
+
* Injection token that configures the image optimized image functionality.
|
|
6222
|
+
*
|
|
6223
|
+
* @see `NgOptimizedImage`
|
|
6224
|
+
* @publicApi
|
|
6225
|
+
* @developerPreview
|
|
6226
|
+
*/
|
|
6227
|
+
const IMAGE_CONFIG = new InjectionToken('ImageConfig', { providedIn: 'root', factory: () => defaultConfig });
|
|
6091
6228
|
/**
|
|
6092
6229
|
* Directive that improves image loading performance by enforcing best practices.
|
|
6093
6230
|
*
|
|
@@ -6099,6 +6236,7 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
|
6099
6236
|
*
|
|
6100
6237
|
* In addition, the directive:
|
|
6101
6238
|
* - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
|
|
6239
|
+
* - Automatically generates a srcset
|
|
6102
6240
|
* - Requires that `width` and `height` are set
|
|
6103
6241
|
* - Warns if `width` or `height` have been set incorrectly
|
|
6104
6242
|
* - Warns if the image will be visually distorted when rendered
|
|
@@ -6184,14 +6322,16 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
|
6184
6322
|
* ```
|
|
6185
6323
|
*
|
|
6186
6324
|
* @publicApi
|
|
6187
|
-
* @developerPreview
|
|
6188
6325
|
*/
|
|
6189
6326
|
class NgOptimizedImage {
|
|
6190
6327
|
constructor() {
|
|
6191
6328
|
this.imageLoader = inject(IMAGE_LOADER);
|
|
6329
|
+
this.config = processConfig(inject(IMAGE_CONFIG));
|
|
6192
6330
|
this.renderer = inject(Renderer2);
|
|
6193
6331
|
this.imgElement = inject(ElementRef).nativeElement;
|
|
6194
6332
|
this.injector = inject(Injector);
|
|
6333
|
+
this.isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
6334
|
+
this.preloadLinkChecker = inject(PreloadLinkCreator);
|
|
6195
6335
|
// a LCP image observer - should be injected only in the dev mode
|
|
6196
6336
|
this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null;
|
|
6197
6337
|
/**
|
|
@@ -6202,28 +6342,12 @@ class NgOptimizedImage {
|
|
|
6202
6342
|
*/
|
|
6203
6343
|
this._renderedSrc = null;
|
|
6204
6344
|
this._priority = false;
|
|
6345
|
+
this._disableOptimizedSrcset = false;
|
|
6346
|
+
this._fill = false;
|
|
6205
6347
|
}
|
|
6206
6348
|
/**
|
|
6207
|
-
*
|
|
6208
|
-
*
|
|
6209
|
-
* suggesting to switch to `ngSrc` instead.
|
|
6210
|
-
*
|
|
6211
|
-
* This error should be removed in v15.
|
|
6212
|
-
*
|
|
6213
|
-
* @nodoc
|
|
6214
|
-
* @deprecated Use `ngSrc` instead.
|
|
6215
|
-
*/
|
|
6216
|
-
set rawSrc(value) {
|
|
6217
|
-
if (ngDevMode) {
|
|
6218
|
-
throw new ɵRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(value, false)} the \`rawSrc\` attribute was used ` +
|
|
6219
|
-
`to activate the directive. Newer version of the directive uses the \`ngSrc\` ` +
|
|
6220
|
-
`attribute instead. Please replace \`rawSrc\` with \`ngSrc\` and ` +
|
|
6221
|
-
`\`rawSrcset\` with \`ngSrcset\` attributes in the template to ` +
|
|
6222
|
-
`enable image optimizations.`);
|
|
6223
|
-
}
|
|
6224
|
-
}
|
|
6225
|
-
/**
|
|
6226
|
-
* The intrinsic width of the image in pixels.
|
|
6349
|
+
* For responsive images: the intrinsic width of the image in pixels.
|
|
6350
|
+
* For fixed size images: the desired rendered width of the image in pixels.
|
|
6227
6351
|
*/
|
|
6228
6352
|
set width(value) {
|
|
6229
6353
|
ngDevMode && assertGreaterThanZero(this, value, 'width');
|
|
@@ -6233,7 +6357,9 @@ class NgOptimizedImage {
|
|
|
6233
6357
|
return this._width;
|
|
6234
6358
|
}
|
|
6235
6359
|
/**
|
|
6236
|
-
*
|
|
6360
|
+
* For responsive images: the intrinsic height of the image in pixels.
|
|
6361
|
+
* For fixed size images: the desired rendered height of the image in pixels.* The intrinsic
|
|
6362
|
+
* height of the image in pixels.
|
|
6237
6363
|
*/
|
|
6238
6364
|
set height(value) {
|
|
6239
6365
|
ngDevMode && assertGreaterThanZero(this, value, 'height');
|
|
@@ -6251,17 +6377,55 @@ class NgOptimizedImage {
|
|
|
6251
6377
|
get priority() {
|
|
6252
6378
|
return this._priority;
|
|
6253
6379
|
}
|
|
6380
|
+
/**
|
|
6381
|
+
* Disables automatic srcset generation for this image.
|
|
6382
|
+
*/
|
|
6383
|
+
set disableOptimizedSrcset(value) {
|
|
6384
|
+
this._disableOptimizedSrcset = inputToBoolean(value);
|
|
6385
|
+
}
|
|
6386
|
+
get disableOptimizedSrcset() {
|
|
6387
|
+
return this._disableOptimizedSrcset;
|
|
6388
|
+
}
|
|
6389
|
+
/**
|
|
6390
|
+
* Sets the image to "fill mode", which eliminates the height/width requirement and adds
|
|
6391
|
+
* styles such that the image fills its containing element.
|
|
6392
|
+
*
|
|
6393
|
+
* @developerPreview
|
|
6394
|
+
*/
|
|
6395
|
+
set fill(value) {
|
|
6396
|
+
this._fill = inputToBoolean(value);
|
|
6397
|
+
}
|
|
6398
|
+
get fill() {
|
|
6399
|
+
return this._fill;
|
|
6400
|
+
}
|
|
6401
|
+
/** @nodoc */
|
|
6254
6402
|
ngOnInit() {
|
|
6255
6403
|
if (ngDevMode) {
|
|
6256
6404
|
assertNonEmptyInput(this, 'ngSrc', this.ngSrc);
|
|
6257
6405
|
assertValidNgSrcset(this, this.ngSrcset);
|
|
6258
6406
|
assertNoConflictingSrc(this);
|
|
6259
|
-
|
|
6407
|
+
if (this.ngSrcset) {
|
|
6408
|
+
assertNoConflictingSrcset(this);
|
|
6409
|
+
}
|
|
6260
6410
|
assertNotBase64Image(this);
|
|
6261
6411
|
assertNotBlobUrl(this);
|
|
6262
|
-
|
|
6412
|
+
if (this.fill) {
|
|
6413
|
+
assertEmptyWidthAndHeight(this);
|
|
6414
|
+
assertNonZeroRenderedHeight(this, this.imgElement, this.renderer);
|
|
6415
|
+
}
|
|
6416
|
+
else {
|
|
6417
|
+
assertNonEmptyWidthAndHeight(this);
|
|
6418
|
+
// Only check for distorted images when not in fill mode, where
|
|
6419
|
+
// images may be intentionally stretched, cropped or letterboxed.
|
|
6420
|
+
assertNoImageDistortion(this, this.imgElement, this.renderer);
|
|
6421
|
+
}
|
|
6263
6422
|
assertValidLoadingInput(this);
|
|
6264
|
-
|
|
6423
|
+
if (!this.ngSrcset) {
|
|
6424
|
+
assertNoComplexSizes(this);
|
|
6425
|
+
}
|
|
6426
|
+
assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
|
|
6427
|
+
assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
|
|
6428
|
+
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
|
|
6265
6429
|
if (this.priority) {
|
|
6266
6430
|
const checker = this.injector.get(PreconnectLinkChecker);
|
|
6267
6431
|
checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
|
|
@@ -6283,21 +6447,64 @@ class NgOptimizedImage {
|
|
|
6283
6447
|
setHostAttributes() {
|
|
6284
6448
|
// Must set width/height explicitly in case they are bound (in which case they will
|
|
6285
6449
|
// only be reflected and not found by the browser)
|
|
6286
|
-
|
|
6287
|
-
|
|
6450
|
+
if (this.fill) {
|
|
6451
|
+
if (!this.sizes) {
|
|
6452
|
+
this.sizes = '100vw';
|
|
6453
|
+
}
|
|
6454
|
+
}
|
|
6455
|
+
else {
|
|
6456
|
+
this.setHostAttribute('width', this.width.toString());
|
|
6457
|
+
this.setHostAttribute('height', this.height.toString());
|
|
6458
|
+
}
|
|
6288
6459
|
this.setHostAttribute('loading', this.getLoadingBehavior());
|
|
6289
6460
|
this.setHostAttribute('fetchpriority', this.getFetchPriority());
|
|
6461
|
+
// The `data-ng-img` attribute flags an image as using the directive, to allow
|
|
6462
|
+
// for analysis of the directive's performance.
|
|
6463
|
+
this.setHostAttribute('ng-img', 'true');
|
|
6290
6464
|
// The `src` and `srcset` attributes should be set last since other attributes
|
|
6291
6465
|
// could affect the image's loading behavior.
|
|
6292
|
-
|
|
6466
|
+
const rewrittenSrc = this.getRewrittenSrc();
|
|
6467
|
+
this.setHostAttribute('src', rewrittenSrc);
|
|
6468
|
+
let rewrittenSrcset = undefined;
|
|
6469
|
+
if (this.sizes) {
|
|
6470
|
+
this.setHostAttribute('sizes', this.sizes);
|
|
6471
|
+
}
|
|
6293
6472
|
if (this.ngSrcset) {
|
|
6294
|
-
|
|
6473
|
+
rewrittenSrcset = this.getRewrittenSrcset();
|
|
6474
|
+
}
|
|
6475
|
+
else if (this.shouldGenerateAutomaticSrcset()) {
|
|
6476
|
+
rewrittenSrcset = this.getAutomaticSrcset();
|
|
6477
|
+
}
|
|
6478
|
+
if (rewrittenSrcset) {
|
|
6479
|
+
this.setHostAttribute('srcset', rewrittenSrcset);
|
|
6480
|
+
}
|
|
6481
|
+
if (this.isServer && this.priority) {
|
|
6482
|
+
this.preloadLinkChecker.createPreloadLinkTag(this.renderer, rewrittenSrc, rewrittenSrcset, this.sizes);
|
|
6295
6483
|
}
|
|
6296
6484
|
}
|
|
6485
|
+
/** @nodoc */
|
|
6297
6486
|
ngOnChanges(changes) {
|
|
6298
6487
|
if (ngDevMode) {
|
|
6299
|
-
assertNoPostInitInputChange(this, changes, [
|
|
6300
|
-
|
|
6488
|
+
assertNoPostInitInputChange(this, changes, [
|
|
6489
|
+
'ngSrc',
|
|
6490
|
+
'ngSrcset',
|
|
6491
|
+
'width',
|
|
6492
|
+
'height',
|
|
6493
|
+
'priority',
|
|
6494
|
+
'fill',
|
|
6495
|
+
'loading',
|
|
6496
|
+
'sizes',
|
|
6497
|
+
'loaderParams',
|
|
6498
|
+
'disableOptimizedSrcset',
|
|
6499
|
+
]);
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
callImageLoader(configWithoutCustomParams) {
|
|
6503
|
+
let augmentedConfig = configWithoutCustomParams;
|
|
6504
|
+
if (this.loaderParams) {
|
|
6505
|
+
augmentedConfig.loaderParams = this.loaderParams;
|
|
6506
|
+
}
|
|
6507
|
+
return this.imageLoader(augmentedConfig);
|
|
6301
6508
|
}
|
|
6302
6509
|
getLoadingBehavior() {
|
|
6303
6510
|
if (!this.priority && this.loading !== undefined) {
|
|
@@ -6315,7 +6522,7 @@ class NgOptimizedImage {
|
|
|
6315
6522
|
if (!this._renderedSrc) {
|
|
6316
6523
|
const imgConfig = { src: this.ngSrc };
|
|
6317
6524
|
// Cache calculated image src to reuse it later in the code.
|
|
6318
|
-
this._renderedSrc = this.
|
|
6525
|
+
this._renderedSrc = this.callImageLoader(imgConfig);
|
|
6319
6526
|
}
|
|
6320
6527
|
return this._renderedSrc;
|
|
6321
6528
|
}
|
|
@@ -6324,10 +6531,41 @@ class NgOptimizedImage {
|
|
|
6324
6531
|
const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => {
|
|
6325
6532
|
srcStr = srcStr.trim();
|
|
6326
6533
|
const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
|
|
6327
|
-
return `${this.
|
|
6534
|
+
return `${this.callImageLoader({ src: this.ngSrc, width })} ${srcStr}`;
|
|
6328
6535
|
});
|
|
6329
6536
|
return finalSrcs.join(', ');
|
|
6330
6537
|
}
|
|
6538
|
+
getAutomaticSrcset() {
|
|
6539
|
+
if (this.sizes) {
|
|
6540
|
+
return this.getResponsiveSrcset();
|
|
6541
|
+
}
|
|
6542
|
+
else {
|
|
6543
|
+
return this.getFixedSrcset();
|
|
6544
|
+
}
|
|
6545
|
+
}
|
|
6546
|
+
getResponsiveSrcset() {
|
|
6547
|
+
const { breakpoints } = this.config;
|
|
6548
|
+
let filteredBreakpoints = breakpoints;
|
|
6549
|
+
if (this.sizes?.trim() === '100vw') {
|
|
6550
|
+
// Since this is a full-screen-width image, our srcset only needs to include
|
|
6551
|
+
// breakpoints with full viewport widths.
|
|
6552
|
+
filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
|
|
6553
|
+
}
|
|
6554
|
+
const finalSrcs = filteredBreakpoints.map(bp => `${this.callImageLoader({ src: this.ngSrc, width: bp })} ${bp}w`);
|
|
6555
|
+
return finalSrcs.join(', ');
|
|
6556
|
+
}
|
|
6557
|
+
getFixedSrcset() {
|
|
6558
|
+
const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => {
|
|
6559
|
+
const imgUrl = this.callImageLoader({ src: this.ngSrc, width: this.width * multiplier });
|
|
6560
|
+
return `${imgUrl} ${multiplier}x`;
|
|
6561
|
+
});
|
|
6562
|
+
return finalSrcs.join(', ');
|
|
6563
|
+
}
|
|
6564
|
+
shouldGenerateAutomaticSrcset() {
|
|
6565
|
+
return !this._disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader &&
|
|
6566
|
+
!(this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT);
|
|
6567
|
+
}
|
|
6568
|
+
/** @nodoc */
|
|
6331
6569
|
ngOnDestroy() {
|
|
6332
6570
|
if (ngDevMode) {
|
|
6333
6571
|
if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) {
|
|
@@ -6339,20 +6577,26 @@ class NgOptimizedImage {
|
|
|
6339
6577
|
this.renderer.setAttribute(this.imgElement, name, value);
|
|
6340
6578
|
}
|
|
6341
6579
|
}
|
|
6342
|
-
NgOptimizedImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
6343
|
-
NgOptimizedImage.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
6344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
6580
|
+
NgOptimizedImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgOptimizedImage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6581
|
+
NgOptimizedImage.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NgOptimizedImage, isStandalone: true, selector: "img[ngSrc]", inputs: { ngSrc: "ngSrc", ngSrcset: "ngSrcset", sizes: "sizes", width: "width", height: "height", loading: "loading", priority: "priority", loaderParams: "loaderParams", disableOptimizedSrcset: "disableOptimizedSrcset", fill: "fill", src: "src", srcset: "srcset" }, host: { properties: { "style.position": "fill ? \"absolute\" : null", "style.width": "fill ? \"100%\" : null", "style.height": "fill ? \"100%\" : null", "style.inset": "fill ? \"0px\" : null" } }, usesOnChanges: true, ngImport: i0 });
|
|
6582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgOptimizedImage, decorators: [{
|
|
6345
6583
|
type: Directive,
|
|
6346
6584
|
args: [{
|
|
6347
6585
|
standalone: true,
|
|
6348
|
-
selector: 'img[ngSrc]
|
|
6586
|
+
selector: 'img[ngSrc]',
|
|
6587
|
+
host: {
|
|
6588
|
+
'[style.position]': 'fill ? "absolute" : null',
|
|
6589
|
+
'[style.width]': 'fill ? "100%" : null',
|
|
6590
|
+
'[style.height]': 'fill ? "100%" : null',
|
|
6591
|
+
'[style.inset]': 'fill ? "0px" : null'
|
|
6592
|
+
}
|
|
6349
6593
|
}]
|
|
6350
|
-
}], propDecorators: {
|
|
6351
|
-
type: Input
|
|
6352
|
-
}], ngSrc: [{
|
|
6594
|
+
}], propDecorators: { ngSrc: [{
|
|
6353
6595
|
type: Input
|
|
6354
6596
|
}], ngSrcset: [{
|
|
6355
6597
|
type: Input
|
|
6598
|
+
}], sizes: [{
|
|
6599
|
+
type: Input
|
|
6356
6600
|
}], width: [{
|
|
6357
6601
|
type: Input
|
|
6358
6602
|
}], height: [{
|
|
@@ -6361,6 +6605,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
6361
6605
|
type: Input
|
|
6362
6606
|
}], priority: [{
|
|
6363
6607
|
type: Input
|
|
6608
|
+
}], loaderParams: [{
|
|
6609
|
+
type: Input
|
|
6610
|
+
}], disableOptimizedSrcset: [{
|
|
6611
|
+
type: Input
|
|
6612
|
+
}], fill: [{
|
|
6613
|
+
type: Input
|
|
6364
6614
|
}], src: [{
|
|
6365
6615
|
type: Input
|
|
6366
6616
|
}], srcset: [{
|
|
@@ -6379,6 +6629,16 @@ function inputToInteger(value) {
|
|
|
6379
6629
|
function inputToBoolean(value) {
|
|
6380
6630
|
return value != null && `${value}` !== 'false';
|
|
6381
6631
|
}
|
|
6632
|
+
/**
|
|
6633
|
+
* Sorts provided config breakpoints and uses defaults.
|
|
6634
|
+
*/
|
|
6635
|
+
function processConfig(config) {
|
|
6636
|
+
let sortedBreakpoints = {};
|
|
6637
|
+
if (config.breakpoints) {
|
|
6638
|
+
sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
|
|
6639
|
+
}
|
|
6640
|
+
return Object.assign({}, defaultConfig, config, sortedBreakpoints);
|
|
6641
|
+
}
|
|
6382
6642
|
/***** Assert functions *****/
|
|
6383
6643
|
/**
|
|
6384
6644
|
* Verifies that there is no `src` set on a host element.
|
|
@@ -6417,6 +6677,18 @@ function assertNotBase64Image(dir) {
|
|
|
6417
6677
|
`by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
|
|
6418
6678
|
}
|
|
6419
6679
|
}
|
|
6680
|
+
/**
|
|
6681
|
+
* Verifies that the 'sizes' only includes responsive values.
|
|
6682
|
+
*/
|
|
6683
|
+
function assertNoComplexSizes(dir) {
|
|
6684
|
+
let sizes = dir.sizes;
|
|
6685
|
+
if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
|
|
6686
|
+
throw new ɵRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` +
|
|
6687
|
+
`pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` +
|
|
6688
|
+
`values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` +
|
|
6689
|
+
`To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
|
|
6690
|
+
}
|
|
6691
|
+
}
|
|
6420
6692
|
/**
|
|
6421
6693
|
* Verifies that the `ngSrc` is not a Blob URL.
|
|
6422
6694
|
*/
|
|
@@ -6477,10 +6749,19 @@ function assertUnderDensityCap(dir, value) {
|
|
|
6477
6749
|
* the directive has initialized.
|
|
6478
6750
|
*/
|
|
6479
6751
|
function postInitInputChangeError(dir, inputName) {
|
|
6752
|
+
let reason;
|
|
6753
|
+
if (inputName === 'width' || inputName === 'height') {
|
|
6754
|
+
reason = `Changing \`${inputName}\` may result in different attribute value ` +
|
|
6755
|
+
`applied to the underlying image element and cause layout shifts on a page.`;
|
|
6756
|
+
}
|
|
6757
|
+
else {
|
|
6758
|
+
reason = `Changing the \`${inputName}\` would have no effect on the underlying ` +
|
|
6759
|
+
`image element, because the resource loading has already occurred.`;
|
|
6760
|
+
}
|
|
6480
6761
|
return new ɵRuntimeError(2953 /* RuntimeErrorCode.UNEXPECTED_INPUT_CHANGE */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` +
|
|
6481
|
-
`The NgOptimizedImage directive will not react to this input change. ` +
|
|
6482
|
-
`To fix this, switch \`${inputName}\` a static value
|
|
6483
|
-
`in an *ngIf that is gated on the necessary value.`);
|
|
6762
|
+
`The NgOptimizedImage directive will not react to this input change. ${reason} ` +
|
|
6763
|
+
`To fix this, either switch \`${inputName}\` to a static value ` +
|
|
6764
|
+
`or wrap the image element in an *ngIf that is gated on the necessary value.`);
|
|
6484
6765
|
}
|
|
6485
6766
|
/**
|
|
6486
6767
|
* Verify that none of the listed inputs has changed.
|
|
@@ -6520,15 +6801,12 @@ function assertGreaterThanZero(dir, inputValue, inputName) {
|
|
|
6520
6801
|
function assertNoImageDistortion(dir, img, renderer) {
|
|
6521
6802
|
const removeListenerFn = renderer.listen(img, 'load', () => {
|
|
6522
6803
|
removeListenerFn();
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
// Verify whether `parseFloat` is needed in the cases below.
|
|
6526
|
-
const renderedWidth = parseFloat(img.clientWidth);
|
|
6527
|
-
const renderedHeight = parseFloat(img.clientHeight);
|
|
6804
|
+
const renderedWidth = img.clientWidth;
|
|
6805
|
+
const renderedHeight = img.clientHeight;
|
|
6528
6806
|
const renderedAspectRatio = renderedWidth / renderedHeight;
|
|
6529
6807
|
const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
|
|
6530
|
-
const intrinsicWidth =
|
|
6531
|
-
const intrinsicHeight =
|
|
6808
|
+
const intrinsicWidth = img.naturalWidth;
|
|
6809
|
+
const intrinsicHeight = img.naturalHeight;
|
|
6532
6810
|
const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
|
|
6533
6811
|
const suppliedWidth = dir.width;
|
|
6534
6812
|
const suppliedHeight = dir.height;
|
|
@@ -6593,9 +6871,38 @@ function assertNonEmptyWidthAndHeight(dir) {
|
|
|
6593
6871
|
throw new ɵRuntimeError(2954 /* RuntimeErrorCode.REQUIRED_INPUT_MISSING */, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` +
|
|
6594
6872
|
`are missing: ${missingAttributes.map(attr => `"${attr}"`).join(', ')}. ` +
|
|
6595
6873
|
`Including "width" and "height" attributes will prevent image-related layout shifts. ` +
|
|
6596
|
-
`To fix this, include "width" and "height" attributes on the image tag
|
|
6874
|
+
`To fix this, include "width" and "height" attributes on the image tag or turn on ` +
|
|
6875
|
+
`"fill" mode with the \`fill\` attribute.`);
|
|
6876
|
+
}
|
|
6877
|
+
}
|
|
6878
|
+
/**
|
|
6879
|
+
* Verifies that width and height are not set. Used in fill mode, where those attributes don't make
|
|
6880
|
+
* sense.
|
|
6881
|
+
*/
|
|
6882
|
+
function assertEmptyWidthAndHeight(dir) {
|
|
6883
|
+
if (dir.width || dir.height) {
|
|
6884
|
+
throw new ɵRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` +
|
|
6885
|
+
`along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` +
|
|
6886
|
+
`element, the size attributes have no effect and should be removed.`);
|
|
6597
6887
|
}
|
|
6598
6888
|
}
|
|
6889
|
+
/**
|
|
6890
|
+
* Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides
|
|
6891
|
+
* guidance that this can be caused by the containing element's CSS position property.
|
|
6892
|
+
*/
|
|
6893
|
+
function assertNonZeroRenderedHeight(dir, img, renderer) {
|
|
6894
|
+
const removeListenerFn = renderer.listen(img, 'load', () => {
|
|
6895
|
+
removeListenerFn();
|
|
6896
|
+
const renderedHeight = img.clientHeight;
|
|
6897
|
+
if (dir.fill && renderedHeight === 0) {
|
|
6898
|
+
console.warn(ɵformatRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` +
|
|
6899
|
+
`This is likely because the containing element does not have the CSS 'position' ` +
|
|
6900
|
+
`property set to one of the following: "relative", "fixed", or "absolute". ` +
|
|
6901
|
+
`To fix this problem, make sure the container element has the CSS 'position' ` +
|
|
6902
|
+
`property defined and the height of the element is not zero.`));
|
|
6903
|
+
}
|
|
6904
|
+
});
|
|
6905
|
+
}
|
|
6599
6906
|
/**
|
|
6600
6907
|
* Verifies that the `loading` attribute is set to a valid input &
|
|
6601
6908
|
* is not used on priority images.
|
|
@@ -6615,6 +6922,58 @@ function assertValidLoadingInput(dir) {
|
|
|
6615
6922
|
`To fix this, provide a valid value ("lazy", "eager", or "auto").`);
|
|
6616
6923
|
}
|
|
6617
6924
|
}
|
|
6925
|
+
/**
|
|
6926
|
+
* Warns if NOT using a loader (falling back to the generic loader) and
|
|
6927
|
+
* the image appears to be hosted on one of the image CDNs for which
|
|
6928
|
+
* we do have a built-in image loader. Suggests switching to the
|
|
6929
|
+
* built-in loader.
|
|
6930
|
+
*
|
|
6931
|
+
* @param ngSrc Value of the ngSrc attribute
|
|
6932
|
+
* @param imageLoader ImageLoader provided
|
|
6933
|
+
*/
|
|
6934
|
+
function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
|
|
6935
|
+
if (imageLoader === noopImageLoader) {
|
|
6936
|
+
let builtInLoaderName = '';
|
|
6937
|
+
for (const loader of BUILT_IN_LOADERS) {
|
|
6938
|
+
if (loader.testUrl(ngSrc)) {
|
|
6939
|
+
builtInLoaderName = loader.name;
|
|
6940
|
+
break;
|
|
6941
|
+
}
|
|
6942
|
+
}
|
|
6943
|
+
if (builtInLoaderName) {
|
|
6944
|
+
console.warn(ɵformatRuntimeError(2962 /* RuntimeErrorCode.MISSING_BUILTIN_LOADER */, `NgOptimizedImage: It looks like your images may be hosted on the ` +
|
|
6945
|
+
`${builtInLoaderName} CDN, but your app is not using Angular's ` +
|
|
6946
|
+
`built-in loader for that CDN. We recommend switching to use ` +
|
|
6947
|
+
`the built-in by calling \`provide${builtInLoaderName}Loader()\` ` +
|
|
6948
|
+
`in your \`providers\` and passing it your instance's base URL. ` +
|
|
6949
|
+
`If you don't want to use the built-in loader, define a custom ` +
|
|
6950
|
+
`loader function using IMAGE_LOADER to silence this warning.`));
|
|
6951
|
+
}
|
|
6952
|
+
}
|
|
6953
|
+
}
|
|
6954
|
+
/**
|
|
6955
|
+
* Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used).
|
|
6956
|
+
*/
|
|
6957
|
+
function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
|
|
6958
|
+
if (dir.ngSrcset && imageLoader === noopImageLoader) {
|
|
6959
|
+
console.warn(ɵformatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` +
|
|
6960
|
+
`no image loader is configured (i.e. the default one is being used), ` +
|
|
6961
|
+
`which would result in the same image being used for all configured sizes. ` +
|
|
6962
|
+
`To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
|
|
6963
|
+
}
|
|
6964
|
+
}
|
|
6965
|
+
/**
|
|
6966
|
+
* Warns if loaderParams is present and no loader is configured (i.e. the default one is being
|
|
6967
|
+
* used).
|
|
6968
|
+
*/
|
|
6969
|
+
function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
|
|
6970
|
+
if (dir.loaderParams && imageLoader === noopImageLoader) {
|
|
6971
|
+
console.warn(ɵformatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` +
|
|
6972
|
+
`no image loader is configured (i.e. the default one is being used), ` +
|
|
6973
|
+
`which means that the loaderParams data will not be consumed and will not affect the URL. ` +
|
|
6974
|
+
`To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
|
|
6975
|
+
}
|
|
6976
|
+
}
|
|
6618
6977
|
|
|
6619
6978
|
/**
|
|
6620
6979
|
* @license
|