import {Component} from './component';
+export interface TabsChangeEvent {
+ showing: string;
+}
+
/**
* Tabs
* Uses accessible attributes to drive its functionality.
*/
export class Tabs extends Component {
- protected container: HTMLElement;
- protected tabList: HTMLElement;
- protected tabs: HTMLElement[];
- protected panels: HTMLElement[];
+ protected container!: HTMLElement;
+ protected tabList!: HTMLElement;
+ protected tabs!: HTMLElement[];
+ protected panels!: HTMLElement[];
- protected activeUnder: number;
+ protected activeUnder!: number;
protected active: null|boolean = null;
setup() {
tab.setAttribute('aria-selected', selected ? 'true' : 'false');
}
- this.$emit('change', {showing: sectionId});
+ const data: TabsChangeEvent = {showing: sectionId};
+ this.$emit('change', data);
}
protected updateActiveState(): void {