File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
projects/angular/components/ui-grid/src Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -449,8 +449,9 @@ export class UiGridComponent<T extends IGridDataEntry>
449
449
*
450
450
*/
451
451
@Input ( )
452
- maxSelectedFilterValues = Infinity ;
453
-
452
+ set maxSelectedFilterValues ( value : number ) {
453
+ this . maxSelectedFilterValues$ . next ( value ) ;
454
+ }
454
455
/**
455
456
* Configure if the pagination should be selectable
456
457
*
@@ -758,6 +759,12 @@ export class UiGridComponent<T extends IGridDataEntry>
758
759
} ) ,
759
760
) ;
760
761
762
+ /**
763
+ * Emits current max selected filter values count
764
+ *
765
+ */
766
+ maxSelectedFilterValues$ = new BehaviorSubject ( Infinity ) ;
767
+
761
768
/**
762
769
* Emits the id of the entity that should be highlighted.
763
770
*
@@ -859,8 +866,12 @@ export class UiGridComponent<T extends IGridDataEntry>
859
866
) ;
860
867
861
868
disableFilterSelection$ = defer ( ( ) => this . filterManager . activeFilterValueCount$ . pipe (
862
- map ( count => count >= this . maxSelectedFilterValues ) ) ,
863
- ) . pipe ( shareReplay ( 1 ) ) ;
869
+ switchMap ( count => this . maxSelectedFilterValues$
870
+ . pipe (
871
+ map ( max => count >= max ) ,
872
+ ) ) ,
873
+ distinctUntilChanged ( ) ,
874
+ ) ) . pipe ( shareReplay ( 1 ) ) ;
864
875
865
876
readonly Infinity = Infinity ;
866
877
protected _destroyed$ = new Subject < void > ( ) ;
You can’t perform that action at this time.
0 commit comments