@@ -75,7 +75,7 @@ export class IgxRow {
75
75
76
76
createDoneEditEventArgs ( cachedRowData : any , event ?: Event ) : IGridEditDoneEventArgs {
77
77
const updatedData = this . grid . transactions . enabled ?
78
- this . grid . transactions . getAggregatedValue ( this . id , true ) : this . grid . gridAPI . getRowData ( this . id ) ;
78
+ this . grid . transactions . getAggregatedValue ( this . id , true ) : this . grid . gridAPI . getRowData ( this . id ) ;
79
79
const rowData = updatedData === null ? this . grid . gridAPI . getRowData ( this . id ) : updatedData ;
80
80
const args : IGridEditDoneEventArgs = {
81
81
rowID : this . id ,
@@ -131,7 +131,7 @@ export class IgxCell {
131
131
132
132
createDoneEditEventArgs ( value : any , event ?: Event ) : IGridEditDoneEventArgs {
133
133
const updatedData = this . grid . transactions . enabled ?
134
- this . grid . transactions . getAggregatedValue ( this . id . rowID , true ) : this . rowData ;
134
+ this . grid . transactions . getAggregatedValue ( this . id . rowID , true ) : this . rowData ;
135
135
const rowData = updatedData === null ? this . grid . gridAPI . getRowData ( this . id . rowID ) : updatedData ;
136
136
const args : IGridEditDoneEventArgs = {
137
137
rowID : this . id . rowID ,
@@ -228,7 +228,7 @@ export class IgxGridCRUDService {
228
228
}
229
229
/** Changing the reference with the new editable cell */
230
230
const newCell = this . createCell ( cell ) ;
231
- if ( this . rowEditing ) {
231
+ if ( this . rowEditing ) {
232
232
const canceled = this . beginRowEdit ( newCell , event ) ;
233
233
if ( ! canceled ) {
234
234
this . beginCellEdit ( newCell , event ) ;
@@ -394,6 +394,7 @@ export class IgxGridSelectionService {
394
394
_ranges : Set < string > = new Set < string > ( ) ;
395
395
_selectionRange : Range ;
396
396
rowSelection : Set < any > = new Set < any > ( ) ;
397
+ indeterminateRows : Set < any > = new Set < any > ( ) ;
397
398
columnSelection : Set < string > = new Set < string > ( ) ;
398
399
/**
399
400
* @hidden @internal
@@ -759,12 +760,16 @@ export class IgxGridSelectionService {
759
760
return this . rowSelection . size ? Array . from ( this . rowSelection . keys ( ) ) : [ ] ;
760
761
}
761
762
763
+ /** Returns array of the rows in indeterminate state. */
764
+ getIndeterminateRows ( ) : Array < any > {
765
+ return this . indeterminateRows . size ? Array . from ( this . indeterminateRows . keys ( ) ) : [ ] ;
766
+ }
767
+
762
768
/** Clears row selection, if filtering is applied clears only selected rows from filtered data. */
763
769
clearRowSelection ( event ?) : void {
764
770
const removedRec = this . isFilteringApplied ( ) ?
765
771
this . getRowIDs ( this . allData ) . filter ( rID => this . isRowSelected ( rID ) ) : this . getSelectedRows ( ) ;
766
772
const newSelection = this . isFilteringApplied ( ) ? this . getSelectedRows ( ) . filter ( x => ! removedRec . includes ( x ) ) : [ ] ;
767
-
768
773
this . emitRowSelectionEvent ( newSelection , [ ] , removedRec , event ) ;
769
774
}
770
775
@@ -773,6 +778,7 @@ export class IgxGridSelectionService {
773
778
const allRowIDs = this . getRowIDs ( this . allData ) ;
774
779
const addedRows = allRowIDs . filter ( ( rID ) => ! this . isRowSelected ( rID ) ) ;
775
780
const newSelection = this . rowSelection . size ? this . getSelectedRows ( ) . concat ( addedRows ) : addedRows ;
781
+ this . indeterminateRows . clear ( ) ;
776
782
this . selectedRowsChange . next ( ) ;
777
783
this . emitRowSelectionEvent ( newSelection , addedRows , [ ] , event ) ;
778
784
}
@@ -824,6 +830,10 @@ export class IgxGridSelectionService {
824
830
return this . rowSelection . size > 0 && this . rowSelection . has ( rowID ) ;
825
831
}
826
832
833
+ isRowInIndeterminateState ( rowID ) : boolean {
834
+ return this . indeterminateRows . size > 0 && this . indeterminateRows . has ( rowID ) ;
835
+ }
836
+
827
837
/** Select range from last selected row to the current specified row. */
828
838
selectMultipleRows ( rowID , rowData , event ?) : void {
829
839
this . allRowsSelected = undefined ;
@@ -904,6 +914,7 @@ export class IgxGridSelectionService {
904
914
/** Clear rowSelection and update checkbox state */
905
915
public clearAllSelectedRows ( ) : void {
906
916
this . rowSelection . clear ( ) ;
917
+ this . indeterminateRows . clear ( ) ;
907
918
this . clearHeaderCBState ( ) ;
908
919
this . selectedRowsChange . next ( ) ;
909
920
}
@@ -1041,7 +1052,7 @@ export class IgxGridSelectionService {
1041
1052
this . columnSelection . clear ( ) ;
1042
1053
}
1043
1054
1044
- private areEqualCollections ( first , second ) : boolean {
1055
+ protected areEqualCollections ( first , second ) : boolean {
1045
1056
return first . length === second . length && new Set ( first . concat ( second ) ) . size === first . length ;
1046
1057
}
1047
1058
@@ -1057,4 +1068,4 @@ export class IgxGridSelectionService {
1057
1068
}
1058
1069
1059
1070
export const isChromium = ( ) : boolean => ( / C h r o m | e ? i u m / g. test ( navigator . userAgent ) ||
1060
- / G o o g l e I n c / g. test ( navigator . vendor ) ) && ! / E d g e / g. test ( navigator . userAgent ) ;
1071
+ / G o o g l e I n c / g. test ( navigator . vendor ) ) && ! / E d g e / g. test ( navigator . userAgent ) ;
0 commit comments