Skip to content

Commit ca56772

Browse files
committed
fixup! feat(cdk-experimental/ui-patterns): listbox ui pattern
1 parent 6d912d6 commit ca56772

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/cdk-experimental/listbox/listbox.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ export class CdkListbox implements OnDestroy {
5858
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
5959
private _dir = inject(Directionality);
6060

61-
/** A signal wrapper for directionality. */
62-
private directionality = signal<'ltr' | 'rtl'>('ltr');
63-
6461
/** The CdkOptions nested inside of the CdkListbox. */
6562
private _cdkOptions = contentChildren(CdkOption, {descendants: true});
6663

67-
/** The Option UIPatterns of the child CdkOptions. */
68-
private items = computed(() => this._cdkOptions().map(option => option.pattern));
69-
7064
/** Emits when the list has been destroyed. */
7165
private readonly _destroyed = new Subject<void>();
7266

67+
/** A signal wrapper for directionality. */
68+
protected directionality = signal<'ltr' | 'rtl'>('ltr');
69+
70+
/** The Option UIPatterns of the child CdkOptions. */
71+
protected items = computed(() => this._cdkOptions().map(option => option.pattern));
72+
7373
/** Whether the list is vertically or horizontally oriented. */
7474
orientation = input<'vertical' | 'horizontal'>('vertical');
7575

@@ -141,16 +141,16 @@ export class CdkOption {
141141
private _cdkListbox = inject(CdkListbox);
142142

143143
/** A unique identifier for the option. */
144-
private id = computed(() => `${count++}`);
144+
protected id = computed(() => `${count++}`);
145145

146146
/** The text used by the typeahead search. */
147-
private searchTerm = computed(() => this.label() ?? this.element().textContent);
147+
protected searchTerm = computed(() => this.label() ?? this.element().textContent);
148148

149149
/** The parent Listbox UIPattern. */
150-
private listbox = computed(() => this._cdkListbox.pattern);
150+
protected listbox = computed(() => this._cdkListbox.pattern);
151151

152152
/** A reference to the option element to be focused on navigation. */
153-
private element = computed(() => this._elementRef.nativeElement);
153+
protected element = computed(() => this._elementRef.nativeElement);
154154

155155
/** Whether an item is disabled. */
156156
disabled = input(false, {transform: booleanAttribute});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {computed, signal, Signal} from '@angular/core';
9+
import {computed, Signal} from '@angular/core';
1010
import {ListSelectionItem} from '../behaviors/list-selection/list-selection';
1111
import {ListTypeaheadItem} from '../behaviors/list-typeahead/list-typeahead';
1212
import {ListNavigationItem} from '../behaviors/list-navigation/list-navigation';

0 commit comments

Comments
 (0)