File tree 4 files changed +67
-15
lines changed
projects/igniteui-angular/src/lib
4 files changed +67
-15
lines changed Original file line number Diff line number Diff line change 3
3
</ div >
4
4
< div #tablist class ="{{itemStyle}}__menu {{itemStyle}}__menu--bottom " role ="tablist " aria-orientation ="horizontal ">
5
5
< ng-container *ngIf ="!hasContentTabs ">
6
- < igx-tab *ngFor ="let panel of panels " [id] ="'igx-tab-' + panel.index " [attr.aria-label] ="panel.label " [attr.aria-disabled] ="panel.disabled "
7
- [attr.aria-selected] ="panel.isSelected " [attr.aria-controls] ="'igx-tab-panel-'+ panel.index " [ngClass] ="{
8
- 'igx-bottom-nav__menu-item': !panel.isSelected && !panel.disabled,
9
- 'igx-bottom-nav__menu-item--selected': panel.isSelected,
10
- 'igx-bottom-nav__menu-item--disabled': panel.disabled
11
- } " [relatedPanel] ="panel " (click) ="panel.select() " role ="tab ">
6
+ < igx-tab *ngFor ="let panel of panels " [relatedPanel] ="panel " (click) ="panel.select() ">
12
7
</ igx-tab >
13
8
</ ng-container >
14
9
< ng-content select ="igx-tab "> </ ng-content >
Original file line number Diff line number Diff line change @@ -462,6 +462,36 @@ export class IgxTabComponent {
462
462
@HostBinding ( 'attr.role' )
463
463
public role = 'tab' ;
464
464
465
+ /**
466
+ * @hidden @internal
467
+ */
468
+ @HostBinding ( 'attr.id' )
469
+ public id = 'igx-tab-' + this . index ;
470
+
471
+ /**
472
+ * @hidden @internal
473
+ */
474
+ @HostBinding ( 'attr.aria-label' )
475
+ public ariaLabel = this . label ;
476
+
477
+ /**
478
+ * @hidden @internal
479
+ */
480
+ @HostBinding ( 'attr.aria-disabled' )
481
+ public ariaDisabled = this . disabled ;
482
+
483
+ /**
484
+ * @hidden @internal
485
+ */
486
+ @HostBinding ( 'attr.aria-selected' )
487
+ public ariaSelected = this . isSelected ;
488
+
489
+ /**
490
+ * @hidden @internal
491
+ */
492
+ @HostBinding ( 'attr.aria-controls' )
493
+ public ariaControls = 'igx-tab-panel-' + this . index ;
494
+
465
495
/**
466
496
* Gets the panel associated with the tab.
467
497
* ```typescript
Original file line number Diff line number Diff line change @@ -103,17 +103,47 @@ export class IgxTabItemComponent implements IgxTabItemBase {
103
103
}
104
104
105
105
/**
106
- * @hidden
106
+ * @hidden @internal
107
107
*/
108
108
@HostBinding ( 'attr.role' )
109
109
public role = 'tab' ;
110
110
111
111
/**
112
- * @hidden
112
+ * @hidden @internal
113
113
*/
114
114
@HostBinding ( 'attr.tabindex' )
115
115
public tabindex ;
116
116
117
+ /**
118
+ * @hidden @internal
119
+ */
120
+ @HostBinding ( 'attr.id' )
121
+ public id = 'igx-tab-item-' + this . index ;
122
+
123
+ /**
124
+ * @hidden @internal
125
+ */
126
+ @HostBinding ( 'attr.aria-label' )
127
+ public ariaLabel = this . label ;
128
+
129
+ /**
130
+ * @hidden @internal
131
+ */
132
+ @HostBinding ( 'attr.aria-disabled' )
133
+ public ariaDisabled = this . disabled ;
134
+
135
+ /**
136
+ * @hidden @internal
137
+ */
138
+ @HostBinding ( 'attr.aria-selected' )
139
+ public ariaSelected = this . isSelected ;
140
+
141
+ /**
142
+ * @hidden @internal
143
+ */
144
+ @HostBinding ( 'attr.aria-controls' )
145
+ public ariaControls = 'igx-tab-item-group-' + this . index ;
146
+
117
147
/**
118
148
* @hidden
119
149
*/
@@ -225,7 +255,9 @@ export class IgxTabItemComponent implements IgxTabItemBase {
225
255
* @hidden
226
256
*/
227
257
get index ( ) : number {
228
- return this . _tabs . tabs . toArray ( ) . indexOf ( this ) ;
258
+ if ( this . _tabs . tabs ) {
259
+ return this . _tabs . tabs . toArray ( ) . indexOf ( this ) ;
260
+ }
229
261
}
230
262
231
263
/**
Original file line number Diff line number Diff line change 7
7
< div class ="igx-tabs__header-wrapper-fixed " #viewPort >
8
8
< div #itemsContainer class ="igx-tabs__header-wrapper-fluid ">
9
9
< ng-container *ngIf ="!hasContentTabs ">
10
- < igx-tab-item igxRipple *ngFor ="let group of groups " [id] ="'igx-tab-item-' + group.index " [attr.aria-label] ="group.label "
11
- [attr.aria-disabled] ="group.disabled " [attr.aria-selected] ="group.isSelected " [attr.aria-controls] ="'igx-tab-item-group-'+ group.index "
12
- [ngClass] ="{
13
- 'igx-tabs__header-menu-item': !group.isSelected && !group.disabled,
14
- 'igx-tabs__header-menu-item--selected': group.isSelected,
15
- 'igx-tabs__header-menu-item--disabled': group.disabled } " [relatedGroup] ="group " role ="tab ">
10
+ < igx-tab-item igxRipple *ngFor ="let group of groups " [relatedGroup] ="group ">
16
11
</ igx-tab-item >
17
12
</ ng-container >
18
13
< ng-content select ="igx-tab-item "> </ ng-content >
You can’t perform that action at this time.
0 commit comments