@angular/platform-browser 13.1.0-next.1 → 13.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animations/animations.d.ts +1 -1
- package/esm2020/animations/src/animation_builder.mjs +3 -3
- package/esm2020/animations/src/animation_renderer.mjs +6 -6
- package/esm2020/animations/src/module.mjs +8 -8
- package/esm2020/animations/src/providers.mjs +3 -3
- package/esm2020/src/browser/meta.mjs +3 -3
- package/esm2020/src/browser/title.mjs +3 -3
- package/esm2020/src/browser/transfer_state.mjs +7 -7
- package/esm2020/src/browser/xhr.mjs +3 -3
- package/esm2020/src/browser.mjs +6 -24
- package/esm2020/src/dom/debug/ng_probe.mjs +2 -24
- package/esm2020/src/dom/dom_renderer.mjs +3 -3
- package/esm2020/src/dom/events/dom_events.mjs +3 -3
- package/esm2020/src/dom/events/event_manager.mjs +3 -3
- package/esm2020/src/dom/events/hammer_gestures.mjs +30 -31
- package/esm2020/src/dom/events/key_events.mjs +3 -3
- package/esm2020/src/dom/shared_styles_host.mjs +6 -6
- package/esm2020/src/platform-browser.mjs +2 -4
- package/esm2020/src/private_export.mjs +2 -3
- package/esm2020/src/security/dom_sanitization_service.mjs +6 -6
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/browser.mjs +6 -8
- package/fesm2015/animations.mjs +20 -20
- package/fesm2015/animations.mjs.map +1 -1
- package/fesm2015/platform-browser.mjs +573 -641
- package/fesm2015/platform-browser.mjs.map +1 -1
- package/fesm2015/testing.mjs +6 -8
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/animations.mjs +20 -20
- package/fesm2020/animations.mjs.map +1 -1
- package/fesm2020/platform-browser.mjs +569 -637
- package/fesm2020/platform-browser.mjs.map +1 -1
- package/fesm2020/testing.mjs +6 -8
- package/fesm2020/testing.mjs.map +1 -1
- package/package.json +4 -4
- package/platform-browser.d.ts +1 -30
- package/testing/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular v13.1.
|
2
|
+
* @license Angular v13.1.1
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -7,7 +7,7 @@
|
|
7
7
|
import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, DOCUMENT, ɵPLATFORM_BROWSER_ID, XhrFactory, CommonModule } from '@angular/common';
|
8
8
|
export { ɵgetDOM } from '@angular/common';
|
9
9
|
import * as i0 from '@angular/core';
|
10
|
-
import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, ɵglobal, Injectable,
|
10
|
+
import { InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, ɵglobal, Injectable, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, ɵINJECTOR_SCOPE, NgZone, RendererFactory2, Testability, ApplicationModule, NgModule, Optional, SkipSelf, ɵɵinject, ApplicationRef, ɵConsole, forwardRef, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵgetSanitizationBypassType, ɵ_sanitizeUrl, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, Version } from '@angular/core';
|
11
11
|
|
12
12
|
/**
|
13
13
|
* @license
|
@@ -221,97 +221,12 @@ class BrowserXhr {
|
|
221
221
|
return new XMLHttpRequest();
|
222
222
|
}
|
223
223
|
}
|
224
|
-
BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
225
|
-
BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
224
|
+
BrowserXhr.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
225
|
+
BrowserXhr.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserXhr });
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserXhr, decorators: [{
|
227
227
|
type: Injectable
|
228
228
|
}] });
|
229
229
|
|
230
|
-
/**
|
231
|
-
* @license
|
232
|
-
* Copyright Google LLC All Rights Reserved.
|
233
|
-
*
|
234
|
-
* Use of this source code is governed by an MIT-style license that can be
|
235
|
-
* found in the LICENSE file at https://angular.io/license
|
236
|
-
*/
|
237
|
-
const CAMEL_CASE_REGEXP = /([A-Z])/g;
|
238
|
-
const DASH_CASE_REGEXP = /-([a-z])/g;
|
239
|
-
function camelCaseToDashCase(input) {
|
240
|
-
return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
|
241
|
-
}
|
242
|
-
function dashCaseToCamelCase(input) {
|
243
|
-
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
|
247
|
-
* `name` is `'probe'`.
|
248
|
-
* @param name Name under which it will be exported. Keep in mind this will be a property of the
|
249
|
-
* global `ng` object.
|
250
|
-
* @param value The value to export.
|
251
|
-
*/
|
252
|
-
function exportNgVar(name, value) {
|
253
|
-
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
254
|
-
// Note: we can't export `ng` when using closure enhanced optimization as:
|
255
|
-
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
256
|
-
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
257
|
-
// for typings for angularJS (via `goog.provide('ng....')`).
|
258
|
-
const ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
|
259
|
-
ng[name] = value;
|
260
|
-
}
|
261
|
-
}
|
262
|
-
|
263
|
-
/**
|
264
|
-
* @license
|
265
|
-
* Copyright Google LLC All Rights Reserved.
|
266
|
-
*
|
267
|
-
* Use of this source code is governed by an MIT-style license that can be
|
268
|
-
* found in the LICENSE file at https://angular.io/license
|
269
|
-
*/
|
270
|
-
const CORE_TOKENS = (() => ({
|
271
|
-
'ApplicationRef': ApplicationRef,
|
272
|
-
'NgZone': NgZone,
|
273
|
-
}))();
|
274
|
-
const INSPECT_GLOBAL_NAME = 'probe';
|
275
|
-
const CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
|
276
|
-
/**
|
277
|
-
* Returns a {@link DebugElement} for the given native DOM element, or
|
278
|
-
* null if the given native element does not have an Angular view associated
|
279
|
-
* with it.
|
280
|
-
*/
|
281
|
-
function inspectNativeElementR2(element) {
|
282
|
-
return ɵgetDebugNodeR2(element);
|
283
|
-
}
|
284
|
-
function _createNgProbeR2(coreTokens) {
|
285
|
-
exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2);
|
286
|
-
exportNgVar(CORE_TOKENS_GLOBAL_NAME, { ...CORE_TOKENS, ..._ngProbeTokensToMap(coreTokens || []) });
|
287
|
-
return () => inspectNativeElementR2;
|
288
|
-
}
|
289
|
-
function _ngProbeTokensToMap(tokens) {
|
290
|
-
return tokens.reduce((prev, t) => (prev[t.name] = t.token, prev), {});
|
291
|
-
}
|
292
|
-
/**
|
293
|
-
* In Ivy, we don't support NgProbe because we have our own set of testing utilities
|
294
|
-
* with more robust functionality.
|
295
|
-
*
|
296
|
-
* We shouldn't bring in NgProbe because it prevents DebugNode and friends from
|
297
|
-
* tree-shaking properly.
|
298
|
-
*/
|
299
|
-
const ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
|
300
|
-
/**
|
301
|
-
* Providers which support debugging Angular applications (e.g. via `ng.probe`).
|
302
|
-
*/
|
303
|
-
const ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
|
304
|
-
{
|
305
|
-
provide: APP_INITIALIZER,
|
306
|
-
useFactory: _createNgProbeR2,
|
307
|
-
deps: [
|
308
|
-
[NgProbeToken, new Optional()],
|
309
|
-
],
|
310
|
-
multi: true,
|
311
|
-
},
|
312
|
-
];
|
313
|
-
const ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__POST_R3__;
|
314
|
-
|
315
230
|
/**
|
316
231
|
* @license
|
317
232
|
* Copyright Google LLC All Rights Reserved.
|
@@ -391,9 +306,9 @@ class EventManager {
|
|
391
306
|
throw new Error(`No event manager plugin found for event ${eventName}`);
|
392
307
|
}
|
393
308
|
}
|
394
|
-
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
395
|
-
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
309
|
+
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
310
|
+
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EventManager });
|
311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EventManager, decorators: [{
|
397
312
|
type: Injectable
|
398
313
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
399
314
|
type: Inject,
|
@@ -439,9 +354,9 @@ class SharedStylesHost {
|
|
439
354
|
return Array.from(this._stylesSet);
|
440
355
|
}
|
441
356
|
}
|
442
|
-
SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
443
|
-
SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
357
|
+
SharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: SharedStylesHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
358
|
+
SharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: SharedStylesHost });
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: SharedStylesHost, decorators: [{
|
445
360
|
type: Injectable
|
446
361
|
}] });
|
447
362
|
class DomSharedStylesHost extends SharedStylesHost {
|
@@ -480,9 +395,9 @@ class DomSharedStylesHost extends SharedStylesHost {
|
|
480
395
|
this._hostNodes.forEach(styleNodes => styleNodes.forEach(removeStyle));
|
481
396
|
}
|
482
397
|
}
|
483
|
-
DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
484
|
-
DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
398
|
+
DomSharedStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSharedStylesHost, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
399
|
+
DomSharedStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSharedStylesHost });
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSharedStylesHost, decorators: [{
|
486
401
|
type: Injectable
|
487
402
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
488
403
|
type: Inject,
|
@@ -602,9 +517,9 @@ class DomRendererFactory2 {
|
|
602
517
|
begin() { }
|
603
518
|
end() { }
|
604
519
|
}
|
605
|
-
DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
606
|
-
DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
607
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
520
|
+
DomRendererFactory2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: DomSharedStylesHost }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
521
|
+
DomRendererFactory2.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomRendererFactory2 });
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomRendererFactory2, decorators: [{
|
608
523
|
type: Injectable
|
609
524
|
}], ctorParameters: function () { return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: undefined, decorators: [{
|
610
525
|
type: Inject,
|
@@ -820,9 +735,9 @@ class DomEventsPlugin extends EventManagerPlugin {
|
|
820
735
|
return target.removeEventListener(eventName, callback);
|
821
736
|
}
|
822
737
|
}
|
823
|
-
DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
824
|
-
DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
738
|
+
DomEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
739
|
+
DomEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomEventsPlugin });
|
740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomEventsPlugin, decorators: [{
|
826
741
|
type: Injectable
|
827
742
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
828
743
|
type: Inject,
|
@@ -837,348 +752,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1",
|
|
837
752
|
* found in the LICENSE file at https://angular.io/license
|
838
753
|
*/
|
839
754
|
/**
|
840
|
-
*
|
755
|
+
* Defines supported modifiers for key events.
|
841
756
|
*/
|
842
|
-
const
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
'
|
849
|
-
'
|
850
|
-
'
|
851
|
-
'
|
852
|
-
'
|
853
|
-
|
854
|
-
'
|
855
|
-
'
|
856
|
-
'
|
857
|
-
'
|
858
|
-
'
|
859
|
-
'
|
860
|
-
'
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
'
|
867
|
-
'
|
868
|
-
'
|
869
|
-
'
|
870
|
-
|
871
|
-
'
|
872
|
-
'
|
873
|
-
'
|
874
|
-
'
|
875
|
-
'
|
876
|
-
|
877
|
-
'
|
878
|
-
'
|
757
|
+
const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
|
758
|
+
const DOM_KEY_LOCATION_NUMPAD = 3;
|
759
|
+
// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
|
760
|
+
const _keyMap = {
|
761
|
+
// The following values are here for cross-browser compatibility and to match the W3C standard
|
762
|
+
// cf https://www.w3.org/TR/DOM-Level-3-Events-key/
|
763
|
+
'\b': 'Backspace',
|
764
|
+
'\t': 'Tab',
|
765
|
+
'\x7F': 'Delete',
|
766
|
+
'\x1B': 'Escape',
|
767
|
+
'Del': 'Delete',
|
768
|
+
'Esc': 'Escape',
|
769
|
+
'Left': 'ArrowLeft',
|
770
|
+
'Right': 'ArrowRight',
|
771
|
+
'Up': 'ArrowUp',
|
772
|
+
'Down': 'ArrowDown',
|
773
|
+
'Menu': 'ContextMenu',
|
774
|
+
'Scroll': 'ScrollLock',
|
775
|
+
'Win': 'OS'
|
776
|
+
};
|
777
|
+
// There is a bug in Chrome for numeric keypad keys:
|
778
|
+
// https://code.google.com/p/chromium/issues/detail?id=155654
|
779
|
+
// 1, 2, 3 ... are reported as A, B, C ...
|
780
|
+
const _chromeNumKeyPadMap = {
|
781
|
+
'A': '1',
|
782
|
+
'B': '2',
|
783
|
+
'C': '3',
|
784
|
+
'D': '4',
|
785
|
+
'E': '5',
|
786
|
+
'F': '6',
|
787
|
+
'G': '7',
|
788
|
+
'H': '8',
|
789
|
+
'I': '9',
|
790
|
+
'J': '*',
|
791
|
+
'K': '+',
|
792
|
+
'M': '-',
|
793
|
+
'N': '.',
|
794
|
+
'O': '/',
|
795
|
+
'\x60': '0',
|
796
|
+
'\x90': 'NumLock'
|
879
797
|
};
|
880
798
|
/**
|
881
|
-
*
|
882
|
-
* @see `HammerGestureConfig`
|
883
|
-
*
|
884
|
-
* @ngModule HammerModule
|
885
|
-
* @publicApi
|
886
|
-
*/
|
887
|
-
const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
|
888
|
-
/**
|
889
|
-
* Injection token used to provide a {@link HammerLoader} to Angular.
|
890
|
-
*
|
891
|
-
* @publicApi
|
799
|
+
* Retrieves modifiers from key-event objects.
|
892
800
|
*/
|
893
|
-
const
|
801
|
+
const MODIFIER_KEY_GETTERS = {
|
802
|
+
'alt': (event) => event.altKey,
|
803
|
+
'control': (event) => event.ctrlKey,
|
804
|
+
'meta': (event) => event.metaKey,
|
805
|
+
'shift': (event) => event.shiftKey
|
806
|
+
};
|
894
807
|
/**
|
895
|
-
* An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
|
896
|
-
* for gesture recognition. Configures specific event recognition.
|
897
808
|
* @publicApi
|
809
|
+
* A browser plug-in that provides support for handling of key events in Angular.
|
898
810
|
*/
|
899
|
-
class
|
900
|
-
constructor() {
|
901
|
-
/**
|
902
|
-
* A set of supported event names for gestures to be used in Angular.
|
903
|
-
* Angular supports all built-in recognizers, as listed in
|
904
|
-
* [HammerJS documentation](https://hammerjs.github.io/).
|
905
|
-
*/
|
906
|
-
this.events = [];
|
907
|
-
/**
|
908
|
-
* Maps gesture event names to a set of configuration options
|
909
|
-
* that specify overrides to the default values for specific properties.
|
910
|
-
*
|
911
|
-
* The key is a supported event name to be configured,
|
912
|
-
* and the options object contains a set of properties, with override values
|
913
|
-
* to be applied to the named recognizer event.
|
914
|
-
* For example, to disable recognition of the rotate event, specify
|
915
|
-
* `{"rotate": {"enable": false}}`.
|
916
|
-
*
|
917
|
-
* Properties that are not present take the HammerJS default values.
|
918
|
-
* For information about which properties are supported for which events,
|
919
|
-
* and their allowed and default values, see
|
920
|
-
* [HammerJS documentation](https://hammerjs.github.io/).
|
921
|
-
*
|
922
|
-
*/
|
923
|
-
this.overrides = {};
|
924
|
-
}
|
811
|
+
class KeyEventsPlugin extends EventManagerPlugin {
|
925
812
|
/**
|
926
|
-
*
|
927
|
-
*
|
928
|
-
* @param element The element that will recognize gestures.
|
929
|
-
* @returns A HammerJS event-manager object.
|
813
|
+
* Initializes an instance of the browser plug-in.
|
814
|
+
* @param doc The document in which key events will be detected.
|
930
815
|
*/
|
931
|
-
|
932
|
-
const mc = new Hammer(element, this.options);
|
933
|
-
mc.get('pinch').set({ enable: true });
|
934
|
-
mc.get('rotate').set({ enable: true });
|
935
|
-
for (const eventName in this.overrides) {
|
936
|
-
mc.get(eventName).set(this.overrides[eventName]);
|
937
|
-
}
|
938
|
-
return mc;
|
939
|
-
}
|
940
|
-
}
|
941
|
-
HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
942
|
-
HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGestureConfig });
|
943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGestureConfig, decorators: [{
|
944
|
-
type: Injectable
|
945
|
-
}] });
|
946
|
-
/**
|
947
|
-
* Event plugin that adds Hammer support to an application.
|
948
|
-
*
|
949
|
-
* @ngModule HammerModule
|
950
|
-
*/
|
951
|
-
class HammerGesturesPlugin extends EventManagerPlugin {
|
952
|
-
constructor(doc, _config, console, loader) {
|
816
|
+
constructor(doc) {
|
953
817
|
super(doc);
|
954
|
-
this._config = _config;
|
955
|
-
this.console = console;
|
956
|
-
this.loader = loader;
|
957
|
-
this._loaderPromise = null;
|
958
818
|
}
|
819
|
+
/**
|
820
|
+
* Reports whether a named key event is supported.
|
821
|
+
* @param eventName The event name to query.
|
822
|
+
* @return True if the named key event is supported.
|
823
|
+
*/
|
959
824
|
supports(eventName) {
|
960
|
-
|
961
|
-
return false;
|
962
|
-
}
|
963
|
-
if (!window.Hammer && !this.loader) {
|
964
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
965
|
-
this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
|
966
|
-
`loaded and no custom loader has been specified.`);
|
967
|
-
}
|
968
|
-
return false;
|
969
|
-
}
|
970
|
-
return true;
|
825
|
+
return KeyEventsPlugin.parseEventName(eventName) != null;
|
971
826
|
}
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
// Until Hammer is loaded, the returned function needs to *cancel* the registration rather
|
981
|
-
// than remove anything.
|
982
|
-
let cancelRegistration = false;
|
983
|
-
let deregister = () => {
|
984
|
-
cancelRegistration = true;
|
985
|
-
};
|
986
|
-
this._loaderPromise
|
987
|
-
.then(() => {
|
988
|
-
// If Hammer isn't actually loaded when the custom loader resolves, give up.
|
989
|
-
if (!window.Hammer) {
|
990
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
991
|
-
this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
|
992
|
-
}
|
993
|
-
deregister = () => { };
|
994
|
-
return;
|
995
|
-
}
|
996
|
-
if (!cancelRegistration) {
|
997
|
-
// Now that Hammer is loaded and the listener is being loaded for real,
|
998
|
-
// the deregistration function changes from canceling registration to removal.
|
999
|
-
deregister = this.addEventListener(element, eventName, handler);
|
1000
|
-
}
|
1001
|
-
})
|
1002
|
-
.catch(() => {
|
1003
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1004
|
-
this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
|
1005
|
-
`Hammer.JS loader failed.`);
|
1006
|
-
}
|
1007
|
-
deregister = () => { };
|
1008
|
-
});
|
1009
|
-
// Return a function that *executes* `deregister` (and not `deregister` itself) so that we
|
1010
|
-
// can change the behavior of `deregister` once the listener is added. Using a closure in
|
1011
|
-
// this way allows us to avoid any additional data structures to track listener removal.
|
1012
|
-
return () => {
|
1013
|
-
deregister();
|
1014
|
-
};
|
1015
|
-
}
|
1016
|
-
return zone.runOutsideAngular(() => {
|
1017
|
-
// Creating the manager bind events, must be done outside of angular
|
1018
|
-
const mc = this._config.buildHammer(element);
|
1019
|
-
const callback = function (eventObj) {
|
1020
|
-
zone.runGuarded(function () {
|
1021
|
-
handler(eventObj);
|
1022
|
-
});
|
1023
|
-
};
|
1024
|
-
mc.on(eventName, callback);
|
1025
|
-
return () => {
|
1026
|
-
mc.off(eventName, callback);
|
1027
|
-
// destroy mc to prevent memory leak
|
1028
|
-
if (typeof mc.destroy === 'function') {
|
1029
|
-
mc.destroy();
|
1030
|
-
}
|
1031
|
-
};
|
1032
|
-
});
|
1033
|
-
}
|
1034
|
-
isCustomEvent(eventName) {
|
1035
|
-
return this._config.events.indexOf(eventName) > -1;
|
1036
|
-
}
|
1037
|
-
}
|
1038
|
-
HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
1039
|
-
HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGesturesPlugin });
|
1040
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
|
1041
|
-
type: Injectable
|
1042
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1043
|
-
type: Inject,
|
1044
|
-
args: [DOCUMENT]
|
1045
|
-
}] }, { type: HammerGestureConfig, decorators: [{
|
1046
|
-
type: Inject,
|
1047
|
-
args: [HAMMER_GESTURE_CONFIG]
|
1048
|
-
}] }, { type: i0.ɵConsole }, { type: undefined, decorators: [{
|
1049
|
-
type: Optional
|
1050
|
-
}, {
|
1051
|
-
type: Inject,
|
1052
|
-
args: [HAMMER_LOADER]
|
1053
|
-
}] }]; } });
|
1054
|
-
/**
|
1055
|
-
* In Ivy, support for Hammer gestures is optional, so applications must
|
1056
|
-
* import the `HammerModule` at root to turn on support. This means that
|
1057
|
-
* Hammer-specific code can be tree-shaken away if not needed.
|
1058
|
-
*/
|
1059
|
-
const HAMMER_PROVIDERS__POST_R3__ = [];
|
1060
|
-
/**
|
1061
|
-
* In View Engine, support for Hammer gestures is built-in by default.
|
1062
|
-
*/
|
1063
|
-
const HAMMER_PROVIDERS__PRE_R3__ = [
|
1064
|
-
{
|
1065
|
-
provide: EVENT_MANAGER_PLUGINS,
|
1066
|
-
useClass: HammerGesturesPlugin,
|
1067
|
-
multi: true,
|
1068
|
-
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1069
|
-
},
|
1070
|
-
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1071
|
-
];
|
1072
|
-
const HAMMER_PROVIDERS = HAMMER_PROVIDERS__POST_R3__;
|
1073
|
-
/**
|
1074
|
-
* Adds support for HammerJS.
|
1075
|
-
*
|
1076
|
-
* Import this module at the root of your application so that Angular can work with
|
1077
|
-
* HammerJS to detect gesture events.
|
1078
|
-
*
|
1079
|
-
* Note that applications still need to include the HammerJS script itself. This module
|
1080
|
-
* simply sets up the coordination layer between HammerJS and Angular's EventManager.
|
1081
|
-
*
|
1082
|
-
* @publicApi
|
1083
|
-
*/
|
1084
|
-
class HammerModule {
|
1085
|
-
}
|
1086
|
-
HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1087
|
-
HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerModule });
|
1088
|
-
HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerModule, providers: HAMMER_PROVIDERS__PRE_R3__ });
|
1089
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: HammerModule, decorators: [{
|
1090
|
-
type: NgModule,
|
1091
|
-
args: [{ providers: HAMMER_PROVIDERS__PRE_R3__ }]
|
1092
|
-
}] });
|
1093
|
-
|
1094
|
-
/**
|
1095
|
-
* @license
|
1096
|
-
* Copyright Google LLC All Rights Reserved.
|
1097
|
-
*
|
1098
|
-
* Use of this source code is governed by an MIT-style license that can be
|
1099
|
-
* found in the LICENSE file at https://angular.io/license
|
1100
|
-
*/
|
1101
|
-
/**
|
1102
|
-
* Defines supported modifiers for key events.
|
1103
|
-
*/
|
1104
|
-
const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
|
1105
|
-
const DOM_KEY_LOCATION_NUMPAD = 3;
|
1106
|
-
// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
|
1107
|
-
const _keyMap = {
|
1108
|
-
// The following values are here for cross-browser compatibility and to match the W3C standard
|
1109
|
-
// cf https://www.w3.org/TR/DOM-Level-3-Events-key/
|
1110
|
-
'\b': 'Backspace',
|
1111
|
-
'\t': 'Tab',
|
1112
|
-
'\x7F': 'Delete',
|
1113
|
-
'\x1B': 'Escape',
|
1114
|
-
'Del': 'Delete',
|
1115
|
-
'Esc': 'Escape',
|
1116
|
-
'Left': 'ArrowLeft',
|
1117
|
-
'Right': 'ArrowRight',
|
1118
|
-
'Up': 'ArrowUp',
|
1119
|
-
'Down': 'ArrowDown',
|
1120
|
-
'Menu': 'ContextMenu',
|
1121
|
-
'Scroll': 'ScrollLock',
|
1122
|
-
'Win': 'OS'
|
1123
|
-
};
|
1124
|
-
// There is a bug in Chrome for numeric keypad keys:
|
1125
|
-
// https://code.google.com/p/chromium/issues/detail?id=155654
|
1126
|
-
// 1, 2, 3 ... are reported as A, B, C ...
|
1127
|
-
const _chromeNumKeyPadMap = {
|
1128
|
-
'A': '1',
|
1129
|
-
'B': '2',
|
1130
|
-
'C': '3',
|
1131
|
-
'D': '4',
|
1132
|
-
'E': '5',
|
1133
|
-
'F': '6',
|
1134
|
-
'G': '7',
|
1135
|
-
'H': '8',
|
1136
|
-
'I': '9',
|
1137
|
-
'J': '*',
|
1138
|
-
'K': '+',
|
1139
|
-
'M': '-',
|
1140
|
-
'N': '.',
|
1141
|
-
'O': '/',
|
1142
|
-
'\x60': '0',
|
1143
|
-
'\x90': 'NumLock'
|
1144
|
-
};
|
1145
|
-
/**
|
1146
|
-
* Retrieves modifiers from key-event objects.
|
1147
|
-
*/
|
1148
|
-
const MODIFIER_KEY_GETTERS = {
|
1149
|
-
'alt': (event) => event.altKey,
|
1150
|
-
'control': (event) => event.ctrlKey,
|
1151
|
-
'meta': (event) => event.metaKey,
|
1152
|
-
'shift': (event) => event.shiftKey
|
1153
|
-
};
|
1154
|
-
/**
|
1155
|
-
* @publicApi
|
1156
|
-
* A browser plug-in that provides support for handling of key events in Angular.
|
1157
|
-
*/
|
1158
|
-
class KeyEventsPlugin extends EventManagerPlugin {
|
1159
|
-
/**
|
1160
|
-
* Initializes an instance of the browser plug-in.
|
1161
|
-
* @param doc The document in which key events will be detected.
|
1162
|
-
*/
|
1163
|
-
constructor(doc) {
|
1164
|
-
super(doc);
|
1165
|
-
}
|
1166
|
-
/**
|
1167
|
-
* Reports whether a named key event is supported.
|
1168
|
-
* @param eventName The event name to query.
|
1169
|
-
* @return True if the named key event is supported.
|
1170
|
-
*/
|
1171
|
-
supports(eventName) {
|
1172
|
-
return KeyEventsPlugin.parseEventName(eventName) != null;
|
1173
|
-
}
|
1174
|
-
/**
|
1175
|
-
* Registers a handler for a specific element and key event.
|
1176
|
-
* @param element The HTML element to receive event notifications.
|
1177
|
-
* @param eventName The name of the key event to listen for.
|
1178
|
-
* @param handler A function to call when the notification occurs. Receives the
|
1179
|
-
* event object as an argument.
|
1180
|
-
* @returns The key event that was registered.
|
1181
|
-
*/
|
827
|
+
/**
|
828
|
+
* Registers a handler for a specific element and key event.
|
829
|
+
* @param element The HTML element to receive event notifications.
|
830
|
+
* @param eventName The name of the key event to listen for.
|
831
|
+
* @param handler A function to call when the notification occurs. Receives the
|
832
|
+
* event object as an argument.
|
833
|
+
* @returns The key event that was registered.
|
834
|
+
*/
|
1182
835
|
addEventListener(element, eventName, handler) {
|
1183
836
|
const parsedEvent = KeyEventsPlugin.parseEventName(eventName);
|
1184
837
|
const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
|
@@ -1260,9 +913,9 @@ class KeyEventsPlugin extends EventManagerPlugin {
|
|
1260
913
|
}
|
1261
914
|
}
|
1262
915
|
}
|
1263
|
-
KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
1264
|
-
KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
1265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
916
|
+
KeyEventsPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
917
|
+
KeyEventsPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: KeyEventsPlugin });
|
918
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: KeyEventsPlugin, decorators: [{
|
1266
919
|
type: Injectable
|
1267
920
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1268
921
|
type: Inject,
|
@@ -1298,189 +951,58 @@ function getEventKey(event) {
|
|
1298
951
|
* Use of this source code is governed by an MIT-style license that can be
|
1299
952
|
* found in the LICENSE file at https://angular.io/license
|
1300
953
|
*/
|
954
|
+
function initDomAdapter() {
|
955
|
+
BrowserDomAdapter.makeCurrent();
|
956
|
+
BrowserGetTestability.init();
|
957
|
+
}
|
958
|
+
function errorHandler() {
|
959
|
+
return new ErrorHandler();
|
960
|
+
}
|
961
|
+
function _document() {
|
962
|
+
// Tell ivy about the global document
|
963
|
+
ɵsetDocument(document);
|
964
|
+
return document;
|
965
|
+
}
|
966
|
+
const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
|
967
|
+
{ provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
|
968
|
+
{ provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
|
969
|
+
{ provide: DOCUMENT, useFactory: _document, deps: [] },
|
970
|
+
];
|
1301
971
|
/**
|
1302
|
-
*
|
1303
|
-
*
|
1304
|
-
*
|
1305
|
-
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
|
1306
|
-
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
|
1307
|
-
* the website.
|
1308
|
-
*
|
1309
|
-
* In specific situations, it might be necessary to disable sanitization, for example if the
|
1310
|
-
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
|
1311
|
-
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
|
1312
|
-
* methods, and then binding to that value from the template.
|
1313
|
-
*
|
1314
|
-
* These situations should be very rare, and extraordinary care must be taken to avoid creating a
|
1315
|
-
* Cross Site Scripting (XSS) security bug!
|
1316
|
-
*
|
1317
|
-
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
|
1318
|
-
* close as possible to the source of the value, to make it easy to verify no security bug is
|
1319
|
-
* created by its use.
|
1320
|
-
*
|
1321
|
-
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
|
1322
|
-
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
|
1323
|
-
* code. The sanitizer leaves safe values intact.
|
972
|
+
* A factory function that returns a `PlatformRef` instance associated with browser service
|
973
|
+
* providers.
|
1324
974
|
*
|
1325
|
-
* @
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
}
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
return ɵunwrapSafeValue(value);
|
1357
|
-
}
|
1358
|
-
return ɵ_sanitizeHtml(this._doc, String(value)).toString();
|
1359
|
-
case SecurityContext.STYLE:
|
1360
|
-
if (ɵallowSanitizationBypassAndThrow(value, "Style" /* Style */)) {
|
1361
|
-
return ɵunwrapSafeValue(value);
|
1362
|
-
}
|
1363
|
-
return value;
|
1364
|
-
case SecurityContext.SCRIPT:
|
1365
|
-
if (ɵallowSanitizationBypassAndThrow(value, "Script" /* Script */)) {
|
1366
|
-
return ɵunwrapSafeValue(value);
|
1367
|
-
}
|
1368
|
-
throw new Error('unsafe value used in a script context');
|
1369
|
-
case SecurityContext.URL:
|
1370
|
-
const type = ɵgetSanitizationBypassType(value);
|
1371
|
-
if (ɵallowSanitizationBypassAndThrow(value, "URL" /* Url */)) {
|
1372
|
-
return ɵunwrapSafeValue(value);
|
1373
|
-
}
|
1374
|
-
return ɵ_sanitizeUrl(String(value));
|
1375
|
-
case SecurityContext.RESOURCE_URL:
|
1376
|
-
if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" /* ResourceUrl */)) {
|
1377
|
-
return ɵunwrapSafeValue(value);
|
1378
|
-
}
|
1379
|
-
throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
1380
|
-
default:
|
1381
|
-
throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`);
|
1382
|
-
}
|
1383
|
-
}
|
1384
|
-
bypassSecurityTrustHtml(value) {
|
1385
|
-
return ɵbypassSanitizationTrustHtml(value);
|
1386
|
-
}
|
1387
|
-
bypassSecurityTrustStyle(value) {
|
1388
|
-
return ɵbypassSanitizationTrustStyle(value);
|
1389
|
-
}
|
1390
|
-
bypassSecurityTrustScript(value) {
|
1391
|
-
return ɵbypassSanitizationTrustScript(value);
|
1392
|
-
}
|
1393
|
-
bypassSecurityTrustUrl(value) {
|
1394
|
-
return ɵbypassSanitizationTrustUrl(value);
|
1395
|
-
}
|
1396
|
-
bypassSecurityTrustResourceUrl(value) {
|
1397
|
-
return ɵbypassSanitizationTrustResourceUrl(value);
|
1398
|
-
}
|
1399
|
-
}
|
1400
|
-
DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1401
|
-
DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [{ token: Injector }] });
|
1402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1", ngImport: i0, type: DomSanitizerImpl, decorators: [{
|
1403
|
-
type: Injectable,
|
1404
|
-
args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }]
|
1405
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1406
|
-
type: Inject,
|
1407
|
-
args: [DOCUMENT]
|
1408
|
-
}] }]; } });
|
1409
|
-
|
1410
|
-
/**
|
1411
|
-
* @license
|
1412
|
-
* Copyright Google LLC All Rights Reserved.
|
1413
|
-
*
|
1414
|
-
* Use of this source code is governed by an MIT-style license that can be
|
1415
|
-
* found in the LICENSE file at https://angular.io/license
|
1416
|
-
*/
|
1417
|
-
function initDomAdapter() {
|
1418
|
-
BrowserDomAdapter.makeCurrent();
|
1419
|
-
BrowserGetTestability.init();
|
1420
|
-
}
|
1421
|
-
function errorHandler() {
|
1422
|
-
return new ErrorHandler();
|
1423
|
-
}
|
1424
|
-
function _document() {
|
1425
|
-
// Tell ivy about the global document
|
1426
|
-
ɵsetDocument(document);
|
1427
|
-
return document;
|
1428
|
-
}
|
1429
|
-
const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
|
1430
|
-
{ provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
|
1431
|
-
{ provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
|
1432
|
-
{ provide: DOCUMENT, useFactory: _document, deps: [] },
|
1433
|
-
];
|
1434
|
-
const BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [
|
1435
|
-
{ provide: Sanitizer, useExisting: DomSanitizer },
|
1436
|
-
{ provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT] },
|
1437
|
-
];
|
1438
|
-
const BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = [];
|
1439
|
-
/**
|
1440
|
-
* @security Replacing built-in sanitization providers exposes the application to XSS risks.
|
1441
|
-
* Attacker-controlled data introduced by an unsanitized provider could expose your
|
1442
|
-
* application to XSS risks. For more detail, see the [Security Guide](https://g.co/ng/security).
|
1443
|
-
* @publicApi
|
1444
|
-
*/
|
1445
|
-
const BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__POST_R3__;
|
1446
|
-
/**
|
1447
|
-
* A factory function that returns a `PlatformRef` instance associated with browser service
|
1448
|
-
* providers.
|
1449
|
-
*
|
1450
|
-
* @publicApi
|
1451
|
-
*/
|
1452
|
-
const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
|
1453
|
-
const BROWSER_MODULE_PROVIDERS = [
|
1454
|
-
BROWSER_SANITIZATION_PROVIDERS,
|
1455
|
-
{ provide: ɵINJECTOR_SCOPE, useValue: 'root' },
|
1456
|
-
{ provide: ErrorHandler, useFactory: errorHandler, deps: [] },
|
1457
|
-
{
|
1458
|
-
provide: EVENT_MANAGER_PLUGINS,
|
1459
|
-
useClass: DomEventsPlugin,
|
1460
|
-
multi: true,
|
1461
|
-
deps: [DOCUMENT, NgZone, PLATFORM_ID]
|
1462
|
-
},
|
1463
|
-
{ provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
|
1464
|
-
HAMMER_PROVIDERS,
|
1465
|
-
{
|
1466
|
-
provide: DomRendererFactory2,
|
1467
|
-
useClass: DomRendererFactory2,
|
1468
|
-
deps: [EventManager, DomSharedStylesHost, APP_ID]
|
1469
|
-
},
|
1470
|
-
{ provide: RendererFactory2, useExisting: DomRendererFactory2 },
|
1471
|
-
{ provide: SharedStylesHost, useExisting: DomSharedStylesHost },
|
1472
|
-
{ provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
|
1473
|
-
{ provide: Testability, useClass: Testability, deps: [NgZone] },
|
1474
|
-
{ provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
|
1475
|
-
{ provide: XhrFactory, useClass: BrowserXhr, deps: [] },
|
1476
|
-
ELEMENT_PROBE_PROVIDERS,
|
1477
|
-
];
|
1478
|
-
/**
|
1479
|
-
* Exports required infrastructure for all Angular apps.
|
1480
|
-
* Included by default in all Angular apps created with the CLI
|
1481
|
-
* `new` command.
|
1482
|
-
* Re-exports `CommonModule` and `ApplicationModule`, making their
|
1483
|
-
* exports and providers available to all apps.
|
975
|
+
* @publicApi
|
976
|
+
*/
|
977
|
+
const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
|
978
|
+
const BROWSER_MODULE_PROVIDERS = [
|
979
|
+
{ provide: ɵINJECTOR_SCOPE, useValue: 'root' },
|
980
|
+
{ provide: ErrorHandler, useFactory: errorHandler, deps: [] },
|
981
|
+
{
|
982
|
+
provide: EVENT_MANAGER_PLUGINS,
|
983
|
+
useClass: DomEventsPlugin,
|
984
|
+
multi: true,
|
985
|
+
deps: [DOCUMENT, NgZone, PLATFORM_ID]
|
986
|
+
},
|
987
|
+
{ provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
|
988
|
+
{
|
989
|
+
provide: DomRendererFactory2,
|
990
|
+
useClass: DomRendererFactory2,
|
991
|
+
deps: [EventManager, DomSharedStylesHost, APP_ID]
|
992
|
+
},
|
993
|
+
{ provide: RendererFactory2, useExisting: DomRendererFactory2 },
|
994
|
+
{ provide: SharedStylesHost, useExisting: DomSharedStylesHost },
|
995
|
+
{ provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
|
996
|
+
{ provide: Testability, useClass: Testability, deps: [NgZone] },
|
997
|
+
{ provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
|
998
|
+
{ provide: XhrFactory, useClass: BrowserXhr, deps: [] },
|
999
|
+
];
|
1000
|
+
/**
|
1001
|
+
* Exports required infrastructure for all Angular apps.
|
1002
|
+
* Included by default in all Angular apps created with the CLI
|
1003
|
+
* `new` command.
|
1004
|
+
* Re-exports `CommonModule` and `ApplicationModule`, making their
|
1005
|
+
* exports and providers available to all apps.
|
1484
1006
|
*
|
1485
1007
|
* @publicApi
|
1486
1008
|
*/
|
@@ -1509,10 +1031,10 @@ class BrowserModule {
|
|
1509
1031
|
};
|
1510
1032
|
}
|
1511
1033
|
}
|
1512
|
-
BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
1513
|
-
BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.
|
1514
|
-
BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.
|
1515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
1034
|
+
BrowserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserModule, deps: [{ token: BrowserModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
1035
|
+
BrowserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] });
|
1036
|
+
BrowserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserModule, providers: BROWSER_MODULE_PROVIDERS, imports: [CommonModule, ApplicationModule] });
|
1037
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserModule, decorators: [{
|
1516
1038
|
type: NgModule,
|
1517
1039
|
args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule] }]
|
1518
1040
|
}], ctorParameters: function () { return [{ type: BrowserModule, decorators: [{
|
@@ -1687,9 +1209,9 @@ class Meta {
|
|
1687
1209
|
return META_KEYS_MAP[prop] || prop;
|
1688
1210
|
}
|
1689
1211
|
}
|
1690
|
-
Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
1691
|
-
Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
1692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
1212
|
+
Meta.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1213
|
+
Meta.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Meta, providedIn: 'root', useFactory: createMeta, deps: [] });
|
1214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Meta, decorators: [{
|
1693
1215
|
type: Injectable,
|
1694
1216
|
args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }]
|
1695
1217
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
@@ -1744,9 +1266,9 @@ class Title {
|
|
1744
1266
|
this._doc.title = newTitle || '';
|
1745
1267
|
}
|
1746
1268
|
}
|
1747
|
-
Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
1748
|
-
Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
1749
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
1269
|
+
Title.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1270
|
+
Title.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Title, providedIn: 'root', useFactory: createTitle, deps: [] });
|
1271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: Title, decorators: [{
|
1750
1272
|
type: Injectable,
|
1751
1273
|
args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }]
|
1752
1274
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
@@ -1754,6 +1276,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0-next.1",
|
|
1754
1276
|
args: [DOCUMENT]
|
1755
1277
|
}] }]; } });
|
1756
1278
|
|
1279
|
+
/**
|
1280
|
+
* @license
|
1281
|
+
* Copyright Google LLC All Rights Reserved.
|
1282
|
+
*
|
1283
|
+
* Use of this source code is governed by an MIT-style license that can be
|
1284
|
+
* found in the LICENSE file at https://angular.io/license
|
1285
|
+
*/
|
1286
|
+
const CAMEL_CASE_REGEXP = /([A-Z])/g;
|
1287
|
+
const DASH_CASE_REGEXP = /-([a-z])/g;
|
1288
|
+
function camelCaseToDashCase(input) {
|
1289
|
+
return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
|
1290
|
+
}
|
1291
|
+
function dashCaseToCamelCase(input) {
|
1292
|
+
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
1293
|
+
}
|
1294
|
+
/**
|
1295
|
+
* Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
|
1296
|
+
* `name` is `'probe'`.
|
1297
|
+
* @param name Name under which it will be exported. Keep in mind this will be a property of the
|
1298
|
+
* global `ng` object.
|
1299
|
+
* @param value The value to export.
|
1300
|
+
*/
|
1301
|
+
function exportNgVar(name, value) {
|
1302
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
1303
|
+
// Note: we can't export `ng` when using closure enhanced optimization as:
|
1304
|
+
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
1305
|
+
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
1306
|
+
// for typings for angularJS (via `goog.provide('ng....')`).
|
1307
|
+
const ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
|
1308
|
+
ng[name] = value;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
|
1757
1312
|
/**
|
1758
1313
|
* @license
|
1759
1314
|
* Copyright Google LLC All Rights Reserved.
|
@@ -1980,9 +1535,9 @@ class TransferState {
|
|
1980
1535
|
return JSON.stringify(this.store);
|
1981
1536
|
}
|
1982
1537
|
}
|
1983
|
-
TransferState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
1984
|
-
TransferState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
1985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
1538
|
+
TransferState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TransferState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1539
|
+
TransferState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TransferState });
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TransferState, decorators: [{
|
1986
1541
|
type: Injectable
|
1987
1542
|
}] });
|
1988
1543
|
function initTransferState(doc, appId) {
|
@@ -2009,10 +1564,10 @@ function initTransferState(doc, appId) {
|
|
2009
1564
|
*/
|
2010
1565
|
class BrowserTransferStateModule {
|
2011
1566
|
}
|
2012
|
-
BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
2013
|
-
BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.
|
2014
|
-
BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.
|
2015
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
1567
|
+
BrowserTransferStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserTransferStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1568
|
+
BrowserTransferStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserTransferStateModule });
|
1569
|
+
BrowserTransferStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserTransferStateModule, providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }] });
|
1570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BrowserTransferStateModule, decorators: [{
|
2016
1571
|
type: NgModule,
|
2017
1572
|
args: [{
|
2018
1573
|
providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }],
|
@@ -2079,6 +1634,383 @@ function elementMatches(n, selector) {
|
|
2079
1634
|
return false;
|
2080
1635
|
}
|
2081
1636
|
|
1637
|
+
/**
|
1638
|
+
* @license
|
1639
|
+
* Copyright Google LLC All Rights Reserved.
|
1640
|
+
*
|
1641
|
+
* Use of this source code is governed by an MIT-style license that can be
|
1642
|
+
* found in the LICENSE file at https://angular.io/license
|
1643
|
+
*/
|
1644
|
+
/**
|
1645
|
+
* Supported HammerJS recognizer event names.
|
1646
|
+
*/
|
1647
|
+
const EVENT_NAMES = {
|
1648
|
+
// pan
|
1649
|
+
'pan': true,
|
1650
|
+
'panstart': true,
|
1651
|
+
'panmove': true,
|
1652
|
+
'panend': true,
|
1653
|
+
'pancancel': true,
|
1654
|
+
'panleft': true,
|
1655
|
+
'panright': true,
|
1656
|
+
'panup': true,
|
1657
|
+
'pandown': true,
|
1658
|
+
// pinch
|
1659
|
+
'pinch': true,
|
1660
|
+
'pinchstart': true,
|
1661
|
+
'pinchmove': true,
|
1662
|
+
'pinchend': true,
|
1663
|
+
'pinchcancel': true,
|
1664
|
+
'pinchin': true,
|
1665
|
+
'pinchout': true,
|
1666
|
+
// press
|
1667
|
+
'press': true,
|
1668
|
+
'pressup': true,
|
1669
|
+
// rotate
|
1670
|
+
'rotate': true,
|
1671
|
+
'rotatestart': true,
|
1672
|
+
'rotatemove': true,
|
1673
|
+
'rotateend': true,
|
1674
|
+
'rotatecancel': true,
|
1675
|
+
// swipe
|
1676
|
+
'swipe': true,
|
1677
|
+
'swipeleft': true,
|
1678
|
+
'swiperight': true,
|
1679
|
+
'swipeup': true,
|
1680
|
+
'swipedown': true,
|
1681
|
+
// tap
|
1682
|
+
'tap': true,
|
1683
|
+
'doubletap': true
|
1684
|
+
};
|
1685
|
+
/**
|
1686
|
+
* DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
|
1687
|
+
* @see `HammerGestureConfig`
|
1688
|
+
*
|
1689
|
+
* @ngModule HammerModule
|
1690
|
+
* @publicApi
|
1691
|
+
*/
|
1692
|
+
const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
|
1693
|
+
/**
|
1694
|
+
* Injection token used to provide a {@link HammerLoader} to Angular.
|
1695
|
+
*
|
1696
|
+
* @publicApi
|
1697
|
+
*/
|
1698
|
+
const HAMMER_LOADER = new InjectionToken('HammerLoader');
|
1699
|
+
/**
|
1700
|
+
* An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
|
1701
|
+
* for gesture recognition. Configures specific event recognition.
|
1702
|
+
* @publicApi
|
1703
|
+
*/
|
1704
|
+
class HammerGestureConfig {
|
1705
|
+
constructor() {
|
1706
|
+
/**
|
1707
|
+
* A set of supported event names for gestures to be used in Angular.
|
1708
|
+
* Angular supports all built-in recognizers, as listed in
|
1709
|
+
* [HammerJS documentation](https://hammerjs.github.io/).
|
1710
|
+
*/
|
1711
|
+
this.events = [];
|
1712
|
+
/**
|
1713
|
+
* Maps gesture event names to a set of configuration options
|
1714
|
+
* that specify overrides to the default values for specific properties.
|
1715
|
+
*
|
1716
|
+
* The key is a supported event name to be configured,
|
1717
|
+
* and the options object contains a set of properties, with override values
|
1718
|
+
* to be applied to the named recognizer event.
|
1719
|
+
* For example, to disable recognition of the rotate event, specify
|
1720
|
+
* `{"rotate": {"enable": false}}`.
|
1721
|
+
*
|
1722
|
+
* Properties that are not present take the HammerJS default values.
|
1723
|
+
* For information about which properties are supported for which events,
|
1724
|
+
* and their allowed and default values, see
|
1725
|
+
* [HammerJS documentation](https://hammerjs.github.io/).
|
1726
|
+
*
|
1727
|
+
*/
|
1728
|
+
this.overrides = {};
|
1729
|
+
}
|
1730
|
+
/**
|
1731
|
+
* Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
|
1732
|
+
* and attaches it to a given HTML element.
|
1733
|
+
* @param element The element that will recognize gestures.
|
1734
|
+
* @returns A HammerJS event-manager object.
|
1735
|
+
*/
|
1736
|
+
buildHammer(element) {
|
1737
|
+
const mc = new Hammer(element, this.options);
|
1738
|
+
mc.get('pinch').set({ enable: true });
|
1739
|
+
mc.get('rotate').set({ enable: true });
|
1740
|
+
for (const eventName in this.overrides) {
|
1741
|
+
mc.get(eventName).set(this.overrides[eventName]);
|
1742
|
+
}
|
1743
|
+
return mc;
|
1744
|
+
}
|
1745
|
+
}
|
1746
|
+
HammerGestureConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1747
|
+
HammerGestureConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGestureConfig });
|
1748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGestureConfig, decorators: [{
|
1749
|
+
type: Injectable
|
1750
|
+
}] });
|
1751
|
+
/**
|
1752
|
+
* Event plugin that adds Hammer support to an application.
|
1753
|
+
*
|
1754
|
+
* @ngModule HammerModule
|
1755
|
+
*/
|
1756
|
+
class HammerGesturesPlugin extends EventManagerPlugin {
|
1757
|
+
constructor(doc, _config, console, loader) {
|
1758
|
+
super(doc);
|
1759
|
+
this._config = _config;
|
1760
|
+
this.console = console;
|
1761
|
+
this.loader = loader;
|
1762
|
+
this._loaderPromise = null;
|
1763
|
+
}
|
1764
|
+
supports(eventName) {
|
1765
|
+
if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
|
1766
|
+
return false;
|
1767
|
+
}
|
1768
|
+
if (!window.Hammer && !this.loader) {
|
1769
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1770
|
+
this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
|
1771
|
+
`loaded and no custom loader has been specified.`);
|
1772
|
+
}
|
1773
|
+
return false;
|
1774
|
+
}
|
1775
|
+
return true;
|
1776
|
+
}
|
1777
|
+
addEventListener(element, eventName, handler) {
|
1778
|
+
const zone = this.manager.getZone();
|
1779
|
+
eventName = eventName.toLowerCase();
|
1780
|
+
// If Hammer is not present but a loader is specified, we defer adding the event listener
|
1781
|
+
// until Hammer is loaded.
|
1782
|
+
if (!window.Hammer && this.loader) {
|
1783
|
+
this._loaderPromise = this._loaderPromise || this.loader();
|
1784
|
+
// This `addEventListener` method returns a function to remove the added listener.
|
1785
|
+
// Until Hammer is loaded, the returned function needs to *cancel* the registration rather
|
1786
|
+
// than remove anything.
|
1787
|
+
let cancelRegistration = false;
|
1788
|
+
let deregister = () => {
|
1789
|
+
cancelRegistration = true;
|
1790
|
+
};
|
1791
|
+
this._loaderPromise
|
1792
|
+
.then(() => {
|
1793
|
+
// If Hammer isn't actually loaded when the custom loader resolves, give up.
|
1794
|
+
if (!window.Hammer) {
|
1795
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1796
|
+
this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
|
1797
|
+
}
|
1798
|
+
deregister = () => { };
|
1799
|
+
return;
|
1800
|
+
}
|
1801
|
+
if (!cancelRegistration) {
|
1802
|
+
// Now that Hammer is loaded and the listener is being loaded for real,
|
1803
|
+
// the deregistration function changes from canceling registration to removal.
|
1804
|
+
deregister = this.addEventListener(element, eventName, handler);
|
1805
|
+
}
|
1806
|
+
})
|
1807
|
+
.catch(() => {
|
1808
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1809
|
+
this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
|
1810
|
+
`Hammer.JS loader failed.`);
|
1811
|
+
}
|
1812
|
+
deregister = () => { };
|
1813
|
+
});
|
1814
|
+
// Return a function that *executes* `deregister` (and not `deregister` itself) so that we
|
1815
|
+
// can change the behavior of `deregister` once the listener is added. Using a closure in
|
1816
|
+
// this way allows us to avoid any additional data structures to track listener removal.
|
1817
|
+
return () => {
|
1818
|
+
deregister();
|
1819
|
+
};
|
1820
|
+
}
|
1821
|
+
return zone.runOutsideAngular(() => {
|
1822
|
+
// Creating the manager bind events, must be done outside of angular
|
1823
|
+
const mc = this._config.buildHammer(element);
|
1824
|
+
const callback = function (eventObj) {
|
1825
|
+
zone.runGuarded(function () {
|
1826
|
+
handler(eventObj);
|
1827
|
+
});
|
1828
|
+
};
|
1829
|
+
mc.on(eventName, callback);
|
1830
|
+
return () => {
|
1831
|
+
mc.off(eventName, callback);
|
1832
|
+
// destroy mc to prevent memory leak
|
1833
|
+
if (typeof mc.destroy === 'function') {
|
1834
|
+
mc.destroy();
|
1835
|
+
}
|
1836
|
+
};
|
1837
|
+
});
|
1838
|
+
}
|
1839
|
+
isCustomEvent(eventName) {
|
1840
|
+
return this._config.events.indexOf(eventName) > -1;
|
1841
|
+
}
|
1842
|
+
}
|
1843
|
+
HammerGesturesPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.ɵConsole }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
1844
|
+
HammerGesturesPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGesturesPlugin });
|
1845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
|
1846
|
+
type: Injectable
|
1847
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
1848
|
+
type: Inject,
|
1849
|
+
args: [DOCUMENT]
|
1850
|
+
}] }, { type: HammerGestureConfig, decorators: [{
|
1851
|
+
type: Inject,
|
1852
|
+
args: [HAMMER_GESTURE_CONFIG]
|
1853
|
+
}] }, { type: i0.ɵConsole }, { type: undefined, decorators: [{
|
1854
|
+
type: Optional
|
1855
|
+
}, {
|
1856
|
+
type: Inject,
|
1857
|
+
args: [HAMMER_LOADER]
|
1858
|
+
}] }]; } });
|
1859
|
+
/**
|
1860
|
+
* Adds support for HammerJS.
|
1861
|
+
*
|
1862
|
+
* Import this module at the root of your application so that Angular can work with
|
1863
|
+
* HammerJS to detect gesture events.
|
1864
|
+
*
|
1865
|
+
* Note that applications still need to include the HammerJS script itself. This module
|
1866
|
+
* simply sets up the coordination layer between HammerJS and Angular's EventManager.
|
1867
|
+
*
|
1868
|
+
* @publicApi
|
1869
|
+
*/
|
1870
|
+
class HammerModule {
|
1871
|
+
}
|
1872
|
+
HammerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1873
|
+
HammerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerModule });
|
1874
|
+
HammerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerModule, providers: [
|
1875
|
+
{
|
1876
|
+
provide: EVENT_MANAGER_PLUGINS,
|
1877
|
+
useClass: HammerGesturesPlugin,
|
1878
|
+
multi: true,
|
1879
|
+
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1880
|
+
},
|
1881
|
+
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1882
|
+
] });
|
1883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HammerModule, decorators: [{
|
1884
|
+
type: NgModule,
|
1885
|
+
args: [{
|
1886
|
+
providers: [
|
1887
|
+
{
|
1888
|
+
provide: EVENT_MANAGER_PLUGINS,
|
1889
|
+
useClass: HammerGesturesPlugin,
|
1890
|
+
multi: true,
|
1891
|
+
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1892
|
+
},
|
1893
|
+
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1894
|
+
]
|
1895
|
+
}]
|
1896
|
+
}] });
|
1897
|
+
|
1898
|
+
/**
|
1899
|
+
* @license
|
1900
|
+
* Copyright Google LLC All Rights Reserved.
|
1901
|
+
*
|
1902
|
+
* Use of this source code is governed by an MIT-style license that can be
|
1903
|
+
* found in the LICENSE file at https://angular.io/license
|
1904
|
+
*/
|
1905
|
+
/**
|
1906
|
+
* DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
|
1907
|
+
* values to be safe to use in the different DOM contexts.
|
1908
|
+
*
|
1909
|
+
* For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
|
1910
|
+
* sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
|
1911
|
+
* the website.
|
1912
|
+
*
|
1913
|
+
* In specific situations, it might be necessary to disable sanitization, for example if the
|
1914
|
+
* application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
|
1915
|
+
* Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
|
1916
|
+
* methods, and then binding to that value from the template.
|
1917
|
+
*
|
1918
|
+
* These situations should be very rare, and extraordinary care must be taken to avoid creating a
|
1919
|
+
* Cross Site Scripting (XSS) security bug!
|
1920
|
+
*
|
1921
|
+
* When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
|
1922
|
+
* close as possible to the source of the value, to make it easy to verify no security bug is
|
1923
|
+
* created by its use.
|
1924
|
+
*
|
1925
|
+
* It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
|
1926
|
+
* does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
|
1927
|
+
* code. The sanitizer leaves safe values intact.
|
1928
|
+
*
|
1929
|
+
* @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
|
1930
|
+
* sanitization for the value passed in. Carefully check and audit all values and code paths going
|
1931
|
+
* into this call. Make sure any user data is appropriately escaped for this security context.
|
1932
|
+
* For more detail, see the [Security Guide](https://g.co/ng/security).
|
1933
|
+
*
|
1934
|
+
* @publicApi
|
1935
|
+
*/
|
1936
|
+
class DomSanitizer {
|
1937
|
+
}
|
1938
|
+
DomSanitizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
1939
|
+
DomSanitizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(function () { return DomSanitizerImpl; }) });
|
1940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizer, decorators: [{
|
1941
|
+
type: Injectable,
|
1942
|
+
args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
|
1943
|
+
}] });
|
1944
|
+
function domSanitizerImplFactory(injector) {
|
1945
|
+
return new DomSanitizerImpl(injector.get(DOCUMENT));
|
1946
|
+
}
|
1947
|
+
class DomSanitizerImpl extends DomSanitizer {
|
1948
|
+
constructor(_doc) {
|
1949
|
+
super();
|
1950
|
+
this._doc = _doc;
|
1951
|
+
}
|
1952
|
+
sanitize(ctx, value) {
|
1953
|
+
if (value == null)
|
1954
|
+
return null;
|
1955
|
+
switch (ctx) {
|
1956
|
+
case SecurityContext.NONE:
|
1957
|
+
return value;
|
1958
|
+
case SecurityContext.HTML:
|
1959
|
+
if (ɵallowSanitizationBypassAndThrow(value, "HTML" /* Html */)) {
|
1960
|
+
return ɵunwrapSafeValue(value);
|
1961
|
+
}
|
1962
|
+
return ɵ_sanitizeHtml(this._doc, String(value)).toString();
|
1963
|
+
case SecurityContext.STYLE:
|
1964
|
+
if (ɵallowSanitizationBypassAndThrow(value, "Style" /* Style */)) {
|
1965
|
+
return ɵunwrapSafeValue(value);
|
1966
|
+
}
|
1967
|
+
return value;
|
1968
|
+
case SecurityContext.SCRIPT:
|
1969
|
+
if (ɵallowSanitizationBypassAndThrow(value, "Script" /* Script */)) {
|
1970
|
+
return ɵunwrapSafeValue(value);
|
1971
|
+
}
|
1972
|
+
throw new Error('unsafe value used in a script context');
|
1973
|
+
case SecurityContext.URL:
|
1974
|
+
const type = ɵgetSanitizationBypassType(value);
|
1975
|
+
if (ɵallowSanitizationBypassAndThrow(value, "URL" /* Url */)) {
|
1976
|
+
return ɵunwrapSafeValue(value);
|
1977
|
+
}
|
1978
|
+
return ɵ_sanitizeUrl(String(value));
|
1979
|
+
case SecurityContext.RESOURCE_URL:
|
1980
|
+
if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" /* ResourceUrl */)) {
|
1981
|
+
return ɵunwrapSafeValue(value);
|
1982
|
+
}
|
1983
|
+
throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
1984
|
+
default:
|
1985
|
+
throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`);
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
bypassSecurityTrustHtml(value) {
|
1989
|
+
return ɵbypassSanitizationTrustHtml(value);
|
1990
|
+
}
|
1991
|
+
bypassSecurityTrustStyle(value) {
|
1992
|
+
return ɵbypassSanitizationTrustStyle(value);
|
1993
|
+
}
|
1994
|
+
bypassSecurityTrustScript(value) {
|
1995
|
+
return ɵbypassSanitizationTrustScript(value);
|
1996
|
+
}
|
1997
|
+
bypassSecurityTrustUrl(value) {
|
1998
|
+
return ɵbypassSanitizationTrustUrl(value);
|
1999
|
+
}
|
2000
|
+
bypassSecurityTrustResourceUrl(value) {
|
2001
|
+
return ɵbypassSanitizationTrustResourceUrl(value);
|
2002
|
+
}
|
2003
|
+
}
|
2004
|
+
DomSanitizerImpl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
2005
|
+
DomSanitizerImpl.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [{ token: Injector }] });
|
2006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DomSanitizerImpl, decorators: [{
|
2007
|
+
type: Injectable,
|
2008
|
+
args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }]
|
2009
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
2010
|
+
type: Inject,
|
2011
|
+
args: [DOCUMENT]
|
2012
|
+
}] }]; } });
|
2013
|
+
|
2082
2014
|
/**
|
2083
2015
|
* @license
|
2084
2016
|
* Copyright Google LLC All Rights Reserved.
|
@@ -2097,7 +2029,7 @@ function elementMatches(n, selector) {
|
|
2097
2029
|
/**
|
2098
2030
|
* @publicApi
|
2099
2031
|
*/
|
2100
|
-
const VERSION = new Version('13.1.
|
2032
|
+
const VERSION = new Version('13.1.1');
|
2101
2033
|
|
2102
2034
|
/**
|
2103
2035
|
* @license
|
@@ -2128,5 +2060,5 @@ const VERSION = new Version('13.1.0-next.1');
|
|
2128
2060
|
* Generated bundle index. Do not edit.
|
2129
2061
|
*/
|
2130
2062
|
|
2131
|
-
export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser,
|
2063
|
+
export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, DomSharedStylesHost as ɵDomSharedStylesHost, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, NAMESPACE_URIS as ɵNAMESPACE_URIS, SharedStylesHost as ɵSharedStylesHost, TRANSITION_ID as ɵTRANSITION_ID, escapeHtml as ɵescapeHtml, flattenStyles as ɵflattenStyles, initDomAdapter as ɵinitDomAdapter, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute };
|
2132
2064
|
//# sourceMappingURL=platform-browser.mjs.map
|