@@ -36,7 +36,7 @@ import { IgxGridBaseDirective } from '../grid-base.directive';
36
36
import { IgxFilteringService } from '../filtering/grid-filtering.service' ;
37
37
import { IgxGridSelectionService } from '../selection/selection.service' ;
38
38
import { IgxForOfSyncService , IgxForOfScrollSyncService } from '../../directives/for-of/for_of.sync.service' ;
39
- import { ColumnType , GridType , IGX_GRID_BASE , IgxColumnTemplateContext , RowType } from '../common/grid.interface' ;
39
+ import { ColumnType , GridType , IGX_GRID_BASE , IgxColumnTemplateContext , PivotGridType , RowType } from '../common/grid.interface' ;
40
40
import { IgxGridCRUDService } from '../common/crud.service' ;
41
41
import { IgxGridSummaryService } from '../summaries/grid-summary.service' ;
42
42
import { DEFAULT_PIVOT_KEYS , IDimensionsChange , IgxPivotGridValueTemplateContext , IPivotConfiguration , IPivotConfigurationChangedEventArgs , IPivotDimension , IPivotValue , IValuesChange , PivotDimensionType , IPivotUISettings , PivotRowLayoutType , PivotSummaryPosition } from './pivot-grid.interface' ;
@@ -102,7 +102,6 @@ import { IgxTextHighlightService } from '../../directives/text-highlight/text-hi
102
102
import { IgxPivotRowHeaderGroupComponent } from './pivot-row-header-group.component' ;
103
103
import { IgxPivotDateDimension } from './pivot-grid-dimensions' ;
104
104
import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
105
- import { IgxPivotGridStateService } from './pivot-grid-state.service' ;
106
105
107
106
let NEXT_ID = 0 ;
108
107
const MINIMUM_COLUMN_WIDTH = 200 ;
@@ -197,7 +196,7 @@ const MINIMUM_COLUMN_WIDTH_SUPER_COMPACT = 104;
197
196
schemas : [ CUSTOM_ELEMENTS_SCHEMA ]
198
197
} )
199
198
export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnInit , AfterContentInit ,
200
- GridType , AfterViewInit , OnChanges {
199
+ PivotGridType , AfterViewInit , OnChanges {
201
200
202
201
/**
203
202
* Emitted when the dimension collection is changed via the grid chip area.
@@ -1029,7 +1028,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
1029
1028
summaryService : IgxGridSummaryService ,
1030
1029
@Inject ( LOCALE_ID ) localeId : string ,
1031
1030
platform : PlatformUtil ,
1032
- private pivotStateService : IgxPivotGridStateService ,
1033
1031
@Optional ( ) @Inject ( IgxGridTransaction ) _diTransactions ?: TransactionService < Transaction , State >
1034
1032
) {
1035
1033
super (
@@ -2277,6 +2275,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2277
2275
return hierarchy ;
2278
2276
}
2279
2277
2278
+ /** @hidden @internal */
2279
+ public currencyColumnSet : Set < string > = new Set ( ) ;
2280
2280
protected generateColumnHierarchy ( fields : Map < string , any > , data , parent = null ) : IgxColumnComponent [ ] {
2281
2281
let columns = [ ] ;
2282
2282
if ( fields . size === 0 ) {
@@ -2285,7 +2285,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2285
2285
let columnDataType = value . dataType || this . resolveDataTypes ( data . length ? data [ 0 ] [ value . member ] : null ) ;
2286
2286
2287
2287
if ( value . aggregate ?. key ?. toLowerCase ( ) === 'count' && columnDataType === GridColumnDataType . Currency ) {
2288
- this . pivotStateService . addCurrencyColumn ( value . member ) ;
2288
+ this . currencyColumnSet . add ( value . member ) ;
2289
2289
columnDataType = GridColumnDataType . Number ;
2290
2290
}
2291
2291
@@ -2311,10 +2311,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2311
2311
this . values . forEach ( ( aggregatorValue ) => {
2312
2312
if ( col . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
2313
2313
col . dataType = GridColumnDataType . Number ;
2314
- this . pivotStateService . addCurrencyColumn ( aggregatorValue . member ) ;
2315
- } else if ( this . pivotStateService . isCurrencyColumn ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2314
+ this . currencyColumnSet . add ( aggregatorValue . member ) ;
2315
+ } else if ( this . currencyColumnSet . has ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2316
2316
col . dataType = GridColumnDataType . Currency ;
2317
- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2317
+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
2318
2318
}
2319
2319
} )
2320
2320
@@ -2327,10 +2327,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2327
2327
if ( child . field . includes ( aggregatorValue . member ) ) {
2328
2328
if ( child . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
2329
2329
child . dataType = GridColumnDataType . Number ;
2330
- this . pivotStateService . addCurrencyColumn ( aggregatorValue . member ) ;
2331
- } else if ( this . pivotStateService . isCurrencyColumn ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2330
+ this . currencyColumnSet . add ( aggregatorValue . member ) ;
2331
+ } else if ( this . currencyColumnSet . has ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2332
2332
child . dataType = GridColumnDataType . Currency ;
2333
- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2333
+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
2334
2334
}
2335
2335
}
2336
2336
} )
0 commit comments