Skip to content

Commit 9b0a44b

Browse files
authored
Merge branch 'master' into vslavov/select-nav-closed
2 parents 6c5cb55 + 119cdae commit 9b0a44b

File tree

9 files changed

+106
-186
lines changed

9 files changed

+106
-186
lines changed

projects/igniteui-angular/src/lib/combo/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,15 @@ The service, should inform the combo for the total items that are on the server
5858
If we want to use a two-way data-binding, we could just use `ngModel` like this:
5959

6060
```html
61-
<igx-combo #combo [(ngModel)]="values"></igx-combo>
61+
<igx-combo #combo [data]="data" [(ngModel)]="values"></igx-combo>
6262
```
6363

6464
```typescript
65-
@ViewChild('combo', { read: IgxComboComponent }) public combo: IgxComboComponent;
66-
get values() {
67-
return this.combo.selectedItems();
68-
}
69-
set values(newValues: Array<any>) {
70-
this.combo.selectItems(newValues);
65+
export class MyExampleComponent {
66+
...
67+
public data: ExampleType[] = ...;
68+
...
69+
public values: ExampleType[] = ...;
7170
}
7271
```
7372

projects/igniteui-angular/src/lib/combo/combo-add-item.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { IgxComboItemComponent } from './combo-item.component';
22
import { Component } from '@angular/core';
33

4+
/**
5+
* @hidden
6+
*/
47
@Component({
58
selector: 'igx-combo-add-item',
69
template: '<ng-content></ng-content>',

projects/igniteui-angular/src/lib/combo/combo-dropdown.component.ts

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,10 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
3131
super(elementRef, cdr, selection);
3232
}
3333

34-
/**
35-
* @hidden
36-
*/
3734
protected get scrollContainer() {
3835
return this.verticalScrollContainer.dc.location.nativeElement;
3936
}
4037

41-
/**
42-
* @hidden
43-
*/
4438
protected get isScrolledToLast(): boolean {
4539
const scrollTop = this.verticalScrollContainer.getVerticalScroll().scrollTop;
4640
const scrollHeight = this.verticalScrollContainer.getVerticalScroll().scrollHeight;
@@ -63,13 +57,13 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
6357
public children: QueryList<IgxDropDownItemBase> = null;
6458

6559
/**
66-
* @hidden
60+
* @hidden @internal
6761
*/
6862
@ContentChild(forwardRef(() => IgxForOfDirective), { read: IgxForOfDirective })
6963
public verticalScrollContainer: IgxForOfDirective<any>;
7064

7165
/**
72-
* @hidden
66+
* @hidden @internal
7367
*/
7468
public onFocus() {
7569
this._focusedItem = this._focusedItem || this.items[0];
@@ -79,7 +73,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
7973
}
8074

8175
/**
82-
* @hidden
76+
* @hidden @internal
8377
*/
8478
public onBlur(evt?) {
8579
if (this._focusedItem) {
@@ -89,7 +83,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
8983
}
9084

9185
/**
92-
* @hidden
86+
* @hidden @internal
9387
*/
9488
public onToggleOpened() {
9589
this.onOpened.emit();
@@ -106,7 +100,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
106100
}
107101

108102
/**
109-
* @hidden
103+
* @hidden @internal
110104
*/
111105
public navigateFirst() {
112106
const vContainer = this.verticalScrollContainer;
@@ -123,7 +117,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
123117
}
124118

125119
/**
126-
* @hidden
120+
* @hidden @internal
127121
*/
128122
public navigateLast() {
129123
const vContainer = this.verticalScrollContainer;
@@ -142,9 +136,6 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
142136
});
143137
}
144138

145-
/**
146-
* @hidden
147-
*/
148139
private navigateRemoteItem(direction) {
149140
this.verticalScrollContainer.addScrollTop(direction * this.combo.itemHeight);
150141
this.subscribeNext(this.verticalScrollContainer, () => {
@@ -157,7 +148,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
157148
}
158149

159150
/**
160-
* @hidden
151+
* @hidden @internal
161152
*/
162153
public selectItem(item: IgxDropDownItemBase) {
163154
if (item === null || item === undefined) {
@@ -244,9 +235,6 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
244235
}
245236
}
246237

247-
/**
248-
* @hidden
249-
*/
250238
protected navigate(direction: Navigate, currentIndex?: number) {
251239
let index = -1;
252240
if (this._focusedItem) {
@@ -303,16 +291,10 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
303291

304292
protected scrollToHiddenItem(newItem: any): void { }
305293

306-
/**
307-
* @hidden
308-
*/
309294
protected scrollHandler = () => {
310295
this.comboAPI.disableTransitions = true;
311296
}
312297

313-
/**
314-
* @hidden
315-
*/
316298
protected get sortedChildren(): IgxDropDownItemBase[] {
317299
if (this.children !== undefined) {
318300
return this.children.toArray()
@@ -344,28 +326,25 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
344326
return items;
345327
}
346328

347-
/**
348-
* @hidden
349-
*/
350329
protected scrollToItem() {
351330
}
352331
/**
353-
* @hidden
332+
* @hidden @internal
354333
*/
355334
onToggleClosing(e: CancelableBrowserEventArgs) {
356335
super.onToggleClosing(e);
357336
this._scrollPosition = this.verticalScrollContainer.getVerticalScroll().scrollTop;
358337
}
359338

360339
/**
361-
* @hidden
340+
* @hidden @internal
362341
*/
363342
updateScrollPosition() {
364343
this.verticalScrollContainer.getVerticalScroll().scrollTop = this._scrollPosition;
365344
}
366345

367346
/**
368-
* @hidden
347+
* @hidden @internal
369348
*/
370349
public onItemActionKey(key: DropDownActionKey) {
371350
switch (key) {
@@ -405,7 +384,7 @@ export class IgxComboDropDownComponent extends IgxDropDownComponent implements I
405384
}
406385

407386
/**
408-
*@hidden
387+
*@hidden @internal
409388
*/
410389
public ngOnDestroy(): void {
411390
this.verticalScrollContainer.getVerticalScroll().removeEventListener('scroll', this.scrollHandler);

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -937,15 +937,6 @@ describe('igxCombo', () => {
937937
expect(checkbox.classList.contains(CSS_CLASS_CHECKED)).toBeFalsy();
938938
expect(combo.isItemSelected(combo.data[itemIndex])).toBeFalsy();
939939
}
940-
it('Should properly return the selected value(s)', () => {
941-
const fixture = TestBed.createComponent(IgxComboSampleComponent);
942-
fixture.detectChanges();
943-
const combo = fixture.componentInstance.combo;
944-
expect(combo).toBeDefined();
945-
expect(combo.values).toEqual([]);
946-
combo.valueKey = undefined;
947-
expect(combo.values).toEqual([]);
948-
});
949940
it('Should properly call "writeValue" method', () => {
950941
const fixture = TestBed.createComponent(IgxComboSampleComponent);
951942
fixture.detectChanges();

0 commit comments

Comments
 (0)