@@ -93,8 +93,9 @@ import { CharSeparatedValueData } from '../services/csv/char-separated-value-dat
93
93
import { IgxColumnResizingService } from './resizing/resizing.service' ;
94
94
import { IFilteringStrategy } from '../data-operations/filtering-strategy' ;
95
95
import {
96
- IgxRowExpandedIndicatorDirective , IgxRowCollapsedIndicatorDirective ,
97
- IgxHeaderExpandIndicatorDirective , IgxHeaderCollapseIndicatorDirective , IgxExcelStyleHeaderIconDirective
96
+ IgxRowExpandedIndicatorDirective , IgxRowCollapsedIndicatorDirective , IgxHeaderExpandIndicatorDirective ,
97
+ IgxHeaderCollapseIndicatorDirective , IgxExcelStyleHeaderIconDirective , IgxSortAscendingHeaderIconDirective ,
98
+ IgxSortDescendingHeaderIconDirective , IgxSortHeaderIconDirective
98
99
} from './grid/grid.directives' ;
99
100
import {
100
101
GridKeydownTargetType ,
@@ -765,8 +766,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
765
766
* <igx-grid #grid [data]="localData" (rowAdd)="rowAdd($event)" [height]="'305px'" [autoGenerate]="true"></igx-grid>
766
767
* ```
767
768
*/
768
- @Output ( )
769
- public rowAdd = new EventEmitter < IGridEditEventArgs > ( ) ;
769
+ @Output ( )
770
+ public rowAdd = new EventEmitter < IGridEditEventArgs > ( ) ;
770
771
771
772
/**
772
773
* Emitted after column is resized.
@@ -1252,6 +1253,24 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
1252
1253
@ContentChild ( IgxExcelStyleHeaderIconDirective , { read : TemplateRef } )
1253
1254
public excelStyleHeaderIconTemplate : TemplateRef < any > = null ;
1254
1255
1256
+ /**
1257
+ * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in asc order.
1258
+ */
1259
+ @ContentChild ( IgxSortAscendingHeaderIconDirective , { read : TemplateRef } )
1260
+ public sortAscendingHeaderIconTemplate : TemplateRef < any > = null ;
1261
+
1262
+ /**
1263
+ * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in desc order.
1264
+ */
1265
+ @ContentChild ( IgxSortDescendingHeaderIconDirective , { read : TemplateRef } )
1266
+ public sortDescendingHeaderIconTemplate : TemplateRef < any > = null ;
1267
+
1268
+ /**
1269
+ * The custom template, if any, that should be used when rendering a header sorting indicator when columns are not sorted.
1270
+ */
1271
+ @ContentChild ( IgxSortHeaderIconDirective , { read : TemplateRef } )
1272
+ public sortHeaderIconTemplate : TemplateRef < any > = null ;
1273
+
1255
1274
/**
1256
1275
* @hidden
1257
1276
* @internal
@@ -3437,26 +3456,26 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
3437
3456
public setUpPaginator ( ) {
3438
3457
if ( this . paginator ) {
3439
3458
this . paginator . pageChange . pipe ( takeWhile ( ( ) => ! ! this . paginator ) , filter ( ( ) => ! this . _init ) )
3440
- . subscribe ( ( page : number ) => {
3441
- this . pageChange . emit ( page ) ;
3442
- } ) ;
3459
+ . subscribe ( ( page : number ) => {
3460
+ this . pageChange . emit ( page ) ;
3461
+ } ) ;
3443
3462
this . paginator . pagingDone . pipe ( takeWhile ( ( ) => ! ! this . paginator ) , filter ( ( ) => ! this . _init ) )
3444
- . subscribe ( ( args : IPageEventArgs ) => {
3445
- this . selectionService . clear ( true ) ;
3446
- this . pagingDone . emit ( { previous : args . previous , current : args . current } ) ;
3447
- this . crudService . endEdit ( false ) ;
3448
- this . pipeTrigger ++ ;
3449
- this . navigateTo ( 0 ) ;
3450
- this . notifyChanges ( ) ;
3451
- } ) ;
3463
+ . subscribe ( ( args : IPageEventArgs ) => {
3464
+ this . selectionService . clear ( true ) ;
3465
+ this . pagingDone . emit ( { previous : args . previous , current : args . current } ) ;
3466
+ this . crudService . endEdit ( false ) ;
3467
+ this . pipeTrigger ++ ;
3468
+ this . navigateTo ( 0 ) ;
3469
+ this . notifyChanges ( ) ;
3470
+ } ) ;
3452
3471
this . paginator . perPageChange . pipe ( takeWhile ( ( ) => ! ! this . paginator ) , filter ( ( ) => ! this . _init ) )
3453
- . subscribe ( ( perPage : number ) => {
3454
- this . selectionService . clear ( true ) ;
3455
- this . perPageChange . emit ( perPage ) ;
3456
- this . paginator . page = 0 ;
3457
- this . crudService . endEdit ( false ) ;
3458
- this . notifyChanges ( ) ;
3459
- } ) ;
3472
+ . subscribe ( ( perPage : number ) => {
3473
+ this . selectionService . clear ( true ) ;
3474
+ this . perPageChange . emit ( perPage ) ;
3475
+ this . paginator . page = 0 ;
3476
+ this . crudService . endEdit ( false ) ;
3477
+ this . notifyChanges ( ) ;
3478
+ } ) ;
3460
3479
} else {
3461
3480
this . markForCheck ( ) ;
3462
3481
}
@@ -3552,7 +3571,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
3552
3571
this . rendered$ . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
3553
3572
if ( this . paginator ) {
3554
3573
this . paginator . perPage = this . _perPage !== DEFAULT_ITEMS_PER_PAGE ? this . _perPage : this . paginator . perPage ;
3555
- this . paginator . totalRecords = this . totalRecords ;
3574
+ this . paginator . totalRecords = this . totalRecords ? this . totalRecords : this . paginator . totalRecords ;
3556
3575
this . paginator . overlaySettings = { outlet : this . outlet } ;
3557
3576
}
3558
3577
this . _rendered = true ;
@@ -3927,7 +3946,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
3927
3946
* ```
3928
3947
*/
3929
3948
public get columnsCollection ( ) : IgxColumnComponent [ ] {
3930
- return this . _rendered ? this . _columns : [ ] ;
3949
+ return this . _rendered ? this . _columns : [ ] ;
3931
3950
}
3932
3951
3933
3952
/**
@@ -5479,7 +5498,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
5479
5498
const selectedColumns = this . gridAPI . grid . selectedColumns ( ) ;
5480
5499
const columnData = this . getSelectedColumnsData ( this . clipboardOptions . copyFormatters , this . clipboardOptions . copyHeaders ) ;
5481
5500
let selectedData ;
5482
- if ( event . type === 'copy' ) {
5501
+ if ( event . type === 'copy' ) {
5483
5502
selectedData = this . getSelectedData ( this . clipboardOptions . copyFormatters , this . clipboardOptions . copyHeaders ) ;
5484
5503
} ;
5485
5504
@@ -5981,8 +6000,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
5981
6000
5982
6001
protected subscribeToTransactions ( ) : void {
5983
6002
this . transactionChange$ . next ( ) ;
5984
- this . transactions . onStateUpdate . pipe ( takeUntil ( merge ( this . destroy$ , this . transactionChange$ ) ) )
5985
- . subscribe ( this . transactionStatusUpdate . bind ( this ) ) ;
6003
+ this . transactions . onStateUpdate . pipe ( takeUntil ( merge ( this . destroy$ , this . transactionChange$ ) ) )
6004
+ . subscribe ( this . transactionStatusUpdate . bind ( this ) ) ;
5986
6005
}
5987
6006
5988
6007
protected transactionStatusUpdate ( event : StateUpdateEvent ) {
@@ -6742,10 +6761,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
6742
6761
let selectionMap ;
6743
6762
if ( this . nativeElement . tagName . toLowerCase ( ) === 'igx-hierarchical-grid' && selectionCollection . size > 0 ) {
6744
6763
selectionMap = isRemote ? Array . from ( selectionCollection ) :
6745
- Array . from ( selectionCollection ) . filter ( ( tuple ) => tuple [ 0 ] < source . length ) ;
6746
- } else {
6764
+ Array . from ( selectionCollection ) . filter ( ( tuple ) => tuple [ 0 ] < source . length ) ;
6765
+ } else {
6747
6766
selectionMap = isRemote ? Array . from ( this . selectionService . selection ) :
6748
- Array . from ( this . selectionService . selection ) . filter ( ( tuple ) => tuple [ 0 ] < source . length ) ;
6767
+ Array . from ( this . selectionService . selection ) . filter ( ( tuple ) => tuple [ 0 ] < source . length ) ;
6749
6768
}
6750
6769
6751
6770
if ( this . cellSelection === GridSelectionMode . single && activeEl ) {
0 commit comments