@@ -30,17 +30,15 @@ import { IgxDropDownModule } from '../drop-down/index';
3030import { IgxInputGroupModule , IgxInputGroupComponent } from '../input-group/input-group.component' ;
3131import { IgxComboItemComponent } from './combo-item.component' ;
3232import { IgxComboDropDownComponent } from './combo-dropdown.component' ;
33- import { IgxComboFilteringPipe , IgxComboGroupingPipe , IgxComboSortingPipe } from './combo.pipes' ;
33+ import { IgxComboFilteringPipe , IgxComboGroupingPipe } from './combo.pipes' ;
3434import { OverlaySettings , AbsoluteScrollStrategy } from '../services' ;
3535import { Subject } from 'rxjs' ;
3636import { takeUntil } from 'rxjs/operators' ;
37- import { DefaultSortingStrategy , ISortingStrategy } from '../data-operations/sorting-strategy' ;
3837import { DisplayDensityBase , DisplayDensityToken , IDisplayDensityOptions } from '../core/density' ;
3938import { IGX_COMBO_COMPONENT , IgxComboBase } from './combo.common' ;
4039import { IgxComboAddItemComponent } from './combo-add-item.component' ;
4140import { IgxComboAPIService } from './combo.api' ;
4241import { EditorProvider } from '../core/edit-provider' ;
43- import { take } from 'rxjs/operators' ;
4442import { IgxInputState , IgxInputDirective } from '../directives/input/input.directive' ;
4543
4644/**
@@ -142,9 +140,6 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
142140 public defaultFallbackGroup = 'Other' ;
143141 protected stringFilters = IgxStringFilteringOperand ;
144142 protected booleanFilters = IgxBooleanFilteringOperand ;
145- protected _filteringLogic = FilteringLogic . Or ;
146- protected _filteringExpressions : IFilteringExpression [ ] = [ ] ;
147- protected _sortingExpressions : ISortingExpression [ ] = [ ] ;
148143 protected _groupKey = '' ;
149144 protected _displayKey : string ;
150145 protected _prevInputValue = '' ;
@@ -763,9 +758,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
763758 */
764759 @Input ( )
765760 public set groupKey ( val : string ) {
766- this . clearSorting ( this . _groupKey ) ;
767761 this . _groupKey = val ;
768- this . sort ( this . _groupKey ) ;
769762 }
770763
771764 /**
@@ -783,7 +776,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
783776 /**
784777 * An @Input property that enabled/disables filtering in the list. The default is `true`.
785778 * ```html
786- *<igx-combo [filterable]="' false' ">
779+ *<igx-combo [filterable]="false">
787780 * ```
788781 */
789782 @Input ( )
@@ -912,50 +905,6 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
912905 */
913906 set totalItemCount ( count : number ) {
914907 this . virtDir . totalItemCount = count ;
915- this . cdr . detectChanges ( ) ;
916- }
917-
918- /**
919- * @hidden @internal
920- */
921- public get filteringExpressions ( ) : IFilteringExpression [ ] {
922- return this . filterable ? this . _filteringExpressions : [ ] ;
923- }
924-
925- /**
926- * @hidden @internal
927- */
928- public set filteringExpressions ( value : IFilteringExpression [ ] ) {
929- this . _filteringExpressions = value ;
930- this . cdr . markForCheck ( ) ;
931- }
932-
933- /**
934- * @hidden @internal
935- */
936- public get sortingExpressions ( ) : ISortingExpression [ ] {
937- return this . _sortingExpressions ;
938- }
939-
940- /**
941- * @hidden @internal
942- */
943- public set sortingExpressions ( value : ISortingExpression [ ] ) {
944- this . _sortingExpressions = value ;
945- this . cdr . markForCheck ( ) ;
946- }
947-
948- protected clearSorting ( field ?: string | number ) {
949- if ( field === undefined || field === null ) {
950- this . sortingExpressions = [ ] ;
951- return ;
952- }
953- const currentState = cloneArray ( this . sortingExpressions ) ;
954- const index = currentState . findIndex ( ( expr ) => expr . fieldName === field ) ;
955- if ( index > - 1 ) {
956- currentState . splice ( index , 1 ) ;
957- this . sortingExpressions = currentState ;
958- }
959908 }
960909
961910 /**
@@ -1022,41 +971,10 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
1022971 * @hidden @internal
1023972 */
1024973 public handleInputChange ( event ?: string ) {
1025- this . onSearchInput . emit ( event ) ;
1026- if ( this . filterable ) {
1027- this . checkMatch ( ) ;
1028- }
1029- }
1030-
1031- /**
1032- * @hidden @internal
1033- */
1034- public sort ( fieldName : string , dir : SortingDirection = SortingDirection . Asc , ignoreCase : boolean = true ,
1035- strategy : ISortingStrategy = DefaultSortingStrategy . instance ( ) ) : void {
1036- if ( ! fieldName ) {
1037- return ;
1038- }
1039- const sortingState = cloneArray ( this . sortingExpressions , true ) ;
1040-
1041- this . prepare_sorting_expression ( sortingState , fieldName , dir , ignoreCase , strategy ) ;
1042- this . sortingExpressions = sortingState ;
1043- }
1044-
1045- protected prepare_sorting_expression ( state : ISortingExpression [ ] , fieldName : string , dir : SortingDirection , ignoreCase : boolean ,
1046- strategy : ISortingStrategy ) {
1047-
1048- if ( dir === SortingDirection . None ) {
1049- state . splice ( state . findIndex ( ( expr ) => expr . fieldName === fieldName ) , 1 ) ;
1050- return ;
1051- }
1052-
1053- const expression = state . find ( ( expr ) => expr . fieldName === fieldName ) ;
1054-
1055- if ( ! expression ) {
1056- state . push ( { fieldName, dir, ignoreCase, strategy } ) ;
1057- } else {
1058- Object . assign ( expression , { fieldName, dir, ignoreCase } ) ;
974+ if ( event !== undefined ) {
975+ this . onSearchInput . emit ( event ) ;
1059976 }
977+ this . checkMatch ( ) ;
1060978 }
1061979
1062980 /**
@@ -1235,6 +1153,9 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
12351153 this . manageRequiredAsterisk ( ) ;
12361154 this . cdr . detectChanges ( ) ;
12371155 }
1156+ this . virtDir . onChunkPreload . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( e ) => {
1157+ this . onDataPreLoad . emit ( e ) ;
1158+ } ) ;
12381159 }
12391160
12401161 /**
@@ -1247,13 +1168,6 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
12471168 this . selection . clear ( this . id ) ;
12481169 }
12491170
1250- /**
1251- * @hidden @internal
1252- */
1253- public dataLoading ( event ) {
1254- this . onDataPreLoad . emit ( event ) ;
1255- }
1256-
12571171 /**
12581172 * @hidden @internal
12591173 */
@@ -1556,7 +1470,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
15561470 */
15571471@NgModule ( {
15581472 declarations : [ IgxComboComponent , IgxComboItemComponent , IgxComboGroupingPipe ,
1559- IgxComboFilteringPipe , IgxComboSortingPipe , IgxComboDropDownComponent , IgxComboAddItemComponent ,
1473+ IgxComboFilteringPipe , IgxComboDropDownComponent , IgxComboAddItemComponent ,
15601474 IgxComboItemDirective ,
15611475 IgxComboEmptyDirective ,
15621476 IgxComboHeaderItemDirective ,
0 commit comments