Skip to content

Commit 6446094

Browse files
authored
Merge branch 'master' into patch-1
2 parents ba04d05 + dd99266 commit 6446094

File tree

79 files changed

+1274
-146
lines changed

Some content is hidden

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

79 files changed

+1274
-146
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/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>
@@ -113,6 +113,15 @@ import { Location, LocationStrategy, HashLocationStrategy } from '@angular/commo
113113
<li><a href="#pinning" (click)="state='pinning'">Pinning</a></li>
114114
</ul>
115115
</li>
116+
<li>
117+
<h4>Summary Row</h4>
118+
<ul>
119+
<li><a href="#simple-summary" (click)="state='simple-summary'">Simple</a></li>
120+
<li><a href="#custom-template-summary" (click)="state='custom-template-summary'">Custom Template</a></li>
121+
<li><a href="#paging-summary" (click)="state='paging-summary'">Server-side paging</a></li>
122+
<li><a href="#inline-html-summary" (click)="state='inline-html-summary'">Inline HTML</a></li>
123+
</ul>
124+
</li>
116125
</ul>
117126
</nav>
118127
<content>
@@ -171,6 +180,14 @@ import { Location, LocationStrategy, HashLocationStrategy } from '@angular/commo
171180
<column-standard-demo *ngIf="state === 'fixed'"></column-standard-demo>
172181
<column-force-demo *ngIf="state === 'force'"></column-force-demo>
173182
<column-pinning-demo *ngIf="state === 'pinning'"></column-pinning-demo>
183+
184+
<!-- Summary row -->
185+
<summary-row-simple-demo *ngIf="state === 'simple-summary'"></summary-row-simple-demo>
186+
<summary-row-custom-template-demo *ngIf="state === 'custom-template-summary'">
187+
</summary-row-custom-template-demo>
188+
<summary-row-server-paging-demo *ngIf="state === 'paging-summary'">
189+
</summary-row-server-paging-demo>
190+
<summary-row-inline-html *ngIf="state === 'inline-html-summary'"></summary-row-inline-html>
174191
</content>
175192
</div>
176193
`

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
@@ -60,6 +60,12 @@ import { ColumnForceComponent } from './columns/column-force.component';
6060
import { ColumnFlexComponent } from './columns/column-flex.component';
6161
import { ColumnPinningComponent } from './columns/pinning.component';
6262

63+
// -- Summary row
64+
import { SummaryRowSimpleComponent } from './summary/summary-row-simple.component';
65+
import { SummaryRowCustomTemplateComponent } from './summary/summary-row-custom-template.component';
66+
import { SummaryRowServerPagingComponent } from './summary/summary-row-server-paging.component';
67+
import { SummaryRowInlineHtmlComponent } from './summary/summary-row-inline-html.component';
68+
6369
@NgModule({
6470
declarations: [
6571
AppComponent,
@@ -104,7 +110,11 @@ import { ColumnPinningComponent } from './columns/pinning.component';
104110
DynamicHeightComponent,
105111
FooterDemoComponent,
106112
RowGroupingComponent,
107-
BootstrapThemeComponent
113+
BootstrapThemeComponent,
114+
SummaryRowSimpleComponent,
115+
SummaryRowCustomTemplateComponent,
116+
SummaryRowServerPagingComponent,
117+
SummaryRowInlineHtmlComponent,
108118
],
109119
imports: [BrowserModule, NgxDatatableModule],
110120
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',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
.name-container {
3+
display: flex;
4+
flex-wrap: wrap;
5+
justify-content: center;
6+
7+
.chip {
8+
background-color: #555;
9+
border-radius: 20px;
10+
text-align: center;
11+
margin: 3px 1px;
12+
width: 100px;
13+
padding: 2px 0px;
14+
15+
.chip-content {
16+
color: #fff;
17+
}
18+
}
19+
}
20+

0 commit comments

Comments
 (0)