Skip to content

Commit cbd77fb

Browse files
authored
Merge branch 'master' into column-reorder
2 parents b623357 + 7b9a341 commit cbd77fb

File tree

93 files changed

+4038
-1528
lines changed

Some content is hidden

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

93 files changed

+4038
-1528
lines changed

assets/app.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ body {
2424

2525
.info {
2626
box-sizing: border-box;
27-
padding: 0 1em;
28-
border: solid 1px #ccc;
27+
padding: 0 1em;
28+
border: solid 1px #ccc;
2929
background: white;
3030
font-size: .8em;
3131
margin-bottom: 1em;
@@ -149,7 +149,6 @@ nav {
149149
z-index: 99;
150150
top:0;
151151
left:0;
152-
height: 100%;
153152
width: 200px;
154153
position: absolute;
155154
min-height: 1900px;
@@ -251,7 +250,7 @@ select {
251250
margin: 0 .25em 0 0;
252251
padding: 0;
253252
vertical-align: top;
254-
width: 16px;
253+
width: 16px;
255254
}
256255

257256
.expectedpayment2 + label:before {
@@ -263,7 +262,7 @@ select {
263262
margin: 0 .25em 0 0;
264263
padding: 0;
265264
vertical-align: top;
266-
width: 16px;
265+
width: 16px;
267266
}
268267

269268
.expectedpayment3 + label:before {
@@ -275,7 +274,7 @@ select {
275274
margin: 0 .25em 0 0;
276275
padding: 0;
277276
vertical-align: top;
278-
width: 16px;
277+
width: 16px;
279278
}
280279

281280
.expectedpayment:checked + label:before{

config/deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var ghpages = require('gh-pages');
44
var dir = path.resolve(path.join(__dirname, '../', 'dist'));
55
ghpages.publish(dir, {
66
user: {
7-
name: 'Austin McDaniel',
8-
email: 'amcdaniel2@gmail.com'
7+
name: 'Swimlane',
8+
email: 'developer@swimlane.com'
99
},
1010
message: '(deploy): CI',
1111
logger: function(message) {

config/webpack.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { ENV, dir } = require('./helpers');
99

1010
module.exports = function(options) {
1111
return webpackMerge(commonConfig({ env: ENV }), {
12-
devtool: 'cheap-module-source-map',
12+
devtool: 'inline-source-map',
1313
devServer: {
1414
port: 9999,
1515
hot: options.HMR,

demo/app.component.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import { Location, LocationStrategy, HashLocationStrategy } from '@angular/commo
5858
<li>
5959
<h4>Rows</h4>
6060
<ul>
61-
<li><a href="#row-grouping" (click)="state='row-grouping'">Row Grouping</a></li>
61+
<li><a href="#row-grouping" (click)="state='row-grouping'">Row Grouping</a></li>
6262
<li><a href="#" (click)="state=''">Fluid Row Height</a></li>
6363
<li><a href="#basic-fixed" (click)="state='basic-fixed'">Fixed Row Height</a></li>
6464
<li><a href="#dynamic" (click)="state='dynamic'">Dynamic Row Height</a></li>
@@ -114,6 +114,15 @@ import { Location, LocationStrategy, HashLocationStrategy } from '@angular/commo
114114
<li><a href="#reorder" (click)="state='reorder'">Reorder</a></li>
115115
</ul>
116116
</li>
117+
<li>
118+
<h4>Summary Row</h4>
119+
<ul>
120+
<li><a href="#simple-summary" (click)="state='simple-summary'">Simple</a></li>
121+
<li><a href="#custom-template-summary" (click)="state='custom-template-summary'">Custom Template</a></li>
122+
<li><a href="#paging-summary" (click)="state='paging-summary'">Server-side paging</a></li>
123+
<li><a href="#inline-html-summary" (click)="state='inline-html-summary'">Inline HTML</a></li>
124+
</ul>
125+
</li>
117126
</ul>
118127
</nav>
119128
<content>
@@ -173,6 +182,14 @@ import { Location, LocationStrategy, HashLocationStrategy } from '@angular/commo
173182
<column-force-demo *ngIf="state === 'force'"></column-force-demo>
174183
<column-pinning-demo *ngIf="state === 'pinning'"></column-pinning-demo>
175184
<column-reorder-demo *ngIf="state === 'reorder'"></column-reorder-demo>
185+
186+
<!-- Summary row -->
187+
<summary-row-simple-demo *ngIf="state === 'simple-summary'"></summary-row-simple-demo>
188+
<summary-row-custom-template-demo *ngIf="state === 'custom-template-summary'">
189+
</summary-row-custom-template-demo>
190+
<summary-row-server-paging-demo *ngIf="state === 'paging-summary'">
191+
</summary-row-server-paging-demo>
192+
<summary-row-inline-html *ngIf="state === 'inline-html-summary'"></summary-row-inline-html>
176193
</content>
177194
</div>
178195
`

demo/basic/bootstrap.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { Component } from '@angular/core';
1919
[columns]="columns"
2020
[columnMode]="'force'"
2121
[headerHeight]="40"
22+
[summaryRow]="true"
23+
[summaryPosition]="'bottom'"
2224
[footerHeight]="40"
2325
[limit]="10"
2426
[rowHeight]="'auto'"
@@ -34,9 +36,9 @@ export class BootstrapThemeComponent {
3436
reorderable: boolean = true;
3537

3638
columns = [
37-
{ prop: 'name' },
38-
{ name: 'Gender' },
39-
{ name: 'Company' }
39+
{ prop: 'name', summaryFunc: () => null },
40+
{ name: 'Gender', summaryFunc: (cells) => this.summaryForGender(cells) },
41+
{ name: 'Company', summaryFunc: () => null }
4042
];
4143

4244
constructor() {
@@ -57,4 +59,11 @@ export class BootstrapThemeComponent {
5759
req.send();
5860
}
5961

62+
private summaryForGender(cells: string[]) {
63+
const males = cells.filter(cell => cell === 'male').length;
64+
const females = cells.filter(cell => cell === 'female').length;
65+
66+
return `males: ${males}, females: ${females}`;
67+
}
68+
6069
}

demo/basic/dark-theme.component.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Component } from '@angular/core';
1919
[columns]="columns"
2020
[columnMode]="'force'"
2121
[headerHeight]="40"
22+
[summaryRow]="true"
2223
[footerHeight]="40"
2324
[limit]="10"
2425
[rowHeight]="'auto'"
@@ -34,9 +35,9 @@ export class DarkThemeComponent {
3435
reorderable: boolean = true;
3536

3637
columns = [
37-
{ prop: 'name' },
38-
{ name: 'Gender' },
39-
{ name: 'Company' }
38+
{ prop: 'name', summaryFunc: () => null },
39+
{ name: 'Gender', summaryFunc: (cells) => this.summaryForGender(cells) },
40+
{ name: 'Company', summaryFunc: () => null }
4041
];
4142

4243
constructor() {
@@ -57,4 +58,11 @@ export class DarkThemeComponent {
5758
req.send();
5859
}
5960

61+
private summaryForGender(cells: string[]) {
62+
const males = cells.filter(cell => cell === 'male').length;
63+
const females = cells.filter(cell => cell === 'female').length;
64+
65+
return `males: ${males}, females: ${females}`;
66+
}
67+
6068
}

demo/module.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ import { ColumnFlexComponent } from './columns/column-flex.component';
6161
import { ColumnPinningComponent } from './columns/pinning.component';
6262
import { ColumnReorderComponent } from './columns/column-reorder.component';
6363

64+
// -- Summary row
65+
import { SummaryRowSimpleComponent } from './summary/summary-row-simple.component';
66+
import { SummaryRowCustomTemplateComponent } from './summary/summary-row-custom-template.component';
67+
import { SummaryRowServerPagingComponent } from './summary/summary-row-server-paging.component';
68+
import { SummaryRowInlineHtmlComponent } from './summary/summary-row-inline-html.component';
69+
6470
@NgModule({
6571
declarations: [
6672
AppComponent,
@@ -106,7 +112,11 @@ import { ColumnReorderComponent } from './columns/column-reorder.component';
106112
DynamicHeightComponent,
107113
FooterDemoComponent,
108114
RowGroupingComponent,
109-
BootstrapThemeComponent
115+
BootstrapThemeComponent,
116+
SummaryRowSimpleComponent,
117+
SummaryRowCustomTemplateComponent,
118+
SummaryRowServerPagingComponent,
119+
SummaryRowInlineHtmlComponent,
110120
],
111121
imports: [BrowserModule, NgxDatatableModule],
112122
bootstrap: [AppComponent]

demo/paging/mock-server-results-service.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {Injectable} from "@angular/core";
2-
import {Observable} from "rxjs";
3-
import {PagedData} from "./model/paged-data";
4-
import {CorporateEmployee} from "./model/corporate-employee";
5-
import {Page} from "./model/page";
1+
import {Injectable} from '@angular/core';
2+
import {Observable} from 'rxjs';
3+
import {PagedData} from './model/paged-data';
4+
import {CorporateEmployee} from './model/corporate-employee';
5+
import {Page} from './model/page';
66
const companyData = require('../../assets/data/company.json');
77

88
/**
@@ -26,14 +26,14 @@ export class MockServerResultsService {
2626
* @returns {PagedData<CorporateEmployee>} An array of the selected data and page
2727
*/
2828
private getPagedData(page: Page): PagedData<CorporateEmployee> {
29-
let pagedData = new PagedData<CorporateEmployee>();
29+
const pagedData = new PagedData<CorporateEmployee>();
3030
page.totalElements = companyData.length;
3131
page.totalPages = page.totalElements / page.size;
32-
let start = page.pageNumber * page.size;
33-
let end = Math.min((start + page.size), page.totalElements);
32+
const start = page.pageNumber * page.size;
33+
const end = Math.min((start + page.size), page.totalElements);
3434
for (let i = start; i < end; i++){
35-
let jsonObj = companyData[i];
36-
let employee = new CorporateEmployee(jsonObj.name, jsonObj.gender, jsonObj.company, jsonObj.age);
35+
const jsonObj = companyData[i];
36+
const employee = new CorporateEmployee(jsonObj.name, jsonObj.gender, jsonObj.company, jsonObj.age);
3737
pagedData.data.push(employee);
3838
}
3939
pagedData.page = page;

demo/paging/paging-client.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ export class ClientPagingComponent {
4646
req.send();
4747
}
4848

49-
}
49+
}

demo/paging/paging-server.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component } from '@angular/core';
2-
import {MockServerResultsService} from "./mock-server-results-service";
3-
import {PagedData} from "./model/paged-data";
4-
import {CorporateEmployee} from "./model/corporate-employee";
5-
import {Page} from "./model/page";
2+
import {MockServerResultsService} from './mock-server-results-service';
3+
import {PagedData} from './model/paged-data';
4+
import {CorporateEmployee} from './model/corporate-employee';
5+
import {Page} from './model/page';
66

77
@Component({
88
selector: 'server-paging-demo',

0 commit comments

Comments
 (0)