@angular/platform-browser
Advanced tools
Comparing version 2.2.0-rc.0 to 2.2.0
/** | ||
* @license Angular v2.2.0-rc.0 | ||
* @license Angular v2.2.0 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
@@ -41,28 +41,3 @@ * License: MIT | ||
}; | ||
function isPresent(obj) { | ||
return obj != null; | ||
} | ||
// Safari doesn't implement MapIterator.next(), which is used is Traceur's polyfill of Array.from | ||
// TODO(mlaval): remove the work around once we have a working polyfill of Array.from | ||
var _arrayFromMap = (function () { | ||
try { | ||
if ((new Map()).values().next) { | ||
return function createArrayFromMap(m, getValues) { | ||
return getValues ? Array.from(m.values()) : Array.from(m.keys()); | ||
}; | ||
} | ||
} | ||
catch (e) { | ||
} | ||
return function createArrayFromMapWithForeach(m, getValues) { | ||
var res = new Array(m.size), i = 0; | ||
m.forEach(function (v, k) { | ||
res[i] = getValues ? v : k; | ||
i++; | ||
}); | ||
return res; | ||
}; | ||
})(); | ||
var getDOM = _angular_platformBrowser.__platform_browser_private__.getDOM; | ||
@@ -78,8 +53,6 @@ var BrowserDomAdapter = _angular_platformBrowser.__platform_browser_private__.BrowserDomAdapter; | ||
get: function () { | ||
if (isPresent(this._overrideUa)) { | ||
if (typeof this._overrideUa === 'string') { | ||
return this._overrideUa; | ||
} | ||
else { | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
} | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
}, | ||
@@ -86,0 +59,0 @@ enumerable: true, |
{ | ||
"name": "@angular/platform-browser", | ||
"version": "2.2.0-rc.0", | ||
"version": "2.2.0", | ||
"description": "Angular - library for using Angular in a web browser", | ||
@@ -11,4 +11,4 @@ "main": "bundles/platform-browser.umd.js", | ||
"peerDependencies": { | ||
"@angular/core": "2.2.0-rc.0", | ||
"@angular/common": "2.2.0-rc.0" | ||
"@angular/core": "2.2.0", | ||
"@angular/common": "2.2.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "repository": { |
@@ -81,9 +81,23 @@ /** | ||
// TODO(tbosch): move this into a separate environment class once we have it | ||
BrowserDomAdapter.prototype.logError = function (error) { (window.console.error || window.console.log)(error); }; | ||
BrowserDomAdapter.prototype.log = function (error) { window.console.log(error); }; | ||
BrowserDomAdapter.prototype.logError = function (error) { | ||
if (window.console) { | ||
(window.console.error || window.console.log)(error); | ||
} | ||
}; | ||
BrowserDomAdapter.prototype.log = function (error) { | ||
if (window.console) { | ||
window.console.log && window.console.log(error); | ||
} | ||
}; | ||
BrowserDomAdapter.prototype.logGroup = function (error) { | ||
window.console.group && window.console.group(error); | ||
this.logError(error); | ||
if (window.console) { | ||
window.console.group && window.console.group(error); | ||
this.logError(error); | ||
} | ||
}; | ||
BrowserDomAdapter.prototype.logGroupEnd = function () { window.console.groupEnd && window.console.groupEnd(); }; | ||
BrowserDomAdapter.prototype.logGroupEnd = function () { | ||
if (window.console) { | ||
window.console.groupEnd && window.console.groupEnd(); | ||
} | ||
}; | ||
Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { | ||
@@ -90,0 +104,0 @@ get: function () { return _attrToPropMap; }, |
@@ -25,3 +25,3 @@ /** | ||
export function enableDebugTools(ref) { | ||
context.ng = new AngularTools(ref); | ||
Object.assign(context.ng, new AngularTools(ref)); | ||
return ref; | ||
@@ -35,4 +35,4 @@ } | ||
export function disableDebugTools() { | ||
delete context.ng; | ||
delete context.ng.profiler; | ||
} | ||
//# sourceMappingURL=tools.js.map |
@@ -16,2 +16,4 @@ /** | ||
currentTime: number; | ||
addEventListener(eventName: string, handler: (event: any) => any): any; | ||
dispatchEvent(eventName: string): any; | ||
} |
@@ -9,18 +9,23 @@ /** | ||
import { RenderComponentType, Renderer, RootRenderer } from '@angular/core'; | ||
import { AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo } from '../private_import_core'; | ||
import { AnimationKeyframe, AnimationPlayer, AnimationStyles, DirectRenderer, RenderDebugInfo } from '../private_import_core'; | ||
import { AnimationDriver } from './animation_driver'; | ||
import { EventManager } from './events/event_manager'; | ||
import { DomSharedStylesHost } from './shared_styles_host'; | ||
export declare const NAMESPACE_URIS: { | ||
[ns: string]: string; | ||
}; | ||
export declare abstract class DomRootRenderer implements RootRenderer { | ||
document: any; | ||
document: Document; | ||
eventManager: EventManager; | ||
sharedStylesHost: DomSharedStylesHost; | ||
animationDriver: AnimationDriver; | ||
appId: string; | ||
protected registeredComponents: Map<string, DomRenderer>; | ||
constructor(document: any, eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, animationDriver: AnimationDriver); | ||
constructor(document: Document, eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, animationDriver: AnimationDriver, appId: string); | ||
renderComponent(componentProto: RenderComponentType): Renderer; | ||
} | ||
export declare class DomRootRenderer_ extends DomRootRenderer { | ||
constructor(_document: any, _eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, animationDriver: AnimationDriver); | ||
constructor(_document: any, _eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, animationDriver: AnimationDriver, appId: string); | ||
} | ||
export declare const DIRECT_DOM_RENDERER: DirectRenderer; | ||
export declare class DomRenderer implements Renderer { | ||
@@ -33,21 +38,22 @@ private _rootRenderer; | ||
private _styles; | ||
constructor(_rootRenderer: DomRootRenderer, componentProto: RenderComponentType, _animationDriver: AnimationDriver); | ||
selectRootElement(selectorOrNode: string | any, debugInfo: RenderDebugInfo): Element; | ||
createElement(parent: Element, name: string, debugInfo: RenderDebugInfo): Node; | ||
createViewRoot(hostElement: any): any; | ||
createTemplateAnchor(parentElement: any, debugInfo: RenderDebugInfo): any; | ||
createText(parentElement: any, value: string, debugInfo: RenderDebugInfo): any; | ||
projectNodes(parentElement: any, nodes: any[]): void; | ||
attachViewAfter(node: any, viewRootNodes: any[]): void; | ||
detachView(viewRootNodes: any[]): void; | ||
destroyView(hostElement: any, viewAllNodes: any[]): void; | ||
directRenderer: DirectRenderer; | ||
constructor(_rootRenderer: DomRootRenderer, componentProto: RenderComponentType, _animationDriver: AnimationDriver, styleShimId: string); | ||
selectRootElement(selectorOrNode: string | Element, debugInfo: RenderDebugInfo): Element; | ||
createElement(parent: Element | DocumentFragment, name: string, debugInfo: RenderDebugInfo): Element; | ||
createViewRoot(hostElement: Element): Element | DocumentFragment; | ||
createTemplateAnchor(parentElement: Element | DocumentFragment, debugInfo: RenderDebugInfo): Comment; | ||
createText(parentElement: Element | DocumentFragment, value: string, debugInfo: RenderDebugInfo): any; | ||
projectNodes(parentElement: Element | DocumentFragment, nodes: Node[]): void; | ||
attachViewAfter(node: Node, viewRootNodes: Node[]): void; | ||
detachView(viewRootNodes: (Element | Text | Comment)[]): void; | ||
destroyView(hostElement: Element | DocumentFragment, viewAllNodes: Node[]): void; | ||
listen(renderElement: any, name: string, callback: Function): Function; | ||
listenGlobal(target: string, name: string, callback: Function): Function; | ||
setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void; | ||
setElementAttribute(renderElement: any, attributeName: string, attributeValue: string): void; | ||
setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string): void; | ||
setElementClass(renderElement: any, className: string, isAdd: boolean): void; | ||
setElementStyle(renderElement: any, styleName: string, styleValue: string): void; | ||
invokeElementMethod(renderElement: any, methodName: string, args: any[]): void; | ||
setText(renderNode: any, text: string): void; | ||
setElementProperty(renderElement: Element | DocumentFragment, propertyName: string, propertyValue: any): void; | ||
setElementAttribute(renderElement: Element, attributeName: string, attributeValue: string): void; | ||
setBindingDebugInfo(renderElement: Element, propertyName: string, propertyValue: string): void; | ||
setElementClass(renderElement: Element, className: string, isAdd: boolean): void; | ||
setElementStyle(renderElement: HTMLElement, styleName: string, styleValue: string): void; | ||
invokeElementMethod(renderElement: Element, methodName: string, args: any[]): void; | ||
setText(renderNode: Text, text: string): void; | ||
animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer; | ||
@@ -58,1 +64,6 @@ } | ||
export declare const CONTENT_ATTR: string; | ||
export declare function shimContentAttribute(componentShortId: string): string; | ||
export declare function shimHostAttribute(componentShortId: string): string; | ||
export declare function flattenStyles(compId: string, styles: Array<any | any[]>, target: string[]): string[]; | ||
export declare function isNamespaced(name: string): boolean; | ||
export declare function splitNamespace(name: string): string[]; |
@@ -13,11 +13,9 @@ /** | ||
}; | ||
import { Inject, Injectable, ViewEncapsulation } from '@angular/core'; | ||
import { isBlank, isPresent, stringify } from '../facade/lang'; | ||
import { APP_ID, Inject, Injectable, ViewEncapsulation } from '@angular/core'; | ||
import { isPresent, stringify } from '../facade/lang'; | ||
import { AnimationDriver } from './animation_driver'; | ||
import { getDOM } from './dom_adapter'; | ||
import { DOCUMENT } from './dom_tokens'; | ||
import { EventManager } from './events/event_manager'; | ||
import { DomSharedStylesHost } from './shared_styles_host'; | ||
import { camelCaseToDashCase } from './util'; | ||
var NAMESPACE_URIS = { | ||
export var NAMESPACE_URIS = { | ||
'xlink': 'http://www.w3.org/1999/xlink', | ||
@@ -30,3 +28,3 @@ 'svg': 'http://www.w3.org/2000/svg', | ||
export var DomRootRenderer = (function () { | ||
function DomRootRenderer(document, eventManager, sharedStylesHost, animationDriver) { | ||
function DomRootRenderer(document, eventManager, sharedStylesHost, animationDriver, appId) { | ||
this.document = document; | ||
@@ -36,2 +34,3 @@ this.eventManager = eventManager; | ||
this.animationDriver = animationDriver; | ||
this.appId = appId; | ||
this.registeredComponents = new Map(); | ||
@@ -42,3 +41,3 @@ } | ||
if (!renderer) { | ||
renderer = new DomRenderer(this, componentProto, this.animationDriver); | ||
renderer = new DomRenderer(this, componentProto, this.animationDriver, this.appId + "-" + componentProto.id); | ||
this.registeredComponents.set(componentProto.id, renderer); | ||
@@ -52,4 +51,4 @@ } | ||
__extends(DomRootRenderer_, _super); | ||
function DomRootRenderer_(_document, _eventManager, sharedStylesHost, animationDriver) { | ||
_super.call(this, _document, _eventManager, sharedStylesHost, animationDriver); | ||
function DomRootRenderer_(_document, _eventManager, sharedStylesHost, animationDriver, appId) { | ||
_super.call(this, _document, _eventManager, sharedStylesHost, animationDriver, appId); | ||
} | ||
@@ -65,11 +64,24 @@ DomRootRenderer_.decorators = [ | ||
{ type: AnimationDriver, }, | ||
{ type: undefined, decorators: [{ type: Inject, args: [APP_ID,] },] }, | ||
]; | ||
return DomRootRenderer_; | ||
}(DomRootRenderer)); | ||
export var DIRECT_DOM_RENDERER = { | ||
remove: function (node) { | ||
if (node.parentNode) { | ||
node.parentNode.removeChild(node); | ||
} | ||
}, | ||
appendChild: function (node, parent) { parent.appendChild(node); }, | ||
insertBefore: function (node, refNode) { refNode.parentNode.insertBefore(node, refNode); }, | ||
nextSibling: function (node) { return node.nextSibling; }, | ||
parentElement: function (node) { return node.parentNode; } | ||
}; | ||
export var DomRenderer = (function () { | ||
function DomRenderer(_rootRenderer, componentProto, _animationDriver) { | ||
function DomRenderer(_rootRenderer, componentProto, _animationDriver, styleShimId) { | ||
this._rootRenderer = _rootRenderer; | ||
this.componentProto = componentProto; | ||
this._animationDriver = _animationDriver; | ||
this._styles = _flattenStyles(componentProto.id, componentProto.styles, []); | ||
this.directRenderer = DIRECT_DOM_RENDERER; | ||
this._styles = flattenStyles(styleShimId, componentProto.styles, []); | ||
if (componentProto.encapsulation !== ViewEncapsulation.Native) { | ||
@@ -79,4 +91,4 @@ this._rootRenderer.sharedStylesHost.addStyles(this._styles); | ||
if (this.componentProto.encapsulation === ViewEncapsulation.Emulated) { | ||
this._contentAttr = _shimContentAttribute(componentProto.id); | ||
this._hostAttr = _shimHostAttribute(componentProto.id); | ||
this._contentAttr = shimContentAttribute(styleShimId); | ||
this._hostAttr = shimHostAttribute(styleShimId); | ||
} | ||
@@ -91,4 +103,4 @@ else { | ||
if (typeof selectorOrNode === 'string') { | ||
el = getDOM().querySelector(this._rootRenderer.document, selectorOrNode); | ||
if (isBlank(el)) { | ||
el = this._rootRenderer.document.querySelector(selectorOrNode); | ||
if (!el) { | ||
throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements"); | ||
@@ -100,16 +112,22 @@ } | ||
} | ||
getDOM().clearNodes(el); | ||
while (el.firstChild) { | ||
el.removeChild(el.firstChild); | ||
} | ||
return el; | ||
}; | ||
DomRenderer.prototype.createElement = function (parent, name, debugInfo) { | ||
var nsAndName = splitNamespace(name); | ||
var el = isPresent(nsAndName[0]) ? | ||
getDOM().createElementNS(NAMESPACE_URIS[nsAndName[0]], nsAndName[1]) : | ||
getDOM().createElement(nsAndName[1]); | ||
if (isPresent(this._contentAttr)) { | ||
getDOM().setAttribute(el, this._contentAttr, ''); | ||
var el; | ||
if (isNamespaced(name)) { | ||
var nsAndName = splitNamespace(name); | ||
el = document.createElementNS((NAMESPACE_URIS)[nsAndName[0]], nsAndName[1]); | ||
} | ||
if (isPresent(parent)) { | ||
getDOM().appendChild(parent, el); | ||
else { | ||
el = document.createElement(name); | ||
} | ||
if (this._contentAttr) { | ||
el.setAttribute(this._contentAttr, ''); | ||
} | ||
if (parent) { | ||
parent.appendChild(el); | ||
} | ||
return el; | ||
@@ -120,11 +138,13 @@ }; | ||
if (this.componentProto.encapsulation === ViewEncapsulation.Native) { | ||
nodesParent = getDOM().createShadowRoot(hostElement); | ||
nodesParent = hostElement.createShadowRoot(); | ||
this._rootRenderer.sharedStylesHost.addHost(nodesParent); | ||
for (var i = 0; i < this._styles.length; i++) { | ||
getDOM().appendChild(nodesParent, getDOM().createStyleElement(this._styles[i])); | ||
var styleEl = document.createElement('style'); | ||
styleEl.textContent = this._styles[i]; | ||
nodesParent.appendChild(styleEl); | ||
} | ||
} | ||
else { | ||
if (isPresent(this._hostAttr)) { | ||
getDOM().setAttribute(hostElement, this._hostAttr, ''); | ||
if (this._hostAttr) { | ||
hostElement.setAttribute(this._hostAttr, ''); | ||
} | ||
@@ -136,5 +156,5 @@ nodesParent = hostElement; | ||
DomRenderer.prototype.createTemplateAnchor = function (parentElement, debugInfo) { | ||
var comment = getDOM().createComment(TEMPLATE_COMMENT_TEXT); | ||
if (isPresent(parentElement)) { | ||
getDOM().appendChild(parentElement, comment); | ||
var comment = document.createComment(TEMPLATE_COMMENT_TEXT); | ||
if (parentElement) { | ||
parentElement.appendChild(comment); | ||
} | ||
@@ -144,5 +164,5 @@ return comment; | ||
DomRenderer.prototype.createText = function (parentElement, value, debugInfo) { | ||
var node = getDOM().createTextNode(value); | ||
if (isPresent(parentElement)) { | ||
getDOM().appendChild(parentElement, node); | ||
var node = document.createTextNode(value); | ||
if (parentElement) { | ||
parentElement.appendChild(node); | ||
} | ||
@@ -152,3 +172,3 @@ return node; | ||
DomRenderer.prototype.projectNodes = function (parentElement, nodes) { | ||
if (isBlank(parentElement)) | ||
if (!parentElement) | ||
return; | ||
@@ -160,8 +180,11 @@ appendNodes(parentElement, nodes); | ||
for (var i = 0; i < viewRootNodes.length; i++) { | ||
getDOM().remove(viewRootNodes[i]); | ||
var node = viewRootNodes[i]; | ||
if (node.parentNode) { | ||
node.parentNode.removeChild(node); | ||
} | ||
} | ||
}; | ||
DomRenderer.prototype.destroyView = function (hostElement, viewAllNodes) { | ||
if (this.componentProto.encapsulation === ViewEncapsulation.Native && isPresent(hostElement)) { | ||
this._rootRenderer.sharedStylesHost.removeHost(getDOM().getShadowRoot(hostElement)); | ||
if (this.componentProto.encapsulation === ViewEncapsulation.Native && hostElement) { | ||
this._rootRenderer.sharedStylesHost.removeHost(hostElement.shadowRoot); | ||
} | ||
@@ -176,8 +199,10 @@ }; | ||
DomRenderer.prototype.setElementProperty = function (renderElement, propertyName, propertyValue) { | ||
getDOM().setProperty(renderElement, propertyName, propertyValue); | ||
renderElement[propertyName] = propertyValue; | ||
}; | ||
DomRenderer.prototype.setElementAttribute = function (renderElement, attributeName, attributeValue) { | ||
var attrNs; | ||
var nsAndName = splitNamespace(attributeName); | ||
if (isPresent(nsAndName[0])) { | ||
var attrNameWithoutNs = attributeName; | ||
if (isNamespaced(attributeName)) { | ||
var nsAndName = splitNamespace(attributeName); | ||
attrNameWithoutNs = nsAndName[1]; | ||
attributeName = nsAndName[0] + ':' + nsAndName[1]; | ||
@@ -187,7 +212,7 @@ attrNs = NAMESPACE_URIS[nsAndName[0]]; | ||
if (isPresent(attributeValue)) { | ||
if (isPresent(attrNs)) { | ||
getDOM().setAttributeNS(renderElement, attrNs, attributeName, attributeValue); | ||
if (attrNs) { | ||
renderElement.setAttributeNS(attrNs, attributeName, attributeValue); | ||
} | ||
else { | ||
getDOM().setAttribute(renderElement, attributeName, attributeValue); | ||
renderElement.setAttribute(attributeName, attributeValue); | ||
} | ||
@@ -197,6 +222,6 @@ } | ||
if (isPresent(attrNs)) { | ||
getDOM().removeAttributeNS(renderElement, attrNs, nsAndName[1]); | ||
renderElement.removeAttributeNS(attrNs, attrNameWithoutNs); | ||
} | ||
else { | ||
getDOM().removeAttribute(renderElement, attributeName); | ||
renderElement.removeAttribute(attributeName); | ||
} | ||
@@ -206,8 +231,8 @@ } | ||
DomRenderer.prototype.setBindingDebugInfo = function (renderElement, propertyName, propertyValue) { | ||
var dashCasedPropertyName = camelCaseToDashCase(propertyName); | ||
if (getDOM().isCommentNode(renderElement)) { | ||
var existingBindings = getDOM().getText(renderElement).replace(/\n/g, '').match(TEMPLATE_BINDINGS_EXP); | ||
if (renderElement.nodeType === Node.COMMENT_NODE) { | ||
var existingBindings = renderElement.nodeValue.replace(/\n/g, '').match(TEMPLATE_BINDINGS_EXP); | ||
var parsedBindings = JSON.parse(existingBindings[1]); | ||
parsedBindings[dashCasedPropertyName] = propertyValue; | ||
getDOM().setText(renderElement, TEMPLATE_COMMENT_TEXT.replace('{}', JSON.stringify(parsedBindings, null, 2))); | ||
parsedBindings[propertyName] = propertyValue; | ||
renderElement.nodeValue = | ||
TEMPLATE_COMMENT_TEXT.replace('{}', JSON.stringify(parsedBindings, null, 2)); | ||
} | ||
@@ -220,6 +245,6 @@ else { | ||
if (isAdd) { | ||
getDOM().addClass(renderElement, className); | ||
renderElement.classList.add(className); | ||
} | ||
else { | ||
getDOM().removeClass(renderElement, className); | ||
renderElement.classList.remove(className); | ||
} | ||
@@ -229,12 +254,14 @@ }; | ||
if (isPresent(styleValue)) { | ||
getDOM().setStyle(renderElement, styleName, stringify(styleValue)); | ||
renderElement.style[styleName] = stringify(styleValue); | ||
} | ||
else { | ||
getDOM().removeStyle(renderElement, styleName); | ||
// IE requires '' instead of null | ||
// see https://github.com/angular/angular/issues/7916 | ||
renderElement.style[styleName] = ''; | ||
} | ||
}; | ||
DomRenderer.prototype.invokeElementMethod = function (renderElement, methodName, args) { | ||
getDOM().invoke(renderElement, methodName, args); | ||
renderElement[methodName].apply(renderElement, args); | ||
}; | ||
DomRenderer.prototype.setText = function (renderNode, text) { getDOM().setText(renderNode, text); }; | ||
DomRenderer.prototype.setText = function (renderNode, text) { renderNode.nodeValue = text; }; | ||
DomRenderer.prototype.animate = function (element, startingStyles, keyframes, duration, delay, easing) { | ||
@@ -245,9 +272,9 @@ return this._animationDriver.animate(element, startingStyles, keyframes, duration, delay, easing); | ||
}()); | ||
function moveNodesAfterSibling(sibling /** TODO #9100 */, nodes /** TODO #9100 */) { | ||
var parent = getDOM().parentElement(sibling); | ||
if (nodes.length > 0 && isPresent(parent)) { | ||
var nextSibling = getDOM().nextSibling(sibling); | ||
if (isPresent(nextSibling)) { | ||
function moveNodesAfterSibling(sibling, nodes) { | ||
var parent = sibling.parentNode; | ||
if (nodes.length > 0 && parent) { | ||
var nextSibling = sibling.nextSibling; | ||
if (nextSibling) { | ||
for (var i = 0; i < nodes.length; i++) { | ||
getDOM().insertBefore(nextSibling, nodes[i]); | ||
parent.insertBefore(nodes[i], nextSibling); | ||
} | ||
@@ -257,3 +284,3 @@ } | ||
for (var i = 0; i < nodes.length; i++) { | ||
getDOM().appendChild(parent, nodes[i]); | ||
parent.appendChild(nodes[i]); | ||
} | ||
@@ -263,13 +290,14 @@ } | ||
} | ||
function appendNodes(parent /** TODO #9100 */, nodes /** TODO #9100 */) { | ||
function appendNodes(parent, nodes) { | ||
for (var i = 0; i < nodes.length; i++) { | ||
getDOM().appendChild(parent, nodes[i]); | ||
parent.appendChild(nodes[i]); | ||
} | ||
} | ||
function decoratePreventDefault(eventHandler) { | ||
return function (event /** TODO #9100 */) { | ||
return function (event) { | ||
var allowDefaultBehavior = eventHandler(event); | ||
if (allowDefaultBehavior === false) { | ||
// TODO(tbosch): move preventDefault into event plugins... | ||
getDOM().preventDefault(event); | ||
event.preventDefault(); | ||
event.returnValue = false; | ||
} | ||
@@ -282,13 +310,13 @@ }; | ||
export var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE; | ||
function _shimContentAttribute(componentShortId) { | ||
export function shimContentAttribute(componentShortId) { | ||
return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId); | ||
} | ||
function _shimHostAttribute(componentShortId) { | ||
export function shimHostAttribute(componentShortId) { | ||
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId); | ||
} | ||
function _flattenStyles(compId, styles, target) { | ||
export function flattenStyles(compId, styles, target) { | ||
for (var i = 0; i < styles.length; i++) { | ||
var style = styles[i]; | ||
if (Array.isArray(style)) { | ||
_flattenStyles(compId, style, target); | ||
flattenStyles(compId, style, target); | ||
} | ||
@@ -303,6 +331,6 @@ else { | ||
var NS_PREFIX_RE = /^:([^:]+):(.+)$/; | ||
function splitNamespace(name) { | ||
if (name[0] != ':') { | ||
return [null, name]; | ||
} | ||
export function isNamespaced(name) { | ||
return name[0] === ':'; | ||
} | ||
export function splitNamespace(name) { | ||
var match = name.match(NS_PREFIX_RE); | ||
@@ -309,0 +337,0 @@ return [match[1], match[2]]; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"DomRootRenderer_":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./dom_tokens","name":"DOCUMENT"}]}],null,null,null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./events/event_manager","name":"EventManager"},{"__symbolic":"reference","module":"./shared_styles_host","name":"DomSharedStylesHost"},{"__symbolic":"reference","module":"./animation_driver","name":"AnimationDriver"}]}]}},"COMPONENT_VARIABLE":"%COMP%","HOST_ATTR":{"__symbolic":"error","message":"Expression form not supported","line":270,"character":25},"CONTENT_ATTR":{"__symbolic":"error","message":"Expression form not supported","line":271,"character":28}}} | ||
{"__symbolic":"module","version":1,"metadata":{"NAMESPACE_URIS":{"xlink":"http://www.w3.org/1999/xlink","svg":"http://www.w3.org/2000/svg","xhtml":"http://www.w3.org/1999/xhtml"},"DomRootRenderer_":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./dom_tokens","name":"DOCUMENT"}]}],null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"APP_ID"}]}]],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./events/event_manager","name":"EventManager"},{"__symbolic":"reference","module":"./shared_styles_host","name":"DomSharedStylesHost"},{"__symbolic":"reference","module":"./animation_driver","name":"AnimationDriver"},{"__symbolic":"reference","name":"string"}]}]}},"DIRECT_DOM_RENDERER":{},"COMPONENT_VARIABLE":"%COMP%","HOST_ATTR":{"__symbolic":"error","message":"Expression form not supported","line":303,"character":25},"CONTENT_ATTR":{"__symbolic":"error","message":"Expression form not supported","line":304,"character":28},"shimContentAttribute":{"__symbolic":"function","parameters":["componentShortId"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":301,"character":6,"context":{"name":"COMPONENT_REGEX"}}},"shimHostAttribute":{"__symbolic":"function","parameters":["componentShortId"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":301,"character":6,"context":{"name":"COMPONENT_REGEX"}}},"isNamespaced":{"__symbolic":"function","parameters":["name"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"name"},"index":0},"right":":"}}}} |
@@ -5,3 +5,2 @@ import { EventManagerPlugin } from './event_manager'; | ||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
addGlobalEventListener(target: string, eventName: string, handler: Function): Function; | ||
} |
@@ -14,3 +14,2 @@ /** | ||
import { Injectable } from '@angular/core'; | ||
import { getDOM } from '../dom_adapter'; | ||
import { EventManagerPlugin } from './event_manager'; | ||
@@ -26,12 +25,5 @@ export var DomEventsPlugin = (function (_super) { | ||
DomEventsPlugin.prototype.addEventListener = function (element, eventName, handler) { | ||
var zone = this.manager.getZone(); | ||
var outsideHandler = function (event /** TODO #9100 */) { return zone.runGuarded(function () { return handler(event); }); }; | ||
return this.manager.getZone().runOutsideAngular(function () { return getDOM().onAndCancel(element, eventName, outsideHandler); }); | ||
element.addEventListener(eventName, handler, false); | ||
return function () { return element.removeEventListener(eventName, handler, false); }; | ||
}; | ||
DomEventsPlugin.prototype.addGlobalEventListener = function (target, eventName, handler) { | ||
var element = getDOM().getGlobalEventTarget(target); | ||
var zone = this.manager.getZone(); | ||
var outsideHandler = function (event /** TODO #9100 */) { return zone.runGuarded(function () { return handler(event); }); }; | ||
return this.manager.getZone().runOutsideAngular(function () { return getDOM().onAndCancel(element, eventName, outsideHandler); }); | ||
}; | ||
DomEventsPlugin.decorators = [ | ||
@@ -38,0 +30,0 @@ { type: Injectable }, |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"DomEventsPlugin":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"supports":[{"__symbolic":"method"}],"addEventListener":[{"__symbolic":"method"}],"addGlobalEventListener":[{"__symbolic":"method"}]}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"DomEventsPlugin":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"supports":[{"__symbolic":"method"}],"addEventListener":[{"__symbolic":"method"}]}}}} |
@@ -19,2 +19,3 @@ /** | ||
private _plugins; | ||
private _eventNameToPlugin; | ||
constructor(plugins: EventManagerPlugin[], _zone: NgZone); | ||
@@ -25,7 +26,7 @@ addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
} | ||
export declare class EventManagerPlugin { | ||
export declare abstract class EventManagerPlugin { | ||
manager: EventManager; | ||
supports(eventName: string): boolean; | ||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
abstract supports(eventName: string): boolean; | ||
abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | ||
addGlobalEventListener(element: string, eventName: string, handler: Function): Function; | ||
} |
@@ -9,2 +9,3 @@ /** | ||
import { Inject, Injectable, NgZone, OpaqueToken } from '@angular/core'; | ||
import { getDOM } from '../dom_adapter'; | ||
/** | ||
@@ -21,2 +22,3 @@ * @stable | ||
this._zone = _zone; | ||
this._eventNameToPlugin = new Map(); | ||
plugins.forEach(function (p) { return p.manager = _this; }); | ||
@@ -36,7 +38,12 @@ this._plugins = plugins.slice().reverse(); | ||
EventManager.prototype._findPluginFor = function (eventName) { | ||
var plugin = this._eventNameToPlugin.get(eventName); | ||
if (plugin) { | ||
return plugin; | ||
} | ||
var plugins = this._plugins; | ||
for (var i = 0; i < plugins.length; i++) { | ||
var plugin = plugins[i]; | ||
if (plugin.supports(eventName)) { | ||
return plugin; | ||
var plugin_1 = plugins[i]; | ||
if (plugin_1.supports(eventName)) { | ||
this._eventNameToPlugin.set(eventName, plugin_1); | ||
return plugin_1; | ||
} | ||
@@ -59,12 +66,12 @@ } | ||
} | ||
// That is equivalent to having supporting $event.target | ||
EventManagerPlugin.prototype.supports = function (eventName) { return false; }; | ||
EventManagerPlugin.prototype.addEventListener = function (element, eventName, handler) { | ||
throw 'not implemented'; | ||
}; | ||
EventManagerPlugin.prototype.addGlobalEventListener = function (element, eventName, handler) { | ||
throw 'not implemented'; | ||
var target = getDOM().getGlobalEventTarget(element); | ||
if (!target) { | ||
throw new Error("Unsupported event target " + target + " for event " + eventName); | ||
} | ||
return this.addEventListener(target, eventName, handler); | ||
}; | ||
; | ||
return EventManagerPlugin; | ||
}()); | ||
//# sourceMappingURL=event_manager.js.map |
@@ -9,3 +9,3 @@ /** | ||
import { OpaqueToken } from '@angular/core'; | ||
import { HammerGesturesPluginCommon } from './hammer_common'; | ||
import { EventManagerPlugin } from './event_manager'; | ||
/** | ||
@@ -32,3 +32,3 @@ * A DI token that you can use to provide{@link HammerGestureConfig} to Angular. Use it to configure | ||
} | ||
export declare class HammerGesturesPlugin extends HammerGesturesPluginCommon { | ||
export declare class HammerGesturesPlugin extends EventManagerPlugin { | ||
private _config; | ||
@@ -35,0 +35,0 @@ constructor(_config: HammerGestureConfig); |
@@ -14,3 +14,40 @@ /** | ||
import { Inject, Injectable, OpaqueToken } from '@angular/core'; | ||
import { HammerGesturesPluginCommon } from './hammer_common'; | ||
import { EventManagerPlugin } from './event_manager'; | ||
var EVENT_NAMES = { | ||
// pan | ||
'pan': true, | ||
'panstart': true, | ||
'panmove': true, | ||
'panend': true, | ||
'pancancel': true, | ||
'panleft': true, | ||
'panright': true, | ||
'panup': true, | ||
'pandown': true, | ||
// pinch | ||
'pinch': true, | ||
'pinchstart': true, | ||
'pinchmove': true, | ||
'pinchend': true, | ||
'pinchcancel': true, | ||
'pinchin': true, | ||
'pinchout': true, | ||
// press | ||
'press': true, | ||
'pressup': true, | ||
// rotate | ||
'rotate': true, | ||
'rotatestart': true, | ||
'rotatemove': true, | ||
'rotateend': true, | ||
'rotatecancel': true, | ||
// swipe | ||
'swipe': true, | ||
'swipeleft': true, | ||
'swiperight': true, | ||
'swipeup': true, | ||
'swipedown': true, | ||
// tap | ||
'tap': true, | ||
}; | ||
/** | ||
@@ -54,4 +91,5 @@ * A DI token that you can use to provide{@link HammerGestureConfig} to Angular. Use it to configure | ||
HammerGesturesPlugin.prototype.supports = function (eventName) { | ||
if (!_super.prototype.supports.call(this, eventName) && !this.isCustomEvent(eventName)) | ||
if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) { | ||
return false; | ||
} | ||
if (!window.Hammer) { | ||
@@ -85,3 +123,3 @@ throw new Error("Hammer.js is not loaded, can not bind " + eventName + " event"); | ||
return HammerGesturesPlugin; | ||
}(HammerGesturesPluginCommon)); | ||
}(EventManagerPlugin)); | ||
//# sourceMappingURL=hammer_gestures.js.map |
@@ -21,3 +21,3 @@ /** | ||
static getEventFullKey(event: KeyboardEvent): string; | ||
static eventCallback(element: HTMLElement, fullKey: any, handler: Function, zone: NgZone): Function; | ||
static eventCallback(fullKey: any, handler: Function, zone: NgZone): Function; | ||
} |
@@ -14,8 +14,6 @@ /** | ||
import { Injectable } from '@angular/core'; | ||
import { ListWrapper } from '../../facade/collection'; | ||
import { isPresent } from '../../facade/lang'; | ||
import { getDOM } from '../dom_adapter'; | ||
import { EventManagerPlugin } from './event_manager'; | ||
var modifierKeys = ['alt', 'control', 'meta', 'shift']; | ||
var modifierKeyGetters = { | ||
var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift']; | ||
var MODIFIER_KEY_GETTERS = { | ||
'alt': function (event) { return event.altKey; }, | ||
@@ -34,8 +32,6 @@ 'control': function (event) { return event.ctrlKey; }, | ||
} | ||
KeyEventsPlugin.prototype.supports = function (eventName) { | ||
return isPresent(KeyEventsPlugin.parseEventName(eventName)); | ||
}; | ||
KeyEventsPlugin.prototype.supports = function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; }; | ||
KeyEventsPlugin.prototype.addEventListener = function (element, eventName, handler) { | ||
var parsedEvent = KeyEventsPlugin.parseEventName(eventName); | ||
var outsideHandler = KeyEventsPlugin.eventCallback(element, parsedEvent['fullKey'], handler, this.manager.getZone()); | ||
var outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone()); | ||
return this.manager.getZone().runOutsideAngular(function () { | ||
@@ -53,5 +49,6 @@ return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler); | ||
var fullKey = ''; | ||
modifierKeys.forEach(function (modifierName) { | ||
if (parts.indexOf(modifierName) > -1) { | ||
ListWrapper.remove(parts, modifierName); | ||
MODIFIER_KEYS.forEach(function (modifierName) { | ||
var index = parts.indexOf(modifierName); | ||
if (index > -1) { | ||
parts.splice(index, 1); | ||
fullKey += modifierName + '.'; | ||
@@ -80,5 +77,5 @@ } | ||
} | ||
modifierKeys.forEach(function (modifierName) { | ||
MODIFIER_KEYS.forEach(function (modifierName) { | ||
if (modifierName != key) { | ||
var modifierGetter = modifierKeyGetters[modifierName]; | ||
var modifierGetter = MODIFIER_KEY_GETTERS[modifierName]; | ||
if (modifierGetter(event)) { | ||
@@ -92,3 +89,3 @@ fullKey += modifierName + '.'; | ||
}; | ||
KeyEventsPlugin.eventCallback = function (element, fullKey, handler, zone) { | ||
KeyEventsPlugin.eventCallback = function (fullKey, handler, zone) { | ||
return function (event /** TODO #9100 */) { | ||
@@ -102,3 +99,3 @@ if (KeyEventsPlugin.getEventFullKey(event) === fullKey) { | ||
KeyEventsPlugin._normalizeKey = function (keyName) { | ||
// TODO: switch to a StringMap if the mapping grows too much | ||
// TODO: switch to a Map if the mapping grows too much | ||
switch (keyName) { | ||
@@ -105,0 +102,0 @@ case 'esc': |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"KeyEventsPlugin":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"supports":[{"__symbolic":"method"}],"addEventListener":[{"__symbolic":"method"}]},"statics":{"eventCallback":{"__symbolic":"function","parameters":["element","fullKey","handler","zone"],"value":{"__symbolic":"error","message":"Function call not supported","line":101,"character":11}}}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"KeyEventsPlugin":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"supports":[{"__symbolic":"method"}],"addEventListener":[{"__symbolic":"method"}]},"statics":{"eventCallback":{"__symbolic":"function","parameters":["fullKey","handler","zone"],"value":{"__symbolic":"error","message":"Function call not supported","line":93,"character":11}}}}}} |
@@ -14,3 +14,2 @@ /** | ||
import { Inject, Injectable } from '@angular/core'; | ||
import { getDOM } from './dom_adapter'; | ||
import { DOCUMENT } from './dom_tokens'; | ||
@@ -55,4 +54,5 @@ export var SharedStylesHost = (function () { | ||
for (var i = 0; i < styles.length; i++) { | ||
var style = styles[i]; | ||
getDOM().appendChild(host, getDOM().createStyleElement(style)); | ||
var styleEl = document.createElement('style'); | ||
styleEl.textContent = styles[i]; | ||
host.appendChild(styleEl); | ||
} | ||
@@ -59,0 +59,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"camelCaseToDashCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":8,"character":4,"context":{"name":"CAMEL_CASE_REGEXP"}}},"dashCaseToCamelCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":9,"character":4,"context":{"name":"DASH_CASE_REGEXP"}}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"camelCaseToDashCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":8,"character":6,"context":{"name":"CAMEL_CASE_REGEXP"}}},"dashCaseToCamelCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":9,"character":6,"context":{"name":"DASH_CASE_REGEXP"}}}}} |
@@ -8,5 +8,3 @@ /** | ||
*/ | ||
import { AUTO_STYLE } from '@angular/core'; | ||
import { isPresent } from '../facade/lang'; | ||
import { dashCaseToCamelCase } from './util'; | ||
import { WebAnimationsPlayer } from './web_animations_player'; | ||
@@ -54,10 +52,3 @@ export var WebAnimationsDriver = (function () { | ||
var data = {}; | ||
styles.styles.forEach(function (entry) { | ||
Object.keys(entry).forEach(function (prop) { | ||
var val = entry[prop]; | ||
var formattedProp = dashCaseToCamelCase(prop); | ||
data[formattedProp] = | ||
val == AUTO_STYLE ? val : val.toString() + _resolveStyleUnit(val, prop, formattedProp); | ||
}); | ||
}); | ||
styles.styles.forEach(function (entry) { Object.keys(entry).forEach(function (prop) { data[prop] = entry[prop]; }); }); | ||
Object.keys(defaultStyles).forEach(function (prop) { | ||
@@ -70,61 +61,2 @@ if (!isPresent(data[prop])) { | ||
} | ||
function _resolveStyleUnit(val, userProvidedProp, formattedProp) { | ||
var unit = ''; | ||
if (_isPixelDimensionStyle(formattedProp) && val != 0 && val != '0') { | ||
if (typeof val === 'number') { | ||
unit = 'px'; | ||
} | ||
else if (_findDimensionalSuffix(val.toString()).length == 0) { | ||
throw new Error('Please provide a CSS unit value for ' + userProvidedProp + ':' + val); | ||
} | ||
} | ||
return unit; | ||
} | ||
var _$0 = 48; | ||
var _$9 = 57; | ||
var _$PERIOD = 46; | ||
function _findDimensionalSuffix(value) { | ||
for (var i = 0; i < value.length; i++) { | ||
var c = value.charCodeAt(i); | ||
if ((c >= _$0 && c <= _$9) || c == _$PERIOD) | ||
continue; | ||
return value.substring(i, value.length); | ||
} | ||
return ''; | ||
} | ||
function _isPixelDimensionStyle(prop) { | ||
switch (prop) { | ||
case 'width': | ||
case 'height': | ||
case 'minWidth': | ||
case 'minHeight': | ||
case 'maxWidth': | ||
case 'maxHeight': | ||
case 'left': | ||
case 'top': | ||
case 'bottom': | ||
case 'right': | ||
case 'fontSize': | ||
case 'outlineWidth': | ||
case 'outlineOffset': | ||
case 'paddingTop': | ||
case 'paddingLeft': | ||
case 'paddingBottom': | ||
case 'paddingRight': | ||
case 'marginTop': | ||
case 'marginLeft': | ||
case 'marginBottom': | ||
case 'marginRight': | ||
case 'borderRadius': | ||
case 'borderWidth': | ||
case 'borderTopWidth': | ||
case 'borderLeftWidth': | ||
case 'borderRightWidth': | ||
case 'borderBottomWidth': | ||
case 'textIndent': | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
//# sourceMappingURL=web_animations_driver.js.map |
import { AnimationPlayer } from '../private_import_core'; | ||
import { DomAnimatePlayer } from './dom_animate_player'; | ||
export declare class WebAnimationsPlayer implements AnimationPlayer { | ||
@@ -12,7 +13,8 @@ element: any; | ||
private _onStartFns; | ||
private _player; | ||
private _duration; | ||
private _initialized; | ||
private _finished; | ||
private _initialized; | ||
private _player; | ||
private _started; | ||
private _duration; | ||
private _destroyed; | ||
parentPlayer: AnimationPlayer; | ||
@@ -26,2 +28,3 @@ constructor(element: any, keyframes: { | ||
init(): void; | ||
domPlayer: DomAnimatePlayer; | ||
onStart(fn: () => void): void; | ||
@@ -33,2 +36,3 @@ onDone(fn: () => void): void; | ||
reset(): void; | ||
private _resetDomPlayerState(); | ||
restart(): void; | ||
@@ -35,0 +39,0 @@ hasStarted(): boolean; |
@@ -9,3 +9,2 @@ /** | ||
import { AUTO_STYLE } from '@angular/core'; | ||
import { isPresent } from '../facade/lang'; | ||
import { getDOM } from './dom_adapter'; | ||
@@ -19,5 +18,6 @@ export var WebAnimationsPlayer = (function () { | ||
this._onStartFns = []; | ||
this._initialized = false; | ||
this._finished = false; | ||
this._initialized = false; | ||
this._started = false; | ||
this._destroyed = false; | ||
this.parentPlayer = null; | ||
@@ -29,5 +29,2 @@ this._duration = options['duration']; | ||
this._finished = true; | ||
if (!isPresent(this.parentPlayer)) { | ||
this.destroy(); | ||
} | ||
this._onDoneFns.forEach(function (fn) { return fn(); }); | ||
@@ -52,4 +49,4 @@ this._onDoneFns = []; | ||
// this is required so that the player doesn't start to animate right away | ||
this.reset(); | ||
this._player.onfinish = function () { return _this._onFinish(); }; | ||
this._resetDomPlayerState(); | ||
this._player.addEventListener('finish', function () { return _this._onFinish(); }); | ||
}; | ||
@@ -60,2 +57,7 @@ /** @internal */ | ||
}; | ||
Object.defineProperty(WebAnimationsPlayer.prototype, "domPlayer", { | ||
get: function () { return this._player; }, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
WebAnimationsPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); }; | ||
@@ -81,3 +83,9 @@ WebAnimationsPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); }; | ||
}; | ||
WebAnimationsPlayer.prototype.reset = function () { this._player.cancel(); }; | ||
WebAnimationsPlayer.prototype.reset = function () { | ||
this._resetDomPlayerState(); | ||
this._destroyed = false; | ||
this._finished = false; | ||
this._started = false; | ||
}; | ||
WebAnimationsPlayer.prototype._resetDomPlayerState = function () { this._player.cancel(); }; | ||
WebAnimationsPlayer.prototype.restart = function () { | ||
@@ -89,4 +97,7 @@ this.reset(); | ||
WebAnimationsPlayer.prototype.destroy = function () { | ||
this.reset(); | ||
this._onFinish(); | ||
if (!this._destroyed) { | ||
this._resetDomPlayerState(); | ||
this._onFinish(); | ||
this._destroyed = true; | ||
} | ||
}; | ||
@@ -93,0 +104,0 @@ Object.defineProperty(WebAnimationsPlayer.prototype, "totalTime", { |
@@ -1,8 +0,1 @@ | ||
export declare class MapWrapper { | ||
static createFromStringMap<T>(stringMap: { | ||
[key: string]: T; | ||
}): Map<string, T>; | ||
static keys<K>(m: Map<K, any>): K[]; | ||
static values<V>(m: Map<any, V>): V[]; | ||
} | ||
/** | ||
@@ -36,7 +29,6 @@ * Wraps Javascript Objects | ||
static equals(a: any[], b: any[]): boolean; | ||
static maximum<T>(list: T[], predicate: (t: T) => number): T; | ||
static flatten<T>(list: Array<T | T[]>): T[]; | ||
} | ||
export declare function isListLikeIterable(obj: any): boolean; | ||
export declare function areIterablesEqual(a: any, b: any, comparator: Function): boolean; | ||
export declare function iterateListLike(obj: any, fn: Function): void; | ||
export declare function areIterablesEqual(a: any, b: any, comparator: (a: any, b: any) => boolean): boolean; | ||
export declare function iterateListLike(obj: any, fn: (p: any) => any): void; |
@@ -8,38 +8,3 @@ /** | ||
*/ | ||
import { getSymbolIterator, isJsObject, isPresent } from './lang'; | ||
// Safari doesn't implement MapIterator.next(), which is used is Traceur's polyfill of Array.from | ||
// TODO(mlaval): remove the work around once we have a working polyfill of Array.from | ||
var _arrayFromMap = (function () { | ||
try { | ||
if ((new Map()).values().next) { | ||
return function createArrayFromMap(m, getValues) { | ||
return getValues ? Array.from(m.values()) : Array.from(m.keys()); | ||
}; | ||
} | ||
} | ||
catch (e) { | ||
} | ||
return function createArrayFromMapWithForeach(m, getValues) { | ||
var res = new Array(m.size), i = 0; | ||
m.forEach(function (v, k) { | ||
res[i] = getValues ? v : k; | ||
i++; | ||
}); | ||
return res; | ||
}; | ||
})(); | ||
export var MapWrapper = (function () { | ||
function MapWrapper() { | ||
} | ||
MapWrapper.createFromStringMap = function (stringMap) { | ||
var result = new Map(); | ||
for (var prop in stringMap) { | ||
result.set(prop, stringMap[prop]); | ||
} | ||
return result; | ||
}; | ||
MapWrapper.keys = function (m) { return _arrayFromMap(m, false); }; | ||
MapWrapper.values = function (m) { return _arrayFromMap(m, true); }; | ||
return MapWrapper; | ||
}()); | ||
import { getSymbolIterator, isJsObject } from './lang'; | ||
/** | ||
@@ -85,3 +50,5 @@ * Wraps Javascript Objects | ||
var index = list.indexOf(items[i]); | ||
list.splice(index, 1); | ||
if (index > -1) { | ||
list.splice(index, 1); | ||
} | ||
} | ||
@@ -106,42 +73,10 @@ }; | ||
}; | ||
ListWrapper.maximum = function (list, predicate) { | ||
if (list.length == 0) { | ||
return null; | ||
} | ||
var solution = null; | ||
var maxValue = -Infinity; | ||
for (var index = 0; index < list.length; index++) { | ||
var candidate = list[index]; | ||
if (candidate == null) { | ||
continue; | ||
} | ||
var candidateValue = predicate(candidate); | ||
if (candidateValue > maxValue) { | ||
solution = candidate; | ||
maxValue = candidateValue; | ||
} | ||
} | ||
return solution; | ||
}; | ||
ListWrapper.flatten = function (list) { | ||
var target = []; | ||
_flattenArray(list, target); | ||
return target; | ||
return list.reduce(function (flat, item) { | ||
var flatItem = Array.isArray(item) ? ListWrapper.flatten(item) : item; | ||
return flat.concat(flatItem); | ||
}, []); | ||
}; | ||
return ListWrapper; | ||
}()); | ||
function _flattenArray(source, target) { | ||
if (isPresent(source)) { | ||
for (var i = 0; i < source.length; i++) { | ||
var item = source[i]; | ||
if (Array.isArray(item)) { | ||
_flattenArray(item, target); | ||
} | ||
else { | ||
target.push(item); | ||
} | ||
} | ||
} | ||
return target; | ||
} | ||
export function isListLikeIterable(obj) { | ||
@@ -148,0 +83,0 @@ if (!isJsObject(obj)) |
@@ -41,3 +41,2 @@ | ||
static parseIntAutoRadix(text: string): number; | ||
static parseInt(text: string, radix: number): number; | ||
static isNumeric(value: any): boolean; | ||
@@ -44,0 +43,0 @@ } |
@@ -54,3 +54,3 @@ /** | ||
} | ||
if (token === undefined || token === null) { | ||
if (token == null) { | ||
return '' + token; | ||
@@ -78,21 +78,2 @@ } | ||
}; | ||
NumberWrapper.parseInt = function (text, radix) { | ||
if (radix == 10) { | ||
if (/^(\-|\+)?[0-9]+$/.test(text)) { | ||
return parseInt(text, radix); | ||
} | ||
} | ||
else if (radix == 16) { | ||
if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { | ||
return parseInt(text, radix); | ||
} | ||
} | ||
else { | ||
var result = parseInt(text, radix); | ||
if (!isNaN(result)) { | ||
return result; | ||
} | ||
} | ||
throw new Error('Invalid integer literal when parsing ' + text + ' in base ' + radix); | ||
}; | ||
NumberWrapper.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; | ||
@@ -118,8 +99,8 @@ return NumberWrapper; | ||
while (parts.length > 1) { | ||
var name = parts.shift(); | ||
if (obj.hasOwnProperty(name) && isPresent(obj[name])) { | ||
obj = obj[name]; | ||
var name_1 = parts.shift(); | ||
if (obj.hasOwnProperty(name_1) && obj[name_1] != null) { | ||
obj = obj[name_1]; | ||
} | ||
else { | ||
obj = obj[name] = {}; | ||
obj = obj[name_1] = {}; | ||
} | ||
@@ -126,0 +107,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":199,"character":19}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":123,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":123,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":127,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":127,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":182,"character":19}}}} |
@@ -19,2 +19,3 @@ /** | ||
import * as shared_styles_host from './dom/shared_styles_host'; | ||
import { WebAnimationsDriver } from './dom/web_animations_driver'; | ||
export declare var __platform_browser_private__: { | ||
@@ -35,2 +36,8 @@ _BrowserPlatformLocation?: location.BrowserPlatformLocation; | ||
DomRootRenderer_: typeof dom_renderer.DomRootRenderer_; | ||
NAMESPACE_URIS: typeof dom_renderer.NAMESPACE_URIS; | ||
shimContentAttribute: typeof dom_renderer.shimContentAttribute; | ||
shimHostAttribute: typeof dom_renderer.shimHostAttribute; | ||
flattenStyles: typeof dom_renderer.flattenStyles; | ||
splitNamespace: typeof dom_renderer.splitNamespace; | ||
isNamespaced: typeof dom_renderer.isNamespaced; | ||
_DomSharedStylesHost?: shared_styles_host.DomSharedStylesHost; | ||
@@ -50,2 +57,3 @@ DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost; | ||
BROWSER_SANITIZATION_PROVIDERS: typeof browser.BROWSER_SANITIZATION_PROVIDERS; | ||
WebAnimationsDriver: typeof WebAnimationsDriver; | ||
}; |
@@ -19,2 +19,3 @@ /** | ||
import * as shared_styles_host from './dom/shared_styles_host'; | ||
import { WebAnimationsDriver } from './dom/web_animations_driver'; | ||
export var __platform_browser_private__ = { | ||
@@ -29,2 +30,8 @@ BrowserPlatformLocation: location.BrowserPlatformLocation, | ||
DomRootRenderer: dom_renderer.DomRootRenderer, | ||
NAMESPACE_URIS: dom_renderer.NAMESPACE_URIS, | ||
shimContentAttribute: dom_renderer.shimContentAttribute, | ||
shimHostAttribute: dom_renderer.shimHostAttribute, | ||
flattenStyles: dom_renderer.flattenStyles, | ||
splitNamespace: dom_renderer.splitNamespace, | ||
isNamespaced: dom_renderer.isNamespaced, | ||
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost, | ||
@@ -38,4 +45,5 @@ SharedStylesHost: shared_styles_host.SharedStylesHost, | ||
INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS, | ||
BROWSER_SANITIZATION_PROVIDERS: browser.BROWSER_SANITIZATION_PROVIDERS | ||
BROWSER_SANITIZATION_PROVIDERS: browser.BROWSER_SANITIZATION_PROVIDERS, | ||
WebAnimationsDriver: WebAnimationsDriver | ||
}; | ||
//# sourceMappingURL=private_export.js.map |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"___platform_browser_private__":{"BrowserPlatformLocation":{"__symbolic":"reference","module":"./browser/location/browser_platform_location","name":"BrowserPlatformLocation"},"DomAdapter":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"DomAdapter"},"BrowserDomAdapter":{"__symbolic":"reference","module":"./browser/browser_adapter","name":"BrowserDomAdapter"},"BrowserGetTestability":{"__symbolic":"reference","module":"./browser/testability","name":"BrowserGetTestability"},"getDOM":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"getDOM"},"setRootDomAdapter":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"setRootDomAdapter"},"DomRootRenderer_":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"DomRootRenderer_"},"DomRootRenderer":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"DomRootRenderer"},"DomSharedStylesHost":{"__symbolic":"reference","module":"./dom/shared_styles_host","name":"DomSharedStylesHost"},"SharedStylesHost":{"__symbolic":"reference","module":"./dom/shared_styles_host","name":"SharedStylesHost"},"ELEMENT_PROBE_PROVIDERS":{"__symbolic":"reference","module":"./dom/debug/ng_probe","name":"ELEMENT_PROBE_PROVIDERS"},"DomEventsPlugin":{"__symbolic":"reference","module":"./dom/events/dom_events","name":"DomEventsPlugin"},"KeyEventsPlugin":{"__symbolic":"reference","module":"./dom/events/key_events","name":"KeyEventsPlugin"},"HammerGesturesPlugin":{"__symbolic":"reference","module":"./dom/events/hammer_gestures","name":"HammerGesturesPlugin"},"initDomAdapter":{"__symbolic":"reference","module":"./browser","name":"initDomAdapter"},"INTERNAL_BROWSER_PLATFORM_PROVIDERS":{"__symbolic":"reference","module":"./browser","name":"INTERNAL_BROWSER_PLATFORM_PROVIDERS"},"BROWSER_SANITIZATION_PROVIDERS":{"__symbolic":"reference","module":"./browser","name":"BROWSER_SANITIZATION_PROVIDERS"}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"___platform_browser_private__":{"BrowserPlatformLocation":{"__symbolic":"reference","module":"./browser/location/browser_platform_location","name":"BrowserPlatformLocation"},"DomAdapter":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"DomAdapter"},"BrowserDomAdapter":{"__symbolic":"reference","module":"./browser/browser_adapter","name":"BrowserDomAdapter"},"BrowserGetTestability":{"__symbolic":"reference","module":"./browser/testability","name":"BrowserGetTestability"},"getDOM":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"getDOM"},"setRootDomAdapter":{"__symbolic":"reference","module":"./dom/dom_adapter","name":"setRootDomAdapter"},"DomRootRenderer_":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"DomRootRenderer_"},"DomRootRenderer":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"DomRootRenderer"},"NAMESPACE_URIS":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"NAMESPACE_URIS"},"shimContentAttribute":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"shimContentAttribute"},"shimHostAttribute":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"shimHostAttribute"},"flattenStyles":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"flattenStyles"},"splitNamespace":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"splitNamespace"},"isNamespaced":{"__symbolic":"reference","module":"./dom/dom_renderer","name":"isNamespaced"},"DomSharedStylesHost":{"__symbolic":"reference","module":"./dom/shared_styles_host","name":"DomSharedStylesHost"},"SharedStylesHost":{"__symbolic":"reference","module":"./dom/shared_styles_host","name":"SharedStylesHost"},"ELEMENT_PROBE_PROVIDERS":{"__symbolic":"reference","module":"./dom/debug/ng_probe","name":"ELEMENT_PROBE_PROVIDERS"},"DomEventsPlugin":{"__symbolic":"reference","module":"./dom/events/dom_events","name":"DomEventsPlugin"},"KeyEventsPlugin":{"__symbolic":"reference","module":"./dom/events/key_events","name":"KeyEventsPlugin"},"HammerGesturesPlugin":{"__symbolic":"reference","module":"./dom/events/hammer_gestures","name":"HammerGesturesPlugin"},"initDomAdapter":{"__symbolic":"reference","module":"./browser","name":"initDomAdapter"},"INTERNAL_BROWSER_PLATFORM_PROVIDERS":{"__symbolic":"reference","module":"./browser","name":"INTERNAL_BROWSER_PLATFORM_PROVIDERS"},"BROWSER_SANITIZATION_PROVIDERS":{"__symbolic":"reference","module":"./browser","name":"BROWSER_SANITIZATION_PROVIDERS"},"WebAnimationsDriver":{"__symbolic":"reference","module":"./dom/web_animations_driver","name":"WebAnimationsDriver"}}}} |
@@ -11,2 +11,3 @@ /** | ||
export declare var RenderDebugInfo: typeof r.RenderDebugInfo; | ||
export declare type DirectRenderer = typeof r._DirectRenderer; | ||
export declare var ReflectionCapabilities: typeof r.ReflectionCapabilities; | ||
@@ -13,0 +14,0 @@ export declare type DebugDomRootRenderer = typeof r._DebugDomRootRenderer; |
@@ -9,4 +9,3 @@ /** | ||
import { NgZone } from '@angular/core'; | ||
import { MapWrapper } from './facade/collection'; | ||
import { global, isPresent } from './facade/lang'; | ||
import { global } from './facade/lang'; | ||
import { getDOM } from './private_import_platform-browser'; | ||
@@ -19,8 +18,6 @@ export var BrowserDetection = (function () { | ||
get: function () { | ||
if (isPresent(this._overrideUa)) { | ||
if (typeof this._overrideUa === 'string') { | ||
return this._overrideUa; | ||
} | ||
else { | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
} | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
}, | ||
@@ -143,3 +140,3 @@ enumerable: true, | ||
var attributeMap = getDOM().attributeMap(el); | ||
var keys = MapWrapper.keys(attributeMap).sort(); | ||
var keys = Array.from(attributeMap.keys()).sort(); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -158,3 +155,3 @@ var key = keys[i]; | ||
var childrenRoot = getDOM().templateAwareRoot(el); | ||
var children = isPresent(childrenRoot) ? getDOM().childNodes(childrenRoot) : []; | ||
var children = childrenRoot ? getDOM().childNodes(childrenRoot) : []; | ||
for (var j = 0; j < children.length; j++) { | ||
@@ -161,0 +158,0 @@ result += stringifyElement(children[j]); |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"el":{"__symbolic":"function","parameters":["html"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"firstChild"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"content"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"createTemplate"},"arguments":[{"__symbolic":"reference","name":"html"}]}]}]}},"normalizeCSS":{"__symbolic":"function","parameters":["css"],"value":{"__symbolic":"error","message":"Expression form not supported","line":90,"character":15}},"browserDetection":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"BrowserDetection"},"arguments":[null]},"createNgZone":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgZone"},"arguments":[{"enableLongStackTrace":true}]}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"el":{"__symbolic":"function","parameters":["html"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"firstChild"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"content"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"./private_import_platform-browser","name":"getDOM"}},"member":"createTemplate"},"arguments":[{"__symbolic":"reference","name":"html"}]}]}]}},"normalizeCSS":{"__symbolic":"function","parameters":["css"],"value":{"__symbolic":"error","message":"Expression form not supported","line":89,"character":15}},"browserDetection":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"BrowserDetection"},"arguments":[null]},"createNgZone":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgZone"},"arguments":[{"enableLongStackTrace":true}]}}}} |
@@ -41,3 +41,2 @@ | ||
static parseIntAutoRadix(text: string): number; | ||
static parseInt(text: string, radix: number): number; | ||
static isNumeric(value: any): boolean; | ||
@@ -44,0 +43,0 @@ } |
@@ -54,3 +54,3 @@ /** | ||
} | ||
if (token === undefined || token === null) { | ||
if (token == null) { | ||
return '' + token; | ||
@@ -78,21 +78,2 @@ } | ||
}; | ||
NumberWrapper.parseInt = function (text, radix) { | ||
if (radix == 10) { | ||
if (/^(\-|\+)?[0-9]+$/.test(text)) { | ||
return parseInt(text, radix); | ||
} | ||
} | ||
else if (radix == 16) { | ||
if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) { | ||
return parseInt(text, radix); | ||
} | ||
} | ||
else { | ||
var result = parseInt(text, radix); | ||
if (!isNaN(result)) { | ||
return result; | ||
} | ||
} | ||
throw new Error('Invalid integer literal when parsing ' + text + ' in base ' + radix); | ||
}; | ||
NumberWrapper.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; | ||
@@ -118,8 +99,8 @@ return NumberWrapper; | ||
while (parts.length > 1) { | ||
var name = parts.shift(); | ||
if (obj.hasOwnProperty(name) && isPresent(obj[name])) { | ||
obj = obj[name]; | ||
var name_1 = parts.shift(); | ||
if (obj.hasOwnProperty(name_1) && obj[name_1] != null) { | ||
obj = obj[name_1]; | ||
} | ||
else { | ||
obj = obj[name] = {}; | ||
obj = obj[name_1] = {}; | ||
} | ||
@@ -126,0 +107,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":199,"character":19}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":123,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":123,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":127,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":127,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":182,"character":19}}}} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
650526
151
7506