mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Comments: Fixed a range of TS errors + other
- Migrated toolbox component to TS - Aligned how custom event types are managed - Fixed PHP use of content_ref where not provided
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import {Component} from './component';
|
||||
|
||||
export interface TabsChangeEvent {
|
||||
showing: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tabs
|
||||
* Uses accessible attributes to drive its functionality.
|
||||
@@ -19,12 +23,12 @@ import {Component} from './component';
|
||||
*/
|
||||
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() {
|
||||
@@ -58,7 +62,8 @@ export class Tabs extends Component {
|
||||
tab.setAttribute('aria-selected', selected ? 'true' : 'false');
|
||||
}
|
||||
|
||||
this.$emit('change', {showing: sectionId});
|
||||
const data: TabsChangeEvent = {showing: sectionId};
|
||||
this.$emit('change', data);
|
||||
}
|
||||
|
||||
protected updateActiveState(): void {
|
||||
|
||||
Reference in New Issue
Block a user