@@ -37,7 +37,7 @@ import { IgxGridBaseDirective } from '../grid-base.directive';
3737import { IgxFilteringService } from '../filtering/grid-filtering.service' ;
3838import { IgxGridSelectionService } from '../selection/selection.service' ;
3939import { IgxForOfSyncService , IgxForOfScrollSyncService } from '../../directives/for-of/for_of.sync.service' ;
40- import { ColumnType , GridType , IGX_GRID_BASE , IGX_GRID_SERVICE_BASE , IgxColumnTemplateContext , RowType } from '../common/grid.interface' ;
40+ import { ColumnType , GridType , IGX_GRID_BASE , IGX_GRID_SERVICE_BASE , IgxColumnTemplateContext , PivotGridType , RowType } from '../common/grid.interface' ;
4141import { IgxGridCRUDService } from '../common/crud.service' ;
4242import { IgxGridSummaryService } from '../summaries/grid-summary.service' ;
4343import { DEFAULT_PIVOT_KEYS , IDimensionsChange , IgxPivotGridValueTemplateContext , IPivotConfiguration , IPivotConfigurationChangedEventArgs , IPivotDimension , IPivotValue , IValuesChange , PivotDimensionType , IPivotUISettings , PivotRowLayoutType , PivotSummaryPosition } from './pivot-grid.interface' ;
@@ -103,7 +103,6 @@ import { IgxTextHighlightService } from '../../directives/text-highlight/text-hi
103103import { IgxPivotRowHeaderGroupComponent } from './pivot-row-header-group.component' ;
104104import { IgxPivotDateDimension } from './pivot-grid-dimensions' ;
105105import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
106- import { IgxPivotGridStateService } from './pivot-grid-state.service' ;
107106
108107let NEXT_ID = 0 ;
109108const MINIMUM_COLUMN_WIDTH = 200 ;
@@ -199,7 +198,7 @@ const MINIMUM_COLUMN_WIDTH_SUPER_COMPACT = 104;
199198 schemas : [ CUSTOM_ELEMENTS_SCHEMA ]
200199} )
201200export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnInit , AfterContentInit ,
202- GridType , AfterViewInit , OnChanges {
201+ PivotGridType , AfterViewInit , OnChanges {
203202
204203 /**
205204 * Emitted when the dimension collection is changed via the grid chip area.
@@ -1031,7 +1030,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10311030 summaryService : IgxGridSummaryService ,
10321031 @Inject ( LOCALE_ID ) localeId : string ,
10331032 platform : PlatformUtil ,
1034- private pivotStateService : IgxPivotGridStateService ,
10351033 @Optional ( ) @Inject ( IgxGridTransaction ) _diTransactions ?: TransactionService < Transaction , State >
10361034 ) {
10371035 super (
@@ -2288,6 +2286,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
22882286 return hierarchy ;
22892287 }
22902288
2289+ /** @hidden @internal */
2290+ public currencyColumnSet : Set < string > = new Set ( ) ;
22912291 protected generateColumnHierarchy ( fields : Map < string , any > , data , parent = null ) : IgxColumnComponent [ ] {
22922292 let columns = [ ] ;
22932293 if ( fields . size === 0 ) {
@@ -2296,7 +2296,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
22962296 let columnDataType = value . dataType || this . resolveDataTypes ( data . length ? data [ 0 ] [ value . member ] : null ) ;
22972297
22982298 if ( value . aggregate ?. key ?. toLowerCase ( ) === 'count' && columnDataType === GridColumnDataType . Currency ) {
2299- this . pivotStateService . addCurrencyColumn ( value . member ) ;
2299+ this . currencyColumnSet . add ( value . member ) ;
23002300 columnDataType = GridColumnDataType . Number ;
23012301 }
23022302
@@ -2322,10 +2322,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
23222322 this . values . forEach ( ( aggregatorValue ) => {
23232323 if ( col . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
23242324 col . dataType = GridColumnDataType . Number ;
2325- this . pivotStateService . addCurrencyColumn ( aggregatorValue . member ) ;
2326- } else if ( this . pivotStateService . isCurrencyColumn ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2325+ this . currencyColumnSet . add ( aggregatorValue . member ) ;
2326+ } else if ( this . currencyColumnSet . has ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
23272327 col . dataType = GridColumnDataType . Currency ;
2328- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2328+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
23292329 }
23302330 } )
23312331
@@ -2338,10 +2338,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
23382338 if ( child . field . includes ( aggregatorValue . member ) ) {
23392339 if ( child . dataType === GridColumnDataType . Currency && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) === 'count' ) {
23402340 child . dataType = GridColumnDataType . Number ;
2341- this . pivotStateService . addCurrencyColumn ( aggregatorValue . member ) ;
2342- } else if ( this . pivotStateService . isCurrencyColumn ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
2341+ this . currencyColumnSet . add ( aggregatorValue . member ) ;
2342+ } else if ( this . currencyColumnSet . has ( aggregatorValue . member ) && aggregatorValue . aggregate ?. key ?. toLowerCase ( ) !== 'count' ) {
23432343 child . dataType = GridColumnDataType . Currency ;
2344- this . pivotStateService . removeCurrencyColumn ( aggregatorValue . member ) ;
2344+ this . currencyColumnSet . delete ( aggregatorValue . member ) ;
23452345 }
23462346 }
23472347 } )
0 commit comments