Skip to content

Commit 18125ca

Browse files
committed
fix(cdk-experimental/listbox): fix lint issues
1 parent f5e1f86 commit 18125ca

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

src/cdk-experimental/listbox/listbox.spec.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,7 @@ describe('CdkOption and CdkListbox', () => {
342342
});
343343

344344
it('should not change selection on click of a disabled option', async () => {
345-
const {fixture, testComponent, listbox, listboxEl, options} = await setupComponent(
346-
ListboxWithOptions,
347-
);
345+
const {fixture, testComponent, listbox, listboxEl} = await setupComponent(ListboxWithOptions);
348346
listbox.focus();
349347
fixture.detectChanges();
350348

@@ -751,20 +749,20 @@ class ListboxWithFormControl {
751749
})
752750
class ListboxWithCustomTypeahead {}
753751

754-
@Component({
755-
template: `
756-
<div cdkListbox
757-
[cdkListboxValue]="value">
758-
<div cdkOption="apple">Apple</div>
759-
<div cdkOption="orange">Orange</div>
760-
<div cdkOption="banana">Banana</div>
761-
<div cdkOption="peach">Peach</div>
762-
</div>
763-
`,
764-
})
765-
class ListboxWithBoundValue {
766-
value = ['banana'];
767-
}
752+
// @Component({
753+
// template: `
754+
// <div cdkListbox
755+
// [cdkListboxValue]="value">
756+
// <div cdkOption="apple">Apple</div>
757+
// <div cdkOption="orange">Orange</div>
758+
// <div cdkOption="banana">Banana</div>
759+
// <div cdkOption="peach">Peach</div>
760+
// </div>
761+
// `,
762+
// })
763+
// class ListboxWithBoundValue {
764+
// value = ['banana'];
765+
// }
768766

769767
@Component({
770768
template: `

src/dev-app/cdk-experimental-listbox/cdk-listbox-demo.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,10 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {
10-
AfterViewInit,
11-
ChangeDetectionStrategy,
12-
Component,
13-
ViewChild,
14-
ViewEncapsulation,
15-
} from '@angular/core';
9+
import {ChangeDetectionStrategy, Component} from '@angular/core';
1610
import {CdkListboxModule} from '@angular/cdk-experimental/listbox';
1711
import {CommonModule} from '@angular/common';
18-
import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angular/forms';
12+
import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
1913
import {MatSelectModule} from '@angular/material/select';
2014

2115
function dumbCompare(o1: string, o2: string) {

tools/public_api_guard/cdk/collections.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface SelectionChange<T> {
7171

7272
// @public
7373
export class SelectionModel<T> {
74-
constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean);
74+
constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean, _compareWith?: ((o1: T, o2: T) => boolean) | undefined);
7575
readonly changed: Subject<SelectionChange<T>>;
7676
clear(): void;
7777
deselect(...values: T[]): void;
@@ -81,6 +81,8 @@ export class SelectionModel<T> {
8181
isSelected(value: T): boolean;
8282
select(...values: T[]): void;
8383
get selected(): T[];
84+
// (undocumented)
85+
setSelection(...values: T[]): void;
8486
sort(predicate?: (a: T, b: T) => number): void;
8587
toggle(value: T): void;
8688
}

0 commit comments

Comments
 (0)