@@ -11,14 +11,15 @@ import {
1111import { IgxColumnComponent } from '../../columns/column.component' ;
1212import { ExpressionUI } from '../grid-filtering.service' ;
1313import { IgxButtonGroupComponent } from '../../../buttonGroup/buttonGroup.component' ;
14- import { IgxDropDownItemComponent , IgxDropDownComponent } from '../../../drop-down/public_api' ;
15- import { IgxInputGroupComponent , IgxInputDirective } from '../../../input-group/public_api' ;
1614import { DataType , DataUtil } from '../../../data-operations/data-util' ;
1715import { IFilteringOperation } from '../../../data-operations/filtering-condition' ;
18- import { OverlaySettings , ConnectedPositioningStrategy , CloseScrollStrategy } from '../../../services/public_api' ;
16+ import { OverlaySettings , ConnectedPositioningStrategy , AbsoluteScrollStrategy } from '../../../services/public_api' ;
1917import { KEYS , IBaseEventArgs } from '../../../core/utils' ;
2018import { FilteringLogic } from '../../../data-operations/filtering-expression.interface' ;
2119import { DisplayDensity } from '../../../core/density' ;
20+ import { IgxSelectComponent } from '../../../select/select.component' ;
21+ import { IgxOverlayOutletDirective } from '../../../directives/toggle/toggle.directive' ;
22+ import { IgxInputDirective } from '../../../input-group/public_api' ;
2223
2324/**
2425 * @hidden
@@ -39,11 +40,11 @@ export interface ILogicOperatorChangedArgs extends IBaseEventArgs {
3940} )
4041export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
4142
42- private _dropDownOverlaySettings : OverlaySettings = {
43- closeOnOutsideClick : true ,
43+ public dropDownOverlaySettings : OverlaySettings = {
44+ scrollStrategy : new AbsoluteScrollStrategy ( ) ,
4445 modal : false ,
45- positionStrategy : new ConnectedPositioningStrategy ( ) ,
46- scrollStrategy : new CloseScrollStrategy ( )
46+ closeOnOutsideClick : true ,
47+ excludePositionTarget : true
4748 } ;
4849
4950 @Input ( )
@@ -67,21 +68,17 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
6768 @Output ( )
6869 public onLogicOperatorChanged = new EventEmitter < ILogicOperatorChangedArgs > ( ) ;
6970
70- @ViewChild ( 'inputGroupConditions' , { read : IgxInputGroupComponent , static : true } )
71- protected inputGroupConditions : IgxInputGroupComponent ;
72-
73- @ViewChild ( 'inputValues' , { read : IgxInputDirective , static : true } )
74- protected inputValuesDirective : IgxInputDirective ;
71+ @ViewChild ( 'overlayOutlet' , { read : IgxOverlayOutletDirective , static : true } )
72+ public overlayOutlet : IgxOverlayOutletDirective ;
7573
76- @ViewChild ( 'dropdownConditions' , { read : IgxDropDownComponent , static : true } )
77- protected dropdownConditions : IgxDropDownComponent ;
74+ @ViewChild ( 'dropdownConditions' , { read : IgxSelectComponent , static : true } )
75+ protected dropdownConditions : IgxSelectComponent ;
7876
7977 @ViewChild ( 'logicOperatorButtonGroup' , { read : IgxButtonGroupComponent } )
8078 protected logicOperatorButtonGroup : IgxButtonGroupComponent ;
8179
82- protected get inputValuesElement ( ) {
83- return this . inputValuesDirective ;
84- }
80+ @ViewChild ( 'inputValues' , { read : IgxInputDirective , static : true } )
81+ protected inputValuesDirective : IgxInputDirective ;
8582
8683 get isLast ( ) : boolean {
8784 return this . expressionsList [ this . expressionsList . length - 1 ] === this . expressionUI ;
@@ -91,7 +88,7 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
9188 return this . expressionsList . length === 1 ;
9289 }
9390
94- get inputConditionsPlaceholder ( ) : string {
91+ get conditionsPlaceholder ( ) : string {
9592 return this . grid . resourceStrings [ 'igx_grid_filter_condition_placeholder' ] ;
9693 }
9794
@@ -110,9 +107,19 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
110107
111108 constructor ( public cdr : ChangeDetectorRef ) { }
112109
110+ get conditions ( ) {
111+ return this . column . filters . conditionList ( ) ;
112+ }
113+
114+ protected get inputValuesElement ( ) {
115+ return this . inputValuesDirective ;
116+ }
117+
113118 ngAfterViewInit ( ) : void {
114- this . _dropDownOverlaySettings . outlet = this . column . grid . outletDirective ;
115- this . _dropDownOverlaySettings . positionStrategy . settings . target = this . inputGroupConditions . element . nativeElement ;
119+ this . dropDownOverlaySettings . outlet = this . overlayOutlet ;
120+ this . dropDownOverlaySettings . positionStrategy = new ConnectedPositioningStrategy ( {
121+ target : this . dropdownConditions . inputGroup . element . nativeElement
122+ } ) ;
116123 }
117124
118125 public focus ( ) {
@@ -121,22 +128,6 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
121128 requestAnimationFrame ( ( ) => this . inputValuesElement . focus ( ) ) ;
122129 }
123130
124- public isConditionSelected ( conditionName : string ) : boolean {
125- return this . expressionUI . expression . condition && this . expressionUI . expression . condition . name === conditionName ;
126- }
127-
128- public getConditionName ( condition : IFilteringOperation ) {
129- return condition ? this . translateCondition ( condition . name ) : null ;
130- }
131-
132- public getInputWidth ( ) {
133- return this . inputGroupConditions . element . nativeElement . offsetWidth + 'px' ;
134- }
135-
136- get conditions ( ) {
137- return this . column . filters . conditionList ( ) ;
138- }
139-
140131 public translateCondition ( value : string ) : string {
141132 return this . grid . resourceStrings [ `igx_grid_filter_${ this . getCondition ( value ) . name } ` ] || value ;
142133 }
@@ -151,21 +142,21 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
151142 }
152143 }
153144
154- public toggleCustomDialogDropDown ( ) {
155- this . dropdownConditions . toggle ( this . _dropDownOverlaySettings ) ;
156- }
157-
158- public getCondition ( value : string ) : IFilteringOperation {
159- return this . column . filters . condition ( value ) ;
145+ public isConditionSelected ( conditionName : string ) : boolean {
146+ return this . expressionUI . expression . condition && this . expressionUI . expression . condition . name === conditionName ;
160147 }
161148
162149 public onConditionsChanged ( eventArgs : any ) {
163- const value = ( eventArgs . newSelection as IgxDropDownItemComponent ) . value ;
150+ const value = ( eventArgs . newSelection as IgxSelectComponent ) . value ;
164151 this . expressionUI . expression . condition = this . getCondition ( value ) ;
165152
166153 this . focus ( ) ;
167154 }
168155
156+ public getCondition ( value : string ) : IFilteringOperation {
157+ return this . column . filters . condition ( value ) ;
158+ }
159+
169160 public onValuesInput ( eventArgs ) {
170161 this . expressionUI . expression . searchVal = DataUtil . parseValue ( this . column . dataType , eventArgs . target . value ) ;
171162 }
@@ -196,15 +187,7 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
196187 this . onExpressionRemoved . emit ( this . expressionUI ) ;
197188 }
198189
199- public onInputConditionsKeyDown ( eventArgs ) {
200- if ( eventArgs . altKey && ( eventArgs . key === KEYS . DOWN_ARROW || eventArgs . key === KEYS . DOWN_ARROW_IE ) ) {
201- this . toggleCustomDialogDropDown ( ) ;
202- }
203-
204- if ( eventArgs . key === KEYS . TAB && eventArgs . shiftKey && this . expressionsList [ 0 ] === this . expressionUI ) {
205- eventArgs . preventDefault ( ) ;
206- }
207-
208- eventArgs . stopPropagation ( ) ;
190+ public onOutletPointerDown ( event ) {
191+ event . preventDefault ( ) ;
209192 }
210193}
0 commit comments