@@ -93,8 +93,9 @@ import { CharSeparatedValueData } from '../services/csv/char-separated-value-dat
9393import { IgxColumnResizingService } from './resizing/resizing.service' ;
9494import { IFilteringStrategy } from '../data-operations/filtering-strategy' ;
9595import {
96- IgxRowExpandedIndicatorDirective , IgxRowCollapsedIndicatorDirective ,
97- IgxHeaderExpandIndicatorDirective , IgxHeaderCollapseIndicatorDirective , IgxExcelStyleHeaderIconDirective
96+ IgxRowExpandedIndicatorDirective , IgxRowCollapsedIndicatorDirective , IgxHeaderExpandIndicatorDirective ,
97+ IgxHeaderCollapseIndicatorDirective , IgxExcelStyleHeaderIconDirective , IgxSortAscendingHeaderIconDirective ,
98+ IgxSortDescendingHeaderIconDirective , IgxSortHeaderIconDirective
9899} from './grid/grid.directives' ;
99100import {
100101 GridKeydownTargetType ,
@@ -765,8 +766,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
765766 * <igx-grid #grid [data]="localData" (rowAdd)="rowAdd($event)" [height]="'305px'" [autoGenerate]="true"></igx-grid>
766767 * ```
767768 */
768- @Output ( )
769- public rowAdd = new EventEmitter < IGridEditEventArgs > ( ) ;
769+ @Output ( )
770+ public rowAdd = new EventEmitter < IGridEditEventArgs > ( ) ;
770771
771772 /**
772773 * Emitted after column is resized.
@@ -1252,6 +1253,24 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
12521253 @ContentChild ( IgxExcelStyleHeaderIconDirective , { read : TemplateRef } )
12531254 public excelStyleHeaderIconTemplate : TemplateRef < any > = null ;
12541255
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+
12551274 /**
12561275 * @hidden
12571276 * @internal
@@ -3437,26 +3456,26 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
34373456 public setUpPaginator ( ) {
34383457 if ( this . paginator ) {
34393458 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+ } ) ;
34433462 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+ } ) ;
34523471 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+ } ) ;
34603479 } else {
34613480 this . markForCheck ( ) ;
34623481 }
@@ -3552,7 +3571,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
35523571 this . rendered$ . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
35533572 if ( this . paginator ) {
35543573 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 ;
35563575 this . paginator . overlaySettings = { outlet : this . outlet } ;
35573576 }
35583577 this . _rendered = true ;
@@ -3927,7 +3946,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
39273946 * ```
39283947 */
39293948 public get columnsCollection ( ) : IgxColumnComponent [ ] {
3930- return this . _rendered ? this . _columns : [ ] ;
3949+ return this . _rendered ? this . _columns : [ ] ;
39313950 }
39323951
39333952 /**
@@ -5479,7 +5498,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
54795498 const selectedColumns = this . gridAPI . grid . selectedColumns ( ) ;
54805499 const columnData = this . getSelectedColumnsData ( this . clipboardOptions . copyFormatters , this . clipboardOptions . copyHeaders ) ;
54815500 let selectedData ;
5482- if ( event . type === 'copy' ) {
5501+ if ( event . type === 'copy' ) {
54835502 selectedData = this . getSelectedData ( this . clipboardOptions . copyFormatters , this . clipboardOptions . copyHeaders ) ;
54845503 } ;
54855504
@@ -5981,8 +6000,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
59816000
59826001 protected subscribeToTransactions ( ) : void {
59836002 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 ) ) ;
59866005 }
59876006
59886007 protected transactionStatusUpdate ( event : StateUpdateEvent ) {
@@ -6742,10 +6761,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
67426761 let selectionMap ;
67436762 if ( this . nativeElement . tagName . toLowerCase ( ) === 'igx-hierarchical-grid' && selectionCollection . size > 0 ) {
67446763 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 {
67476766 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 ) ;
67496768 }
67506769
67516770 if ( this . cellSelection === GridSelectionMode . single && activeEl ) {
0 commit comments