Upgrade DataTable to angular 2.0.0-rc.1

This commit is contained in:
Denys Vuika
2016-06-14 06:22:07 +01:00
parent 5bb011564e
commit a6cff4f235
10 changed files with 83 additions and 75 deletions

View File

@@ -11,16 +11,12 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="systemjs.config.js"></script>
<script>

View File

@@ -22,14 +22,24 @@
},
"license": "Apache-2.0",
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-promise": "3.0.2",
"es6-shim": "0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"zone.js": "0.6.10",
"ng2-alfresco-datatable": "^0.1.0"
},
"devDependencies": {
@@ -37,7 +47,7 @@
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12",
"typings": "^1.0.4",
"wsrv": "^0.1.0"
},
"keywords": [

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { Component } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import {
ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter,

View File

@@ -1,44 +1,51 @@
/**
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
(function(global) {
// map tells the System loader where to look for things
var map = {
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'app': 'dist/main'
};
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { format: 'register', defaultExtension: 'js' },
'ng2-alfresco-datatable': { defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2': { defaultExtension: 'js' }
};
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-alfresco-datatable': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -48,13 +48,21 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"systemjs": "0.19.26",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.12",
"es6-module-loader": "^0.17.8"
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.11"
},
"peerDependencies": {
"material-design-icons": "^2.2.3",
@@ -76,7 +84,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12",
"typings": "^1.0.4",
"wsrv": "^0.1.0"
},
"license-check-config": {

View File

@@ -14,7 +14,7 @@
</label>
</th>
<th class="mdl-data-table__cell--non-numeric non-selectable {{col.cssClass}}"
*ngFor="#col of data.getColumns()"
*ngFor="let col of data.getColumns()"
[class.column-header]="col.title"
[class.mdl-data-table__header--sorted-ascending]="isColumnSorted(col, 'asc')"
[class.mdl-data-table__header--sorted-descending]="isColumnSorted(col, 'desc')"
@@ -30,7 +30,7 @@
</thead>
<tbody>
<tr *ngFor="#row of data.getRows(); #idx = index">
<tr *ngFor="let row of data.getRows(); let idx = index">
<td *ngIf="multiselect">
<label
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect mdl-data-table__select"
@@ -39,7 +39,7 @@
<input type="checkbox" [attr.id]="'row[' + idx + ']'" class="mdl-checkbox__input" [(ngModel)]="row.isSelected" />
</label>
</td>
<td *ngFor="#col of data.getColumns()" [ngSwitch]="col.type"
<td *ngFor="let col of data.getColumns()" [ngSwitch]="col.type"
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
(click)="onRowClick(row, $event)" (dblclick)="onRowDblClick(row, $event)">
<div *ngSwitchWhen="'image'">

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import { DataTableComponent } from './datatable.component';
import {

View File

@@ -23,7 +23,7 @@ import {
Output,
EventEmitter,
AfterViewChecked
} from 'angular2/core';
} from '@angular/core';
import {
DataTableAdapter,

View File

@@ -19,7 +19,7 @@ import {
it,
describe,
expect
} from 'angular2/testing';
} from '@angular/core/testing';
import {
DataColumn,