mirror of
https://github.com/mathuo/dockview
synced 2025-02-03 06:55:46 +00:00
Merge pull request #207 from mathuo/206-internal-enhancements
refactor: remove legacy code
This commit is contained in:
commit
325a203877
@ -1,20 +0,0 @@
|
|||||||
const {join, normalize} = require("path");
|
|
||||||
|
|
||||||
const tsconfig = normalize(join(__dirname, "tsconfig.test.json"))
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
displayName: { name: "root" },
|
|
||||||
preset: "ts-jest",
|
|
||||||
projects: ["<rootDir>/packages/*/jest.config.js"],
|
|
||||||
transform: {
|
|
||||||
"^.+\\.tsx?$":"ts-jest"
|
|
||||||
},
|
|
||||||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
|
|
||||||
globals: {
|
|
||||||
"ts-jest": {
|
|
||||||
tsconfig,
|
|
||||||
experimental: true,
|
|
||||||
compilerHost: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
const baseConfig = require("./jest.config.base");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
displayName: { name: "root", color: "blue" },
|
|
||||||
projects: ["<rootDir>/packages/*/jest.config.js"],
|
|
||||||
collectCoverage: true,
|
|
||||||
collectCoverageFrom:[
|
|
||||||
"<rootDir>/packages/*/src/**/*.{js,jsx,ts,tsx}",
|
|
||||||
],
|
|
||||||
coveragePathIgnorePatterns: [
|
|
||||||
"/node_modules/",
|
|
||||||
"<rootDir>packages/*/src/__tests__/",
|
|
||||||
],
|
|
||||||
coverageDirectory: "coverage",
|
|
||||||
testResultsProcessor: 'jest-sonar-reporter',
|
|
||||||
};
|
|
17
jest.config.ts
Normal file
17
jest.config.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { JestConfigWithTsJest } from 'ts-jest';
|
||||||
|
|
||||||
|
const config: JestConfigWithTsJest = {
|
||||||
|
preset: 'ts-jest',
|
||||||
|
displayName: { name: 'root', color: 'blue' },
|
||||||
|
projects: ['<rootDir>/packages/*/jest.config.ts'],
|
||||||
|
collectCoverage: true,
|
||||||
|
collectCoverageFrom: ['<rootDir>/packages/*/src/**/*.{js,jsx,ts,tsx}'],
|
||||||
|
coveragePathIgnorePatterns: [
|
||||||
|
'/node_modules/',
|
||||||
|
'<rootDir>packages/*/src/__tests__/',
|
||||||
|
],
|
||||||
|
coverageDirectory: 'coverage',
|
||||||
|
testResultsProcessor: 'jest-sonar-reporter',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
@ -44,7 +44,6 @@
|
|||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-dart-sass": "^1.0.2",
|
"gulp-dart-sass": "^1.0.2",
|
||||||
"jest": "^29.4.3",
|
|
||||||
"jest-environment-jsdom": "^29.4.3",
|
"jest-environment-jsdom": "^29.4.3",
|
||||||
"jest-sonar-reporter": "^2.0.0",
|
"jest-sonar-reporter": "^2.0.0",
|
||||||
"jsdom": "^21.1.0",
|
"jsdom": "^21.1.0",
|
||||||
@ -61,5 +60,9 @@
|
|||||||
"webpack": "^5.75.0",
|
"webpack": "^5.75.0",
|
||||||
"webpack-cli": "^5.0.1",
|
"webpack-cli": "^5.0.1",
|
||||||
"webpack-dev-server": "^4.11.1"
|
"webpack-dev-server": "^4.11.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"jest": "^29.5.0",
|
||||||
|
"ts-node": "^10.9.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
const { name } = require('./package');
|
import { JestConfigWithTsJest } from 'ts-jest';
|
||||||
|
|
||||||
const baseConfig = require('../../jest.config.base');
|
const config: JestConfigWithTsJest = {
|
||||||
|
preset: 'ts-jest',
|
||||||
console.log('loaded');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
roots: ['<rootDir>/packages/dockview-core'],
|
roots: ['<rootDir>/packages/dockview-core'],
|
||||||
modulePaths: ['<rootDir>/packages/dockview-core/src'],
|
modulePaths: ['<rootDir>/packages/dockview-core/src'],
|
||||||
displayName: { name, color: 'blue' },
|
displayName: { name: 'dockview-core', color: 'blue' },
|
||||||
rootDir: '../../',
|
rootDir: '../../',
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'<rootDir>/packages/dockview-core/src/**/*.{js,jsx,ts,tsx}',
|
'<rootDir>/packages/dockview-core/src/**/*.{js,jsx,ts,tsx}',
|
||||||
@ -25,3 +21,5 @@ module.exports = {
|
|||||||
testResultsProcessor: 'jest-sonar-reporter',
|
testResultsProcessor: 'jest-sonar-reporter',
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
@ -29,13 +29,6 @@ export class DockviewPanelModelMock implements IDockviewPanelModel {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
updateParentGroup(
|
|
||||||
group: DockviewGroupPanel,
|
|
||||||
isPanelVisible: boolean
|
|
||||||
): void {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
IGroupPanelInitParameters,
|
IGroupPanelInitParameters,
|
||||||
} from '../../dockview/types';
|
} from '../../dockview/types';
|
||||||
import { PanelUpdateEvent } from '../../panel/types';
|
import { PanelUpdateEvent } from '../../panel/types';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
import { CompositeDisposable } from '../../lifecycle';
|
import { CompositeDisposable } from '../../lifecycle';
|
||||||
import { Emitter } from '../../events';
|
import { Emitter } from '../../events';
|
||||||
import { IDockviewPanel } from '../../dockview/dockviewPanel';
|
import { IDockviewPanel } from '../../dockview/dockviewPanel';
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
PanelUpdateEvent,
|
PanelUpdateEvent,
|
||||||
Parameters,
|
Parameters,
|
||||||
} from '../../panel/types';
|
} from '../../panel/types';
|
||||||
import { LayoutPriority, Orientation } from '../../splitview/core/splitview';
|
import { LayoutPriority, Orientation } from '../../splitview/splitview';
|
||||||
|
|
||||||
class TestPanel implements IGridPanelView {
|
class TestPanel implements IGridPanelView {
|
||||||
_onDidChange = new Emitter<IViewSize | undefined>();
|
_onDidChange = new Emitter<IViewSize | undefined>();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Gridview } from '../../gridview/gridview';
|
import { Gridview } from '../../gridview/gridview';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
|
|
||||||
describe('gridview', () => {
|
describe('gridview', () => {
|
||||||
let container: HTMLElement;
|
let container: HTMLElement;
|
||||||
|
@ -2,7 +2,7 @@ import { GridviewComponent } from '../../gridview/gridviewComponent';
|
|||||||
import { GridviewPanel } from '../../gridview/gridviewPanel';
|
import { GridviewPanel } from '../../gridview/gridviewPanel';
|
||||||
import { CompositeDisposable } from '../../lifecycle';
|
import { CompositeDisposable } from '../../lifecycle';
|
||||||
import { IFrameworkPart } from '../../panel/types';
|
import { IFrameworkPart } from '../../panel/types';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
|
|
||||||
class TestGridview extends GridviewPanel {
|
class TestGridview extends GridviewPanel {
|
||||||
constructor(id: string, componentName: string) {
|
constructor(id: string, componentName: string) {
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
IPaneHeaderPart,
|
IPaneHeaderPart,
|
||||||
PaneviewPanel,
|
PaneviewPanel,
|
||||||
} from '../../paneview/paneviewPanel';
|
} from '../../paneview/paneviewPanel';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
|
|
||||||
class TestPanel extends PaneviewPanel {
|
class TestPanel extends PaneviewPanel {
|
||||||
protected getBodyComponent(): IPaneBodyPart {
|
protected getBodyComponent(): IPaneBodyPart {
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
IPaneHeaderPart,
|
IPaneHeaderPart,
|
||||||
PanePanelComponentInitParameter,
|
PanePanelComponentInitParameter,
|
||||||
} from '../../paneview/paneviewPanel';
|
} from '../../paneview/paneviewPanel';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
|
|
||||||
class TestPanel extends PaneviewPanel {
|
class TestPanel extends PaneviewPanel {
|
||||||
constructor(id: string, component: string) {
|
constructor(id: string, component: string) {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Emitter } from '../../../events';
|
import { Emitter } from '../../events';
|
||||||
import { CompositeDisposable } from '../../../lifecycle';
|
import { CompositeDisposable } from '../../lifecycle';
|
||||||
import {
|
import {
|
||||||
IView,
|
IView,
|
||||||
LayoutPriority,
|
LayoutPriority,
|
||||||
Orientation,
|
Orientation,
|
||||||
Sizing,
|
Sizing,
|
||||||
Splitview,
|
Splitview,
|
||||||
} from '../../../splitview/core/splitview';
|
} from '../../splitview/splitview';
|
||||||
|
|
||||||
class Testview implements IView {
|
class Testview implements IView {
|
||||||
private _element: HTMLElement = document.createElement('div');
|
private _element: HTMLElement = document.createElement('div');
|
@ -1,6 +1,6 @@
|
|||||||
import { PanelDimensionChangeEvent } from '../../api/panelApi';
|
import { PanelDimensionChangeEvent } from '../../api/panelApi';
|
||||||
import { CompositeDisposable } from '../../lifecycle';
|
import { CompositeDisposable } from '../../lifecycle';
|
||||||
import { Orientation } from '../../splitview/core/splitview';
|
import { Orientation } from '../../splitview/splitview';
|
||||||
import { SplitviewComponent } from '../../splitview/splitviewComponent';
|
import { SplitviewComponent } from '../../splitview/splitviewComponent';
|
||||||
import { SplitviewPanel } from '../../splitview/splitviewPanel';
|
import { SplitviewPanel } from '../../splitview/splitviewPanel';
|
||||||
|
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
.actions-bar {
|
|
||||||
text-align: right;
|
|
||||||
width: 28px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
.actions-container {
|
|
||||||
display: flex;
|
|
||||||
padding: 0px;
|
|
||||||
margin: 0px;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
.close-action {
|
|
||||||
padding: 4px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-radius: 2px;
|
|
||||||
background-color: var(--dv-icon-hover-background-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
export class ActionContainer {
|
|
||||||
private _element: HTMLElement;
|
|
||||||
private _list: HTMLElement;
|
|
||||||
|
|
||||||
get element(): HTMLElement {
|
|
||||||
return this._element;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this._element = document.createElement('div');
|
|
||||||
this._element.className = 'actions-bar';
|
|
||||||
|
|
||||||
this._list = document.createElement('ul');
|
|
||||||
this._list.className = 'actions-container';
|
|
||||||
|
|
||||||
this._element.appendChild(this._list);
|
|
||||||
}
|
|
||||||
|
|
||||||
public add(element: HTMLElement): void {
|
|
||||||
const listItem = document.createElement('li');
|
|
||||||
listItem.className = 'action-item';
|
|
||||||
this._list.appendChild(element);
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,7 +28,7 @@ import {
|
|||||||
SerializedSplitview,
|
SerializedSplitview,
|
||||||
SplitviewComponentUpdateOptions,
|
SplitviewComponentUpdateOptions,
|
||||||
} from '../splitview/splitviewComponent';
|
} from '../splitview/splitviewComponent';
|
||||||
import { IView, Orientation, Sizing } from '../splitview/core/splitview';
|
import { IView, Orientation, Sizing } from '../splitview/splitview';
|
||||||
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
||||||
import {
|
import {
|
||||||
DockviewGroupPanel,
|
DockviewGroupPanel,
|
||||||
|
@ -7,9 +7,6 @@ import { createCloseButton } from '../../../svg';
|
|||||||
|
|
||||||
export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
||||||
private _element: HTMLElement;
|
private _element: HTMLElement;
|
||||||
|
|
||||||
private _isPanelVisible = false;
|
|
||||||
private _isGroupActive = false;
|
|
||||||
private _content: HTMLElement;
|
private _content: HTMLElement;
|
||||||
private _actionContainer: HTMLElement;
|
private _actionContainer: HTMLElement;
|
||||||
private _list: HTMLElement;
|
private _list: HTMLElement;
|
||||||
@ -17,7 +14,7 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
|||||||
//
|
//
|
||||||
private params: GroupPanelPartInitParameters = {} as any;
|
private params: GroupPanelPartInitParameters = {} as any;
|
||||||
|
|
||||||
get element() {
|
get element(): HTMLElement {
|
||||||
return this._element;
|
return this._element;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,16 +52,16 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
|||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
public update(event: PanelUpdateEvent) {
|
public update(event: PanelUpdateEvent): void {
|
||||||
this.params = { ...this.params, ...event.params };
|
this.params = { ...this.params, ...event.params };
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
focus() {
|
focus(): void {
|
||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(params: GroupPanelPartInitParameters) {
|
public init(params: GroupPanelPartInitParameters): void {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this._content.textContent = params.title;
|
this._content.textContent = params.title;
|
||||||
|
|
||||||
@ -74,27 +71,19 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateParentGroup(
|
onGroupChange(_group: DockviewGroupPanel): void {
|
||||||
group: DockviewGroupPanel,
|
|
||||||
isPanelVisible: boolean
|
|
||||||
) {
|
|
||||||
const changed =
|
|
||||||
this._isPanelVisible !== isPanelVisible ||
|
|
||||||
this._isGroupActive !== group.isActive;
|
|
||||||
|
|
||||||
this._isPanelVisible = isPanelVisible;
|
|
||||||
this._isGroupActive = group.isActive;
|
|
||||||
|
|
||||||
if (changed) {
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPanelVisibleChange(_isPanelVisible: boolean): void {
|
||||||
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
public layout(_width: number, _height: number) {
|
public layout(_width: number, _height: number): void {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
private render() {
|
private render(): void {
|
||||||
if (this._content.textContent !== this.params.title) {
|
if (this._content.textContent !== this.params.title) {
|
||||||
this._content.textContent = this.params.title;
|
this._content.textContent = this.params.title;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
&.has-actions {
|
&.has-actions {
|
||||||
.watermark-title {
|
.watermark-title {
|
||||||
.actions-bar {
|
.actions-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,4 +18,28 @@
|
|||||||
.watermark-content {
|
.watermark-content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actions-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0px 8px;
|
||||||
|
// padding: 0px;
|
||||||
|
// margin: 0px;
|
||||||
|
// justify-content: flex-end;
|
||||||
|
|
||||||
|
.close-action {
|
||||||
|
padding: 4px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: var(--dv-icon-hover-background-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { GroupPanelPartInitParameters, IWatermarkRenderer } from '../../types';
|
import { GroupPanelPartInitParameters, IWatermarkRenderer } from '../../types';
|
||||||
import { ActionContainer } from '../../../actionbar/actionsContainer';
|
|
||||||
import { addDisposableListener } from '../../../events';
|
import { addDisposableListener } from '../../../events';
|
||||||
import { toggleClass } from '../../../dom';
|
import { toggleClass } from '../../../dom';
|
||||||
import { CompositeDisposable } from '../../../lifecycle';
|
import { CompositeDisposable } from '../../../lifecycle';
|
||||||
@ -36,15 +35,17 @@ export class Watermark
|
|||||||
this._element.appendChild(title);
|
this._element.appendChild(title);
|
||||||
this._element.appendChild(content);
|
this._element.appendChild(content);
|
||||||
|
|
||||||
const actions = new ActionContainer();
|
const actionsContainer = document.createElement('div');
|
||||||
title.appendChild(emptySpace);
|
actionsContainer.className = 'actions-container';
|
||||||
title.appendChild(actions.element);
|
|
||||||
|
|
||||||
const closeAnchor = document.createElement('div');
|
const closeAnchor = document.createElement('div');
|
||||||
closeAnchor.className = 'close-action';
|
closeAnchor.className = 'close-action';
|
||||||
closeAnchor.appendChild(createCloseButton());
|
closeAnchor.appendChild(createCloseButton());
|
||||||
|
|
||||||
actions.add(closeAnchor);
|
actionsContainer.appendChild(closeAnchor);
|
||||||
|
|
||||||
|
title.appendChild(emptySpace);
|
||||||
|
title.appendChild(actionsContainer);
|
||||||
|
|
||||||
this.addDisposables(
|
this.addDisposables(
|
||||||
addDisposableListener(closeAnchor, 'click', (ev) => {
|
addDisposableListener(closeAnchor, 'click', (ev) => {
|
||||||
|
@ -35,7 +35,7 @@ import {
|
|||||||
toTarget,
|
toTarget,
|
||||||
} from '../gridview/baseComponentGridview';
|
} from '../gridview/baseComponentGridview';
|
||||||
import { DockviewApi } from '../api/component.api';
|
import { DockviewApi } from '../api/component.api';
|
||||||
import { Orientation, Sizing } from '../splitview/core/splitview';
|
import { Orientation, Sizing } from '../splitview/splitview';
|
||||||
import {
|
import {
|
||||||
GroupOptions,
|
GroupOptions,
|
||||||
GroupPanelViewState,
|
GroupPanelViewState,
|
||||||
|
@ -155,7 +155,7 @@ export class DockviewPanel
|
|||||||
isVisible: isPanelVisible,
|
isVisible: isPanelVisible,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.view?.updateParentGroup(
|
this.view.updateParentGroup(
|
||||||
this._group,
|
this._group,
|
||||||
this._group.model.isPanelActive(this)
|
this._group.model.isPanelActive(this)
|
||||||
);
|
);
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
DockviewGroupPanel,
|
DockviewGroupPanel,
|
||||||
DockviewGroupPanelApi,
|
DockviewGroupPanelApi,
|
||||||
} from './dockviewGroupPanel';
|
} from './dockviewGroupPanel';
|
||||||
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
|
import { ISplitviewStyles, Orientation } from '../splitview/splitview';
|
||||||
import { FrameworkFactory } from '../types';
|
import { FrameworkFactory } from '../types';
|
||||||
import { PanelTransfer } from '../dnd/dataTransfer';
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
||||||
import { IDisposable } from '../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
|
@ -3,11 +3,7 @@ import { getGridLocation, Gridview, IGridView } from './gridview';
|
|||||||
import { Position } from '../dnd/droptarget';
|
import { Position } from '../dnd/droptarget';
|
||||||
import { CompositeDisposable, IValueDisposable } from '../lifecycle';
|
import { CompositeDisposable, IValueDisposable } from '../lifecycle';
|
||||||
import { sequentialNumberGenerator } from '../math';
|
import { sequentialNumberGenerator } from '../math';
|
||||||
import {
|
import { ISplitviewStyles, Orientation, Sizing } from '../splitview/splitview';
|
||||||
ISplitviewStyles,
|
|
||||||
Orientation,
|
|
||||||
Sizing,
|
|
||||||
} from '../splitview/core/splitview';
|
|
||||||
import { IPanel } from '../panel/types';
|
import { IPanel } from '../panel/types';
|
||||||
import { MovementOptions2 } from '../dockview/options';
|
import { MovementOptions2 } from '../dockview/options';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
Sizing,
|
Sizing,
|
||||||
LayoutPriority,
|
LayoutPriority,
|
||||||
ISplitviewStyles,
|
ISplitviewStyles,
|
||||||
} from '../splitview/core/splitview';
|
} from '../splitview/splitview';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { INodeDescriptor } from './gridview';
|
import { INodeDescriptor } from './gridview';
|
||||||
import { LeafNode } from './leafNode';
|
import { LeafNode } from './leafNode';
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
LayoutPriority,
|
LayoutPriority,
|
||||||
Orientation,
|
Orientation,
|
||||||
Sizing,
|
Sizing,
|
||||||
} from '../splitview/core/splitview';
|
} from '../splitview/splitview';
|
||||||
import { tail } from '../array';
|
import { tail } from '../array';
|
||||||
import { LeafNode } from './leafNode';
|
import { LeafNode } from './leafNode';
|
||||||
import { BranchNode } from './branchNode';
|
import { BranchNode } from './branchNode';
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
IGridviewPanel,
|
IGridviewPanel,
|
||||||
} from './gridviewPanel';
|
} from './gridviewPanel';
|
||||||
import { BaseComponentOptions } from '../panel/types';
|
import { BaseComponentOptions } from '../panel/types';
|
||||||
import { Orientation, Sizing } from '../splitview/core/splitview';
|
import { Orientation, Sizing } from '../splitview/splitview';
|
||||||
import { createComponent } from '../panel/componentFactory';
|
import { createComponent } from '../panel/componentFactory';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { Position } from '../dnd/droptarget';
|
import { Position } from '../dnd/droptarget';
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
GridviewPanelApi,
|
GridviewPanelApi,
|
||||||
GridviewPanelApiImpl,
|
GridviewPanelApiImpl,
|
||||||
} from '../api/gridviewPanelApi';
|
} from '../api/gridviewPanelApi';
|
||||||
import { LayoutPriority } from '../splitview/core/splitview';
|
import { LayoutPriority } from '../splitview/splitview';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { IViewSize } from './gridview';
|
import { IViewSize } from './gridview';
|
||||||
|
|
||||||
|
@ -3,11 +3,7 @@
|
|||||||
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import {
|
import { IView, LayoutPriority, Orientation } from '../splitview/splitview';
|
||||||
IView,
|
|
||||||
LayoutPriority,
|
|
||||||
Orientation,
|
|
||||||
} from '../splitview/core/splitview';
|
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { IGridView } from './gridview';
|
import { IGridView } from './gridview';
|
||||||
import { IDisposable } from '../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { GridviewPanel } from './gridviewPanel';
|
import { GridviewPanel } from './gridviewPanel';
|
||||||
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
|
import { ISplitviewStyles, Orientation } from '../splitview/splitview';
|
||||||
import { FrameworkFactory } from '../types';
|
import { FrameworkFactory } from '../types';
|
||||||
|
|
||||||
export interface GridviewComponentOptions {
|
export interface GridviewComponentOptions {
|
||||||
|
@ -18,8 +18,8 @@ export {
|
|||||||
export * from './panel/types';
|
export * from './panel/types';
|
||||||
export * from './panel/componentFactory';
|
export * from './panel/componentFactory';
|
||||||
|
|
||||||
export * from './splitview/core/splitview';
|
export * from './splitview/splitview';
|
||||||
export * from './splitview/core/options';
|
export * from './splitview/options';
|
||||||
|
|
||||||
export * from './paneview/paneview';
|
export * from './paneview/paneview';
|
||||||
export * from './gridview/gridview';
|
export * from './gridview/gridview';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IDisposable } from '../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
import { LayoutPriority } from '../splitview/core/splitview';
|
import { LayoutPriority } from '../splitview/splitview';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key-value object of anything that is a valid JavaScript Object.
|
* A key-value object of anything that is a valid JavaScript Object.
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
import { Droptarget, DroptargetEvent } from '../dnd/droptarget';
|
import { Droptarget, DroptargetEvent } from '../dnd/droptarget';
|
||||||
import { Emitter } from '../events';
|
import { Emitter } from '../events';
|
||||||
import { IDisposable } from '../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
import { Orientation } from '../splitview/core/splitview';
|
import { Orientation } from '../splitview/splitview';
|
||||||
import { IPaneviewComponent } from './paneviewComponent';
|
import { IPaneviewComponent } from './paneviewComponent';
|
||||||
import {
|
import {
|
||||||
IPaneviewPanel,
|
IPaneviewPanel,
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
Orientation,
|
Orientation,
|
||||||
ISplitViewDescriptor,
|
ISplitViewDescriptor,
|
||||||
Sizing,
|
Sizing,
|
||||||
} from '../splitview/core/splitview';
|
} from '../splitview/splitview';
|
||||||
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { addClasses, removeClasses } from '../dom';
|
import { addClasses, removeClasses } from '../dom';
|
||||||
|
@ -6,11 +6,7 @@ import {
|
|||||||
IDisposable,
|
IDisposable,
|
||||||
MutableDisposable,
|
MutableDisposable,
|
||||||
} from '../lifecycle';
|
} from '../lifecycle';
|
||||||
import {
|
import { LayoutPriority, Orientation, Sizing } from '../splitview/splitview';
|
||||||
LayoutPriority,
|
|
||||||
Orientation,
|
|
||||||
Sizing,
|
|
||||||
} from '../splitview/core/splitview';
|
|
||||||
import { PaneviewComponentOptions } from './options';
|
import { PaneviewComponentOptions } from './options';
|
||||||
import { Paneview } from './paneview';
|
import { Paneview } from './paneview';
|
||||||
import {
|
import {
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
PanelUpdateEvent,
|
PanelUpdateEvent,
|
||||||
Parameters,
|
Parameters,
|
||||||
} from '../panel/types';
|
} from '../panel/types';
|
||||||
import { IView, Orientation } from '../splitview/core/splitview';
|
import { IView, Orientation } from '../splitview/splitview';
|
||||||
|
|
||||||
export interface PanePanelViewState extends BasePanelViewState {
|
export interface PanePanelViewState extends BasePanelViewState {
|
||||||
headerComponent?: string;
|
headerComponent?: string;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { IPanel, PanelInitParameters } from '../../panel/types';
|
import { IPanel, PanelInitParameters } from '../panel/types';
|
||||||
import { IView, SplitViewOptions, LayoutPriority } from './splitview';
|
import { IView, SplitViewOptions, LayoutPriority } from './splitview';
|
||||||
import { FrameworkFactory } from '../../types';
|
import { FrameworkFactory } from '../types';
|
||||||
import { SplitviewPanel } from '../splitviewPanel';
|
import { SplitviewPanel } from './splitviewPanel';
|
||||||
import { SplitviewComponent } from '../splitviewComponent';
|
import { SplitviewComponent } from './splitviewComponent';
|
||||||
|
|
||||||
export interface PanelViewInitParameters extends PanelInitParameters {
|
export interface PanelViewInitParameters extends PanelInitParameters {
|
||||||
minimumSize?: number;
|
minimumSize?: number;
|
@ -8,10 +8,10 @@ import {
|
|||||||
addClasses,
|
addClasses,
|
||||||
toggleClass,
|
toggleClass,
|
||||||
getElementsByTagName,
|
getElementsByTagName,
|
||||||
} from '../../dom';
|
} from '../dom';
|
||||||
import { clamp } from '../../math';
|
import { clamp } from '../math';
|
||||||
import { Event, Emitter } from '../../events';
|
import { Event, Emitter } from '../events';
|
||||||
import { pushToStart, pushToEnd, range, firstIndex } from '../../array';
|
import { pushToStart, pushToEnd, range, firstIndex } from '../array';
|
||||||
import { ViewItem } from './viewItem';
|
import { ViewItem } from './viewItem';
|
||||||
|
|
||||||
export enum Orientation {
|
export enum Orientation {
|
@ -10,8 +10,8 @@ import {
|
|||||||
Orientation,
|
Orientation,
|
||||||
Sizing,
|
Sizing,
|
||||||
Splitview,
|
Splitview,
|
||||||
} from './core/splitview';
|
} from './splitview';
|
||||||
import { SplitviewComponentOptions } from './core/options';
|
import { SplitviewComponentOptions } from './options';
|
||||||
import { BaseComponentOptions } from '../panel/types';
|
import { BaseComponentOptions } from '../panel/types';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
import { SplitviewPanel, ISplitviewPanel } from './splitviewPanel';
|
import { SplitviewPanel, ISplitviewPanel } from './splitviewPanel';
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { ISerializableView, PanelViewInitParameters } from './core/options';
|
import { ISerializableView, PanelViewInitParameters } from './options';
|
||||||
import {
|
import {
|
||||||
BasePanelView,
|
BasePanelView,
|
||||||
BasePanelViewExported,
|
BasePanelViewExported,
|
||||||
} from '../gridview/basePanelView';
|
} from '../gridview/basePanelView';
|
||||||
import { SplitviewPanelApiImpl } from '../api/splitviewPanelApi';
|
import { SplitviewPanelApiImpl } from '../api/splitviewPanelApi';
|
||||||
import { LayoutPriority, Orientation } from './core/splitview';
|
import { LayoutPriority, Orientation } from './splitview';
|
||||||
import { FunctionOrValue } from '../types';
|
import { FunctionOrValue } from '../types';
|
||||||
import { Emitter, Event } from '../events';
|
import { Emitter, Event } from '../events';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IDisposable } from '../../lifecycle';
|
import { IDisposable } from '../lifecycle';
|
||||||
import { clamp } from '../../math';
|
import { clamp } from '../math';
|
||||||
import { IView, LayoutPriority } from './splitview';
|
import { IView, LayoutPriority } from './splitview';
|
||||||
|
|
||||||
export class ViewItem {
|
export class ViewItem {
|
@ -1,14 +1,13 @@
|
|||||||
const { name } = require('./package');
|
import { JestConfigWithTsJest } from 'ts-jest';
|
||||||
|
import { join, normalize } from 'path';
|
||||||
|
|
||||||
const baseConfig = require('../../jest.config.base');
|
const tsconfig = normalize(join(__dirname, '..', '..', 'tsconfig.test.json'));
|
||||||
|
|
||||||
console.log('loaded');
|
const config: JestConfigWithTsJest = {
|
||||||
|
preset: 'ts-jest',
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
roots: ['<rootDir>/packages/dockview'],
|
roots: ['<rootDir>/packages/dockview'],
|
||||||
modulePaths: ['<rootDir>/packages/dockview/src'],
|
modulePaths: ['<rootDir>/packages/dockview/src'],
|
||||||
displayName: { name, color: 'blue' },
|
displayName: { name: 'dockview', color: 'blue' },
|
||||||
rootDir: '../../',
|
rootDir: '../../',
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'<rootDir>/packages/dockview/src/**/*.{js,jsx,ts,tsx}',
|
'<rootDir>/packages/dockview/src/**/*.{js,jsx,ts,tsx}',
|
||||||
@ -24,4 +23,14 @@ module.exports = {
|
|||||||
coverageDirectory: '<rootDir>/packages/dockview/coverage/',
|
coverageDirectory: '<rootDir>/packages/dockview/coverage/',
|
||||||
testResultsProcessor: 'jest-sonar-reporter',
|
testResultsProcessor: 'jest-sonar-reporter',
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.tsx?$': [
|
||||||
|
'ts-jest',
|
||||||
|
{
|
||||||
|
tsconfig,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
@ -4,7 +4,6 @@ import { IDockviewPanelProps } from '../dockview/dockview';
|
|||||||
import {
|
import {
|
||||||
DockviewEmitter,
|
DockviewEmitter,
|
||||||
DockviewEvent,
|
DockviewEvent,
|
||||||
DockviewGroupPanel,
|
|
||||||
PanelUpdateEvent,
|
PanelUpdateEvent,
|
||||||
IContentRenderer,
|
IContentRenderer,
|
||||||
GroupPanelContentPartInitParameters,
|
GroupPanelContentPartInitParameters,
|
||||||
@ -13,8 +12,6 @@ import {
|
|||||||
export class ReactPanelContentPart implements IContentRenderer {
|
export class ReactPanelContentPart implements IContentRenderer {
|
||||||
private _element: HTMLElement;
|
private _element: HTMLElement;
|
||||||
private part?: ReactPart<IDockviewPanelProps>;
|
private part?: ReactPart<IDockviewPanelProps>;
|
||||||
//
|
|
||||||
private _group: DockviewGroupPanel | undefined;
|
|
||||||
|
|
||||||
private readonly _onDidFocus = new DockviewEmitter<void>();
|
private readonly _onDidFocus = new DockviewEmitter<void>();
|
||||||
readonly onDidFocus: DockviewEvent<void> = this._onDidFocus.event;
|
readonly onDidFocus: DockviewEvent<void> = this._onDidFocus.event;
|
||||||
@ -56,13 +53,6 @@ export class ReactPanelContentPart implements IContentRenderer {
|
|||||||
this.part?.update(event.params);
|
this.part?.update(event.params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateParentGroup(
|
|
||||||
group: DockviewGroupPanel,
|
|
||||||
_isPanelVisible: boolean
|
|
||||||
): void {
|
|
||||||
this._group = group;
|
|
||||||
}
|
|
||||||
|
|
||||||
public layout(_width: number, _height: number): void {
|
public layout(_width: number, _height: number): void {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import { ReactPart, ReactPortalStore } from '../react';
|
|||||||
import { IGroupPanelBaseProps } from './dockview';
|
import { IGroupPanelBaseProps } from './dockview';
|
||||||
import {
|
import {
|
||||||
PanelUpdateEvent,
|
PanelUpdateEvent,
|
||||||
DockviewGroupPanel,
|
|
||||||
ITabRenderer,
|
ITabRenderer,
|
||||||
GroupPanelPartInitParameters,
|
GroupPanelPartInitParameters,
|
||||||
} from 'dockview-core';
|
} from 'dockview-core';
|
||||||
@ -50,13 +49,6 @@ export class ReactPanelHeaderPart implements ITabRenderer {
|
|||||||
// noop - retrieval from api
|
// noop - retrieval from api
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateParentGroup(
|
|
||||||
_group: DockviewGroupPanel,
|
|
||||||
_isPanelVisible: boolean
|
|
||||||
): void {
|
|
||||||
// noop - retrieval from api
|
|
||||||
}
|
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
this.part?.dispose();
|
this.part?.dispose();
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,6 @@ export interface IWatermarkPanelProps extends IGroupPanelBaseProps {
|
|||||||
export class ReactWatermarkPart implements IWatermarkRenderer {
|
export class ReactWatermarkPart implements IWatermarkRenderer {
|
||||||
private _element: HTMLElement;
|
private _element: HTMLElement;
|
||||||
private part?: ReactPart<IWatermarkPanelProps>;
|
private part?: ReactPart<IWatermarkPanelProps>;
|
||||||
private _groupRef: { value: DockviewGroupPanel | undefined } = {
|
|
||||||
value: undefined,
|
|
||||||
};
|
|
||||||
private parameters: GroupPanelPartInitParameters | undefined;
|
private parameters: GroupPanelPartInitParameters | undefined;
|
||||||
|
|
||||||
get element(): HTMLElement {
|
get element(): HTMLElement {
|
||||||
@ -45,11 +42,7 @@ export class ReactWatermarkPart implements IWatermarkRenderer {
|
|||||||
api: parameters.api,
|
api: parameters.api,
|
||||||
containerApi: parameters.containerApi,
|
containerApi: parameters.containerApi,
|
||||||
close: () => {
|
close: () => {
|
||||||
if (this._groupRef.value) {
|
parameters.containerApi.removeGroup(parameters.api.group);
|
||||||
parameters.containerApi.removeGroup(
|
|
||||||
this._groupRef.value
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -72,11 +65,10 @@ export class ReactWatermarkPart implements IWatermarkRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateParentGroup(
|
updateParentGroup(
|
||||||
group: DockviewGroupPanel,
|
_group: DockviewGroupPanel,
|
||||||
_isPanelVisible: boolean
|
_isPanelVisible: boolean
|
||||||
): void {
|
): void {
|
||||||
// noop - retrieval from api
|
// noop
|
||||||
this._groupRef.value = group;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
import {
|
|
||||||
GroupPanelPartInitParameters,
|
|
||||||
IContentRenderer,
|
|
||||||
DockviewGroupPanel,
|
|
||||||
HostedContainer,
|
|
||||||
PanelUpdateEvent,
|
|
||||||
DockviewEvent,
|
|
||||||
} from 'dockview-core';
|
|
||||||
import { ReactPart, ReactPortalStore } from '../../react';
|
|
||||||
import { IDockviewPanelProps } from '../dockview';
|
|
||||||
|
|
||||||
export class ReactContentRenderer implements IContentRenderer {
|
|
||||||
private _hostedContainer: HostedContainer;
|
|
||||||
|
|
||||||
private _element: HTMLElement;
|
|
||||||
private part?: ReactPart<IDockviewPanelProps>;
|
|
||||||
private _group: DockviewGroupPanel | undefined;
|
|
||||||
|
|
||||||
private parameters: GroupPanelPartInitParameters | undefined;
|
|
||||||
|
|
||||||
get element(): HTMLElement {
|
|
||||||
return this._element;
|
|
||||||
}
|
|
||||||
|
|
||||||
get onDidBlur(): DockviewEvent<void> {
|
|
||||||
return this._hostedContainer.onDidBlur;
|
|
||||||
}
|
|
||||||
|
|
||||||
get onDidFocus(): DockviewEvent<void> {
|
|
||||||
return this._hostedContainer.onDidFocus;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
public readonly id: string,
|
|
||||||
private readonly component: React.FunctionComponent<IDockviewPanelProps>,
|
|
||||||
private readonly reactPortalStore: ReactPortalStore
|
|
||||||
) {
|
|
||||||
this._hostedContainer = new HostedContainer({
|
|
||||||
id,
|
|
||||||
parent: document
|
|
||||||
.getElementsByClassName('dockview')
|
|
||||||
.item(0) as HTMLElement,
|
|
||||||
});
|
|
||||||
|
|
||||||
this._element = document.createElement('div');
|
|
||||||
this._element.style.height = '100%';
|
|
||||||
this._element.style.width = '100%';
|
|
||||||
}
|
|
||||||
|
|
||||||
focus(): void {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(parameters: GroupPanelPartInitParameters): void {
|
|
||||||
this.parameters = parameters;
|
|
||||||
|
|
||||||
parameters.api.onDidVisibilityChange((event) => {
|
|
||||||
if (event.isVisible) {
|
|
||||||
this._hostedContainer.show();
|
|
||||||
this._hostedContainer.layout(this.element);
|
|
||||||
} else {
|
|
||||||
this._hostedContainer.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.part = new ReactPart(
|
|
||||||
this._hostedContainer.element,
|
|
||||||
this.reactPortalStore,
|
|
||||||
this.component,
|
|
||||||
{
|
|
||||||
params: parameters.params,
|
|
||||||
api: parameters.api,
|
|
||||||
containerApi: parameters.containerApi,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public update(params: PanelUpdateEvent): void {
|
|
||||||
if (this.parameters) {
|
|
||||||
this.parameters.params = params.params;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.part?.update(params.params);
|
|
||||||
}
|
|
||||||
|
|
||||||
public updateParentGroup(
|
|
||||||
group: DockviewGroupPanel,
|
|
||||||
_isPanelVisible: boolean
|
|
||||||
): void {
|
|
||||||
this._group = group;
|
|
||||||
}
|
|
||||||
|
|
||||||
public layout(_width: number, _height: number): void {
|
|
||||||
this._hostedContainer.layout(this.element);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dispose(): void {
|
|
||||||
this.part?.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
import {
|
|
||||||
GroupPanelPartInitParameters,
|
|
||||||
IContentRenderer,
|
|
||||||
DockviewGroupPanel,
|
|
||||||
HostedContainer,
|
|
||||||
PanelUpdateEvent,
|
|
||||||
} from 'dockview-core';
|
|
||||||
|
|
||||||
export class WebviewContentRenderer implements IContentRenderer {
|
|
||||||
private _hostedContainer: HostedContainer;
|
|
||||||
private _element: HTMLElement;
|
|
||||||
|
|
||||||
private parameters: GroupPanelPartInitParameters | undefined;
|
|
||||||
|
|
||||||
get element(): HTMLElement {
|
|
||||||
return this._element;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(public readonly id: string) {
|
|
||||||
this._hostedContainer = new HostedContainer({ id });
|
|
||||||
|
|
||||||
this._element = document.createElement('div');
|
|
||||||
this._element.style.height = '100%';
|
|
||||||
this._element.style.width = '100%';
|
|
||||||
}
|
|
||||||
|
|
||||||
focus(): void {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(parameters: GroupPanelPartInitParameters): void {
|
|
||||||
this.parameters = parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public update(params: PanelUpdateEvent): void {
|
|
||||||
if (this.parameters) {
|
|
||||||
this.parameters.params = params.params;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public updateParentGroup(
|
|
||||||
_group: DockviewGroupPanel,
|
|
||||||
_isPanelVisible: boolean
|
|
||||||
): void {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public layout(_width: number, _height: number): void {
|
|
||||||
this._hostedContainer.layout(this._element);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dispose(): void {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user