Skip to content

Commit 8ba64a2

Browse files
committed
Merge from remote/master into branch.
2 parents 275a522 + cfa123b commit 8ba64a2

File tree

41 files changed

+532
-134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+532
-134
lines changed

dist/npm/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "1.0.9",
44
"description" : "A packaged version of Ignite UI components for Angular",
55
"license": "MIT",
6-
"typings": "igniteui.angular2.d.ts",
6+
"types": "igniteui.angular2.d.ts",
7+
"main": "bundles/igniteui.angular2.umd.js",
78
"repository": {
89
"type": "git",
910
"url": "https://github.com/IgniteUI/igniteui-angular2.git"

package.json

Lines changed: 75 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,77 @@
11
{
2-
"name": "igniteui-angular2",
3-
"version": "1.0.0",
4-
"license": "MIT",
5-
"repository": {
6-
"type": "git",
7-
"url": "https://github.com/IgniteUI/igniteui-angular2.git"
8-
},
9-
"dependencies": {
10-
"@angular/common": "^5.0.1",
11-
"@angular/compiler": "^5.0.1",
12-
"@angular/core": "^5.0.1",
13-
"@angular/forms": "^5.0.1",
14-
"@angular/http": "^5.0.1",
15-
"@angular/platform-browser": "^5.0.1",
16-
"@angular/platform-browser-dynamic": "^5.0.1",
17-
"@angular/router": "^5.0.1",
18-
"@angular/upgrade": "^5.0.1",
19-
"@types/jquery-mockjax": "^2.0.31",
20-
"angular-in-memory-web-api": "~0.3.0",
21-
"bootstrap": "^3.3.6",
22-
"core-js": "^2.4.1",
23-
"es6-shim": "^0.35.0",
24-
"reflect-metadata": "^0.1.3",
25-
"rxjs": "^5.5.0",
26-
"systemjs": "0.19.40",
27-
"zone.js": "^0.8.4"
28-
},
29-
"devDependencies": {
30-
"@angular/compiler-cli": "^5.0.1",
31-
"@types/ignite-ui": "^0.0.4",
32-
"@types/jasmine": "^2.5.36",
33-
"@types/jquery": "2.0.47",
34-
"@types/node": "^6.0.46",
35-
"@types/reflect-metadata": "^0.0.5",
36-
"concurrently": "^3.2.0",
37-
"coveralls": "^2.11.9",
38-
"gulp-watch": "^4.3.5",
39-
"jasmine-core": "^2.4.1",
40-
"karma": "^0.13.19",
41-
"karma-bower": "^1.0.1",
42-
"karma-chrome-launcher": "^0.2.2",
43-
"karma-coverage": "",
44-
"karma-jasmine": "^0.2.2",
45-
"karma-junit-reporter": "^0.4.2",
46-
"karma-remap-istanbul": "0.5.0",
47-
"lite-server": "^2.2.2",
48-
"traceur": "^0.0.111",
49-
"typescript": "^2.6.1"
50-
},
51-
"scripts": {
52-
"postinstall": "npm prune",
53-
"start": "npm run lite",
54-
"lite": "lite-server",
55-
"watch": "node node_modules/typescript/bin/tsc -w",
56-
"build": "node node_modules/typescript/bin/tsc -p tsconfig.json",
57-
"build-aot": "ngc -p tsconfig-aot.json",
58-
"build-aot-samples": "ngc -p tsconfig-aot-samples.json",
59-
"bundle": "npm run build-aot && npm run prepare-dist",
60-
"prepare-dist": "cp src/igniteui.angular2.js dist/npm/index.js && cp src/igniteui.angular2.d.ts dist/npm/index.d.ts && cp src/igniteui.angular2.metadata.json dist/npm/index.metadata.json && cp src/igniteui.angular2.ts dist/npm/igniteui.angular2.ts && cp -R src/** dist/npm/",
61-
"pretest": "npm run bundle && npm run build",
62-
"test": "karma start tests/karma.conf.js && npm run remap-istanbul",
63-
"remap-istanbul": "npm run copy-coverage-report && npm run remap-istanbul-html && npm run remap-istanbul-lcov",
64-
"remap-istanbul-html": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/html-report -t html",
65-
"remap-istanbul-lcov": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/lcov.info -t lcovonly",
66-
"copy-coverage-report": "cp coverage/karma-tmp/**/coverage*.json coverage/karma-tmp/"
67-
}
2+
"name": "igniteui-angular2",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/IgniteUI/igniteui-angular2.git"
8+
},
9+
"dependencies": {
10+
"@angular/common": "^5.0.1",
11+
"@angular/compiler": "^5.0.1",
12+
"@angular/core": "^5.0.1",
13+
"@angular/http": "^5.0.1",
14+
"@angular/forms": "^5.0.1",
15+
"@angular/platform-browser": "^5.0.1",
16+
"@angular/platform-browser-dynamic": "^5.0.1",
17+
"@angular/router": "^5.0.1",
18+
"@angular/upgrade": "^5.0.1",
19+
"angular-in-memory-web-api": "~0.3.0",
20+
21+
"core-js": "^2.4.1",
22+
"systemjs": "0.19.40",
23+
"es6-shim": "^0.35.0",
24+
"reflect-metadata": "^0.1.3",
25+
"rxjs": "^5.5.0",
26+
"zone.js": "^0.8.4",
27+
28+
"bootstrap": "^3.3.6"
29+
},
30+
"devDependencies": {
31+
"@angular/compiler-cli": "^5.0.1",
32+
"concurrently": "^3.2.0",
33+
"gulp-watch": "^4.3.5",
34+
"jasmine-core": "^2.4.1",
35+
"karma": "^0.13.19",
36+
"karma-chrome-launcher": "^0.2.2",
37+
"karma-jasmine": "^0.2.2",
38+
"karma-junit-reporter": "^0.4.2",
39+
"karma-coverage": "",
40+
"karma-remap-istanbul": "0.5.0",
41+
"lite-server": "^2.2.2",
42+
"typescript": "^2.6.1",
43+
"coveralls": "^2.11.9",
44+
"traceur": "^0.0.111",
45+
"@types/node": "^6.0.46",
46+
"@types/jasmine": "^2.5.36",
47+
"@types/reflect-metadata": "^0.0.5",
48+
"@types/ignite-ui": "^0.0.4",
49+
"@types/jquery": "2.0.47",
50+
"rollup": "^0.52.1",
51+
"rollup-plugin-node-resolve": "^3.0.0",
52+
"rollup-plugin-commonjs": "^8.2.6",
53+
"rollup-plugin-angular": "^0.5.3",
54+
"rollup-plugin-typescript": "^0.8.1"
55+
},
56+
"scripts": {
57+
"postinstall": "npm prune",
58+
59+
"start": "npm run lite",
60+
"lite": "lite-server",
61+
62+
"watch": "node node_modules/typescript/bin/tsc -w",
63+
"build": "node node_modules/typescript/bin/tsc -p tsconfig.json",
64+
"build-aot": "ngc -p tsconfig-aot.json",
65+
"build-aot-samples": "ngc -p tsconfig-aot-samples.json",
66+
"bundle": "npm run build-aot && npm run prepare-dist",
67+
"prepare-dist": "rollup -c rollup.config.umd.js",
68+
69+
"pretest": "npm run bundle && npm run build",
70+
"test": "karma start tests/karma.conf.js && npm run remap-istanbul",
71+
72+
"remap-istanbul": "npm run copy-coverage-report && npm run remap-istanbul-html && npm run remap-istanbul-lcov",
73+
"remap-istanbul-html": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/html-report -t html",
74+
"remap-istanbul-lcov": "remap-istanbul -i coverage/karma-tmp/coverage.json -o coverage/lcov.info -t lcovonly",
75+
"copy-coverage-report": "cp coverage/karma-tmp/**/coverage*.json coverage/karma-tmp/"
76+
}
6877
}

