Skip to content

Commit d1d32dc

Browse files
committed
fixup! build: create angular aria package
1 parent 1f067ec commit d1d32dc

File tree

69 files changed

+653
-648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+653
-648
lines changed

src/aria/accordion/accordion.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ describe('AccordionGroup', () => {
381381
@Component({
382382
template: `
383383
<div
384-
accordionGroup
384+
ngAccordionGroup
385385
[(value)]="value"
386386
[multiExpandable]="multiExpandable()"
387387
[disabled]="disabledGroup()"
@@ -391,15 +391,15 @@ describe('AccordionGroup', () => {
391391
@for (item of items(); track item.value) {
392392
<div class="item-container">
393393
<button
394-
accordionTrigger
394+
ngAccordionTrigger
395395
[value]="item.value"
396396
[disabled]="item.disabled"
397397
>{{ item.header }}</button>
398398
<div
399-
accordionPanel
399+
ngAccordionPanel
400400
[value]="item.value"
401401
>
402-
<ng-template accordionContent>
402+
<ng-template ngAccordionContent>
403403
{{ item.content }}
404404
</ng-template>
405405
</div>

src/aria/accordion/accordion.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ import {
3333
* associated `AccordionTrigger`.
3434
*/
3535
@Directive({
36-
selector: '[accordionPanel]',
37-
exportAs: 'accordionPanel',
36+
selector: '[ngAccordionPanel]',
37+
exportAs: 'ngAccordionPanel',
3838
hostDirectives: [
3939
{
4040
directive: DeferredContentAware,
4141
inputs: ['preserveContent'],
4242
},
4343
],
4444
host: {
45-
'class': 'accordion-panel',
45+
'class': 'ng-accordion-panel',
4646
'role': 'region',
4747
'[attr.id]': 'pattern.id()',
4848
'[attr.aria-labelledby]': 'pattern.accordionTrigger()?.id()',
@@ -83,10 +83,10 @@ export class AccordionPanel {
8383
* state of an associated `AccordionPanel`.
8484
*/
8585
@Directive({
86-
selector: '[accordionTrigger]',
87-
exportAs: 'accordionTrigger',
86+
selector: '[ngAccordionTrigger]',
87+
exportAs: 'ngAccordionTrigger',
8888
host: {
89-
'class': 'accordion-trigger',
89+
'class': 'ng-accordion-trigger',
9090
'[attr.data-active]': 'pattern.active()',
9191
'role': 'button',
9292
'[id]': 'pattern.id()',
@@ -102,7 +102,7 @@ export class AccordionPanel {
102102
})
103103
export class AccordionTrigger {
104104
/** A global unique identifier for the trigger. */
105-
private readonly _id = inject(_IdGenerator).getId('accordion-trigger-');
105+
private readonly _id = inject(_IdGenerator).getId('ng-accordion-trigger-');
106106

107107
/** A reference to the trigger element. */
108108
private readonly _elementRef = inject(ElementRef);
@@ -142,10 +142,10 @@ export class AccordionTrigger {
142142
* interactions of the accordion, such as keyboard navigation and expansion mode.
143143
*/
144144
@Directive({
145-
selector: '[accordionGroup]',
146-
exportAs: 'accordionGroup',
145+
selector: '[ngAccordionGroup]',
146+
exportAs: 'ngAccordionGroup',
147147
host: {
148-
'class': 'accordion-group',
148+
'class': 'ng-accordion-group',
149149
},
150150
})
151151
export class AccordionGroup {
@@ -211,7 +211,7 @@ export class AccordionGroup {
211211
* for a `AccordionPanel`. This content can be lazily loaded.
212212
*/
213213
@Directive({
214-
selector: 'ng-template[accordionContent]',
214+
selector: 'ng-template[ngAccordionContent]',
215215
hostDirectives: [DeferredContent],
216216
})
217217
export class AccordionContent {}

src/aria/combobox/combobox.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,17 +1008,17 @@ describe('Combobox', () => {
10081008
@Component({
10091009
template: `
10101010
<div
1011-
combobox
1012-
#combobox="combobox"
1011+
ngCombobox
1012+
#combobox="ngCombobox"
10131013
[filterMode]="filterMode()"
10141014
>
10151015
<input
1016-
comboboxInput
1016+
ngComboboxInput
10171017
placeholder="Search..."
10181018
[(value)]="searchString"
10191019
/>
10201020
1021-
<ng-template comboboxPopupContainer>
1021+
<ng-template ngComboboxPopupContainer>
10221022
<div listbox [(value)]="value">
10231023
@for (option of options(); track option) {
10241024
<div
@@ -1050,18 +1050,18 @@ class ComboboxListboxExample {
10501050
@Component({
10511051
template: `
10521052
<div
1053-
#combobox="combobox"
1054-
combobox
1053+
ngCombobox
1054+
#combobox="ngCombobox"
10551055
[firstMatch]="firstMatch()"
10561056
[filterMode]="filterMode()"
10571057
>
10581058
<input
1059-
comboboxInput
1059+
ngComboboxInput
10601060
placeholder="Search..."
10611061
[(value)]="searchString"
10621062
/>
10631063
1064-
<ng-template comboboxPopupContainer>
1064+
<ng-template ngComboboxPopupContainer>
10651065
<ul tree #tree="tree" [(value)]="value">
10661066
<ng-template
10671067
[ngTemplateOutlet]="treeNodes"

src/aria/combobox/combobox.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import {
2626
} from '@angular/aria/ui-patterns';
2727

2828
@Directive({
29-
selector: '[combobox]',
30-
exportAs: 'combobox',
29+
selector: '[ngCombobox]',
30+
exportAs: 'ngCombobox',
3131
hostDirectives: [
3232
{
3333
directive: DeferredContentAware,
@@ -90,8 +90,8 @@ export class Combobox<V> {
9090
}
9191

9292
@Directive({
93-
selector: 'input[comboboxInput]',
94-
exportAs: 'comboboxInput',
93+
selector: 'input[ngComboboxInput]',
94+
exportAs: 'ngComboboxInput',
9595
host: {
9696
'role': 'combobox',
9797
'[value]': 'value()',
@@ -127,15 +127,15 @@ export class ComboboxInput {
127127
}
128128

129129
@Directive({
130-
selector: 'ng-template[comboboxPopupContainer]',
131-
exportAs: 'comboboxPopupContainer',
130+
selector: 'ng-template[ngComboboxPopupContainer]',
131+
exportAs: 'ngComboboxPopupContainer',
132132
hostDirectives: [DeferredContent],
133133
})
134134
export class ComboboxPopupContainer {}
135135

136136
@Directive({
137-
selector: '[comboboxPopup]',
138-
exportAs: 'comboboxPopup',
137+
selector: '[ngComboboxPopup]',
138+
exportAs: 'ngComboboxPopup',
139139
})
140140
export class ComboboxPopup<V> {
141141
/** The combobox that the popup belongs to. */

src/aria/listbox/listbox.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ interface TestOption {
742742
@Component({
743743
template: `
744744
<ul
745-
listbox
745+
ngListbox
746746
aria-label="Test Listbox"
747747
[(value)]="value"
748748
[disabled]="disabled"
@@ -755,7 +755,7 @@ interface TestOption {
755755
[selectionMode]="selectionMode"
756756
[typeaheadDelay]="typeaheadDelay">
757757
@for (option of options(); track option.value) {
758-
<li option [value]="option.value" [disabled]="option.disabled" [label]="option.label">{{ option.label }}</li>
758+
<li ngOption [value]="option.value" [disabled]="option.disabled" [label]="option.label">{{ option.label }}</li>
759759
}
760760
</ul>
761761
`,
@@ -784,10 +784,10 @@ class ListboxExample {
784784

785785
@Component({
786786
template: `
787-
<ul aria-label="Test Listbox" listbox>
788-
<li option [value]="0">0</li>
789-
<li option [value]="1">1</li>
790-
<li option [value]="2">2</li>
787+
<ul aria-label="Test Listbox" ngListbox>
788+
<li ngOption [value]="0">0</li>
789+
<li ngOption [value]="1">1</li>
790+
<li ngOption [value]="2">2</li>
791791
</ul>
792792
`,
793793
imports: [Listbox, Option],

src/aria/listbox/listbox.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ import {ComboboxPopup} from '../combobox';
3232
* to be used in conjunction with Option as follows:
3333
*
3434
* ```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>
3939
* </ul>
4040
* ```
4141
*/
4242
@Directive({
43-
selector: '[listbox]',
44-
exportAs: 'listbox',
43+
selector: '[ngListbox]',
44+
exportAs: 'ngListbox',
4545
host: {
4646
'role': 'listbox',
47-
'class': 'listbox',
47+
'class': 'ng-listbox',
4848
'[attr.id]': 'id()',
4949
'[attr.tabindex]': 'pattern.tabindex()',
5050
'[attr.aria-readonly]': 'pattern.readonly()',
@@ -60,7 +60,7 @@ import {ComboboxPopup} from '../combobox';
6060
})
6161
export class Listbox<V> {
6262
/** A unique identifier for the listbox. */
63-
private readonly _generatedId = inject(_IdGenerator).getId('listbox-');
63+
private readonly _generatedId = inject(_IdGenerator).getId('ng-listbox-');
6464

6565
// TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.
6666
/** A unique identifier for the listbox. */
@@ -78,15 +78,15 @@ export class Listbox<V> {
7878
private readonly _directionality = inject(Directionality);
7979

8080
/** The Options nested inside of the Listbox. */
81-
private readonly _Options = contentChildren(Option, {descendants: true});
81+
private readonly _options = contentChildren(Option, {descendants: true});
8282

8383
/** A signal wrapper for directionality. */
8484
protected textDirection = toSignal(this._directionality.change, {
8585
initialValue: this._directionality.value,
8686
});
8787

8888
/** 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));
9090

9191
/** Whether the list is vertically or horizontally oriented. */
9292
orientation = input<'vertical' | 'horizontal'>('vertical');
@@ -187,11 +187,11 @@ export class Listbox<V> {
187187

188188
/** A selectable option in a Listbox. */
189189
@Directive({
190-
selector: '[option]',
191-
exportAs: 'option',
190+
selector: '[ngOption]',
191+
exportAs: 'ngOption',
192192
host: {
193193
'role': 'option',
194-
'class': 'option',
194+
'class': 'ng-option',
195195
'[attr.data-active]': 'pattern.active()',
196196
'[attr.id]': 'pattern.id()',
197197
'[attr.tabindex]': 'pattern.tabindex()',
@@ -204,10 +204,10 @@ export class Option<V> {
204204
private readonly _elementRef = inject(ElementRef);
205205

206206
/** The parent Listbox. */
207-
private readonly _Listbox = inject(Listbox);
207+
private readonly _listbox = inject(Listbox);
208208

209209
/** A unique identifier for the option. */
210-
private readonly _generatedId = inject(_IdGenerator).getId('option-');
210+
private readonly _generatedId = inject(_IdGenerator).getId('ng-option-');
211211

212212
// TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.
213213
/** A unique identifier for the option. */
@@ -219,7 +219,7 @@ export class Option<V> {
219219
protected searchTerm = computed(() => this.label() ?? this.element().textContent);
220220

221221
/** The parent Listbox UIPattern. */
222-
protected listbox = computed(() => this._Listbox.pattern);
222+
protected listbox = computed(() => this._listbox.pattern);
223223

224224
/** A reference to the option element to be focused on navigation. */
225225
protected element = computed(() => this._elementRef.nativeElement);

src/aria/radio-group/radio-group.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,9 @@ interface TestOption {
532532
[focusMode]="focusMode"
533533
[orientation]="orientation"
534534
[skipDisabled]="skipDisabled"
535-
radioGroup>
535+
ngRadioGroup>
536536
@for (option of options(); track option.value) {
537-
<div radioButton [value]="option.value" [disabled]="option.disabled">{{ option.label }}</div>
537+
<div ngRadioButton [value]="option.value" [disabled]="option.disabled">{{ option.label }}</div>
538538
}
539539
</div>
540540
`,
@@ -559,10 +559,10 @@ class RadioGroupExample {
559559

560560
@Component({
561561
template: `
562-
<div radioGroup>
563-
<div radioButton [value]="0">0</div>
564-
<div radioButton [value]="1">1</div>
565-
<div radioButton [value]="2">2</div>
562+
<div ngRadioGroup>
563+
<div ngRadioButton [value]="0">0</div>
564+
<div ngRadioButton [value]="1">1</div>
565+
<div ngRadioButton [value]="2">2</div>
566566
</div>
567567
`,
568568
imports: [RadioGroup, RadioButton],

0 commit comments

Comments
 (0)