Skip to content

Commit 9d6a824

Browse files
committed
fixup! feat(cdk-experimental/ui-patterns): listbox ui pattern
1 parent cc00a24 commit 9d6a824

File tree

1 file changed

+10
-5
lines changed
  • src/cdk-experimental/ui-patterns/listbox

1 file changed

+10
-5
lines changed

src/cdk-experimental/ui-patterns/listbox/option.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
*/
88

99
import {computed, Signal} from '@angular/core';
10-
import {ListSelectionItem} from '../behaviors/list-selection/list-selection';
10+
import {ListSelection, ListSelectionItem} from '../behaviors/list-selection/list-selection';
1111
import {ListTypeaheadItem} from '../behaviors/list-typeahead/list-typeahead';
12-
import {ListNavigationItem} from '../behaviors/list-navigation/list-navigation';
13-
import {ListFocusItem} from '../behaviors/list-focus/list-focus';
14-
import {ListboxPattern} from './listbox';
12+
import {ListNavigation, ListNavigationItem} from '../behaviors/list-navigation/list-navigation';
13+
import {ListFocus, ListFocusItem} from '../behaviors/list-focus/list-focus';
14+
15+
interface ListboxPattern {
16+
focus: ListFocus<OptionPattern>;
17+
selection: ListSelection<OptionPattern>;
18+
navigation: ListNavigation<OptionPattern>;
19+
}
1520

1621
/** The required inputs to options. */
1722
export interface OptionInputs
@@ -36,7 +41,7 @@ export class OptionPattern {
3641
);
3742

3843
/** Whether the option is selected. */
39-
selected = computed(() => this.listbox().inputs.selectedIds().includes(this.id()));
44+
selected = computed(() => this.listbox().selection.inputs.selectedIds().includes(this.id()));
4045

4146
/** Whether the option is disabled. */
4247
disabled: Signal<boolean>;

0 commit comments

Comments
 (0)