@@ -32,19 +32,19 @@ import {ComboboxPopup} from '../combobox';
32
32
* to be used in conjunction with Option as follows:
33
33
*
34
34
* ```html
35
- * <ul listbox >
36
- * <li [value]="1" option >Item 1</li>
37
- * <li [value]="2" option >Item 2</li>
38
- * <li [value]="3" option >Item 3</li>
35
+ * <ul ngListbox >
36
+ * <li [value]="1" ngOption >Item 1</li>
37
+ * <li [value]="2" ngOption >Item 2</li>
38
+ * <li [value]="3" ngOption >Item 3</li>
39
39
* </ul>
40
40
* ```
41
41
*/
42
42
@Directive ( {
43
- selector : '[listbox ]' ,
44
- exportAs : 'listbox ' ,
43
+ selector : '[ngListbox ]' ,
44
+ exportAs : 'ngListbox ' ,
45
45
host : {
46
46
'role' : 'listbox' ,
47
- 'class' : 'listbox' ,
47
+ 'class' : 'ng- listbox' ,
48
48
'[attr.id]' : 'id()' ,
49
49
'[attr.tabindex]' : 'pattern.tabindex()' ,
50
50
'[attr.aria-readonly]' : 'pattern.readonly()' ,
@@ -60,7 +60,7 @@ import {ComboboxPopup} from '../combobox';
60
60
} )
61
61
export class Listbox < V > {
62
62
/** A unique identifier for the listbox. */
63
- private readonly _generatedId = inject ( _IdGenerator ) . getId ( 'listbox-' ) ;
63
+ private readonly _generatedId = inject ( _IdGenerator ) . getId ( 'ng- listbox-' ) ;
64
64
65
65
// TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.
66
66
/** A unique identifier for the listbox. */
@@ -78,15 +78,15 @@ export class Listbox<V> {
78
78
private readonly _directionality = inject ( Directionality ) ;
79
79
80
80
/** The Options nested inside of the Listbox. */
81
- private readonly _Options = contentChildren ( Option , { descendants : true } ) ;
81
+ private readonly _options = contentChildren ( Option , { descendants : true } ) ;
82
82
83
83
/** A signal wrapper for directionality. */
84
84
protected textDirection = toSignal ( this . _directionality . change , {
85
85
initialValue : this . _directionality . value ,
86
86
} ) ;
87
87
88
88
/** The Option UIPatterns of the child Options. */
89
- protected items = computed ( ( ) => this . _Options ( ) . map ( option => option . pattern ) ) ;
89
+ protected items = computed ( ( ) => this . _options ( ) . map ( option => option . pattern ) ) ;
90
90
91
91
/** Whether the list is vertically or horizontally oriented. */
92
92
orientation = input < 'vertical' | 'horizontal' > ( 'vertical' ) ;
@@ -187,11 +187,11 @@ export class Listbox<V> {
187
187
188
188
/** A selectable option in a Listbox. */
189
189
@Directive ( {
190
- selector : '[option ]' ,
191
- exportAs : 'option ' ,
190
+ selector : '[ngOption ]' ,
191
+ exportAs : 'ngOption ' ,
192
192
host : {
193
193
'role' : 'option' ,
194
- 'class' : 'option' ,
194
+ 'class' : 'ng- option' ,
195
195
'[attr.data-active]' : 'pattern.active()' ,
196
196
'[attr.id]' : 'pattern.id()' ,
197
197
'[attr.tabindex]' : 'pattern.tabindex()' ,
@@ -204,10 +204,10 @@ export class Option<V> {
204
204
private readonly _elementRef = inject ( ElementRef ) ;
205
205
206
206
/** The parent Listbox. */
207
- private readonly _Listbox = inject ( Listbox ) ;
207
+ private readonly _listbox = inject ( Listbox ) ;
208
208
209
209
/** A unique identifier for the option. */
210
- private readonly _generatedId = inject ( _IdGenerator ) . getId ( 'option-' ) ;
210
+ private readonly _generatedId = inject ( _IdGenerator ) . getId ( 'ng- option-' ) ;
211
211
212
212
// TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.
213
213
/** A unique identifier for the option. */
@@ -219,7 +219,7 @@ export class Option<V> {
219
219
protected searchTerm = computed ( ( ) => this . label ( ) ?? this . element ( ) . textContent ) ;
220
220
221
221
/** The parent Listbox UIPattern. */
222
- protected listbox = computed ( ( ) => this . _Listbox . pattern ) ;
222
+ protected listbox = computed ( ( ) => this . _listbox . pattern ) ;
223
223
224
224
/** A reference to the option element to be focused on navigation. */
225
225
protected element = computed ( ( ) => this . _elementRef . nativeElement ) ;
0 commit comments