2015-02-05 21:33:57 -05:00
|
|
|
import {int, isBlank} from 'angular2/src/facade/lang';
|
2015-02-27 17:50:06 -05:00
|
|
|
import {DOM} from 'angular2/src/dom/dom_adapter';
|
2015-02-05 21:33:57 -05:00
|
|
|
import {MapWrapper} from 'angular2/src/facade/collection';
|
|
|
|
|
|
|
|
import {Parser, Lexer, ChangeDetector, ChangeDetection}
|
|
|
|
from 'angular2/change_detection';
|
2015-02-16 08:55:00 -05:00
|
|
|
import {ExceptionHandler} from 'angular2/src/core/exception_handler';
|
2015-02-13 20:30:56 -05:00
|
|
|
import {
|
2015-03-10 15:30:50 -04:00
|
|
|
bootstrap, Component, Viewport, Template, ViewContainer, Compiler, onChange, NgElement, Decorator
|
2015-02-13 20:30:56 -05:00
|
|
|
} from 'angular2/angular2';
|
2015-03-11 14:57:21 -04:00
|
|
|
import {reflector} from 'angular2/src/reflection/reflection';
|
2015-02-05 21:33:57 -05:00
|
|
|
import {CompilerCache} from 'angular2/src/core/compiler/compiler';
|
|
|
|
import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader';
|
2015-04-07 23:54:20 -04:00
|
|
|
import {ShadowDomStrategy} from 'angular2/src/render/dom/shadow_dom/shadow_dom_strategy';
|
|
|
|
import {NativeShadowDomStrategy} from 'angular2/src/render/dom/shadow_dom/native_shadow_dom_strategy';
|
|
|
|
import {EmulatedUnscopedShadowDomStrategy} from 'angular2/src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy';
|
2015-04-02 17:40:49 -04:00
|
|
|
import {TemplateLoader} from 'angular2/src/render/dom/compiler/template_loader';
|
2015-02-12 08:44:59 -05:00
|
|
|
import {TemplateResolver} from 'angular2/src/core/compiler/template_resolver';
|
2015-02-05 21:33:57 -05:00
|
|
|
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
2015-04-02 12:52:00 -04:00
|
|
|
import {XHR} from 'angular2/src/services/xhr';
|
|
|
|
import {XHRImpl} from 'angular2/src/services/xhr_impl';
|
|
|
|
import {UrlResolver} from 'angular2/src/services/url_resolver';
|
2015-04-02 17:40:49 -04:00
|
|
|
import {StyleUrlResolver} from 'angular2/src/render/dom/shadow_dom/style_url_resolver';
|
2015-02-24 10:05:45 -05:00
|
|
|
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
2015-04-02 17:40:49 -04:00
|
|
|
import {StyleInliner} from 'angular2/src/render/dom/shadow_dom/style_inliner';
|
2015-03-24 05:19:05 -04:00
|
|
|
import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
|
2015-03-23 19:46:18 -04:00
|
|
|
import {TestabilityRegistry, Testability} from 'angular2/src/core/testability/testability';
|
2015-02-05 21:33:57 -05:00
|
|
|
|
2015-03-13 19:22:01 -04:00
|
|
|
import {If, For} from 'angular2/directives';
|
2015-02-05 21:33:57 -05:00
|
|
|
import {App, setupReflectorForApp} from './app';
|
|
|
|
import {ScrollAreaComponent, setupReflectorForScrollArea} from './scroll_area';
|
|
|
|
import {ScrollItemComponent, setupReflectorForScrollItem} from './scroll_item';
|
|
|
|
import {CompanyNameComponent, OpportunityNameComponent, OfferingNameComponent,
|
|
|
|
AccountCellComponent, StageButtonsComponent, FormattedCellComponent,
|
|
|
|
setupReflectorForCells}
|
|
|
|
from './cells';
|
|
|
|
|
2015-04-02 12:52:00 -04:00
|
|
|
import {EventManager} from 'angular2/src/render/dom/events/event_manager';
|
2015-04-07 23:54:20 -04:00
|
|
|
import {ViewFactory, VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_factory';
|
|
|
|
import {ProtoViewFactory} from 'angular2/src/core/compiler/proto_view_factory';
|
|
|
|
import {Renderer} from 'angular2/src/render/api';
|
|
|
|
import {DirectDomRenderer} from 'angular2/src/render/dom/direct_dom_renderer';
|
|
|
|
import * as rc from 'angular2/src/render/dom/compiler/compiler';
|
|
|
|
import * as rvf from 'angular2/src/render/dom/view/view_factory';
|
|
|
|
import {Inject} from 'angular2/di';
|
2015-03-24 05:19:05 -04:00
|
|
|
|
2015-02-05 21:33:57 -05:00
|
|
|
export function main() {
|
|
|
|
setupReflector();
|
|
|
|
bootstrap(App);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setupReflector() {
|
|
|
|
setupReflectorForAngular();
|
|
|
|
setupReflectorForApp();
|
|
|
|
setupReflectorForScrollArea();
|
|
|
|
setupReflectorForScrollItem();
|
|
|
|
setupReflectorForCells();
|
|
|
|
|
|
|
|
reflector.registerGetters({
|
|
|
|
'scrollAreas': (o) => o.scrollAreas,
|
|
|
|
'length': (o) => o.length,
|
2015-02-12 17:56:41 -05:00
|
|
|
'iterableChanges': (o) => o.iterableChanges,
|
2015-02-05 21:33:57 -05:00
|
|
|
'scrollArea': (o) => o.scrollArea,
|
|
|
|
'item': (o) => o.item,
|
|
|
|
'visibleItems': (o) => o.visibleItems,
|
|
|
|
'condition': (o) => o.condition,
|
|
|
|
'width': (o) => o.width,
|
|
|
|
'value': (o) => o.value,
|
|
|
|
'href': (o) => o.href,
|
|
|
|
'company': (o) => o.company,
|
|
|
|
'formattedValue': (o) => o.formattedValue,
|
|
|
|
'name': (o) => o.name,
|
|
|
|
'style': (o) => o.style,
|
|
|
|
'offering': (o) => o.offering,
|
|
|
|
'account': (o) => o.account,
|
|
|
|
'accountId': (o) => o.accountId,
|
|
|
|
'companyNameWidth': (o) => o.companyNameWidth,
|
|
|
|
'opportunityNameWidth': (o) => o.opportunityNameWidth,
|
|
|
|
'offeringNameWidth': (o) => o.offeringNameWidth,
|
|
|
|
'accountCellWidth': (o) => o.accountCellWidth,
|
|
|
|
'basePointsWidth': (o) => o.basePointsWidth,
|
|
|
|
'scrollDivStyle': (o) => o.scrollDivStyle,
|
|
|
|
'paddingStyle': (o) => o.paddingStyle,
|
|
|
|
'innerStyle': (o) => o.innerStyle,
|
|
|
|
'opportunity': (o) => o.opportunity,
|
|
|
|
'itemStyle': (o) => o.itemStyle,
|
|
|
|
'dueDateWidth': (o) => o.dueDateWidth,
|
|
|
|
'basePoints': (o) => o.basePoints,
|
|
|
|
'kickerPoints': (o) => o.kickerPoints,
|
|
|
|
'kickerPointsWidth': (o) => o.kickerPointsWidth,
|
|
|
|
'bundles': (o) => o.bundles,
|
|
|
|
'stageButtonsWidth': (o) => o.stageButtonsWidth,
|
|
|
|
'bundlesWidth': (o) => o.bundlesWidth,
|
|
|
|
'disabled': (o) => o.disabled,
|
|
|
|
'isDisabled': (o) => o.isDisabled,
|
|
|
|
'dueDate': (o) => o.dueDate,
|
|
|
|
'endDate': (o) => o.endDate,
|
|
|
|
'aatStatus': (o) => o.aatStatus,
|
|
|
|
'stage': (o) => o.stage,
|
|
|
|
'stages': (o) => o.stages,
|
|
|
|
'aatStatusWidth': (o) => o.aatStatusWidth,
|
|
|
|
'endDateWidth': (o) => o.endDateWidth,
|
2015-04-09 20:36:53 -04:00
|
|
|
'$event': (o) => null
|
2015-02-05 21:33:57 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerSetters({
|
|
|
|
'scrollAreas': (o, v) => o.scrollAreas = v,
|
|
|
|
'length': (o, v) => o.length = v,
|
|
|
|
'condition': (o, v) => o.condition = v,
|
|
|
|
'scrollArea': (o, v) => o.scrollArea = v,
|
|
|
|
'item': (o, v) => o.item = v,
|
|
|
|
'visibleItems': (o, v) => o.visibleItems = v,
|
2015-02-12 17:56:41 -05:00
|
|
|
'iterableChanges': (o, v) => o.iterableChanges = v,
|
2015-02-05 21:33:57 -05:00
|
|
|
'width': (o, v) => o.width = v,
|
|
|
|
'value': (o, v) => o.value = v,
|
|
|
|
'company': (o, v) => o.company = v,
|
|
|
|
'name': (o, v) => o.name = v,
|
|
|
|
'offering': (o, v) => o.offering = v,
|
|
|
|
'account': (o, v) => o.account = v,
|
|
|
|
'accountId': (o, v) => o.accountId = v,
|
|
|
|
'formattedValue': (o, v) => o.formattedValue = v,
|
|
|
|
'stage': (o, v) => o.stage = v,
|
|
|
|
'stages': (o, v) => o.stages = v,
|
|
|
|
'disabled': (o, v) => o.disabled = v,
|
|
|
|
'isDisabled': (o, v) => o.isDisabled = v,
|
|
|
|
'href': (o, v) => o.href = v,
|
|
|
|
'companyNameWidth': (o, v) => o.companyNameWidth = v,
|
|
|
|
'opportunityNameWidth': (o, v) => o.opportunityNameWidth = v,
|
|
|
|
'offeringNameWidth': (o, v) => o.offeringNameWidth = v,
|
|
|
|
'accountCellWidth': (o, v) => o.accountCellWidth = v,
|
|
|
|
'basePointsWidth': (o, v) => o.basePointsWidth = v,
|
|
|
|
'scrollDivStyle': (o, v) => o.scrollDivStyle = v,
|
|
|
|
'paddingStyle': (o, v) => o.paddingStyle = v,
|
|
|
|
'innerStyle': (o, v) => o.innerStyle = v,
|
|
|
|
'opportunity': (o, v) => o.opportunity = v,
|
|
|
|
'itemStyle': (o, v) => o.itemStyle = v,
|
|
|
|
'basePoints': (o, v) => o.basePoints = v,
|
|
|
|
'kickerPoints': (o, v) => o.kickerPoints = v,
|
|
|
|
'kickerPointsWidth': (o, v) => o.kickerPointsWidth = v,
|
|
|
|
'stageButtonsWidth': (o, v) => o.stageButtonsWidth = v,
|
|
|
|
'dueDate': (o, v) => o.dueDate = v,
|
|
|
|
'dueDateWidth': (o, v) => o.dueDateWidth = v,
|
|
|
|
'endDate': (o, v) => o.endDate = v,
|
|
|
|
'endDateWidth': (o, v) => o.endDate = v,
|
|
|
|
'aatStatus': (o, v) => o.aatStatus = v,
|
|
|
|
'aatStatusWidth': (o, v) => o.aatStatusWidth = v,
|
|
|
|
'bundles': (o, v) => o.bundles = v,
|
|
|
|
'bundlesWidth': (o, v) => o.bundlesWidth = v,
|
2015-03-20 13:44:51 -04:00
|
|
|
'if': (o, v) => {},
|
|
|
|
'of': (o, v) => {},
|
|
|
|
'cellWidth': (o, v) => o.cellWidth = v,
|
2015-04-09 20:36:53 -04:00
|
|
|
'$event': (o, v) => null,
|
2015-02-05 21:33:57 -05:00
|
|
|
'style': (o, m) => {
|
|
|
|
//if (isBlank(m)) return;
|
|
|
|
// HACK
|
|
|
|
MapWrapper.forEach(m, function(v, k) {
|
|
|
|
o.style.setProperty(k, v);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerMethods({
|
|
|
|
'onScroll': (o, args) => {
|
|
|
|
// HACK
|
|
|
|
o.onScroll(args[0]);
|
|
|
|
},
|
|
|
|
'setStage': (o, args) => o.setStage(args[0])
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setupReflectorForAngular() {
|
2015-02-04 16:27:31 -05:00
|
|
|
reflector.registerType(If, {
|
|
|
|
'factory': (vp) => new If(vp),
|
2015-02-12 05:54:22 -05:00
|
|
|
'parameters': [[ViewContainer]],
|
|
|
|
'annotations' : [new Viewport({
|
2015-02-04 16:27:31 -05:00
|
|
|
selector: '[if]',
|
2015-02-05 21:33:57 -05:00
|
|
|
bind: {
|
2015-02-17 15:55:18 -05:00
|
|
|
'condition': 'if'
|
2015-02-05 21:33:57 -05:00
|
|
|
}
|
|
|
|
})]
|
|
|
|
});
|
|
|
|
|
2015-03-13 19:22:01 -04:00
|
|
|
reflector.registerType(For, {
|
|
|
|
'factory': (vp) => new For(vp),
|
2015-02-12 05:54:22 -05:00
|
|
|
'parameters': [[ViewContainer]],
|
|
|
|
'annotations' : [new Viewport({
|
2015-03-13 19:22:01 -04:00
|
|
|
selector: '[for]',
|
2015-02-05 21:33:57 -05:00
|
|
|
bind: {
|
2015-03-13 19:22:01 -04:00
|
|
|
'iterableChanges': 'of | iterableDiff'
|
2015-02-05 21:33:57 -05:00
|
|
|
}
|
|
|
|
})]
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(Compiler, {
|
2015-04-07 23:54:20 -04:00
|
|
|
"factory": (reader, compilerCache, tplResolver, cmpUrlMapper, urlResolver, renderer,
|
|
|
|
protoViewFactory) =>
|
|
|
|
new Compiler(reader, compilerCache, tplResolver, cmpUrlMapper, urlResolver, renderer,
|
|
|
|
protoViewFactory),
|
|
|
|
"parameters": [[DirectiveMetadataReader], [CompilerCache], [TemplateResolver], [ComponentUrlMapper],
|
|
|
|
[UrlResolver], [Renderer], [ProtoViewFactory]],
|
2015-02-05 23:47:30 -05:00
|
|
|
"annotations": []
|
2015-02-05 21:33:57 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(CompilerCache, {
|
|
|
|
'factory': () => new CompilerCache(),
|
|
|
|
'parameters': [],
|
|
|
|
'annotations': []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(Parser, {
|
|
|
|
'factory': (lexer) => new Parser(lexer),
|
|
|
|
'parameters': [[Lexer]],
|
|
|
|
'annotations': []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(TemplateLoader, {
|
2015-02-24 10:05:45 -05:00
|
|
|
"factory": (xhr, urlResolver) => new TemplateLoader(xhr, urlResolver),
|
|
|
|
"parameters": [[XHR], [UrlResolver]],
|
2015-02-05 23:47:30 -05:00
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-02-12 08:44:59 -05:00
|
|
|
reflector.registerType(TemplateResolver, {
|
|
|
|
"factory": () => new TemplateResolver(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-02-05 23:47:30 -05:00
|
|
|
reflector.registerType(XHR, {
|
|
|
|
"factory": () => new XHRImpl(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
2015-02-05 21:33:57 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(DirectiveMetadataReader, {
|
|
|
|
'factory': () => new DirectiveMetadataReader(),
|
|
|
|
'parameters': [],
|
|
|
|
'annotations': []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(Lexer, {
|
|
|
|
'factory': () => new Lexer(),
|
|
|
|
'parameters': [],
|
|
|
|
'annotations': []
|
|
|
|
});
|
|
|
|
|
2015-02-16 08:55:00 -05:00
|
|
|
reflector.registerType(ExceptionHandler, {
|
|
|
|
"factory": () => new ExceptionHandler(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-02-05 21:33:57 -05:00
|
|
|
reflector.registerType(LifeCycle, {
|
2015-02-16 08:55:00 -05:00
|
|
|
"factory": (exHandler, cd) => new LifeCycle(exHandler, cd),
|
2015-02-25 10:30:30 -05:00
|
|
|
"parameters": [[ExceptionHandler], [ChangeDetector]],
|
2015-02-05 21:33:57 -05:00
|
|
|
"annotations": []
|
|
|
|
});
|
2015-02-05 23:47:30 -05:00
|
|
|
|
|
|
|
reflector.registerType(ShadowDomStrategy, {
|
2015-02-24 10:05:45 -05:00
|
|
|
"factory": (strategy) => strategy,
|
|
|
|
"parameters": [[NativeShadowDomStrategy]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(NativeShadowDomStrategy, {
|
|
|
|
"factory": (styleUrlResolver) => new NativeShadowDomStrategy(styleUrlResolver),
|
|
|
|
"parameters": [[StyleUrlResolver]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-03-10 15:30:50 -04:00
|
|
|
reflector.registerType(EmulatedUnscopedShadowDomStrategy, {
|
|
|
|
"factory": (styleUrlResolver) => new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, null),
|
|
|
|
"parameters": [[StyleUrlResolver]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-02-24 10:05:45 -05:00
|
|
|
reflector.registerType(StyleUrlResolver, {
|
|
|
|
"factory": (urlResolver) => new StyleUrlResolver(urlResolver),
|
|
|
|
"parameters": [[UrlResolver]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(UrlResolver, {
|
|
|
|
"factory": () => new UrlResolver(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(ComponentUrlMapper, {
|
|
|
|
"factory": () => new ComponentUrlMapper(),
|
2015-02-05 23:47:30 -05:00
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-03-23 19:46:18 -04:00
|
|
|
reflector.registerType(TestabilityRegistry, {
|
|
|
|
"factory": () => new TestabilityRegistry(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(Testability, {
|
|
|
|
"factory": () => new Testability(),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
2015-02-24 10:05:45 -05:00
|
|
|
reflector.registerType(StyleInliner, {
|
2015-02-26 11:08:37 -05:00
|
|
|
"factory": (xhr, styleUrlResolver, urlResolver) =>
|
|
|
|
new StyleInliner(xhr, styleUrlResolver, urlResolver),
|
|
|
|
"parameters": [[XHR], [StyleUrlResolver], [UrlResolver]],
|
2015-02-24 10:05:45 -05:00
|
|
|
"annotations": []
|
|
|
|
});
|
2015-03-02 09:02:48 -05:00
|
|
|
|
2015-03-24 05:19:05 -04:00
|
|
|
reflector.registerType(EventManager, {
|
|
|
|
"factory": () => new EventManager([], null),
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(PrivateComponentLoader, {
|
2015-04-07 23:54:20 -04:00
|
|
|
"factory": (compiler, reader, viewFactory) =>
|
|
|
|
new PrivateComponentLoader(compiler, reader, viewFactory),
|
|
|
|
"parameters": [[Compiler], [DirectiveMetadataReader], [ViewFactory]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(DirectDomRenderer, {
|
|
|
|
"factory": (renderCompiler, renderViewFactory, shadowDomStrategy) =>
|
|
|
|
new DirectDomRenderer(renderCompiler, renderViewFactory, shadowDomStrategy),
|
|
|
|
"parameters": [[rc.Compiler], [rvf.ViewFactory], [ShadowDomStrategy]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(rc.DefaultCompiler, {
|
|
|
|
"factory": (parser, shadowDomStrategy, templateLoader) =>
|
|
|
|
new rc.DefaultCompiler(parser, shadowDomStrategy, templateLoader),
|
|
|
|
"parameters": [[Parser], [ShadowDomStrategy], [TemplateLoader]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(rvf.ViewFactory, {
|
|
|
|
"factory": (capacity, eventManager, shadowDomStrategy) =>
|
|
|
|
new rvf.ViewFactory(capacity, eventManager, shadowDomStrategy),
|
|
|
|
"parameters": [[new Inject(rvf.VIEW_POOL_CAPACITY)], [EventManager], [ShadowDomStrategy]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(rvf.VIEW_POOL_CAPACITY, {
|
|
|
|
"factory": () => 100000,
|
|
|
|
"parameters": [],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(ProtoViewFactory, {
|
|
|
|
"factory": (changeDetection, renderer) =>
|
|
|
|
new ProtoViewFactory(changeDetection, renderer),
|
|
|
|
"parameters": [[ChangeDetection], [Renderer]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(ViewFactory, {
|
|
|
|
"factory": (capacity) =>
|
|
|
|
new ViewFactory(capacity),
|
|
|
|
"parameters": [[new Inject(VIEW_POOL_CAPACITY)]],
|
|
|
|
"annotations": []
|
|
|
|
});
|
|
|
|
|
|
|
|
reflector.registerType(VIEW_POOL_CAPACITY, {
|
|
|
|
"factory": () => 100000,
|
|
|
|
"parameters": [],
|
2015-03-24 05:19:05 -04:00
|
|
|
"annotations": []
|
|
|
|
});
|
2015-02-05 21:33:57 -05:00
|
|
|
}
|