-
Notifications
You must be signed in to change notification settings - Fork 120
/
panel.tsx
52 lines (47 loc) · 1.34 KB
/
panel.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { editor as MonacoEditor } from 'mo/monaco';
import { IActionBarItemProps } from 'mo/components/actionBar';
import { ITabProps } from 'mo/components/tabs/tab';
export interface IPanelItem<T = any> extends ITabProps<T> {
/**
* The same as HTMLElement title attribute
*/
title?: string;
toolbox?: IActionBarItemProps[];
data?: T;
/**
* The sort of panel item
*/
sortIndex?: number;
}
export enum PanelEvent {
onTabChange = 'panel.onTabChange',
onToolbarClick = 'panel.onToolbarClick',
onTabClose = 'panel.onTabClose',
}
export interface IPanel {
current?: IPanelItem | null;
data?: IPanelItem[];
toolbox?: IActionBarItemProps[];
}
export interface IOutput extends IPanelItem {
outputEditorInstance?: MonacoEditor.IStandaloneCodeEditor;
onUpdateEditorIns?(
editorInstance: MonacoEditor.IStandaloneCodeEditor
): void;
}
export class PanelModel implements IPanel {
public current: IPanelItem | null;
public data: IPanelItem[];
public hidden = false;
public maximize = false;
public toolbox: IActionBarItemProps[];
constructor(
current: IPanelItem | null = null,
data: IPanelItem[] = [],
toolbox: IActionBarItemProps[] = []
) {
this.current = current;
this.data = data;
this.toolbox = toolbox;
}
}