Skip to content

Commit 8b80f08

Browse files
authored
Merge pull request #130 from PioneerCode/feature/add-history-option
Add history action to table and update to Angular 8
2 parents 6058dc9 + 664ffba commit 8b80f08

29 files changed

+4284
-4214
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"pioneercode",
2020
"polyfills",
2121
"prismjs",
22+
"routerlink",
2223
"ryancavanaugh",
2324
"styleext",
2425
"tooltips",

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<a name="1.0.0"></a>
2+
# [v1.0.0](https://github.com/PioneerCode/pioneer-charts/releases/tag/1.0.0) (2019-06-13)
3+
4+
### Added
5+
- Update to Angular 8, marking a 1.0 release.
6+
- Added onHistoryClicked action to Table.
7+
18
<a name="0.21.0"></a>
29
# [v0.21.0](https://github.com/PioneerCode/pioneer-charts/releases/tag/0.21.0) (2019-02-18)
310

apps/dev/src/app/pages/test/test.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IPcacData } from 'projects/pcac/src/lib/core/public_api';
1212
export class TestComponent {
1313
public showModal = true;
1414

15-
@ViewChild(PcacDialogComponent) dialog: PcacDialogComponent;
15+
@ViewChild(PcacDialogComponent, { static: true }) dialog: PcacDialogComponent;
1616

1717
constructor(public pcService: PcService) { }
1818

apps/dev/src/assets/mock/table.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"enableStickyHeader": true,
44
"enableStickyFooter": true,
55
"hideColumnOne": false,
6-
"enableEditAction": false,
6+
"enableEditAction": true,
7+
"enableHistoryAction": true,
78
"enableDeleteAction": true,
89
"data": [
910
{

apps/dev/src/tsconfig.app.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../out-tsc/app",
5-
"module": "es2015"
6-
},
4+
"outDir": "../out-tsc/app"
5+
},
76
"include": [
87
"**/*.ts"
98
],

apps/dev/src/tsconfig.spec.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
55
"baseUrl": "./",
6-
"module": "commonjs",
76
"types": [
87
"jasmine",
98
"node"

apps/docs/src/app/pages/charts/charts.component.html

+26-13
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,100 @@
55
<div class="col-sm">
66
<div class="pc-chart-container">
77
<pcac-header [config]="{'title':'Vertical Single: Hide Axis'}"></pcac-header>
8-
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartSingleConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
8+
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartSingleConfig"
9+
(barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
910
</div>
1011
</div>
1112
<div class="col-sm">
1213
<div class="pc-chart-container">
1314
<pcac-header [config]="{'title':'Vertical Grouped'}"></pcac-header>
14-
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartGroupConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
15+
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartGroupConfig"
16+
(barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
1517
</div>
1618
</div>
1719
<div class="col-sm">
1820
<div class="pc-chart-container">
1921
<pcac-header [config]="{'title':'Vertical Stacked'}"></pcac-header>
20-
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartStackedConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
22+
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartStackedConfig"
23+
(barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
2124
</div>
2225
</div>
2326
<div class="col-sm">
2427
<div class="pc-chart-container">
2528
<pcac-header [config]="{'title':'Vertical Bars'}"></pcac-header>
26-
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
29+
<pcac-bar-vertical-chart [config]="pcService.barVerticalChartConfig"
30+
(barClicked)="pcService.onClicked($event)"></pcac-bar-vertical-chart>
2731
</div>
2832
</div>
2933
</div>
3034
<div class="row pc-row">
3135
<div class="col-sm">
3236
<div class="pc-chart-container">
3337
<pcac-header [config]="{'title':'Horizontal Single: Hide Axis & Grid'}"></pcac-header>
34-
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartSingleConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
38+
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartSingleConfig"
39+
(barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
3540
</div>
3641
</div>
3742
<div class="col-sm">
3843
<div class="pc-chart-container">
3944
<pcac-header [config]="{'title':'Horizontal Group: Color Override & Spread'}"></pcac-header>
40-
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartGroupConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
45+
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartGroupConfig"
46+
(barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
4147
</div>
4248
</div>
4349
<div class="col-sm">
4450
<div class="pc-chart-container">
4551
<pcac-header [config]="{'title':'Horizontal Stacked'}"></pcac-header>
46-
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartStackedConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
52+
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartStackedConfig"
53+
(barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
4754
</div>
4855
</div>
4956
<div class="col-sm">
5057
<div class="pc-chart-container">
5158
<pcac-header [config]="{'title':' Horizontal Bars'}"></pcac-header>
52-
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartConfig" (barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
59+
<pcac-bar-horizontal-chart [config]="pcService.barHorizontalChartConfig"
60+
(barClicked)="pcService.onClicked($event)"></pcac-bar-horizontal-chart>
5361
</div>
5462
</div>
5563
</div>
5664
<div class="row pc-row">
5765
<div class="col-sm">
5866
<div class="pc-chart-container">
5967
<pcac-header [config]="{'title':'Line Chart'}"></pcac-header>
60-
<pcac-line-area-chart [config]="pcService.lineChartConfig" (dotClicked)="pcService.onClicked($event)"></pcac-line-area-chart>
68+
<pcac-line-area-chart [config]="pcService.lineChartConfig" (dotClicked)="pcService.onClicked($event)">
69+
</pcac-line-area-chart>
6170
</div>
6271
</div>
6372
<div class="col-sm">
6473
<div class="pc-chart-container">
6574
<pcac-header [config]="{'title':'Area Chart'}"></pcac-header>
66-
<pcac-line-area-chart [config]="pcService.areaChartConfig" (dotClicked)="pcService.onClicked($event)"></pcac-line-area-chart>
75+
<pcac-line-area-chart [config]="pcService.areaChartConfig" (dotClicked)="pcService.onClicked($event)">
76+
</pcac-line-area-chart>
6777
</div>
6878
</div>
6979
</div>
7080
<div class="row pc-row">
7181
<div class="col-sm">
7282
<div class="pc-chart-container">
7383
<pcac-header [config]="{'title':'Area Chart: Hide Axis & Grid'}"></pcac-header>
74-
<pcac-line-area-chart [config]="pcService.areaChartHideConfig" (dotClicked)="pcService.onClicked($event)"></pcac-line-area-chart>
84+
<pcac-line-area-chart [config]="pcService.areaChartHideConfig" (dotClicked)="pcService.onClicked($event)">
85+
</pcac-line-area-chart>
7586
</div>
7687
</div>
7788
</div>
7889
<div class="row">
7990
<div class="col-sm">
8091
<div class="pc-chart-container">
8192
<pcac-header [config]="{'title':'Table'}"></pcac-header>
82-
<pcac-table [config]="pcService.tableConfig" (deleteClicked)="onDeleteClicked($event)" (editClicked)="onEditClicked($event)"></pcac-table>
93+
<pcac-table [config]="pcService.tableConfig" (deleteClicked)="onDeleteClicked($event)"
94+
(editClicked)="onEditClicked($event)" (historyClicked)="onHistoryClicked($event)"></pcac-table>
8395
</div>
8496
</div>
8597
<div class="col-sm">
8698
<div class="pc-chart-container">
8799
<pcac-header [config]="{'title':'Pie Chart'}"></pcac-header>
88-
<pcac-pie-chart [config]="pcService.pieChartConfig" (sliceClicked)="pcService.onClicked($event)"></pcac-pie-chart>
100+
<pcac-pie-chart [config]="pcService.pieChartConfig" (sliceClicked)="pcService.onClicked($event)">
101+
</pcac-pie-chart>
89102
</div>
90103
</div>
91104
</div>

apps/docs/src/app/pages/charts/charts.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ export class ChartsComponent {
1818
onDeleteClicked(row: IPcacData): void {
1919
alert("Delete Row");
2020
}
21+
22+
onHistoryClicked(row: IPcacData): void {
23+
alert("Show History");
24+
}
2125
}

apps/docs/src/app/pages/docs/components/charts/table/table.component.html

+18-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
<div class="col-sm">
1010
<div class="pc-chart-container">
1111
<pcac-header [config]="{'title':'Table'}"></pcac-header>
12-
<pcac-table [config]="pcService.tableConfig" (deleteClicked)="onDeleteClicked($event)" (editClicked)="onEditClicked($event)"></pcac-table>
12+
<pcac-table [config]="pcService.tableConfig" (deleteClicked)="onDeleteClicked($event)"
13+
(editClicked)="onEditClicked($event)" (historyClicked)="onHistoryClicked($event)"></pcac-table>
1314
</div>
1415
</div>
1516
</div>
1617
</section>
17-
<section class="pc-doc-section">
18+
<section class=" pc-doc-section">
1819
<div class="row">
1920
<div class="col-sm">
2021
<h3>Markup</h3>
@@ -42,8 +43,8 @@ <h3>API</h3>
4243
<tr>
4344
<td>data</td>
4445
<td>
45-
Collection of <a routerlink="/docs/guides/data-contract" ng-reflect-router-link="/docs/guides/data-contract"
46-
href="/docs/guides/data-contract">IPcacData</a>
46+
Collection of <a routerlink="/docs/guides/data-contract"
47+
ng-reflect-router-link="/docs/guides/data-contract" href="/docs/guides/data-contract">IPcacData</a>
4748
objects.
4849
</td>
4950
</tr>
@@ -63,6 +64,10 @@ <h3>API</h3>
6364
<td>enableDeleteAction</td>
6465
<td>Show/Hide delete icon in action row. (deleteClicked)</td>
6566
</tr>
67+
<tr>
68+
<td>enableHistoryAction</td>
69+
<td>Show/Hide history icon in action row. (historyClicked)</td>
70+
</tr>
6671
<tr>
6772
<td>hideColumnOne</td>
6873
<td>Often is of value to track an ID that is associated with a row, i.e. record. When that ID is part
@@ -104,6 +109,15 @@ <h3 id="events">Events</h3>
104109
Associated row data (IPcacData)
105110
</td>
106111
</tr>
112+
<tr>
113+
<td>
114+
historyClicked
115+
</td>
116+
<td>Emitted when "history" icon is clicked inside a row.</td>
117+
<td>
118+
Associated row data (IPcacData)
119+
</td>
120+
</tr>
107121
</tbody>
108122
</table>
109123
</section>

apps/docs/src/app/pages/docs/components/charts/table/table.component.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class TableComponent {
4242
level: JumpNavLevel.h2
4343
}
4444
] as IJumpNav[];
45-
markupCode = `<pcac-table [config]="config" (deleteClicked)="onDeleteClicked($event)" (editClicked)="onEditClicked($event)"></pcac-table>`;
45+
markupCode = `<pcac-table [config]="config" (deleteClicked)="onDeleteClicked($event)" (editClicked)="onEditClicked($event)" (historyClicked)="onHistoryClicked($event)"></pcac-table>`;
4646
importCode = `import { PcacTableModule } from '@pioneer-code/pioneer-charts';`;
4747

4848
constructor(public pcService: PcService) { }
@@ -54,4 +54,8 @@ export class TableComponent {
5454
onDeleteClicked(row: IPcacData): void {
5555
alert("Delete Row");
5656
}
57+
58+
onHistoryClicked(row: IPcacData): void {
59+
alert("Show History");
60+
}
5761
}

apps/docs/src/app/pages/docs/components/helpers/dialog/dialog.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ onClosed(): void {
4949
}
5050
] as IJumpNav[];
5151

52-
@ViewChild(PcacDialogComponent) dialog: PcacDialogComponent;
52+
@ViewChild(PcacDialogComponent, {static: false}) dialog: PcacDialogComponent;
5353

5454
constructor(public pcService: PcService) { }
5555

apps/docs/src/assets/mock/table.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"enableStickyFooter": true,
55
"enableActionRow": true,
66
"enableEditAction": true,
7+
"enableHistoryAction": true,
78
"enableDeleteAction": true,
89
"data": [
910
{

apps/docs/src/polyfills.ts

+21-38
Original file line numberDiff line numberDiff line change
@@ -11,70 +11,53 @@
1111
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
1212
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
1313
*
14-
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
14+
* Learn more in https://angular.io/guide/browser-support
1515
*/
1616

1717
/***************************************************************************************************
1818
* BROWSER POLYFILLS
1919
*/
2020

21-
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
22-
// import 'core-js/es6/symbol';
23-
// import 'core-js/es6/object';
24-
// import 'core-js/es6/function';
25-
// import 'core-js/es6/parse-int';
26-
// import 'core-js/es6/parse-float';
27-
// import 'core-js/es6/number';
28-
// import 'core-js/es6/math';
29-
// import 'core-js/es6/string';
30-
// import 'core-js/es6/date';
31-
// import 'core-js/es6/array';
32-
// import 'core-js/es6/regexp';
33-
// import 'core-js/es6/map';
34-
// import 'core-js/es6/weak-map';
35-
// import 'core-js/es6/set';
36-
3721
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
3822
// import 'classlist.js'; // Run `npm install --save classlist.js`.
3923

40-
/** IE10 and IE11 requires the following for the Reflect API. */
41-
// import 'core-js/es6/reflect';
42-
43-
44-
/** Evergreen browsers require these. **/
45-
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46-
import 'core-js/es7/reflect';
47-
48-
4924
/**
5025
* Web Animations `@angular/platform-browser/animations`
5126
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
5227
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
53-
**/
28+
*/
5429
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
5530

5631
/**
5732
* By default, zone.js will patch all possible macroTask and DomEvents
5833
* user can disable parts of macroTask/DomEvents patch by setting following flags
34+
* because those flags need to be set before `zone.js` being loaded, and webpack
35+
* will put import in the top of bundle, so user need to create a separate file
36+
* in this directory (for example: zone-flags.ts), and put the following flags
37+
* into that file, and then add the following code before importing zone.js.
38+
* import './zone-flags.ts';
39+
*
40+
* The flags allowed in zone-flags.ts are listed here.
41+
*
42+
* The following flags will work for all browsers.
43+
*
44+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47+
*
48+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
50+
*
51+
* (window as any).__Zone_enable_cross_context_check = true;
52+
*
5953
*/
6054

61-
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
62-
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
63-
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
64-
65-
/*
66-
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
67-
* with the following flag, it will bypass `zone.js` patch for IE/Edge
68-
*/
69-
// (window as any).__Zone_enable_cross_context_check = true;
70-
7155
/***************************************************************************************************
7256
* Zone JS is required by default for Angular itself.
7357
*/
7458
import 'zone.js/dist/zone'; // Included with Angular CLI.
7559

7660

77-
7861
/***************************************************************************************************
7962
* APPLICATION IMPORTS
8063
*/

apps/docs/src/tsconfig.app.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "../../../tsconfig.node.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
5-
"module": "es2015",
65
"types": []
76
},
87
"exclude": [

apps/docs/src/tsconfig.spec.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
5-
"module": "commonjs",
65
"types": [
76
"jasmine",
87
"node"

browserslist

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

0 commit comments

Comments
 (0)