mirror of
https://github.com/mathuo/dockview
synced 2025-02-16 05:15:45 +00:00
refactor: renaming files
This commit is contained in:
parent
8528f8d70f
commit
c3e2ed1a87
@ -1,5 +1,5 @@
|
||||
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
import {
|
||||
GroupPanelPartInitParameters,
|
||||
GroupPanelUpdateEvent,
|
||||
@ -29,7 +29,10 @@ export class DockviewPanelModelMock implements IDockviewPanelModel {
|
||||
//
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(
|
||||
group: DockviewGroupPanel,
|
||||
isPanelVisible: boolean
|
||||
): void {
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DockviewPanelApiImpl, TitleEvent } from '../../api/dockviewPanelApi';
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { DockviewPanel, IDockviewPanel } from '../../dockview/dockviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
|
||||
describe('groupPanelApi', () => {
|
||||
test('title', () => {
|
||||
@ -10,7 +10,7 @@ describe('groupPanelApi', () => {
|
||||
update: jest.fn(),
|
||||
} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
|
||||
@ -37,7 +37,7 @@ describe('groupPanelApi', () => {
|
||||
onDidRemovePanel: jest.fn(),
|
||||
options: {},
|
||||
};
|
||||
const groupViewPanel = new GroupPanel(
|
||||
const groupViewPanel = new DockviewGroupPanel(
|
||||
<DockviewComponent>accessor,
|
||||
'',
|
||||
{}
|
||||
@ -45,7 +45,7 @@ describe('groupPanelApi', () => {
|
||||
|
||||
const cut = new DockviewPanelApiImpl(
|
||||
<IDockviewPanel>groupPanel,
|
||||
<GroupPanel>groupViewPanel
|
||||
<DockviewGroupPanel>groupViewPanel
|
||||
);
|
||||
|
||||
let events = 0;
|
||||
@ -57,7 +57,7 @@ describe('groupPanelApi', () => {
|
||||
expect(events).toBe(0);
|
||||
expect(cut.group).toBe(groupViewPanel);
|
||||
|
||||
const groupViewPanel2 = new GroupPanel(
|
||||
const groupViewPanel2 = new DockviewGroupPanel(
|
||||
<DockviewComponent>accessor,
|
||||
'',
|
||||
{}
|
||||
|
@ -6,7 +6,6 @@ import {
|
||||
} from '../../groupview/types';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { Orientation } from '../../splitview/core/splitview';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { CompositeDisposable } from '../../lifecycle';
|
||||
import {
|
||||
GroupPanelUpdateEvent,
|
||||
@ -23,6 +22,7 @@ import { DefaultDockviewDeserialzier } from '../../dockview/deserializer';
|
||||
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
|
||||
import { DockviewPanelModelMock } from '../__mocks__/mockDockviewPanelMode';
|
||||
import { DefaultTab } from '../../dockview/components/tab/defaultTab';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
|
||||
class PanelContentPartTest implements IContentRenderer {
|
||||
element: HTMLElement = document.createElement('div');
|
||||
@ -36,10 +36,6 @@ class PanelContentPartTest implements IContentRenderer {
|
||||
this.element.classList.add(`testpanel-${id}`);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
init(parameters: GroupPanelPartInitParameters): void {
|
||||
//noop
|
||||
}
|
||||
@ -78,10 +74,6 @@ class PanelTabPartTest implements ITabRenderer {
|
||||
this.element.className = `panel-tab-part-${id}`;
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
init(parameters: GroupPanelPartInitParameters): void {
|
||||
//noop
|
||||
}
|
||||
@ -105,7 +97,7 @@ class PanelTabPartTest implements ITabRenderer {
|
||||
}
|
||||
|
||||
class TestGroupPanel implements IDockviewPanel {
|
||||
private _group: GroupPanel | undefined;
|
||||
private _group: DockviewGroupPanel | undefined;
|
||||
|
||||
readonly api: DockviewPanelApi;
|
||||
readonly view: IDockviewPanelModel;
|
||||
@ -116,7 +108,7 @@ class TestGroupPanel implements IDockviewPanel {
|
||||
accessor: DockviewComponent
|
||||
) {
|
||||
this.api = new DockviewPanelApiImpl(this, this._group!);
|
||||
this._group = new GroupPanel(accessor, id, {});
|
||||
this._group = new DockviewGroupPanel(accessor, id, {});
|
||||
this.view = new DockviewPanelModelMock(
|
||||
'component',
|
||||
new PanelContentPartTest(id, 'component'),
|
||||
@ -128,11 +120,11 @@ class TestGroupPanel implements IDockviewPanel {
|
||||
get params(): Record<string, any> {
|
||||
return {};
|
||||
}
|
||||
get group(): GroupPanel {
|
||||
get group(): DockviewGroupPanel {
|
||||
return this._group!;
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void {
|
||||
updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void {
|
||||
this._group = group;
|
||||
}
|
||||
|
||||
@ -838,7 +830,7 @@ describe('dockviewComponent', () => {
|
||||
|
||||
let events: {
|
||||
panel?: IDockviewPanel;
|
||||
group?: GroupPanel | undefined;
|
||||
group?: DockviewGroupPanel | undefined;
|
||||
type: string;
|
||||
}[] = [];
|
||||
|
||||
@ -1028,7 +1020,7 @@ describe('dockviewComponent', () => {
|
||||
position: { referencePanel: 'panel2', direction: 'below' },
|
||||
});
|
||||
|
||||
const removedGroups: GroupPanel[] = [];
|
||||
const removedGroups: DockviewGroupPanel[] = [];
|
||||
const removedPanels: IDockviewPanel[] = [];
|
||||
|
||||
const disposable = new CompositeDisposable(
|
||||
@ -1481,9 +1473,9 @@ describe('dockviewComponent', () => {
|
||||
|
||||
dockview.layout(1000, 1000);
|
||||
|
||||
let addGroup: GroupPanel[] = [];
|
||||
let removeGroup: GroupPanel[] = [];
|
||||
let activeGroup: (GroupPanel | undefined)[] = [];
|
||||
let addGroup: DockviewGroupPanel[] = [];
|
||||
let removeGroup: DockviewGroupPanel[] = [];
|
||||
let activeGroup: (DockviewGroupPanel | undefined)[] = [];
|
||||
let addPanel: IDockviewPanel[] = [];
|
||||
let removePanel: IDockviewPanel[] = [];
|
||||
let activePanel: (IDockviewPanel | undefined)[] = [];
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { DockviewApi } from '../../api/component.api';
|
||||
import { DockviewPanel } from '../../dockview/dockviewPanel';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
|
||||
describe('dockviewPanel', () => {
|
||||
test('update title', () => {
|
||||
@ -14,7 +14,7 @@ describe('dockviewPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
|
||||
@ -57,7 +57,7 @@ describe('dockviewPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
|
||||
@ -89,7 +89,7 @@ describe('dockviewPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
|
||||
@ -121,7 +121,7 @@ describe('dockviewPanel', () => {
|
||||
const accessorMock = jest.fn<DockviewComponent, []>(() => {
|
||||
return {} as any;
|
||||
});
|
||||
const groupMock = jest.fn<GroupPanel, []>(() => {
|
||||
const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
|
||||
return {
|
||||
api: {
|
||||
setSize: jest.fn(),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
|
||||
describe('gridviewPanel', () => {
|
||||
test('get panel', () => {
|
||||
@ -13,7 +13,7 @@ describe('gridviewPanel', () => {
|
||||
|
||||
const accessor = new accessorMock();
|
||||
|
||||
const cut = new GroupPanel(accessor, 'id', {});
|
||||
const cut = new DockviewGroupPanel(accessor, 'id', {});
|
||||
|
||||
expect(cut.params).toEqual(undefined);
|
||||
|
||||
|
@ -11,8 +11,10 @@ import {
|
||||
IWatermarkRenderer,
|
||||
} from '../../groupview/types';
|
||||
import { PanelUpdateEvent } from '../../panel/types';
|
||||
import { GroupOptions, Groupview } from '../../groupview/groupview';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import {
|
||||
DockviewGroupPanelModel,
|
||||
GroupOptions,
|
||||
} from '../../groupview/dockviewGroupPanelModel';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer';
|
||||
import { CompositeDisposable } from '../../lifecycle';
|
||||
@ -22,6 +24,7 @@ import {
|
||||
IDockviewPanelModel,
|
||||
DockviewPanelModel,
|
||||
} from '../../dockview/dockviewPanelModel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
|
||||
enum GroupChangeKind2 {
|
||||
ADD_PANEL,
|
||||
@ -52,7 +55,10 @@ class TestModel implements IDockviewPanelModel {
|
||||
//
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(
|
||||
group: DockviewGroupPanel,
|
||||
isPanelVisible: boolean
|
||||
): void {
|
||||
//
|
||||
}
|
||||
|
||||
@ -120,10 +126,6 @@ class TestContentPart implements IContentRenderer {
|
||||
//void
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
//noop
|
||||
}
|
||||
|
||||
focus() {
|
||||
//noop
|
||||
}
|
||||
@ -155,10 +157,6 @@ class TestHeaderPart implements ITabRenderer {
|
||||
//void
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
//noop
|
||||
}
|
||||
|
||||
focus() {
|
||||
//noop
|
||||
}
|
||||
@ -173,7 +171,7 @@ class TestHeaderPart implements ITabRenderer {
|
||||
}
|
||||
|
||||
export class TestPanel implements IDockviewPanel {
|
||||
private _group: GroupPanel | undefined;
|
||||
private _group: DockviewGroupPanel | undefined;
|
||||
private _params: IGroupPanelInitParameters;
|
||||
readonly view: IDockviewPanelModel;
|
||||
|
||||
@ -201,8 +199,8 @@ export class TestPanel implements IDockviewPanel {
|
||||
this._params = params;
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean) {
|
||||
this._group = group;
|
||||
updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void {
|
||||
//
|
||||
}
|
||||
|
||||
layout(width: number, height: number) {
|
||||
@ -230,7 +228,7 @@ export class TestPanel implements IDockviewPanel {
|
||||
}
|
||||
|
||||
describe('groupview', () => {
|
||||
let groupview: GroupPanel;
|
||||
let groupview: DockviewGroupPanel;
|
||||
let dockview: DockviewComponent;
|
||||
let options: GroupOptions;
|
||||
|
||||
@ -255,7 +253,7 @@ describe('groupview', () => {
|
||||
options = {
|
||||
tabHeight: 30,
|
||||
};
|
||||
groupview = new GroupPanel(dockview, 'groupview-1', options);
|
||||
groupview = new DockviewGroupPanel(dockview, 'groupview-1', options);
|
||||
groupview.initialize();
|
||||
});
|
||||
|
||||
@ -264,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 GroupPanel(dockview, 'groupview-2', {
|
||||
const groupview2 = new DockviewGroupPanel(dockview, 'groupview-2', {
|
||||
tabHeight: 25,
|
||||
panels: [panel1, panel2, panel3],
|
||||
activePanel: panel2,
|
||||
@ -518,7 +516,7 @@ describe('groupview', () => {
|
||||
}
|
||||
);
|
||||
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
document.createElement('div'),
|
||||
dockviewComponent,
|
||||
'id',
|
||||
@ -543,7 +541,7 @@ describe('groupview', () => {
|
||||
}
|
||||
);
|
||||
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
document.createElement('div'),
|
||||
dockviewComponent,
|
||||
'id',
|
||||
@ -574,7 +572,7 @@ describe('groupview', () => {
|
||||
);
|
||||
|
||||
const groupviewContainer = document.createElement('div');
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
groupviewContainer,
|
||||
dockviewComponent,
|
||||
'id',
|
||||
@ -621,28 +619,32 @@ describe('groupview', () => {
|
||||
};
|
||||
});
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
};
|
||||
});
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const container = document.createElement('div');
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
container,
|
||||
accessor,
|
||||
'groupviewid',
|
||||
{},
|
||||
new groupPanelMock() as GroupPanel
|
||||
new groupPanelMock() as DockviewGroupPanel
|
||||
);
|
||||
|
||||
const element = container
|
||||
@ -678,15 +680,17 @@ describe('groupview', () => {
|
||||
};
|
||||
});
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -694,12 +698,12 @@ describe('groupview', () => {
|
||||
});
|
||||
|
||||
const container = document.createElement('div');
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
container,
|
||||
accessor,
|
||||
'groupviewid',
|
||||
{},
|
||||
new groupPanelMock() as GroupPanel
|
||||
new groupPanelMock() as DockviewGroupPanel
|
||||
);
|
||||
|
||||
cut.openPanel(new TestPanel('panel1', jest.fn() as any));
|
||||
@ -742,15 +746,17 @@ describe('groupview', () => {
|
||||
};
|
||||
});
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -758,12 +764,12 @@ describe('groupview', () => {
|
||||
});
|
||||
|
||||
const container = document.createElement('div');
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
container,
|
||||
accessor,
|
||||
'groupviewid',
|
||||
{},
|
||||
new groupPanelMock() as GroupPanel
|
||||
new groupPanelMock() as DockviewGroupPanel
|
||||
);
|
||||
|
||||
cut.openPanel(new TestPanel('panel1', jest.fn() as any));
|
||||
@ -807,15 +813,17 @@ describe('groupview', () => {
|
||||
};
|
||||
});
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -823,12 +831,12 @@ describe('groupview', () => {
|
||||
});
|
||||
|
||||
const container = document.createElement('div');
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
container,
|
||||
accessor,
|
||||
'groupviewid',
|
||||
{},
|
||||
new groupPanelMock() as GroupPanel
|
||||
new groupPanelMock() as DockviewGroupPanel
|
||||
);
|
||||
|
||||
cut.openPanel(new TestPanel('panel1', jest.fn() as any));
|
||||
@ -859,15 +867,17 @@ describe('groupview', () => {
|
||||
});
|
||||
|
||||
test('that watermark is added', () => {
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -876,12 +886,12 @@ describe('groupview', () => {
|
||||
|
||||
const container = document.createElement('div');
|
||||
|
||||
const cut = new Groupview(
|
||||
const cut = new DockviewGroupPanelModel(
|
||||
container,
|
||||
dockview,
|
||||
'groupviewid',
|
||||
{},
|
||||
new groupPanelMock() as GroupPanel
|
||||
new groupPanelMock() as DockviewGroupPanel
|
||||
);
|
||||
|
||||
cut.initialize();
|
@ -7,7 +7,6 @@ import {
|
||||
} from '../../../groupview/types';
|
||||
import { CompositeDisposable } from '../../../lifecycle';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { IDockviewPanel } from '../../../dockview/dockviewPanel';
|
||||
import { IDockviewPanelModel } from '../../../dockview/dockviewPanelModel';
|
||||
|
||||
@ -27,10 +26,6 @@ class TestContentRenderer
|
||||
this.element = document.createElement('div');
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
//
|
||||
}
|
||||
|
||||
init(parameters: GroupPanelContentPartInitParameters): void {
|
||||
//
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer';
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { Groupview } from '../../groupview/groupview';
|
||||
import { GroupPanel } from '../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
|
||||
import { DockviewGroupPanelModel } from '../../groupview/dockviewGroupPanelModel';
|
||||
import { Tab } from '../../groupview/tab';
|
||||
|
||||
describe('tab', () => {
|
||||
@ -34,15 +34,17 @@ describe('tab', () => {
|
||||
id: 'testcomponentid',
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -50,7 +52,7 @@ describe('tab', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new Tab('panelId', accessor, groupPanel);
|
||||
|
||||
@ -77,15 +79,17 @@ describe('tab', () => {
|
||||
id: 'testcomponentid',
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -93,7 +97,7 @@ describe('tab', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new Tab('panel1', accessor, groupPanel);
|
||||
|
||||
@ -125,15 +129,17 @@ describe('tab', () => {
|
||||
id: 'testcomponentid',
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -141,7 +147,7 @@ describe('tab', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new Tab('panel1', accessor, groupPanel);
|
||||
|
||||
@ -173,15 +179,17 @@ describe('tab', () => {
|
||||
id: 'testcomponentid',
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -189,7 +197,7 @@ describe('tab', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new Tab('panel1', accessor, groupPanel);
|
||||
|
||||
@ -227,15 +235,17 @@ describe('tab', () => {
|
||||
id: 'testcomponentid',
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -243,7 +253,7 @@ describe('tab', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new Tab('panel1', accessor, groupPanel);
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { DockviewComponent } from '../../../dockview/dockviewComponent';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { TabsContainer } from '../../../groupview/titlebar/tabsContainer';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { Groupview } from '../../../groupview/groupview';
|
||||
import {
|
||||
LocalSelectionTransfer,
|
||||
PanelTransfer,
|
||||
} from '../../../dnd/dataTransfer';
|
||||
import { TestPanel } from '../groupview.spec';
|
||||
import { TestPanel } from '../dockviewGroupPanelModel.spec';
|
||||
import { DockviewGroupPanelModel } from '../../../groupview/dockviewGroupPanelModel';
|
||||
import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
|
||||
|
||||
describe('tabsContainer', () => {
|
||||
test('that an external event does not render a drop target and calls through to the group mode', () => {
|
||||
@ -18,22 +18,24 @@ describe('tabsContainer', () => {
|
||||
options: {},
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
model: groupView,
|
||||
};
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new TabsContainer(accessor, groupPanel);
|
||||
|
||||
@ -71,15 +73,17 @@ describe('tabsContainer', () => {
|
||||
options: {},
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -88,7 +92,7 @@ describe('tabsContainer', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new TabsContainer(accessor, groupPanel);
|
||||
|
||||
@ -137,15 +141,17 @@ describe('tabsContainer', () => {
|
||||
options: {},
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -154,7 +160,7 @@ describe('tabsContainer', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new TabsContainer(accessor, groupPanel);
|
||||
|
||||
@ -200,15 +206,17 @@ describe('tabsContainer', () => {
|
||||
options: {},
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -217,7 +225,7 @@ describe('tabsContainer', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new TabsContainer(accessor, groupPanel);
|
||||
|
||||
@ -263,15 +271,17 @@ describe('tabsContainer', () => {
|
||||
options: {},
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
});
|
||||
const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
|
||||
() => {
|
||||
return {
|
||||
canDisplayOverlay: jest.fn(),
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const groupView = new groupviewMock() as Groupview;
|
||||
const groupView = new groupviewMock() as DockviewGroupPanelModel;
|
||||
|
||||
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => {
|
||||
const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
|
||||
return {
|
||||
id: 'testgroupid',
|
||||
model: groupView,
|
||||
@ -279,7 +289,7 @@ describe('tabsContainer', () => {
|
||||
});
|
||||
|
||||
const accessor = new accessorMock() as DockviewComponent;
|
||||
const groupPanel = new groupPanelMock() as GroupPanel;
|
||||
const groupPanel = new groupPanelMock() as DockviewGroupPanel;
|
||||
|
||||
const cut = new TabsContainer(accessor, groupPanel);
|
||||
|
||||
|
@ -30,7 +30,10 @@ import {
|
||||
} from '../splitview/splitviewComponent';
|
||||
import { IView, Orientation, Sizing } from '../splitview/core/splitview';
|
||||
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
||||
import { GroupPanel, IGroupviewPanel } from '../groupview/groupviewPanel';
|
||||
import {
|
||||
DockviewGroupPanel,
|
||||
IDockviewGroupPanel,
|
||||
} from '../groupview/dockviewGroupPanel';
|
||||
import { Emitter, Event } from '../events';
|
||||
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
||||
import { PaneviewDropEvent } from '../paneview/draggablePaneviewPanel';
|
||||
@ -362,15 +365,15 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.totalPanels;
|
||||
}
|
||||
|
||||
get onDidActiveGroupChange(): Event<GroupPanel | undefined> {
|
||||
get onDidActiveGroupChange(): Event<DockviewGroupPanel | undefined> {
|
||||
return this.component.onDidActiveGroupChange;
|
||||
}
|
||||
|
||||
get onDidAddGroup(): Event<GroupPanel> {
|
||||
get onDidAddGroup(): Event<DockviewGroupPanel> {
|
||||
return this.component.onDidAddGroup;
|
||||
}
|
||||
|
||||
get onDidRemoveGroup(): Event<GroupPanel> {
|
||||
get onDidRemoveGroup(): Event<DockviewGroupPanel> {
|
||||
return this.component.onDidRemoveGroup;
|
||||
}
|
||||
|
||||
@ -402,7 +405,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.panels;
|
||||
}
|
||||
|
||||
get groups(): GroupPanel[] {
|
||||
get groups(): DockviewGroupPanel[] {
|
||||
return this.component.groups;
|
||||
}
|
||||
|
||||
@ -410,7 +413,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.activePanel;
|
||||
}
|
||||
|
||||
get activeGroup(): GroupPanel | undefined {
|
||||
get activeGroup(): DockviewGroupPanel | undefined {
|
||||
return this.component.activeGroup;
|
||||
}
|
||||
|
||||
@ -440,7 +443,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.addPanel(options);
|
||||
}
|
||||
|
||||
addGroup(options?: AddGroupOptions): IGroupviewPanel {
|
||||
addGroup(options?: AddGroupOptions): IDockviewGroupPanel {
|
||||
return this.component.addGroup(options);
|
||||
}
|
||||
|
||||
@ -456,11 +459,11 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
|
||||
return this.component.closeAllGroups();
|
||||
}
|
||||
|
||||
removeGroup(group: IGroupviewPanel): void {
|
||||
this.component.removeGroup(<GroupPanel>group);
|
||||
removeGroup(group: IDockviewGroupPanel): void {
|
||||
this.component.removeGroup(<DockviewGroupPanel>group);
|
||||
}
|
||||
|
||||
getGroup(id: string): GroupPanel | undefined {
|
||||
getGroup(id: string): DockviewGroupPanel | undefined {
|
||||
return this.component.getPanel(id);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Emitter, Event } from '../events';
|
||||
import { GridviewPanelApiImpl, GridviewPanelApi } from './gridviewPanelApi';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
|
||||
import { MutableDisposable } from '../lifecycle';
|
||||
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
||||
|
||||
@ -13,7 +13,7 @@ export interface TitleEvent {
|
||||
* because it belongs to a groupview
|
||||
*/
|
||||
export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible'> {
|
||||
readonly group: GroupPanel;
|
||||
readonly group: DockviewGroupPanel;
|
||||
readonly isGroupActive: boolean;
|
||||
readonly title: string;
|
||||
readonly onDidActiveGroupChange: Event<void>;
|
||||
@ -26,7 +26,7 @@ export class DockviewPanelApiImpl
|
||||
extends GridviewPanelApiImpl
|
||||
implements DockviewPanelApi
|
||||
{
|
||||
private _group: GroupPanel;
|
||||
private _group: DockviewGroupPanel;
|
||||
|
||||
readonly _onDidTitleChange = new Emitter<TitleEvent>();
|
||||
readonly onDidTitleChange = this._onDidTitleChange.event;
|
||||
@ -47,7 +47,7 @@ export class DockviewPanelApiImpl
|
||||
return !!this.group?.isActive;
|
||||
}
|
||||
|
||||
set group(value: GroupPanel) {
|
||||
set group(value: DockviewGroupPanel) {
|
||||
const isOldGroupActive = this.isGroupActive;
|
||||
|
||||
this._group = value;
|
||||
@ -65,11 +65,11 @@ export class DockviewPanelApiImpl
|
||||
}
|
||||
}
|
||||
|
||||
get group(): GroupPanel {
|
||||
get group(): DockviewGroupPanel {
|
||||
return this._group;
|
||||
}
|
||||
|
||||
constructor(private panel: IDockviewPanel, group: GroupPanel) {
|
||||
constructor(private panel: IDockviewPanel, group: DockviewGroupPanel) {
|
||||
super(panel.id);
|
||||
|
||||
this.initialize(panel);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
|
||||
import { IDisposable } from '../lifecycle';
|
||||
import { DragHandler } from './abstractDragHandler';
|
||||
import { LocalSelectionTransfer, PanelTransfer } from './dataTransfer';
|
||||
@ -11,7 +11,7 @@ export class GroupDragHandler extends DragHandler {
|
||||
constructor(
|
||||
element: HTMLElement,
|
||||
private readonly accessorId: string,
|
||||
private readonly group: GroupPanel
|
||||
private readonly group: DockviewGroupPanel
|
||||
) {
|
||||
super(element);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
} from '../../../groupview/types';
|
||||
import { addDisposableListener } from '../../../events';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
|
||||
import { createCloseButton } from '../../../svg';
|
||||
|
||||
export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
||||
@ -77,7 +77,10 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
||||
});
|
||||
}
|
||||
|
||||
public updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
|
||||
public updateParentGroup(
|
||||
group: DockviewGroupPanel,
|
||||
isPanelVisible: boolean
|
||||
) {
|
||||
const changed =
|
||||
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 { GroupPanel } from '../../../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
|
||||
import { PanelUpdateEvent } from '../../../panel/types';
|
||||
import { createCloseButton } from '../../../svg';
|
||||
|
||||
@ -15,7 +15,7 @@ export class Watermark
|
||||
implements IWatermarkRenderer
|
||||
{
|
||||
private _element: HTMLElement;
|
||||
private group: GroupPanel | undefined;
|
||||
private group: DockviewGroupPanel | undefined;
|
||||
private params: GroupPanelPartInitParameters | undefined;
|
||||
|
||||
get element() {
|
||||
@ -83,7 +83,7 @@ export class Watermark
|
||||
this.render();
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, _visible: boolean): void {
|
||||
updateParentGroup(group: DockviewGroupPanel, _visible: boolean): void {
|
||||
this.group = group;
|
||||
this.render();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { GroupviewPanelState, ITabRenderer } from '../groupview/types';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
|
||||
import { DockviewPanel, IDockviewPanel } from './dockviewPanel';
|
||||
import { IDockviewComponent } from './dockviewComponent';
|
||||
import { createComponent } from '../panel/componentFactory';
|
||||
@ -8,7 +8,10 @@ import { DockviewPanelModel } from './dockviewPanelModel';
|
||||
import { DockviewApi } from '../api/component.api';
|
||||
|
||||
export interface IPanelDeserializer {
|
||||
fromJSON(panelData: GroupviewPanelState, group: GroupPanel): IDockviewPanel;
|
||||
fromJSON(
|
||||
panelData: GroupviewPanelState,
|
||||
group: DockviewGroupPanel
|
||||
): IDockviewPanel;
|
||||
}
|
||||
|
||||
export class DefaultDockviewDeserialzier implements IPanelDeserializer {
|
||||
@ -16,7 +19,7 @@ export class DefaultDockviewDeserialzier implements IPanelDeserializer {
|
||||
|
||||
public fromJSON(
|
||||
panelData: GroupviewPanelState,
|
||||
group: GroupPanel
|
||||
group: DockviewGroupPanel
|
||||
): IDockviewPanel {
|
||||
const panelId = panelData.id;
|
||||
const params = panelData.params;
|
||||
|
@ -42,8 +42,11 @@ import {
|
||||
GroupOptions,
|
||||
GroupPanelViewState,
|
||||
GroupviewDropEvent,
|
||||
} from '../groupview/groupview';
|
||||
import { GroupPanel, IGroupviewPanel } from '../groupview/groupviewPanel';
|
||||
} from '../groupview/dockviewGroupPanelModel';
|
||||
import {
|
||||
DockviewGroupPanel,
|
||||
IDockviewGroupPanel,
|
||||
} from '../groupview/dockviewGroupPanel';
|
||||
import { DockviewPanelModel } from './dockviewPanelModel';
|
||||
import { getPanelData } from '../dnd/dataTransfer';
|
||||
import { DockviewDropTargets } from '../groupview/dnd';
|
||||
@ -80,10 +83,10 @@ export type DockviewComponentUpdateOptions = Pick<
|
||||
|
||||
export interface DockviewDropEvent extends GroupviewDropEvent {
|
||||
api: DockviewApi;
|
||||
group: GroupPanel | null;
|
||||
group: DockviewGroupPanel | null;
|
||||
}
|
||||
|
||||
export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
|
||||
export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
||||
readonly activePanel: IDockviewPanel | undefined;
|
||||
readonly totalPanels: number;
|
||||
readonly panels: IDockviewPanel[];
|
||||
@ -93,21 +96,21 @@ export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
|
||||
deserializer: IPanelDeserializer | undefined;
|
||||
updateOptions(options: DockviewComponentUpdateOptions): void;
|
||||
moveGroupOrPanel(
|
||||
referenceGroup: GroupPanel,
|
||||
referenceGroup: DockviewGroupPanel,
|
||||
groupId: string,
|
||||
itemId: string,
|
||||
target: Position,
|
||||
index?: number
|
||||
): void;
|
||||
doSetGroupActive: (group: GroupPanel, skipFocus?: boolean) => void;
|
||||
removeGroup: (group: GroupPanel) => void;
|
||||
doSetGroupActive: (group: DockviewGroupPanel, skipFocus?: boolean) => void;
|
||||
removeGroup: (group: DockviewGroupPanel) => void;
|
||||
options: DockviewComponentOptions;
|
||||
addPanel(options: AddPanelOptions): IDockviewPanel;
|
||||
removePanel(panel: IDockviewPanel): void;
|
||||
getGroupPanel: (id: string) => IDockviewPanel | undefined;
|
||||
createWatermarkComponent(): IWatermarkRenderer;
|
||||
// lifecycle
|
||||
addGroup(options?: AddGroupOptions): IGroupviewPanel;
|
||||
addGroup(options?: AddGroupOptions): IDockviewGroupPanel;
|
||||
closeAllGroups(): void;
|
||||
// events
|
||||
moveToNext(options?: MovementOptions): void;
|
||||
@ -124,7 +127,7 @@ export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
|
||||
}
|
||||
|
||||
export class DockviewComponent
|
||||
extends BaseGrid<GroupPanel>
|
||||
extends BaseGrid<DockviewGroupPanel>
|
||||
implements IDockviewComponent
|
||||
{
|
||||
private readonly nextGroupId = sequentialNumberGenerator();
|
||||
@ -301,7 +304,7 @@ export class DockviewComponent
|
||||
this.updateWatermark();
|
||||
}
|
||||
|
||||
private orthogonalize(position: Position): GroupPanel {
|
||||
private orthogonalize(position: Position): DockviewGroupPanel {
|
||||
switch (position) {
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
@ -381,7 +384,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
const location = getGridLocation(options.group.element);
|
||||
const next = <GroupPanel>this.gridview.next(location)?.view;
|
||||
const next = <DockviewGroupPanel>this.gridview.next(location)?.view;
|
||||
this.doSetGroupActive(next);
|
||||
}
|
||||
|
||||
@ -403,7 +406,7 @@ export class DockviewComponent
|
||||
const location = getGridLocation(options.group.element);
|
||||
const next = this.gridview.previous(location)?.view;
|
||||
if (next) {
|
||||
this.doSetGroupActive(next as GroupPanel);
|
||||
this.doSetGroupActive(next as DockviewGroupPanel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,7 +535,7 @@ export class DockviewComponent
|
||||
throw new Error(`panel with id ${options.id} already exists`);
|
||||
}
|
||||
|
||||
let referenceGroup: GroupPanel | undefined;
|
||||
let referenceGroup: DockviewGroupPanel | undefined;
|
||||
|
||||
if (options.position) {
|
||||
if (isPanelOptionsWithPanel(options.position)) {
|
||||
@ -665,11 +668,11 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
addGroup(options?: AddGroupOptions): GroupPanel {
|
||||
addGroup(options?: AddGroupOptions): DockviewGroupPanel {
|
||||
const group = this.createGroup();
|
||||
|
||||
if (options) {
|
||||
let referenceGroup: GroupPanel | undefined;
|
||||
let referenceGroup: DockviewGroupPanel | undefined;
|
||||
|
||||
if (isGroupOptionsWithPanel(options)) {
|
||||
const referencePanel =
|
||||
@ -726,7 +729,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
removeGroup(group: GroupPanel, skipActive = false): void {
|
||||
removeGroup(group: DockviewGroupPanel, skipActive = false): void {
|
||||
const panels = [...group.panels]; // reassign since group panels will mutate
|
||||
|
||||
for (const panel of panels) {
|
||||
@ -740,7 +743,7 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
moveGroupOrPanel(
|
||||
referenceGroup: GroupPanel,
|
||||
referenceGroup: DockviewGroupPanel,
|
||||
groupId: string,
|
||||
itemId: string | undefined,
|
||||
target: Position,
|
||||
@ -831,8 +834,8 @@ export class DockviewComponent
|
||||
}
|
||||
|
||||
private moveGroup(
|
||||
sourceGroup: GroupPanel,
|
||||
referenceGroup: GroupPanel,
|
||||
sourceGroup: DockviewGroupPanel,
|
||||
referenceGroup: DockviewGroupPanel,
|
||||
target: Position
|
||||
): void {
|
||||
if (sourceGroup) {
|
||||
@ -872,7 +875,10 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
doSetGroupActive(group: GroupPanel | undefined, skipFocus?: boolean): void {
|
||||
doSetGroupActive(
|
||||
group: DockviewGroupPanel | undefined,
|
||||
skipFocus?: boolean
|
||||
): void {
|
||||
const isGroupAlreadyFocused = this._activeGroup === group;
|
||||
super.doSetGroupActive(group, skipFocus);
|
||||
|
||||
@ -881,7 +887,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
createGroup(options?: GroupOptions): GroupPanel {
|
||||
createGroup(options?: GroupOptions): DockviewGroupPanel {
|
||||
if (!options) {
|
||||
options = { tabHeight: this.tabHeight };
|
||||
}
|
||||
@ -905,7 +911,7 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
const view = new GroupPanel(this, id, options);
|
||||
const view = new DockviewGroupPanel(this, id, options);
|
||||
view.init({ params: {}, accessor: <any>null }); // required to initialized .part and allow for correct disposal of group
|
||||
|
||||
if (!this._groups.has(view.id)) {
|
||||
@ -948,7 +954,7 @@ export class DockviewComponent
|
||||
|
||||
private createPanel(
|
||||
options: AddPanelOptions,
|
||||
group: GroupPanel
|
||||
group: DockviewGroupPanel
|
||||
): IDockviewPanel {
|
||||
const contentComponent = options.component;
|
||||
const tabComponent =
|
||||
@ -976,13 +982,15 @@ export class DockviewComponent
|
||||
return panel;
|
||||
}
|
||||
|
||||
private createGroupAtLocation(location: number[] = [0]): GroupPanel {
|
||||
private createGroupAtLocation(
|
||||
location: number[] = [0]
|
||||
): DockviewGroupPanel {
|
||||
const group = this.createGroup();
|
||||
this.doAddGroup(group, location);
|
||||
return group;
|
||||
}
|
||||
|
||||
private findGroup(panel: IDockviewPanel): GroupPanel | undefined {
|
||||
private findGroup(panel: IDockviewPanel): DockviewGroupPanel | undefined {
|
||||
return Array.from(this._groups.values()).find((group) =>
|
||||
group.value.model.containsPanel(panel)
|
||||
)?.value;
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
GroupviewPanelState,
|
||||
IGroupPanelInitParameters,
|
||||
} from '../groupview/types';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
|
||||
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
||||
import { IPanel, Parameters } from '../panel/types';
|
||||
import { IDockviewPanelModel } from './dockviewPanelModel';
|
||||
@ -16,11 +16,11 @@ import { IDockviewComponent } from './dockviewComponent';
|
||||
|
||||
export interface IDockviewPanel extends IDisposable, IPanel {
|
||||
readonly view: IDockviewPanelModel;
|
||||
readonly group: GroupPanel;
|
||||
readonly group: DockviewGroupPanel;
|
||||
readonly api: DockviewPanelApi;
|
||||
readonly title: string;
|
||||
readonly params: Record<string, any> | undefined;
|
||||
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void;
|
||||
updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void;
|
||||
init(params: IGroupPanelInitParameters): void;
|
||||
toJSON(): GroupviewPanelState;
|
||||
update(event: GroupPanelUpdateEvent): void;
|
||||
@ -31,7 +31,7 @@ export class DockviewPanel
|
||||
implements IDockviewPanel
|
||||
{
|
||||
readonly api: DockviewPanelApiImpl;
|
||||
private _group: GroupPanel;
|
||||
private _group: DockviewGroupPanel;
|
||||
private _params?: Parameters;
|
||||
|
||||
private _title: string;
|
||||
@ -44,7 +44,7 @@ export class DockviewPanel
|
||||
return this._title;
|
||||
}
|
||||
|
||||
get group(): GroupPanel {
|
||||
get group(): DockviewGroupPanel {
|
||||
return this._group;
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ export class DockviewPanel
|
||||
public readonly id: string,
|
||||
accessor: IDockviewComponent,
|
||||
private readonly containerApi: DockviewApi,
|
||||
group: GroupPanel,
|
||||
group: DockviewGroupPanel,
|
||||
readonly view: IDockviewPanelModel
|
||||
) {
|
||||
super();
|
||||
@ -139,7 +139,10 @@ export class DockviewPanel
|
||||
});
|
||||
}
|
||||
|
||||
public updateParentGroup(group: GroupPanel, isGroupActive: boolean): void {
|
||||
public updateParentGroup(
|
||||
group: DockviewGroupPanel,
|
||||
isGroupActive: boolean
|
||||
): void {
|
||||
this._group = group;
|
||||
this.api.group = group;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
ITabRenderer,
|
||||
GroupPanelUpdateEvent,
|
||||
} from '../groupview/types';
|
||||
import { GroupPanel } from '../groupview/groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
|
||||
import { IDisposable } from '../lifecycle';
|
||||
import { createComponent } from '../panel/componentFactory';
|
||||
import { IDockviewComponent } from './dockviewComponent';
|
||||
@ -23,14 +23,14 @@ export interface IDockviewPanelModel extends IDisposable {
|
||||
update(event: GroupPanelUpdateEvent): void;
|
||||
layout(width: number, height: number): void;
|
||||
init(params: GroupPanelPartInitParameters): void;
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void;
|
||||
updateParentGroup(group: DockviewGroupPanel, isPanelVisible: boolean): void;
|
||||
}
|
||||
|
||||
export class DockviewPanelModel implements IDockviewPanelModel {
|
||||
private readonly _content: IContentRenderer;
|
||||
private readonly _tab: ITabRenderer;
|
||||
|
||||
private _group: GroupPanel | null = null;
|
||||
private _group: DockviewGroupPanel | null = null;
|
||||
private _isPanelVisible: boolean | null = null;
|
||||
|
||||
get content(): IContentRenderer {
|
||||
@ -57,7 +57,10 @@ export class DockviewPanelModel implements IDockviewPanelModel {
|
||||
this.tab.init(params);
|
||||
}
|
||||
|
||||
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
|
||||
updateParentGroup(
|
||||
group: DockviewGroupPanel,
|
||||
isPanelVisible: boolean
|
||||
): void {
|
||||
if (group !== this._group) {
|
||||
this._group = group;
|
||||
if (this._content.onGroupChange) {
|
||||
|
@ -7,7 +7,10 @@ import {
|
||||
WatermarkConstructor,
|
||||
IWatermarkRenderer,
|
||||
} from '../groupview/types';
|
||||
import { GroupPanel, GroupviewPanelApi } from '../groupview/groupviewPanel';
|
||||
import {
|
||||
DockviewGroupPanel,
|
||||
DockviewGroupPanelApi,
|
||||
} from '../groupview/dockviewGroupPanel';
|
||||
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
|
||||
import { FrameworkFactory } from '../types';
|
||||
import { DockviewDropTargets } from '../groupview/dnd';
|
||||
@ -18,7 +21,10 @@ import { IDockviewPanel } from './dockviewPanel';
|
||||
|
||||
export interface IGroupControlRenderer extends IDisposable {
|
||||
readonly element: HTMLElement;
|
||||
init(params: { containerApi: DockviewApi; api: GroupviewPanelApi }): void;
|
||||
init(params: {
|
||||
containerApi: DockviewApi;
|
||||
api: DockviewGroupPanelApi;
|
||||
}): void;
|
||||
}
|
||||
|
||||
export interface GroupPanelFrameworkComponentFactory {
|
||||
@ -61,7 +67,7 @@ export interface DockviewDndOverlayEvent {
|
||||
nativeEvent: DragEvent;
|
||||
target: DockviewDropTargets;
|
||||
position: Position;
|
||||
group?: GroupPanel;
|
||||
group?: DockviewGroupPanel;
|
||||
getData: () => PanelTransfer | undefined;
|
||||
}
|
||||
|
||||
@ -74,7 +80,9 @@ export interface DockviewComponentOptions extends DockviewRenderFunctions {
|
||||
styles?: ISplitviewStyles;
|
||||
defaultTabComponent?: string;
|
||||
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
||||
createGroupControlElement?: (group: GroupPanel) => IGroupControlRenderer;
|
||||
createGroupControlElement?: (
|
||||
group: DockviewGroupPanel
|
||||
) => IGroupControlRenderer;
|
||||
singleTabMode?: 'fullwidth' | 'default';
|
||||
}
|
||||
|
||||
@ -93,7 +101,7 @@ type RelativePanel = {
|
||||
|
||||
type RelativeGroup = {
|
||||
direction?: Direction;
|
||||
referenceGroup: string | GroupPanel;
|
||||
referenceGroup: string | DockviewGroupPanel;
|
||||
};
|
||||
|
||||
type AbsolutePosition = {
|
||||
@ -136,7 +144,7 @@ type AddGroupOptionsWithPanel = {
|
||||
};
|
||||
|
||||
type AddGroupOptionsWithGroup = {
|
||||
referenceGroup: string | GroupPanel;
|
||||
referenceGroup: string | DockviewGroupPanel;
|
||||
direction?: Omit<Direction, 'within'>;
|
||||
};
|
||||
|
||||
@ -169,5 +177,5 @@ export interface MovementOptions2 {
|
||||
|
||||
export interface MovementOptions extends MovementOptions2 {
|
||||
includePanel?: boolean;
|
||||
group?: GroupPanel;
|
||||
group?: DockviewGroupPanel;
|
||||
}
|
||||
|
@ -1,24 +1,31 @@
|
||||
import { IFrameworkPart } from '../panel/types';
|
||||
import { DockviewComponent } from '../dockview/dockviewComponent';
|
||||
import { GridviewPanelApi } from '../api/gridviewPanelApi';
|
||||
import { Groupview, GroupOptions, IHeader } from './groupview';
|
||||
import {
|
||||
DockviewGroupPanelModel,
|
||||
GroupOptions,
|
||||
IHeader,
|
||||
} from './dockviewGroupPanelModel';
|
||||
import { GridviewPanel, IGridviewPanel } from '../gridview/gridviewPanel';
|
||||
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
||||
|
||||
export interface IGroupviewPanel extends IGridviewPanel {
|
||||
model: Groupview;
|
||||
export interface IDockviewGroupPanel extends IGridviewPanel {
|
||||
model: DockviewGroupPanelModel;
|
||||
locked: boolean;
|
||||
readonly size: number;
|
||||
readonly panels: IDockviewPanel[];
|
||||
readonly activePanel: IDockviewPanel | undefined;
|
||||
}
|
||||
|
||||
export type IGroupviewPanelPublic = IGroupviewPanel;
|
||||
export type IDockviewGroupPanelPublic = IDockviewGroupPanel;
|
||||
|
||||
export type GroupviewPanelApi = GridviewPanelApi;
|
||||
export type DockviewGroupPanelApi = GridviewPanelApi;
|
||||
|
||||
export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
|
||||
private readonly _model: Groupview;
|
||||
export class DockviewGroupPanel
|
||||
extends GridviewPanel
|
||||
implements IDockviewGroupPanel
|
||||
{
|
||||
private readonly _model: DockviewGroupPanelModel;
|
||||
|
||||
get panels(): IDockviewPanel[] {
|
||||
return this._model.panels;
|
||||
@ -32,7 +39,7 @@ export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
|
||||
return this._model.size;
|
||||
}
|
||||
|
||||
get model(): Groupview {
|
||||
get model(): DockviewGroupPanelModel {
|
||||
return this._model;
|
||||
}
|
||||
|
||||
@ -71,7 +78,13 @@ export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
|
||||
) {
|
||||
super(id, 'groupview_default');
|
||||
|
||||
this._model = new Groupview(this.element, accessor, id, options, this);
|
||||
this._model = new DockviewGroupPanelModel(
|
||||
this.element,
|
||||
accessor,
|
||||
id,
|
||||
options,
|
||||
this
|
||||
);
|
||||
}
|
||||
|
||||
initialize() {
|
@ -11,19 +11,19 @@ import { PanelInitParameters, PanelUpdateEvent } from '../panel/types';
|
||||
import { ContentContainer, IContentContainer } from './panel/content';
|
||||
import { ITabsContainer, TabsContainer } from './titlebar/tabsContainer';
|
||||
import { IWatermarkRenderer } from './types';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
||||
import { DockviewDropTargets } from './dnd';
|
||||
import { IDockviewPanel } from '../dockview/dockviewPanel';
|
||||
import { IGroupControlRenderer } from '../dockview/options';
|
||||
|
||||
export interface DndService {
|
||||
canDisplayOverlay(
|
||||
group: IGroupview,
|
||||
group: IDockviewGroupPanelModel,
|
||||
event: DragEvent,
|
||||
target: DockviewDropTargets
|
||||
): boolean;
|
||||
onDrop(
|
||||
group: IGroupview,
|
||||
group: IDockviewGroupPanelModel,
|
||||
event: DragEvent,
|
||||
position: Position,
|
||||
index?: number
|
||||
@ -77,7 +77,7 @@ export interface IHeader {
|
||||
height: number | undefined;
|
||||
}
|
||||
|
||||
export interface IGroupview extends IGridPanelView {
|
||||
export interface IDockviewGroupPanelModel extends IGridPanelView {
|
||||
readonly isActive: boolean;
|
||||
readonly size: number;
|
||||
readonly panels: IDockviewPanel[];
|
||||
@ -117,7 +117,10 @@ export interface IGroupview extends IGridPanelView {
|
||||
): boolean;
|
||||
}
|
||||
|
||||
export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
export class DockviewGroupPanelModel
|
||||
extends CompositeDisposable
|
||||
implements IDockviewGroupPanelModel
|
||||
{
|
||||
private readonly tabsContainer: ITabsContainer;
|
||||
private readonly contentContainer: IContentContainer;
|
||||
private readonly dropTarget: Droptarget;
|
||||
@ -232,7 +235,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
|
||||
private accessor: DockviewComponent,
|
||||
public id: string,
|
||||
private readonly options: GroupOptions,
|
||||
private readonly groupPanel: GroupPanel
|
||||
private readonly groupPanel: DockviewGroupPanel
|
||||
) {
|
||||
super();
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
import { toggleClass } from '../dom';
|
||||
import { IDockviewComponent } from '../dockview/dockviewComponent';
|
||||
import { ITabRenderer } from './types';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
||||
import { DroptargetEvent, Droptarget } from '../dnd/droptarget';
|
||||
import { DockviewDropTargets } from './dnd';
|
||||
import { DragHandler } from '../dnd/abstractDragHandler';
|
||||
@ -40,7 +40,7 @@ export class Tab extends CompositeDisposable implements ITab {
|
||||
constructor(
|
||||
public readonly panelId: string,
|
||||
private readonly accessor: IDockviewComponent,
|
||||
private readonly group: GroupPanel
|
||||
private readonly group: DockviewGroupPanel
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
import { addDisposableListener, Emitter, Event } from '../../events';
|
||||
import { ITab, Tab } from '../tab';
|
||||
import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { GroupPanel } from '../groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../dockviewGroupPanel';
|
||||
import { VoidContainer } from './voidContainer';
|
||||
import { toggleClass } from '../../dom';
|
||||
import { IDockviewPanel } from '../../dockview/dockviewPanel';
|
||||
@ -135,7 +135,7 @@ export class TabsContainer
|
||||
|
||||
constructor(
|
||||
private readonly accessor: DockviewComponent,
|
||||
private readonly group: GroupPanel
|
||||
private readonly group: DockviewGroupPanel
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { DockviewComponent } from '../../dockview/dockviewComponent';
|
||||
import { addDisposableListener, Emitter, Event } from '../../events';
|
||||
import { CompositeDisposable } from '../../lifecycle';
|
||||
import { DockviewDropTargets } from '../dnd';
|
||||
import { GroupPanel } from '../groupviewPanel';
|
||||
import { DockviewGroupPanel } from '../dockviewGroupPanel';
|
||||
|
||||
export class VoidContainer extends CompositeDisposable {
|
||||
private readonly _element: HTMLElement;
|
||||
@ -21,7 +21,7 @@ export class VoidContainer extends CompositeDisposable {
|
||||
|
||||
constructor(
|
||||
private readonly accessor: DockviewComponent,
|
||||
private readonly group: GroupPanel
|
||||
private readonly group: DockviewGroupPanel
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
Parameters,
|
||||
} from '../panel/types';
|
||||
import { DockviewApi } from '../api/component.api';
|
||||
import { GroupPanel } from './groupviewPanel';
|
||||
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
||||
import { Event } from '../events';
|
||||
import {
|
||||
IDockviewPanelModel,
|
||||
@ -38,7 +38,7 @@ export interface IWatermarkRenderer
|
||||
> {
|
||||
readonly element: HTMLElement;
|
||||
init: (params: GroupPanelPartInitParameters) => void;
|
||||
updateParentGroup(group: GroupPanel, visible: boolean): void;
|
||||
updateParentGroup(group: DockviewGroupPanel, visible: boolean): void;
|
||||
}
|
||||
|
||||
export interface ITabRenderer
|
||||
@ -48,7 +48,7 @@ export interface ITabRenderer
|
||||
> {
|
||||
readonly element: HTMLElement;
|
||||
init(parameters: GroupPanelPartInitParameters): void;
|
||||
onGroupChange?(group: GroupPanel): void;
|
||||
onGroupChange?(group: DockviewGroupPanel): void;
|
||||
onPanelVisibleChange?(isPanelVisible: boolean): void;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ export interface IContentRenderer
|
||||
readonly onDidFocus?: Event<void>;
|
||||
readonly onDidBlur?: Event<void>;
|
||||
init(parameters: GroupPanelContentPartInitParameters): void;
|
||||
onGroupChange?(group: GroupPanel): void;
|
||||
onGroupChange?(group: DockviewGroupPanel): void;
|
||||
onPanelVisibleChange?(isPanelVisible: boolean): void;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ export * from './splitview/core/options';
|
||||
|
||||
export * from './paneview/paneview';
|
||||
export * from './gridview/gridview';
|
||||
export * from './groupview/groupview';
|
||||
export * from './groupview/dockviewGroupPanelModel';
|
||||
export * from './gridview/baseComponentGridview';
|
||||
|
||||
export * from './paneview/draggablePaneviewPanel';
|
||||
@ -32,7 +32,7 @@ export * from './groupview/panel/content';
|
||||
export * from './groupview/tab';
|
||||
export * from './groupview/dnd';
|
||||
export * from './groupview/types';
|
||||
export * from './groupview/groupviewPanel';
|
||||
export * from './groupview/dockviewGroupPanel';
|
||||
|
||||
export * from './dockview/options';
|
||||
export * from './dockview/dockviewPanel';
|
||||
|
@ -3,7 +3,7 @@ import { ReactPart, ReactPortalStore } from '../react';
|
||||
import { IDockviewPanelProps } from '../dockview/dockview';
|
||||
import {
|
||||
DockviewEmitter,
|
||||
Event,
|
||||
DockviewEvent,
|
||||
GroupPanel,
|
||||
PanelUpdateEvent,
|
||||
IContentRenderer,
|
||||
@ -17,10 +17,10 @@ export class ReactPanelContentPart implements IContentRenderer {
|
||||
private _group: GroupPanel | undefined;
|
||||
|
||||
private readonly _onDidFocus = new DockviewEmitter<void>();
|
||||
readonly onDidFocus: Event<void> = this._onDidFocus.event;
|
||||
readonly onDidFocus: DockviewEvent<void> = this._onDidFocus.event;
|
||||
|
||||
private readonly _onDidBlur = new DockviewEmitter<void>();
|
||||
readonly onDidBlur: Event<void> = this._onDidBlur.event;
|
||||
readonly onDidBlur: DockviewEvent<void> = this._onDidBlur.event;
|
||||
|
||||
get element(): HTMLElement {
|
||||
return this._element;
|
||||
|
Loading…
Reference in New Issue
Block a user