@@ -22,7 +22,6 @@ import { IgxPivotHeaderRowComponent } from './pivot-header-row.component';
2222import { IgxColumnGroupComponent } from '../columns/column-group.component' ;
2323import { IgxColumnComponent } from '../columns/column.component' ;
2424import { PivotUtil } from './pivot-util' ;
25- import { GridColumnDataType } from 'igniteui-angular' ;
2625
2726let NEXT_ID = 0 ;
2827const 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 ) ;
0 commit comments