@angular/common 15.0.0-next.4 → 15.0.0-next.6
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/public_api.mjs +6 -3
- package/esm2020/http/src/backend.mjs +1 -1
- package/esm2020/http/src/client.mjs +3 -3
- package/esm2020/http/src/interceptor.mjs +65 -20
- package/esm2020/http/src/jsonp.mjs +38 -18
- package/esm2020/http/src/module.mjs +40 -116
- package/esm2020/http/src/provider.mjs +129 -0
- package/esm2020/http/src/xhr.mjs +3 -3
- package/esm2020/http/src/xsrf.mjs +42 -33
- package/esm2020/http/testing/public_api.mjs +2 -1
- package/esm2020/http/testing/src/backend.mjs +3 -3
- package/esm2020/http/testing/src/module.mjs +9 -14
- package/esm2020/http/testing/src/provider.mjs +18 -0
- package/esm2020/src/common.mjs +2 -2
- 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 -5
- package/esm2020/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.mjs +1 -5
- package/esm2020/src/directives/ng_optimized_image/image_loaders/image_loader.mjs +2 -6
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imagekit_loader.mjs +1 -5
- package/esm2020/src/directives/ng_optimized_image/image_loaders/imgix_loader.mjs +1 -5
- package/esm2020/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2020/src/directives/ng_optimized_image/ng_optimized_image.mjs +156 -11
- package/esm2020/src/directives/ng_optimized_image/preconnect_link_checker.mjs +9 -10
- package/esm2020/src/directives/ng_optimized_image/preload-link-creator.mjs +74 -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 +50 -7
- package/esm2020/src/pipes/date_pipe_config.mjs +13 -0
- package/esm2020/src/pipes/i18n_plural_pipe.mjs +5 -5
- package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2020/src/pipes/index.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/testing/src/provide_location_mocks.mjs +24 -0
- package/esm2020/testing/src/testing.mjs +2 -1
- package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2015/common.mjs +578 -306
- package/fesm2015/common.mjs.map +1 -1
- package/fesm2015/http/testing.mjs +27 -16
- package/fesm2015/http/testing.mjs.map +1 -1
- package/fesm2015/http.mjs +295 -174
- package/fesm2015/http.mjs.map +1 -1
- package/fesm2015/testing.mjs +33 -12
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +5 -5
- package/fesm2020/common.mjs +575 -304
- package/fesm2020/common.mjs.map +1 -1
- package/fesm2020/http/testing.mjs +27 -16
- package/fesm2020/http/testing.mjs.map +1 -1
- package/fesm2020/http.mjs +294 -172
- package/fesm2020/http.mjs.map +1 -1
- package/fesm2020/testing.mjs +33 -12
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +5 -5
- package/http/index.d.ts +87 -30
- package/http/testing/index.d.ts +4 -1
- package/index.d.ts +97 -39
- package/package.json +3 -3
- package/testing/index.d.ts +11 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2015/common.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-next.
|
|
2
|
+
* @license Angular v15.0.0-next.6
|
|
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: "15.0.0-next.
|
|
91
|
-
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
90
|
+
PlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PlatformLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
+
PlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PlatformLocation, providedIn: 'platform', useFactory: useBrowserPlatformLocation });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", 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: "15.0.0-next.
|
|
194
|
-
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
193
|
+
BrowserPlatformLocation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: BrowserPlatformLocation, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
194
|
+
BrowserPlatformLocation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: BrowserPlatformLocation, providedIn: 'platform', useFactory: createBrowserPlatformLocation });
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: BrowserPlatformLocation, decorators: [{
|
|
196
196
|
type: Injectable,
|
|
197
197
|
args: [{
|
|
198
198
|
providedIn: 'platform',
|
|
@@ -313,9 +313,9 @@ class LocationStrategy {
|
|
|
313
313
|
throw new Error('Not implemented');
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
317
|
-
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
316
|
+
LocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LocationStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
317
|
+
LocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LocationStrategy, providedIn: 'root', useFactory: () => inject(PathLocationStrategy) });
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LocationStrategy, decorators: [{
|
|
319
319
|
type: Injectable,
|
|
320
320
|
args: [{ providedIn: 'root', useFactory: () => inject(PathLocationStrategy) }]
|
|
321
321
|
}] });
|
|
@@ -424,9 +424,9 @@ class PathLocationStrategy extends LocationStrategy {
|
|
|
424
424
|
(_b = (_a = this._platformLocation).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
428
|
-
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
427
|
+
PathLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PathLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
428
|
+
PathLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PathLocationStrategy, providedIn: 'root' });
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PathLocationStrategy, decorators: [{
|
|
430
430
|
type: Injectable,
|
|
431
431
|
args: [{ providedIn: 'root' }]
|
|
432
432
|
}], ctorParameters: function () {
|
|
@@ -525,9 +525,9 @@ class HashLocationStrategy extends LocationStrategy {
|
|
|
525
525
|
(_b = (_a = this._platformLocation).historyGo) === null || _b === void 0 ? void 0 : _b.call(_a, relativePosition);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
529
|
-
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
530
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
528
|
+
HashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: HashLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
529
|
+
HashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: HashLocationStrategy });
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: HashLocationStrategy, decorators: [{
|
|
531
531
|
type: Injectable
|
|
532
532
|
}], ctorParameters: function () {
|
|
533
533
|
return [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
@@ -783,9 +783,9 @@ Location.joinWithSlash = joinWithSlash;
|
|
|
783
783
|
* @returns The URL string, modified if needed.
|
|
784
784
|
*/
|
|
785
785
|
Location.stripTrailingSlash = stripTrailingSlash;
|
|
786
|
-
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
787
|
-
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
788
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
786
|
+
Location.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Location, deps: [{ token: LocationStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
787
|
+
Location.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Location, providedIn: 'root', useFactory: createLocation });
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Location, decorators: [{
|
|
789
789
|
type: Injectable,
|
|
790
790
|
args: [{
|
|
791
791
|
providedIn: 'root',
|
|
@@ -2601,9 +2601,9 @@ function parseIntAutoRadix(text) {
|
|
|
2601
2601
|
*/
|
|
2602
2602
|
class NgLocalization {
|
|
2603
2603
|
}
|
|
2604
|
-
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2605
|
-
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2606
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2604
|
+
NgLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocalization, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2605
|
+
NgLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocalization, providedIn: 'root', useFactory: (locale) => new NgLocaleLocalization(locale), deps: [{ token: LOCALE_ID }] });
|
|
2606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocalization, decorators: [{
|
|
2607
2607
|
type: Injectable,
|
|
2608
2608
|
args: [{
|
|
2609
2609
|
providedIn: 'root',
|
|
@@ -2658,9 +2658,9 @@ class NgLocaleLocalization extends NgLocalization {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
2660
|
}
|
|
2661
|
-
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2662
|
-
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2663
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2661
|
+
NgLocaleLocalization.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocaleLocalization, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2662
|
+
NgLocaleLocalization.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocaleLocalization });
|
|
2663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgLocaleLocalization, decorators: [{
|
|
2664
2664
|
type: Injectable
|
|
2665
2665
|
}], ctorParameters: function () {
|
|
2666
2666
|
return [{ type: undefined, decorators: [{
|
|
@@ -2855,9 +2855,9 @@ class NgClass {
|
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
2857
|
}
|
|
2858
|
-
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2859
|
-
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
2860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2858
|
+
NgClass.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgClass, deps: [{ token: i0.IterableDiffers }, { token: i0.KeyValueDiffers }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2859
|
+
NgClass.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgClass, isStandalone: true, selector: "[ngClass]", inputs: { klass: ["class", "klass"], ngClass: "ngClass" }, ngImport: i0 });
|
|
2860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgClass, decorators: [{
|
|
2861
2861
|
type: Directive,
|
|
2862
2862
|
args: [{
|
|
2863
2863
|
selector: '[ngClass]',
|
|
@@ -2976,9 +2976,9 @@ class NgComponentOutlet {
|
|
|
2976
2976
|
this._moduleRef.destroy();
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
|
-
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2980
|
-
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
2981
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2979
|
+
NgComponentOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgComponentOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2980
|
+
NgComponentOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgComponentOutlet, isStandalone: true, selector: "[ngComponentOutlet]", inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModule: "ngComponentOutletNgModule", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, usesOnChanges: true, ngImport: i0 });
|
|
2981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgComponentOutlet, decorators: [{
|
|
2982
2982
|
type: Directive,
|
|
2983
2983
|
args: [{
|
|
2984
2984
|
selector: '[ngComponentOutlet]',
|
|
@@ -3268,9 +3268,9 @@ class NgForOf {
|
|
|
3268
3268
|
return true;
|
|
3269
3269
|
}
|
|
3270
3270
|
}
|
|
3271
|
-
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3272
|
-
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3271
|
+
NgForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3272
|
+
NgForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgForOf, isStandalone: true, selector: "[ngFor][ngForOf]", inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" }, ngImport: i0 });
|
|
3273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgForOf, decorators: [{
|
|
3274
3274
|
type: Directive,
|
|
3275
3275
|
args: [{
|
|
3276
3276
|
selector: '[ngFor][ngForOf]',
|
|
@@ -3503,9 +3503,9 @@ class NgIf {
|
|
|
3503
3503
|
return true;
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
|
-
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3507
|
-
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3508
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3506
|
+
NgIf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgIf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3507
|
+
NgIf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgIf, isStandalone: true, selector: "[ngIf]", inputs: { ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" }, ngImport: i0 });
|
|
3508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgIf, decorators: [{
|
|
3509
3509
|
type: Directive,
|
|
3510
3510
|
args: [{
|
|
3511
3511
|
selector: '[ngIf]',
|
|
@@ -3676,9 +3676,9 @@ class NgSwitch {
|
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
}
|
|
3679
|
-
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3680
|
-
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3681
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3679
|
+
NgSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3680
|
+
NgSwitch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgSwitch, isStandalone: true, selector: "[ngSwitch]", inputs: { ngSwitch: "ngSwitch" }, ngImport: i0 });
|
|
3681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitch, decorators: [{
|
|
3682
3682
|
type: Directive,
|
|
3683
3683
|
args: [{
|
|
3684
3684
|
selector: '[ngSwitch]',
|
|
@@ -3737,9 +3737,9 @@ class NgSwitchCase {
|
|
|
3737
3737
|
this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
|
|
3738
3738
|
}
|
|
3739
3739
|
}
|
|
3740
|
-
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3741
|
-
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3742
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3740
|
+
NgSwitchCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitchCase, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3741
|
+
NgSwitchCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgSwitchCase, isStandalone: true, selector: "[ngSwitchCase]", inputs: { ngSwitchCase: "ngSwitchCase" }, ngImport: i0 });
|
|
3742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitchCase, decorators: [{
|
|
3743
3743
|
type: Directive,
|
|
3744
3744
|
args: [{
|
|
3745
3745
|
selector: '[ngSwitchCase]',
|
|
@@ -3776,9 +3776,9 @@ class NgSwitchDefault {
|
|
|
3776
3776
|
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
|
|
3777
3777
|
}
|
|
3778
3778
|
}
|
|
3779
|
-
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3780
|
-
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3781
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3779
|
+
NgSwitchDefault.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitchDefault, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NgSwitch, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3780
|
+
NgSwitchDefault.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgSwitchDefault, isStandalone: true, selector: "[ngSwitchDefault]", ngImport: i0 });
|
|
3781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgSwitchDefault, decorators: [{
|
|
3782
3782
|
type: Directive,
|
|
3783
3783
|
args: [{
|
|
3784
3784
|
selector: '[ngSwitchDefault]',
|
|
@@ -3864,9 +3864,9 @@ class NgPlural {
|
|
|
3864
3864
|
}
|
|
3865
3865
|
}
|
|
3866
3866
|
}
|
|
3867
|
-
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3868
|
-
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3867
|
+
NgPlural.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgPlural, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3868
|
+
NgPlural.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgPlural, isStandalone: true, selector: "[ngPlural]", inputs: { ngPlural: "ngPlural" }, ngImport: i0 });
|
|
3869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgPlural, decorators: [{
|
|
3870
3870
|
type: Directive,
|
|
3871
3871
|
args: [{
|
|
3872
3872
|
selector: '[ngPlural]',
|
|
@@ -3902,9 +3902,9 @@ class NgPluralCase {
|
|
|
3902
3902
|
ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
|
|
3903
3903
|
}
|
|
3904
3904
|
}
|
|
3905
|
-
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3906
|
-
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
3907
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
3905
|
+
NgPluralCase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgPluralCase, deps: [{ token: 'ngPluralCase', attribute: true }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: NgPlural, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3906
|
+
NgPluralCase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgPluralCase, isStandalone: true, selector: "[ngPluralCase]", ngImport: i0 });
|
|
3907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgPluralCase, decorators: [{
|
|
3908
3908
|
type: Directive,
|
|
3909
3909
|
args: [{
|
|
3910
3910
|
selector: '[ngPluralCase]',
|
|
@@ -4000,9 +4000,9 @@ class NgStyle {
|
|
|
4000
4000
|
changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
|
|
4001
4001
|
}
|
|
4002
4002
|
}
|
|
4003
|
-
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4004
|
-
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4003
|
+
NgStyle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgStyle, deps: [{ token: i0.ElementRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4004
|
+
NgStyle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgStyle, isStandalone: true, selector: "[ngStyle]", inputs: { ngStyle: "ngStyle" }, ngImport: i0 });
|
|
4005
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgStyle, decorators: [{
|
|
4006
4006
|
type: Directive,
|
|
4007
4007
|
args: [{
|
|
4008
4008
|
selector: '[ngStyle]',
|
|
@@ -4082,9 +4082,9 @@ class NgTemplateOutlet {
|
|
|
4082
4082
|
}
|
|
4083
4083
|
}
|
|
4084
4084
|
}
|
|
4085
|
-
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4086
|
-
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4087
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4085
|
+
NgTemplateOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgTemplateOutlet, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4086
|
+
NgTemplateOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgTemplateOutlet, isStandalone: true, selector: "[ngTemplateOutlet]", inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet", ngTemplateOutletInjector: "ngTemplateOutletInjector" }, usesOnChanges: true, ngImport: i0 });
|
|
4087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgTemplateOutlet, decorators: [{
|
|
4088
4088
|
type: Directive,
|
|
4089
4089
|
args: [{
|
|
4090
4090
|
selector: '[ngTemplateOutlet]',
|
|
@@ -4256,9 +4256,9 @@ class AsyncPipe {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
4258
4258
|
}
|
|
4259
|
-
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4260
|
-
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4259
|
+
AsyncPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: AsyncPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4260
|
+
AsyncPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: AsyncPipe, isStandalone: true, name: "async", pure: false });
|
|
4261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: AsyncPipe, decorators: [{
|
|
4262
4262
|
type: Pipe,
|
|
4263
4263
|
args: [{
|
|
4264
4264
|
name: 'async',
|
|
@@ -4299,9 +4299,9 @@ class LowerCasePipe {
|
|
|
4299
4299
|
return value.toLowerCase();
|
|
4300
4300
|
}
|
|
4301
4301
|
}
|
|
4302
|
-
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4303
|
-
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4302
|
+
LowerCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LowerCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4303
|
+
LowerCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: LowerCasePipe, isStandalone: true, name: "lowercase" });
|
|
4304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LowerCasePipe, decorators: [{
|
|
4305
4305
|
type: Pipe,
|
|
4306
4306
|
args: [{
|
|
4307
4307
|
name: 'lowercase',
|
|
@@ -4344,9 +4344,9 @@ class TitleCasePipe {
|
|
|
4344
4344
|
return value.replace(unicodeWordMatch, (txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase()));
|
|
4345
4345
|
}
|
|
4346
4346
|
}
|
|
4347
|
-
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4348
|
-
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4347
|
+
TitleCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4348
|
+
TitleCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleCasePipe, isStandalone: true, name: "titlecase" });
|
|
4349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleCasePipe, decorators: [{
|
|
4350
4350
|
type: Pipe,
|
|
4351
4351
|
args: [{
|
|
4352
4352
|
name: 'titlecase',
|
|
@@ -4371,9 +4371,9 @@ class UpperCasePipe {
|
|
|
4371
4371
|
return value.toUpperCase();
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
|
-
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4375
|
-
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4376
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4374
|
+
UpperCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: UpperCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4375
|
+
UpperCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: UpperCasePipe, isStandalone: true, name: "uppercase" });
|
|
4376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: UpperCasePipe, decorators: [{
|
|
4377
4377
|
type: Pipe,
|
|
4378
4378
|
args: [{
|
|
4379
4379
|
name: 'uppercase',
|
|
@@ -4381,6 +4381,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
4381
4381
|
}]
|
|
4382
4382
|
}] });
|
|
4383
4383
|
|
|
4384
|
+
/**
|
|
4385
|
+
* @license
|
|
4386
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4387
|
+
*
|
|
4388
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4389
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4390
|
+
*/
|
|
4391
|
+
/**
|
|
4392
|
+
* The default date format of Angular date pipe, which corresponds to the following format:
|
|
4393
|
+
* `'MMM d,y'` (e.g. `Jun 15, 2015`)
|
|
4394
|
+
*/
|
|
4395
|
+
const DEFAULT_DATE_FORMAT = 'mediumDate';
|
|
4396
|
+
|
|
4384
4397
|
/**
|
|
4385
4398
|
* @license
|
|
4386
4399
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4391,8 +4404,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
4391
4404
|
/**
|
|
4392
4405
|
* Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).
|
|
4393
4406
|
* If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.
|
|
4407
|
+
*
|
|
4408
|
+
* @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe
|
|
4394
4409
|
*/
|
|
4395
4410
|
const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken('DATE_PIPE_DEFAULT_TIMEZONE');
|
|
4411
|
+
/**
|
|
4412
|
+
* DI token that allows to provide default configuration for the `DatePipe` instances in an
|
|
4413
|
+
* application. The value is an object which can include the following fields:
|
|
4414
|
+
* - `dateFormat`: configures the default date format. If not provided, the `DatePipe`
|
|
4415
|
+
* will use the 'mediumDate' as a value.
|
|
4416
|
+
* - `timezone`: configures the default timezone. If not provided, the `DatePipe` will
|
|
4417
|
+
* use the end-user's local system timezone.
|
|
4418
|
+
*
|
|
4419
|
+
* @see `DatePipeConfig`
|
|
4420
|
+
*
|
|
4421
|
+
* @usageNotes
|
|
4422
|
+
*
|
|
4423
|
+
* Various date pipe default values can be overwritten by providing this token with
|
|
4424
|
+
* the value that has this interface.
|
|
4425
|
+
*
|
|
4426
|
+
* For example:
|
|
4427
|
+
*
|
|
4428
|
+
* Override the default date format by providing a value using the token:
|
|
4429
|
+
* ```typescript
|
|
4430
|
+
* providers: [
|
|
4431
|
+
* {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}
|
|
4432
|
+
* ]
|
|
4433
|
+
* ```
|
|
4434
|
+
*
|
|
4435
|
+
* Override the default timezone by providing a value using the token:
|
|
4436
|
+
* ```typescript
|
|
4437
|
+
* providers: [
|
|
4438
|
+
* {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}
|
|
4439
|
+
* ]
|
|
4440
|
+
* ```
|
|
4441
|
+
*/
|
|
4442
|
+
const DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken('DATE_PIPE_DEFAULT_OPTIONS');
|
|
4396
4443
|
// clang-format off
|
|
4397
4444
|
/**
|
|
4398
4445
|
* @ngModule CommonModule
|
|
@@ -4553,25 +4600,28 @@ const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken('DATE_PIPE_DEFAULT_TIMEZON
|
|
|
4553
4600
|
*/
|
|
4554
4601
|
// clang-format on
|
|
4555
4602
|
class DatePipe {
|
|
4556
|
-
constructor(locale, defaultTimezone) {
|
|
4603
|
+
constructor(locale, defaultTimezone, defaultOptions) {
|
|
4557
4604
|
this.locale = locale;
|
|
4558
4605
|
this.defaultTimezone = defaultTimezone;
|
|
4606
|
+
this.defaultOptions = defaultOptions;
|
|
4559
4607
|
}
|
|
4560
|
-
transform(value, format
|
|
4561
|
-
var _a;
|
|
4608
|
+
transform(value, format, timezone, locale) {
|
|
4609
|
+
var _a, _b, _c, _d, _e;
|
|
4562
4610
|
if (value == null || value === '' || value !== value)
|
|
4563
4611
|
return null;
|
|
4564
4612
|
try {
|
|
4565
|
-
|
|
4613
|
+
const _format = (_b = format !== null && format !== void 0 ? format : (_a = this.defaultOptions) === null || _a === void 0 ? void 0 : _a.dateFormat) !== null && _b !== void 0 ? _b : DEFAULT_DATE_FORMAT;
|
|
4614
|
+
const _timezone = (_e = (_d = timezone !== null && timezone !== void 0 ? timezone : (_c = this.defaultOptions) === null || _c === void 0 ? void 0 : _c.timezone) !== null && _d !== void 0 ? _d : this.defaultTimezone) !== null && _e !== void 0 ? _e : undefined;
|
|
4615
|
+
return formatDate(value, _format, locale || this.locale, _timezone);
|
|
4566
4616
|
}
|
|
4567
4617
|
catch (error) {
|
|
4568
4618
|
throw invalidPipeArgumentError(DatePipe, error.message);
|
|
4569
4619
|
}
|
|
4570
4620
|
}
|
|
4571
4621
|
}
|
|
4572
|
-
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4573
|
-
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4574
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4622
|
+
DatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DatePipe, deps: [{ token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }, { token: DATE_PIPE_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4623
|
+
DatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: DatePipe, isStandalone: true, name: "date" });
|
|
4624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DatePipe, decorators: [{
|
|
4575
4625
|
type: Pipe,
|
|
4576
4626
|
args: [{
|
|
4577
4627
|
name: 'date',
|
|
@@ -4587,6 +4637,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
4587
4637
|
args: [DATE_PIPE_DEFAULT_TIMEZONE]
|
|
4588
4638
|
}, {
|
|
4589
4639
|
type: Optional
|
|
4640
|
+
}] }, { type: undefined, decorators: [{
|
|
4641
|
+
type: Inject,
|
|
4642
|
+
args: [DATE_PIPE_DEFAULT_OPTIONS]
|
|
4643
|
+
}, {
|
|
4644
|
+
type: Optional
|
|
4590
4645
|
}] }];
|
|
4591
4646
|
} });
|
|
4592
4647
|
|
|
@@ -4619,7 +4674,7 @@ class I18nPluralPipe {
|
|
|
4619
4674
|
/**
|
|
4620
4675
|
* @param value the number to be formatted
|
|
4621
4676
|
* @param pluralMap an object that mimics the ICU format, see
|
|
4622
|
-
*
|
|
4677
|
+
* https://unicode-org.github.io/icu/userguide/format_parse/messages/.
|
|
4623
4678
|
* @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
|
|
4624
4679
|
* default).
|
|
4625
4680
|
*/
|
|
@@ -4633,9 +4688,9 @@ class I18nPluralPipe {
|
|
|
4633
4688
|
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
|
|
4634
4689
|
}
|
|
4635
4690
|
}
|
|
4636
|
-
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4637
|
-
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4691
|
+
I18nPluralPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nPluralPipe, deps: [{ token: NgLocalization }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4692
|
+
I18nPluralPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nPluralPipe, isStandalone: true, name: "i18nPlural" });
|
|
4693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nPluralPipe, decorators: [{
|
|
4639
4694
|
type: Pipe,
|
|
4640
4695
|
args: [{
|
|
4641
4696
|
name: 'i18nPlural',
|
|
@@ -4689,9 +4744,9 @@ class I18nSelectPipe {
|
|
|
4689
4744
|
return '';
|
|
4690
4745
|
}
|
|
4691
4746
|
}
|
|
4692
|
-
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4693
|
-
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4694
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4747
|
+
I18nSelectPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nSelectPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4748
|
+
I18nSelectPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nSelectPipe, isStandalone: true, name: "i18nSelect" });
|
|
4749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: I18nSelectPipe, decorators: [{
|
|
4695
4750
|
type: Pipe,
|
|
4696
4751
|
args: [{
|
|
4697
4752
|
name: 'i18nSelect',
|
|
@@ -4730,9 +4785,9 @@ class JsonPipe {
|
|
|
4730
4785
|
return JSON.stringify(value, null, 2);
|
|
4731
4786
|
}
|
|
4732
4787
|
}
|
|
4733
|
-
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4734
|
-
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4788
|
+
JsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: JsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4789
|
+
JsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: JsonPipe, isStandalone: true, name: "json", pure: false });
|
|
4790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: JsonPipe, decorators: [{
|
|
4736
4791
|
type: Pipe,
|
|
4737
4792
|
args: [{
|
|
4738
4793
|
name: 'json',
|
|
@@ -4800,9 +4855,9 @@ class KeyValuePipe {
|
|
|
4800
4855
|
return this.keyValues;
|
|
4801
4856
|
}
|
|
4802
4857
|
}
|
|
4803
|
-
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4804
|
-
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4805
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4858
|
+
KeyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: KeyValuePipe, deps: [{ token: i0.KeyValueDiffers }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4859
|
+
KeyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: KeyValuePipe, isStandalone: true, name: "keyvalue", pure: false });
|
|
4860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: KeyValuePipe, decorators: [{
|
|
4806
4861
|
type: Pipe,
|
|
4807
4862
|
args: [{
|
|
4808
4863
|
name: 'keyvalue',
|
|
@@ -4935,9 +4990,9 @@ class DecimalPipe {
|
|
|
4935
4990
|
}
|
|
4936
4991
|
}
|
|
4937
4992
|
}
|
|
4938
|
-
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4939
|
-
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
4940
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4993
|
+
DecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DecimalPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4994
|
+
DecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: DecimalPipe, isStandalone: true, name: "number" });
|
|
4995
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DecimalPipe, decorators: [{
|
|
4941
4996
|
type: Pipe,
|
|
4942
4997
|
args: [{
|
|
4943
4998
|
name: 'number',
|
|
@@ -5002,9 +5057,9 @@ class PercentPipe {
|
|
|
5002
5057
|
}
|
|
5003
5058
|
}
|
|
5004
5059
|
}
|
|
5005
|
-
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5006
|
-
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
5007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5060
|
+
PercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PercentPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5061
|
+
PercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: PercentPipe, isStandalone: true, name: "percent" });
|
|
5062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PercentPipe, decorators: [{
|
|
5008
5063
|
type: Pipe,
|
|
5009
5064
|
args: [{
|
|
5010
5065
|
name: 'percent',
|
|
@@ -5122,9 +5177,9 @@ class CurrencyPipe {
|
|
|
5122
5177
|
}
|
|
5123
5178
|
}
|
|
5124
5179
|
}
|
|
5125
|
-
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5126
|
-
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
5127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5180
|
+
CurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: CurrencyPipe, deps: [{ token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5181
|
+
CurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: CurrencyPipe, isStandalone: true, name: "currency" });
|
|
5182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: CurrencyPipe, decorators: [{
|
|
5128
5183
|
type: Pipe,
|
|
5129
5184
|
args: [{
|
|
5130
5185
|
name: 'currency',
|
|
@@ -5211,9 +5266,9 @@ class SlicePipe {
|
|
|
5211
5266
|
return typeof obj === 'string' || Array.isArray(obj);
|
|
5212
5267
|
}
|
|
5213
5268
|
}
|
|
5214
|
-
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5215
|
-
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
5216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5269
|
+
SlicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: SlicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5270
|
+
SlicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: SlicePipe, isStandalone: true, name: "slice", pure: false });
|
|
5271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: SlicePipe, decorators: [{
|
|
5217
5272
|
type: Pipe,
|
|
5218
5273
|
args: [{
|
|
5219
5274
|
name: 'slice',
|
|
@@ -5267,10 +5322,10 @@ const COMMON_PIPES = [
|
|
|
5267
5322
|
*/
|
|
5268
5323
|
class CommonModule {
|
|
5269
5324
|
}
|
|
5270
|
-
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5271
|
-
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
5272
|
-
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5325
|
+
CommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5326
|
+
CommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.6", 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] });
|
|
5327
|
+
CommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: CommonModule });
|
|
5328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: CommonModule, decorators: [{
|
|
5274
5329
|
type: NgModule,
|
|
5275
5330
|
args: [{
|
|
5276
5331
|
imports: [COMMON_DIRECTIVES, COMMON_PIPES],
|
|
@@ -5328,7 +5383,7 @@ function isPlatformWorkerUi(platformId) {
|
|
|
5328
5383
|
/**
|
|
5329
5384
|
* @publicApi
|
|
5330
5385
|
*/
|
|
5331
|
-
const VERSION = new Version('15.0.0-next.
|
|
5386
|
+
const VERSION = new Version('15.0.0-next.6');
|
|
5332
5387
|
|
|
5333
5388
|
/**
|
|
5334
5389
|
* @license
|
|
@@ -5553,38 +5608,6 @@ class NullViewportScroller {
|
|
|
5553
5608
|
class XhrFactory {
|
|
5554
5609
|
}
|
|
5555
5610
|
|
|
5556
|
-
/**
|
|
5557
|
-
* @license
|
|
5558
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5559
|
-
*
|
|
5560
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5561
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5562
|
-
*/
|
|
5563
|
-
/**
|
|
5564
|
-
* Asserts that the application is in development mode. Throws an error if the application is in
|
|
5565
|
-
* production mode. This assert can be used to make sure that there is no dev-mode code invoked in
|
|
5566
|
-
* the prod mode accidentally.
|
|
5567
|
-
*/
|
|
5568
|
-
function assertDevMode(checkName) {
|
|
5569
|
-
if (!ngDevMode) {
|
|
5570
|
-
throw new ɵRuntimeError(2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` +
|
|
5571
|
-
`Please make sure that the prod mode is enabled for production builds.`);
|
|
5572
|
-
}
|
|
5573
|
-
}
|
|
5574
|
-
|
|
5575
|
-
/**
|
|
5576
|
-
* @license
|
|
5577
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5578
|
-
*
|
|
5579
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5580
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5581
|
-
*/
|
|
5582
|
-
// Assembles directive details string, useful for error messages.
|
|
5583
|
-
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
5584
|
-
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : '';
|
|
5585
|
-
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
5586
|
-
}
|
|
5587
|
-
|
|
5588
5611
|
/**
|
|
5589
5612
|
* @license
|
|
5590
5613
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5627,139 +5650,6 @@ function normalizeSrc(src) {
|
|
|
5627
5650
|
return src.startsWith('/') ? src.slice(1) : src;
|
|
5628
5651
|
}
|
|
5629
5652
|
|
|
5630
|
-
/**
|
|
5631
|
-
* @license
|
|
5632
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5633
|
-
*
|
|
5634
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5635
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5636
|
-
*/
|
|
5637
|
-
// Set of origins that are always excluded from the preconnect checks.
|
|
5638
|
-
const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
|
|
5639
|
-
/**
|
|
5640
|
-
* Multi-provider injection token to configure which origins should be excluded
|
|
5641
|
-
* from the preconnect checks. It can either be a single string or an array of strings
|
|
5642
|
-
* to represent a group of origins, for example:
|
|
5643
|
-
*
|
|
5644
|
-
* ```typescript
|
|
5645
|
-
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true, useValue: 'https://your-domain.com'}
|
|
5646
|
-
* ```
|
|
5647
|
-
*
|
|
5648
|
-
* or:
|
|
5649
|
-
*
|
|
5650
|
-
* ```typescript
|
|
5651
|
-
* {provide: PRECONNECT_CHECK_BLOCKLIST, multi: true,
|
|
5652
|
-
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
5653
|
-
* ```
|
|
5654
|
-
*
|
|
5655
|
-
* @publicApi
|
|
5656
|
-
* @developerPreview
|
|
5657
|
-
*/
|
|
5658
|
-
const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
|
|
5659
|
-
/**
|
|
5660
|
-
* Contains the logic to detect whether an image, marked with the "priority" attribute
|
|
5661
|
-
* has a corresponding `<link rel="preconnect">` tag in the `document.head`.
|
|
5662
|
-
*
|
|
5663
|
-
* Note: this is a dev-mode only class, which should not appear in prod bundles,
|
|
5664
|
-
* thus there is no `ngDevMode` use in the code.
|
|
5665
|
-
*/
|
|
5666
|
-
class PreconnectLinkChecker {
|
|
5667
|
-
constructor() {
|
|
5668
|
-
this.document = inject(DOCUMENT);
|
|
5669
|
-
/**
|
|
5670
|
-
* Set of <link rel="preconnect"> tags found on this page.
|
|
5671
|
-
* The `null` value indicates that there was no DOM query operation performed.
|
|
5672
|
-
*/
|
|
5673
|
-
this.preconnectLinks = null;
|
|
5674
|
-
/*
|
|
5675
|
-
* Keep track of all already seen origin URLs to avoid repeating the same check.
|
|
5676
|
-
*/
|
|
5677
|
-
this.alreadySeen = new Set();
|
|
5678
|
-
this.window = null;
|
|
5679
|
-
this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
5680
|
-
assertDevMode('preconnect link checker');
|
|
5681
|
-
const win = this.document.defaultView;
|
|
5682
|
-
if (typeof win !== 'undefined') {
|
|
5683
|
-
this.window = win;
|
|
5684
|
-
}
|
|
5685
|
-
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, { optional: true });
|
|
5686
|
-
if (blocklist) {
|
|
5687
|
-
this.populateBlocklist(blocklist);
|
|
5688
|
-
}
|
|
5689
|
-
}
|
|
5690
|
-
populateBlocklist(origins) {
|
|
5691
|
-
if (Array.isArray(origins)) {
|
|
5692
|
-
deepForEach(origins, origin => {
|
|
5693
|
-
this.blocklist.add(extractHostname(origin));
|
|
5694
|
-
});
|
|
5695
|
-
}
|
|
5696
|
-
else {
|
|
5697
|
-
throw new ɵRuntimeError(2957 /* RuntimeErrorCode.INVALID_PRECONNECT_CHECK_BLOCKLIST */, `The blocklist for the preconnect check was not provided as an array. ` +
|
|
5698
|
-
`Check that the \`PRECONNECT_CHECK_BLOCKLIST\` token is configured as a \`multi: true\` provider.`);
|
|
5699
|
-
}
|
|
5700
|
-
}
|
|
5701
|
-
/**
|
|
5702
|
-
* Checks that a preconnect resource hint exists in the head fo rthe
|
|
5703
|
-
* given src.
|
|
5704
|
-
*
|
|
5705
|
-
* @param rewrittenSrc src formatted with loader
|
|
5706
|
-
* @param originalNgSrc ngSrc value
|
|
5707
|
-
*/
|
|
5708
|
-
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
5709
|
-
if (!this.window)
|
|
5710
|
-
return;
|
|
5711
|
-
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
5712
|
-
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
5713
|
-
return;
|
|
5714
|
-
// Register this origin as seen, so we don't check it again later.
|
|
5715
|
-
this.alreadySeen.add(imgUrl.origin);
|
|
5716
|
-
if (!this.preconnectLinks) {
|
|
5717
|
-
// Note: we query for preconnect links only *once* and cache the results
|
|
5718
|
-
// for the entire lifespan of an application, since it's unlikely that the
|
|
5719
|
-
// list would change frequently. This allows to make sure there are no
|
|
5720
|
-
// performance implications of making extra DOM lookups for each image.
|
|
5721
|
-
this.preconnectLinks = this.queryPreconnectLinks();
|
|
5722
|
-
}
|
|
5723
|
-
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
5724
|
-
console.warn(ɵformatRuntimeError(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +
|
|
5725
|
-
`image. Preconnecting to the origin(s) that serve priority images ensures that these ` +
|
|
5726
|
-
`images are delivered as soon as possible. To fix this, please add the following ` +
|
|
5727
|
-
`element into the <head> of the document:\n` +
|
|
5728
|
-
` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
5729
|
-
}
|
|
5730
|
-
}
|
|
5731
|
-
queryPreconnectLinks() {
|
|
5732
|
-
const preconnectUrls = new Set();
|
|
5733
|
-
const selector = 'link[rel=preconnect]';
|
|
5734
|
-
const links = Array.from(this.document.querySelectorAll(selector));
|
|
5735
|
-
for (let link of links) {
|
|
5736
|
-
const url = getUrl(link.href, this.window);
|
|
5737
|
-
preconnectUrls.add(url.origin);
|
|
5738
|
-
}
|
|
5739
|
-
return preconnectUrls;
|
|
5740
|
-
}
|
|
5741
|
-
ngOnDestroy() {
|
|
5742
|
-
var _a;
|
|
5743
|
-
(_a = this.preconnectLinks) === null || _a === void 0 ? void 0 : _a.clear();
|
|
5744
|
-
this.alreadySeen.clear();
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
PreconnectLinkChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5748
|
-
PreconnectLinkChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
5749
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
5750
|
-
type: Injectable,
|
|
5751
|
-
args: [{ providedIn: 'root' }]
|
|
5752
|
-
}], ctorParameters: function () { return []; } });
|
|
5753
|
-
/**
|
|
5754
|
-
* Invokes a callback for each element in the array. Also invokes a callback
|
|
5755
|
-
* recursively for each nested array.
|
|
5756
|
-
*/
|
|
5757
|
-
function deepForEach(input, fn) {
|
|
5758
|
-
for (let value of input) {
|
|
5759
|
-
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
5760
|
-
}
|
|
5761
|
-
}
|
|
5762
|
-
|
|
5763
5653
|
/**
|
|
5764
5654
|
* @license
|
|
5765
5655
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5797,7 +5687,7 @@ const IMAGE_LOADER = new InjectionToken('ImageLoader', {
|
|
|
5797
5687
|
* @returns a set of DI providers corresponding to the configured image loader
|
|
5798
5688
|
*/
|
|
5799
5689
|
function createImageLoader(buildUrlFn, exampleUrls) {
|
|
5800
|
-
return function provideImageLoader(path
|
|
5690
|
+
return function provideImageLoader(path) {
|
|
5801
5691
|
if (!isValidPath(path)) {
|
|
5802
5692
|
throwInvalidPathError(path, exampleUrls || []);
|
|
5803
5693
|
}
|
|
@@ -5816,9 +5706,6 @@ function createImageLoader(buildUrlFn, exampleUrls) {
|
|
|
5816
5706
|
return buildUrlFn(path, Object.assign(Object.assign({}, config), { src: normalizeSrc(config.src) }));
|
|
5817
5707
|
};
|
|
5818
5708
|
const providers = [{ provide: IMAGE_LOADER, useValue: loaderFn }];
|
|
5819
|
-
if (ngDevMode && options.ensurePreconnect === false) {
|
|
5820
|
-
providers.push({ provide: PRECONNECT_CHECK_BLOCKLIST, useValue: [path], multi: true });
|
|
5821
|
-
}
|
|
5822
5709
|
return providers;
|
|
5823
5710
|
};
|
|
5824
5711
|
}
|
|
@@ -5850,10 +5737,6 @@ function throwUnexpectedAbsoluteUrlError(path, url) {
|
|
|
5850
5737
|
* Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
|
|
5851
5738
|
*
|
|
5852
5739
|
* @param path Your domain name, e.g. https://mysite.com
|
|
5853
|
-
* @param options An object with extra configuration:
|
|
5854
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5855
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5856
|
-
* present in the document's `<head>`.
|
|
5857
5740
|
* @returns Provider that provides an ImageLoader function
|
|
5858
5741
|
*
|
|
5859
5742
|
* @publicApi
|
|
@@ -5885,10 +5768,6 @@ function createCloudflareUrl(path, config) {
|
|
|
5885
5768
|
* https://res.cloudinary.com/mysite
|
|
5886
5769
|
* https://mysite.cloudinary.com
|
|
5887
5770
|
* https://subdomain.mysite.com
|
|
5888
|
-
* @param options An object with extra configuration:
|
|
5889
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5890
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5891
|
-
* present in the document's `<head>`.
|
|
5892
5771
|
* @returns Set of providers to configure the Cloudinary loader.
|
|
5893
5772
|
*
|
|
5894
5773
|
* @publicApi
|
|
@@ -5926,10 +5805,6 @@ function createCloudinaryUrl(path, config) {
|
|
|
5926
5805
|
* This URL should match one of the following formats:
|
|
5927
5806
|
* https://ik.imagekit.io/myaccount
|
|
5928
5807
|
* https://subdomain.mysite.com
|
|
5929
|
-
* @param options An object with extra configuration:
|
|
5930
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5931
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5932
|
-
* present in the document's `<head>`.
|
|
5933
5808
|
* @returns Set of providers to configure the ImageKit loader.
|
|
5934
5809
|
*
|
|
5935
5810
|
* @publicApi
|
|
@@ -5958,10 +5833,6 @@ function createImagekitUrl(path, config) {
|
|
|
5958
5833
|
*
|
|
5959
5834
|
* @param path path to the desired Imgix origin,
|
|
5960
5835
|
* e.g. https://somepath.imgix.net or https://images.mysite.com
|
|
5961
|
-
* @param options An object with extra configuration:
|
|
5962
|
-
* - `ensurePreconnect`: boolean flag indicating whether the NgOptimizedImage directive
|
|
5963
|
-
* should verify that there is a corresponding `<link rel="preconnect">`
|
|
5964
|
-
* present in the document's `<head>`.
|
|
5965
5836
|
* @returns Set of providers to configure the Imgix loader.
|
|
5966
5837
|
*
|
|
5967
5838
|
* @publicApi
|
|
@@ -5978,6 +5849,38 @@ function createImgixUrl(path, config) {
|
|
|
5978
5849
|
return url.href;
|
|
5979
5850
|
}
|
|
5980
5851
|
|
|
5852
|
+
/**
|
|
5853
|
+
* @license
|
|
5854
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5855
|
+
*
|
|
5856
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5857
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5858
|
+
*/
|
|
5859
|
+
// Assembles directive details string, useful for error messages.
|
|
5860
|
+
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
5861
|
+
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : '';
|
|
5862
|
+
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
/**
|
|
5866
|
+
* @license
|
|
5867
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5868
|
+
*
|
|
5869
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5870
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5871
|
+
*/
|
|
5872
|
+
/**
|
|
5873
|
+
* Asserts that the application is in development mode. Throws an error if the application is in
|
|
5874
|
+
* production mode. This assert can be used to make sure that there is no dev-mode code invoked in
|
|
5875
|
+
* the prod mode accidentally.
|
|
5876
|
+
*/
|
|
5877
|
+
function assertDevMode(checkName) {
|
|
5878
|
+
if (!ngDevMode) {
|
|
5879
|
+
throw new ɵRuntimeError(2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` +
|
|
5880
|
+
`Please make sure that the prod mode is enabled for production builds.`);
|
|
5881
|
+
}
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5981
5884
|
/**
|
|
5982
5885
|
* @license
|
|
5983
5886
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6058,9 +5961,9 @@ class LCPImageObserver {
|
|
|
6058
5961
|
this.alreadyWarned.clear();
|
|
6059
5962
|
}
|
|
6060
5963
|
}
|
|
6061
|
-
LCPImageObserver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6062
|
-
LCPImageObserver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6063
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5964
|
+
LCPImageObserver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LCPImageObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5965
|
+
LCPImageObserver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LCPImageObserver, providedIn: 'root' });
|
|
5966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: LCPImageObserver, decorators: [{
|
|
6064
5967
|
type: Injectable,
|
|
6065
5968
|
args: [{ providedIn: 'root' }]
|
|
6066
5969
|
}], ctorParameters: function () { return []; } });
|
|
@@ -6072,6 +5975,231 @@ function logMissingPriorityWarning(ngSrc) {
|
|
|
6072
5975
|
`To fix this, add the "priority" attribute.`));
|
|
6073
5976
|
}
|
|
6074
5977
|
|
|
5978
|
+
/**
|
|
5979
|
+
* @license
|
|
5980
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5981
|
+
*
|
|
5982
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5983
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5984
|
+
*/
|
|
5985
|
+
// Set of origins that are always excluded from the preconnect checks.
|
|
5986
|
+
const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
|
|
5987
|
+
/**
|
|
5988
|
+
* Injection token to configure which origins should be excluded
|
|
5989
|
+
* from the preconnect checks. It can either be a single string or an array of strings
|
|
5990
|
+
* to represent a group of origins, for example:
|
|
5991
|
+
*
|
|
5992
|
+
* ```typescript
|
|
5993
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}
|
|
5994
|
+
* ```
|
|
5995
|
+
*
|
|
5996
|
+
* or:
|
|
5997
|
+
*
|
|
5998
|
+
* ```typescript
|
|
5999
|
+
* {provide: PRECONNECT_CHECK_BLOCKLIST,
|
|
6000
|
+
* useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
|
|
6001
|
+
* ```
|
|
6002
|
+
*
|
|
6003
|
+
* @publicApi
|
|
6004
|
+
* @developerPreview
|
|
6005
|
+
*/
|
|
6006
|
+
const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
|
|
6007
|
+
/**
|
|
6008
|
+
* Contains the logic to detect whether an image, marked with the "priority" attribute
|
|
6009
|
+
* has a corresponding `<link rel="preconnect">` tag in the `document.head`.
|
|
6010
|
+
*
|
|
6011
|
+
* Note: this is a dev-mode only class, which should not appear in prod bundles,
|
|
6012
|
+
* thus there is no `ngDevMode` use in the code.
|
|
6013
|
+
*/
|
|
6014
|
+
class PreconnectLinkChecker {
|
|
6015
|
+
constructor() {
|
|
6016
|
+
this.document = inject(DOCUMENT);
|
|
6017
|
+
/**
|
|
6018
|
+
* Set of <link rel="preconnect"> tags found on this page.
|
|
6019
|
+
* The `null` value indicates that there was no DOM query operation performed.
|
|
6020
|
+
*/
|
|
6021
|
+
this.preconnectLinks = null;
|
|
6022
|
+
/*
|
|
6023
|
+
* Keep track of all already seen origin URLs to avoid repeating the same check.
|
|
6024
|
+
*/
|
|
6025
|
+
this.alreadySeen = new Set();
|
|
6026
|
+
this.window = null;
|
|
6027
|
+
this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
6028
|
+
assertDevMode('preconnect link checker');
|
|
6029
|
+
const win = this.document.defaultView;
|
|
6030
|
+
if (typeof win !== 'undefined') {
|
|
6031
|
+
this.window = win;
|
|
6032
|
+
}
|
|
6033
|
+
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, { optional: true });
|
|
6034
|
+
if (blocklist) {
|
|
6035
|
+
this.populateBlocklist(blocklist);
|
|
6036
|
+
}
|
|
6037
|
+
}
|
|
6038
|
+
populateBlocklist(origins) {
|
|
6039
|
+
if (Array.isArray(origins)) {
|
|
6040
|
+
deepForEach(origins, origin => {
|
|
6041
|
+
this.blocklist.add(extractHostname(origin));
|
|
6042
|
+
});
|
|
6043
|
+
}
|
|
6044
|
+
else {
|
|
6045
|
+
this.blocklist.add(extractHostname(origins));
|
|
6046
|
+
}
|
|
6047
|
+
}
|
|
6048
|
+
/**
|
|
6049
|
+
* Checks that a preconnect resource hint exists in the head fo rthe
|
|
6050
|
+
* given src.
|
|
6051
|
+
*
|
|
6052
|
+
* @param rewrittenSrc src formatted with loader
|
|
6053
|
+
* @param originalNgSrc ngSrc value
|
|
6054
|
+
*/
|
|
6055
|
+
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
6056
|
+
if (!this.window)
|
|
6057
|
+
return;
|
|
6058
|
+
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
6059
|
+
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
6060
|
+
return;
|
|
6061
|
+
// Register this origin as seen, so we don't check it again later.
|
|
6062
|
+
this.alreadySeen.add(imgUrl.origin);
|
|
6063
|
+
if (!this.preconnectLinks) {
|
|
6064
|
+
// Note: we query for preconnect links only *once* and cache the results
|
|
6065
|
+
// for the entire lifespan of an application, since it's unlikely that the
|
|
6066
|
+
// list would change frequently. This allows to make sure there are no
|
|
6067
|
+
// performance implications of making extra DOM lookups for each image.
|
|
6068
|
+
this.preconnectLinks = this.queryPreconnectLinks();
|
|
6069
|
+
}
|
|
6070
|
+
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
6071
|
+
console.warn(ɵformatRuntimeError(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +
|
|
6072
|
+
`image. Preconnecting to the origin(s) that serve priority images ensures that these ` +
|
|
6073
|
+
`images are delivered as soon as possible. To fix this, please add the following ` +
|
|
6074
|
+
`element into the <head> of the document:\n` +
|
|
6075
|
+
` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
queryPreconnectLinks() {
|
|
6079
|
+
const preconnectUrls = new Set();
|
|
6080
|
+
const selector = 'link[rel=preconnect]';
|
|
6081
|
+
const links = Array.from(this.document.querySelectorAll(selector));
|
|
6082
|
+
for (let link of links) {
|
|
6083
|
+
const url = getUrl(link.href, this.window);
|
|
6084
|
+
preconnectUrls.add(url.origin);
|
|
6085
|
+
}
|
|
6086
|
+
return preconnectUrls;
|
|
6087
|
+
}
|
|
6088
|
+
ngOnDestroy() {
|
|
6089
|
+
var _a;
|
|
6090
|
+
(_a = this.preconnectLinks) === null || _a === void 0 ? void 0 : _a.clear();
|
|
6091
|
+
this.alreadySeen.clear();
|
|
6092
|
+
}
|
|
6093
|
+
}
|
|
6094
|
+
PreconnectLinkChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreconnectLinkChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6095
|
+
PreconnectLinkChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreconnectLinkChecker, providedIn: 'root' });
|
|
6096
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreconnectLinkChecker, decorators: [{
|
|
6097
|
+
type: Injectable,
|
|
6098
|
+
args: [{ providedIn: 'root' }]
|
|
6099
|
+
}], ctorParameters: function () { return []; } });
|
|
6100
|
+
/**
|
|
6101
|
+
* Invokes a callback for each element in the array. Also invokes a callback
|
|
6102
|
+
* recursively for each nested array.
|
|
6103
|
+
*/
|
|
6104
|
+
function deepForEach(input, fn) {
|
|
6105
|
+
for (let value of input) {
|
|
6106
|
+
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
6107
|
+
}
|
|
6108
|
+
}
|
|
6109
|
+
|
|
6110
|
+
/**
|
|
6111
|
+
* @license
|
|
6112
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6113
|
+
*
|
|
6114
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6115
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6116
|
+
*/
|
|
6117
|
+
/**
|
|
6118
|
+
* In SSR scenarios, a preload `<link>` element is generated for priority images.
|
|
6119
|
+
* Having a large number of preload tags may negatively affect the performance,
|
|
6120
|
+
* so we warn developers (by throwing an error) if the number of preloaded images
|
|
6121
|
+
* is above a certain threshold. This const specifies this threshold.
|
|
6122
|
+
*/
|
|
6123
|
+
const DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
|
|
6124
|
+
/**
|
|
6125
|
+
* Helps to keep track of priority images that already have a corresponding
|
|
6126
|
+
* preload tag (to avoid generating multiple preload tags with the same URL).
|
|
6127
|
+
*
|
|
6128
|
+
* This Set tracks the original src passed into the `ngSrc` input not the src after it has been
|
|
6129
|
+
* run through the specified `IMAGE_LOADER`.
|
|
6130
|
+
*/
|
|
6131
|
+
const PRELOADED_IMAGES = new InjectionToken('NG_OPTIMIZED_PRELOADED_IMAGES', { providedIn: 'root', factory: () => new Set() });
|
|
6132
|
+
|
|
6133
|
+
/**
|
|
6134
|
+
* @license
|
|
6135
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6136
|
+
*
|
|
6137
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6138
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6139
|
+
*/
|
|
6140
|
+
/**
|
|
6141
|
+
* @description Contains the logic needed to track and add preload link tags to the `<head>` tag. It
|
|
6142
|
+
* will also track what images have already had preload link tags added so as to not duplicate link
|
|
6143
|
+
* tags.
|
|
6144
|
+
*
|
|
6145
|
+
* In dev mode this service will validate that the number of preloaded images does not exceed the
|
|
6146
|
+
* configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.
|
|
6147
|
+
*/
|
|
6148
|
+
class PreloadLinkCreator {
|
|
6149
|
+
constructor() {
|
|
6150
|
+
this.preloadedImages = inject(PRELOADED_IMAGES);
|
|
6151
|
+
this.document = inject(DOCUMENT);
|
|
6152
|
+
}
|
|
6153
|
+
/**
|
|
6154
|
+
* @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the
|
|
6155
|
+
* server while using Angular Universal and SSR to kick off image loads for high priority images.
|
|
6156
|
+
*
|
|
6157
|
+
* The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
|
|
6158
|
+
* properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
|
|
6159
|
+
* respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from
|
|
6160
|
+
* the CDN.
|
|
6161
|
+
*
|
|
6162
|
+
* {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
|
|
6163
|
+
*
|
|
6164
|
+
* @param renderer The `Renderer2` passed in from the directive
|
|
6165
|
+
* @param src The original src of the image that is set on the `ngSrc` input.
|
|
6166
|
+
* @param srcset The parsed and formatted srcset created from the `ngSrcset` input
|
|
6167
|
+
* @param sizes The value of the `sizes` attribute passed in to the `<img>` tag
|
|
6168
|
+
*/
|
|
6169
|
+
createPreloadLinkTag(renderer, src, srcset, sizes) {
|
|
6170
|
+
if (ngDevMode) {
|
|
6171
|
+
if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
|
|
6172
|
+
throw new ɵRuntimeError(2961 /* RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES */, ngDevMode &&
|
|
6173
|
+
`The \`NgOptimizedImage\` directive has detected that more than ` +
|
|
6174
|
+
`${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` +
|
|
6175
|
+
`This might negatively affect an overall performance of the page. ` +
|
|
6176
|
+
`To fix this, remove the "priority" attribute from images with less priority.`);
|
|
6177
|
+
}
|
|
6178
|
+
}
|
|
6179
|
+
if (this.preloadedImages.has(src)) {
|
|
6180
|
+
return;
|
|
6181
|
+
}
|
|
6182
|
+
this.preloadedImages.add(src);
|
|
6183
|
+
const preload = renderer.createElement('link');
|
|
6184
|
+
renderer.setAttribute(preload, 'as', 'image');
|
|
6185
|
+
renderer.setAttribute(preload, 'href', src);
|
|
6186
|
+
renderer.setAttribute(preload, 'rel', 'preload');
|
|
6187
|
+
if (sizes) {
|
|
6188
|
+
renderer.setAttribute(preload, 'imageSizes', sizes);
|
|
6189
|
+
}
|
|
6190
|
+
if (srcset) {
|
|
6191
|
+
renderer.setAttribute(preload, 'imageSrcset', srcset);
|
|
6192
|
+
}
|
|
6193
|
+
renderer.appendChild(this.document.head, preload);
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6196
|
+
PreloadLinkCreator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadLinkCreator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6197
|
+
PreloadLinkCreator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadLinkCreator, providedIn: 'root' });
|
|
6198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadLinkCreator, decorators: [{
|
|
6199
|
+
type: Injectable,
|
|
6200
|
+
args: [{ providedIn: 'root' }]
|
|
6201
|
+
}] });
|
|
6202
|
+
|
|
6075
6203
|
/**
|
|
6076
6204
|
* @license
|
|
6077
6205
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6108,6 +6236,14 @@ const ABSOLUTE_SRCSET_DENSITY_CAP = 3;
|
|
|
6108
6236
|
* only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.
|
|
6109
6237
|
*/
|
|
6110
6238
|
const RECOMMENDED_SRCSET_DENSITY_CAP = 2;
|
|
6239
|
+
/**
|
|
6240
|
+
* Used in generating automatic density-based srcsets
|
|
6241
|
+
*/
|
|
6242
|
+
const DENSITY_SRCSET_MULTIPLIERS = [1, 2];
|
|
6243
|
+
/**
|
|
6244
|
+
* Used to determine which breakpoints to use on full-width images
|
|
6245
|
+
*/
|
|
6246
|
+
const VIEWPORT_BREAKPOINT_CUTOFF = 640;
|
|
6111
6247
|
/**
|
|
6112
6248
|
* Used to determine whether two aspect ratios are similar in value.
|
|
6113
6249
|
*/
|
|
@@ -6118,6 +6254,17 @@ const ASPECT_RATIO_TOLERANCE = .1;
|
|
|
6118
6254
|
* into account a typical device pixel ratio). In pixels.
|
|
6119
6255
|
*/
|
|
6120
6256
|
const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
6257
|
+
const defaultConfig = {
|
|
6258
|
+
breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
6259
|
+
};
|
|
6260
|
+
/**
|
|
6261
|
+
* Injection token that configures the image optimized image functionality.
|
|
6262
|
+
*
|
|
6263
|
+
* @see `NgOptimizedImage`
|
|
6264
|
+
* @publicApi
|
|
6265
|
+
* @developerPreview
|
|
6266
|
+
*/
|
|
6267
|
+
const IMAGE_CONFIG = new InjectionToken('ImageConfig', { providedIn: 'root', factory: () => defaultConfig });
|
|
6121
6268
|
/**
|
|
6122
6269
|
* Directive that improves image loading performance by enforcing best practices.
|
|
6123
6270
|
*
|
|
@@ -6129,6 +6276,7 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
|
6129
6276
|
*
|
|
6130
6277
|
* In addition, the directive:
|
|
6131
6278
|
* - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
|
|
6279
|
+
* - Automatically generates a srcset
|
|
6132
6280
|
* - Requires that `width` and `height` are set
|
|
6133
6281
|
* - Warns if `width` or `height` have been set incorrectly
|
|
6134
6282
|
* - Warns if the image will be visually distorted when rendered
|
|
@@ -6219,9 +6367,12 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
|
6219
6367
|
class NgOptimizedImage {
|
|
6220
6368
|
constructor() {
|
|
6221
6369
|
this.imageLoader = inject(IMAGE_LOADER);
|
|
6370
|
+
this.config = processConfig(inject(IMAGE_CONFIG));
|
|
6222
6371
|
this.renderer = inject(Renderer2);
|
|
6223
6372
|
this.imgElement = inject(ElementRef).nativeElement;
|
|
6224
6373
|
this.injector = inject(Injector);
|
|
6374
|
+
this.isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
6375
|
+
this.preloadLinkChecker = inject(PreloadLinkCreator);
|
|
6225
6376
|
// a LCP image observer - should be injected only in the dev mode
|
|
6226
6377
|
this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null;
|
|
6227
6378
|
/**
|
|
@@ -6232,6 +6383,8 @@ class NgOptimizedImage {
|
|
|
6232
6383
|
*/
|
|
6233
6384
|
this._renderedSrc = null;
|
|
6234
6385
|
this._priority = false;
|
|
6386
|
+
this._disableOptimizedSrcset = false;
|
|
6387
|
+
this._fill = false;
|
|
6235
6388
|
}
|
|
6236
6389
|
/**
|
|
6237
6390
|
* Previously, the `rawSrc` attribute was used to activate the directive.
|
|
@@ -6281,17 +6434,46 @@ class NgOptimizedImage {
|
|
|
6281
6434
|
get priority() {
|
|
6282
6435
|
return this._priority;
|
|
6283
6436
|
}
|
|
6437
|
+
/**
|
|
6438
|
+
* Disables automatic srcset generation for this image.
|
|
6439
|
+
*/
|
|
6440
|
+
set disableOptimizedSrcset(value) {
|
|
6441
|
+
this._disableOptimizedSrcset = inputToBoolean(value);
|
|
6442
|
+
}
|
|
6443
|
+
get disableOptimizedSrcset() {
|
|
6444
|
+
return this._disableOptimizedSrcset;
|
|
6445
|
+
}
|
|
6446
|
+
/**
|
|
6447
|
+
* Sets the image to "fill mode," which eliminates the height/width requirement and adds
|
|
6448
|
+
* styles such that the image fills its containing element.
|
|
6449
|
+
*/
|
|
6450
|
+
set fill(value) {
|
|
6451
|
+
this._fill = inputToBoolean(value);
|
|
6452
|
+
}
|
|
6453
|
+
get fill() {
|
|
6454
|
+
return this._fill;
|
|
6455
|
+
}
|
|
6284
6456
|
ngOnInit() {
|
|
6285
6457
|
if (ngDevMode) {
|
|
6286
6458
|
assertNonEmptyInput(this, 'ngSrc', this.ngSrc);
|
|
6287
6459
|
assertValidNgSrcset(this, this.ngSrcset);
|
|
6288
6460
|
assertNoConflictingSrc(this);
|
|
6289
|
-
|
|
6461
|
+
if (this.ngSrcset) {
|
|
6462
|
+
assertNoConflictingSrcset(this);
|
|
6463
|
+
}
|
|
6290
6464
|
assertNotBase64Image(this);
|
|
6291
6465
|
assertNotBlobUrl(this);
|
|
6292
|
-
|
|
6466
|
+
if (this.fill) {
|
|
6467
|
+
assertEmptyWidthAndHeight(this);
|
|
6468
|
+
}
|
|
6469
|
+
else {
|
|
6470
|
+
assertNonEmptyWidthAndHeight(this);
|
|
6471
|
+
}
|
|
6293
6472
|
assertValidLoadingInput(this);
|
|
6294
6473
|
assertNoImageDistortion(this, this.imgElement, this.renderer);
|
|
6474
|
+
if (!this.ngSrcset) {
|
|
6475
|
+
assertNoComplexSizes(this);
|
|
6476
|
+
}
|
|
6295
6477
|
if (this.priority) {
|
|
6296
6478
|
const checker = this.injector.get(PreconnectLinkChecker);
|
|
6297
6479
|
checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
|
|
@@ -6313,15 +6495,36 @@ class NgOptimizedImage {
|
|
|
6313
6495
|
setHostAttributes() {
|
|
6314
6496
|
// Must set width/height explicitly in case they are bound (in which case they will
|
|
6315
6497
|
// only be reflected and not found by the browser)
|
|
6316
|
-
|
|
6317
|
-
|
|
6498
|
+
if (this.fill) {
|
|
6499
|
+
if (!this.sizes) {
|
|
6500
|
+
this.sizes = '100vw';
|
|
6501
|
+
}
|
|
6502
|
+
}
|
|
6503
|
+
else {
|
|
6504
|
+
this.setHostAttribute('width', this.width.toString());
|
|
6505
|
+
this.setHostAttribute('height', this.height.toString());
|
|
6506
|
+
}
|
|
6318
6507
|
this.setHostAttribute('loading', this.getLoadingBehavior());
|
|
6319
6508
|
this.setHostAttribute('fetchpriority', this.getFetchPriority());
|
|
6320
6509
|
// The `src` and `srcset` attributes should be set last since other attributes
|
|
6321
6510
|
// could affect the image's loading behavior.
|
|
6322
|
-
|
|
6511
|
+
const rewrittenSrc = this.getRewrittenSrc();
|
|
6512
|
+
this.setHostAttribute('src', rewrittenSrc);
|
|
6513
|
+
let rewrittenSrcset = undefined;
|
|
6514
|
+
if (this.sizes) {
|
|
6515
|
+
this.setHostAttribute('sizes', this.sizes);
|
|
6516
|
+
}
|
|
6323
6517
|
if (this.ngSrcset) {
|
|
6324
|
-
|
|
6518
|
+
rewrittenSrcset = this.getRewrittenSrcset();
|
|
6519
|
+
}
|
|
6520
|
+
else if (!this._disableOptimizedSrcset && !this.srcset) {
|
|
6521
|
+
rewrittenSrcset = this.getAutomaticSrcset();
|
|
6522
|
+
}
|
|
6523
|
+
if (rewrittenSrcset) {
|
|
6524
|
+
this.setHostAttribute('srcset', rewrittenSrcset);
|
|
6525
|
+
}
|
|
6526
|
+
if (this.isServer && this.priority) {
|
|
6527
|
+
this.preloadLinkChecker.createPreloadLinkTag(this.renderer, rewrittenSrc, rewrittenSrcset, this.sizes);
|
|
6325
6528
|
}
|
|
6326
6529
|
}
|
|
6327
6530
|
ngOnChanges(changes) {
|
|
@@ -6358,6 +6561,30 @@ class NgOptimizedImage {
|
|
|
6358
6561
|
});
|
|
6359
6562
|
return finalSrcs.join(', ');
|
|
6360
6563
|
}
|
|
6564
|
+
getAutomaticSrcset() {
|
|
6565
|
+
if (this.sizes) {
|
|
6566
|
+
return this.getResponsiveSrcset();
|
|
6567
|
+
}
|
|
6568
|
+
else {
|
|
6569
|
+
return this.getFixedSrcset();
|
|
6570
|
+
}
|
|
6571
|
+
}
|
|
6572
|
+
getResponsiveSrcset() {
|
|
6573
|
+
var _a;
|
|
6574
|
+
const { breakpoints } = this.config;
|
|
6575
|
+
let filteredBreakpoints = breakpoints;
|
|
6576
|
+
if (((_a = this.sizes) === null || _a === void 0 ? void 0 : _a.trim()) === '100vw') {
|
|
6577
|
+
// Since this is a full-screen-width image, our srcset only needs to include
|
|
6578
|
+
// breakpoints with full viewport widths.
|
|
6579
|
+
filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
|
|
6580
|
+
}
|
|
6581
|
+
const finalSrcs = filteredBreakpoints.map(bp => `${this.imageLoader({ src: this.ngSrc, width: bp })} ${bp}w`);
|
|
6582
|
+
return finalSrcs.join(', ');
|
|
6583
|
+
}
|
|
6584
|
+
getFixedSrcset() {
|
|
6585
|
+
const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => `${this.imageLoader({ src: this.ngSrc, width: this.width * multiplier })} ${multiplier}x`);
|
|
6586
|
+
return finalSrcs.join(', ');
|
|
6587
|
+
}
|
|
6361
6588
|
ngOnDestroy() {
|
|
6362
6589
|
if (ngDevMode) {
|
|
6363
6590
|
if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) {
|
|
@@ -6369,13 +6596,19 @@ class NgOptimizedImage {
|
|
|
6369
6596
|
this.renderer.setAttribute(this.imgElement, name, value);
|
|
6370
6597
|
}
|
|
6371
6598
|
}
|
|
6372
|
-
NgOptimizedImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6373
|
-
NgOptimizedImage.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
6374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6599
|
+
NgOptimizedImage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgOptimizedImage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6600
|
+
NgOptimizedImage.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: NgOptimizedImage, isStandalone: true, selector: "img[ngSrc],img[rawSrc]", inputs: { rawSrc: "rawSrc", ngSrc: "ngSrc", ngSrcset: "ngSrcset", sizes: "sizes", width: "width", height: "height", loading: "loading", priority: "priority", 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 });
|
|
6601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NgOptimizedImage, decorators: [{
|
|
6375
6602
|
type: Directive,
|
|
6376
6603
|
args: [{
|
|
6377
6604
|
standalone: true,
|
|
6378
6605
|
selector: 'img[ngSrc],img[rawSrc]',
|
|
6606
|
+
host: {
|
|
6607
|
+
'[style.position]': 'fill ? "absolute" : null',
|
|
6608
|
+
'[style.width]': 'fill ? "100%" : null',
|
|
6609
|
+
'[style.height]': 'fill ? "100%" : null',
|
|
6610
|
+
'[style.inset]': 'fill ? "0px" : null'
|
|
6611
|
+
}
|
|
6379
6612
|
}]
|
|
6380
6613
|
}], propDecorators: { rawSrc: [{
|
|
6381
6614
|
type: Input
|
|
@@ -6383,6 +6616,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
6383
6616
|
type: Input
|
|
6384
6617
|
}], ngSrcset: [{
|
|
6385
6618
|
type: Input
|
|
6619
|
+
}], sizes: [{
|
|
6620
|
+
type: Input
|
|
6386
6621
|
}], width: [{
|
|
6387
6622
|
type: Input
|
|
6388
6623
|
}], height: [{
|
|
@@ -6391,6 +6626,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
6391
6626
|
type: Input
|
|
6392
6627
|
}], priority: [{
|
|
6393
6628
|
type: Input
|
|
6629
|
+
}], disableOptimizedSrcset: [{
|
|
6630
|
+
type: Input
|
|
6631
|
+
}], fill: [{
|
|
6632
|
+
type: Input
|
|
6394
6633
|
}], src: [{
|
|
6395
6634
|
type: Input
|
|
6396
6635
|
}], srcset: [{
|
|
@@ -6409,6 +6648,16 @@ function inputToInteger(value) {
|
|
|
6409
6648
|
function inputToBoolean(value) {
|
|
6410
6649
|
return value != null && `${value}` !== 'false';
|
|
6411
6650
|
}
|
|
6651
|
+
/**
|
|
6652
|
+
* Sorts provided config breakpoints and uses defaults.
|
|
6653
|
+
*/
|
|
6654
|
+
function processConfig(config) {
|
|
6655
|
+
let sortedBreakpoints = {};
|
|
6656
|
+
if (config.breakpoints) {
|
|
6657
|
+
sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
|
|
6658
|
+
}
|
|
6659
|
+
return Object.assign({}, defaultConfig, config, sortedBreakpoints);
|
|
6660
|
+
}
|
|
6412
6661
|
/***** Assert functions *****/
|
|
6413
6662
|
/**
|
|
6414
6663
|
* Verifies that there is no `src` set on a host element.
|
|
@@ -6447,6 +6696,18 @@ function assertNotBase64Image(dir) {
|
|
|
6447
6696
|
`by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
|
|
6448
6697
|
}
|
|
6449
6698
|
}
|
|
6699
|
+
/**
|
|
6700
|
+
* Verifies that the 'sizes' only includes responsive values.
|
|
6701
|
+
*/
|
|
6702
|
+
function assertNoComplexSizes(dir) {
|
|
6703
|
+
let sizes = dir.sizes;
|
|
6704
|
+
if (sizes === null || sizes === void 0 ? void 0 : sizes.match(/((\)|,)\s|^)\d+px/)) {
|
|
6705
|
+
throw new ɵRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` +
|
|
6706
|
+
`pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` +
|
|
6707
|
+
`values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` +
|
|
6708
|
+
`To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6450
6711
|
/**
|
|
6451
6712
|
* Verifies that the `ngSrc` is not a Blob URL.
|
|
6452
6713
|
*/
|
|
@@ -6626,6 +6887,17 @@ function assertNonEmptyWidthAndHeight(dir) {
|
|
|
6626
6887
|
`To fix this, include "width" and "height" attributes on the image tag.`);
|
|
6627
6888
|
}
|
|
6628
6889
|
}
|
|
6890
|
+
/**
|
|
6891
|
+
* Verifies that width and height are not set. Used in fill mode, where those attributes don't make
|
|
6892
|
+
* sense.
|
|
6893
|
+
*/
|
|
6894
|
+
function assertEmptyWidthAndHeight(dir) {
|
|
6895
|
+
if (dir.width || dir.height) {
|
|
6896
|
+
throw new ɵRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` +
|
|
6897
|
+
`along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` +
|
|
6898
|
+
`element, the size attributes have no effect and should be removed.`);
|
|
6899
|
+
}
|
|
6900
|
+
}
|
|
6629
6901
|
/**
|
|
6630
6902
|
* Verifies that the `loading` attribute is set to a valid input &
|
|
6631
6903
|
* is not used on priority images.
|
|
@@ -6683,5 +6955,5 @@ function assertValidLoadingInput(dir) {
|
|
|
6683
6955
|
* Generated bundle index. Do not edit.
|
|
6684
6956
|
*/
|
|
6685
6957
|
|
|
6686
|
-
export { APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_TIMEZONE, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, IMAGE_LOADER, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgOptimizedImage, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PRECONNECT_CHECK_BLOCKLIST, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, XhrFactory, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, registerLocaleData, BrowserPlatformLocation as ɵBrowserPlatformLocation, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PLATFORM_WORKER_APP_ID as ɵPLATFORM_WORKER_APP_ID, PLATFORM_WORKER_UI_ID as ɵPLATFORM_WORKER_UI_ID, getDOM as ɵgetDOM, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
|
|
6958
|
+
export { APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, IMAGE_LOADER, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgOptimizedImage, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PRECONNECT_CHECK_BLOCKLIST, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, XhrFactory, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, registerLocaleData, BrowserPlatformLocation as ɵBrowserPlatformLocation, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PLATFORM_WORKER_APP_ID as ɵPLATFORM_WORKER_APP_ID, PLATFORM_WORKER_UI_ID as ɵPLATFORM_WORKER_UI_ID, getDOM as ɵgetDOM, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
|
|
6687
6959
|
//# sourceMappingURL=common.mjs.map
|