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