Skip to content

Commit c8d7538

Browse files
committed
chore(*): fix some lint errors
1 parent 092abbe commit c8d7538

File tree

3 files changed

+78
-80
lines changed

3 files changed

+78
-80
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { IgxPivotHeaderRowComponent } from './pivot-header-row.component';
2222
import { IgxColumnGroupComponent } from '../columns/column-group.component';
2323
import { IgxColumnComponent } from '../columns/column.component';
2424
import { PivotUtil } from './pivot-util';
25-
import { GridColumnDataType } from 'igniteui-angular';
2625

2726
let NEXT_ID = 0;
2827
const MINIMUM_COLUMN_WIDTH = 200;
@@ -72,8 +71,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
7271
/**
7372
* @hidden @internal
7473
*/
75-
@ViewChild('record_template', { read: TemplateRef, static: true })
76-
public recordTemplate: TemplateRef<any>;
74+
@ViewChild('record_template', { read: TemplateRef, static: true })
75+
public recordTemplate: TemplateRef<any>;
7776

7877
/**
7978
* @hidden @internal
@@ -149,7 +148,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
149148
* let data = this.grid.data;
150149
* ```
151150
*/
152-
public get data(): any[] | null {
151+
public get data(): any[] | null {
153152
return this._data;
154153
}
155154
/**
@@ -161,21 +160,21 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
161160
* }];
162161
* ```
163162
*/
164-
public set filteredData(value) {
165-
this._filteredData = value;
166-
}
163+
public set filteredData(value) {
164+
this._filteredData = value;
165+
}
167166

168-
/**
169-
* Returns an array of objects containing the filtered data.
170-
* ```typescript
171-
* let filteredData = this.grid.filteredData;
172-
* ```
173-
*
174-
* @memberof IgxHierarchicalGridComponent
175-
*/
176-
public get filteredData() {
177-
return this._filteredData;
178-
}
167+
/**
168+
* Returns an array of objects containing the filtered data.
169+
* ```typescript
170+
* let filteredData = this.grid.filteredData;
171+
* ```
172+
*
173+
* @memberof IgxHierarchicalGridComponent
174+
*/
175+
public get filteredData() {
176+
return this._filteredData;
177+
}
179178

180179

181180
/**
@@ -197,26 +196,26 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
197196
return MINIMUM_COLUMN_WIDTH * rowDimCount;
198197
}
199198

200-
public toggleColumn(col: IgxColumnComponent) {
201-
const state = this.columnGroupStates.get(col.field);
202-
const newState = !state;
203-
this.columnGroupStates.set(col.field, newState);
204-
const fieldColumns = col.children.filter(x => !x.columnGroup);
205-
const groupColumns = col.children.filter(x => x.columnGroup);
206-
groupColumns.forEach(groupColumn => {
199+
public toggleColumn(col: IgxColumnComponent) {
200+
const state = this.columnGroupStates.get(col.field);
201+
const newState = !state;
202+
this.columnGroupStates.set(col.field, newState);
203+
const fieldColumns = col.children.filter(x => !x.columnGroup);
204+
const groupColumns = col.children.filter(x => x.columnGroup);
205+
groupColumns.forEach(groupColumn => {
207206
groupColumn.hidden = newState;
208207
this.resolveToggle(groupColumn);
209-
});
208+
});
210209
fieldColumns.forEach(fieldColumn => {
211210
fieldColumn.hidden = !newState;
212211
});
213-
this.reflow();
214-
}
212+
this.reflow();
213+
}
215214

216-
protected resolveToggle(groupColumn: IgxColumnComponent) {
217-
const hasChildGroup = groupColumn.children.filter(x => x.columnGroup).length > 0;
218-
if (!groupColumn.hidden && hasChildGroup) {
219-
const fieldChildren = groupColumn.children.filter(x => !x.columnGroup);
215+
protected resolveToggle(groupColumn: IgxColumnComponent) {
216+
const hasChildGroup = groupColumn.children.filter(x => x.columnGroup).length > 0;
217+
if (!groupColumn.hidden && hasChildGroup) {
218+
const fieldChildren = groupColumn.children.filter(x => !x.columnGroup);
220219
const groupChildren = groupColumn.children.filter(x => x.columnGroup);
221220
groupChildren.forEach(group => {
222221
this.resolveToggle(group);
@@ -225,7 +224,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
225224
fieldChild.hidden = true;
226225
});
227226
}
228-
}
227+
}
229228

230229
/**
231230
* @hidden
@@ -237,13 +236,13 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
237236
/**
238237
* @hidden
239238
*/
240-
protected autogenerateColumns() {
239+
protected autogenerateColumns() {
241240
const data = this.gridAPI.get_data();
242241
const fieldsMap = PivotUtil.getFieldsHierarchy(
243242
data,
244243
this.pivotConfiguration.columns,
245-
{aggregations: 'aggregations', records: 'records', children: 'children', level: 'level'}
246-
);
244+
{ aggregations: 'aggregations', records: 'records', children: 'children', level: 'level' }
245+
);
247246
const columns = this.generateColumnHierarchy(fieldsMap, data);
248247
this._autoGeneratedCols = columns;
249248

@@ -253,7 +252,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
253252
}
254253
}
255254

