mirror of
https://github.com/mathuo/dockview
synced 2025-05-04 18:48:26 +00:00
Merge pull request #96 from mathuo/95-api-enhancements
feat: rename classes
This commit is contained in:
commit
cec14b9d50
@ -1,24 +1,25 @@
|
||||
import { IDockviewComponent, IGroupPanel } from '../..';
|
||||
import { IDockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { DockviewPanelApiImpl, TitleEvent } from '../../api/groupPanelApi';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { IDockviewPanel } from '../../groupview/groupPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
|
||||
describe('groupPanelApi', () => {
|
||||
test('title', () => {
|
||||
const groupPanel: Partial<IGroupPanel> = {
|
||||
const groupPanel: Partial<IDockviewPanel> = {
|
||||
id: 'test_id',
|
||||
title: 'test_title',
|
||||
};
|
||||
|
||||
const accessor: Partial<IDockviewComponent> = {};
|
||||
const groupViewPanel = new GroupviewPanel(
|
||||
const groupViewPanel = new GroupPanel(
|
||||
<IDockviewComponent>accessor,
|
||||
'',
|
||||
{}
|
||||
);
|
||||
|
||||
const cut = new DockviewPanelApiImpl(
|
||||
<IGroupPanel>groupPanel,
|
||||
<GroupviewPanel>groupViewPanel
|
||||
<IDockviewPanel>groupPanel,
|
||||
<GroupPanel>groupViewPanel
|
||||
);
|
||||
|
||||
let events: TitleEvent[] = [];
|
||||
@ -39,20 +40,20 @@ describe('groupPanelApi', () => {
|
||||
});
|
||||
|
||||
test('onDidGroupChange', () => {
|
||||
const groupPanel: Partial<IGroupPanel> = {
|
||||
const groupPanel: Partial<IDockviewPanel> = {
|
||||
id: 'test_id',
|
||||
};
|
||||
|
||||
const accessor: Partial<IDockviewComponent> = {};
|
||||
const groupViewPanel = new GroupviewPanel(
|
||||
const groupViewPanel = new GroupPanel(
|
||||
<IDockviewComponent>accessor,
|
||||
'',
|
||||
{}
|
||||
);
|
||||
|
||||
const cut = new DockviewPanelApiImpl(
|
||||
<IGroupPanel>groupPanel,
|
||||
<GroupviewPanel>groupViewPanel
|
||||
<IDockviewPanel>groupPanel,
|
||||
<GroupPanel>groupViewPanel
|
||||
);
|
||||
|
||||
let events = 0;
|
||||
@ -64,7 +65,7 @@ describe('groupPanelApi', () => {
|
||||
expect(events).toBe(0);
|
||||
expect(cut.group).toBe(groupViewPanel);
|
||||
|
||||
const groupViewPanel2 = new GroupviewPanel(
|
||||
const groupViewPanel2 = new GroupPanel(
|
||||
<IDockviewComponent>accessor,
|
||||
'',
|
||||
{}
|
||||
|
@ -4,7 +4,7 @@ import {
|
||||
} from '../../dockview/deserializer';
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { Groupview } from '../../groupview/groupview';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
|
||||
describe('deserializer', () => {
|
||||
test('fromJSON', () => {
|
||||
@ -21,14 +21,14 @@ describe('deserializer', () => {
|
||||
const panel1 = jest.fn();
|
||||
const panel2 = jest.fn();
|
||||
|
||||
const groupMock = jest.fn<GroupviewPanel, []>(() => {
|
||||
const result: Partial<GroupviewPanel> = {
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const result: Partial<GroupPanel> = {
|
||||
model: new model(),
|
||||
panels: <any>[panel1, panel2],
|
||||
activePanel: null,
|
||||
};
|
||||
|
||||
return result as GroupviewPanel;
|
||||
return result as GroupPanel;
|
||||
});
|
||||
const group = new groupMock();
|
||||
const createGroup = jest.fn().mockReturnValue(new groupMock());
|
||||
|
@ -11,12 +11,12 @@ import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { Orientation } from '../../splitview/core/splitview';
|
||||
import { ReactPanelDeserialzier } from '../../react/deserializer';
|
||||
import { Position } from '../../dnd/droptarget';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { CompositeDisposable } from '../../lifecycle';
|
||||
import {
|
||||
GroupPanelUpdateEvent,
|
||||
GroupviewPanelState,
|
||||
IGroupPanel,
|
||||
IDockviewPanel,
|
||||
IGroupPanelInitParameters,
|
||||
} from '../../groupview/groupPanel';
|
||||
import { IGroupPanelView } from '../../dockview/defaultGroupPanelView';
|
||||
@ -39,7 +39,7 @@ class PanelContentPartTest implements IContentRenderer {
|
||||
this.element.classList.add(`testpanel-${id}`);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ class PanelTabPartTest implements ITabRenderer {
|
||||
this.element.classList.add(`testpanel-${id}`);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ class TestGroupPanelView implements IGroupPanelView {
|
||||
//
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//
|
||||
}
|
||||
|
||||
@ -143,8 +143,8 @@ class TestGroupPanelView implements IGroupPanelView {
|
||||
}
|
||||
}
|
||||
|
||||
class TestGroupPanel implements IGroupPanel {
|
||||
private _group: GroupviewPanel | undefined;
|
||||
class TestGroupPanel implements IDockviewPanel {
|
||||
private _group: GroupPanel | undefined;
|
||||
|
||||
readonly view: IGroupPanelView;
|
||||
readonly suppressClosable: boolean = false;
|
||||
@ -156,7 +156,7 @@ class TestGroupPanel implements IGroupPanel {
|
||||
accessor: IDockviewComponent
|
||||
) {
|
||||
this.api = new DockviewPanelApiImpl(this, this._group);
|
||||
this._group = new GroupviewPanel(accessor, id, {});
|
||||
this._group = new GroupPanel(accessor, id, {});
|
||||
this.view = new TestGroupPanelView(
|
||||
new PanelContentPartTest(id, 'component')
|
||||
);
|
||||
@ -166,11 +166,11 @@ class TestGroupPanel implements IGroupPanel {
|
||||
return {};
|
||||
}
|
||||
|
||||
get group(): GroupviewPanel | undefined {
|
||||
get group(): GroupPanel | undefined {
|
||||
return this._group;
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isGroupActive: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void {
|
||||
this._group = group;
|
||||
}
|
||||
|
||||
@ -876,8 +876,8 @@ describe('dockviewComponent', () => {
|
||||
dockview.layout(1000, 1000);
|
||||
|
||||
let events: {
|
||||
panel?: IGroupPanel;
|
||||
group?: GroupviewPanel | undefined;
|
||||
panel?: IDockviewPanel;
|
||||
group?: GroupPanel | undefined;
|
||||
type: string;
|
||||
}[] = [];
|
||||
|
||||
@ -1042,7 +1042,7 @@ describe('dockviewComponent', () => {
|
||||
test('#1', () => {
|
||||
dockview.layout(500, 500);
|
||||
dockview.deserializer = {
|
||||
fromJSON: (panelData: GroupviewPanelState): IGroupPanel => {
|
||||
fromJSON: (panelData: GroupviewPanelState): IDockviewPanel => {
|
||||
return new TestGroupPanel(
|
||||
panelData.id,
|
||||
panelData.title,
|
||||
@ -1067,8 +1067,8 @@ describe('dockviewComponent', () => {
|
||||
position: { referencePanel: 'panel2', direction: 'below' },
|
||||
});
|
||||
|
||||
const removedGroups: GroupviewPanel[] = [];
|
||||
const removedPanels: IGroupPanel[] = [];
|
||||
const removedGroups: GroupPanel[] = [];
|
||||
const removedPanels: IDockviewPanel[] = [];
|
||||
|
||||
const disposable = new CompositeDisposable(
|
||||
dockview.onDidRemoveGroup((group) => {
|
||||
|
@ -2,7 +2,7 @@ import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { DockviewApi } from '../../api/component.api';
|
||||
import { IGroupPanelView } from '../../dockview/defaultGroupPanelView';
|
||||
import { DockviewGroupPanel } from '../../dockview/dockviewGroupPanel';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
|
||||
describe('dockviewGroupPanel', () => {
|
||||
test('update title', () => {
|
||||
@ -14,7 +14,7 @@ describe('dockviewGroupPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupviewPanel, []>(() => {
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const api = new dockviewApiMock();
|
||||
@ -48,7 +48,7 @@ describe('dockviewGroupPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupviewPanel, []>(() => {
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const api = new dockviewApiMock();
|
||||
@ -88,7 +88,7 @@ describe('dockviewGroupPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupviewPanel, []>(() => {
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const api = new dockviewApiMock();
|
||||
|
@ -4,7 +4,7 @@ import {
|
||||
} from '../../dockview/dockviewComponent';
|
||||
import {
|
||||
GroupviewPanelState,
|
||||
IGroupPanel,
|
||||
IDockviewPanel,
|
||||
IGroupPanelInitParameters,
|
||||
} from '../../groupview/groupPanel';
|
||||
import {
|
||||
@ -14,7 +14,6 @@ import {
|
||||
IWatermarkRenderer,
|
||||
} from '../../groupview/types';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import {
|
||||
GroupChangeKind2,
|
||||
GroupOptions,
|
||||
@ -25,6 +24,7 @@ import {
|
||||
DefaultGroupPanelView,
|
||||
IGroupPanelView,
|
||||
} from '../../dockview/defaultGroupPanelView';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
|
||||
class Watermark implements IWatermarkRenderer {
|
||||
public readonly element = document.createElement('div');
|
||||
@ -81,7 +81,7 @@ class TestContentPart implements IContentRenderer {
|
||||
//void
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean) {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
//noop
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class TestHeaderPart implements ITabRenderer {
|
||||
//void
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean) {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
//noop
|
||||
}
|
||||
|
||||
@ -133,9 +133,9 @@ class TestHeaderPart implements ITabRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
class TestPanel implements IGroupPanel {
|
||||
class TestPanel implements IDockviewPanel {
|
||||
private _view: IGroupPanelView | undefined;
|
||||
private _group: GroupviewPanel | undefined;
|
||||
private _group: GroupPanel | undefined;
|
||||
private _params: IGroupPanelInitParameters;
|
||||
|
||||
get title() {
|
||||
@ -175,7 +175,7 @@ class TestPanel implements IGroupPanel {
|
||||
this._params = params;
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isGroupActive: boolean) {
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean) {
|
||||
this._group = group;
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ class TestPanel implements IGroupPanel {
|
||||
}
|
||||
|
||||
describe('groupview', () => {
|
||||
let groupview: GroupviewPanel;
|
||||
let groupview: GroupPanel;
|
||||
let dockview: IDockviewComponent;
|
||||
let options: GroupOptions;
|
||||
|
||||
@ -228,7 +228,7 @@ describe('groupview', () => {
|
||||
options = {
|
||||
tabHeight: 30,
|
||||
};
|
||||
groupview = new GroupviewPanel(dockview, 'groupview-1', options);
|
||||
groupview = new GroupPanel(dockview, 'groupview-1', options);
|
||||
groupview.initialize();
|
||||
});
|
||||
|
||||
@ -237,7 +237,7 @@ describe('groupview', () => {
|
||||
const panel2 = new TestPanel('panel2', jest.fn() as any);
|
||||
const panel3 = new TestPanel('panel3', jest.fn() as any);
|
||||
|
||||
const groupview2 = new GroupviewPanel(dockview, 'groupview-2', {
|
||||
const groupview2 = new GroupPanel(dockview, 'groupview-2', {
|
||||
tabHeight: 25,
|
||||
panels: [panel1, panel2, panel3],
|
||||
activePanel: panel2,
|
||||
@ -262,7 +262,7 @@ describe('groupview', () => {
|
||||
const panel2 = new TestPanel('panel2', jest.fn() as any);
|
||||
const panel3 = new TestPanel('panel3', jest.fn() as any);
|
||||
|
||||
const groupview2 = new GroupviewPanel(dockview, 'groupview-2', {
|
||||
const groupview2 = new GroupPanel(dockview, 'groupview-2', {
|
||||
tabHeight: 25,
|
||||
panels: [panel1, panel2, panel3],
|
||||
activePanel: panel2,
|
||||
|
@ -1,19 +1,20 @@
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { Emitter, Event } from '../../../events';
|
||||
import { IGroupPanel } from '../../../groupview/groupPanel';
|
||||
import { ContentContainer } from '../../../groupview/panel/content';
|
||||
import {
|
||||
GroupPanelContentPartInitParameters,
|
||||
IContentRenderer,
|
||||
} from '../../../groupview/types';
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { CompositeDisposable } from '../../../lifecycle';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { IGroupPanelView } from '../../../dockview/defaultGroupPanelView';
|
||||
import { IDockviewPanel } from '../../../groupview/groupPanel';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
|
||||
class TestContentRenderer
|
||||
extends CompositeDisposable
|
||||
implements IContentRenderer {
|
||||
implements IContentRenderer
|
||||
{
|
||||
readonly element: HTMLElement;
|
||||
|
||||
readonly _onDidFocus = new Emitter<void>();
|
||||
@ -26,7 +27,7 @@ class TestContentRenderer
|
||||
this.element = document.createElement('div');
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//
|
||||
}
|
||||
|
||||
@ -77,9 +78,9 @@ describe('contentContainer', () => {
|
||||
view: {
|
||||
content: contentRenderer,
|
||||
} as Partial<IGroupPanelView>,
|
||||
} as Partial<IGroupPanel>;
|
||||
} as Partial<IDockviewPanel>;
|
||||
|
||||
cut.openPanel(panel as IGroupPanel);
|
||||
cut.openPanel(panel as IDockviewPanel);
|
||||
|
||||
expect(focus).toBe(0);
|
||||
expect(blur).toBe(0);
|
||||
@ -111,9 +112,9 @@ describe('contentContainer', () => {
|
||||
view: {
|
||||
content: contentRenderer2,
|
||||
} as Partial<IGroupPanelView>,
|
||||
} as Partial<IGroupPanel>;
|
||||
} as Partial<IDockviewPanel>;
|
||||
|
||||
cut.openPanel(panel2 as IGroupPanel);
|
||||
cut.openPanel(panel2 as IDockviewPanel);
|
||||
expect(focus).toBe(2);
|
||||
expect(blur).toBe(2);
|
||||
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
SerializedGridview,
|
||||
} from '../gridview/gridviewComponent';
|
||||
import { IGridviewPanel } from '../gridview/gridviewPanel';
|
||||
import { IGroupPanel } from '../groupview/groupPanel';
|
||||
import { IDockviewPanel } from '../groupview/groupPanel';
|
||||
import {
|
||||
AddPaneviewComponentOptions,
|
||||
SerializedPaneview,
|
||||
@ -30,7 +30,7 @@ import {
|
||||
} from '../splitview/splitviewComponent';
|
||||
import { IView, Orientation, Sizing } from '../splitview/core/splitview';
|
||||
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
||||
import { GroupviewPanel, IGroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel, IGroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { Emitter, Event } from '../events';
|
||||
import { PaneviewDropEvent } from '../react';
|
||||
|
||||
@ -376,15 +376,15 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.onDidRemoveGroup;
|
||||
}
|
||||
|
||||
get onDidActivePanelChange(): Event<IGroupPanel | undefined> {
|
||||
get onDidActivePanelChange(): Event<IDockviewPanel | undefined> {
|
||||
return this.component.onDidActivePanelChange;
|
||||
}
|
||||
|
||||
get onDidAddPanel(): Event<IGroupPanel> {
|
||||
get onDidAddPanel(): Event<IDockviewPanel> {
|
||||
return this.component.onDidAddPanel;
|
||||
}
|
||||
|
||||
get onDidRemovePanel(): Event<IGroupPanel> {
|
||||
get onDidRemovePanel(): Event<IDockviewPanel> {
|
||||
return this.component.onDidRemovePanel;
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.onDidDrop;
|
||||
}
|
||||
|
||||
get panels(): IGroupPanel[] {
|
||||
get panels(): IDockviewPanel[] {
|
||||
return this.component.panels;
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.groups;
|
||||
}
|
||||
|
||||
get activePanel(): IGroupPanel | undefined {
|
||||
get activePanel(): IDockviewPanel | undefined {
|
||||
return this.component.activePanel;
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
this.component.focus();
|
||||
}
|
||||
|
||||
getPanel(id: string): IGroupPanel | undefined {
|
||||
getPanel(id: string): IDockviewPanel | undefined {
|
||||
return this.component.getGroupPanel(id);
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
this.component.layout(width, height, force);
|
||||
}
|
||||
|
||||
addPanel(options: AddPanelOptions): IGroupPanel {
|
||||
addPanel(options: AddPanelOptions): IDockviewPanel {
|
||||
return this.component.addPanel(options);
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
}
|
||||
|
||||
removeGroup(group: IGroupviewPanel): void {
|
||||
this.component.removeGroup(<GroupviewPanel>group);
|
||||
this.component.removeGroup(<GroupPanel>group);
|
||||
}
|
||||
|
||||
getGroup(id: string): IGroupviewPanel | undefined {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Emitter } from '../events';
|
||||
import { GridviewPanelApiImpl, GridviewPanelApi } from './gridviewPanelApi';
|
||||
import { IGroupPanel } from '../groupview/groupPanel';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { IDockviewPanel } from '../groupview/groupPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { MutableDisposable } from '../lifecycle';
|
||||
|
||||
export interface TitleEvent {
|
||||
@ -17,7 +17,7 @@ export interface SuppressClosableEvent {
|
||||
* because it belongs to a groupview
|
||||
*/
|
||||
export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible'> {
|
||||
readonly group: GroupviewPanel;
|
||||
readonly group: GroupPanel;
|
||||
readonly isGroupActive: boolean;
|
||||
readonly title: string;
|
||||
readonly suppressClosable: boolean;
|
||||
@ -29,7 +29,7 @@ export class DockviewPanelApiImpl
|
||||
extends GridviewPanelApiImpl
|
||||
implements DockviewPanelApi
|
||||
{
|
||||
private _group: GroupviewPanel;
|
||||
private _group: GroupPanel;
|
||||
|
||||
readonly _onDidTitleChange = new Emitter<TitleEvent>();
|
||||
readonly onDidTitleChange = this._onDidTitleChange.event;
|
||||
@ -60,7 +60,7 @@ export class DockviewPanelApiImpl
|
||||
return !!this.group?.isActive;
|
||||
}
|
||||
|
||||
set group(value: GroupviewPanel) {
|
||||
set group(value: GroupPanel) {
|
||||
const isOldGroupActive = this.isGroupActive;
|
||||
|
||||
this._group = value;
|
||||
@ -78,11 +78,11 @@ export class DockviewPanelApiImpl
|
||||
}
|
||||
}
|
||||
|
||||
get group(): GroupviewPanel {
|
||||
get group(): GroupPanel {
|
||||
return this._group;
|
||||
}
|
||||
|
||||
constructor(private panel: IGroupPanel, group: GroupviewPanel) {
|
||||
constructor(private panel: IDockviewPanel, group: GroupPanel) {
|
||||
super(panel.id);
|
||||
this._group = group;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
} from '../../../groupview/types';
|
||||
import { addDisposableListener } from '../../../events';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
|
||||
export class WrappedTab implements ITabRenderer {
|
||||
private readonly _element: HTMLElement;
|
||||
@ -59,7 +59,7 @@ export class WrappedTab implements ITabRenderer {
|
||||
this.renderer.init(parameters);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
this.renderer.updateParentGroup(group, isPanelVisible);
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
public updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean) {
|
||||
public updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
this._isPanelVisible = isPanelVisible;
|
||||
this._isGroupActive = group.isActive;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { ActionContainer } from '../../../actionbar/actionsContainer';
|
||||
import { addDisposableListener } from '../../../events';
|
||||
import { toggleClass } from '../../../dom';
|
||||
import { CompositeDisposable } from '../../../lifecycle';
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
|
||||
export class Watermark
|
||||
@ -14,7 +14,7 @@ export class Watermark
|
||||
implements IWatermarkRenderer
|
||||
{
|
||||
private _element: HTMLElement;
|
||||
private group: GroupviewPanel | undefined;
|
||||
private group: GroupPanel | undefined;
|
||||
private params: GroupPanelPartInitParameters | undefined;
|
||||
|
||||
get id() {
|
||||
@ -85,7 +85,7 @@ export class Watermark
|
||||
this.render();
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, _visible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, _visible: boolean): void {
|
||||
this.group = group;
|
||||
this.render();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
IContentRenderer,
|
||||
ITabRenderer,
|
||||
} from '../groupview/types';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { IDisposable } from '../lifecycle';
|
||||
import { GroupPanelUpdateEvent } from '../groupview/groupPanel';
|
||||
|
||||
@ -16,7 +16,7 @@ export interface IGroupPanelView extends IDisposable {
|
||||
update(event: GroupPanelUpdateEvent): void;
|
||||
layout(width: number, height: number): void;
|
||||
init(params: GroupPanelPartInitParameters): void;
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void;
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void;
|
||||
toJSON(): {};
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ export class DefaultGroupPanelView implements IGroupPanelView {
|
||||
this.tab.init(params);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
this._content.updateParentGroup(group, isPanelVisible);
|
||||
this._tab?.updateParentGroup(group, isPanelVisible);
|
||||
}
|
||||
|
@ -3,20 +3,17 @@ import {
|
||||
ISerializedLeafNode,
|
||||
IViewDeserializer,
|
||||
} from '../gridview/gridview';
|
||||
import { GroupviewPanelState, IGroupPanel } from '../groupview/groupPanel';
|
||||
import { GroupviewPanelState, IDockviewPanel } from '../groupview/groupPanel';
|
||||
import { GroupPanelViewState } from '../groupview/groupview';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewComponent } from './dockviewComponent';
|
||||
|
||||
export interface IPanelDeserializer {
|
||||
fromJSON(
|
||||
panelData: GroupviewPanelState,
|
||||
group: GroupviewPanel
|
||||
): IGroupPanel;
|
||||
fromJSON(panelData: GroupviewPanelState, group: GroupPanel): IDockviewPanel;
|
||||
}
|
||||
|
||||
export interface PanelDeserializerOptions {
|
||||
createPanel: (id: string, group: GroupviewPanel) => IGroupPanel;
|
||||
createPanel: (id: string, group: GroupPanel) => IDockviewPanel;
|
||||
}
|
||||
|
||||
export class DefaultDeserializer implements IViewDeserializer {
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
} from '../gridview/gridview';
|
||||
import { Position } from '../dnd/droptarget';
|
||||
import { tail, sequenceEquals } from '../array';
|
||||
import { GroupviewPanelState, IGroupPanel } from '../groupview/groupPanel';
|
||||
import { GroupviewPanelState, IDockviewPanel } from '../groupview/groupPanel';
|
||||
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
||||
import { CompositeDisposable } from '../lifecycle';
|
||||
import { Event, Emitter } from '../events';
|
||||
@ -40,7 +40,7 @@ import {
|
||||
GroupPanelViewState,
|
||||
GroupviewDropEvent,
|
||||
} from '../groupview/groupview';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DefaultGroupPanelView } from './defaultGroupPanelView';
|
||||
|
||||
const nextGroupId = sequentialNumberGenerator();
|
||||
@ -77,27 +77,27 @@ export interface DockviewDropEvent extends GroupviewDropEvent {
|
||||
api: DockviewApi;
|
||||
}
|
||||
|
||||
export interface IDockviewComponent extends IBaseGrid<GroupviewPanel> {
|
||||
readonly activePanel: IGroupPanel | undefined;
|
||||
export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
|
||||
readonly activePanel: IDockviewPanel | undefined;
|
||||
readonly totalPanels: number;
|
||||
readonly panels: IGroupPanel[];
|
||||
readonly panels: IDockviewPanel[];
|
||||
readonly onDidDrop: Event<DockviewDropEvent>;
|
||||
tabHeight: number | undefined;
|
||||
deserializer: IPanelDeserializer | undefined;
|
||||
updateOptions(options: DockviewComponentUpdateOptions): void;
|
||||
moveGroupOrPanel(
|
||||
referenceGroup: GroupviewPanel,
|
||||
referenceGroup: GroupPanel,
|
||||
groupId: string,
|
||||
itemId: string,
|
||||
target: Position,
|
||||
index?: number
|
||||
): void;
|
||||
doSetGroupActive: (group: GroupviewPanel, skipFocus?: boolean) => void;
|
||||
removeGroup: (group: GroupviewPanel) => void;
|
||||
doSetGroupActive: (group: GroupPanel, skipFocus?: boolean) => void;
|
||||
removeGroup: (group: GroupPanel) => void;
|
||||
options: DockviewComponentOptions;
|
||||
addPanel(options: AddPanelOptions): IGroupPanel;
|
||||
removePanel(panel: IGroupPanel): void;
|
||||
getGroupPanel: (id: string) => IGroupPanel | undefined;
|
||||
addPanel(options: AddPanelOptions): IDockviewPanel;
|
||||
removePanel(panel: IDockviewPanel): void;
|
||||
getGroupPanel: (id: string) => IDockviewPanel | undefined;
|
||||
fireMouseEvent(event: LayoutMouseEvent): void;
|
||||
createWatermarkComponent(): IWatermarkRenderer;
|
||||
// lifecycle
|
||||
@ -108,19 +108,19 @@ export interface IDockviewComponent extends IBaseGrid<GroupviewPanel> {
|
||||
onTabContextMenu: Event<TabContextMenuEvent>;
|
||||
moveToNext(options?: MovementOptions): void;
|
||||
moveToPrevious(options?: MovementOptions): void;
|
||||
setActivePanel(panel: IGroupPanel): void;
|
||||
setActivePanel(panel: IDockviewPanel): void;
|
||||
focus(): void;
|
||||
toJSON(): SerializedDockview;
|
||||
fromJSON(data: SerializedDockview): void;
|
||||
//
|
||||
readonly onDidRemovePanel: Event<IGroupPanel>;
|
||||
readonly onDidAddPanel: Event<IGroupPanel>;
|
||||
readonly onDidRemovePanel: Event<IDockviewPanel>;
|
||||
readonly onDidAddPanel: Event<IDockviewPanel>;
|
||||
readonly onDidLayoutfromJSON: Event<void>;
|
||||
readonly onDidActivePanelChange: Event<IGroupPanel | undefined>;
|
||||
readonly onDidActivePanelChange: Event<IDockviewPanel | undefined>;
|
||||
}
|
||||
|
||||
export class DockviewComponent
|
||||
extends BaseGrid<GroupviewPanel>
|
||||
extends BaseGrid<GroupPanel>
|
||||
implements IDockviewComponent
|
||||
{
|
||||
private _deserializer: IPanelDeserializer | undefined;
|
||||
@ -139,27 +139,27 @@ export class DockviewComponent
|
||||
private readonly _onDidDrop = new Emitter<DockviewDropEvent>();
|
||||
readonly onDidDrop: Event<DockviewDropEvent> = this._onDidDrop.event;
|
||||
|
||||
private readonly _onDidRemovePanel = new Emitter<IGroupPanel>();
|
||||
readonly onDidRemovePanel: Event<IGroupPanel> =
|
||||
private readonly _onDidRemovePanel = new Emitter<IDockviewPanel>();
|
||||
readonly onDidRemovePanel: Event<IDockviewPanel> =
|
||||
this._onDidRemovePanel.event;
|
||||
|
||||
private readonly _onDidAddPanel = new Emitter<IGroupPanel>();
|
||||
readonly onDidAddPanel: Event<IGroupPanel> = this._onDidAddPanel.event;
|
||||
private readonly _onDidAddPanel = new Emitter<IDockviewPanel>();
|
||||
readonly onDidAddPanel: Event<IDockviewPanel> = this._onDidAddPanel.event;
|
||||
|
||||
private readonly _onDidLayoutfromJSON = new Emitter<void>();
|
||||
readonly onDidLayoutfromJSON: Event<void> = this._onDidLayoutfromJSON.event;
|
||||
|
||||
private readonly _onDidActivePanelChange = new Emitter<
|
||||
IGroupPanel | undefined
|
||||
IDockviewPanel | undefined
|
||||
>();
|
||||
readonly onDidActivePanelChange: Event<IGroupPanel | undefined> =
|
||||
readonly onDidActivePanelChange: Event<IDockviewPanel | undefined> =
|
||||
this._onDidActivePanelChange.event;
|
||||
|
||||
get totalPanels(): number {
|
||||
return this.panels.length;
|
||||
}
|
||||
|
||||
get panels(): IGroupPanel[] {
|
||||
get panels(): IDockviewPanel[] {
|
||||
return this.groups.flatMap((group) => group.panels);
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ export class DockviewComponent
|
||||
return this._options;
|
||||
}
|
||||
|
||||
get activePanel(): IGroupPanel | undefined {
|
||||
get activePanel(): IDockviewPanel | undefined {
|
||||
const activeGroup = this.activeGroup;
|
||||
|
||||
if (!activeGroup) {
|
||||
@ -258,11 +258,11 @@ export class DockviewComponent
|
||||
this.activeGroup?.focus();
|
||||
}
|
||||
|
||||
getGroupPanel(id: string): IGroupPanel | undefined {
|
||||
getGroupPanel(id: string): IDockviewPanel | undefined {
|
||||
return this.panels.find((panel) => panel.id === id);
|
||||
}
|
||||
|
||||
setActivePanel(panel: IGroupPanel): void {
|
||||
setActivePanel(panel: IDockviewPanel): void {
|
||||
this.doSetGroupActive(panel.group);
|
||||
panel.group.model.openPanel(panel);
|
||||
}
|
||||
@ -288,7 +288,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
const location = getGridLocation(options.group.element);
|
||||
const next = <GroupviewPanel>this.gridview.next(location)?.view
|
||||
const next = <GroupPanel>this.gridview.next(location)?.view
|
||||
this.doSetGroupActive(next);
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ export class DockviewComponent
|
||||
const location = getGridLocation(options.group.element);
|
||||
const next = this.gridview.previous(location)?.view;
|
||||
if (next) {
|
||||
this.doSetGroupActive(next as GroupviewPanel);
|
||||
this.doSetGroupActive(next as GroupPanel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -403,12 +403,12 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
addPanel(options: AddPanelOptions): IGroupPanel {
|
||||
addPanel(options: AddPanelOptions): IDockviewPanel {
|
||||
if (this.panels.find((_) => _.id === options.id)) {
|
||||
throw new Error(`panel with id ${options.id} already exists`);
|
||||
}
|
||||
|
||||
let referenceGroup: GroupviewPanel | undefined;
|
||||
let referenceGroup: GroupPanel | undefined;
|
||||
|
||||
if (options.position?.referencePanel) {
|
||||
const referencePanel = this.getGroupPanel(
|
||||
@ -426,7 +426,7 @@ export class DockviewComponent
|
||||
referenceGroup = this.activeGroup;
|
||||
}
|
||||
|
||||
let panel: IGroupPanel
|
||||
let panel: IDockviewPanel
|
||||
|
||||
if (referenceGroup) {
|
||||
const target = toTarget(options.position?.direction || 'within');
|
||||
@ -454,7 +454,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
removePanel(
|
||||
panel: IGroupPanel,
|
||||
panel: IDockviewPanel,
|
||||
options: { removeEmptyGroup: boolean; skipDispose: boolean } = {
|
||||
removeEmptyGroup: true,
|
||||
skipDispose: false,
|
||||
@ -533,7 +533,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
removeGroup(group: GroupviewPanel, skipActive = false): void {
|
||||
removeGroup(group: GroupPanel, skipActive = false): void {
|
||||
const panels = [...group.panels]; // reassign since group panels will mutate
|
||||
|
||||
for (const panel of panels) {
|
||||
@ -547,7 +547,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
moveGroupOrPanel(
|
||||
referenceGroup: GroupviewPanel,
|
||||
referenceGroup: GroupPanel,
|
||||
groupId: string,
|
||||
itemId: string,
|
||||
target: Position,
|
||||
@ -558,7 +558,7 @@ export class DockviewComponent
|
||||
: undefined;
|
||||
|
||||
if (!target || target === Position.Center) {
|
||||
const groupItem: IGroupPanel | undefined =
|
||||
const groupItem: IDockviewPanel | undefined =
|
||||
sourceGroup?.model.removePanel(itemId) ||
|
||||
this.panels.find((panel) => panel.id === itemId);
|
||||
|
||||
@ -610,7 +610,7 @@ export class DockviewComponent
|
||||
this.doAddGroup(targetGroup, location);
|
||||
}
|
||||
} else {
|
||||
const groupItem: IGroupPanel | undefined =
|
||||
const groupItem: IDockviewPanel | undefined =
|
||||
sourceGroup?.model.removePanel(itemId) ||
|
||||
this.panels.find((panel) => panel.id === itemId);
|
||||
|
||||
@ -631,7 +631,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
override doSetGroupActive(
|
||||
group: GroupviewPanel | undefined,
|
||||
group: GroupPanel | undefined,
|
||||
skipFocus?: boolean
|
||||
): void {
|
||||
const isGroupAlreadyFocused = this._activeGroup === group;
|
||||
@ -644,7 +644,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
createGroup(options?: GroupOptions): GroupviewPanel {
|
||||
createGroup(options?: GroupOptions): GroupPanel {
|
||||
if (!options) {
|
||||
options = { tabHeight: this.tabHeight };
|
||||
}
|
||||
@ -668,7 +668,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
const view = new GroupviewPanel(this, id, options);
|
||||
const view = new GroupPanel(this, id, options);
|
||||
view.init({ params: {}, containerApi: <any>null }); // required to initialized .part and allow for correct disposal of group
|
||||
|
||||
if (!this._groups.has(view.id)) {
|
||||
@ -713,7 +713,7 @@ export class DockviewComponent
|
||||
return view;
|
||||
}
|
||||
|
||||
private createPanel(options: AddPanelOptions, group: GroupviewPanel): IGroupPanel {
|
||||
private createPanel(options: AddPanelOptions, group: GroupPanel): IDockviewPanel {
|
||||
const view = new DefaultGroupPanelView({
|
||||
content: this.createContentComponent(options.id, options.component),
|
||||
tab: this.createTabComponent(options.id, options.tabComponent),
|
||||
@ -759,13 +759,13 @@ export class DockviewComponent
|
||||
|
||||
private createGroupAtLocation(
|
||||
location: number[] = [0]
|
||||
): GroupviewPanel {
|
||||
): GroupPanel {
|
||||
const group = this.createGroup();
|
||||
this.doAddGroup(group, location);
|
||||
return group
|
||||
}
|
||||
|
||||
private findGroup(panel: IGroupPanel): GroupviewPanel | undefined {
|
||||
private findGroup(panel: IDockviewPanel): GroupPanel | undefined {
|
||||
return Array.from(this._groups.values()).find((group) =>
|
||||
group.value.model.containsPanel(panel)
|
||||
)?.value;
|
||||
|
@ -3,10 +3,10 @@ import { DockviewPanelApiImpl } from '../api/groupPanelApi';
|
||||
import {
|
||||
GroupPanelUpdateEvent,
|
||||
GroupviewPanelState,
|
||||
IGroupPanel,
|
||||
IDockviewPanel,
|
||||
IGroupPanelInitParameters,
|
||||
} from '../groupview/groupPanel';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { CompositeDisposable, MutableDisposable } from '../lifecycle';
|
||||
import { Parameters } from '../panel/types';
|
||||
import { IGroupPanelView } from './defaultGroupPanelView';
|
||||
@ -14,12 +14,12 @@ import { DockviewComponent } from './dockviewComponent';
|
||||
|
||||
export class DockviewGroupPanel
|
||||
extends CompositeDisposable
|
||||
implements IGroupPanel
|
||||
implements IDockviewPanel
|
||||
{
|
||||
private readonly mutableDisposable = new MutableDisposable();
|
||||
|
||||
readonly api: DockviewPanelApiImpl;
|
||||
private _group: GroupviewPanel;
|
||||
private _group: GroupPanel;
|
||||
private _params?: Parameters;
|
||||
|
||||
private _view?: IGroupPanelView;
|
||||
@ -39,7 +39,7 @@ export class DockviewGroupPanel
|
||||
return this._suppressClosable;
|
||||
}
|
||||
|
||||
get group(): GroupviewPanel {
|
||||
get group(): GroupPanel {
|
||||
return this._group;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ export class DockviewGroupPanel
|
||||
public readonly id: string,
|
||||
accessor: DockviewComponent,
|
||||
private readonly containerApi: DockviewApi,
|
||||
group: GroupviewPanel
|
||||
group: GroupPanel
|
||||
) {
|
||||
super();
|
||||
this._suppressClosable = false;
|
||||
@ -148,7 +148,7 @@ export class DockviewGroupPanel
|
||||
});
|
||||
}
|
||||
|
||||
public updateParentGroup(group: GroupviewPanel, isGroupActive: boolean) {
|
||||
public updateParentGroup(group: GroupPanel, isGroupActive: boolean) {
|
||||
this._group = group;
|
||||
this.api.group = group;
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { DockviewApi } from '../api/component.api';
|
||||
import { Direction } from '../gridview/baseComponentGridview';
|
||||
import { IGridView } from '../gridview/gridview';
|
||||
import { IGroupPanel } from '../groupview/groupPanel';
|
||||
import { IDockviewPanel } from '../groupview/groupPanel';
|
||||
import {
|
||||
IContentRenderer,
|
||||
ITabRenderer,
|
||||
WatermarkConstructor,
|
||||
IWatermarkRenderer,
|
||||
} from '../groupview/types';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
|
||||
import { FrameworkFactory } from '../types';
|
||||
import { DockviewDropTargets } from '../groupview/dnd';
|
||||
@ -22,7 +22,7 @@ export interface GroupPanelFrameworkComponentFactory {
|
||||
export interface TabContextMenuEvent {
|
||||
event: MouseEvent;
|
||||
api: DockviewApi;
|
||||
panel: IGroupPanel;
|
||||
panel: IDockviewPanel;
|
||||
}
|
||||
|
||||
export interface DockviewRenderFunctions {
|
||||
@ -89,5 +89,5 @@ export interface MovementOptions2 {
|
||||
|
||||
export interface MovementOptions extends MovementOptions2 {
|
||||
includePanel?: boolean;
|
||||
group?: GroupviewPanel;
|
||||
group?: GroupPanel;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
PanelUpdateEvent,
|
||||
Parameters,
|
||||
} from '../panel/types';
|
||||
import { GroupviewPanel } from './groupviewPanel';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { IGroupPanelView } from '../dockview/defaultGroupPanelView';
|
||||
|
||||
export interface IGroupPanelInitParameters
|
||||
@ -22,14 +22,14 @@ export type GroupPanelUpdateEvent = PanelUpdateEvent<{
|
||||
suppressClosable?: boolean;
|
||||
}>;
|
||||
|
||||
export interface IGroupPanel extends IDisposable, IPanel {
|
||||
export interface IDockviewPanel extends IDisposable, IPanel {
|
||||
readonly view?: IGroupPanelView;
|
||||
readonly group: GroupviewPanel;
|
||||
readonly group: GroupPanel;
|
||||
readonly api: DockviewPanelApi;
|
||||
readonly title: string;
|
||||
readonly suppressClosable: boolean;
|
||||
readonly params: Record<string, any> | undefined;
|
||||
updateParentGroup(group: GroupviewPanel, isGroupActive: boolean): void;
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void;
|
||||
init(params: IGroupPanelInitParameters): void;
|
||||
toJSON(): GroupviewPanelState;
|
||||
update(event: GroupPanelUpdateEvent): void;
|
||||
|
@ -8,11 +8,11 @@ import { IGridPanelView } from '../gridview/baseComponentGridview';
|
||||
import { IViewSize } from '../gridview/gridview';
|
||||
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
||||
import { PanelInitParameters, PanelUpdateEvent } from '../panel/types';
|
||||
import { IGroupPanel } from './groupPanel';
|
||||
import { IDockviewPanel } from './groupPanel';
|
||||
import { ContentContainer, IContentContainer } from './panel/content';
|
||||
import { ITabsContainer, TabsContainer } from './titlebar/tabsContainer';
|
||||
import { IWatermarkRenderer } from './types';
|
||||
import { GroupviewPanel } from './groupviewPanel';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { DockviewDropTargets } from './dnd';
|
||||
|
||||
export enum GroupChangeKind2 {
|
||||
@ -54,8 +54,8 @@ interface CoreGroupOptions {
|
||||
}
|
||||
|
||||
export interface GroupOptions extends CoreGroupOptions {
|
||||
readonly panels?: IGroupPanel[];
|
||||
readonly activePanel?: IGroupPanel;
|
||||
readonly panels?: IDockviewPanel[];
|
||||
readonly activePanel?: IDockviewPanel;
|
||||
readonly id?: string;
|
||||
tabHeight?: number;
|
||||
}
|
||||
@ -68,7 +68,7 @@ export interface GroupPanelViewState extends CoreGroupOptions {
|
||||
|
||||
export interface GroupviewChangeEvent {
|
||||
readonly kind: GroupChangeKind2;
|
||||
readonly panel?: IGroupPanel;
|
||||
readonly panel?: IDockviewPanel;
|
||||
}
|
||||
|
||||
export interface GroupviewDropEvent {
|
||||
@ -86,8 +86,8 @@ export interface IHeader {
|
||||
export interface IGroupview extends IDisposable, IGridPanelView {
|
||||
readonly isActive: boolean;
|
||||
readonly size: number;
|
||||
readonly panels: IGroupPanel[];
|
||||
readonly activePanel: IGroupPanel | undefined;
|
||||
readonly panels: IDockviewPanel[];
|
||||
readonly activePanel: IDockviewPanel | undefined;
|
||||
readonly header: IHeader;
|
||||
readonly isContentFocused: boolean;
|
||||
readonly onDidDrop: Event<GroupviewDropEvent>;
|
||||
@ -95,20 +95,23 @@ export interface IGroupview extends IDisposable, IGridPanelView {
|
||||
readonly onMove: Event<GroupMoveEvent>;
|
||||
locked: boolean;
|
||||
// state
|
||||
isPanelActive: (panel: IGroupPanel) => boolean;
|
||||
indexOf(panel: IGroupPanel): number;
|
||||
isPanelActive: (panel: IDockviewPanel) => boolean;
|
||||
indexOf(panel: IDockviewPanel): number;
|
||||
// panel lifecycle
|
||||
openPanel(
|
||||
panel: IGroupPanel,
|
||||
panel: IDockviewPanel,
|
||||
options?: { index?: number; skipFocus?: boolean }
|
||||
): void;
|
||||
closePanel(panel: IGroupPanel): void;
|
||||
closePanel(panel: IDockviewPanel): void;
|
||||
closeAllPanels(): void;
|
||||
containsPanel(panel: IGroupPanel): boolean;
|
||||
removePanel: (panelOrId: IGroupPanel | string) => IGroupPanel;
|
||||
moveToNext(options?: { panel?: IGroupPanel; suppressRoll?: boolean }): void;
|
||||
containsPanel(panel: IDockviewPanel): boolean;
|
||||
removePanel: (panelOrId: IDockviewPanel | string) => IDockviewPanel;
|
||||
moveToNext(options?: {
|
||||
panel?: IDockviewPanel;
|
||||
suppressRoll?: boolean;
|
||||
}): void;
|
||||
moveToPrevious(options?: {
|
||||
panel?: IGroupPanel;
|
||||
panel?: IDockviewPanel;
|
||||
suppressRoll?: boolean;
|
||||
}): void;
|
||||
canDisplayOverlay(event: DragEvent, target: DockviewDropTargets): boolean;
|
||||
@ -118,12 +121,12 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
private readonly tabsContainer: ITabsContainer;
|
||||
private readonly contentContainer: IContentContainer;
|
||||
private readonly dropTarget: Droptarget;
|
||||
private _activePanel?: IGroupPanel;
|
||||
private _activePanel?: IDockviewPanel;
|
||||
private watermark?: IWatermarkRenderer;
|
||||
private _isGroupActive = false;
|
||||
private _locked = false;
|
||||
|
||||
private mostRecentlyUsed: IGroupPanel[] = [];
|
||||
private mostRecentlyUsed: IDockviewPanel[] = [];
|
||||
|
||||
private readonly _onDidChange = new Emitter<IViewSize | undefined>();
|
||||
readonly onDidChange: Event<IViewSize | undefined> =
|
||||
@ -132,7 +135,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
private _width = 0;
|
||||
private _height = 0;
|
||||
|
||||
private _panels: IGroupPanel[] = [];
|
||||
private _panels: IDockviewPanel[] = [];
|
||||
|
||||
private readonly _onMove = new Emitter<GroupMoveEvent>();
|
||||
readonly onMove: Event<GroupMoveEvent> = this._onMove.event;
|
||||
@ -148,7 +151,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
throw new Error('not supported');
|
||||
}
|
||||
|
||||
get activePanel(): IGroupPanel | undefined {
|
||||
get activePanel(): IDockviewPanel | undefined {
|
||||
return this._activePanel;
|
||||
}
|
||||
|
||||
@ -164,7 +167,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
return this._isGroupActive;
|
||||
}
|
||||
|
||||
get panels(): IGroupPanel[] {
|
||||
get panels(): IDockviewPanel[] {
|
||||
return this._panels;
|
||||
}
|
||||
|
||||
@ -217,7 +220,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
private accessor: IDockviewComponent,
|
||||
public id: string,
|
||||
private readonly options: GroupOptions,
|
||||
private readonly parent: GroupviewPanel
|
||||
private readonly parent: GroupPanel
|
||||
) {
|
||||
super();
|
||||
|
||||
@ -298,7 +301,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
this.updateContainer();
|
||||
}
|
||||
|
||||
public indexOf(panel: IGroupPanel) {
|
||||
public indexOf(panel: IDockviewPanel) {
|
||||
return this.tabsContainer.indexOf(panel.id);
|
||||
}
|
||||
|
||||
@ -321,7 +324,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
|
||||
public moveToNext(options?: {
|
||||
panel?: IGroupPanel;
|
||||
panel?: IDockviewPanel;
|
||||
suppressRoll?: boolean;
|
||||
}) {
|
||||
if (!options) {
|
||||
@ -347,7 +350,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
|
||||
public moveToPrevious(options?: {
|
||||
panel?: IGroupPanel;
|
||||
panel?: IDockviewPanel;
|
||||
suppressRoll?: boolean;
|
||||
}) {
|
||||
if (!options) {
|
||||
@ -376,7 +379,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
this.openPanel(this.panels[normalizedIndex]);
|
||||
}
|
||||
|
||||
public containsPanel(panel: IGroupPanel) {
|
||||
public containsPanel(panel: IDockviewPanel) {
|
||||
return this.panels.includes(panel);
|
||||
}
|
||||
|
||||
@ -393,7 +396,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
|
||||
public openPanel(
|
||||
panel: IGroupPanel,
|
||||
panel: IDockviewPanel,
|
||||
options: {
|
||||
index?: number;
|
||||
skipFocus?: boolean;
|
||||
@ -427,7 +430,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
this.updateContainer();
|
||||
}
|
||||
|
||||
public removePanel(groupItemOrId: IGroupPanel | string): IGroupPanel {
|
||||
public removePanel(groupItemOrId: IDockviewPanel | string): IDockviewPanel {
|
||||
const id =
|
||||
typeof groupItemOrId === 'string'
|
||||
? groupItemOrId
|
||||
@ -454,15 +457,15 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
}
|
||||
|
||||
public closePanel(panel: IGroupPanel): void {
|
||||
public closePanel(panel: IDockviewPanel): void {
|
||||
this.doClose(panel);
|
||||
}
|
||||
|
||||
private doClose(panel: IGroupPanel) {
|
||||
private doClose(panel: IDockviewPanel) {
|
||||
this.accessor.removePanel(panel);
|
||||
}
|
||||
|
||||
public isPanelActive(panel: IGroupPanel) {
|
||||
public isPanelActive(panel: IDockviewPanel) {
|
||||
return this._activePanel === panel;
|
||||
}
|
||||
|
||||
@ -515,7 +518,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
}
|
||||
|
||||
private _removePanel(panel: IGroupPanel) {
|
||||
private _removePanel(panel: IDockviewPanel) {
|
||||
const isActivePanel = this._activePanel === panel;
|
||||
|
||||
this.doRemovePanel(panel);
|
||||
@ -533,7 +536,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
return panel;
|
||||
}
|
||||
|
||||
private doRemovePanel(panel: IGroupPanel) {
|
||||
private doRemovePanel(panel: IDockviewPanel) {
|
||||
const index = this.panels.indexOf(panel);
|
||||
|
||||
if (this._activePanel === panel) {
|
||||
@ -556,7 +559,10 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
});
|
||||
}
|
||||
|
||||
private doAddPanel(panel: IGroupPanel, index: number = this.panels.length) {
|
||||
private doAddPanel(
|
||||
panel: IDockviewPanel,
|
||||
index: number = this.panels.length
|
||||
) {
|
||||
const existingPanel = this._panels.indexOf(panel);
|
||||
const hasExistingPanel = existingPanel > -1;
|
||||
|
||||
@ -581,7 +587,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
});
|
||||
}
|
||||
|
||||
private doSetActivePanel(panel: IGroupPanel | undefined) {
|
||||
private doSetActivePanel(panel: IDockviewPanel | undefined) {
|
||||
this._activePanel = panel;
|
||||
|
||||
if (panel) {
|
||||
@ -598,7 +604,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
}
|
||||
}
|
||||
|
||||
private updateMru(panel: IGroupPanel) {
|
||||
private updateMru(panel: IDockviewPanel) {
|
||||
if (this.mostRecentlyUsed.includes(panel)) {
|
||||
this.mostRecentlyUsed.splice(
|
||||
this.mostRecentlyUsed.indexOf(panel),
|
||||
|
@ -6,14 +6,14 @@ import {
|
||||
} from '../api/gridviewPanelApi';
|
||||
import { Groupview, GroupOptions, IHeader } from './groupview';
|
||||
import { GridviewPanel, IGridviewPanel } from '../gridview/gridviewPanel';
|
||||
import { IGroupPanel } from './groupPanel';
|
||||
import { IDockviewPanel } from './groupPanel';
|
||||
|
||||
export interface IGroupviewPanel extends IGridviewPanel {
|
||||
model: Groupview;
|
||||
locked: boolean;
|
||||
readonly size: number;
|
||||
readonly panels: IGroupPanel[];
|
||||
readonly activePanel: IGroupPanel | undefined;
|
||||
readonly panels: IDockviewPanel[];
|
||||
readonly activePanel: IDockviewPanel | undefined;
|
||||
}
|
||||
|
||||
export type IGroupviewPanelPublic = IGroupviewPanel;
|
||||
@ -22,14 +22,14 @@ export type GroupviewPanelApi = GridviewPanelApi;
|
||||
|
||||
class GroupviewApi extends GridviewPanelApiImpl implements GroupviewPanelApi {}
|
||||
|
||||
export class GroupviewPanel extends GridviewPanel implements IGroupviewPanel {
|
||||
export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
|
||||
private readonly _model: Groupview;
|
||||
|
||||
get panels(): IGroupPanel[] {
|
||||
get panels(): IDockviewPanel[] {
|
||||
return this._model.panels;
|
||||
}
|
||||
|
||||
get activePanel(): IGroupPanel | undefined {
|
||||
get activePanel(): IDockviewPanel | undefined {
|
||||
return this._model.activePanel;
|
||||
}
|
||||
|
||||
|
@ -5,14 +5,14 @@ import {
|
||||
} from '../../lifecycle';
|
||||
import { Emitter, Event } from '../../events';
|
||||
import { trackFocus } from '../../dom';
|
||||
import { IGroupPanel } from '../groupPanel';
|
||||
import { IDockviewPanel } from '../groupPanel';
|
||||
|
||||
export interface IContentContainer extends IDisposable {
|
||||
onDidFocus: Event<void>;
|
||||
onDidBlur: Event<void>;
|
||||
element: HTMLElement;
|
||||
layout(width: number, height: number): void;
|
||||
openPanel: (panel: IGroupPanel) => void;
|
||||
openPanel: (panel: IDockviewPanel) => void;
|
||||
closePanel: () => void;
|
||||
show(): void;
|
||||
hide(): void;
|
||||
@ -23,7 +23,7 @@ export class ContentContainer
|
||||
implements IContentContainer
|
||||
{
|
||||
private _element: HTMLElement;
|
||||
private panel: IGroupPanel | undefined;
|
||||
private panel: IDockviewPanel | undefined;
|
||||
private disposable = new MutableDisposable();
|
||||
|
||||
private readonly _onDidFocus = new Emitter<void>();
|
||||
@ -59,7 +59,7 @@ export class ContentContainer
|
||||
this.element.style.display = 'none';
|
||||
}
|
||||
|
||||
public openPanel(panel: IGroupPanel) {
|
||||
public openPanel(panel: IDockviewPanel) {
|
||||
if (this.panel === panel) {
|
||||
return;
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ import {
|
||||
import { toggleClass } from '../dom';
|
||||
import { IDockviewComponent } from '../dockview/dockviewComponent';
|
||||
import { ITabRenderer } from './types';
|
||||
import { IGroupPanel } from './groupPanel';
|
||||
import { GroupviewPanel } from './groupviewPanel';
|
||||
import { IDockviewPanel } from './groupPanel';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { DroptargetEvent, Droptarget } from '../dnd/droptarget';
|
||||
import { DockviewDropTargets } from './dnd';
|
||||
import { DragHandler } from '../dnd/abstractDragHandler';
|
||||
@ -22,7 +22,7 @@ export enum MouseEventKind {
|
||||
export interface LayoutMouseEvent {
|
||||
readonly kind: MouseEventKind;
|
||||
readonly event: MouseEvent;
|
||||
readonly panel?: IGroupPanel;
|
||||
readonly panel?: IDockviewPanel;
|
||||
readonly tab?: boolean;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ export class Tab extends CompositeDisposable implements ITab {
|
||||
constructor(
|
||||
public readonly panelId: string,
|
||||
accessor: IDockviewComponent,
|
||||
private readonly group: GroupviewPanel
|
||||
private readonly group: GroupPanel
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -6,10 +6,10 @@ import {
|
||||
import { addDisposableListener, Emitter, Event } from '../../events';
|
||||
import { ITab, MouseEventKind, Tab } from '../tab';
|
||||
import { last } from '../../array';
|
||||
import { IGroupPanel } from '../groupPanel';
|
||||
import { IDockviewPanel } from '../groupPanel';
|
||||
import { IDockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { getPanelData } from '../../dnd/dataTransfer';
|
||||
import { GroupviewPanel } from '../groupviewPanel';
|
||||
import { GroupPanel } from '../groupviewPanel';
|
||||
import { Droptarget } from '../../dnd/droptarget';
|
||||
import { DockviewDropTargets } from '../dnd';
|
||||
|
||||
@ -28,10 +28,10 @@ export interface ITabsContainer extends IDisposable {
|
||||
at: (index: number) => ITab;
|
||||
onDrop: Event<TabDropIndexEvent>;
|
||||
setActive: (isGroupActive: boolean) => void;
|
||||
setActivePanel: (panel: IGroupPanel) => void;
|
||||
setActivePanel: (panel: IDockviewPanel) => void;
|
||||
isActive: (tab: ITab) => boolean;
|
||||
closePanel: (panel: IGroupPanel) => void;
|
||||
openPanel: (panel: IGroupPanel, index?: number) => void;
|
||||
closePanel: (panel: IDockviewPanel) => void;
|
||||
openPanel: (panel: IDockviewPanel, index?: number) => void;
|
||||
setActionElement(element: HTMLElement | undefined): void;
|
||||
hidden: boolean;
|
||||
show(): void;
|
||||
@ -52,7 +52,7 @@ export class TabsContainer
|
||||
private tabs: IValueDisposable<ITab>[] = [];
|
||||
private selectedIndex = -1;
|
||||
private active = false;
|
||||
private activePanel: IGroupPanel | undefined;
|
||||
private activePanel: IDockviewPanel | undefined;
|
||||
private actions: HTMLElement | undefined;
|
||||
|
||||
private _height: number | undefined;
|
||||
@ -141,7 +141,7 @@ export class TabsContainer
|
||||
|
||||
constructor(
|
||||
private accessor: IDockviewComponent,
|
||||
private group: GroupviewPanel,
|
||||
private group: GroupPanel,
|
||||
options: { tabHeight?: number }
|
||||
) {
|
||||
super();
|
||||
@ -244,14 +244,14 @@ export class TabsContainer
|
||||
value.element.remove();
|
||||
}
|
||||
|
||||
public setActivePanel(panel: IGroupPanel) {
|
||||
public setActivePanel(panel: IDockviewPanel) {
|
||||
this.tabs.forEach((tab) => {
|
||||
const isActivePanel = panel.id === tab.value.panelId;
|
||||
tab.value.setActive(isActivePanel);
|
||||
});
|
||||
}
|
||||
|
||||
public openPanel(panel: IGroupPanel, index: number = this.tabs.length) {
|
||||
public openPanel(panel: IDockviewPanel, index: number = this.tabs.length) {
|
||||
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
||||
return;
|
||||
}
|
||||
@ -294,7 +294,7 @@ export class TabsContainer
|
||||
this.activePanel = panel;
|
||||
}
|
||||
|
||||
public closePanel(panel: IGroupPanel) {
|
||||
public closePanel(panel: IDockviewPanel) {
|
||||
this.delete(panel.id);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { IDockviewComponent } from '../dockview/dockviewComponent';
|
||||
import { DockviewPanelApi } from '../api/groupPanelApi';
|
||||
import { PanelInitParameters, IPanel } from '../panel/types';
|
||||
import { DockviewApi } from '../api/component.api';
|
||||
import { GroupviewPanel } from './groupviewPanel';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { Event } from '../events';
|
||||
import { WrappedTab } from '../dockview/components/tab/defaultTab';
|
||||
|
||||
@ -34,13 +34,13 @@ export interface GroupPanelContentPartInitParameters
|
||||
export interface IWatermarkRenderer extends IPanel {
|
||||
readonly element: HTMLElement;
|
||||
init: (params: GroupPanelPartInitParameters) => void;
|
||||
updateParentGroup(group: GroupviewPanel, visible: boolean): void;
|
||||
updateParentGroup(group: GroupPanel, visible: boolean): void;
|
||||
}
|
||||
|
||||
export interface ITabRenderer extends IPanel {
|
||||
readonly element: HTMLElement;
|
||||
init(parameters: GroupPanelPartInitParameters): void;
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void;
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void;
|
||||
}
|
||||
|
||||
export interface IActionsRenderer extends IDisposable {
|
||||
@ -52,7 +52,7 @@ export interface IContentRenderer extends IPanel {
|
||||
readonly actions?: HTMLElement;
|
||||
readonly onDidFocus?: Event<void>;
|
||||
readonly onDidBlur?: Event<void>;
|
||||
updateParentGroup(group: GroupviewPanel, isPanelVisible: boolean): void;
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void;
|
||||
init(parameters: GroupPanelContentPartInitParameters): void;
|
||||
close?(): Promise<boolean>;
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
import { DockviewComponent } from '../dockview/dockviewComponent';
|
||||
import { GroupviewPanelState, IGroupPanel } from '../groupview/groupPanel';
|
||||
import { GroupviewPanelState, IDockviewPanel } from '../groupview/groupPanel';
|
||||
import { DockviewGroupPanel } from '../dockview/dockviewGroupPanel';
|
||||
import { IPanelDeserializer } from '../dockview/deserializer';
|
||||
import { createComponent } from '../panel/componentFactory';
|
||||
import { DockviewApi } from '../api/component.api';
|
||||
import { DefaultTab } from '../dockview/components/tab/defaultTab';
|
||||
import { DefaultGroupPanelView } from '../dockview/defaultGroupPanelView';
|
||||
import { GroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
|
||||
export class ReactPanelDeserialzier implements IPanelDeserializer {
|
||||
constructor(private readonly layout: DockviewComponent) {}
|
||||
|
||||
public fromJSON(
|
||||
panelData: GroupviewPanelState,
|
||||
group: GroupviewPanel
|
||||
): IGroupPanel {
|
||||
group: GroupPanel
|
||||
): IDockviewPanel {
|
||||
const panelId = panelData.id;
|
||||
const params = panelData.params;
|
||||
const title = panelData.title;
|
||||
|
@ -8,7 +8,7 @@ import { IDockviewPanelProps } from '../dockview/dockview';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { DockviewPanelApi } from '../../api/groupPanelApi';
|
||||
import { DockviewApi } from '../../api/component.api';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { Emitter, Event } from '../../events';
|
||||
import { WrappedTab } from '../../dockview/components/tab/defaultTab';
|
||||
|
||||
@ -30,7 +30,7 @@ export class ReactPanelContentPart implements IContentRenderer {
|
||||
//
|
||||
private _actionsElement: HTMLElement;
|
||||
private actionsPart?: ReactPart<any>;
|
||||
private _group: GroupviewPanel | undefined;
|
||||
private _group: GroupPanel | undefined;
|
||||
|
||||
private readonly _onDidFocus = new Emitter<void>();
|
||||
readonly onDidFocus: Event<void> = this._onDidFocus.event;
|
||||
@ -94,7 +94,7 @@ export class ReactPanelContentPart implements IContentRenderer {
|
||||
}
|
||||
|
||||
public updateParentGroup(
|
||||
group: GroupviewPanel,
|
||||
group: GroupPanel,
|
||||
_isPanelVisible: boolean
|
||||
): void {
|
||||
this._group = group;
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
ITabRenderer,
|
||||
GroupPanelPartInitParameters,
|
||||
} from '../../groupview/types';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import { IGroupPanelBaseProps } from './dockview';
|
||||
@ -57,7 +57,7 @@ export class ReactPanelHeaderPart implements ITabRenderer {
|
||||
}
|
||||
|
||||
public updateParentGroup(
|
||||
_group: GroupviewPanel,
|
||||
_group: GroupPanel,
|
||||
_isPanelVisible: boolean
|
||||
): void {
|
||||
// noop - retrieval from api
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
GroupPanelPartInitParameters,
|
||||
IWatermarkRenderer,
|
||||
} from '../../groupview/types';
|
||||
import { GroupviewPanel } from '../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import { IGroupPanelBaseProps } from './dockview';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
@ -15,7 +15,7 @@ export interface IWatermarkPanelProps extends IGroupPanelBaseProps {
|
||||
export class ReactWatermarkPart implements IWatermarkRenderer {
|
||||
private _element: HTMLElement;
|
||||
private part?: ReactPart<IWatermarkPanelProps>;
|
||||
private _groupRef: { value: GroupviewPanel | undefined } = {
|
||||
private _groupRef: { value: GroupPanel | undefined } = {
|
||||
value: undefined,
|
||||
};
|
||||
private parameters: GroupPanelPartInitParameters | undefined;
|
||||
@ -77,7 +77,7 @@ export class ReactWatermarkPart implements IWatermarkRenderer {
|
||||
// noop - retrieval from api
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupviewPanel, _isPanelVisible: boolean): void {
|
||||
updateParentGroup(group: GroupPanel, _isPanelVisible: boolean): void {
|
||||
// noop - retrieval from api
|
||||
this._groupRef.value = group;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import {
|
||||
GroupPanelPartInitParameters,
|
||||
IContentRenderer,
|
||||
} from '../../../groupview/types';
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { HostedContainer } from '../../../hostedContainer';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { ReactPart, ReactPortalStore } from '../../react';
|
||||
@ -13,7 +13,7 @@ export class ReactContentRenderer implements IContentRenderer {
|
||||
|
||||
private _element: HTMLElement;
|
||||
private part?: ReactPart<IDockviewPanelProps>;
|
||||
private _group: GroupviewPanel | undefined;
|
||||
private _group: GroupPanel | undefined;
|
||||
|
||||
private parameters: GroupPanelPartInitParameters | undefined;
|
||||
|
||||
@ -89,7 +89,7 @@ export class ReactContentRenderer implements IContentRenderer {
|
||||
}
|
||||
|
||||
public updateParentGroup(
|
||||
group: GroupviewPanel,
|
||||
group: GroupPanel,
|
||||
_isPanelVisible: boolean
|
||||
): void {
|
||||
this._group = group;
|
||||
|
@ -2,7 +2,7 @@ import {
|
||||
GroupPanelPartInitParameters,
|
||||
IContentRenderer,
|
||||
} from '../../../groupview/types';
|
||||
import { GroupviewPanel } from '../../../groupview/groupviewPanel';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { HostedContainer } from '../../../hostedContainer';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
|
||||
@ -43,7 +43,7 @@ export class WebviewContentRenderer implements IContentRenderer {
|
||||
}
|
||||
|
||||
public updateParentGroup(
|
||||
_group: GroupviewPanel,
|
||||
_group: GroupPanel,
|
||||
_isPanelVisible: boolean
|
||||
): void {
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user