dockview-core 1.16.0 → 1.17.0
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/component.api.d.ts +6 -4
- package/dist/cjs/dnd/groupDragHandler.js +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +2 -2
- package/dist/cjs/dockview/components/tab/tab.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +0 -7
- package/dist/cjs/dockview/components/watermark/watermark.js +3 -18
- package/dist/cjs/dockview/deserializer.js +4 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +2 -0
- package/dist/cjs/dockview/dockviewComponent.js +77 -58
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +4 -0
- package/dist/cjs/dockview/dockviewGroupPanel.js +49 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +4 -0
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +0 -1
- package/dist/cjs/dockview/dockviewPanel.d.ts +14 -1
- package/dist/cjs/dockview/dockviewPanel.js +36 -0
- package/dist/cjs/dockview/options.d.ts +16 -9
- package/dist/cjs/dockview/types.d.ts +5 -2
- package/dist/cjs/dom.d.ts +7 -0
- package/dist/cjs/dom.js +63 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -2
- package/dist/cjs/gridview/baseComponentGridview.js +30 -5
- package/dist/cjs/gridview/gridviewComponent.d.ts +2 -3
- package/dist/cjs/gridview/gridviewComponent.js +2 -2
- package/dist/cjs/gridview/gridviewPanel.d.ts +6 -0
- package/dist/cjs/overlay/overlay.js +6 -6
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
- package/dist/cjs/paneview/paneviewComponent.js +11 -3
- package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.js +13 -7
- package/dist/dockview-core.amd.js +231 -103
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +230 -102
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +231 -103
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +231 -103
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +231 -103
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +230 -102
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +6 -4
- package/dist/esm/dnd/groupDragHandler.js +1 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +2 -2
- package/dist/esm/dockview/components/tab/tab.js +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -7
- package/dist/esm/dockview/components/watermark/watermark.js +3 -18
- package/dist/esm/dockview/deserializer.js +4 -0
- package/dist/esm/dockview/dockviewComponent.d.ts +2 -0
- package/dist/esm/dockview/dockviewComponent.js +76 -54
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +4 -0
- package/dist/esm/dockview/dockviewGroupPanel.js +33 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +4 -0
- package/dist/esm/dockview/dockviewGroupPanelModel.js +0 -1
- package/dist/esm/dockview/dockviewPanel.d.ts +14 -1
- package/dist/esm/dockview/dockviewPanel.js +20 -0
- package/dist/esm/dockview/options.d.ts +16 -9
- package/dist/esm/dockview/types.d.ts +5 -2
- package/dist/esm/dom.d.ts +7 -0
- package/dist/esm/dom.js +36 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +3 -2
- package/dist/esm/gridview/baseComponentGridview.js +30 -5
- package/dist/esm/gridview/gridviewComponent.d.ts +2 -3
- package/dist/esm/gridview/gridviewComponent.js +2 -2
- package/dist/esm/gridview/gridviewPanel.d.ts +6 -0
- package/dist/esm/overlay/overlay.js +6 -6
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
- package/dist/esm/paneview/paneviewComponent.js +11 -3
- package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
- package/dist/esm/splitview/splitviewComponent.js +13 -7
- package/dist/styles/dockview.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.17.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -555,6 +555,42 @@
|
|
|
555
555
|
},
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
+
function getDockviewTheme(element) {
|
|
559
|
+
function toClassList(element) {
|
|
560
|
+
const list = [];
|
|
561
|
+
for (let i = 0; i < element.classList.length; i++) {
|
|
562
|
+
list.push(element.classList.item(i));
|
|
563
|
+
}
|
|
564
|
+
return list;
|
|
565
|
+
}
|
|
566
|
+
let theme = undefined;
|
|
567
|
+
let parent = element;
|
|
568
|
+
while (parent !== null) {
|
|
569
|
+
theme = toClassList(parent).find((cls) => cls.startsWith('dockview-theme-'));
|
|
570
|
+
if (typeof theme === 'string') {
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
parent = parent.parentElement;
|
|
574
|
+
}
|
|
575
|
+
return theme;
|
|
576
|
+
}
|
|
577
|
+
class Classnames {
|
|
578
|
+
constructor(element) {
|
|
579
|
+
this.element = element;
|
|
580
|
+
this._classNames = [];
|
|
581
|
+
}
|
|
582
|
+
setClassNames(classNames) {
|
|
583
|
+
for (const className of this._classNames) {
|
|
584
|
+
toggleClass(this.element, className, false);
|
|
585
|
+
}
|
|
586
|
+
this._classNames = classNames
|
|
587
|
+
.split(' ')
|
|
588
|
+
.filter((v) => v.trim().length > 0);
|
|
589
|
+
for (const className of this._classNames) {
|
|
590
|
+
toggleClass(this.element, className, true);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
558
594
|
|
|
559
595
|
function tail(arr) {
|
|
560
596
|
if (arr.length === 0) {
|
|
@@ -2674,7 +2710,8 @@
|
|
|
2674
2710
|
set locked(value) {
|
|
2675
2711
|
this.gridview.locked = value;
|
|
2676
2712
|
}
|
|
2677
|
-
constructor(options) {
|
|
2713
|
+
constructor(parentElement, options) {
|
|
2714
|
+
var _a;
|
|
2678
2715
|
super(document.createElement('div'), options.disableAutoResizing);
|
|
2679
2716
|
this._id = nextLayoutId$1.next();
|
|
2680
2717
|
this._groups = new Map();
|
|
@@ -2690,10 +2727,9 @@
|
|
|
2690
2727
|
this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
|
|
2691
2728
|
this.element.style.height = '100%';
|
|
2692
2729
|
this.element.style.width = '100%';
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
options.parentElement.appendChild(this.element);
|
|
2730
|
+
this._classNames = new Classnames(this.element);
|
|
2731
|
+
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2732
|
+
parentElement.appendChild(this.element);
|
|
2697
2733
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2698
2734
|
this.gridview.locked = !!options.locked;
|
|
2699
2735
|
this.element.appendChild(this.gridview.element);
|
|
@@ -2716,6 +2752,25 @@
|
|
|
2716
2752
|
isVisible(panel) {
|
|
2717
2753
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
2718
2754
|
}
|
|
2755
|
+
updateOptions(options) {
|
|
2756
|
+
var _a, _b, _c, _d;
|
|
2757
|
+
if (typeof options.proportionalLayout === 'boolean') ;
|
|
2758
|
+
if (options.orientation) {
|
|
2759
|
+
this.gridview.orientation = options.orientation;
|
|
2760
|
+
}
|
|
2761
|
+
if ('disableResizing' in options) {
|
|
2762
|
+
this.disableResizing = (_a = options.disableAutoResizing) !== null && _a !== void 0 ? _a : false;
|
|
2763
|
+
}
|
|
2764
|
+
if ('locked' in options) {
|
|
2765
|
+
this.locked = (_b = options.locked) !== null && _b !== void 0 ? _b : false;
|
|
2766
|
+
}
|
|
2767
|
+
if ('margin' in options) {
|
|
2768
|
+
this.gridview.margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 0;
|
|
2769
|
+
}
|
|
2770
|
+
if ('className' in options) {
|
|
2771
|
+
this._classNames.setClassNames((_d = options.className) !== null && _d !== void 0 ? _d : '');
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2719
2774
|
maximizeGroup(panel) {
|
|
2720
2775
|
this.gridview.maximizeView(panel);
|
|
2721
2776
|
this.doSetGroupActive(panel);
|
|
@@ -4639,7 +4694,7 @@
|
|
|
4639
4694
|
this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
|
|
4640
4695
|
this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
|
|
4641
4696
|
this._onDragStart.fire(event);
|
|
4642
|
-
}), dragHandler, addDisposableListener(this._element, '
|
|
4697
|
+
}), dragHandler, addDisposableListener(this._element, 'pointerdown', (event) => {
|
|
4643
4698
|
if (event.defaultPrevented) {
|
|
4644
4699
|
return;
|
|
4645
4700
|
}
|
|
@@ -4681,7 +4736,7 @@
|
|
|
4681
4736
|
this.accessor = accessor;
|
|
4682
4737
|
this.group = group;
|
|
4683
4738
|
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
4684
|
-
this.addDisposables(addDisposableListener(element, '
|
|
4739
|
+
this.addDisposables(addDisposableListener(element, 'pointerdown', (e) => {
|
|
4685
4740
|
if (e.shiftKey) {
|
|
4686
4741
|
/**
|
|
4687
4742
|
* You cannot call e.preventDefault() because that will prevent drag events from firing
|
|
@@ -4900,7 +4955,7 @@
|
|
|
4900
4955
|
group: this.group,
|
|
4901
4956
|
getData: getPanelData,
|
|
4902
4957
|
}));
|
|
4903
|
-
}), addDisposableListener(this.voidContainer.element, '
|
|
4958
|
+
}), addDisposableListener(this.voidContainer.element, 'pointerdown', (event) => {
|
|
4904
4959
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
4905
4960
|
if (isFloatingGroupsEnabled &&
|
|
4906
4961
|
event.shiftKey &&
|
|
@@ -4914,7 +4969,7 @@
|
|
|
4914
4969
|
inDragMode: true,
|
|
4915
4970
|
});
|
|
4916
4971
|
}
|
|
4917
|
-
}), addDisposableListener(this.tabContainer, '
|
|
4972
|
+
}), addDisposableListener(this.tabContainer, 'pointerdown', (event) => {
|
|
4918
4973
|
if (event.defaultPrevented) {
|
|
4919
4974
|
return;
|
|
4920
4975
|
}
|
|
@@ -5619,7 +5674,6 @@
|
|
|
5619
5674
|
});
|
|
5620
5675
|
this.tabsContainer.hide();
|
|
5621
5676
|
this.contentContainer.element.appendChild(this.watermark.element);
|
|
5622
|
-
this.watermark.updateParentGroup(this.groupPanel, true);
|
|
5623
5677
|
}
|
|
5624
5678
|
if (!this.isEmpty && this.watermark) {
|
|
5625
5679
|
this.watermark.element.remove();
|
|
@@ -5982,6 +6036,34 @@
|
|
|
5982
6036
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
|
|
5983
6037
|
const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
|
|
5984
6038
|
class DockviewGroupPanel extends GridviewPanel {
|
|
6039
|
+
get minimumWidth() {
|
|
6040
|
+
var _a;
|
|
6041
|
+
const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
6042
|
+
return typeof activePanelMinimumWidth === 'number'
|
|
6043
|
+
? activePanelMinimumWidth
|
|
6044
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH;
|
|
6045
|
+
}
|
|
6046
|
+
get minimumHeight() {
|
|
6047
|
+
var _a;
|
|
6048
|
+
const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
6049
|
+
return typeof activePanelMinimumHeight === 'number'
|
|
6050
|
+
? activePanelMinimumHeight
|
|
6051
|
+
: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT;
|
|
6052
|
+
}
|
|
6053
|
+
get maximumWidth() {
|
|
6054
|
+
var _a;
|
|
6055
|
+
const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
6056
|
+
return typeof activePanelMaximumWidth === 'number'
|
|
6057
|
+
? activePanelMaximumWidth
|
|
6058
|
+
: Number.MAX_SAFE_INTEGER;
|
|
6059
|
+
}
|
|
6060
|
+
get maximumHeight() {
|
|
6061
|
+
var _a;
|
|
6062
|
+
const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
6063
|
+
return typeof activePanelMaximumHeight === 'number'
|
|
6064
|
+
? activePanelMaximumHeight
|
|
6065
|
+
: Number.MAX_SAFE_INTEGER;
|
|
6066
|
+
}
|
|
5985
6067
|
get panels() {
|
|
5986
6068
|
return this._model.panels;
|
|
5987
6069
|
}
|
|
@@ -6004,9 +6086,12 @@
|
|
|
6004
6086
|
return this._model.header;
|
|
6005
6087
|
}
|
|
6006
6088
|
constructor(accessor, id, options) {
|
|
6089
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6007
6090
|
super(id, 'groupview_default', {
|
|
6008
|
-
minimumHeight: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
6009
|
-
minimumWidth: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
6091
|
+
minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
|
|
6092
|
+
minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
|
|
6093
|
+
maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
|
|
6094
|
+
maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
|
|
6010
6095
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
6011
6096
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
6012
6097
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
@@ -6162,6 +6247,18 @@
|
|
|
6162
6247
|
var _a;
|
|
6163
6248
|
return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
|
|
6164
6249
|
}
|
|
6250
|
+
get minimumWidth() {
|
|
6251
|
+
return this._minimumWidth;
|
|
6252
|
+
}
|
|
6253
|
+
get minimumHeight() {
|
|
6254
|
+
return this._minimumHeight;
|
|
6255
|
+
}
|
|
6256
|
+
get maximumWidth() {
|
|
6257
|
+
return this._maximumWidth;
|
|
6258
|
+
}
|
|
6259
|
+
get maximumHeight() {
|
|
6260
|
+
return this._maximumHeight;
|
|
6261
|
+
}
|
|
6165
6262
|
constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
|
|
6166
6263
|
super();
|
|
6167
6264
|
this.id = id;
|
|
@@ -6170,6 +6267,10 @@
|
|
|
6170
6267
|
this.view = view;
|
|
6171
6268
|
this._renderer = options.renderer;
|
|
6172
6269
|
this._group = group;
|
|
6270
|
+
this._minimumWidth = options.minimumWidth;
|
|
6271
|
+
this._minimumHeight = options.minimumHeight;
|
|
6272
|
+
this._maximumWidth = options.maximumWidth;
|
|
6273
|
+
this._maximumHeight = options.maximumHeight;
|
|
6173
6274
|
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
|
|
6174
6275
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
6175
6276
|
accessor.setActivePanel(this);
|
|
@@ -6206,6 +6307,10 @@
|
|
|
6206
6307
|
: undefined,
|
|
6207
6308
|
title: this.title,
|
|
6208
6309
|
renderer: this._renderer,
|
|
6310
|
+
minimumHeight: this._minimumHeight,
|
|
6311
|
+
maximumHeight: this._maximumHeight,
|
|
6312
|
+
minimumWidth: this._minimumWidth,
|
|
6313
|
+
maximumWidth: this._maximumWidth,
|
|
6209
6314
|
};
|
|
6210
6315
|
}
|
|
6211
6316
|
setTitle(title) {
|
|
@@ -6335,7 +6440,7 @@
|
|
|
6335
6440
|
this.action.appendChild(createCloseButton());
|
|
6336
6441
|
this._element.appendChild(this._content);
|
|
6337
6442
|
this._element.appendChild(this.action);
|
|
6338
|
-
this.addDisposables(addDisposableListener(this.action, '
|
|
6443
|
+
this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
6339
6444
|
ev.preventDefault();
|
|
6340
6445
|
}));
|
|
6341
6446
|
this.render();
|
|
@@ -6345,7 +6450,7 @@
|
|
|
6345
6450
|
this.addDisposables(params.api.onDidTitleChange((event) => {
|
|
6346
6451
|
this._title = event.title;
|
|
6347
6452
|
this.render();
|
|
6348
|
-
}), addDisposableListener(this.action, '
|
|
6453
|
+
}), addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
6349
6454
|
ev.preventDefault();
|
|
6350
6455
|
}), addDisposableListener(this.action, 'click', (ev) => {
|
|
6351
6456
|
if (ev.defaultPrevented) {
|
|
@@ -6446,6 +6551,10 @@
|
|
|
6446
6551
|
const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
6447
6552
|
const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6448
6553
|
renderer: panelData.renderer,
|
|
6554
|
+
minimumWidth: panelData.minimumWidth,
|
|
6555
|
+
minimumHeight: panelData.minimumHeight,
|
|
6556
|
+
maximumWidth: panelData.maximumWidth,
|
|
6557
|
+
maximumHeight: panelData.maximumHeight,
|
|
6449
6558
|
});
|
|
6450
6559
|
panel.init({
|
|
6451
6560
|
title: title !== null && title !== void 0 ? title : panelId,
|
|
@@ -6479,34 +6588,19 @@
|
|
|
6479
6588
|
actionsContainer.appendChild(closeAnchor);
|
|
6480
6589
|
title.appendChild(emptySpace);
|
|
6481
6590
|
title.appendChild(actionsContainer);
|
|
6482
|
-
this.addDisposables(addDisposableListener(closeAnchor, 'click', (
|
|
6591
|
+
this.addDisposables(addDisposableListener(closeAnchor, 'click', (event) => {
|
|
6483
6592
|
var _a;
|
|
6484
|
-
|
|
6593
|
+
event.preventDefault();
|
|
6485
6594
|
if (this._group) {
|
|
6486
6595
|
(_a = this._api) === null || _a === void 0 ? void 0 : _a.removeGroup(this._group);
|
|
6487
6596
|
}
|
|
6488
6597
|
}));
|
|
6489
6598
|
}
|
|
6490
|
-
update(_event) {
|
|
6491
|
-
// noop
|
|
6492
|
-
}
|
|
6493
|
-
focus() {
|
|
6494
|
-
// noop
|
|
6495
|
-
}
|
|
6496
|
-
layout(_width, _height) {
|
|
6497
|
-
// noop
|
|
6498
|
-
}
|
|
6499
6599
|
init(_params) {
|
|
6500
6600
|
this._api = _params.containerApi;
|
|
6601
|
+
this._group = _params.group;
|
|
6501
6602
|
this.render();
|
|
6502
6603
|
}
|
|
6503
|
-
updateParentGroup(group, _visible) {
|
|
6504
|
-
this._group = group;
|
|
6505
|
-
this.render();
|
|
6506
|
-
}
|
|
6507
|
-
dispose() {
|
|
6508
|
-
super.dispose();
|
|
6509
|
-
}
|
|
6510
6604
|
render() {
|
|
6511
6605
|
const isOneGroup = !!(this._api && this._api.size <= 1);
|
|
6512
6606
|
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
@@ -6665,7 +6759,7 @@
|
|
|
6665
6759
|
dispose: () => {
|
|
6666
6760
|
iframes.release();
|
|
6667
6761
|
},
|
|
6668
|
-
}, addDisposableWindowListener(window, '
|
|
6762
|
+
}, addDisposableWindowListener(window, 'pointermove', (e) => {
|
|
6669
6763
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
6670
6764
|
const x = e.clientX - containerRect.left;
|
|
6671
6765
|
const y = e.clientY - containerRect.top;
|
|
@@ -6708,7 +6802,7 @@
|
|
|
6708
6802
|
this._onDidChangeEnd.fire();
|
|
6709
6803
|
}));
|
|
6710
6804
|
};
|
|
6711
|
-
this.addDisposables(move, addDisposableListener(dragTarget, '
|
|
6805
|
+
this.addDisposables(move, addDisposableListener(dragTarget, 'pointerdown', (event) => {
|
|
6712
6806
|
if (event.defaultPrevented) {
|
|
6713
6807
|
event.preventDefault();
|
|
6714
6808
|
return;
|
|
@@ -6719,7 +6813,7 @@
|
|
|
6719
6813
|
return;
|
|
6720
6814
|
}
|
|
6721
6815
|
track();
|
|
6722
|
-
}), addDisposableListener(this.options.content, '
|
|
6816
|
+
}), addDisposableListener(this.options.content, 'pointerdown', (event) => {
|
|
6723
6817
|
if (event.defaultPrevented) {
|
|
6724
6818
|
return;
|
|
6725
6819
|
}
|
|
@@ -6731,7 +6825,7 @@
|
|
|
6731
6825
|
if (event.shiftKey) {
|
|
6732
6826
|
track();
|
|
6733
6827
|
}
|
|
6734
|
-
}), addDisposableListener(this.options.content, '
|
|
6828
|
+
}), addDisposableListener(this.options.content, 'pointerdown', () => {
|
|
6735
6829
|
arialLevelTracker.push(this._element);
|
|
6736
6830
|
}, true));
|
|
6737
6831
|
if (options.inDragMode) {
|
|
@@ -6743,11 +6837,11 @@
|
|
|
6743
6837
|
resizeHandleElement.className = `dv-resize-handle-${direction}`;
|
|
6744
6838
|
this._element.appendChild(resizeHandleElement);
|
|
6745
6839
|
const move = new MutableDisposable();
|
|
6746
|
-
this.addDisposables(move, addDisposableListener(resizeHandleElement, '
|
|
6840
|
+
this.addDisposables(move, addDisposableListener(resizeHandleElement, 'pointerdown', (e) => {
|
|
6747
6841
|
e.preventDefault();
|
|
6748
6842
|
let startPosition = null;
|
|
6749
6843
|
const iframes = disableIframePointEvents();
|
|
6750
|
-
move.value = new CompositeDisposable(addDisposableWindowListener(window, '
|
|
6844
|
+
move.value = new CompositeDisposable(addDisposableWindowListener(window, 'pointermove', (e) => {
|
|
6751
6845
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
6752
6846
|
const overlayRect = this._element.getBoundingClientRect();
|
|
6753
6847
|
const y = e.clientY - containerRect.top;
|
|
@@ -7252,25 +7346,6 @@
|
|
|
7252
7346
|
});
|
|
7253
7347
|
});
|
|
7254
7348
|
}
|
|
7255
|
-
function getDockviewTheme(element) {
|
|
7256
|
-
function toClassList(element) {
|
|
7257
|
-
const list = [];
|
|
7258
|
-
for (let i = 0; i < element.classList.length; i++) {
|
|
7259
|
-
list.push(element.classList.item(i));
|
|
7260
|
-
}
|
|
7261
|
-
return list;
|
|
7262
|
-
}
|
|
7263
|
-
let theme = undefined;
|
|
7264
|
-
let parent = element;
|
|
7265
|
-
while (parent !== null) {
|
|
7266
|
-
theme = toClassList(parent).find((cls) => cls.startsWith('dockview-theme-'));
|
|
7267
|
-
if (typeof theme === 'string') {
|
|
7268
|
-
break;
|
|
7269
|
-
}
|
|
7270
|
-
parent = parent.parentElement;
|
|
7271
|
-
}
|
|
7272
|
-
return theme;
|
|
7273
|
-
}
|
|
7274
7349
|
class DockviewComponent extends BaseGrid {
|
|
7275
7350
|
get orientation() {
|
|
7276
7351
|
return this.gridview.orientation;
|
|
@@ -7306,13 +7381,12 @@
|
|
|
7306
7381
|
}
|
|
7307
7382
|
constructor(parentElement, options) {
|
|
7308
7383
|
var _a;
|
|
7309
|
-
super({
|
|
7384
|
+
super(parentElement, {
|
|
7310
7385
|
proportionalLayout: true,
|
|
7311
7386
|
orientation: exports.Orientation.HORIZONTAL,
|
|
7312
7387
|
styles: options.hideBorders
|
|
7313
7388
|
? { separatorBorder: 'transparent' }
|
|
7314
7389
|
: undefined,
|
|
7315
|
-
parentElement: parentElement,
|
|
7316
7390
|
disableAutoResizing: options.disableAutoResizing,
|
|
7317
7391
|
locked: options.locked,
|
|
7318
7392
|
margin: options.gap,
|
|
@@ -7352,9 +7426,6 @@
|
|
|
7352
7426
|
this._onDidActiveGroupChange = new Emitter();
|
|
7353
7427
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
7354
7428
|
this._moving = false;
|
|
7355
|
-
// const gready = document.createElement('div');
|
|
7356
|
-
// gready.className = 'dv-overlay-render-container';
|
|
7357
|
-
// this.gridview.element.appendChild(gready);
|
|
7358
7429
|
this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
|
|
7359
7430
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
7360
7431
|
toggleClass(this.element, 'dv-debug', !!options.debug);
|
|
@@ -7803,15 +7874,11 @@
|
|
|
7803
7874
|
}
|
|
7804
7875
|
}
|
|
7805
7876
|
updateOptions(options) {
|
|
7806
|
-
var _a, _b;
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
|
|
7810
|
-
options.rootOverlayModel !== this.options.rootOverlayModel;
|
|
7811
|
-
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
7812
|
-
if (changed_floatingGroupBounds) {
|
|
7877
|
+
var _a, _b, _c, _d;
|
|
7878
|
+
super.updateOptions(options);
|
|
7879
|
+
if ('floatingGroupBounds' in options) {
|
|
7813
7880
|
for (const group of this._floatingGroups) {
|
|
7814
|
-
switch (
|
|
7881
|
+
switch (options.floatingGroupBounds) {
|
|
7815
7882
|
case 'boundedWithinViewport':
|
|
7816
7883
|
group.overlay.minimumInViewportHeight = undefined;
|
|
7817
7884
|
group.overlay.minimumInViewportWidth = undefined;
|
|
@@ -7824,25 +7891,20 @@
|
|
|
7824
7891
|
break;
|
|
7825
7892
|
default:
|
|
7826
7893
|
group.overlay.minimumInViewportHeight =
|
|
7827
|
-
(_a =
|
|
7894
|
+
(_a = options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
|
|
7828
7895
|
group.overlay.minimumInViewportWidth =
|
|
7829
|
-
(_b =
|
|
7896
|
+
(_b = options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
|
|
7830
7897
|
}
|
|
7831
7898
|
group.overlay.setBounds();
|
|
7832
7899
|
}
|
|
7833
7900
|
}
|
|
7834
|
-
if (
|
|
7835
|
-
this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
|
|
7901
|
+
if ('rootOverlayModel' in options) {
|
|
7902
|
+
this._rootDropTarget.setOverlayModel((_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL);
|
|
7836
7903
|
}
|
|
7837
|
-
if (
|
|
7838
|
-
|
|
7839
|
-
'gap' in options &&
|
|
7840
|
-
options.gap === undefined) {
|
|
7841
|
-
this.gridview.margin = 0;
|
|
7842
|
-
}
|
|
7843
|
-
if (typeof options.gap === 'number') {
|
|
7844
|
-
this.gridview.margin = options.gap;
|
|
7904
|
+
if ('gap' in options) {
|
|
7905
|
+
this.gridview.margin = (_d = options.gap) !== null && _d !== void 0 ? _d : 0;
|
|
7845
7906
|
}
|
|
7907
|
+
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
7846
7908
|
this.layout(this.gridview.width, this.gridview.height, true);
|
|
7847
7909
|
}
|
|
7848
7910
|
layout(width, height, forceResize) {
|
|
@@ -8099,6 +8161,10 @@
|
|
|
8099
8161
|
if (options.position && options.floating) {
|
|
8100
8162
|
throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
|
|
8101
8163
|
}
|
|
8164
|
+
const initial = {
|
|
8165
|
+
width: options.initialWidth,
|
|
8166
|
+
height: options.initialHeight,
|
|
8167
|
+
};
|
|
8102
8168
|
if (options.position) {
|
|
8103
8169
|
if (isPanelOptionsWithPanel(options.position)) {
|
|
8104
8170
|
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
@@ -8128,6 +8194,10 @@
|
|
|
8128
8194
|
if (!options.inactive) {
|
|
8129
8195
|
this.doSetGroupAndPanelActive(group);
|
|
8130
8196
|
}
|
|
8197
|
+
group.api.setSize({
|
|
8198
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
8199
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
8200
|
+
});
|
|
8131
8201
|
return panel;
|
|
8132
8202
|
}
|
|
8133
8203
|
}
|
|
@@ -8158,6 +8228,10 @@
|
|
|
8158
8228
|
skipSetActive: options.inactive,
|
|
8159
8229
|
skipSetGroupActive: options.inactive,
|
|
8160
8230
|
});
|
|
8231
|
+
referenceGroup.api.setSize({
|
|
8232
|
+
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
8233
|
+
height: initial === null || initial === void 0 ? void 0 : initial.height,
|
|
8234
|
+
});
|
|
8161
8235
|
if (!options.inactive) {
|
|
8162
8236
|
this.doSetGroupAndPanelActive(referenceGroup);
|
|
8163
8237
|
}
|
|
@@ -8165,7 +8239,10 @@
|
|
|
8165
8239
|
else {
|
|
8166
8240
|
const location = getGridLocation(referenceGroup.element);
|
|
8167
8241
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
8168
|
-
const group = this.createGroupAtLocation(relativeLocation)
|
|
8242
|
+
const group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) ===
|
|
8243
|
+
exports.Orientation.VERTICAL
|
|
8244
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
8245
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
8169
8246
|
panel = this.createPanel(options, group);
|
|
8170
8247
|
group.model.openPanel(panel, {
|
|
8171
8248
|
skipSetActive: options.inactive,
|
|
@@ -8191,7 +8268,9 @@
|
|
|
8191
8268
|
});
|
|
8192
8269
|
}
|
|
8193
8270
|
else {
|
|
8194
|
-
const group = this.createGroupAtLocation(
|
|
8271
|
+
const group = this.createGroupAtLocation([0], this.gridview.orientation === exports.Orientation.VERTICAL
|
|
8272
|
+
? initial === null || initial === void 0 ? void 0 : initial.height
|
|
8273
|
+
: initial === null || initial === void 0 ? void 0 : initial.width);
|
|
8195
8274
|
panel = this.createPanel(options, group);
|
|
8196
8275
|
group.model.openPanel(panel, {
|
|
8197
8276
|
skipSetActive: options.inactive,
|
|
@@ -8285,7 +8364,11 @@
|
|
|
8285
8364
|
const location = getGridLocation(referenceGroup.element);
|
|
8286
8365
|
const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
8287
8366
|
const group = this.createGroup(options);
|
|
8288
|
-
this.
|
|
8367
|
+
const size = this.getLocationOrientation(relativeLocation) ===
|
|
8368
|
+
exports.Orientation.VERTICAL
|
|
8369
|
+
? options.initialHeight
|
|
8370
|
+
: options.initialWidth;
|
|
8371
|
+
this.doAddGroup(group, relativeLocation, size);
|
|
8289
8372
|
if (!options.skipSetActive) {
|
|
8290
8373
|
this.doSetGroupAndPanelActive(group);
|
|
8291
8374
|
}
|
|
@@ -8298,6 +8381,12 @@
|
|
|
8298
8381
|
return group;
|
|
8299
8382
|
}
|
|
8300
8383
|
}
|
|
8384
|
+
getLocationOrientation(location) {
|
|
8385
|
+
return location.length % 2 == 0 &&
|
|
8386
|
+
this.gridview.orientation === exports.Orientation.HORIZONTAL
|
|
8387
|
+
? exports.Orientation.HORIZONTAL
|
|
8388
|
+
: exports.Orientation.VERTICAL;
|
|
8389
|
+
}
|
|
8301
8390
|
removeGroup(group, options) {
|
|
8302
8391
|
this.doRemoveGroup(group, options);
|
|
8303
8392
|
}
|
|
@@ -8569,7 +8658,22 @@
|
|
|
8569
8658
|
}
|
|
8570
8659
|
const referenceLocation = getGridLocation(to.element);
|
|
8571
8660
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
8572
|
-
|
|
8661
|
+
let size;
|
|
8662
|
+
switch (this.gridview.orientation) {
|
|
8663
|
+
case exports.Orientation.VERTICAL:
|
|
8664
|
+
size =
|
|
8665
|
+
referenceLocation.length % 2 == 0
|
|
8666
|
+
? from.api.width
|
|
8667
|
+
: from.api.height;
|
|
8668
|
+
break;
|
|
8669
|
+
case exports.Orientation.HORIZONTAL:
|
|
8670
|
+
size =
|
|
8671
|
+
referenceLocation.length % 2 == 0
|
|
8672
|
+
? from.api.height
|
|
8673
|
+
: from.api.width;
|
|
8674
|
+
break;
|
|
8675
|
+
}
|
|
8676
|
+
this.gridview.addView(from, size, dropLocation);
|
|
8573
8677
|
}
|
|
8574
8678
|
from.panels.forEach((panel) => {
|
|
8575
8679
|
this._onDidMovePanel.fire({ panel, from });
|
|
@@ -8681,22 +8785,34 @@
|
|
|
8681
8785
|
const contentComponent = options.component;
|
|
8682
8786
|
const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
8683
8787
|
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
8684
|
-
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
8788
|
+
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
|
|
8789
|
+
renderer: options.renderer,
|
|
8790
|
+
minimumWidth: options.minimumWidth,
|
|
8791
|
+
minimumHeight: options.minimumHeight,
|
|
8792
|
+
maximumWidth: options.maximumWidth,
|
|
8793
|
+
maximumHeight: options.maximumHeight,
|
|
8794
|
+
});
|
|
8685
8795
|
panel.init({
|
|
8686
8796
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
8687
8797
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
8688
8798
|
});
|
|
8689
8799
|
return panel;
|
|
8690
8800
|
}
|
|
8691
|
-
createGroupAtLocation(location
|
|
8801
|
+
createGroupAtLocation(location, size) {
|
|
8692
8802
|
const group = this.createGroup();
|
|
8693
|
-
this.doAddGroup(group, location);
|
|
8803
|
+
this.doAddGroup(group, location, size);
|
|
8694
8804
|
return group;
|
|
8695
8805
|
}
|
|
8696
8806
|
findGroup(panel) {
|
|
8697
8807
|
var _a;
|
|
8698
8808
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
8699
8809
|
}
|
|
8810
|
+
orientationAtLocation(location) {
|
|
8811
|
+
const rootOrientation = this.gridview.orientation;
|
|
8812
|
+
return location.length % 2 == 1
|
|
8813
|
+
? rootOrientation
|
|
8814
|
+
: orthogonal(rootOrientation);
|
|
8815
|
+
}
|
|
8700
8816
|
}
|
|
8701
8817
|
|
|
8702
8818
|
class GridviewComponent extends BaseGrid {
|
|
@@ -8716,8 +8832,7 @@
|
|
|
8716
8832
|
this._deserializer = value;
|
|
8717
8833
|
}
|
|
8718
8834
|
constructor(parentElement, options) {
|
|
8719
|
-
super({
|
|
8720
|
-
parentElement: parentElement,
|
|
8835
|
+
super(parentElement, {
|
|
8721
8836
|
proportionalLayout: options.proportionalLayout,
|
|
8722
8837
|
orientation: options.orientation,
|
|
8723
8838
|
styles: options.styles,
|
|
@@ -8748,6 +8863,7 @@
|
|
|
8748
8863
|
}
|
|
8749
8864
|
}
|
|
8750
8865
|
updateOptions(options) {
|
|
8866
|
+
super.updateOptions(options);
|
|
8751
8867
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
8752
8868
|
this.gridview.orientation !== options.orientation;
|
|
8753
8869
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
@@ -9015,6 +9131,7 @@
|
|
|
9015
9131
|
: this.splitview.orthogonalSize;
|
|
9016
9132
|
}
|
|
9017
9133
|
constructor(parentElement, options) {
|
|
9134
|
+
var _a;
|
|
9018
9135
|
super(parentElement, options.disableAutoResizing);
|
|
9019
9136
|
this._splitviewChangeDisposable = new MutableDisposable();
|
|
9020
9137
|
this._panels = new Map();
|
|
@@ -9026,9 +9143,8 @@
|
|
|
9026
9143
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9027
9144
|
this._onDidLayoutChange = new Emitter();
|
|
9028
9145
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
}
|
|
9146
|
+
this._classNames = new Classnames(this.element);
|
|
9147
|
+
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9032
9148
|
this._options = options;
|
|
9033
9149
|
if (!options.components) {
|
|
9034
9150
|
options.components = {};
|
|
@@ -9040,12 +9156,17 @@
|
|
|
9040
9156
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9041
9157
|
}
|
|
9042
9158
|
updateOptions(options) {
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9159
|
+
var _a, _b;
|
|
9160
|
+
if ('className' in options) {
|
|
9161
|
+
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9162
|
+
}
|
|
9163
|
+
if ('disableResizing' in options) {
|
|
9164
|
+
this.disableResizing = (_b = options.disableAutoResizing) !== null && _b !== void 0 ? _b : false;
|
|
9165
|
+
}
|
|
9166
|
+
if (typeof options.orientation === 'string') {
|
|
9047
9167
|
this.splitview.orientation = options.orientation;
|
|
9048
9168
|
}
|
|
9169
|
+
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9049
9170
|
this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
|
|
9050
9171
|
}
|
|
9051
9172
|
focus() {
|
|
@@ -9342,6 +9463,7 @@
|
|
|
9342
9463
|
return this._options;
|
|
9343
9464
|
}
|
|
9344
9465
|
constructor(parentElement, options) {
|
|
9466
|
+
var _a;
|
|
9345
9467
|
super(parentElement, options.disableAutoResizing);
|
|
9346
9468
|
this._id = nextLayoutId.next();
|
|
9347
9469
|
this._disposable = new MutableDisposable();
|
|
@@ -9356,10 +9478,9 @@
|
|
|
9356
9478
|
this.onDidAddView = this._onDidAddView.event;
|
|
9357
9479
|
this._onDidRemoveView = new Emitter();
|
|
9358
9480
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9359
|
-
if (typeof options.className === 'string') {
|
|
9360
|
-
this.element.classList.add(options.className);
|
|
9361
|
-
}
|
|
9362
9481
|
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
9482
|
+
this._classNames = new Classnames(this.element);
|
|
9483
|
+
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9363
9484
|
this._options = options;
|
|
9364
9485
|
if (!options.components) {
|
|
9365
9486
|
options.components = {};
|
|
@@ -9381,6 +9502,13 @@
|
|
|
9381
9502
|
//noop
|
|
9382
9503
|
}
|
|
9383
9504
|
updateOptions(options) {
|
|
9505
|
+
var _a, _b;
|
|
9506
|
+
if ('className' in options) {
|
|
9507
|
+
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9508
|
+
}
|
|
9509
|
+
if ('disableResizing' in options) {
|
|
9510
|
+
this.disableResizing = (_b = options.disableAutoResizing) !== null && _b !== void 0 ? _b : false;
|
|
9511
|
+
}
|
|
9384
9512
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9385
9513
|
}
|
|
9386
9514
|
addPanel(options) {
|