dockview 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/groupPanelApi.d.ts +6 -13
- package/dist/cjs/api/groupPanelApi.js +1 -12
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +4 -9
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +1 -6
- package/dist/cjs/dockview/dockviewComponent.js +1 -16
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +2 -4
- package/dist/cjs/dockview/dockviewGroupPanel.js +12 -31
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +0 -1
- package/dist/cjs/groupview/groupPanel.d.ts +0 -3
- package/dist/cjs/groupview/tab.d.ts +1 -2
- package/dist/cjs/groupview/tab.js +0 -6
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.js +0 -12
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/types.d.ts +0 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/deserializer.js +0 -2
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/defaultTab.js +1 -1
- package/dist/cjs/react/dockview/defaultTab.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +1 -2
- package/dist/cjs/react/dockview/dockview.js +0 -15
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/dockview.amd.js +21 -86
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +20 -85
- package/dist/dockview.cjs.js +21 -86
- package/dist/dockview.esm.js +21 -86
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +21 -86
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +20 -85
- package/dist/esm/api/groupPanelApi.d.ts +6 -13
- package/dist/esm/api/groupPanelApi.js +1 -8
- package/dist/esm/dockview/components/tab/defaultTab.js +4 -9
- package/dist/esm/dockview/dockviewComponent.d.ts +1 -6
- package/dist/esm/dockview/dockviewComponent.js +1 -16
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +2 -4
- package/dist/esm/dockview/dockviewGroupPanel.js +12 -27
- package/dist/esm/dockview/options.d.ts +0 -1
- package/dist/esm/groupview/groupPanel.d.ts +0 -3
- package/dist/esm/groupview/tab.d.ts +1 -2
- package/dist/esm/groupview/tab.js +0 -6
- package/dist/esm/groupview/titlebar/tabsContainer.js +0 -1
- package/dist/esm/groupview/types.d.ts +0 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/react/deserializer.js +0 -2
- package/dist/esm/react/dockview/defaultTab.js +1 -1
- package/dist/esm/react/dockview/dockview.d.ts +1 -2
- package/dist/esm/react/dockview/dockview.js +0 -15
- package/dist/styles/dockview.css +0 -3
- package/package.json +2 -2
package/dist/dockview.noStyle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.5.
|
|
3
|
+
* @version 1.5.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -2676,7 +2676,6 @@
|
|
|
2676
2676
|
exports.MouseEventKind = void 0;
|
|
2677
2677
|
(function (MouseEventKind) {
|
|
2678
2678
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2679
|
-
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2680
2679
|
})(exports.MouseEventKind || (exports.MouseEventKind = {}));
|
|
2681
2680
|
class Tab extends CompositeDisposable {
|
|
2682
2681
|
constructor(panelId, accessor, group) {
|
|
@@ -2723,11 +2722,6 @@
|
|
|
2723
2722
|
*/
|
|
2724
2723
|
event.stopPropagation();
|
|
2725
2724
|
this._onChanged.fire({ kind: exports.MouseEventKind.CLICK, event });
|
|
2726
|
-
}), addDisposableListener(this._element, 'contextmenu', (event) => {
|
|
2727
|
-
this._onChanged.fire({
|
|
2728
|
-
kind: exports.MouseEventKind.CONTEXT_MENU,
|
|
2729
|
-
event,
|
|
2730
|
-
});
|
|
2731
2725
|
}));
|
|
2732
2726
|
this.droptarget = new Droptarget(this._element, {
|
|
2733
2727
|
validOverlays: 'none',
|
|
@@ -2917,7 +2911,6 @@
|
|
|
2917
2911
|
var _a;
|
|
2918
2912
|
const alreadyFocused = panel.id === ((_a = this.group.model.activePanel) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
2919
2913
|
this.group.model.isContentFocused;
|
|
2920
|
-
this.accessor.fireMouseEvent(Object.assign(Object.assign({}, event), { panel, tab: true }));
|
|
2921
2914
|
const isLeftClick = event.event.button === 0;
|
|
2922
2915
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2923
2916
|
return;
|
|
@@ -3676,24 +3669,17 @@
|
|
|
3676
3669
|
this.panel = panel;
|
|
3677
3670
|
this._onDidTitleChange = new Emitter();
|
|
3678
3671
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3679
|
-
this._titleChanged = new Emitter();
|
|
3680
|
-
this.titleChanged = this._titleChanged.event;
|
|
3681
|
-
this._suppressClosableChanged = new Emitter();
|
|
3682
|
-
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3683
3672
|
this._onDidActiveGroupChange = new Emitter();
|
|
3684
3673
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3685
3674
|
this._onDidGroupChange = new Emitter();
|
|
3686
3675
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3687
3676
|
this.disposable = new MutableDisposable();
|
|
3688
3677
|
this._group = group;
|
|
3689
|
-
this.addDisposables(this.disposable, this._onDidTitleChange, this.
|
|
3678
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3690
3679
|
}
|
|
3691
3680
|
get title() {
|
|
3692
3681
|
return this.panel.title;
|
|
3693
3682
|
}
|
|
3694
|
-
get suppressClosable() {
|
|
3695
|
-
return !!this.panel.suppressClosable;
|
|
3696
|
-
}
|
|
3697
3683
|
get isGroupActive() {
|
|
3698
3684
|
var _a;
|
|
3699
3685
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
@@ -3731,27 +3717,19 @@
|
|
|
3731
3717
|
this.id = id;
|
|
3732
3718
|
this.containerApi = containerApi;
|
|
3733
3719
|
this.mutableDisposable = new MutableDisposable();
|
|
3734
|
-
this._suppressClosable = false;
|
|
3735
3720
|
this._title = '';
|
|
3736
3721
|
this._group = group;
|
|
3737
3722
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3738
3723
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3739
3724
|
accessor.setActivePanel(this);
|
|
3740
|
-
}), this.api.onDidTitleChange((event) => {
|
|
3741
|
-
const title = event.title;
|
|
3742
|
-
this.update({ params: { title } });
|
|
3743
3725
|
}));
|
|
3744
3726
|
}
|
|
3745
3727
|
get params() {
|
|
3746
|
-
|
|
3747
|
-
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
3728
|
+
return this._params;
|
|
3748
3729
|
}
|
|
3749
3730
|
get title() {
|
|
3750
3731
|
return this._title;
|
|
3751
3732
|
}
|
|
3752
|
-
get suppressClosable() {
|
|
3753
|
-
return this._suppressClosable;
|
|
3754
|
-
}
|
|
3755
3733
|
get group() {
|
|
3756
3734
|
return this._group;
|
|
3757
3735
|
}
|
|
@@ -3763,7 +3741,6 @@
|
|
|
3763
3741
|
this._params = params.params;
|
|
3764
3742
|
this._view = params.view;
|
|
3765
3743
|
this.setTitle(params.title);
|
|
3766
|
-
this.setSuppressClosable(params.suppressClosable || false);
|
|
3767
3744
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3768
3745
|
}
|
|
3769
3746
|
focus() {
|
|
@@ -3776,26 +3753,21 @@
|
|
|
3776
3753
|
params: Object.keys(this._params || {}).length > 0
|
|
3777
3754
|
? this._params
|
|
3778
3755
|
: undefined,
|
|
3779
|
-
suppressClosable: this.suppressClosable || undefined,
|
|
3780
3756
|
title: this.title,
|
|
3781
3757
|
};
|
|
3782
3758
|
}
|
|
3783
3759
|
setTitle(title) {
|
|
3784
|
-
var _a;
|
|
3760
|
+
var _a, _b;
|
|
3785
3761
|
const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
|
|
3786
3762
|
if (didTitleChange) {
|
|
3787
3763
|
this._title = title;
|
|
3788
|
-
this.
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
const didSuppressChangableClose = suppressClosable !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.suppressClosable);
|
|
3794
|
-
if (didSuppressChangableClose) {
|
|
3795
|
-
this._suppressClosable = suppressClosable;
|
|
3796
|
-
this.api._suppressClosableChanged.fire({
|
|
3797
|
-
suppressClosable: !!this.suppressClosable,
|
|
3764
|
+
(_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
|
|
3765
|
+
params: {
|
|
3766
|
+
params: this._params,
|
|
3767
|
+
title: this.title,
|
|
3768
|
+
},
|
|
3798
3769
|
});
|
|
3770
|
+
this.api._onDidTitleChange.fire({ title });
|
|
3799
3771
|
}
|
|
3800
3772
|
}
|
|
3801
3773
|
update(event) {
|
|
@@ -3803,16 +3775,15 @@
|
|
|
3803
3775
|
const params = event.params;
|
|
3804
3776
|
this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
|
|
3805
3777
|
if (typeof params.title === 'string') {
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3778
|
+
if (params.title !== this.title) {
|
|
3779
|
+
this._title = params.title;
|
|
3780
|
+
this.api._onDidTitleChange.fire({ title: this.title });
|
|
3781
|
+
}
|
|
3810
3782
|
}
|
|
3811
3783
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
|
|
3812
3784
|
params: {
|
|
3813
3785
|
params: this._params,
|
|
3814
3786
|
title: this.title,
|
|
3815
|
-
suppressClosable: this.suppressClosable,
|
|
3816
3787
|
},
|
|
3817
3788
|
});
|
|
3818
3789
|
}
|
|
@@ -4040,15 +4011,10 @@
|
|
|
4040
4011
|
init(params) {
|
|
4041
4012
|
this.params = params;
|
|
4042
4013
|
this._content.textContent = params.title;
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
});
|
|
4048
|
-
}
|
|
4049
|
-
else {
|
|
4050
|
-
this.action.classList.add('disable-close');
|
|
4051
|
-
}
|
|
4014
|
+
addDisposableListener(this.action, 'click', (ev) => {
|
|
4015
|
+
ev.preventDefault(); //
|
|
4016
|
+
this.params.api.close();
|
|
4017
|
+
});
|
|
4052
4018
|
}
|
|
4053
4019
|
updateParentGroup(group, isPanelVisible) {
|
|
4054
4020
|
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
@@ -4389,8 +4355,6 @@
|
|
|
4389
4355
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4390
4356
|
styles: options.styles,
|
|
4391
4357
|
});
|
|
4392
|
-
this._onTabContextMenu = new Emitter();
|
|
4393
|
-
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4394
4358
|
this._onDidDrop = new Emitter();
|
|
4395
4359
|
this.onDidDrop = this._onDidDrop.event;
|
|
4396
4360
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -4401,7 +4365,7 @@
|
|
|
4401
4365
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
4402
4366
|
this._onDidActivePanelChange = new Emitter();
|
|
4403
4367
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4404
|
-
this.addDisposables(this.
|
|
4368
|
+
this.addDisposables(this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4405
4369
|
this._bufferOnDidLayoutChange.fire();
|
|
4406
4370
|
}));
|
|
4407
4371
|
this._options = options;
|
|
@@ -4601,17 +4565,6 @@
|
|
|
4601
4565
|
group.value.model.closeAllPanels();
|
|
4602
4566
|
}
|
|
4603
4567
|
}
|
|
4604
|
-
fireMouseEvent(event) {
|
|
4605
|
-
if (event.kind === exports.MouseEventKind.CONTEXT_MENU) {
|
|
4606
|
-
if (event.tab && event.panel) {
|
|
4607
|
-
this._onTabContextMenu.fire({
|
|
4608
|
-
event: event.event,
|
|
4609
|
-
api: this._api,
|
|
4610
|
-
panel: event.panel,
|
|
4611
|
-
});
|
|
4612
|
-
}
|
|
4613
|
-
}
|
|
4614
|
-
}
|
|
4615
4568
|
addPanel(options) {
|
|
4616
4569
|
var _a, _b;
|
|
4617
4570
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
@@ -4818,7 +4771,6 @@
|
|
|
4818
4771
|
panel.init({
|
|
4819
4772
|
view,
|
|
4820
4773
|
title: options.title || options.id,
|
|
4821
|
-
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4822
4774
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4823
4775
|
});
|
|
4824
4776
|
return panel;
|
|
@@ -6301,7 +6253,6 @@
|
|
|
6301
6253
|
const panelId = panelData.id;
|
|
6302
6254
|
const params = panelData.params;
|
|
6303
6255
|
const title = panelData.title;
|
|
6304
|
-
const suppressClosable = panelData.suppressClosable;
|
|
6305
6256
|
const viewData = panelData.view;
|
|
6306
6257
|
let tab;
|
|
6307
6258
|
if ((_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id) {
|
|
@@ -6321,7 +6272,6 @@
|
|
|
6321
6272
|
panel.init({
|
|
6322
6273
|
view,
|
|
6323
6274
|
title,
|
|
6324
|
-
suppressClosable,
|
|
6325
6275
|
params: params || {},
|
|
6326
6276
|
});
|
|
6327
6277
|
return panel;
|
|
@@ -6576,21 +6526,6 @@
|
|
|
6576
6526
|
frameworkTabComponents: props.tabComponents,
|
|
6577
6527
|
});
|
|
6578
6528
|
}, [props.tabComponents]);
|
|
6579
|
-
React__namespace.useEffect(() => {
|
|
6580
|
-
if (!props.onTabContextMenu || !dockviewRef.current) {
|
|
6581
|
-
return () => {
|
|
6582
|
-
//noop
|
|
6583
|
-
};
|
|
6584
|
-
}
|
|
6585
|
-
const disposable = dockviewRef.current.onTabContextMenu((event) => {
|
|
6586
|
-
if (props.onTabContextMenu) {
|
|
6587
|
-
props.onTabContextMenu(event);
|
|
6588
|
-
}
|
|
6589
|
-
});
|
|
6590
|
-
return () => {
|
|
6591
|
-
disposable.dispose();
|
|
6592
|
-
};
|
|
6593
|
-
}, [props.onTabContextMenu]);
|
|
6594
6529
|
React__namespace.useEffect(() => {
|
|
6595
6530
|
if (!dockviewRef.current) {
|
|
6596
6531
|
return;
|
|
@@ -6657,7 +6592,7 @@
|
|
|
6657
6592
|
const iconClassname = React__namespace.useMemo(() => {
|
|
6658
6593
|
const cn = ['dockview-react-tab-action'];
|
|
6659
6594
|
return cn.join(',');
|
|
6660
|
-
}, [
|
|
6595
|
+
}, []);
|
|
6661
6596
|
return (React__namespace.createElement("div", Object.assign({}, rest, { onClick: onClick, className: "dockview-react-tab" }),
|
|
6662
6597
|
React__namespace.createElement("span", { className: "dockview-react-tab-title" }, api.title),
|
|
6663
6598
|
React__namespace.createElement("div", { className: iconClassname, onClick: onClose },
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { Emitter } from '../events';
|
|
1
|
+
import { Emitter, Event } from '../events';
|
|
2
2
|
import { GridviewPanelApiImpl, GridviewPanelApi } from './gridviewPanelApi';
|
|
3
3
|
import { IDockviewPanel } from '../groupview/groupPanel';
|
|
4
4
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
5
5
|
export interface TitleEvent {
|
|
6
6
|
readonly title: string;
|
|
7
7
|
}
|
|
8
|
-
export interface SuppressClosableEvent {
|
|
9
|
-
readonly suppressClosable: boolean;
|
|
10
|
-
}
|
|
11
8
|
export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible'> {
|
|
12
9
|
readonly group: GroupPanel;
|
|
13
10
|
readonly isGroupActive: boolean;
|
|
14
11
|
readonly title: string;
|
|
15
|
-
readonly
|
|
12
|
+
readonly onDidActiveGroupChange: Event<void>;
|
|
13
|
+
readonly onDidGroupChange: Event<void>;
|
|
16
14
|
close(): void;
|
|
17
15
|
setTitle(title: string): void;
|
|
18
16
|
}
|
|
@@ -20,18 +18,13 @@ export declare class DockviewPanelApiImpl extends GridviewPanelApiImpl implement
|
|
|
20
18
|
private panel;
|
|
21
19
|
private _group;
|
|
22
20
|
readonly _onDidTitleChange: Emitter<TitleEvent>;
|
|
23
|
-
readonly onDidTitleChange:
|
|
24
|
-
readonly _titleChanged: Emitter<TitleEvent>;
|
|
25
|
-
readonly titleChanged: import("../events").Event<TitleEvent>;
|
|
26
|
-
readonly _suppressClosableChanged: Emitter<SuppressClosableEvent>;
|
|
27
|
-
readonly suppressClosableChanged: import("../events").Event<SuppressClosableEvent>;
|
|
21
|
+
readonly onDidTitleChange: Event<TitleEvent>;
|
|
28
22
|
private readonly _onDidActiveGroupChange;
|
|
29
|
-
readonly onDidActiveGroupChange:
|
|
23
|
+
readonly onDidActiveGroupChange: Event<void>;
|
|
30
24
|
private readonly _onDidGroupChange;
|
|
31
|
-
readonly onDidGroupChange:
|
|
25
|
+
readonly onDidGroupChange: Event<void>;
|
|
32
26
|
private disposable;
|
|
33
27
|
get title(): string;
|
|
34
|
-
get suppressClosable(): boolean;
|
|
35
28
|
get isGroupActive(): boolean;
|
|
36
29
|
set group(value: GroupPanel);
|
|
37
30
|
get group(): GroupPanel;
|
|
@@ -7,24 +7,17 @@ export class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
7
7
|
this.panel = panel;
|
|
8
8
|
this._onDidTitleChange = new Emitter();
|
|
9
9
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
10
|
-
this._titleChanged = new Emitter();
|
|
11
|
-
this.titleChanged = this._titleChanged.event;
|
|
12
|
-
this._suppressClosableChanged = new Emitter();
|
|
13
|
-
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
14
10
|
this._onDidActiveGroupChange = new Emitter();
|
|
15
11
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
16
12
|
this._onDidGroupChange = new Emitter();
|
|
17
13
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
18
14
|
this.disposable = new MutableDisposable();
|
|
19
15
|
this._group = group;
|
|
20
|
-
this.addDisposables(this.disposable, this._onDidTitleChange, this.
|
|
16
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
21
17
|
}
|
|
22
18
|
get title() {
|
|
23
19
|
return this.panel.title;
|
|
24
20
|
}
|
|
25
|
-
get suppressClosable() {
|
|
26
|
-
return !!this.panel.suppressClosable;
|
|
27
|
-
}
|
|
28
21
|
get isGroupActive() {
|
|
29
22
|
var _a;
|
|
30
23
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
@@ -54,15 +54,10 @@ export class DefaultTab extends CompositeDisposable {
|
|
|
54
54
|
init(params) {
|
|
55
55
|
this.params = params;
|
|
56
56
|
this._content.textContent = params.title;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.action.classList.add('disable-close');
|
|
65
|
-
}
|
|
57
|
+
addDisposableListener(this.action, 'click', (ev) => {
|
|
58
|
+
ev.preventDefault(); //
|
|
59
|
+
this.params.api.close();
|
|
60
|
+
});
|
|
66
61
|
}
|
|
67
62
|
updateParentGroup(group, isPanelVisible) {
|
|
68
63
|
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
@@ -4,10 +4,9 @@ import { GroupviewPanelState, IDockviewPanel } from '../groupview/groupPanel';
|
|
|
4
4
|
import { Event } from '../events';
|
|
5
5
|
import { IWatermarkRenderer } from '../groupview/types';
|
|
6
6
|
import { IPanelDeserializer } from './deserializer';
|
|
7
|
-
import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, MovementOptions
|
|
7
|
+
import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, MovementOptions } from './options';
|
|
8
8
|
import { BaseGrid, IBaseGrid } from '../gridview/baseComponentGridview';
|
|
9
9
|
import { DockviewApi } from '../api/component.api';
|
|
10
|
-
import { LayoutMouseEvent } from '../groupview/tab';
|
|
11
10
|
import { Orientation } from '../splitview/core/splitview';
|
|
12
11
|
import { GroupOptions, GroupPanelViewState, GroupviewDropEvent } from '../groupview/groupview';
|
|
13
12
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
@@ -57,7 +56,6 @@ export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
|
|
|
57
56
|
createWatermarkComponent(): IWatermarkRenderer;
|
|
58
57
|
addEmptyGroup(options?: AddGroupOptions): void;
|
|
59
58
|
closeAllGroups(): void;
|
|
60
|
-
onTabContextMenu: Event<TabContextMenuEvent>;
|
|
61
59
|
moveToNext(options?: MovementOptions): void;
|
|
62
60
|
moveToPrevious(options?: MovementOptions): void;
|
|
63
61
|
setActivePanel(panel: IDockviewPanel): void;
|
|
@@ -73,8 +71,6 @@ export declare class DockviewComponent extends BaseGrid<GroupPanel> implements I
|
|
|
73
71
|
private _deserializer;
|
|
74
72
|
private _api;
|
|
75
73
|
private _options;
|
|
76
|
-
private readonly _onTabContextMenu;
|
|
77
|
-
readonly onTabContextMenu: Event<TabContextMenuEvent>;
|
|
78
74
|
private readonly _onDidDrop;
|
|
79
75
|
readonly onDidDrop: Event<DockviewDropEvent>;
|
|
80
76
|
private readonly _onDidRemovePanel;
|
|
@@ -109,7 +105,6 @@ export declare class DockviewComponent extends BaseGrid<GroupPanel> implements I
|
|
|
109
105
|
fromJSON(data: SerializedDockview): void;
|
|
110
106
|
clear(): void;
|
|
111
107
|
closeAllGroups(): void;
|
|
112
|
-
fireMouseEvent(event: LayoutMouseEvent): void;
|
|
113
108
|
addPanel(options: AddPanelOptions): IDockviewPanel;
|
|
114
109
|
removePanel(panel: IDockviewPanel, options?: {
|
|
115
110
|
removeEmptyGroup: boolean;
|
|
@@ -9,7 +9,6 @@ import { sequentialNumberGenerator } from '../math';
|
|
|
9
9
|
import { createComponent } from '../panel/componentFactory';
|
|
10
10
|
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
11
11
|
import { DockviewApi } from '../api/component.api';
|
|
12
|
-
import { MouseEventKind } from '../groupview/tab';
|
|
13
12
|
import { Orientation } from '../splitview/core/splitview';
|
|
14
13
|
import { DefaultTab } from './components/tab/defaultTab';
|
|
15
14
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
@@ -22,8 +21,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
22
21
|
orientation: options.orientation || Orientation.HORIZONTAL,
|
|
23
22
|
styles: options.styles,
|
|
24
23
|
});
|
|
25
|
-
this._onTabContextMenu = new Emitter();
|
|
26
|
-
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
27
24
|
this._onDidDrop = new Emitter();
|
|
28
25
|
this.onDidDrop = this._onDidDrop.event;
|
|
29
26
|
this._onDidRemovePanel = new Emitter();
|
|
@@ -34,7 +31,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
34
31
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
35
32
|
this._onDidActivePanelChange = new Emitter();
|
|
36
33
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
37
|
-
this.addDisposables(this.
|
|
34
|
+
this.addDisposables(this._onDidDrop, Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
38
35
|
this._bufferOnDidLayoutChange.fire();
|
|
39
36
|
}));
|
|
40
37
|
this._options = options;
|
|
@@ -234,17 +231,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
234
231
|
group.value.model.closeAllPanels();
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
|
-
fireMouseEvent(event) {
|
|
238
|
-
if (event.kind === MouseEventKind.CONTEXT_MENU) {
|
|
239
|
-
if (event.tab && event.panel) {
|
|
240
|
-
this._onTabContextMenu.fire({
|
|
241
|
-
event: event.event,
|
|
242
|
-
api: this._api,
|
|
243
|
-
panel: event.panel,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
234
|
addPanel(options) {
|
|
249
235
|
var _a, _b;
|
|
250
236
|
if (this.panels.find((_) => _.id === options.id)) {
|
|
@@ -451,7 +437,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
451
437
|
panel.init({
|
|
452
438
|
view,
|
|
453
439
|
title: options.title || options.id,
|
|
454
|
-
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
455
440
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
456
441
|
});
|
|
457
442
|
return panel;
|
|
@@ -3,6 +3,7 @@ import { DockviewPanelApiImpl } from '../api/groupPanelApi';
|
|
|
3
3
|
import { GroupPanelUpdateEvent, GroupviewPanelState, IDockviewPanel, IGroupPanelInitParameters } from '../groupview/groupPanel';
|
|
4
4
|
import { GroupPanel } from '../groupview/groupviewPanel';
|
|
5
5
|
import { CompositeDisposable } from '../lifecycle';
|
|
6
|
+
import { Parameters } from '../panel/types';
|
|
6
7
|
import { IGroupPanelView } from './defaultGroupPanelView';
|
|
7
8
|
import { DockviewComponent } from './dockviewComponent';
|
|
8
9
|
export declare class DockviewGroupPanel extends CompositeDisposable implements IDockviewPanel {
|
|
@@ -14,10 +15,8 @@ export declare class DockviewGroupPanel extends CompositeDisposable implements I
|
|
|
14
15
|
private _params?;
|
|
15
16
|
private _view?;
|
|
16
17
|
private _title;
|
|
17
|
-
|
|
18
|
-
get params(): any;
|
|
18
|
+
get params(): Parameters | undefined;
|
|
19
19
|
get title(): string;
|
|
20
|
-
get suppressClosable(): boolean;
|
|
21
20
|
get group(): GroupPanel;
|
|
22
21
|
get view(): IGroupPanelView | undefined;
|
|
23
22
|
constructor(id: string, accessor: DockviewComponent, containerApi: DockviewApi, group: GroupPanel);
|
|
@@ -25,7 +24,6 @@ export declare class DockviewGroupPanel extends CompositeDisposable implements I
|
|
|
25
24
|
focus(): void;
|
|
26
25
|
toJSON(): GroupviewPanelState;
|
|
27
26
|
setTitle(title: string): void;
|
|
28
|
-
setSuppressClosable(suppressClosable: boolean): void;
|
|
29
27
|
update(event: GroupPanelUpdateEvent): void;
|
|
30
28
|
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void;
|
|
31
29
|
layout(width: number, height: number): void;
|
|
@@ -6,27 +6,19 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
6
6
|
this.id = id;
|
|
7
7
|
this.containerApi = containerApi;
|
|
8
8
|
this.mutableDisposable = new MutableDisposable();
|
|
9
|
-
this._suppressClosable = false;
|
|
10
9
|
this._title = '';
|
|
11
10
|
this._group = group;
|
|
12
11
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
13
12
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
14
13
|
accessor.setActivePanel(this);
|
|
15
|
-
}), this.api.onDidTitleChange((event) => {
|
|
16
|
-
const title = event.title;
|
|
17
|
-
this.update({ params: { title } });
|
|
18
14
|
}));
|
|
19
15
|
}
|
|
20
16
|
get params() {
|
|
21
|
-
|
|
22
|
-
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
17
|
+
return this._params;
|
|
23
18
|
}
|
|
24
19
|
get title() {
|
|
25
20
|
return this._title;
|
|
26
21
|
}
|
|
27
|
-
get suppressClosable() {
|
|
28
|
-
return this._suppressClosable;
|
|
29
|
-
}
|
|
30
22
|
get group() {
|
|
31
23
|
return this._group;
|
|
32
24
|
}
|
|
@@ -38,7 +30,6 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
38
30
|
this._params = params.params;
|
|
39
31
|
this._view = params.view;
|
|
40
32
|
this.setTitle(params.title);
|
|
41
|
-
this.setSuppressClosable(params.suppressClosable || false);
|
|
42
33
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
43
34
|
}
|
|
44
35
|
focus() {
|
|
@@ -51,26 +42,21 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
51
42
|
params: Object.keys(this._params || {}).length > 0
|
|
52
43
|
? this._params
|
|
53
44
|
: undefined,
|
|
54
|
-
suppressClosable: this.suppressClosable || undefined,
|
|
55
45
|
title: this.title,
|
|
56
46
|
};
|
|
57
47
|
}
|
|
58
48
|
setTitle(title) {
|
|
59
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
60
50
|
const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
|
|
61
51
|
if (didTitleChange) {
|
|
62
52
|
this._title = title;
|
|
63
|
-
this.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const didSuppressChangableClose = suppressClosable !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.suppressClosable);
|
|
69
|
-
if (didSuppressChangableClose) {
|
|
70
|
-
this._suppressClosable = suppressClosable;
|
|
71
|
-
this.api._suppressClosableChanged.fire({
|
|
72
|
-
suppressClosable: !!this.suppressClosable,
|
|
53
|
+
(_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
|
|
54
|
+
params: {
|
|
55
|
+
params: this._params,
|
|
56
|
+
title: this.title,
|
|
57
|
+
},
|
|
73
58
|
});
|
|
59
|
+
this.api._onDidTitleChange.fire({ title });
|
|
74
60
|
}
|
|
75
61
|
}
|
|
76
62
|
update(event) {
|
|
@@ -78,16 +64,15 @@ export class DockviewGroupPanel extends CompositeDisposable {
|
|
|
78
64
|
const params = event.params;
|
|
79
65
|
this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
|
|
80
66
|
if (typeof params.title === 'string') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
if (params.title !== this.title) {
|
|
68
|
+
this._title = params.title;
|
|
69
|
+
this.api._onDidTitleChange.fire({ title: this.title });
|
|
70
|
+
}
|
|
85
71
|
}
|
|
86
72
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
|
|
87
73
|
params: {
|
|
88
74
|
params: this._params,
|
|
89
75
|
title: this.title,
|
|
90
|
-
suppressClosable: this.suppressClosable,
|
|
91
76
|
},
|
|
92
77
|
});
|
|
93
78
|
}
|
|
@@ -10,14 +10,12 @@ export interface IGroupPanelInitParameters extends PanelInitParameters, HeaderPa
|
|
|
10
10
|
export declare type GroupPanelUpdateEvent = PanelUpdateEvent<{
|
|
11
11
|
params?: Parameters;
|
|
12
12
|
title?: string;
|
|
13
|
-
suppressClosable?: boolean;
|
|
14
13
|
}>;
|
|
15
14
|
export interface IDockviewPanel extends IDisposable, IPanel {
|
|
16
15
|
readonly view?: IGroupPanelView;
|
|
17
16
|
readonly group: GroupPanel;
|
|
18
17
|
readonly api: DockviewPanelApi;
|
|
19
18
|
readonly title: string;
|
|
20
|
-
readonly suppressClosable: boolean;
|
|
21
19
|
readonly params: Record<string, any> | undefined;
|
|
22
20
|
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void;
|
|
23
21
|
init(params: IGroupPanelInitParameters): void;
|
|
@@ -31,5 +29,4 @@ export interface GroupviewPanelState {
|
|
|
31
29
|
params?: {
|
|
32
30
|
[key: string]: any;
|
|
33
31
|
};
|
|
34
|
-
suppressClosable?: boolean;
|
|
35
32
|
}
|
|
@@ -6,8 +6,7 @@ import { IDockviewPanel } from './groupPanel';
|
|
|
6
6
|
import { GroupPanel } from './groupviewPanel';
|
|
7
7
|
import { DroptargetEvent } from '../dnd/droptarget';
|
|
8
8
|
export declare enum MouseEventKind {
|
|
9
|
-
CLICK = "CLICK"
|
|
10
|
-
CONTEXT_MENU = "CONTEXT_MENU"
|
|
9
|
+
CLICK = "CLICK"
|
|
11
10
|
}
|
|
12
11
|
export interface LayoutMouseEvent {
|
|
13
12
|
readonly kind: MouseEventKind;
|
|
@@ -8,7 +8,6 @@ import { DragHandler } from '../dnd/abstractDragHandler';
|
|
|
8
8
|
export var MouseEventKind;
|
|
9
9
|
(function (MouseEventKind) {
|
|
10
10
|
MouseEventKind["CLICK"] = "CLICK";
|
|
11
|
-
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
12
11
|
})(MouseEventKind || (MouseEventKind = {}));
|
|
13
12
|
export class Tab extends CompositeDisposable {
|
|
14
13
|
constructor(panelId, accessor, group) {
|
|
@@ -55,11 +54,6 @@ export class Tab extends CompositeDisposable {
|
|
|
55
54
|
*/
|
|
56
55
|
event.stopPropagation();
|
|
57
56
|
this._onChanged.fire({ kind: MouseEventKind.CLICK, event });
|
|
58
|
-
}), addDisposableListener(this._element, 'contextmenu', (event) => {
|
|
59
|
-
this._onChanged.fire({
|
|
60
|
-
kind: MouseEventKind.CONTEXT_MENU,
|
|
61
|
-
event,
|
|
62
|
-
});
|
|
63
57
|
}));
|
|
64
58
|
this.droptarget = new Droptarget(this._element, {
|
|
65
59
|
validOverlays: 'none',
|
|
@@ -159,7 +159,6 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
159
159
|
var _a;
|
|
160
160
|
const alreadyFocused = panel.id === ((_a = this.group.model.activePanel) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
161
161
|
this.group.model.isContentFocused;
|
|
162
|
-
this.accessor.fireMouseEvent(Object.assign(Object.assign({}, event), { panel, tab: true }));
|
|
163
162
|
const isLeftClick = event.event.button === 0;
|
|
164
163
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
165
164
|
return;
|
|
@@ -12,7 +12,6 @@ export interface IRenderable {
|
|
|
12
12
|
}
|
|
13
13
|
export interface HeaderPartInitParameters {
|
|
14
14
|
title: string;
|
|
15
|
-
suppressClosable?: boolean;
|
|
16
15
|
}
|
|
17
16
|
export interface GroupPanelPartInitParameters extends PanelInitParameters, HeaderPartInitParameters {
|
|
18
17
|
api: DockviewPanelApi;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { IDisposable } from './lifecycle';
|
|
|
24
24
|
export { Position } from './dnd/droptarget';
|
|
25
25
|
export { FocusEvent, PanelDimensionChangeEvent, VisibilityEvent, ActiveEvent, PanelApi, } from './api/panelApi';
|
|
26
26
|
export { SizeEvent, GridviewPanelApi, GridConstraintChangeEvent, } from './api/gridviewPanelApi';
|
|
27
|
-
export { TitleEvent,
|
|
27
|
+
export { TitleEvent, DockviewPanelApi } from './api/groupPanelApi';
|
|
28
28
|
export { PanelSizeEvent, PanelConstraintChangeEvent, SplitviewPanelApi, } from './api/splitviewPanelApi';
|
|
29
29
|
export { ExpansionEvent, PaneviewPanelApi } from './api/paneviewPanelApi';
|
|
30
30
|
export { CommonApi, SplitviewApi, PaneviewApi, GridviewApi, DockviewApi, } from './api/component.api';
|