angular2
Version:
Angular 2 - a web framework for modern web apps
1 lines • 15.7 kB
Source Map (JSON)
{"version":3,"sources":["proto_view_factory.js"],"names":[],"mappings":"AAAA;AAAA,KAAK,iBAAiB,AAAC,CAAC,MAAK,QAAQ;kBAArC,EAAC,GAAE,YAAqB;AAAE,6BAAwB;IAAE,AAA9B,CAAC;AAAvB,WAAS,CAAT,EAAC,KAAI,CAAO,KAAG,AAAS,CAAC;CAAgC,CAAC;;;;;;;;;;EAAlD,WAAS,EAAjB,EAAC,qBAAoB,CAAA,OAAM,AAAC,eAAkB,CACtC,CAAA,sBAAqB,+BAA2B,CAAA,sBAAqB,GAAK,EAAC,OAAM,qBAAmB,CAAC,AAD/D,CACgE;SAD9G,EAAC,8CAAoB,CAAA,OAAM,AAAC,kCAAkB,CACtC,CAAA,+CAAqB,wDAA2B,CAAA,+CAAqB,GAAK,EAAC,OAAM,8CAAmB,CAAC,AAD/D,CACgE;AAAtG,OAAG;AAAG,cAAU;AAAG,aAAS;SADpC,EAAC,wCAAoB,CAAA,OAAM,AAAC,4BAAkB,CACtC,CAAA,yCAAqB,kDAA2B,CAAA,yCAAqB,GAAK,EAAC,OAAM,wCAAmB,CAAC,AAD/D,CACgE;AACtG,YAAQ;AAAG,UAAM;EACjB,UAAQ,EAHhB,EAAC,kDAAoB,CAAA,OAAM,AAAC,sCAAkB,CACtC,CAAA,mDAAqB,4DAA2B,CAAA,mDAAqB,GAAK,EAAC,OAAM,kDAAmB,CAAC,AAD/D,CACgE;EAItG,gBAAc,EALtB,EAAC,sCAAoB,CAAA,OAAM,AAAC,6BAAkB,CACtC,CAAA,uCAAqB,gDAA2B,CAAA,uCAAqB,GAAK,EAAC,OAAM,sCAAmB,CAAC,AAD/D,CACgE;SAD9G,EAAC,6CAAoB,CAAA,OAAM,AAAC,8BAAkB,CACtC,CAAA,8CAAqB,uDAA2B,CAAA,8CAAqB,GAAK,EAAC,OAAM,6CAAmB,CAAC,AAD/D,CACgE;AAKtG,YAAQ;AAAG,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,AAAC,gDAAwD;AAArF,KAAK,eAAe,AAAC,sDACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,YAmLS,oBAAmB,IApLtD,eAAc,KAAO,UAC4B;EAAC,CAAC,CAAC,CAAC;AAwLrD","file":"angular2/src/core/compiler/proto_view_factory.js","sourcesContent":["import {Injectable} from 'angular2/di';\nimport {List, ListWrapper, MapWrapper} from 'angular2/src/facade/collection';\nimport {isPresent, isBlank} from 'angular2/src/facade/lang';\nimport {reflector} from 'angular2/src/reflection/reflection';\n\nimport {ChangeDetection} from 'angular2/change_detection';\nimport {Component, Viewport, DynamicComponent} from '../annotations/annotations';\n\nimport * as renderApi from 'angular2/src/render/api';\nimport {AppProtoView} from './view';\nimport {ProtoElementInjector, DirectiveBinding} from './element_injector';\n\n@Injectable()\nexport class ProtoViewFactory {\n _changeDetection:ChangeDetection;\n\n constructor(changeDetection:ChangeDetection) {\n this._changeDetection = changeDetection;\n }\n\n createProtoView(componentBinding:DirectiveBinding, renderProtoView: renderApi.ProtoViewDto, directives:List<DirectiveBinding>):AppProtoView {\n var protoChangeDetector;\n if (isBlank(componentBinding)) {\n protoChangeDetector = this._changeDetection.createProtoChangeDetector('root', null);\n } else {\n var componentAnnotation:Component = componentBinding.annotation;\n protoChangeDetector = this._changeDetection.createProtoChangeDetector(\n 'dummy', componentAnnotation.changeDetection\n );\n }\n var protoView = new AppProtoView(renderProtoView.render, protoChangeDetector);\n\n for (var i=0; i<renderProtoView.elementBinders.length; i++) {\n var renderElementBinder = renderProtoView.elementBinders[i];\n var sortedDirectives = new SortedDirectives(renderElementBinder.directives, directives);\n var parentPeiWithDistance = this._findParentProtoElementInjectorWithDistance(\n i, protoView.elementBinders, renderProtoView.elementBinders\n );\n var protoElementInjector = this._createProtoElementInjector(\n i, parentPeiWithDistance,\n sortedDirectives, renderElementBinder\n );\n this._createElementBinder(\n protoView, renderElementBinder, protoElementInjector, sortedDirectives\n );\n this._createDirectiveBinders(protoView, sortedDirectives);\n }\n MapWrapper.forEach(renderProtoView.variableBindings, (mappedName, varName) => {\n protoView.bindVariable(varName, mappedName);\n });\n return protoView;\n }\n\n _findParentProtoElementInjectorWithDistance(binderIndex, elementBinders, renderElementBinders) {\n var distance = 0;\n do {\n var renderElementBinder = renderElementBinders[binderIndex];\n binderIndex = renderElementBinder.parentIndex;\n if (binderIndex !== -1) {\n distance += renderElementBinder.distanceToParent;\n var elementBinder = elementBinders[binderIndex];\n if (isPresent(elementBinder.protoElementInjector)) {\n return new ParentProtoElementInjectorWithDistance(elementBinder.protoElementInjector, distance);\n }\n }\n } while (binderIndex !== -1);\n return new ParentProtoElementInjectorWithDistance(null, -1);\n }\n\n _createProtoElementInjector(binderIndex, parentPeiWithDistance, sortedDirectives, renderElementBinder) {\n var protoElementInjector = null;\n // Create a protoElementInjector for any element that either has bindings *or* has one\n // or more var- defined. Elements with a var- defined need a their own element injector\n // so that, when hydrating, $implicit can be set to the element.\n var hasVariables = MapWrapper.size(renderElementBinder.variableBindings) > 0;\n if (sortedDirectives.directives.length > 0 || hasVariables) {\n protoElementInjector = new ProtoElementInjector(\n parentPeiWithDistance.protoElementInjector, binderIndex,\n sortedDirectives.directives,\n isPresent(sortedDirectives.componentDirective), parentPeiWithDistance.distance\n );\n protoElementInjector.attributes = renderElementBinder.readAttributes;\n // Viewport directives are treated differently than other element with var- definitions.\n if (hasVariables && !isPresent(sortedDirectives.viewportDirective)) {\n protoElementInjector.exportComponent = isPresent(sortedDirectives.componentDirective);\n protoElementInjector.exportElement = isBlank(sortedDirectives.componentDirective);\n\n // experiment\n var exportImplicitName = MapWrapper.get(renderElementBinder.variableBindings, '\\$implicit');\n if (isPresent(exportImplicitName)) {\n protoElementInjector.exportImplicitName = exportImplicitName;\n }\n }\n }\n return protoElementInjector;\n }\n\n _createElementBinder(protoView, renderElementBinder, protoElementInjector, sortedDirectives) {\n var parent = null;\n if (renderElementBinder.parentIndex !== -1) {\n parent = protoView.elementBinders[renderElementBinder.parentIndex];\n }\n var elBinder = protoView.bindElement(\n parent,\n renderElementBinder.distanceToParent,\n protoElementInjector,\n sortedDirectives.componentDirective,\n sortedDirectives.viewportDirective\n );\n // text nodes\n for (var i=0; i<renderElementBinder.textBindings.length; i++) {\n protoView.bindTextNode(renderElementBinder.textBindings[i]);\n }\n // element properties\n MapWrapper.forEach(renderElementBinder.propertyBindings, (astWithSource, propertyName) => {\n protoView.bindElementProperty(astWithSource, propertyName);\n });\n // events\n protoView.bindEvent(renderElementBinder.eventBindings, -1);\n // variables\n // The view's locals needs to have a full set of variable names at construction time\n // in order to prevent new variables from being set later in the lifecycle. Since we don't want\n // to actually create variable bindings for the $implicit bindings, add to the\n // protoLocals manually.\n MapWrapper.forEach(renderElementBinder.variableBindings, (mappedName, varName) => {\n MapWrapper.set(protoView.protoLocals, mappedName, null);\n });\n return elBinder;\n }\n\n _createDirectiveBinders(protoView, sortedDirectives) {\n for (var i=0; i<sortedDirectives.renderDirectives.length; i++) {\n var renderDirectiveMetadata = sortedDirectives.renderDirectives[i];\n // directive properties\n MapWrapper.forEach(renderDirectiveMetadata.propertyBindings, (astWithSource, propertyName) => {\n // TODO: these setters should eventually be created by change detection, to make\n // it monomorphic!\n var setter = reflector.setter(propertyName);\n protoView.bindDirectiveProperty(i, astWithSource, propertyName, setter);\n });\n // directive events\n protoView.bindEvent(renderDirectiveMetadata.eventBindings, i);\n }\n }\n\n}\n\nclass SortedDirectives {\n componentDirective: DirectiveBinding;\n viewportDirective: DirectiveBinding;\n renderDirectives: List<renderApi.DirectiveMetadata>;\n directives: List<DirectiveBinding>;\n\n constructor(renderDirectives, allDirectives) {\n this.renderDirectives = [];\n this.directives = [];\n this.viewportDirective = null;\n this.componentDirective = null;\n ListWrapper.forEach(renderDirectives, (renderDirectiveMetadata) => {\n var directiveBinding = allDirectives[renderDirectiveMetadata.directiveIndex];\n if ((directiveBinding.annotation instanceof Component) || (directiveBinding.annotation instanceof DynamicComponent)) {\n // component directives need to be the first binding in ElementInjectors!\n this.componentDirective = directiveBinding;\n ListWrapper.insert(this.renderDirectives, 0, renderDirectiveMetadata);\n ListWrapper.insert(this.directives, 0, directiveBinding);\n } else {\n if (directiveBinding.annotation instanceof Viewport) {\n this.viewportDirective = directiveBinding;\n }\n ListWrapper.push(this.renderDirectives, renderDirectiveMetadata);\n ListWrapper.push(this.directives, directiveBinding);\n }\n });\n\n }\n}\n\nclass ParentProtoElementInjectorWithDistance {\n protoElementInjector:ProtoElementInjector;\n distance:number;\n constructor(protoElementInjector:ProtoElementInjector, distance:number) {\n this.protoElementInjector = protoElementInjector;\n this.distance = distance;\n }\n}\n"]}