@@ -36,7 +36,7 @@ import { IgxGridBaseDirective } from '../grid-base.directive';
3636import { IgxFilteringService } from '../filtering/grid-filtering.service' ;
3737import { IgxGridSelectionService } from '../selection/selection.service' ;
3838import { 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' ;
4040import { IgxGridCRUDService } from '../common/crud.service' ;
4141import { IgxGridSummaryService } from '../summaries/grid-summary.service' ;
4242import { 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
102102import { IgxPivotRowHeaderGroupComponent } from './pivot-row-header-group.component' ;
103103import { IgxPivotDateDimension } from './pivot-grid-dimensions' ;
104104import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
105- import { IgxPivotGridStateService } from './pivot-grid-state.service' ;
106105
107106let NEXT_ID = 0 ;
108107const MINIMUM_COLUMN_WIDTH = 200 ;
@@ -197,7 +196,7 @@ const MINIMUM_COLUMN_WIDTH_SUPER_COMPACT = 104;
197196 schemas : [ CUSTOM_ELEMENTS_SCHEMA ]
198197} )
199198export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnInit , AfterContentInit ,
200- GridType , AfterViewInit , OnChanges {
199+ PivotGridType , AfterViewInit , OnChanges {
201200
202201 /**
203202 * Emitted when the dimension collection is changed via the grid chip area.
@@ -1029,7 +1028,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10291028 summaryService : IgxGridSummaryService ,
10301029 @Inject ( LOCALE_ID ) localeId : string ,
10311030 platform : PlatformUtil ,
1032- private pivotStateService : IgxPivotGridStateService ,
10331031 @Optional ( ) @Inject ( IgxGridTransaction ) _diTransactions ?: TransactionService < Transaction , State >
10341032 ) {
10351033 super (
@@ -2277,6 +2275,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
22772275 return hierarchy ;
22782276 }
22792277
2278+ /** @hidden @internal */
2279+ public currencyColumnSet : Set < string > = new Set ( ) ;
22802280 protected generateColumnHierarchy ( fields : Map < string , any > , data , parent = null ) : IgxColumnComponent [ ] {
22812281 let columns = [ ] ;
22822282 if ( fields . size === 0 ) {
@@ -2285,7 +2285,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
22852285 let columnDataType = value . dataType || this . resolveDataTypes ( data . length ? data [ 0 ] [ value . member ] : null ) ;
22862286
22872287 if ( value . aggregate ?. key ?. toLowerCase ( ) === 'count' && columnDataType === GridColumnDataType . Currency ) {
2288- this . pivotStateService . addCurrencyColumn ( value . member ) ;
2288+ this . currencyColumnSet . add ( value . member ) ;
22892289 columnDataType = GridColumnDataType . Number ;
22902290 }
22912291
@@ -2311,10 +2311,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
23112311 this . values . forEach ( ( aggregatorValue ) => {
23122312 if ( col . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
23132313 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' ) {
23162316 col . dataType = GridColumnDataType . Currency ;
2317- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2317+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
23182318 }
23192319 } )
23202320
@@ -2327,10 +2327,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
23272327 if ( child . field . includes ( aggregatorValue . member ) ) {
23282328 if ( child . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
23292329 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' ) {
23322332 child . dataType = GridColumnDataType . Currency ;
2333- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2333+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
23342334 }
23352335 }
23362336 } )
0 commit comments