Skip to content

Commit 08f623a

Browse files
authored
Merge pull request #446 from cal-smith/issue#46
fix(combobox): tidy up types
2 parents 2f53c91 + 3582c07 commit 08f623a

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/combobox/combobox.component.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
123123
* ];
124124
* ```
125125
*
126-
* @type {Array<ListItem>}
127-
* @memberof ComboBox
128126
*/
129127
@Input() items: Array<ListItem> = [];
130128
/**
@@ -154,7 +152,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
154152
* }
155153
* ```
156154
*/
157-
@Output() selected: EventEmitter<ListItem> = new EventEmitter<ListItem>();
155+
@Output() selected = new EventEmitter<ListItem | ListItem[]>();
158156
/**
159157
* Bubbles from `n-pill-input` when the user types a value and presses enter. Intended to be used to add items to the list.
160158
*
@@ -205,17 +203,13 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
205203

206204
/**
207205
* Creates an instance of ComboBox.
208-
* @param {ElementRef} elementRef
209-
* @memberof ComboBox
210206
*/
211207
constructor(protected elementRef: ElementRef) {}
212208

213209
/**
214210
* Lifecycle hook.
215211
* Updates pills if necessary.
216212
*
217-
* @param {any} changes
218-
* @memberof ComboBox
219213
*/
220214
ngOnChanges(changes) {
221215
if (changes.items) {
@@ -285,7 +279,6 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
285279

286280
/**
287281
* Handles `Escape` key closing the dropdown, and arrow up/down focus to/from the dropdown list.
288-
* @param {KeyboardEvent} ev
289282
*/
290283
@HostListener("keydown", ["$event"])
291284
hostkeys(ev: KeyboardEvent) {
@@ -379,7 +372,6 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
379372

380373
/**
381374
* Sets the list group filter, and manages single select item selection.
382-
* @param {string} searchString
383375
*/
384376
public onSearch(searchString) {
385377
this.view.filterBy(searchString);

src/dropdown/abstract-dropdown-view.class.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ export class AbstractDropdownView {
1616

1717
get items(): Array<ListItem> | Observable<Array<ListItem>> { return; }
1818
/**
19-
* Emits selection events to other class.
19+
* Emits selection events to controlling classes
20+
*
21+
* Deprecated: `Object` as a valid type.
2022
*/
21-
@Output() select: EventEmitter<Object>;
23+
@Output() select: EventEmitter<{item: ListItem } | ListItem[] | Object>;
2224
/**
2325
* Event to suggest a blur on the view.
2426
* Emits _after_ the first/last item has been focused.

0 commit comments

Comments
 (0)