256-
protected generateColumnHierarchy(fields: Map<string, any>, data, parent = null): IgxColumnComponent[] {
255+
protected generateColumnHierarchy(fields: Map<string, any>, data, parent = null): IgxColumnComponent[] {
257256
const factoryColumn = this.resolver.resolveComponentFactory(IgxColumnComponent);
258257
const factoryColumnGroup = this.resolver.resolveComponentFactory(IgxColumnGroupComponent);
259258
let columns = [];
@@ -265,7 +264,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
265264
ref.instance.parent = parent;
266265
ref.changeDetectorRef.detectChanges();
267266

268-
const measureChildren = this.getMeasureChildren(factoryColumn, data , ref.instance, false);
267+
const measureChildren = this.getMeasureChildren(factoryColumn, data, ref.instance, false);
269268
ref.instance.children.reset(measureChildren);
270269
columns.push(ref.instance);
271270
columns = columns.concat(measureChildren);
@@ -281,7 +280,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
281280
const filteredChildren = children.filter(x => x.level === ref.instance.level + 1);
282281
ref.changeDetectorRef.detectChanges();
283282

284-
const measureChildren = this.getMeasureChildren(factoryColumn, data , ref.instance, true);
283+
const measureChildren = this.getMeasureChildren(factoryColumn, data, ref.instance, true);
285284
const nestedChildren = filteredChildren.concat(measureChildren);
286285

287286
const allChildren = children.concat(measureChildren);
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1+
:host ::ng-deep {
2+
.upFont {
3+
color: green;
4+
}
15

6+
.downFont {
7+
color:red;
8+
}
29

10+
.upFont1 {
11+
color: blue;
12+
}
313

4-
:host ::ng-deep {
5-
.upFont {
6-
color: green;
7-
}
8-
9-
.downFont {
10-
color:red;
11-
}
12-
13-
.upFont1 {
14-
color: blue;
15-
}
16-
17-
.downFont1 {
18-
color:yellow;
19-
}
14+
.downFont1 {
15+
color:yellow;
16+
}
2017

21-
.sample-column {
22-
max-width: 900px;
23-
}
18+
.sample-column {
19+
max-width: 900px;
2420
}
21+
}

src/app/pivot-grid/pivot-grid.sample.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export class PivotGridSampleComponent {
1919
childLevels: [{
2020
member: 'Country',
2121
enabled: true,
22-
childLevels:[]
22+
childLevels: []
2323
}]
2424
}],
2525
rows: [{
2626
member: () => 'All',
2727
enabled: true,
28-
childLevels:[
28+
childLevels: [
2929
{
3030
member: (data) => data.ProductCategory,
3131
enabled: true,
32-
childLevels:[]
32+
childLevels: []
3333
}
3434
]
3535
}],
@@ -56,7 +56,7 @@ export class PivotGridSampleComponent {
5656
enabled: true,
5757
childLevels: []
5858
},
59-
]
59+
]
6060
}]
6161
},
6262
{
@@ -65,16 +65,16 @@ export class PivotGridSampleComponent {
6565
childLevels: []
6666
}
6767
]
68-
,
68+
,
6969
rows: [{
7070
member: () => 'All',
7171
enabled: true,
72-
childLevels:[
72+
childLevels: [
7373
{
7474
fieldName: 'ProductCategory',
7575
member: (data) => data.ProductCategory,
7676
enabled: true,
77-
childLevels:[]
77+
childLevels: []
7878
}
7979
]
8080
}],
@@ -84,10 +84,10 @@ export class PivotGridSampleComponent {
8484
aggregate: IgxNumberSummaryOperand.sum,
8585
enabled: true,
8686
styles: {
87-
upFont: (rowData:any, columnKey:any): boolean => {
87+
upFont: (rowData: any, columnKey: any): boolean => {
8888
return rowData[columnKey] > 300;
8989
},
90-
downFont: (rowData:any, columnKey:any): boolean => {
90+
downFont: (rowData: any, columnKey: any): boolean => {
9191
return rowData[columnKey] <= 300;
9292
}
9393
},
@@ -100,10 +100,10 @@ export class PivotGridSampleComponent {
100100
enabled: true,
101101
dataType: 'currency',
102102
styles: {
103-
upFont1: (rowData:any, columnKey:any): boolean => {
103+
upFont1: (rowData: any, columnKey: any): boolean => {
104104
return rowData[columnKey] > 150;
105105
},
106-
downFont1: (rowData:any, columnKey:any): boolean => {
106+
downFont1: (rowData: any, columnKey: any): boolean => {
107107
return rowData[columnKey] <= 150;
108108
}
109109
},
@@ -130,16 +130,18 @@ export class PivotGridSampleComponent {
130130
{ ProductCategory: 'Components', USA: 240 }
131131
];
132132

133-
public dataHierarchical = [
134-
{ ProductCategory: 'All', All: 1000, Bulgaria: 774, USA: 829, Uruguay: 524, level: 0, records: [
135-
{ ProductCategory: 'Clothing', Bulgaria: 774, USA: 296, Uruguay: 456, level: 1 },
136-
{ ProductCategory: 'Bikes', Uruguay: 68, level: 1 },
137-
{ ProductCategory: 'Accessories', USA: 293, level: 1 },
138-
{ ProductCategory: 'Components', USA: 240, level: 1 }
139-
] },
140-
{ ProductCategory: 'Clothing', All: 1000, Bulgaria: 774, USA: 296, Uruguay: 456, level: 1 },
141-
{ ProductCategory: 'Bikes', All: 1000, Uruguay: 68, level: 1 },
142-
{ ProductCategory: 'Accessories', All: 1000, USA: 293, level: 1 },
143-
{ ProductCategory: 'Components', All: 1000, USA: 240, level: 1 }
133+
public dataHierarchical = [
134+
{
135+
ProductCategory: 'All', All: 1000, Bulgaria: 774, USA: 829, Uruguay: 524, level: 0, records: [
136+
{ ProductCategory: 'Clothing', Bulgaria: 774, USA: 296, Uruguay: 456, level: 1 },
137+
{ ProductCategory: 'Bikes', Uruguay: 68, level: 1 },
138+
{ ProductCategory: 'Accessories', USA: 293, level: 1 },
139+
{ ProductCategory: 'Components', USA: 240, level: 1 }
140+
]
141+
},
142+
{ ProductCategory: 'Clothing', All: 1000, Bulgaria: 774, USA: 296, Uruguay: 456, level: 1 },
143+
{ ProductCategory: 'Bikes', All: 1000, Uruguay: 68, level: 1 },
144+
{ ProductCategory: 'Accessories', All: 1000, USA: 293, level: 1 },
145+
{ ProductCategory: 'Components', All: 1000, USA: 240, level: 1 }
144146
];
145147
}

0 commit comments

Comments
 (0)