@@ -13,7 +13,11 @@ import {
13
13
ViewChild ,
14
14
inject
15
15
} from '@angular/core' ;
16
- import { XAutoCompleteNode , XAutoCompleteProperty , XAutoCompletePrefix } from './auto-complete.property' ;
16
+ import {
17
+ XAutoCompleteNode ,
18
+ XAutoCompleteProperty ,
19
+ XAutoCompletePrefix
20
+ } from './auto-complete.property' ;
17
21
import {
18
22
XIsEmpty ,
19
23
XIsObservable ,
@@ -26,7 +30,7 @@ import {
26
30
XParents
27
31
} from '@ng-nest/ui/core' ;
28
32
import { XPortalService , XPortalOverlayRef , XPortalConnectedPosition } from '@ng-nest/ui/portal' ;
29
- import { XInputModule , XInputComponent } from '@ng-nest/ui/input' ;
33
+ import { XInputComponent } from '@ng-nest/ui/input' ;
30
34
import { XAutoCompletePortalComponent } from './auto-complete-portal.component' ;
31
35
import {
32
36
Overlay ,
@@ -43,7 +47,13 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
43
47
@Component ( {
44
48
selector : `${ XAutoCompletePrefix } ` ,
45
49
standalone : true ,
46
- imports : [ FormsModule , ReactiveFormsModule , XInputModule , XControlValueAccessor , XAutoCompletePortalComponent ] ,
50
+ imports : [
51
+ FormsModule ,
52
+ ReactiveFormsModule ,
53
+ XInputComponent ,
54
+ XControlValueAccessor ,
55
+ XAutoCompletePortalComponent
56
+ ] ,
47
57
templateUrl : './auto-complete.component.html' ,
48
58
styleUrls : [ './auto-complete.component.scss' ] ,
49
59
encapsulation : ViewEncapsulation . None ,
@@ -93,7 +103,13 @@ export class XAutoCompleteComponent extends XAutoCompleteProperty implements OnI
93
103
override cdr = inject ( ChangeDetectorRef ) ;
94
104
95
105
ngOnInit ( ) {
96
- this . setFlex ( this . autoComplete . nativeElement , this . renderer , this . justify , this . align , this . direction ) ;
106
+ this . setFlex (
107
+ this . autoComplete . nativeElement ,
108
+ this . renderer ,
109
+ this . justify ,
110
+ this . align ,
111
+ this . direction
112
+ ) ;
97
113
this . setClassMap ( ) ;
98
114
this . setSubject ( ) ;
99
115
this . setParantScroll ( ) ;
@@ -257,10 +273,12 @@ export class XAutoCompleteComponent extends XAutoCompleteProperty implements OnI
257
273
258
274
setPosition ( config : OverlayConfig ) {
259
275
let position = config . positionStrategy as FlexibleConnectedPositionStrategy ;
260
- position . positionChanges . pipe ( takeUntil ( this . _unSubject ) ) . subscribe ( ( pos : ConnectedOverlayPositionChange ) => {
261
- const place = XPortalConnectedPosition . get ( pos . connectionPair ) as XPositionTopBottom ;
262
- place !== this . placement && this . positionChange . next ( place ) ;
263
- } ) ;
276
+ position . positionChanges
277
+ . pipe ( takeUntil ( this . _unSubject ) )
278
+ . subscribe ( ( pos : ConnectedOverlayPositionChange ) => {
279
+ const place = XPortalConnectedPosition . get ( pos . connectionPair ) as XPositionTopBottom ;
280
+ place !== this . placement && this . positionChange . next ( place ) ;
281
+ } ) ;
264
282
}
265
283
266
284
setInstance ( ) {
@@ -304,7 +322,13 @@ export class XAutoCompleteComponent extends XAutoCompleteProperty implements OnI
304
322
setPlacement ( ) {
305
323
return this . portalService . setPlacement ( {
306
324
elementRef : this . inputCom . inputRef ,
307
- placement : [ this . placement as XPositionTopBottom , 'bottom-start' , 'bottom-end' , 'top-start' , 'top-end' ] ,
325
+ placement : [
326
+ this . placement as XPositionTopBottom ,
327
+ 'bottom-start' ,
328
+ 'bottom-end' ,
329
+ 'top-start' ,
330
+ 'top-end'
331
+ ] ,
308
332
transformOriginOn : 'x-auto-complete-portal'
309
333
} ) ;
310
334
}
@@ -334,13 +358,15 @@ export class XAutoCompleteComponent extends XAutoCompleteProperty implements OnI
334
358
this . icon = 'fto-loader' ;
335
359
this . iconSpin = true ;
336
360
this . cdr . detectChanges ( ) ;
337
- XSetData < XAutoCompleteNode > ( this . data , this . _unSubject , true , value as any ) . subscribe ( ( x ) => {
338
- this . icon = '' ;
339
- this . iconSpin = false ;
340
- this . nodes = x ;
341
- this . dataChange . next ( this . nodes ) ;
342
- this . cdr . detectChanges ( ) ;
343
- } ) ;
361
+ XSetData < XAutoCompleteNode > ( this . data , this . _unSubject , true , value as any ) . subscribe (
362
+ ( x ) => {
363
+ this . icon = '' ;
364
+ this . iconSpin = false ;
365
+ this . nodes = x ;
366
+ this . dataChange . next ( this . nodes ) ;
367
+ this . cdr . detectChanges ( ) ;
368
+ }
369
+ ) ;
344
370
}
345
371
}
346
372
if ( ! this . onlySelect ) {
0 commit comments