diff --git a/modules/benchmarks/src/naive_infinite_scroll/cells.ts b/modules/benchmarks/src/naive_infinite_scroll/cells.ts index 57a605ed289a2b..af0097bd125695 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/cells.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/cells.ts @@ -1,31 +1,31 @@ -import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/facade/collection'; +import {List, ListWrapper, Map} from 'angular2/src/facade/collection'; import {Company, Opportunity, Offering, Account, CustomDate, STATUS_LIST} from './common'; import {NgFor} from 'angular2/directives'; import {Component, Directive, View} from 'angular2/angular2'; export class HasStyle { - style: Map; + cellWidth: int; - constructor() { this.style = new Map(); } + constructor() {} - set width(w) { this.style.set('width', w); } + set width(w: int) { this.cellWidth = w; } } @Component({selector: 'company-name', properties: ['width: cell-width', 'company']}) -@View({directives: [], template: `
{{company.name}}
`}) +@View({directives: [], template: `
{{company.name}}
`}) export class CompanyNameComponent extends HasStyle { company: Company; } @Component({selector: 'opportunity-name', properties: ['width: cell-width', 'opportunity']}) -@View({directives: [], template: `
{{opportunity.name}}
`}) +@View({directives: [], template: `
{{opportunity.name}}
`}) export class OpportunityNameComponent extends HasStyle { opportunity: Opportunity; } @Component({selector: 'offering-name', properties: ['width: cell-width', 'offering']}) -@View({directives: [], template: `
{{offering.name}}
`}) +@View({directives: [], template: `
{{offering.name}}
`}) export class OfferingNameComponent extends HasStyle { offering: Offering; } @@ -33,7 +33,7 @@ export class OfferingNameComponent extends HasStyle { export class Stage { name: string; isDisabled: boolean; - style: Map; + backgroundColor: string; apply: Function; } @@ -41,10 +41,10 @@ export class Stage { @View({ directives: [NgFor], template: ` -
+
@@ -73,9 +73,7 @@ export class StageButtonsComponent extends HasStyle { var stage = new Stage(); stage.name = status; stage.isDisabled = disabled; - var stageStyle = new Map(); - stageStyle.set('background-color', disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD'); - stage.style = stageStyle; + stage.backgroundColor = disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD'; if (isCurrent) { disabled = false; } @@ -88,7 +86,7 @@ export class StageButtonsComponent extends HasStyle { @View({ directives: [], template: ` -
+
{{account.accountId}} @@ -99,7 +97,7 @@ export class AccountCellComponent extends HasStyle { } @Component({selector: 'formatted-cell', properties: ['width: cell-width', 'value']}) -@View({directives: [], template: `
{{formattedValue}}
`}) +@View({directives: [], template: `
{{formattedValue}}
`}) export class FormattedCellComponent extends HasStyle { formattedValue: string; diff --git a/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts b/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts index 92ba8a52052460..dbba86024a7561 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts @@ -1,4 +1,4 @@ -import {ListWrapper, MapWrapper} from 'angular2/src/facade/collection'; +import {ListWrapper} from 'angular2/src/facade/collection'; import {Math} from 'angular2/src/facade/math'; import {Component, Directive, View} from 'angular2/angular2'; @@ -24,7 +24,10 @@ import {NgFor} from 'angular2/directives'; template: `
@@ -47,12 +50,12 @@ export class ScrollAreaComponent { constructor() { this._fullList = generateOfferings(ITEMS); this.visibleItems = []; - this.scrollDivStyle = MapWrapper.createFromPairs([ - ['height', `${VIEW_PORT_HEIGHT}px`], - ['width', '1000px'], - ['border', '1px solid #000'], - ['overflow', 'scroll'] - ]); + this.scrollDivStyle = { + 'height': VIEW_PORT_HEIGHT, + 'width': 1000, + 'border': '1px solid #000', + 'overflow': 'scroll' + }; this.onScroll(null); } diff --git a/modules/benchmarks/src/naive_infinite_scroll/scroll_item.ts b/modules/benchmarks/src/naive_infinite_scroll/scroll_item.ts index 2615bc03e64c4b..a923948dce7708 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/scroll_item.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/scroll_item.ts @@ -1,4 +1,3 @@ -import {ListWrapper, MapWrapper} from 'angular2/src/facade/collection'; import { CompanyNameComponent, OpportunityNameComponent, @@ -37,7 +36,12 @@ import { FormattedCellComponent ], template: ` -
+
@@ -78,24 +82,24 @@ export class ScrollItemComponent { itemStyle; constructor() { - this.itemStyle = MapWrapper.createFromPairs([ - ['height', `${ITEM_HEIGHT}px`], - ['line-height', `${ITEM_HEIGHT}px`], - ['font-size', '18px'], - ['display', 'flex'], - ['justify-content', 'space-between'] - ]); + this.itemStyle = { + 'height': ITEM_HEIGHT, + 'line-height': ITEM_HEIGHT, + 'font-size': 18, + 'display': 'flex', + 'justify-content': 'space-between' + }; } - get companyNameWidth() { return `${COMPANY_NAME_WIDTH}px`; } - get opportunityNameWidth() { return `${OPPORTUNITY_NAME_WIDTH}px`; } - get offeringNameWidth() { return `${OFFERING_NAME_WIDTH}px`; } - get accountCellWidth() { return `${ACCOUNT_CELL_WIDTH}px`; } - get basePointsWidth() { return `${BASE_POINTS_WIDTH}px`; } - get kickerPointsWidth() { return `${KICKER_POINTS_WIDTH}px`; } - get stageButtonsWidth() { return `${STAGE_BUTTONS_WIDTH}px`; } - get bundlesWidth() { return `${BUNDLES_WIDTH}px`; } - get dueDateWidth() { return `${DUE_DATE_WIDTH}px`; } - get endDateWidth() { return `${END_DATE_WIDTH}px`; } - get aatStatusWidth() { return `${AAT_STATUS_WIDTH}px`; } + get companyNameWidth() { return COMPANY_NAME_WIDTH; } + get opportunityNameWidth() { return OPPORTUNITY_NAME_WIDTH; } + get offeringNameWidth() { return OFFERING_NAME_WIDTH; } + get accountCellWidth() { return ACCOUNT_CELL_WIDTH; } + get basePointsWidth() { return BASE_POINTS_WIDTH; } + get kickerPointsWidth() { return KICKER_POINTS_WIDTH; } + get stageButtonsWidth() { return STAGE_BUTTONS_WIDTH; } + get bundlesWidth() { return BUNDLES_WIDTH; } + get dueDateWidth() { return DUE_DATE_WIDTH; } + get endDateWidth() { return END_DATE_WIDTH; } + get aatStatusWidth() { return AAT_STATUS_WIDTH; } }