rollup.config.umd.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import resolve from 'rollup-plugin-node-resolve';
2+
import commonjs from 'rollup-plugin-commonjs';
3+
import angular from 'rollup-plugin-angular';
4+
import typescript from 'rollup-plugin-typescript';
5+
export default {
6+
entry: 'src/igniteui.angular2.ts',
7+
format: 'umd',
8+
moduleName: 'igniteui-angular2',
9+
sourceMap:true,
10+
external: [
11+
'@angular/core',
12+
],
13+
dest: "dist/npm/bundles/igniteui-angular2.umd.js",
14+
plugins: [
15+
angular(
16+
{
17+
preprocessors:{
18+
template:template => template
19+
}
20+
}
21+
),
22+
typescript({
23+
typescript:require('typescript')
24+
}),
25+
resolve({
26+
module: true,
27+
main: true
28+
}),
29+
commonjs({
30+
include: 'node_modules/**',
31+
})
32+
],
33+
onwarn: warning => {
34+
const skip_codes = [
35+
'THIS_IS_UNDEFINED',
36+
'MISSING_GLOBAL_NAME'
37+
];
38+
if (skip_codes.indexOf(warning.code) != -1) return;
39+
console.error(warning);
40+
}
41+
};

src/iggrid/features.directive.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive, AfterContentInit, ContentChild } from "@angular/core";
1+
import { Directive, AfterContentInit, ContentChild, ElementRef } from "@angular/core";
22
import { IgGridSortingFeature } from "./iggridfeatures/iggridsorting.directive";
33
import { IgGridFilteringFeature } from "./iggridfeatures/iggridfiltering.directive";
44
import { IgGridPagingFeature } from "./iggridfeatures/iggridpaging.directive";
@@ -22,12 +22,13 @@ import { IgGridMultiColumnHeadersFeature } from "./iggridfeatures/iggridmulticol
2222
})
2323
export class Features implements AfterContentInit {
2424
public allFeatures:Array<any> = new Array<any>()
25+
2526
@ContentChild(IgGridSortingFeature) sorting: IgGridSortingFeature;
2627
@ContentChild(IgGridFilteringFeature) filtering: IgGridFilteringFeature;
2728
@ContentChild(IgGridPagingFeature) paging: IgGridPagingFeature;
2829
@ContentChild(IgGridUpdatingFeature) updating: IgGridUpdatingFeature;
2930
@ContentChild(IgGridGroupByFeature) groupBy: IgGridGroupByFeature;
30-
@ContentChild(IgGridColumnMovingFeature) moving: IgGridColumnMovingFeature;
31+
@ContentChild(IgGridColumnMovingFeature) columnMoving: IgGridColumnMovingFeature;
3132
@ContentChild(IgGridHidingFeature) hiding: IgGridHidingFeature;
3233
@ContentChild(IgGridCellMergingFeature) cellMerging: IgGridCellMergingFeature;
3334
@ContentChild(IgGridResponsiveFeature) responsive: IgGridResponsiveFeature;
@@ -40,13 +41,42 @@ export class Features implements AfterContentInit {
4041
@ContentChild(IgGridAppendRowsOnDemandFeature) appendRowsOnDemand: IgGridAppendRowsOnDemandFeature;
4142
@ContentChild(IgGridMultiColumnHeadersFeature) multiColumnHeaders: IgGridMultiColumnHeadersFeature;
4243

44+
addFeature(name, parent){
45+
var nodeName = name.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase() });
46+
var el = document.createElement(nodeName);
47+
el = parent.appendChild(el);
48+
var child = new ElementRef(el);
49+
50+
switch(nodeName) {
51+
case "filtering": this.filtering = new IgGridFilteringFeature(child);break;
52+
case "sorting": this.sorting = new IgGridSortingFeature(child); break;
53+
case "paging": this.paging = new IgGridPagingFeature(child); break;
54+
case "updating": this.updating = new IgGridUpdatingFeature(child); break;
55+
case "group-by": this.groupBy = new IgGridGroupByFeature(child); break;
56+
case "column-moving": this.columnMoving = new IgGridColumnMovingFeature(child); break;
57+
case "hiding": this.hiding = new IgGridHidingFeature(child); break;
58+
case "responsive": this.responsive = new IgGridResponsiveFeature(child); break;
59+
case "cell-merging": this.cellMerging = new IgGridCellMergingFeature(child); break;
60+
case "resizing": this.resizing = new IgGridResizingFeature(child); break;
61+
case "selection": this.selection = new IgGridSelectionFeature(child); break;
62+
case "row-selectors": this.rowSelectors = new IgGridRowSelectorsFeature(child); break;
63+
case "summaries": this.summaries = new IgGridSummariesFeature(child); break;
64+
case "column-fixing": this.columnFixing = new IgGridColumnFixingFeature(child); break;
65+
case "tooltips": this.tooltips = new IgGridTooltipsFeature(child); break;
66+
case "append-rows-on-demand": this.appendRowsOnDemand = new IgGridAppendRowsOnDemandFeature(child); break;
67+
case "multi-column-headers": this.multiColumnHeaders = new IgGridMultiColumnHeadersFeature(child); break;
68+
}
69+
this[name].ngOnInit();
70+
this.allFeatures.push(this[name]);
71+
72+
}
4373
ngAfterContentInit() {
4474
this.filtering ? this.allFeatures.push(this.filtering): null;
4575
this.sorting ? this.allFeatures.push(this.sorting): null;
4676
this.paging ? this.allFeatures.push(this.paging): null;
4777
this.updating ? this.allFeatures.push(this.updating): null;
4878
this.groupBy ? this.allFeatures.push(this.groupBy): null;
49-
this.moving ? this.allFeatures.push(this.moving): null;
79+
this.columnMoving ? this.allFeatures.push(this.columnMoving): null;
5080
this.hiding ? this.allFeatures.push(this.hiding): null;
5181
this.responsive ? this.allFeatures.push(this.responsive): null;
5282
this.cellMerging ? this.allFeatures.push(this.cellMerging): null;

src/iggrid/iggridbase.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AfterContentInit, QueryList, ContentChild, ContentChildren, ElementRef,
33
import { Column } from './column.directive';
44
import { Features } from './features.directive';
55

6-
export class IgGridBase<Model> extends IgControlBase<Model> implements AfterContentInit {
6+
export class IgGridBase<Model> extends IgControlBase<Model> implements AfterContentInit {
77
protected _dataSource: any;
88
protected _changes: any;
99
@ContentChildren(Column) _columns: QueryList<Column>;
@@ -16,7 +16,6 @@ export class IgGridBase<Model> extends IgControlBase<Model> implements AfterCont
1616
jQuery.extend(true, [], this._opts.dataSource) :
1717
jQuery.extend(true, [], this._config.dataSource);
1818
}
19-
2019
ngAfterContentInit() {
2120
if (this._columns && this._columns.length) {
2221
if (this._config) {
@@ -32,6 +31,14 @@ export class IgGridBase<Model> extends IgControlBase<Model> implements AfterCont
3231
this._opts["features"] = this.featuresList.allFeatures.map((c) => { return c.initSettings;});
3332
}
3433
}
34+
if(this._config && this._config["features"] && !this.featuresList){
35+
this.featuresList = new Features();
36+
//populate featuresList
37+
for(var i=0; i < this._config["features"].length; i++){
38+
var featureName = this._config["features"][i].name.charAt(0).toLowerCase() + this._config["features"][i].name.slice(1);
39+
this.featuresList.addFeature(featureName, this._el);
40+
}
41+
}
3542
super.ngOnInit();
3643
}
3744

@@ -87,12 +94,10 @@ export class IgGridBase<Model> extends IgControlBase<Model> implements AfterCont
8794
return;
8895
}
8996
this._changes = this._differ.diff(this._config.dataSource);
90-
if (this._config.dataSource.length !== this._dataSource.length) {
97+
if (this._changes && grid) {
9198
this._dataSource = jQuery.extend(true, [], this._config.dataSource);
92-
if (this._changes) {
93-
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
94-
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]))
95-
}
99+
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
100+
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]));
96101
}
97102
//check for changes in values
98103
if (!this.equalsDiff(this._config.dataSource, this._dataSource, diff)) {

src/ighierarchicalgrid/ighierarchicalgrid.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ export class IgHierarchicalGridComponent extends IgGridBase<IgHierarchicalGrid>
4040
return;
4141
}
4242
this._changes = this._differ.diff(this._config.dataSource);
43-
if (this._config.dataSource.length !== this._dataSource.length) {
43+
if (this._changes && mainGrid) {
4444
this._dataSource = jQuery.extend(true, [], this._config.dataSource);
45-
if (this._changes) {
46-
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
47-
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]))
48-
}
45+
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
46+
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]));
4947
}
5048
//check for changes in data source values
5149
if (!this.equalsDiff(this._config.dataSource, this._dataSource, diff)) {

src/igtreegrid/igtreegrid.component.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ export class IgTreeGridComponent extends IgGridBase<IgTreeGrid> {
4242
return;
4343
}
4444
this._changes = this._differ.diff(this._config.dataSource);
45-
if (this._config.dataSource.length !== this._dataSource.length) {
46-
this._dataSource = jQuery.extend(true, [], this._config.dataSource);
47-
if (this._changes) {
48-
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
49-
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]))
50-
}
45+
if (this._changes && grid) {
46+
this._dataSource = jQuery.extend(true, [], this._config.dataSource);
47+
this._changes.forEachAddedItem(r => this.addRow(r.item, r.currentIndex));
48+
this._changes.forEachRemovedItem(r => this.deleteRow(r.item[pkKey]));
5149
}
5250
//check for changes in values
5351
if (!this.equalsDiff(this._config.dataSource, this._dataSource, diff)) {

tests/karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ module.exports = function(config){
5353
{ pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false },
5454

5555
// paths loaded via module imports
56-
{ pattern: 'dist/npm/**/*.*', included: false, watched: true },
57-
56+
{ pattern: 'src/**/*.*', included: false, watched: true },
57+
5858
// spec files need to be loaded in the shim file IN CONTEXT of the main module, don't include:
5959
{ pattern: 'tests/unit/**/*.js', included: false, watched: false },
6060
{ pattern: 'tests/unit/**/*.js.map', included: false, watched: false }
@@ -88,7 +88,7 @@ module.exports = function(config){
8888
reporters: ['progress', 'coverage'],
8989

9090
preprocessors: {
91-
'dist/npm/**/*.js': ['coverage']
91+
'src/**/*.js': ['coverage']
9292
},
9393

9494
coverageReporter: {

tests/unit/igbulletgraph/bulletgraph.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// modeled after https://github.com/angular/angular/blob/cee2318110eeea115e5f6fc5bfc814cbaa7d90d8/modules/angular2/test/common/directives/ng_for_spec.ts
22
import { TestBed } from '@angular/core/testing';
33
import { Component, ViewChild } from '@angular/core';
4-
import * as Infragistics from '../../../dist/npm/igniteui.angular2';
4+
import * as Infragistics from '../../../src/igniteui.angular2';
55

66
export function main() {
77

@@ -20,13 +20,13 @@ export function main() {
2020
template: template
2121
}
2222
});
23-
TestBed.compileComponents().then(() => {
23+
//TestBed.compileComponents().then(() => {
2424
let fixture = TestBed.createComponent(TestComponent);
2525
fixture.detectChanges();
2626
expect(fixture.debugElement.componentInstance.viewChild instanceof Infragistics.IgBulletGraphComponent)
2727
.toBe(true);
2828
done();
29-
});
29+
//});
3030
});
3131
});
3232
}

tests/unit/igcombo/combo.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { TestBed } from '@angular/core/testing';
33
import { Component, ViewChild } from '@angular/core';
44
import { FormsModule } from '@angular/forms';
5-
import * as Infragistics from '../../../dist/npm/igniteui.angular2';
5+
import * as Infragistics from '../../../src/igniteui.angular2';
66
import { Northwind } from "../../../samples/data/northwind";
77

88
export function main() {

0 commit comments

Comments
 (0)