@@ -1510,10 +1510,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
1510
1510
@Output ( )
1511
1511
public onGridKeydown = new EventEmitter < IGridKeydownEventArgs > ( ) ;
1512
1512
1513
- /**
1514
- * Emitted when start dragging a row.
1515
- * Return the dragged row.
1516
- */
1513
+ /**
1514
+ * Emitted when start dragging a row.
1515
+ * Return the dragged row.
1516
+ */
1517
1517
@Output ( )
1518
1518
public onRowDragStart = new EventEmitter < IRowDragStartEventArgs > ( ) ;
1519
1519
@@ -1714,9 +1714,9 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
1714
1714
@ViewChild ( 'verticalScrollContainer' , { read : IgxGridForOfDirective } )
1715
1715
public verticalScrollContainer : IgxGridForOfDirective < any > ;
1716
1716
1717
- /**
1718
- * @hidden
1719
- */
1717
+ /**
1718
+ * @hidden
1719
+ */
1720
1720
@ViewChild ( 'verticalScrollHolder' , { read : IgxGridForOfDirective } )
1721
1721
public verticalScroll : IgxGridForOfDirective < any > ;
1722
1722
@@ -2712,8 +2712,8 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
2712
2712
this . _derivePossibleHeight ( ) ;
2713
2713
2714
2714
this . columnList . changes
2715
- . pipe ( takeUntil ( this . destroy$ ) )
2716
- . subscribe ( ( change : QueryList < IgxColumnComponent > ) => { this . onColumnsChanged ( change ) ; } ) ;
2715
+ . pipe ( takeUntil ( this . destroy$ ) )
2716
+ . subscribe ( ( change : QueryList < IgxColumnComponent > ) => { this . onColumnsChanged ( change ) ; } ) ;
2717
2717
}
2718
2718
2719
2719
/**
@@ -4096,7 +4096,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4096
4096
4097
4097
if ( this . isPercentHeight ) {
4098
4098
/*height in %*/
4099
- if ( computed . getPropertyValue ( 'height' ) . indexOf ( '%' ) === - 1 ) {
4099
+ if ( computed . getPropertyValue ( 'height' ) . indexOf ( '%' ) === - 1 ) {
4100
4100
gridHeight = parseInt ( computed . getPropertyValue ( 'height' ) , 10 ) ;
4101
4101
} else {
4102
4102
return this . defaultTargetBodyHeight ;
@@ -4105,10 +4105,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4105
4105
gridHeight = parseInt ( this . _height , 10 ) ;
4106
4106
}
4107
4107
const height = Math . abs ( gridHeight - toolbarHeight -
4108
- this . theadRow . nativeElement . offsetHeight -
4109
- this . summariesHeight - pagingHeight -
4110
- groupAreaHeight - footerBordersAndScrollbars -
4111
- this . scr . nativeElement . clientHeight ) ;
4108
+ this . theadRow . nativeElement . offsetHeight -
4109
+ this . summariesHeight - pagingHeight -
4110
+ groupAreaHeight - footerBordersAndScrollbars -
4111
+ this . scr . nativeElement . clientHeight ) ;
4112
4112
4113
4113
if ( height === 0 || isNaN ( gridHeight ) ) {
4114
4114
const bodyHeight = this . defaultTargetBodyHeight ;
@@ -4209,7 +4209,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4209
4209
4210
4210
4211
4211
if ( ! width ) {
4212
- width = this . columnList . reduce ( ( sum , item ) => sum + parseInt ( ( item . width || item . defaultWidth ) , 10 ) , 0 ) ;
4212
+ width = this . columnList . reduce ( ( sum , item ) => sum + parseInt ( ( item . width || item . defaultWidth ) , 10 ) , 0 ) ;
4213
4213
}
4214
4214
4215
4215
if ( this . hasVerticalSroll ( ) ) {
@@ -4226,8 +4226,8 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4226
4226
if ( ! this . _ngAfterViewInitPassed ) { return false ; }
4227
4227
const isScrollable = this . verticalScrollContainer . isScrollable ( ) ;
4228
4228
return ! ! ( this . calcWidth && this . verticalScrollContainer . igxForOf &&
4229
- this . verticalScrollContainer . igxForOf . length > 0 &&
4230
- isScrollable ) ;
4229
+ this . verticalScrollContainer . igxForOf . length > 0 &&
4230
+ isScrollable ) ;
4231
4231
}
4232
4232
4233
4233
/**
@@ -4289,6 +4289,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4289
4289
this . repositionRowEditingOverlay ( this . rowInEditMode ) ;
4290
4290
}
4291
4291
4292
+ if ( this . filteringService . isFilterRowVisible ) {
4293
+ this . filteringRow . resetChipsArea ( ) ;
4294
+ }
4295
+
4292
4296
this . cdr . detectChanges ( ) ;
4293
4297
this . resetCaches ( ) ;
4294
4298
// in case scrollbar has appeared recalc to size correctly.
@@ -4460,9 +4464,9 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4460
4464
this . columnList . forEach ( ( col ) => {
4461
4465
if ( col . columnLayout ) {
4462
4466
const layoutSize = col . children ?
4463
- col . children . reduce ( ( acc , val ) => Math . max ( val . rowStart + val . gridRowSpan - 1 , acc ) , 1 ) :
4464
- 1 ;
4465
- this . _multiRowLayoutRowSize = Math . max ( layoutSize , this . _multiRowLayoutRowSize ) ;
4467
+ col . children . reduce ( ( acc , val ) => Math . max ( val . rowStart + val . gridRowSpan - 1 , acc ) , 1 ) :
4468
+ 1 ;
4469
+ this . _multiRowLayoutRowSize = Math . max ( layoutSize , this . _multiRowLayoutRowSize ) ;
4466
4470
}
4467
4471
} ) ;
4468
4472
}
@@ -4767,8 +4771,8 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4767
4771
4768
4772
4769
4773
setSelection ( range : GridSelectionRange ) : void {
4770
- const startNode = { row : range . rowStart , column : this . columnToVisibleIndex ( range . columnStart ) } ;
4771
- const endNode = { row : range . rowEnd , column : this . columnToVisibleIndex ( range . columnEnd ) } ;
4774
+ const startNode = { row : range . rowStart , column : this . columnToVisibleIndex ( range . columnStart ) } ;
4775
+ const endNode = { row : range . rowEnd , column : this . columnToVisibleIndex ( range . columnEnd ) } ;
4772
4776
4773
4777
this . selectionService . pointerState . node = startNode ;
4774
4778
this . selectionService . selectRange ( endNode , this . selectionService . pointerState ) ;
@@ -4859,7 +4863,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4859
4863
*/
4860
4864
public navigateTo ( rowIndex : number , visibleColIndex = - 1 , cb : Function = null ) {
4861
4865
if ( rowIndex < 0 || rowIndex > this . verticalScrollContainer . igxForOf . length - 1
4862
- || ( visibleColIndex !== - 1 && this . columnList . map ( col => col . visibleIndex ) . indexOf ( visibleColIndex ) === - 1 ) ) {
4866
+ || ( visibleColIndex !== - 1 && this . columnList . map ( col => col . visibleIndex ) . indexOf ( visibleColIndex ) === - 1 ) ) {
4863
4867
return ;
4864
4868
}
4865
4869
this . wheelHandler ( ) ;
@@ -4871,9 +4875,9 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4871
4875
if ( this . navigation . shouldPerformVerticalScroll ( rowIndex ) ) {
4872
4876
this . verticalScrollContainer . scrollTo ( rowIndex ) ;
4873
4877
this . verticalScrollContainer . onChunkLoad
4874
- . pipe ( first ( ) ) . subscribe ( ( ) => {
4875
- this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4876
- } ) ;
4878
+ . pipe ( first ( ) ) . subscribe ( ( ) => {
4879
+ this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4880
+ } ) ;
4877
4881
} else {
4878
4882
this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4879
4883
}
@@ -4882,89 +4886,89 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4882
4886
this . parentVirtDir . onChunkLoad
4883
4887
. pipe ( first ( ) )
4884
4888
. subscribe ( ( ) => {
4885
- if ( this . navigation . shouldPerformVerticalScroll ( rowIndex ) ) {
4886
- this . verticalScrollContainer . scrollTo ( rowIndex ) ;
4887
- this . verticalScrollContainer . onChunkLoad
4888
- . pipe ( first ( ) ) . subscribe ( ( ) => {
4889
+ if ( this . navigation . shouldPerformVerticalScroll ( rowIndex ) ) {
4890
+ this . verticalScrollContainer . scrollTo ( rowIndex ) ;
4891
+ this . verticalScrollContainer . onChunkLoad
4892
+ . pipe ( first ( ) ) . subscribe ( ( ) => {
4893
+ this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4894
+ } ) ;
4895
+ } else {
4889
4896
this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4890
- } ) ;
4891
- } else {
4892
- this . executeCallback ( rowIndex , visibleColIndex , cb ) ;
4893
- }
4897
+ }
4894
4898
4895
- } ) ;
4899
+ } ) ;
4896
4900
this . navigation . horizontalScroll ( rowIndex ) . scrollTo ( unpinnedIndex ) ;
4897
4901
}
4898
4902
}
4899
4903
4900
- /**
4901
- * Returns `ICellPosition` which defines the next cell,
4902
- * according to the current position, that match specific criteria.
4903
- * You can pass callback function as a third parameter of `getPreviousCell` method.
4904
- * The callback function accepts IgxColumnComponent as a param
4905
- * ```typescript
4906
- * const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
4907
- * ```
4908
- * @memberof IgxGridBaseComponent
4909
- */
4904
+ /**
4905
+ * Returns `ICellPosition` which defines the next cell,
4906
+ * according to the current position, that match specific criteria.
4907
+ * You can pass callback function as a third parameter of `getPreviousCell` method.
4908
+ * The callback function accepts IgxColumnComponent as a param
4909
+ * ```typescript
4910
+ * const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
4911
+ * ```
4912
+ * @memberof IgxGridBaseComponent
4913
+ */
4910
4914
public getNextCell ( currRowIndex : number , curVisibleColIndex : number ,
4911
- callback : ( IgxColumnComponent ) => boolean = null ) : ICellPosition {
4915
+ callback : ( IgxColumnComponent ) => boolean = null ) : ICellPosition {
4912
4916
const columns = this . columnList . filter ( col => ! col . columnGroup && col . visibleIndex >= 0 ) ;
4913
4917
4914
4918
if ( ! this . isValidPosition ( currRowIndex , curVisibleColIndex ) ) {
4915
- return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4919
+ return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4916
4920
}
4917
4921
const colIndexes = callback ? columns . filter ( ( col ) => callback ( col ) ) . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => a - b ) :
4918
- columns . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => a - b ) ;
4922
+ columns . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => a - b ) ;
4919
4923
const nextCellIndex = colIndexes . find ( index => index > curVisibleColIndex ) ;
4920
4924
if ( this . verticalScrollContainer . igxForOf . slice ( currRowIndex , currRowIndex + 1 )
4921
- . find ( rec => ! rec . expression && ! rec . summaries && ! rec . childGridsData ) && nextCellIndex !== undefined ) {
4922
- return { rowIndex : currRowIndex , visibleColumnIndex : nextCellIndex } ;
4925
+ . find ( rec => ! rec . expression && ! rec . summaries && ! rec . childGridsData ) && nextCellIndex !== undefined ) {
4926
+ return { rowIndex : currRowIndex , visibleColumnIndex : nextCellIndex } ;
4923
4927
} else {
4924
4928
if ( colIndexes . length === 0 || this . getNextDataRowIndex ( currRowIndex ) === currRowIndex ) {
4925
- return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4929
+ return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4926
4930
} else {
4927
- return { rowIndex : this . getNextDataRowIndex ( currRowIndex ) , visibleColumnIndex : colIndexes [ 0 ] } ;
4931
+ return { rowIndex : this . getNextDataRowIndex ( currRowIndex ) , visibleColumnIndex : colIndexes [ 0 ] } ;
4928
4932
}
4929
4933
}
4930
4934
}
4931
4935
4932
- /**
4933
- * Returns `ICellPosition` which defines the previous cell,
4934
- * according to the current position, that match specific criteria.
4935
- * You can pass callback function as a third parameter of `getPreviousCell` method.
4936
- * The callback function accepts IgxColumnComponent as a param
4937
- * ```typescript
4938
- * const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
4939
- * ```
4940
- * @memberof IgxGridBaseComponent
4941
- */
4936
+ /**
4937
+ * Returns `ICellPosition` which defines the previous cell,
4938
+ * according to the current position, that match specific criteria.
4939
+ * You can pass callback function as a third parameter of `getPreviousCell` method.
4940
+ * The callback function accepts IgxColumnComponent as a param
4941
+ * ```typescript
4942
+ * const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
4943
+ * ```
4944
+ * @memberof IgxGridBaseComponent
4945
+ */
4942
4946
public getPreviousCell ( currRowIndex : number , curVisibleColIndex : number ,
4943
- callback : ( IgxColumnComponent ) => boolean = null ) : ICellPosition {
4944
- const columns = this . columnList . filter ( col => ! col . columnGroup && col . visibleIndex >= 0 ) ;
4947
+ callback : ( IgxColumnComponent ) => boolean = null ) : ICellPosition {
4948
+ const columns = this . columnList . filter ( col => ! col . columnGroup && col . visibleIndex >= 0 ) ;
4945
4949
4946
4950
if ( ! this . isValidPosition ( currRowIndex , curVisibleColIndex ) ) {
4947
- return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4951
+ return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4948
4952
}
4949
4953
const colIndexes = callback ? columns . filter ( ( col ) => callback ( col ) ) . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => b - a ) :
4950
- columns . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => b - a ) ;
4954
+ columns . map ( editCol => editCol . visibleIndex ) . sort ( ( a , b ) => b - a ) ;
4951
4955
const prevCellIndex = colIndexes . find ( index => index < curVisibleColIndex ) ;
4952
4956
if ( this . verticalScrollContainer . igxForOf . slice ( currRowIndex , currRowIndex + 1 )
4953
- . find ( rec => ! rec . expression && ! rec . summaries && ! rec . childGridsData ) && prevCellIndex !== undefined ) {
4954
- return { rowIndex : currRowIndex , visibleColumnIndex : prevCellIndex } ;
4957
+ . find ( rec => ! rec . expression && ! rec . summaries && ! rec . childGridsData ) && prevCellIndex !== undefined ) {
4958
+ return { rowIndex : currRowIndex , visibleColumnIndex : prevCellIndex } ;
4955
4959
} else {
4956
4960
if ( colIndexes . length === 0 || this . getPrevDataRowIndex ( currRowIndex ) === currRowIndex ) {
4957
- return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4961
+ return { rowIndex : currRowIndex , visibleColumnIndex : curVisibleColIndex } ;
4958
4962
} else {
4959
- return { rowIndex : this . getPrevDataRowIndex ( currRowIndex ) , visibleColumnIndex : colIndexes [ 0 ] } ;
4963
+ return { rowIndex : this . getPrevDataRowIndex ( currRowIndex ) , visibleColumnIndex : colIndexes [ 0 ] } ;
4960
4964
}
4961
4965
}
4962
4966
}
4963
4967
4964
4968
private executeCallback ( rowIndex , visibleColIndex = - 1 , cb : Function = null ) {
4965
4969
if ( ! cb ) { return ; }
4966
4970
let targetType , target ;
4967
- const row = this . summariesRowList . filter ( s => s . index !== 0 ) . concat ( this . rowList . toArray ( ) ) . find ( r => r . index === rowIndex ) ;
4971
+ const row = this . summariesRowList . filter ( s => s . index !== 0 ) . concat ( this . rowList . toArray ( ) ) . find ( r => r . index === rowIndex ) ;
4968
4972
if ( ! row ) { return ; }
4969
4973
switch ( row . nativeElement . tagName . toLowerCase ( ) ) {
4970
4974
case 'igx-grid-groupby-row' :
@@ -4998,7 +5002,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
4998
5002
}
4999
5003
5000
5004
private getNextDataRowIndex ( currentRowIndex ) : number {
5001
- if ( currentRowIndex === this . verticalScrollContainer . igxForOf . length ) { return currentRowIndex ; }
5005
+ if ( currentRowIndex === this . verticalScrollContainer . igxForOf . length ) { return currentRowIndex ; }
5002
5006
5003
5007
const nextRow = this . verticalScrollContainer . igxForOf . slice ( currentRowIndex + 1 , this . verticalScrollContainer . igxForOf . length )
5004
5008
. find ( rec => ! rec . expression && ! rec . summaries && ! rec . childGridsData ) ;
@@ -5011,7 +5015,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5011
5015
if ( rows < 1 || cols < 1 ) { return false ; }
5012
5016
if ( rowIndex > - 1 && rowIndex < this . verticalScrollContainer . igxForOf . length &&
5013
5017
colIndex > - 1 && colIndex <= this . unpinnedColumns [ this . unpinnedColumns . length - 1 ] . visibleIndex ) {
5014
- return true ;
5018
+ return true ;
5015
5019
}
5016
5020
return false ;
5017
5021
}
@@ -5021,10 +5025,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5021
5025
*/
5022
5026
public wheelHandler ( isScroll = false ) {
5023
5027
if ( document . activeElement &&
5024
- // tslint:disable-next-line:no-bitwise
5028
+ // tslint:disable-next-line:no-bitwise
5025
5029
( document . activeElement . compareDocumentPosition ( this . tbody . nativeElement ) & Node . DOCUMENT_POSITION_CONTAINS ||
5026
- // tslint:disable-next-line:no-bitwise
5027
- ( document . activeElement . compareDocumentPosition ( this . tfoot . nativeElement ) & Node . DOCUMENT_POSITION_CONTAINS && isScroll ) ) ) {
5030
+ // tslint:disable-next-line:no-bitwise
5031
+ ( document . activeElement . compareDocumentPosition ( this . tfoot . nativeElement ) & Node . DOCUMENT_POSITION_CONTAINS && isScroll ) ) ) {
5028
5032
( document . activeElement as HTMLElement ) . blur ( ) ;
5029
5033
}
5030
5034
}
@@ -5088,7 +5092,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5088
5092
5089
5093
if ( this . lastSearchInfo . matchInfoCache . length ) {
5090
5094
const matchInfo = this . lastSearchInfo . matchInfoCache [ this . lastSearchInfo . activeMatchIndex ] ;
5091
- this . lastSearchInfo = { ...this . lastSearchInfo } ;
5095
+ this . lastSearchInfo = { ...this . lastSearchInfo } ;
5092
5096
5093
5097
if ( scroll !== false ) {
5094
5098
this . scrollTo ( matchInfo . row , matchInfo . column ) ;
@@ -5192,7 +5196,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5192
5196
protected scrollTo ( row : any | number , column : any | number ) : void {
5193
5197
let delayScrolling = false ;
5194
5198
5195
- if ( this . paging && typeof ( row ) !== 'number' ) {
5199
+ if ( this . paging && typeof ( row ) !== 'number' ) {
5196
5200
const rowIndex = this . filteredSortedData . indexOf ( row ) ;
5197
5201
const page = Math . floor ( rowIndex / this . perPage ) ;
5198
5202
@@ -5205,11 +5209,11 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5205
5209
if ( delayScrolling ) {
5206
5210
this . verticalScrollContainer . onDataChanged . pipe ( first ( ) ) . subscribe ( ( ) => {
5207
5211
this . scrollDirective ( this . verticalScrollContainer ,
5208
- typeof ( row ) === 'number' ? row : this . verticalScrollContainer . igxForOf . indexOf ( row ) ) ;
5212
+ typeof ( row ) === 'number' ? row : this . verticalScrollContainer . igxForOf . indexOf ( row ) ) ;
5209
5213
} ) ;
5210
5214
} else {
5211
5215
this . scrollDirective ( this . verticalScrollContainer ,
5212
- typeof ( row ) === 'number' ? row : this . verticalScrollContainer . igxForOf . indexOf ( row ) ) ;
5216
+ typeof ( row ) === 'number' ? row : this . verticalScrollContainer . igxForOf . indexOf ( row ) ) ;
5213
5217
}
5214
5218
5215
5219
this . scrollToHorizontally ( column ) ;
@@ -5476,12 +5480,12 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
5476
5480
}
5477
5481
5478
5482
protected _restoreVirtState ( row ) {
5479
- // check virtualization state of data record added from cache
5480
- // in case state is no longer valid - update it.
5481
- const rowForOf = row . virtDirRow ;
5482
- const gridScrLeft = rowForOf . getHorizontalScroll ( ) . scrollLeft ;
5483
- const left = - parseInt ( rowForOf . dc . instance . _viewContainer . element . nativeElement . style . left , 10 ) ;
5484
- const actualScrollLeft = left + rowForOf . getColumnScrollLeft ( rowForOf . state . startIndex ) ;
5483
+ // check virtualization state of data record added from cache
5484
+ // in case state is no longer valid - update it.
5485
+ const rowForOf = row . virtDirRow ;
5486
+ const gridScrLeft = rowForOf . getHorizontalScroll ( ) . scrollLeft ;
5487
+ const left = - parseInt ( rowForOf . dc . instance . _viewContainer . element . nativeElement . style . left , 10 ) ;
5488
+ const actualScrollLeft = left + rowForOf . getColumnScrollLeft ( rowForOf . state . startIndex ) ;
5485
5489
if ( gridScrLeft !== actualScrollLeft ) {
5486
5490
rowForOf . onHScroll ( gridScrLeft ) ;
5487
5491
}
0 commit comments