1
0
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:
Dan Brown
2025-05-12 15:31:55 +01:00
parent 62f78f1c6d
commit 8f92b6f21b
10 changed files with 166 additions and 148 deletions

View File

@@ -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 {