1- import { CommonModule , DOCUMENT } from ' @angular/common' ;
1+ import { CommonModule , DOCUMENT } from " @angular/common" ;
22import {
33 Component ,
44 ContentChild ,
@@ -11,33 +11,33 @@ import {
1111 QueryList ,
1212 Inject ,
1313 Optional ,
14- AfterContentInit
15- } from ' @angular/core' ;
16- import { IgxHintDirective } from ' ../directives/hint/hint.directive' ;
14+ AfterContentInit ,
15+ } from " @angular/core" ;
16+ import { IgxHintDirective } from " ../directives/hint/hint.directive" ;
1717import {
1818 IgxInputDirective ,
1919 IgxInputState ,
20- } from ' ../directives/input/input.directive' ;
21- import { IgxLabelDirective } from ' ../directives/label/label.directive' ;
22- import { IgxPrefixModule } from ' ../directives/prefix/prefix.directive' ;
23- import { IgxSuffixModule } from ' ../directives/suffix/suffix.directive' ;
20+ } from " ../directives/input/input.directive" ;
21+ import { IgxLabelDirective } from " ../directives/label/label.directive" ;
22+ import { IgxPrefixModule } from " ../directives/prefix/prefix.directive" ;
23+ import { IgxSuffixModule } from " ../directives/suffix/suffix.directive" ;
2424import {
2525 DisplayDensity ,
2626 IDisplayDensityOptions ,
2727 DisplayDensityToken ,
2828 DisplayDensityBase ,
29- } from ' ../core/displayDensity' ;
30- import { IgxInputGroupBase } from ' ./input-group.common' ;
31- import { DeprecateProperty } from ' ../core/deprecateDecorators' ;
32- import { IgxInputGroupType , IGX_INPUT_GROUP_TYPE } from ' ./inputGroupType' ;
29+ } from " ../core/displayDensity" ;
30+ import { IgxInputGroupBase } from " ./input-group.common" ;
31+ import { DeprecateProperty } from " ../core/deprecateDecorators" ;
32+ import { IgxInputGroupType , IGX_INPUT_GROUP_TYPE } from " ./inputGroupType" ;
3333
3434let NEXT_ID = 0 ;
3535
3636enum IgxInputGroupThemeEnum {
37- ' material' ,
38- ' fluent' ,
39- ' bootstrap' ,
40- ' indigo-design' ,
37+ " material" ,
38+ " fluent" ,
39+ " bootstrap" ,
40+ " indigo-design" ,
4141}
4242
4343/**
@@ -46,25 +46,26 @@ enum IgxInputGroupThemeEnum {
4646export type IgxInputGroupTheme = keyof typeof IgxInputGroupThemeEnum ;
4747
4848@Component ( {
49- selector : ' igx-input-group' ,
50- templateUrl : ' input-group.component.html' ,
49+ selector : " igx-input-group" ,
50+ templateUrl : " input-group.component.html" ,
5151 providers : [
52- { provide : IgxInputGroupBase , useExisting : IgxInputGroupComponent }
52+ { provide : IgxInputGroupBase , useExisting : IgxInputGroupComponent } ,
5353 ] ,
5454} )
55- export class IgxInputGroupComponent extends DisplayDensityBase
55+ export class IgxInputGroupComponent
56+ extends DisplayDensityBase
5657 implements IgxInputGroupBase , AfterContentInit {
5758 private _type : IgxInputGroupType = null ;
5859 private _filled = false ;
59- private _variant : IgxInputGroupTheme = ' material' ;
60+ private _variant : IgxInputGroupTheme = " material" ;
6061
6162 /**
6263 * An @Input property that sets the value of `id` attribute. If not provided it will be automatically generated.
6364 * ```html
6465 * <igx-input-group [id]="'igx-input-group-55'"></igx-input-group>
6566 * ```
6667 */
67- @HostBinding ( ' attr.id' )
68+ @HostBinding ( " attr.id" )
6869 @Input ( )
6970 public id = `igx-input-group-${ NEXT_ID ++ } ` ;
7071
@@ -79,19 +80,19 @@ export class IgxInputGroupComponent extends DisplayDensityBase
7980 * ```
8081 * }
8182 */
82- @HostBinding ( ' class.igx-input-group' )
83+ @HostBinding ( " class.igx-input-group" )
8384 public defaultClass = true ;
8485
8586 /** @hidden */
86- @HostBinding ( ' class.igx-input-group--placeholder' )
87+ @HostBinding ( " class.igx-input-group--placeholder" )
8788 public hasPlaceholder = false ;
8889
8990 /** @hidden */
90- @HostBinding ( ' class.igx-input-group--required' )
91+ @HostBinding ( " class.igx-input-group--required" )
9192 public isRequired = false ;
9293
9394 /** @hidden */
94- @HostBinding ( ' class.igx-input-group--focused' )
95+ @HostBinding ( " class.igx-input-group--focused" )
9596 public isFocused = false ;
9697
9798 /**
@@ -100,7 +101,7 @@ export class IgxInputGroupComponent extends DisplayDensityBase
100101 * <igx-input-group [disabled]="'true'"></igx-input-group>
101102 * ```
102103 */
103- @HostBinding ( ' class.igx-input-group--disabled' )
104+ @HostBinding ( " class.igx-input-group--disabled" )
104105 @Input ( )
105106 public disabled = false ;
106107
@@ -117,41 +118,41 @@ export class IgxInputGroupComponent extends DisplayDensityBase
117118 public suppressInputAutofocus = false ;
118119
119120 /** @hidden */
120- @HostBinding ( ' class.igx-input-group--valid' )
121+ @HostBinding ( " class.igx-input-group--valid" )
121122 public get validClass ( ) : boolean {
122123 return this . input . valid === IgxInputState . VALID ;
123124 }
124125
125126 /** @hidden */
126- @HostBinding ( ' class.igx-input-group--invalid' )
127+ @HostBinding ( " class.igx-input-group--invalid" )
127128 public get invalidClass ( ) : boolean {
128129 return this . input . valid === IgxInputState . INVALID ;
129130 }
130131
131132 /** @hidden */
132- @HostBinding ( ' class.igx-input-group--warning' )
133+ @HostBinding ( " class.igx-input-group--warning" )
133134 public hasWarning = false ;
134135
135136 /** @hidden */
136- @HostBinding ( ' class.igx-input-group--filled' )
137+ @HostBinding ( " class.igx-input-group--filled" )
137138 public get isFilled ( ) {
138139 return this . _filled || ( this . input && this . input . value ) ;
139140 }
140141
141142 /** @hidden */
142- @HostBinding ( ' class.igx-input-group--cosy' )
143+ @HostBinding ( " class.igx-input-group--cosy" )
143144 public get isDisplayDensityCosy ( ) {
144145 return this . displayDensity === DisplayDensity . cosy ;
145146 }
146147
147148 /** @hidden */
148- @HostBinding ( ' class.igx-input-group--comfortable' )
149+ @HostBinding ( " class.igx-input-group--comfortable" )
149150 public get isDisplayDensityComfortable ( ) {
150151 return this . displayDensity === DisplayDensity . comfortable ;
151152 }
152153
153154 /** @hidden */
154- @HostBinding ( ' class.igx-input-group--compact' )
155+ @HostBinding ( " class.igx-input-group--compact" )
155156 public get isDisplayDensityCompact ( ) {
156157 return this . displayDensity === DisplayDensity . compact ;
157158 }
@@ -165,7 +166,7 @@ export class IgxInputGroupComponent extends DisplayDensityBase
165166 protected input : IgxInputDirective ;
166167
167168 /** @hidden */
168- @HostListener ( ' click' , [ ' $event' ] )
169+ @HostListener ( " click" , [ " $event" ] )
169170 public onClick ( event : MouseEvent ) {
170171 if (
171172 ! this . isFocused &&
@@ -177,21 +178,25 @@ export class IgxInputGroupComponent extends DisplayDensityBase
177178 }
178179
179180 /** @hidden */
180- @HostListener ( ' pointerdown' , [ ' $event' ] )
181+ @HostListener ( " pointerdown" , [ " $event" ] )
181182 public onPointerDown ( event : PointerEvent ) {
182183 if ( this . isFocused && event . target !== this . input . nativeElement ) {
183184 event . preventDefault ( ) ;
184185 }
185186 }
186187
188+ onEvent ( event ) {
189+ event . stopPropagation ( ) ;
190+ }
191+
187192 /**
188193 * An @Input property that sets how the input will be styled.
189194 * Allowed values of type IgxInputGroupType.
190195 * ```html
191196 * <igx-input-group [type]="'search'">
192197 * ```
193198 */
194- @Input ( ' type' )
199+ @Input ( " type" )
195200 public set type ( value : IgxInputGroupType ) {
196201 this . _type = value ;
197202 }
@@ -208,7 +213,7 @@ export class IgxInputGroupComponent extends DisplayDensityBase
208213 * ```
209214 */
210215 public get type ( ) {
211- return this . _type || this . _inputGroupType || ' line' ;
216+ return this . _type || this . _inputGroupType || " line" ;
212217 }
213218
214219 /** @hidden @internal */
@@ -251,7 +256,7 @@ export class IgxInputGroupComponent extends DisplayDensityBase
251256 ngAfterContentInit ( ) {
252257 const variant = this . document . defaultView
253258 . getComputedStyle ( this . element . nativeElement )
254- . getPropertyValue ( ' --igx-input-group-variant' )
259+ . getPropertyValue ( " --igx-input-group-variant" )
255260 . trim ( ) ;
256261 this . _variant = variant as IgxInputGroupTheme ;
257262 }
@@ -281,8 +286,8 @@ export class IgxInputGroupComponent extends DisplayDensityBase
281286 */
282287 public get hasBorder ( ) {
283288 return (
284- ( this . type === ' line' || this . type === ' box' ) &&
285- this . _variant === ' material'
289+ ( this . type === " line" || this . type === " box" ) &&
290+ this . _variant === " material"
286291 ) ;
287292 }
288293
@@ -297,7 +302,7 @@ export class IgxInputGroupComponent extends DisplayDensityBase
297302 * ```
298303 */
299304 public get isTypeLine ( ) : boolean {
300- return this . type === ' line' && this . _variant === ' material' ;
305+ return this . type === " line" && this . _variant === " material" ;
301306 }
302307
303308 /**
@@ -310,9 +315,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
310315 * }
311316 * ```
312317 */
313- @HostBinding ( ' class.igx-input-group--box' )
318+ @HostBinding ( " class.igx-input-group--box" )
314319 public get isTypeBox ( ) {
315- return this . type === ' box' && this . _variant === ' material' ;
320+ return this . type === " box" && this . _variant === " material" ;
316321 }
317322
318323 /**
@@ -325,9 +330,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
325330 * }
326331 * ```
327332 */
328- @HostBinding ( ' class.igx-input-group--border' )
333+ @HostBinding ( " class.igx-input-group--border" )
329334 public get isTypeBorder ( ) {
330- return this . type === ' border' && this . _variant === ' material' ;
335+ return this . type === " border" && this . _variant === " material" ;
331336 }
332337
333338 /**
@@ -340,9 +345,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
340345 * }
341346 * ```
342347 */
343- @HostBinding ( ' class.igx-input-group--fluent' )
348+ @HostBinding ( " class.igx-input-group--fluent" )
344349 public get isTypeFluent ( ) {
345- return this . _variant === ' fluent' ;
350+ return this . _variant === " fluent" ;
346351 }
347352
348353 /**
@@ -355,9 +360,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
355360 * }
356361 * ```
357362 */
358- @HostBinding ( ' class.igx-input-group--bootstrap' )
363+ @HostBinding ( " class.igx-input-group--bootstrap" )
359364 public get isTypeBootstrap ( ) {
360- return this . _variant === ' bootstrap' ;
365+ return this . _variant === " bootstrap" ;
361366 }
362367
363368 /**
@@ -370,9 +375,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
370375 * }
371376 * ```
372377 */
373- @HostBinding ( ' class.igx-input-group--indigo' )
378+ @HostBinding ( " class.igx-input-group--indigo" )
374379 public get isTypeIndigo ( ) {
375- return this . _variant === ' indigo-design' ;
380+ return this . _variant === " indigo-design" ;
376381 }
377382
378383 /**
@@ -385,9 +390,9 @@ export class IgxInputGroupComponent extends DisplayDensityBase
385390 * }
386391 * ```
387392 */
388- @HostBinding ( ' class.igx-input-group--search' )
393+ @HostBinding ( " class.igx-input-group--search" )
389394 public get isTypeSearch ( ) {
390- return this . type === ' search' ;
395+ return this . type === " search" ;
391396 }
392397
393398 /** @hidden */
0 commit comments