1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import { __extends, __assign, __decorate, __param, __metadata } from 'tslib';
|
8 | import { ɵDomAdapter, ɵsetRootDomAdapter, ɵparseCookieValue, ɵgetDOM, DOCUMENT, ɵPLATFORM_BROWSER_ID, CommonModule } from '@angular/common';
|
9 | export { ɵgetDOM } from '@angular/common';
|
10 | import { ɵglobal, InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, ApplicationRef, NgZone, ɵgetDebugNodeR2, NgProbeToken, Optional, Injectable, Inject, ViewEncapsulation, APP_ID, RendererStyleFlags2, ɵConsole, NgModule, ɵɵdefineInjectable, ɵɵinject, forwardRef, SecurityContext, ɵallowSanitizationBypassAndThrow, ɵunwrapSafeValue, ɵgetSanitizationBypassType, ɵ_sanitizeUrl, ɵ_sanitizeStyle, ɵ_sanitizeHtml, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl, INJECTOR, ErrorHandler, ɵsetDocument, PLATFORM_ID, PLATFORM_INITIALIZER, Sanitizer, createPlatformFactory, platformCore, ɵINJECTOR_SCOPE, RendererFactory2, Testability, ApplicationModule, SkipSelf, Version } from '@angular/core';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | var GenericBrowserDomAdapter = (function (_super) {
|
26 | __extends(GenericBrowserDomAdapter, _super);
|
27 | function GenericBrowserDomAdapter() {
|
28 | return _super.call(this) || this;
|
29 | }
|
30 | GenericBrowserDomAdapter.prototype.supportsDOMEvents = function () { return true; };
|
31 | return GenericBrowserDomAdapter;
|
32 | }(ɵDomAdapter));
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | var ɵ0 = function () {
|
42 | if (ɵglobal['Node']) {
|
43 | return ɵglobal['Node'].prototype.contains || function (node) {
|
44 | return !!(this.compareDocumentPosition(node) & 16);
|
45 | };
|
46 | }
|
47 | return undefined;
|
48 | };
|
49 | var nodeContains = (ɵ0)();
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | var BrowserDomAdapter = (function (_super) {
|
58 | __extends(BrowserDomAdapter, _super);
|
59 | function BrowserDomAdapter() {
|
60 | return _super !== null && _super.apply(this, arguments) || this;
|
61 | }
|
62 | BrowserDomAdapter.makeCurrent = function () { ɵsetRootDomAdapter(new BrowserDomAdapter()); };
|
63 | BrowserDomAdapter.prototype.getProperty = function (el, name) { return el[name]; };
|
64 | BrowserDomAdapter.prototype.log = function (error) {
|
65 | if (window.console) {
|
66 | window.console.log && window.console.log(error);
|
67 | }
|
68 | };
|
69 | BrowserDomAdapter.prototype.logGroup = function (error) {
|
70 | if (window.console) {
|
71 | window.console.group && window.console.group(error);
|
72 | }
|
73 | };
|
74 | BrowserDomAdapter.prototype.logGroupEnd = function () {
|
75 | if (window.console) {
|
76 | window.console.groupEnd && window.console.groupEnd();
|
77 | }
|
78 | };
|
79 | BrowserDomAdapter.prototype.onAndCancel = function (el, evt, listener) {
|
80 | el.addEventListener(evt, listener, false);
|
81 |
|
82 |
|
83 | return function () { el.removeEventListener(evt, listener, false); };
|
84 | };
|
85 | BrowserDomAdapter.prototype.dispatchEvent = function (el, evt) { el.dispatchEvent(evt); };
|
86 | BrowserDomAdapter.prototype.remove = function (node) {
|
87 | if (node.parentNode) {
|
88 | node.parentNode.removeChild(node);
|
89 | }
|
90 | return node;
|
91 | };
|
92 | BrowserDomAdapter.prototype.getValue = function (el) { return el.value; };
|
93 | BrowserDomAdapter.prototype.createElement = function (tagName, doc) {
|
94 | doc = doc || this.getDefaultDocument();
|
95 | return doc.createElement(tagName);
|
96 | };
|
97 | BrowserDomAdapter.prototype.createHtmlDocument = function () {
|
98 | return document.implementation.createHTMLDocument('fakeTitle');
|
99 | };
|
100 | BrowserDomAdapter.prototype.getDefaultDocument = function () { return document; };
|
101 | BrowserDomAdapter.prototype.isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };
|
102 | BrowserDomAdapter.prototype.isShadowRoot = function (node) { return node instanceof DocumentFragment; };
|
103 | BrowserDomAdapter.prototype.getGlobalEventTarget = function (doc, target) {
|
104 | if (target === 'window') {
|
105 | return window;
|
106 | }
|
107 | if (target === 'document') {
|
108 | return doc;
|
109 | }
|
110 | if (target === 'body') {
|
111 | return doc.body;
|
112 | }
|
113 | return null;
|
114 | };
|
115 | BrowserDomAdapter.prototype.getHistory = function () { return window.history; };
|
116 | BrowserDomAdapter.prototype.getLocation = function () { return window.location; };
|
117 | BrowserDomAdapter.prototype.getBaseHref = function (doc) {
|
118 | var href = getBaseElementHref();
|
119 | return href == null ? null : relativePath(href);
|
120 | };
|
121 | BrowserDomAdapter.prototype.resetBaseElement = function () { baseElement = null; };
|
122 | BrowserDomAdapter.prototype.getUserAgent = function () { return window.navigator.userAgent; };
|
123 | BrowserDomAdapter.prototype.performanceNow = function () {
|
124 |
|
125 |
|
126 | return window.performance && window.performance.now ? window.performance.now() :
|
127 | new Date().getTime();
|
128 | };
|
129 | BrowserDomAdapter.prototype.supportsCookies = function () { return true; };
|
130 | BrowserDomAdapter.prototype.getCookie = function (name) { return ɵparseCookieValue(document.cookie, name); };
|
131 | return BrowserDomAdapter;
|
132 | }(GenericBrowserDomAdapter));
|
133 | var baseElement = null;
|
134 | function getBaseElementHref() {
|
135 | if (!baseElement) {
|
136 | baseElement = document.querySelector('base');
|
137 | if (!baseElement) {
|
138 | return null;
|
139 | }
|
140 | }
|
141 | return baseElement.getAttribute('href');
|
142 | }
|
143 |
|
144 | var urlParsingNode;
|
145 | function relativePath(url) {
|
146 | if (!urlParsingNode) {
|
147 | urlParsingNode = document.createElement('a');
|
148 | }
|
149 | urlParsingNode.setAttribute('href', url);
|
150 | return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
|
151 | '/' + urlParsingNode.pathname;
|
152 | }
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 | var TRANSITION_ID = new InjectionToken('TRANSITION_ID');
|
166 | function appInitializerFactory(transitionId, document, injector) {
|
167 | return function () {
|
168 |
|
169 |
|
170 | injector.get(ApplicationInitStatus).donePromise.then(function () {
|
171 | var dom = ɵgetDOM();
|
172 | var styles = Array.prototype.slice.apply(document.querySelectorAll("style[ng-transition]"));
|
173 | styles.filter(function (el) { return el.getAttribute('ng-transition') === transitionId; })
|
174 | .forEach(function (el) { return dom.remove(el); });
|
175 | });
|
176 | };
|
177 | }
|
178 | var SERVER_TRANSITION_PROVIDERS = [
|
179 | {
|
180 | provide: APP_INITIALIZER,
|
181 | useFactory: appInitializerFactory,
|
182 | deps: [TRANSITION_ID, DOCUMENT, Injector],
|
183 | multi: true
|
184 | },
|
185 | ];
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 | var BrowserGetTestability = (function () {
|
195 | function BrowserGetTestability() {
|
196 | }
|
197 | BrowserGetTestability.init = function () { setTestabilityGetter(new BrowserGetTestability()); };
|
198 | BrowserGetTestability.prototype.addToWindow = function (registry) {
|
199 | ɵglobal['getAngularTestability'] = function (elem, findInAncestors) {
|
200 | if (findInAncestors === void 0) { findInAncestors = true; }
|
201 | var testability = registry.findTestabilityInTree(elem, findInAncestors);
|
202 | if (testability == null) {
|
203 | throw new Error('Could not find testability for element.');
|
204 | }
|
205 | return testability;
|
206 | };
|
207 | ɵglobal['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };
|
208 | ɵglobal['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };
|
209 | var whenAllStable = function (callback /** TODO #9100 */) {
|
210 | var testabilities = ɵglobal['getAllAngularTestabilities']();
|
211 | var count = testabilities.length;
|
212 | var didWork = false;
|
213 | var decrement = function (didWork_ /** TODO #9100 */) {
|
214 | didWork = didWork || didWork_;
|
215 | count--;
|
216 | if (count == 0) {
|
217 | callback(didWork);
|
218 | }
|
219 | };
|
220 | testabilities.forEach(function (testability /** TODO #9100 */) {
|
221 | testability.whenStable(decrement);
|
222 | });
|
223 | };
|
224 | if (!ɵglobal['frameworkStabilizers']) {
|
225 | ɵglobal['frameworkStabilizers'] = [];
|
226 | }
|
227 | ɵglobal['frameworkStabilizers'].push(whenAllStable);
|
228 | };
|
229 | BrowserGetTestability.prototype.findTestabilityInTree = function (registry, elem, findInAncestors) {
|
230 | if (elem == null) {
|
231 | return null;
|
232 | }
|
233 | var t = registry.getTestability(elem);
|
234 | if (t != null) {
|
235 | return t;
|
236 | }
|
237 | else if (!findInAncestors) {
|
238 | return null;
|
239 | }
|
240 | if (ɵgetDOM().isShadowRoot(elem)) {
|
241 | return this.findTestabilityInTree(registry, elem.host, true);
|
242 | }
|
243 | return this.findTestabilityInTree(registry, elem.parentElement, true);
|
244 | };
|
245 | return BrowserGetTestability;
|
246 | }());
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | var CAMEL_CASE_REGEXP = /([A-Z])/g;
|
256 | var DASH_CASE_REGEXP = /-([a-z])/g;
|
257 | function camelCaseToDashCase(input) {
|
258 | return input.replace(CAMEL_CASE_REGEXP, function () {
|
259 | var m = [];
|
260 | for (var _i = 0; _i < arguments.length; _i++) {
|
261 | m[_i] = arguments[_i];
|
262 | }
|
263 | return '-' + m[1].toLowerCase();
|
264 | });
|
265 | }
|
266 | function dashCaseToCamelCase(input) {
|
267 | return input.replace(DASH_CASE_REGEXP, function () {
|
268 | var m = [];
|
269 | for (var _i = 0; _i < arguments.length; _i++) {
|
270 | m[_i] = arguments[_i];
|
271 | }
|
272 | return m[1].toUpperCase();
|
273 | });
|
274 | }
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 | function exportNgVar(name, value) {
|
283 | if (typeof COMPILED === 'undefined' || !COMPILED) {
|
284 |
|
285 |
|
286 |
|
287 |
|
288 | var ng = ɵglobal['ng'] = ɵglobal['ng'] || {};
|
289 | ng[name] = value;
|
290 | }
|
291 | }
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | var ɵ0$1 = function () { return ({
|
301 | 'ApplicationRef': ApplicationRef,
|
302 | 'NgZone': NgZone,
|
303 | }); };
|
304 | var CORE_TOKENS = (ɵ0$1)();
|
305 | var INSPECT_GLOBAL_NAME = 'probe';
|
306 | var CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 | function inspectNativeElementR2(element) {
|
313 | return ɵgetDebugNodeR2(element);
|
314 | }
|
315 | function _createNgProbeR2(coreTokens) {
|
316 | exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2);
|
317 | exportNgVar(CORE_TOKENS_GLOBAL_NAME, __assign(__assign({}, CORE_TOKENS), _ngProbeTokensToMap(coreTokens || [])));
|
318 | return function () { return inspectNativeElementR2; };
|
319 | }
|
320 | function _ngProbeTokensToMap(tokens) {
|
321 | return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});
|
322 | }
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 | var ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
|
331 |
|
332 |
|
333 |
|
334 | var ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
|
335 | {
|
336 | provide: APP_INITIALIZER,
|
337 | useFactory: _createNgProbeR2,
|
338 | deps: [
|
339 | [NgProbeToken, new Optional()],
|
340 | ],
|
341 | multi: true,
|
342 | },
|
343 | ];
|
344 | var ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__PRE_R3__;
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 | var EVENT_MANAGER_PLUGINS = new InjectionToken('EventManagerPlugins');
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 | var EventManager = (function () {
|
366 | |
367 |
|
368 |
|
369 | function EventManager(plugins, _zone) {
|
370 | var _this = this;
|
371 | this._zone = _zone;
|
372 | this._eventNameToPlugin = new Map();
|
373 | plugins.forEach(function (p) { return p.manager = _this; });
|
374 | this._plugins = plugins.slice().reverse();
|
375 | }
|
376 | |
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 | EventManager.prototype.addEventListener = function (element, eventName, handler) {
|
386 | var plugin = this._findPluginFor(eventName);
|
387 | return plugin.addEventListener(element, eventName, handler);
|
388 | };
|
389 | |
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 | EventManager.prototype.addGlobalEventListener = function (target, eventName, handler) {
|
399 | var plugin = this._findPluginFor(eventName);
|
400 | return plugin.addGlobalEventListener(target, eventName, handler);
|
401 | };
|
402 | |
403 |
|
404 |
|
405 | EventManager.prototype.getZone = function () { return this._zone; };
|
406 |
|
407 | EventManager.prototype._findPluginFor = function (eventName) {
|
408 | var plugin = this._eventNameToPlugin.get(eventName);
|
409 | if (plugin) {
|
410 | return plugin;
|
411 | }
|
412 | var plugins = this._plugins;
|
413 | for (var i = 0; i < plugins.length; i++) {
|
414 | var plugin_1 = plugins[i];
|
415 | if (plugin_1.supports(eventName)) {
|
416 | this._eventNameToPlugin.set(eventName, plugin_1);
|
417 | return plugin_1;
|
418 | }
|
419 | }
|
420 | throw new Error("No event manager plugin found for event " + eventName);
|
421 | };
|
422 | EventManager = __decorate([
|
423 | Injectable(),
|
424 | __param(0, Inject(EVENT_MANAGER_PLUGINS)),
|
425 | __metadata("design:paramtypes", [Array, NgZone])
|
426 | ], EventManager);
|
427 | return EventManager;
|
428 | }());
|
429 | var EventManagerPlugin = (function () {
|
430 | function EventManagerPlugin(_doc) {
|
431 | this._doc = _doc;
|
432 | }
|
433 | EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) {
|
434 | var target = ɵgetDOM().getGlobalEventTarget(this._doc, element);
|
435 | if (!target) {
|
436 | throw new Error("Unsupported event target " + target + " for event " + eventName);
|
437 | }
|
438 | return this.addEventListener(target, eventName, handler);
|
439 | };
|
440 | return EventManagerPlugin;
|
441 | }());
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 | var SharedStylesHost = (function () {
|
451 | function SharedStylesHost() {
|
452 |
|
453 | this._stylesSet = new Set();
|
454 | }
|
455 | SharedStylesHost.prototype.addStyles = function (styles) {
|
456 | var _this = this;
|
457 | var additions = new Set();
|
458 | styles.forEach(function (style) {
|
459 | if (!_this._stylesSet.has(style)) {
|
460 | _this._stylesSet.add(style);
|
461 | additions.add(style);
|
462 | }
|
463 | });
|
464 | this.onStylesAdded(additions);
|
465 | };
|
466 | SharedStylesHost.prototype.onStylesAdded = function (additions) { };
|
467 | SharedStylesHost.prototype.getAllStyles = function () { return Array.from(this._stylesSet); };
|
468 | SharedStylesHost = __decorate([
|
469 | Injectable()
|
470 | ], SharedStylesHost);
|
471 | return SharedStylesHost;
|
472 | }());
|
473 | var DomSharedStylesHost = (function (_super) {
|
474 | __extends(DomSharedStylesHost, _super);
|
475 | function DomSharedStylesHost(_doc) {
|
476 | var _this = _super.call(this) || this;
|
477 | _this._doc = _doc;
|
478 | _this._hostNodes = new Set();
|
479 | _this._styleNodes = new Set();
|
480 | _this._hostNodes.add(_doc.head);
|
481 | return _this;
|
482 | }
|
483 | DomSharedStylesHost.prototype._addStylesToHost = function (styles, host) {
|
484 | var _this = this;
|
485 | styles.forEach(function (style) {
|
486 | var styleEl = _this._doc.createElement('style');
|
487 | styleEl.textContent = style;
|
488 | _this._styleNodes.add(host.appendChild(styleEl));
|
489 | });
|
490 | };
|
491 | DomSharedStylesHost.prototype.addHost = function (hostNode) {
|
492 | this._addStylesToHost(this._stylesSet, hostNode);
|
493 | this._hostNodes.add(hostNode);
|
494 | };
|
495 | DomSharedStylesHost.prototype.removeHost = function (hostNode) { this._hostNodes.delete(hostNode); };
|
496 | DomSharedStylesHost.prototype.onStylesAdded = function (additions) {
|
497 | var _this = this;
|
498 | this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });
|
499 | };
|
500 | DomSharedStylesHost.prototype.ngOnDestroy = function () { this._styleNodes.forEach(function (styleNode) { return ɵgetDOM().remove(styleNode); }); };
|
501 | DomSharedStylesHost = __decorate([
|
502 | Injectable(),
|
503 | __param(0, Inject(DOCUMENT)),
|
504 | __metadata("design:paramtypes", [Object])
|
505 | ], DomSharedStylesHost);
|
506 | return DomSharedStylesHost;
|
507 | }(SharedStylesHost));
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 | var NAMESPACE_URIS = {
|
517 | 'svg': 'http://www.w3.org/2000/svg',
|
518 | 'xhtml': 'http://www.w3.org/1999/xhtml',
|
519 | 'xlink': 'http://www.w3.org/1999/xlink',
|
520 | 'xml': 'http://www.w3.org/XML/1998/namespace',
|
521 | 'xmlns': 'http://www.w3.org/2000/xmlns/',
|
522 | };
|
523 | var COMPONENT_REGEX = /%COMP%/g;
|
524 | var NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
525 | var COMPONENT_VARIABLE = '%COMP%';
|
526 | var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
|
527 | var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
|
528 | function shimContentAttribute(componentShortId) {
|
529 | return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
530 | }
|
531 | function shimHostAttribute(componentShortId) {
|
532 | return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
533 | }
|
534 | function flattenStyles(compId, styles, target) {
|
535 | for (var i = 0; i < styles.length; i++) {
|
536 | var style = styles[i];
|
537 | if (Array.isArray(style)) {
|
538 | flattenStyles(compId, style, target);
|
539 | }
|
540 | else {
|
541 | style = style.replace(COMPONENT_REGEX, compId);
|
542 | target.push(style);
|
543 | }
|
544 | }
|
545 | return target;
|
546 | }
|
547 | function decoratePreventDefault(eventHandler) {
|
548 |
|
549 |
|
550 |
|
551 |
|
552 | return function (event) {
|
553 |
|
554 |
|
555 |
|
556 |
|
557 | if (event === '__ngUnwrap__') {
|
558 | return eventHandler;
|
559 | }
|
560 | var allowDefaultBehavior = eventHandler(event);
|
561 | if (allowDefaultBehavior === false) {
|
562 |
|
563 | event.preventDefault();
|
564 | event.returnValue = false;
|
565 | }
|
566 | return undefined;
|
567 | };
|
568 | }
|
569 | var DomRendererFactory2 = (function () {
|
570 | function DomRendererFactory2(eventManager, sharedStylesHost, appId) {
|
571 | this.eventManager = eventManager;
|
572 | this.sharedStylesHost = sharedStylesHost;
|
573 | this.appId = appId;
|
574 | this.rendererByCompId = new Map();
|
575 | this.defaultRenderer = new DefaultDomRenderer2(eventManager);
|
576 | }
|
577 | DomRendererFactory2.prototype.createRenderer = function (element, type) {
|
578 | if (!element || !type) {
|
579 | return this.defaultRenderer;
|
580 | }
|
581 | switch (type.encapsulation) {
|
582 | case ViewEncapsulation.Emulated: {
|
583 | var renderer = this.rendererByCompId.get(type.id);
|
584 | if (!renderer) {
|
585 | renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId);
|
586 | this.rendererByCompId.set(type.id, renderer);
|
587 | }
|
588 | renderer.applyToHost(element);
|
589 | return renderer;
|
590 | }
|
591 | case ViewEncapsulation.Native:
|
592 | case ViewEncapsulation.ShadowDom:
|
593 | return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
|
594 | default: {
|
595 | if (!this.rendererByCompId.has(type.id)) {
|
596 | var styles = flattenStyles(type.id, type.styles, []);
|
597 | this.sharedStylesHost.addStyles(styles);
|
598 | this.rendererByCompId.set(type.id, this.defaultRenderer);
|
599 | }
|
600 | return this.defaultRenderer;
|
601 | }
|
602 | }
|
603 | };
|
604 | DomRendererFactory2.prototype.begin = function () { };
|
605 | DomRendererFactory2.prototype.end = function () { };
|
606 | DomRendererFactory2 = __decorate([
|
607 | Injectable(),
|
608 | __param(2, Inject(APP_ID)),
|
609 | __metadata("design:paramtypes", [EventManager, DomSharedStylesHost, String])
|
610 | ], DomRendererFactory2);
|
611 | return DomRendererFactory2;
|
612 | }());
|
613 | var DefaultDomRenderer2 = (function () {
|
614 | function DefaultDomRenderer2(eventManager) {
|
615 | this.eventManager = eventManager;
|
616 | this.data = Object.create(null);
|
617 | }
|
618 | DefaultDomRenderer2.prototype.destroy = function () { };
|
619 | DefaultDomRenderer2.prototype.createElement = function (name, namespace) {
|
620 | if (namespace) {
|
621 |
|
622 |
|
623 | return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
|
624 | }
|
625 | return document.createElement(name);
|
626 | };
|
627 | DefaultDomRenderer2.prototype.createComment = function (value) { return document.createComment(value); };
|
628 | DefaultDomRenderer2.prototype.createText = function (value) { return document.createTextNode(value); };
|
629 | DefaultDomRenderer2.prototype.appendChild = function (parent, newChild) { parent.appendChild(newChild); };
|
630 | DefaultDomRenderer2.prototype.insertBefore = function (parent, newChild, refChild) {
|
631 | if (parent) {
|
632 | parent.insertBefore(newChild, refChild);
|
633 | }
|
634 | };
|
635 | DefaultDomRenderer2.prototype.removeChild = function (parent, oldChild) {
|
636 | if (parent) {
|
637 | parent.removeChild(oldChild);
|
638 | }
|
639 | };
|
640 | DefaultDomRenderer2.prototype.selectRootElement = function (selectorOrNode, preserveContent) {
|
641 | var el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
|
642 | selectorOrNode;
|
643 | if (!el) {
|
644 | throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements");
|
645 | }
|
646 | if (!preserveContent) {
|
647 | el.textContent = '';
|
648 | }
|
649 | return el;
|
650 | };
|
651 | DefaultDomRenderer2.prototype.parentNode = function (node) { return node.parentNode; };
|
652 | DefaultDomRenderer2.prototype.nextSibling = function (node) { return node.nextSibling; };
|
653 | DefaultDomRenderer2.prototype.setAttribute = function (el, name, value, namespace) {
|
654 | if (namespace) {
|
655 | name = namespace + ':' + name;
|
656 |
|
657 |
|
658 | var namespaceUri = NAMESPACE_URIS[namespace];
|
659 | if (namespaceUri) {
|
660 | el.setAttributeNS(namespaceUri, name, value);
|
661 | }
|
662 | else {
|
663 | el.setAttribute(name, value);
|
664 | }
|
665 | }
|
666 | else {
|
667 | el.setAttribute(name, value);
|
668 | }
|
669 | };
|
670 | DefaultDomRenderer2.prototype.removeAttribute = function (el, name, namespace) {
|
671 | if (namespace) {
|
672 |
|
673 |
|
674 | var namespaceUri = NAMESPACE_URIS[namespace];
|
675 | if (namespaceUri) {
|
676 | el.removeAttributeNS(namespaceUri, name);
|
677 | }
|
678 | else {
|
679 |
|
680 |
|
681 |
|
682 | el.removeAttribute(namespace + ":" + name);
|
683 | }
|
684 | }
|
685 | else {
|
686 | el.removeAttribute(name);
|
687 | }
|
688 | };
|
689 | DefaultDomRenderer2.prototype.addClass = function (el, name) { el.classList.add(name); };
|
690 | DefaultDomRenderer2.prototype.removeClass = function (el, name) { el.classList.remove(name); };
|
691 | DefaultDomRenderer2.prototype.setStyle = function (el, style, value, flags) {
|
692 | if (flags & RendererStyleFlags2.DashCase) {
|
693 | el.style.setProperty(style, value, !!(flags & RendererStyleFlags2.Important) ? 'important' : '');
|
694 | }
|
695 | else {
|
696 | el.style[style] = value;
|
697 | }
|
698 | };
|
699 | DefaultDomRenderer2.prototype.removeStyle = function (el, style, flags) {
|
700 | if (flags & RendererStyleFlags2.DashCase) {
|
701 | el.style.removeProperty(style);
|
702 | }
|
703 | else {
|
704 |
|
705 |
|
706 | el.style[style] = '';
|
707 | }
|
708 | };
|
709 | DefaultDomRenderer2.prototype.setProperty = function (el, name, value) {
|
710 | NG_DEV_MODE && checkNoSyntheticProp(name, 'property');
|
711 | el[name] = value;
|
712 | };
|
713 | DefaultDomRenderer2.prototype.setValue = function (node, value) { node.nodeValue = value; };
|
714 | DefaultDomRenderer2.prototype.listen = function (target, event, callback) {
|
715 | NG_DEV_MODE && checkNoSyntheticProp(event, 'listener');
|
716 | if (typeof target === 'string') {
|
717 | return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback));
|
718 | }
|
719 | return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback));
|
720 | };
|
721 | return DefaultDomRenderer2;
|
722 | }());
|
723 | var ɵ0$2 = function () { return '@'.charCodeAt(0); };
|
724 | var AT_CHARCODE = (ɵ0$2)();
|
725 | function checkNoSyntheticProp(name, nameKind) {
|
726 | if (name.charCodeAt(0) === AT_CHARCODE) {
|
727 | throw new Error("Found the synthetic " + nameKind + " " + name + ". Please include either \"BrowserAnimationsModule\" or \"NoopAnimationsModule\" in your application.");
|
728 | }
|
729 | }
|
730 | var EmulatedEncapsulationDomRenderer2 = (function (_super) {
|
731 | __extends(EmulatedEncapsulationDomRenderer2, _super);
|
732 | function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component, appId) {
|
733 | var _this = _super.call(this, eventManager) || this;
|
734 | _this.component = component;
|
735 | var styles = flattenStyles(appId + '-' + component.id, component.styles, []);
|
736 | sharedStylesHost.addStyles(styles);
|
737 | _this.contentAttr = shimContentAttribute(appId + '-' + component.id);
|
738 | _this.hostAttr = shimHostAttribute(appId + '-' + component.id);
|
739 | return _this;
|
740 | }
|
741 | EmulatedEncapsulationDomRenderer2.prototype.applyToHost = function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };
|
742 | EmulatedEncapsulationDomRenderer2.prototype.createElement = function (parent, name) {
|
743 | var el = _super.prototype.createElement.call(this, parent, name);
|
744 | _super.prototype.setAttribute.call(this, el, this.contentAttr, '');
|
745 | return el;
|
746 | };
|
747 | return EmulatedEncapsulationDomRenderer2;
|
748 | }(DefaultDomRenderer2));
|
749 | var ShadowDomRenderer = (function (_super) {
|
750 | __extends(ShadowDomRenderer, _super);
|
751 | function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {
|
752 | var _this = _super.call(this, eventManager) || this;
|
753 | _this.sharedStylesHost = sharedStylesHost;
|
754 | _this.hostEl = hostEl;
|
755 | _this.component = component;
|
756 | if (component.encapsulation === ViewEncapsulation.ShadowDom) {
|
757 | _this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
|
758 | }
|
759 | else {
|
760 | _this.shadowRoot = hostEl.createShadowRoot();
|
761 | }
|
762 | _this.sharedStylesHost.addHost(_this.shadowRoot);
|
763 | var styles = flattenStyles(component.id, component.styles, []);
|
764 | for (var i = 0; i < styles.length; i++) {
|
765 | var styleEl = document.createElement('style');
|
766 | styleEl.textContent = styles[i];
|
767 | _this.shadowRoot.appendChild(styleEl);
|
768 | }
|
769 | return _this;
|
770 | }
|
771 | ShadowDomRenderer.prototype.nodeOrShadowRoot = function (node) { return node === this.hostEl ? this.shadowRoot : node; };
|
772 | ShadowDomRenderer.prototype.destroy = function () { this.sharedStylesHost.removeHost(this.shadowRoot); };
|
773 | ShadowDomRenderer.prototype.appendChild = function (parent, newChild) {
|
774 | return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);
|
775 | };
|
776 | ShadowDomRenderer.prototype.insertBefore = function (parent, newChild, refChild) {
|
777 | return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);
|
778 | };
|
779 | ShadowDomRenderer.prototype.removeChild = function (parent, oldChild) {
|
780 | return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);
|
781 | };
|
782 | ShadowDomRenderer.prototype.parentNode = function (node) {
|
783 | return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));
|
784 | };
|
785 | return ShadowDomRenderer;
|
786 | }(DefaultDomRenderer2));
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 | var DomEventsPlugin = (function (_super) {
|
796 | __extends(DomEventsPlugin, _super);
|
797 | function DomEventsPlugin(doc) {
|
798 | return _super.call(this, doc) || this;
|
799 | }
|
800 |
|
801 |
|
802 | DomEventsPlugin.prototype.supports = function (eventName) { return true; };
|
803 | DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
|
804 | var _this = this;
|
805 | element.addEventListener(eventName, handler, false);
|
806 | return function () { return _this.removeEventListener(element, eventName, handler); };
|
807 | };
|
808 | DomEventsPlugin.prototype.removeEventListener = function (target, eventName, callback) {
|
809 | return target.removeEventListener(eventName, callback);
|
810 | };
|
811 | DomEventsPlugin = __decorate([
|
812 | Injectable(),
|
813 | __param(0, Inject(DOCUMENT)),
|
814 | __metadata("design:paramtypes", [Object])
|
815 | ], DomEventsPlugin);
|
816 | return DomEventsPlugin;
|
817 | }(EventManagerPlugin));
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 | var EVENT_NAMES = {
|
830 |
|
831 | 'pan': true,
|
832 | 'panstart': true,
|
833 | 'panmove': true,
|
834 | 'panend': true,
|
835 | 'pancancel': true,
|
836 | 'panleft': true,
|
837 | 'panright': true,
|
838 | 'panup': true,
|
839 | 'pandown': true,
|
840 |
|
841 | 'pinch': true,
|
842 | 'pinchstart': true,
|
843 | 'pinchmove': true,
|
844 | 'pinchend': true,
|
845 | 'pinchcancel': true,
|
846 | 'pinchin': true,
|
847 | 'pinchout': true,
|
848 |
|
849 | 'press': true,
|
850 | 'pressup': true,
|
851 |
|
852 | 'rotate': true,
|
853 | 'rotatestart': true,
|
854 | 'rotatemove': true,
|
855 | 'rotateend': true,
|
856 | 'rotatecancel': true,
|
857 |
|
858 | 'swipe': true,
|
859 | 'swipeleft': true,
|
860 | 'swiperight': true,
|
861 | 'swipeup': true,
|
862 | 'swipedown': true,
|
863 |
|
864 | 'tap': true,
|
865 | };
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 | var HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 | var HAMMER_LOADER = new InjectionToken('HammerLoader');
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 | var HammerGestureConfig = (function () {
|
886 | function HammerGestureConfig() {
|
887 | |
888 |
|
889 |
|
890 |
|
891 |
|
892 | this.events = [];
|
893 | |
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 | this.overrides = {};
|
910 | }
|
911 | |
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 | HammerGestureConfig.prototype.buildHammer = function (element) {
|
918 | var mc = new Hammer(element, this.options);
|
919 | mc.get('pinch').set({ enable: true });
|
920 | mc.get('rotate').set({ enable: true });
|
921 | for (var eventName in this.overrides) {
|
922 | mc.get(eventName).set(this.overrides[eventName]);
|
923 | }
|
924 | return mc;
|
925 | };
|
926 | HammerGestureConfig = __decorate([
|
927 | Injectable()
|
928 | ], HammerGestureConfig);
|
929 | return HammerGestureConfig;
|
930 | }());
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 | var HammerGesturesPlugin = (function (_super) {
|
937 | __extends(HammerGesturesPlugin, _super);
|
938 | function HammerGesturesPlugin(doc, _config, console, loader) {
|
939 | var _this = _super.call(this, doc) || this;
|
940 | _this._config = _config;
|
941 | _this.console = console;
|
942 | _this.loader = loader;
|
943 | return _this;
|
944 | }
|
945 | HammerGesturesPlugin.prototype.supports = function (eventName) {
|
946 | if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
|
947 | return false;
|
948 | }
|
949 | if (!window.Hammer && !this.loader) {
|
950 | this.console.warn("The \"" + eventName + "\" event cannot be bound because Hammer.JS is not " +
|
951 | "loaded and no custom loader has been specified.");
|
952 | return false;
|
953 | }
|
954 | return true;
|
955 | };
|
956 | HammerGesturesPlugin.prototype.addEventListener = function (element, eventName, handler) {
|
957 | var _this = this;
|
958 | var zone = this.manager.getZone();
|
959 | eventName = eventName.toLowerCase();
|
960 |
|
961 |
|
962 | if (!window.Hammer && this.loader) {
|
963 |
|
964 |
|
965 |
|
966 | var cancelRegistration_1 = false;
|
967 | var deregister_1 = function () { cancelRegistration_1 = true; };
|
968 | this.loader()
|
969 | .then(function () {
|
970 |
|
971 | if (!window.Hammer) {
|
972 | _this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present.");
|
973 | deregister_1 = function () { };
|
974 | return;
|
975 | }
|
976 | if (!cancelRegistration_1) {
|
977 |
|
978 |
|
979 | deregister_1 = _this.addEventListener(element, eventName, handler);
|
980 | }
|
981 | })
|
982 | .catch(function () {
|
983 | _this.console.warn("The \"" + eventName + "\" event cannot be bound because the custom " +
|
984 | "Hammer.JS loader failed.");
|
985 | deregister_1 = function () { };
|
986 | });
|
987 |
|
988 |
|
989 |
|
990 | return function () { deregister_1(); };
|
991 | }
|
992 | return zone.runOutsideAngular(function () {
|
993 |
|
994 | var mc = _this._config.buildHammer(element);
|
995 | var callback = function (eventObj) {
|
996 | zone.runGuarded(function () { handler(eventObj); });
|
997 | };
|
998 | mc.on(eventName, callback);
|
999 | return function () {
|
1000 | mc.off(eventName, callback);
|
1001 |
|
1002 | if (typeof mc.destroy === 'function') {
|
1003 | mc.destroy();
|
1004 | }
|
1005 | };
|
1006 | });
|
1007 | };
|
1008 | HammerGesturesPlugin.prototype.isCustomEvent = function (eventName) { return this._config.events.indexOf(eventName) > -1; };
|
1009 | HammerGesturesPlugin = __decorate([
|
1010 | Injectable(),
|
1011 | __param(0, Inject(DOCUMENT)),
|
1012 | __param(1, Inject(HAMMER_GESTURE_CONFIG)),
|
1013 | __param(3, Optional()), __param(3, Inject(HAMMER_LOADER)),
|
1014 | __metadata("design:paramtypes", [Object, HammerGestureConfig, ɵConsole, Object])
|
1015 | ], HammerGesturesPlugin);
|
1016 | return HammerGesturesPlugin;
|
1017 | }(EventManagerPlugin));
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 | var HAMMER_PROVIDERS__POST_R3__ = [];
|
1024 |
|
1025 |
|
1026 |
|
1027 | var HAMMER_PROVIDERS__PRE_R3__ = [
|
1028 | {
|
1029 | provide: EVENT_MANAGER_PLUGINS,
|
1030 | useClass: HammerGesturesPlugin,
|
1031 | multi: true,
|
1032 | deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
|
1033 | },
|
1034 | { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
|
1035 | ];
|
1036 | var HAMMER_PROVIDERS = HAMMER_PROVIDERS__PRE_R3__;
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 | var HammerModule = (function () {
|
1049 | function HammerModule() {
|
1050 | }
|
1051 | HammerModule = __decorate([
|
1052 | NgModule({ providers: HAMMER_PROVIDERS__PRE_R3__ })
|
1053 | ], HammerModule);
|
1054 | return HammerModule;
|
1055 | }());
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 | var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
|
1068 | var DOM_KEY_LOCATION_NUMPAD = 3;
|
1069 |
|
1070 | var _keyMap = {
|
1071 |
|
1072 |
|
1073 | '\b': 'Backspace',
|
1074 | '\t': 'Tab',
|
1075 | '\x7F': 'Delete',
|
1076 | '\x1B': 'Escape',
|
1077 | 'Del': 'Delete',
|
1078 | 'Esc': 'Escape',
|
1079 | 'Left': 'ArrowLeft',
|
1080 | 'Right': 'ArrowRight',
|
1081 | 'Up': 'ArrowUp',
|
1082 | 'Down': 'ArrowDown',
|
1083 | 'Menu': 'ContextMenu',
|
1084 | 'Scroll': 'ScrollLock',
|
1085 | 'Win': 'OS'
|
1086 | };
|
1087 |
|
1088 |
|
1089 |
|
1090 | var _chromeNumKeyPadMap = {
|
1091 | 'A': '1',
|
1092 | 'B': '2',
|
1093 | 'C': '3',
|
1094 | 'D': '4',
|
1095 | 'E': '5',
|
1096 | 'F': '6',
|
1097 | 'G': '7',
|
1098 | 'H': '8',
|
1099 | 'I': '9',
|
1100 | 'J': '*',
|
1101 | 'K': '+',
|
1102 | 'M': '-',
|
1103 | 'N': '.',
|
1104 | 'O': '/',
|
1105 | '\x60': '0',
|
1106 | '\x90': 'NumLock'
|
1107 | };
|
1108 | var ɵ0$3 = function (event) { return event.altKey; }, ɵ1 = function (event) { return event.ctrlKey; }, ɵ2 = function (event) { return event.metaKey; }, ɵ3 = function (event) { return event.shiftKey; };
|
1109 |
|
1110 |
|
1111 |
|
1112 | var MODIFIER_KEY_GETTERS = {
|
1113 | 'alt': ɵ0$3,
|
1114 | 'control': ɵ1,
|
1115 | 'meta': ɵ2,
|
1116 | 'shift': ɵ3
|
1117 | };
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 | var KeyEventsPlugin = (function (_super) {
|
1123 | __extends(KeyEventsPlugin, _super);
|
1124 | |
1125 |
|
1126 |
|
1127 |
|
1128 | function KeyEventsPlugin(doc) {
|
1129 | return _super.call(this, doc) || this;
|
1130 | }
|
1131 | KeyEventsPlugin_1 = KeyEventsPlugin;
|
1132 | |
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 | KeyEventsPlugin.prototype.supports = function (eventName) { return KeyEventsPlugin_1.parseEventName(eventName) != null; };
|
1138 | |
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 | KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) {
|
1147 | var parsedEvent = KeyEventsPlugin_1.parseEventName(eventName);
|
1148 | var outsideHandler = KeyEventsPlugin_1.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
|
1149 | return this.manager.getZone().runOutsideAngular(function () {
|
1150 | return ɵgetDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
|
1151 | });
|
1152 | };
|
1153 | KeyEventsPlugin.parseEventName = function (eventName) {
|
1154 | var parts = eventName.toLowerCase().split('.');
|
1155 | var domEventName = parts.shift();
|
1156 | if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
|
1157 | return null;
|
1158 | }
|
1159 | var key = KeyEventsPlugin_1._normalizeKey(parts.pop());
|
1160 | var fullKey = '';
|
1161 | MODIFIER_KEYS.forEach(function (modifierName) {
|
1162 | var index = parts.indexOf(modifierName);
|
1163 | if (index > -1) {
|
1164 | parts.splice(index, 1);
|
1165 | fullKey += modifierName + '.';
|
1166 | }
|
1167 | });
|
1168 | fullKey += key;
|
1169 | if (parts.length != 0 || key.length === 0) {
|
1170 |
|
1171 | return null;
|
1172 | }
|
1173 | var result = {};
|
1174 | result['domEventName'] = domEventName;
|
1175 | result['fullKey'] = fullKey;
|
1176 | return result;
|
1177 | };
|
1178 | KeyEventsPlugin.getEventFullKey = function (event) {
|
1179 | var fullKey = '';
|
1180 | var key = getEventKey(event);
|
1181 | key = key.toLowerCase();
|
1182 | if (key === ' ') {
|
1183 | key = 'space';
|
1184 | }
|
1185 | else if (key === '.') {
|
1186 | key = 'dot';
|
1187 | }
|
1188 | MODIFIER_KEYS.forEach(function (modifierName) {
|
1189 | if (modifierName != key) {
|
1190 | var modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
|
1191 | if (modifierGetter(event)) {
|
1192 | fullKey += modifierName + '.';
|
1193 | }
|
1194 | }
|
1195 | });
|
1196 | fullKey += key;
|
1197 | return fullKey;
|
1198 | };
|
1199 | |
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 | KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) {
|
1207 | return function (event /** TODO #9100 */) {
|
1208 | if (KeyEventsPlugin_1.getEventFullKey(event) === fullKey) {
|
1209 | zone.runGuarded(function () { return handler(event); });
|
1210 | }
|
1211 | };
|
1212 | };
|
1213 |
|
1214 | KeyEventsPlugin._normalizeKey = function (keyName) {
|
1215 |
|
1216 | switch (keyName) {
|
1217 | case 'esc':
|
1218 | return 'escape';
|
1219 | default:
|
1220 | return keyName;
|
1221 | }
|
1222 | };
|
1223 | var KeyEventsPlugin_1;
|
1224 | KeyEventsPlugin = KeyEventsPlugin_1 = __decorate([
|
1225 | Injectable(),
|
1226 | __param(0, Inject(DOCUMENT)),
|
1227 | __metadata("design:paramtypes", [Object])
|
1228 | ], KeyEventsPlugin);
|
1229 | return KeyEventsPlugin;
|
1230 | }(EventManagerPlugin));
|
1231 | function getEventKey(event) {
|
1232 | var key = event.key;
|
1233 | if (key == null) {
|
1234 | key = event.keyIdentifier;
|
1235 |
|
1236 |
|
1237 |
|
1238 | if (key == null) {
|
1239 | return 'Unidentified';
|
1240 | }
|
1241 | if (key.startsWith('U+')) {
|
1242 | key = String.fromCharCode(parseInt(key.substring(2), 16));
|
1243 | if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
|
1244 |
|
1245 |
|
1246 |
|
1247 | key = _chromeNumKeyPadMap[key];
|
1248 | }
|
1249 | }
|
1250 | }
|
1251 | return _keyMap[key] || key;
|
1252 | }
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 | var DomSanitizer = (function () {
|
1286 | function DomSanitizer() {
|
1287 | }
|
1288 | DomSanitizer.ɵprov = ɵɵdefineInjectable({ factory: function DomSanitizer_Factory() { return ɵɵinject(DomSanitizerImpl); }, token: DomSanitizer, providedIn: "root" });
|
1289 | DomSanitizer = __decorate([
|
1290 | Injectable({ providedIn: 'root', useExisting: forwardRef(function () { return DomSanitizerImpl; }) })
|
1291 | ], DomSanitizer);
|
1292 | return DomSanitizer;
|
1293 | }());
|
1294 | function domSanitizerImplFactory(injector) {
|
1295 | return new DomSanitizerImpl(injector.get(DOCUMENT));
|
1296 | }
|
1297 | var DomSanitizerImpl = (function (_super) {
|
1298 | __extends(DomSanitizerImpl, _super);
|
1299 | function DomSanitizerImpl(_doc) {
|
1300 | var _this = _super.call(this) || this;
|
1301 | _this._doc = _doc;
|
1302 | return _this;
|
1303 | }
|
1304 | DomSanitizerImpl.prototype.sanitize = function (ctx, value) {
|
1305 | if (value == null)
|
1306 | return null;
|
1307 | switch (ctx) {
|
1308 | case SecurityContext.NONE:
|
1309 | return value;
|
1310 | case SecurityContext.HTML:
|
1311 | if (ɵallowSanitizationBypassAndThrow(value, "HTML" )) {
|
1312 | return ɵunwrapSafeValue(value);
|
1313 | }
|
1314 | return ɵ_sanitizeHtml(this._doc, String(value));
|
1315 | case SecurityContext.STYLE:
|
1316 | if (ɵallowSanitizationBypassAndThrow(value, "Style" )) {
|
1317 | return ɵunwrapSafeValue(value);
|
1318 | }
|
1319 | return ɵ_sanitizeStyle(value);
|
1320 | case SecurityContext.SCRIPT:
|
1321 | if (ɵallowSanitizationBypassAndThrow(value, "Script" )) {
|
1322 | return ɵunwrapSafeValue(value);
|
1323 | }
|
1324 | throw new Error('unsafe value used in a script context');
|
1325 | case SecurityContext.URL:
|
1326 | var type = ɵgetSanitizationBypassType(value);
|
1327 | if (ɵallowSanitizationBypassAndThrow(value, "URL" )) {
|
1328 | return ɵunwrapSafeValue(value);
|
1329 | }
|
1330 | return ɵ_sanitizeUrl(String(value));
|
1331 | case SecurityContext.RESOURCE_URL:
|
1332 | if (ɵallowSanitizationBypassAndThrow(value, "ResourceURL" )) {
|
1333 | return ɵunwrapSafeValue(value);
|
1334 | }
|
1335 | throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
|
1336 | default:
|
1337 | throw new Error("Unexpected SecurityContext " + ctx + " (see http://g.co/ng/security#xss)");
|
1338 | }
|
1339 | };
|
1340 | DomSanitizerImpl.prototype.bypassSecurityTrustHtml = function (value) { return ɵbypassSanitizationTrustHtml(value); };
|
1341 | DomSanitizerImpl.prototype.bypassSecurityTrustStyle = function (value) { return ɵbypassSanitizationTrustStyle(value); };
|
1342 | DomSanitizerImpl.prototype.bypassSecurityTrustScript = function (value) {
|
1343 | return ɵbypassSanitizationTrustScript(value);
|
1344 | };
|
1345 | DomSanitizerImpl.prototype.bypassSecurityTrustUrl = function (value) { return ɵbypassSanitizationTrustUrl(value); };
|
1346 | DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = function (value) {
|
1347 | return ɵbypassSanitizationTrustResourceUrl(value);
|
1348 | };
|
1349 | DomSanitizerImpl.ɵprov = ɵɵdefineInjectable({ factory: function DomSanitizerImpl_Factory() { return domSanitizerImplFactory(ɵɵinject(INJECTOR)); }, token: DomSanitizerImpl, providedIn: "root" });
|
1350 | DomSanitizerImpl = __decorate([
|
1351 | Injectable({ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector] }),
|
1352 | __param(0, Inject(DOCUMENT)),
|
1353 | __metadata("design:paramtypes", [Object])
|
1354 | ], DomSanitizerImpl);
|
1355 | return DomSanitizerImpl;
|
1356 | }(DomSanitizer));
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 |
|
1362 |
|
1363 |
|
1364 |
|
1365 | function initDomAdapter() {
|
1366 | BrowserDomAdapter.makeCurrent();
|
1367 | BrowserGetTestability.init();
|
1368 | }
|
1369 | function errorHandler() {
|
1370 | return new ErrorHandler();
|
1371 | }
|
1372 | function _document() {
|
1373 |
|
1374 | ɵsetDocument(document);
|
1375 | return document;
|
1376 | }
|
1377 | var ɵ0$4 = ɵPLATFORM_BROWSER_ID;
|
1378 | var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
|
1379 | { provide: PLATFORM_ID, useValue: ɵ0$4 },
|
1380 | { provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
|
1381 | { provide: DOCUMENT, useFactory: _document, deps: [] },
|
1382 | ];
|
1383 | var BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [
|
1384 | { provide: Sanitizer, useExisting: DomSanitizer },
|
1385 | { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT] },
|
1386 | ];
|
1387 | var BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = [];
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 | var BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__PRE_R3__;
|
1395 |
|
1396 |
|
1397 |
|
1398 | var platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
|
1399 | var BROWSER_MODULE_PROVIDERS = [
|
1400 | BROWSER_SANITIZATION_PROVIDERS,
|
1401 | { provide: ɵINJECTOR_SCOPE, useValue: 'root' },
|
1402 | { provide: ErrorHandler, useFactory: errorHandler, deps: [] },
|
1403 | {
|
1404 | provide: EVENT_MANAGER_PLUGINS,
|
1405 | useClass: DomEventsPlugin,
|
1406 | multi: true,
|
1407 | deps: [DOCUMENT, NgZone, PLATFORM_ID]
|
1408 | },
|
1409 | { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
|
1410 | HAMMER_PROVIDERS,
|
1411 | {
|
1412 | provide: DomRendererFactory2,
|
1413 | useClass: DomRendererFactory2,
|
1414 | deps: [EventManager, DomSharedStylesHost, APP_ID]
|
1415 | },
|
1416 | { provide: RendererFactory2, useExisting: DomRendererFactory2 },
|
1417 | { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
|
1418 | { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
|
1419 | { provide: Testability, useClass: Testability, deps: [NgZone] },
|
1420 | { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
|
1421 | ELEMENT_PROBE_PROVIDERS,
|
1422 | ];
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 | var BrowserModule = (function () {
|
1433 | function BrowserModule(parentModule) {
|
1434 | if (parentModule) {
|
1435 | throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.");
|
1436 | }
|
1437 | }
|
1438 | BrowserModule_1 = BrowserModule;
|
1439 | |
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 | BrowserModule.withServerTransition = function (params) {
|
1448 | return {
|
1449 | ngModule: BrowserModule_1,
|
1450 | providers: [
|
1451 | { provide: APP_ID, useValue: params.appId },
|
1452 | { provide: TRANSITION_ID, useExisting: APP_ID },
|
1453 | SERVER_TRANSITION_PROVIDERS,
|
1454 | ],
|
1455 | };
|
1456 | };
|
1457 | var BrowserModule_1;
|
1458 | BrowserModule = BrowserModule_1 = __decorate([
|
1459 | NgModule({ providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule] }),
|
1460 | __param(0, Optional()), __param(0, SkipSelf()), __param(0, Inject(BrowserModule_1)),
|
1461 | __metadata("design:paramtypes", [Object])
|
1462 | ], BrowserModule);
|
1463 | return BrowserModule;
|
1464 | }());
|
1465 |
|
1466 |
|
1467 |
|
1468 |
|
1469 | function createMeta() {
|
1470 | return new Meta(ɵɵinject(DOCUMENT));
|
1471 | }
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 | var Meta = (function () {
|
1478 | function Meta(_doc) {
|
1479 | this._doc = _doc;
|
1480 | this._dom = ɵgetDOM();
|
1481 | }
|
1482 | Meta.prototype.addTag = function (tag, forceCreation) {
|
1483 | if (forceCreation === void 0) { forceCreation = false; }
|
1484 | if (!tag)
|
1485 | return null;
|
1486 | return this._getOrCreateElement(tag, forceCreation);
|
1487 | };
|
1488 | Meta.prototype.addTags = function (tags, forceCreation) {
|
1489 | var _this = this;
|
1490 | if (forceCreation === void 0) { forceCreation = false; }
|
1491 | if (!tags)
|
1492 | return [];
|
1493 | return tags.reduce(function (result, tag) {
|
1494 | if (tag) {
|
1495 | result.push(_this._getOrCreateElement(tag, forceCreation));
|
1496 | }
|
1497 | return result;
|
1498 | }, []);
|
1499 | };
|
1500 | Meta.prototype.getTag = function (attrSelector) {
|
1501 | if (!attrSelector)
|
1502 | return null;
|
1503 | return this._doc.querySelector("meta[" + attrSelector + "]") || null;
|
1504 | };
|
1505 | Meta.prototype.getTags = function (attrSelector) {
|
1506 | if (!attrSelector)
|
1507 | return [];
|
1508 | var list = this._doc.querySelectorAll("meta[" + attrSelector + "]");
|
1509 | return list ? [].slice.call(list) : [];
|
1510 | };
|
1511 | Meta.prototype.updateTag = function (tag, selector) {
|
1512 | if (!tag)
|
1513 | return null;
|
1514 | selector = selector || this._parseSelector(tag);
|
1515 | var meta = this.getTag(selector);
|
1516 | if (meta) {
|
1517 | return this._setMetaElementAttributes(tag, meta);
|
1518 | }
|
1519 | return this._getOrCreateElement(tag, true);
|
1520 | };
|
1521 | Meta.prototype.removeTag = function (attrSelector) { this.removeTagElement(this.getTag(attrSelector)); };
|
1522 | Meta.prototype.removeTagElement = function (meta) {
|
1523 | if (meta) {
|
1524 | this._dom.remove(meta);
|
1525 | }
|
1526 | };
|
1527 | Meta.prototype._getOrCreateElement = function (meta, forceCreation) {
|
1528 | if (forceCreation === void 0) { forceCreation = false; }
|
1529 | if (!forceCreation) {
|
1530 | var selector = this._parseSelector(meta);
|
1531 | var elem = this.getTag(selector);
|
1532 |
|
1533 |
|
1534 |
|
1535 | if (elem && this._containsAttributes(meta, elem))
|
1536 | return elem;
|
1537 | }
|
1538 | var element = this._dom.createElement('meta');
|
1539 | this._setMetaElementAttributes(meta, element);
|
1540 | var head = this._doc.getElementsByTagName('head')[0];
|
1541 | head.appendChild(element);
|
1542 | return element;
|
1543 | };
|
1544 | Meta.prototype._setMetaElementAttributes = function (tag, el) {
|
1545 | Object.keys(tag).forEach(function (prop) { return el.setAttribute(prop, tag[prop]); });
|
1546 | return el;
|
1547 | };
|
1548 | Meta.prototype._parseSelector = function (tag) {
|
1549 | var attr = tag.name ? 'name' : 'property';
|
1550 | return attr + "=\"" + tag[attr] + "\"";
|
1551 | };
|
1552 | Meta.prototype._containsAttributes = function (tag, elem) {
|
1553 | return Object.keys(tag).every(function (key) { return elem.getAttribute(key) === tag[key]; });
|
1554 | };
|
1555 | Meta.ɵprov = ɵɵdefineInjectable({ factory: createMeta, token: Meta, providedIn: "root" });
|
1556 | Meta = __decorate([
|
1557 | Injectable({ providedIn: 'root', useFactory: createMeta, deps: [] }),
|
1558 | __param(0, Inject(DOCUMENT)),
|
1559 | __metadata("design:paramtypes", [Object])
|
1560 | ], Meta);
|
1561 | return Meta;
|
1562 | }());
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 | function createTitle() {
|
1568 | return new Title(ɵɵinject(DOCUMENT));
|
1569 | }
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 |
|
1578 |
|
1579 |
|
1580 | var Title = (function () {
|
1581 | function Title(_doc) {
|
1582 | this._doc = _doc;
|
1583 | }
|
1584 | |
1585 |
|
1586 |
|
1587 | Title.prototype.getTitle = function () { return this._doc.title; };
|
1588 | |
1589 |
|
1590 |
|
1591 |
|
1592 | Title.prototype.setTitle = function (newTitle) { this._doc.title = newTitle || ''; };
|
1593 | Title.ɵprov = ɵɵdefineInjectable({ factory: createTitle, token: Title, providedIn: "root" });
|
1594 | Title = __decorate([
|
1595 | Injectable({ providedIn: 'root', useFactory: createTitle, deps: [] }),
|
1596 | __param(0, Inject(DOCUMENT)),
|
1597 | __metadata("design:paramtypes", [Object])
|
1598 | ], Title);
|
1599 | return Title;
|
1600 | }());
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 | var win = typeof window !== 'undefined' && window || {};
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 | var ChangeDetectionPerfRecord = (function () {
|
1619 | function ChangeDetectionPerfRecord(msPerTick, numTicks) {
|
1620 | this.msPerTick = msPerTick;
|
1621 | this.numTicks = numTicks;
|
1622 | }
|
1623 | return ChangeDetectionPerfRecord;
|
1624 | }());
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 | var AngularProfiler = (function () {
|
1630 | function AngularProfiler(ref) {
|
1631 | this.appRef = ref.injector.get(ApplicationRef);
|
1632 | }
|
1633 |
|
1634 | |
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 | AngularProfiler.prototype.timeChangeDetection = function (config) {
|
1651 | var record = config && config['record'];
|
1652 | var profileName = 'Change Detection';
|
1653 |
|
1654 | var isProfilerAvailable = win.console.profile != null;
|
1655 | if (record && isProfilerAvailable) {
|
1656 | win.console.profile(profileName);
|
1657 | }
|
1658 | var start = ɵgetDOM().performanceNow();
|
1659 | var numTicks = 0;
|
1660 | while (numTicks < 5 || (ɵgetDOM().performanceNow() - start) < 500) {
|
1661 | this.appRef.tick();
|
1662 | numTicks++;
|
1663 | }
|
1664 | var end = ɵgetDOM().performanceNow();
|
1665 | if (record && isProfilerAvailable) {
|
1666 | win.console.profileEnd(profileName);
|
1667 | }
|
1668 | var msPerTick = (end - start) / numTicks;
|
1669 | win.console.log("ran " + numTicks + " change detection cycles");
|
1670 | win.console.log(msPerTick.toFixed(2) + " ms per check");
|
1671 | return new ChangeDetectionPerfRecord(msPerTick, numTicks);
|
1672 | };
|
1673 | return AngularProfiler;
|
1674 | }());
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 | var PROFILER_GLOBAL_NAME = 'profiler';
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 | function enableDebugTools(ref) {
|
1698 | exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
|
1699 | return ref;
|
1700 | }
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 | function disableDebugTools() {
|
1707 | exportNgVar(PROFILER_GLOBAL_NAME, null);
|
1708 | }
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 | function escapeHtml(text) {
|
1718 | var escapedText = {
|
1719 | '&': '&a;',
|
1720 | '"': '&q;',
|
1721 | '\'': '&s;',
|
1722 | '<': '&l;',
|
1723 | '>': '&g;',
|
1724 | };
|
1725 | return text.replace(/[&"'<>]/g, function (s) { return escapedText[s]; });
|
1726 | }
|
1727 | function unescapeHtml(text) {
|
1728 | var unescapedText = {
|
1729 | '&a;': '&',
|
1730 | '&q;': '"',
|
1731 | '&s;': '\'',
|
1732 | '&l;': '<',
|
1733 | '&g;': '>',
|
1734 | };
|
1735 | return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });
|
1736 | }
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 | function makeStateKey(key) {
|
1752 | return key;
|
1753 | }
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 | var TransferState = (function () {
|
1768 | function TransferState() {
|
1769 | this.store = {};
|
1770 | this.onSerializeCallbacks = {};
|
1771 | }
|
1772 | TransferState_1 = TransferState;
|
1773 |
|
1774 | TransferState.init = function (initState) {
|
1775 | var transferState = new TransferState_1();
|
1776 | transferState.store = initState;
|
1777 | return transferState;
|
1778 | };
|
1779 | |
1780 |
|
1781 |
|
1782 | TransferState.prototype.get = function (key, defaultValue) {
|
1783 | return this.store[key] !== undefined ? this.store[key] : defaultValue;
|
1784 | };
|
1785 | |
1786 |
|
1787 |
|
1788 | TransferState.prototype.set = function (key, value) { this.store[key] = value; };
|
1789 | |
1790 |
|
1791 |
|
1792 | TransferState.prototype.remove = function (key) { delete this.store[key]; };
|
1793 | |
1794 |
|
1795 |
|
1796 | TransferState.prototype.hasKey = function (key) { return this.store.hasOwnProperty(key); };
|
1797 | |
1798 |
|
1799 |
|
1800 | TransferState.prototype.onSerialize = function (key, callback) {
|
1801 | this.onSerializeCallbacks[key] = callback;
|
1802 | };
|
1803 | |
1804 |
|
1805 |
|
1806 | TransferState.prototype.toJson = function () {
|
1807 |
|
1808 | for (var key in this.onSerializeCallbacks) {
|
1809 | if (this.onSerializeCallbacks.hasOwnProperty(key)) {
|
1810 | try {
|
1811 | this.store[key] = this.onSerializeCallbacks[key]();
|
1812 | }
|
1813 | catch (e) {
|
1814 | console.warn('Exception in onSerialize callback: ', e);
|
1815 | }
|
1816 | }
|
1817 | }
|
1818 | return JSON.stringify(this.store);
|
1819 | };
|
1820 | var TransferState_1;
|
1821 | TransferState = TransferState_1 = __decorate([
|
1822 | Injectable()
|
1823 | ], TransferState);
|
1824 | return TransferState;
|
1825 | }());
|
1826 | function initTransferState(doc, appId) {
|
1827 |
|
1828 |
|
1829 | var script = doc.getElementById(appId + '-state');
|
1830 | var initialState = {};
|
1831 | if (script && script.textContent) {
|
1832 | try {
|
1833 | initialState = JSON.parse(unescapeHtml(script.textContent));
|
1834 | }
|
1835 | catch (e) {
|
1836 | console.warn('Exception while restoring TransferState for app ' + appId, e);
|
1837 | }
|
1838 | }
|
1839 | return TransferState.init(initialState);
|
1840 | }
|
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 | var BrowserTransferStateModule = (function () {
|
1848 | function BrowserTransferStateModule() {
|
1849 | }
|
1850 | BrowserTransferStateModule = __decorate([
|
1851 | NgModule({
|
1852 | providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }],
|
1853 | })
|
1854 | ], BrowserTransferStateModule);
|
1855 | return BrowserTransferStateModule;
|
1856 | }());
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 | var By = (function () {
|
1871 | function By() {
|
1872 | }
|
1873 | |
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 | By.all = function () { return function () { return true; }; };
|
1882 | |
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 | By.css = function (selector) {
|
1891 | return function (debugElement) {
|
1892 | return debugElement.nativeElement != null ?
|
1893 | elementMatches(debugElement.nativeElement, selector) :
|
1894 | false;
|
1895 | };
|
1896 | };
|
1897 | |
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 | By.directive = function (type) {
|
1906 | return function (debugNode) { return debugNode.providerTokens.indexOf(type) !== -1; };
|
1907 | };
|
1908 | return By;
|
1909 | }());
|
1910 | function elementMatches(n, selector) {
|
1911 | if (ɵgetDOM().isElementNode(n)) {
|
1912 | return n.matches && n.matches(selector) ||
|
1913 | n.msMatchesSelector && n.msMatchesSelector(selector) ||
|
1914 | n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
|
1915 | }
|
1916 | return false;
|
1917 | }
|
1918 |
|
1919 |
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 |
|
1936 |
|
1937 | var VERSION = new Version('9.0.5');
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 |
|
1947 |
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 |
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 | export { BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, BROWSER_SANITIZATION_PROVIDERS as ɵBROWSER_SANITIZATION_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS__POST_R3__ as ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, DomSharedStylesHost as ɵDomSharedStylesHost, ELEMENT_PROBE_PROVIDERS as ɵELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS__POST_R3__ as ɵELEMENT_PROBE_PROVIDERS__POST_R3__, HAMMER_PROVIDERS__POST_R3__ as ɵHAMMER_PROVIDERS__POST_R3__, 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, errorHandler as ɵangular_packages_platform_browser_platform_browser_a, _document as ɵangular_packages_platform_browser_platform_browser_b, BROWSER_MODULE_PROVIDERS as ɵangular_packages_platform_browser_platform_browser_c, createMeta as ɵangular_packages_platform_browser_platform_browser_d, createTitle as ɵangular_packages_platform_browser_platform_browser_e, initTransferState as ɵangular_packages_platform_browser_platform_browser_f, EventManagerPlugin as ɵangular_packages_platform_browser_platform_browser_g, HAMMER_PROVIDERS__PRE_R3__ as ɵangular_packages_platform_browser_platform_browser_h, HAMMER_PROVIDERS as ɵangular_packages_platform_browser_platform_browser_i, domSanitizerImplFactory as ɵangular_packages_platform_browser_platform_browser_j, appInitializerFactory as ɵangular_packages_platform_browser_platform_browser_k, SERVER_TRANSITION_PROVIDERS as ɵangular_packages_platform_browser_platform_browser_l, _createNgProbeR2 as ɵangular_packages_platform_browser_platform_browser_m, ELEMENT_PROBE_PROVIDERS__PRE_R3__ as ɵangular_packages_platform_browser_platform_browser_n, GenericBrowserDomAdapter as ɵangular_packages_platform_browser_platform_browser_o, escapeHtml as ɵescapeHtml, flattenStyles as ɵflattenStyles, initDomAdapter as ɵinitDomAdapter, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute };
|
1969 |
|