| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-23 22:52:06 +03:00
										 |  |  | import {Injectable, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, ViewEncapsulation} from '@angular/core'; | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-02 15:53:34 -07:00
										 |  |  | import {EventManager} from './events/event_manager'; | 
					
						
							|  |  |  | import {DomSharedStylesHost} from './shared_styles_host'; | 
					
						
							| 
									
										
										
										
											2015-11-17 15:24:36 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  | export const NAMESPACE_URIS: {[ns: string]: string} = { | 
					
						
							| 
									
										
										
										
											2016-06-27 17:26:45 +02:00
										 |  |  |   'svg': 'http://www.w3.org/2000/svg', | 
					
						
							| 
									
										
										
										
											2017-02-20 14:34:15 -08:00
										 |  |  |   'xhtml': 'http://www.w3.org/1999/xhtml', | 
					
						
							| 
									
										
										
										
											2017-03-23 22:52:06 +03:00
										 |  |  |   'xlink': 'http://www.w3.org/1999/xlink', | 
					
						
							|  |  |  |   'xml': 'http://www.w3.org/XML/1998/namespace', | 
					
						
							|  |  |  |   'xmlns': 'http://www.w3.org/2000/xmlns/', | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2015-11-10 15:56:25 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  | const COMPONENT_REGEX = /%COMP%/g; | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  | export const COMPONENT_VARIABLE = '%COMP%'; | 
					
						
							| 
									
										
										
										
											2016-05-20 16:11:49 -07:00
										 |  |  | export const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`; | 
					
						
							|  |  |  | export const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`; | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  | export function shimContentAttribute(componentShortId: string): string { | 
					
						
							| 
									
										
										
										
											2016-10-06 15:10:27 -07:00
										 |  |  |   return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId); | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  | export function shimHostAttribute(componentShortId: string): string { | 
					
						
							| 
									
										
										
										
											2016-10-06 15:10:27 -07:00
										 |  |  |   return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId); | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  | export function flattenStyles( | 
					
						
							|  |  |  |     compId: string, styles: Array<any|any[]>, target: string[]): string[] { | 
					
						
							| 
									
										
										
										
											2016-10-19 13:42:39 -07:00
										 |  |  |   for (let i = 0; i < styles.length; i++) { | 
					
						
							|  |  |  |     let style = styles[i]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (Array.isArray(style)) { | 
					
						
							| 
									
										
										
										
											2016-11-02 16:59:24 -07:00
										 |  |  |       flattenStyles(compId, style, target); | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2016-10-06 15:10:27 -07:00
										 |  |  |       style = style.replace(COMPONENT_REGEX, compId); | 
					
						
							| 
									
										
										
										
											2015-12-02 10:35:51 -08:00
										 |  |  |       target.push(style); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   return target; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-27 23:08:19 -08:00
										 |  |  | function decoratePreventDefault(eventHandler: Function): Function { | 
					
						
							|  |  |  |   return (event: any) => { | 
					
						
							|  |  |  |     const allowDefaultBehavior = eventHandler(event); | 
					
						
							|  |  |  |     if (allowDefaultBehavior === false) { | 
					
						
							|  |  |  |       // TODO(tbosch): move preventDefault into event plugins...
 | 
					
						
							|  |  |  |       event.preventDefault(); | 
					
						
							|  |  |  |       event.returnValue = false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-01-08 12:01:29 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-02-08 14:36:43 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | @Injectable() | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  | export class DomRendererFactory2 implements RendererFactory2 { | 
					
						
							|  |  |  |   private rendererByCompId = new Map<string, Renderer2>(); | 
					
						
							|  |  |  |   private defaultRenderer: Renderer2; | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   constructor(private eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost) { | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  |     this.defaultRenderer = new DefaultDomRenderer2(eventManager); | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-24 09:59:41 -07:00
										 |  |  |   createRenderer(element: any, type: RendererType2|null): Renderer2 { | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |     if (!element || !type) { | 
					
						
							|  |  |  |       return this.defaultRenderer; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     switch (type.encapsulation) { | 
					
						
							|  |  |  |       case ViewEncapsulation.Emulated: { | 
					
						
							|  |  |  |         let renderer = this.rendererByCompId.get(type.id); | 
					
						
							|  |  |  |         if (!renderer) { | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  |           renderer = | 
					
						
							|  |  |  |               new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type); | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |           this.rendererByCompId.set(type.id, renderer); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  |         (<EmulatedEncapsulationDomRenderer2>renderer).applyToHost(element); | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |         return renderer; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       case ViewEncapsulation.Native: | 
					
						
							|  |  |  |         return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type); | 
					
						
							|  |  |  |       default: { | 
					
						
							|  |  |  |         if (!this.rendererByCompId.has(type.id)) { | 
					
						
							|  |  |  |           const styles = flattenStyles(type.id, type.styles, []); | 
					
						
							|  |  |  |           this.sharedStylesHost.addStyles(styles); | 
					
						
							|  |  |  |           this.rendererByCompId.set(type.id, this.defaultRenderer); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         return this.defaultRenderer; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-05-03 13:17:46 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   begin() {} | 
					
						
							|  |  |  |   end() {} | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  | class DefaultDomRenderer2 implements Renderer2 { | 
					
						
							| 
									
										
										
										
											2017-02-24 12:10:19 -08:00
										 |  |  |   data: {[key: string]: any} = Object.create(null); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   constructor(private eventManager: EventManager) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   destroy(): void {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   destroyNode: null; | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   createElement(name: string, namespace?: string): any { | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     if (namespace) { | 
					
						
							| 
									
										
										
										
											2018-06-06 13:38:21 -07:00
										 |  |  |       return document.createElementNS(NAMESPACE_URIS[namespace], name); | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return document.createElement(name); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   createComment(value: string): any { return document.createComment(value); } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   createText(value: string): any { return document.createTextNode(value); } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   appendChild(parent: any, newChild: any): void { parent.appendChild(newChild); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   insertBefore(parent: any, newChild: any, refChild: any): void { | 
					
						
							|  |  |  |     if (parent) { | 
					
						
							|  |  |  |       parent.insertBefore(newChild, refChild); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-15 08:36:49 -08:00
										 |  |  |   removeChild(parent: any, oldChild: any): void { | 
					
						
							|  |  |  |     if (parent) { | 
					
						
							|  |  |  |       parent.removeChild(oldChild); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   selectRootElement(selectorOrNode: string|any): any { | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     let el: any = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) : | 
					
						
							|  |  |  |                                                        selectorOrNode; | 
					
						
							| 
									
										
										
										
											2017-02-17 08:56:36 -08:00
										 |  |  |     if (!el) { | 
					
						
							|  |  |  |       throw new Error(`The selector "${selectorOrNode}" did not match any elements`); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     el.textContent = ''; | 
					
						
							|  |  |  |     return el; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   parentNode(node: any): any { return node.parentNode; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   nextSibling(node: any): any { return node.nextSibling; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   setAttribute(el: any, name: string, value: string, namespace?: string): void { | 
					
						
							|  |  |  |     if (namespace) { | 
					
						
							| 
									
										
										
										
											2018-06-06 13:38:21 -07:00
										 |  |  |       name = `${namespace}:${name}`; | 
					
						
							|  |  |  |       const namespaceUri = NAMESPACE_URIS[namespace]; | 
					
						
							|  |  |  |       if (namespaceUri) { | 
					
						
							|  |  |  |         el.setAttributeNS(namespaceUri, name, value); | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         el.setAttribute(name, value); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     } else { | 
					
						
							|  |  |  |       el.setAttribute(name, value); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   removeAttribute(el: any, name: string, namespace?: string): void { | 
					
						
							|  |  |  |     if (namespace) { | 
					
						
							| 
									
										
										
										
											2018-06-06 13:38:21 -07:00
										 |  |  |       const namespaceUri = NAMESPACE_URIS[namespace]; | 
					
						
							|  |  |  |       if (namespaceUri) { | 
					
						
							|  |  |  |         el.removeAttributeNS(namespaceUri, name); | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         el.removeAttribute(`${namespace}:${name}`); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     } else { | 
					
						
							|  |  |  |       el.removeAttribute(name); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   addClass(el: any, name: string): void { el.classList.add(name); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   removeClass(el: any, name: string): void { el.classList.remove(name); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-13 09:45:04 -07:00
										 |  |  |   setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void { | 
					
						
							|  |  |  |     if (flags & RendererStyleFlags2.DashCase) { | 
					
						
							|  |  |  |       el.style.setProperty( | 
					
						
							|  |  |  |           style, value, !!(flags & RendererStyleFlags2.Important) ? 'important' : ''); | 
					
						
							| 
									
										
										
										
											2017-02-17 08:56:36 -08:00
										 |  |  |     } else { | 
					
						
							|  |  |  |       el.style[style] = value; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-13 09:45:04 -07:00
										 |  |  |   removeStyle(el: any, style: string, flags: RendererStyleFlags2): void { | 
					
						
							|  |  |  |     if (flags & RendererStyleFlags2.DashCase) { | 
					
						
							| 
									
										
										
										
											2017-02-17 08:56:36 -08:00
										 |  |  |       el.style.removeProperty(style); | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |       // IE requires '' instead of null
 | 
					
						
							|  |  |  |       // see https://github.com/angular/angular/issues/7916
 | 
					
						
							|  |  |  |       el.style[style] = ''; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-06 17:15:08 -08:00
										 |  |  |   setProperty(el: any, name: string, value: any): void { | 
					
						
							|  |  |  |     checkNoSyntheticProp(name, 'property'); | 
					
						
							|  |  |  |     el[name] = value; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   setValue(node: any, value: string): void { node.nodeValue = value; } | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   listen(target: 'window'|'document'|'body'|any, event: string, callback: (event: any) => boolean): | 
					
						
							|  |  |  |       () => void { | 
					
						
							| 
									
										
										
										
											2017-03-06 17:15:08 -08:00
										 |  |  |     checkNoSyntheticProp(event, 'listener'); | 
					
						
							| 
									
										
										
										
											2017-02-14 21:03:18 -08:00
										 |  |  |     if (typeof target === 'string') { | 
					
						
							|  |  |  |       return <() => void>this.eventManager.addGlobalEventListener( | 
					
						
							|  |  |  |           target, event, decoratePreventDefault(callback)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return <() => void>this.eventManager.addEventListener( | 
					
						
							|  |  |  |                target, event, decoratePreventDefault(callback)) as() => void; | 
					
						
							| 
									
										
										
										
											2017-02-08 14:36:43 +03:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-06 17:15:08 -08:00
										 |  |  | const AT_CHARCODE = '@'.charCodeAt(0); | 
					
						
							|  |  |  | function checkNoSyntheticProp(name: string, nameKind: string) { | 
					
						
							|  |  |  |   if (name.charCodeAt(0) === AT_CHARCODE) { | 
					
						
							|  |  |  |     throw new Error( | 
					
						
							|  |  |  |         `Found the synthetic ${nameKind} ${name}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  | class EmulatedEncapsulationDomRenderer2 extends DefaultDomRenderer2 { | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   private contentAttr: string; | 
					
						
							|  |  |  |   private hostAttr: string; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   constructor( | 
					
						
							|  |  |  |       eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  |       private component: RendererType2) { | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |     super(eventManager); | 
					
						
							|  |  |  |     const styles = flattenStyles(component.id, component.styles, []); | 
					
						
							|  |  |  |     sharedStylesHost.addStyles(styles); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     this.contentAttr = shimContentAttribute(component.id); | 
					
						
							|  |  |  |     this.hostAttr = shimHostAttribute(component.id); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   applyToHost(element: any) { super.setAttribute(element, this.hostAttr, ''); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   createElement(parent: any, name: string): Element { | 
					
						
							|  |  |  |     const el = super.createElement(parent, name); | 
					
						
							|  |  |  |     super.setAttribute(el, this.contentAttr, ''); | 
					
						
							|  |  |  |     return el; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  | class ShadowDomRenderer extends DefaultDomRenderer2 { | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |   private shadowRoot: any; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   constructor( | 
					
						
							|  |  |  |       eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost, | 
					
						
							| 
									
										
										
										
											2017-03-07 16:36:12 -08:00
										 |  |  |       private hostEl: any, private component: RendererType2) { | 
					
						
							| 
									
										
										
										
											2017-02-16 13:55:55 -08:00
										 |  |  |     super(eventManager); | 
					
						
							|  |  |  |     this.shadowRoot = (hostEl as any).createShadowRoot(); | 
					
						
							|  |  |  |     this.sharedStylesHost.addHost(this.shadowRoot); | 
					
						
							|  |  |  |     const styles = flattenStyles(component.id, component.styles, []); | 
					
						
							|  |  |  |     for (let i = 0; i < styles.length; i++) { | 
					
						
							|  |  |  |       const styleEl = document.createElement('style'); | 
					
						
							|  |  |  |       styleEl.textContent = styles[i]; | 
					
						
							|  |  |  |       this.shadowRoot.appendChild(styleEl); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   private nodeOrShadowRoot(node: any): any { return node === this.hostEl ? this.shadowRoot : node; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   destroy() { this.sharedStylesHost.removeHost(this.shadowRoot); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   appendChild(parent: any, newChild: any): void { | 
					
						
							|  |  |  |     return super.appendChild(this.nodeOrShadowRoot(parent), newChild); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   insertBefore(parent: any, newChild: any, refChild: any): void { | 
					
						
							|  |  |  |     return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   removeChild(parent: any, oldChild: any): void { | 
					
						
							|  |  |  |     return super.removeChild(this.nodeOrShadowRoot(parent), oldChild); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   parentNode(node: any): any { | 
					
						
							|  |  |  |     return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node))); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2017-02-17 12:55:55 -08:00
										 |  |  | } |