dock-spawn-ts 2.513.1 → 2.515.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/lib/es5/dock-spawn-ts.js +1 -1
- package/lib/js/ContainerType.d.ts +6 -6
- package/lib/js/ContainerType.js +7 -7
- package/lib/js/Dialog.d.ts +43 -43
- package/lib/js/Dialog.js +136 -136
- package/lib/js/DockConfig.d.ts +7 -7
- package/lib/js/DockConfig.js +8 -8
- package/lib/js/DockGraphDeserializer.d.ts +18 -18
- package/lib/js/DockGraphDeserializer.js +116 -116
- package/lib/js/DockGraphSerializer.d.ts +13 -13
- package/lib/js/DockGraphSerializer.js +40 -40
- package/lib/js/DockLayoutEngine.d.ts +35 -35
- package/lib/js/DockLayoutEngine.js +319 -319
- package/lib/js/DockManager.d.ts +153 -153
- package/lib/js/DockManager.js +730 -728
- package/lib/js/DockManager.js.map +1 -1
- package/lib/js/DockManagerContext.d.ts +9 -9
- package/lib/js/DockManagerContext.js +9 -9
- package/lib/js/DockModel.d.ts +8 -8
- package/lib/js/DockModel.js +5 -5
- package/lib/js/DockNode.d.ts +15 -15
- package/lib/js/DockNode.js +61 -61
- package/lib/js/DockWheel.d.ts +40 -40
- package/lib/js/DockWheel.js +200 -200
- package/lib/js/DockWheelItem.d.ts +15 -15
- package/lib/js/DockWheelItem.js +27 -27
- package/lib/js/DocumentManagerContainer.d.ts +16 -16
- package/lib/js/DocumentManagerContainer.js +28 -28
- package/lib/js/DocumentTabPage.d.ts +14 -14
- package/lib/js/DocumentTabPage.js +26 -26
- package/lib/js/DraggableContainer.d.ts +52 -52
- package/lib/js/DraggableContainer.js +183 -183
- package/lib/js/EventHandler.d.ts +7 -7
- package/lib/js/EventHandler.js +11 -11
- package/lib/js/Exports.d.ts +30 -30
- package/lib/js/Exports.js +30 -30
- package/lib/js/FillDockContainer.d.ts +33 -33
- package/lib/js/FillDockContainer.js +69 -69
- package/lib/js/HorizontalDockContainer.d.ts +6 -6
- package/lib/js/HorizontalDockContainer.js +9 -9
- package/lib/js/PanelContainer.d.ts +101 -101
- package/lib/js/PanelContainer.js +384 -384
- package/lib/js/PanelContainer.js.map +1 -1
- package/lib/js/Point.d.ts +5 -5
- package/lib/js/Point.js +6 -6
- package/lib/js/ResizableContainer.d.ts +55 -55
- package/lib/js/ResizableContainer.js +241 -241
- package/lib/js/ResizeHandle.d.ts +15 -15
- package/lib/js/ResizeHandle.js +48 -48
- package/lib/js/SplitterBar.d.ts +35 -35
- package/lib/js/SplitterBar.js +149 -149
- package/lib/js/SplitterDockContainer.d.ts +35 -35
- package/lib/js/SplitterDockContainer.js +65 -65
- package/lib/js/SplitterPanel.d.ts +26 -26
- package/lib/js/SplitterPanel.js +191 -191
- package/lib/js/TabHandle.d.ts +55 -55
- package/lib/js/TabHandle.js +261 -260
- package/lib/js/TabHandle.js.map +1 -1
- package/lib/js/TabHost.d.ts +46 -46
- package/lib/js/TabHost.js +223 -223
- package/lib/js/TabHost.js.map +1 -1
- package/lib/js/TabPage.d.ts +19 -19
- package/lib/js/TabPage.js +74 -73
- package/lib/js/TabPage.js.map +1 -1
- package/lib/js/UndockInitiator.d.ts +31 -31
- package/lib/js/UndockInitiator.js +140 -140
- package/lib/js/Utils.d.ts +14 -14
- package/lib/js/Utils.js +70 -69
- package/lib/js/Utils.js.map +1 -1
- package/lib/js/VerticalDockContainer.d.ts +6 -6
- package/lib/js/VerticalDockContainer.js +9 -9
- package/lib/js/enums/PanelType.d.ts +4 -4
- package/lib/js/enums/PanelType.js +5 -5
- package/lib/js/enums/TabHostDirection.d.ts +6 -6
- package/lib/js/enums/TabHostDirection.js +7 -7
- package/lib/js/enums/WheelTypes.d.ts +11 -11
- package/lib/js/enums/WheelTypes.js +14 -14
- package/lib/js/interfaces/IDockContainer.d.ts +25 -25
- package/lib/js/interfaces/IDockContainer.js +1 -1
- package/lib/js/interfaces/IDockContainerWithSize.d.ts +5 -5
- package/lib/js/interfaces/IDockContainerWithSize.js +1 -1
- package/lib/js/interfaces/ILayoutEventListener.d.ts +26 -26
- package/lib/js/interfaces/ILayoutEventListener.js +1 -1
- package/lib/js/interfaces/IMouseOrTouchEvent.d.ts +6 -6
- package/lib/js/interfaces/IMouseOrTouchEvent.js +1 -1
- package/lib/js/interfaces/INodeInfo.d.ts +7 -7
- package/lib/js/interfaces/INodeInfo.js +1 -1
- package/lib/js/interfaces/IPanelInfo.d.ts +9 -9
- package/lib/js/interfaces/IPanelInfo.js +1 -1
- package/lib/js/interfaces/IRectangle.d.ts +6 -6
- package/lib/js/interfaces/IRectangle.js +1 -1
- package/lib/js/interfaces/ISize.d.ts +4 -4
- package/lib/js/interfaces/ISize.js +1 -1
- package/lib/js/interfaces/IState.d.ts +10 -10
- package/lib/js/interfaces/IState.js +1 -1
- package/lib/js/interfaces/IThickness.d.ts +6 -6
- package/lib/js/interfaces/IThickness.js +1 -1
- package/lib/js/webcomponent/DockSpawnTsWebcomponent.d.ts +31 -30
- package/lib/js/webcomponent/DockSpawnTsWebcomponent.js +158 -152
- package/lib/js/webcomponent/DockSpawnTsWebcomponent.js.map +1 -1
- package/package.json +6 -6
- package/src/DockManager.ts +5 -3
- package/src/PanelContainer.ts +1 -1
- package/src/TabHost.ts +5 -5
- package/src/TabPage.ts +4 -3
- package/src/webcomponent/DockSpawnTsWebcomponent.ts +6 -0
package/lib/js/SplitterBar.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
2
|
-
import { EventHandler } from "./EventHandler.js";
|
|
3
|
-
import { IMouseOrTouchEvent } from "./interfaces/IMouseOrTouchEvent.js";
|
|
4
|
-
export declare class SplitterBar {
|
|
5
|
-
previousContainer: IDockContainer;
|
|
6
|
-
nextContainer: IDockContainer;
|
|
7
|
-
stackedVertical: boolean;
|
|
8
|
-
barElement: HTMLDivElement;
|
|
9
|
-
mouseDownHandler: EventHandler;
|
|
10
|
-
touchDownHandler: EventHandler;
|
|
11
|
-
minPanelSize: number;
|
|
12
|
-
readyToProcessNextDrag: boolean;
|
|
13
|
-
dockSpawnResizedEvent: CustomEvent<{}>;
|
|
14
|
-
previousMouseEvent: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
};
|
|
18
|
-
mouseMovedHandler: EventHandler;
|
|
19
|
-
mouseUpHandler: EventHandler;
|
|
20
|
-
touchMovedHandler: EventHandler;
|
|
21
|
-
touchUpHandler: EventHandler;
|
|
22
|
-
private iframeEventHandlers;
|
|
23
|
-
constructor(previousContainer: IDockContainer, nextContainer: IDockContainer, stackedVertical: boolean);
|
|
24
|
-
onMouseDown(e: IMouseOrTouchEvent): void;
|
|
25
|
-
onMouseUp(): void;
|
|
26
|
-
onMouseMovedIframe(e: IMouseOrTouchEvent, iframe: HTMLIFrameElement): void;
|
|
27
|
-
onMouseMoved(e: IMouseOrTouchEvent): void;
|
|
28
|
-
handleMoveEvent(pos: {
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
}): void;
|
|
32
|
-
_performDrag(dx: number, dy: number): void;
|
|
33
|
-
_startDragging(e: IMouseOrTouchEvent): void;
|
|
34
|
-
_stopDragging(): void;
|
|
35
|
-
}
|
|
1
|
+
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
2
|
+
import { EventHandler } from "./EventHandler.js";
|
|
3
|
+
import { IMouseOrTouchEvent } from "./interfaces/IMouseOrTouchEvent.js";
|
|
4
|
+
export declare class SplitterBar {
|
|
5
|
+
previousContainer: IDockContainer;
|
|
6
|
+
nextContainer: IDockContainer;
|
|
7
|
+
stackedVertical: boolean;
|
|
8
|
+
barElement: HTMLDivElement;
|
|
9
|
+
mouseDownHandler: EventHandler;
|
|
10
|
+
touchDownHandler: EventHandler;
|
|
11
|
+
minPanelSize: number;
|
|
12
|
+
readyToProcessNextDrag: boolean;
|
|
13
|
+
dockSpawnResizedEvent: CustomEvent<{}>;
|
|
14
|
+
previousMouseEvent: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
mouseMovedHandler: EventHandler;
|
|
19
|
+
mouseUpHandler: EventHandler;
|
|
20
|
+
touchMovedHandler: EventHandler;
|
|
21
|
+
touchUpHandler: EventHandler;
|
|
22
|
+
private iframeEventHandlers;
|
|
23
|
+
constructor(previousContainer: IDockContainer, nextContainer: IDockContainer, stackedVertical: boolean);
|
|
24
|
+
onMouseDown(e: IMouseOrTouchEvent): void;
|
|
25
|
+
onMouseUp(): void;
|
|
26
|
+
onMouseMovedIframe(e: IMouseOrTouchEvent, iframe: HTMLIFrameElement): void;
|
|
27
|
+
onMouseMoved(e: IMouseOrTouchEvent): void;
|
|
28
|
+
handleMoveEvent(pos: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}): void;
|
|
32
|
+
_performDrag(dx: number, dy: number): void;
|
|
33
|
+
_startDragging(e: IMouseOrTouchEvent): void;
|
|
34
|
+
_stopDragging(): void;
|
|
35
|
+
}
|
package/lib/js/SplitterBar.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
import { EventHandler } from "./EventHandler.js";
|
|
2
|
-
import { Utils } from "./Utils.js";
|
|
3
|
-
export class SplitterBar {
|
|
4
|
-
constructor(previousContainer, nextContainer, stackedVertical) {
|
|
5
|
-
// The panel to the left/top side of the bar, depending on the bar orientation
|
|
6
|
-
this.previousContainer = previousContainer;
|
|
7
|
-
// The panel to the right/bottom side of the bar, depending on the bar orientation
|
|
8
|
-
this.nextContainer = nextContainer;
|
|
9
|
-
this.stackedVertical = stackedVertical;
|
|
10
|
-
this.barElement = document.createElement('div');
|
|
11
|
-
this.barElement.classList.add(stackedVertical ? 'splitbar-horizontal' : 'splitbar-vertical');
|
|
12
|
-
this.mouseDownHandler = new EventHandler(this.barElement, 'mousedown', this.onMouseDown.bind(this));
|
|
13
|
-
this.touchDownHandler = new EventHandler(this.barElement, 'touchstart', this.onMouseDown.bind(this));
|
|
14
|
-
this.minPanelSize = 50; // TODO: Get from container configuration
|
|
15
|
-
this.readyToProcessNextDrag = true;
|
|
16
|
-
this.dockSpawnResizedEvent = new CustomEvent("DockSpawnResizedEvent", { composed: true, bubbles: true });
|
|
17
|
-
this.iframeEventHandlers = [];
|
|
18
|
-
}
|
|
19
|
-
onMouseDown(e) {
|
|
20
|
-
if (e.touches) {
|
|
21
|
-
if (e.touches.length > 1)
|
|
22
|
-
return;
|
|
23
|
-
e = e.touches[0];
|
|
24
|
-
}
|
|
25
|
-
this._startDragging(e);
|
|
26
|
-
}
|
|
27
|
-
onMouseUp() {
|
|
28
|
-
this._stopDragging();
|
|
29
|
-
}
|
|
30
|
-
onMouseMovedIframe(e, iframe) {
|
|
31
|
-
if (e.changedTouches != null) {
|
|
32
|
-
e = e.changedTouches[0];
|
|
33
|
-
}
|
|
34
|
-
let posIf = iframe.getBoundingClientRect();
|
|
35
|
-
this.handleMoveEvent({ x: e.clientX + posIf.x, y: e.clientY + posIf.y });
|
|
36
|
-
}
|
|
37
|
-
onMouseMoved(e) {
|
|
38
|
-
if (e.changedTouches != null) {
|
|
39
|
-
e = e.changedTouches[0];
|
|
40
|
-
}
|
|
41
|
-
this.handleMoveEvent({ x: e.clientX, y: e.clientY });
|
|
42
|
-
}
|
|
43
|
-
handleMoveEvent(pos) {
|
|
44
|
-
if (!this.readyToProcessNextDrag)
|
|
45
|
-
return;
|
|
46
|
-
this.readyToProcessNextDrag = false;
|
|
47
|
-
let dockManager = this.previousContainer.dockManager;
|
|
48
|
-
dockManager.suspendLayout(this.previousContainer);
|
|
49
|
-
dockManager.suspendLayout(this.nextContainer);
|
|
50
|
-
let dx = pos.x - this.previousMouseEvent.x;
|
|
51
|
-
let dy = pos.y - this.previousMouseEvent.y;
|
|
52
|
-
this._performDrag(dx, dy);
|
|
53
|
-
this.previousMouseEvent = pos;
|
|
54
|
-
this.readyToProcessNextDrag = true;
|
|
55
|
-
dockManager.resumeLayout(this.previousContainer);
|
|
56
|
-
dockManager.resumeLayout(this.nextContainer);
|
|
57
|
-
}
|
|
58
|
-
_performDrag(dx, dy) {
|
|
59
|
-
let previousWidth = this.previousContainer.containerElement.clientWidth;
|
|
60
|
-
let previousHeight = this.previousContainer.containerElement.clientHeight;
|
|
61
|
-
let nextWidth = this.nextContainer.containerElement.clientWidth;
|
|
62
|
-
let nextHeight = this.nextContainer.containerElement.clientHeight;
|
|
63
|
-
let previousPanelSize = this.stackedVertical ? previousHeight : previousWidth;
|
|
64
|
-
let nextPanelSize = this.stackedVertical ? nextHeight : nextWidth;
|
|
65
|
-
let deltaMovement = this.stackedVertical ? dy : dx;
|
|
66
|
-
let newPreviousPanelSize = previousPanelSize + deltaMovement;
|
|
67
|
-
let newNextPanelSize = nextPanelSize - deltaMovement;
|
|
68
|
-
if (newPreviousPanelSize < this.minPanelSize || newNextPanelSize < this.minPanelSize) {
|
|
69
|
-
// One of the panels is smaller than it should be.
|
|
70
|
-
// In that case, check if the small panel's size is being increased
|
|
71
|
-
let continueProcessing = (newPreviousPanelSize < this.minPanelSize && newPreviousPanelSize > previousPanelSize) ||
|
|
72
|
-
(newNextPanelSize < this.minPanelSize && newNextPanelSize > nextPanelSize);
|
|
73
|
-
if (!continueProcessing)
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (this.stackedVertical) {
|
|
77
|
-
this.previousContainer.resize(previousWidth, newPreviousPanelSize);
|
|
78
|
-
this.nextContainer.resize(nextWidth, newNextPanelSize);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
if (deltaMovement < 0) {
|
|
82
|
-
this.previousContainer.resize(newPreviousPanelSize, previousHeight);
|
|
83
|
-
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
87
|
-
this.previousContainer.resize(newPreviousPanelSize, previousHeight);
|
|
88
|
-
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
document.dispatchEvent(this.dockSpawnResizedEvent);
|
|
92
|
-
}
|
|
93
|
-
_startDragging(e) {
|
|
94
|
-
Utils.disableGlobalTextSelection(this.previousContainer.dockManager.config.dialogRootElement);
|
|
95
|
-
if (this.mouseMovedHandler) {
|
|
96
|
-
this.mouseMovedHandler.cancel();
|
|
97
|
-
delete this.mouseMovedHandler;
|
|
98
|
-
}
|
|
99
|
-
if (this.touchMovedHandler) {
|
|
100
|
-
this.touchMovedHandler.cancel();
|
|
101
|
-
delete this.touchMovedHandler;
|
|
102
|
-
}
|
|
103
|
-
if (this.mouseUpHandler) {
|
|
104
|
-
this.mouseUpHandler.cancel();
|
|
105
|
-
delete this.mouseUpHandler;
|
|
106
|
-
}
|
|
107
|
-
if (this.touchUpHandler) {
|
|
108
|
-
this.touchUpHandler.cancel();
|
|
109
|
-
delete this.touchUpHandler;
|
|
110
|
-
}
|
|
111
|
-
this.mouseMovedHandler = new EventHandler(window, 'mousemove', this.onMouseMoved.bind(this));
|
|
112
|
-
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this));
|
|
113
|
-
this.touchMovedHandler = new EventHandler(window, 'touchmove', this.onMouseMoved.bind(this));
|
|
114
|
-
this.touchUpHandler = new EventHandler(window, 'touchend', this.onMouseUp.bind(this));
|
|
115
|
-
if (this.previousContainer.dockManager.iframes) {
|
|
116
|
-
for (let f of this.previousContainer.dockManager.iframes) {
|
|
117
|
-
let mmi = this.onMouseMovedIframe.bind(this);
|
|
118
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mousemove', (e) => mmi(e, f)));
|
|
119
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mouseup', this.onMouseUp.bind(this)));
|
|
120
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchmove', (e) => mmi(e, f)));
|
|
121
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchend', this.onMouseUp.bind(this)));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
this.previousMouseEvent = { x: e.clientX, y: e.clientY };
|
|
125
|
-
}
|
|
126
|
-
_stopDragging() {
|
|
127
|
-
Utils.enableGlobalTextSelection(this.previousContainer.dockManager.config.dialogRootElement);
|
|
128
|
-
if (this.mouseMovedHandler) {
|
|
129
|
-
this.mouseMovedHandler.cancel();
|
|
130
|
-
delete this.mouseMovedHandler;
|
|
131
|
-
}
|
|
132
|
-
if (this.touchMovedHandler) {
|
|
133
|
-
this.touchMovedHandler.cancel();
|
|
134
|
-
delete this.touchMovedHandler;
|
|
135
|
-
}
|
|
136
|
-
if (this.mouseUpHandler) {
|
|
137
|
-
this.mouseUpHandler.cancel();
|
|
138
|
-
delete this.mouseUpHandler;
|
|
139
|
-
}
|
|
140
|
-
if (this.touchUpHandler) {
|
|
141
|
-
this.touchUpHandler.cancel();
|
|
142
|
-
delete this.touchUpHandler;
|
|
143
|
-
}
|
|
144
|
-
for (let e of this.iframeEventHandlers) {
|
|
145
|
-
e.cancel();
|
|
146
|
-
}
|
|
147
|
-
this.iframeEventHandlers = [];
|
|
148
|
-
}
|
|
149
|
-
}
|
|
1
|
+
import { EventHandler } from "./EventHandler.js";
|
|
2
|
+
import { Utils } from "./Utils.js";
|
|
3
|
+
export class SplitterBar {
|
|
4
|
+
constructor(previousContainer, nextContainer, stackedVertical) {
|
|
5
|
+
// The panel to the left/top side of the bar, depending on the bar orientation
|
|
6
|
+
this.previousContainer = previousContainer;
|
|
7
|
+
// The panel to the right/bottom side of the bar, depending on the bar orientation
|
|
8
|
+
this.nextContainer = nextContainer;
|
|
9
|
+
this.stackedVertical = stackedVertical;
|
|
10
|
+
this.barElement = document.createElement('div');
|
|
11
|
+
this.barElement.classList.add(stackedVertical ? 'splitbar-horizontal' : 'splitbar-vertical');
|
|
12
|
+
this.mouseDownHandler = new EventHandler(this.barElement, 'mousedown', this.onMouseDown.bind(this));
|
|
13
|
+
this.touchDownHandler = new EventHandler(this.barElement, 'touchstart', this.onMouseDown.bind(this));
|
|
14
|
+
this.minPanelSize = 50; // TODO: Get from container configuration
|
|
15
|
+
this.readyToProcessNextDrag = true;
|
|
16
|
+
this.dockSpawnResizedEvent = new CustomEvent("DockSpawnResizedEvent", { composed: true, bubbles: true });
|
|
17
|
+
this.iframeEventHandlers = [];
|
|
18
|
+
}
|
|
19
|
+
onMouseDown(e) {
|
|
20
|
+
if (e.touches) {
|
|
21
|
+
if (e.touches.length > 1)
|
|
22
|
+
return;
|
|
23
|
+
e = e.touches[0];
|
|
24
|
+
}
|
|
25
|
+
this._startDragging(e);
|
|
26
|
+
}
|
|
27
|
+
onMouseUp() {
|
|
28
|
+
this._stopDragging();
|
|
29
|
+
}
|
|
30
|
+
onMouseMovedIframe(e, iframe) {
|
|
31
|
+
if (e.changedTouches != null) {
|
|
32
|
+
e = e.changedTouches[0];
|
|
33
|
+
}
|
|
34
|
+
let posIf = iframe.getBoundingClientRect();
|
|
35
|
+
this.handleMoveEvent({ x: e.clientX + posIf.x, y: e.clientY + posIf.y });
|
|
36
|
+
}
|
|
37
|
+
onMouseMoved(e) {
|
|
38
|
+
if (e.changedTouches != null) {
|
|
39
|
+
e = e.changedTouches[0];
|
|
40
|
+
}
|
|
41
|
+
this.handleMoveEvent({ x: e.clientX, y: e.clientY });
|
|
42
|
+
}
|
|
43
|
+
handleMoveEvent(pos) {
|
|
44
|
+
if (!this.readyToProcessNextDrag)
|
|
45
|
+
return;
|
|
46
|
+
this.readyToProcessNextDrag = false;
|
|
47
|
+
let dockManager = this.previousContainer.dockManager;
|
|
48
|
+
dockManager.suspendLayout(this.previousContainer);
|
|
49
|
+
dockManager.suspendLayout(this.nextContainer);
|
|
50
|
+
let dx = pos.x - this.previousMouseEvent.x;
|
|
51
|
+
let dy = pos.y - this.previousMouseEvent.y;
|
|
52
|
+
this._performDrag(dx, dy);
|
|
53
|
+
this.previousMouseEvent = pos;
|
|
54
|
+
this.readyToProcessNextDrag = true;
|
|
55
|
+
dockManager.resumeLayout(this.previousContainer);
|
|
56
|
+
dockManager.resumeLayout(this.nextContainer);
|
|
57
|
+
}
|
|
58
|
+
_performDrag(dx, dy) {
|
|
59
|
+
let previousWidth = this.previousContainer.containerElement.clientWidth;
|
|
60
|
+
let previousHeight = this.previousContainer.containerElement.clientHeight;
|
|
61
|
+
let nextWidth = this.nextContainer.containerElement.clientWidth;
|
|
62
|
+
let nextHeight = this.nextContainer.containerElement.clientHeight;
|
|
63
|
+
let previousPanelSize = this.stackedVertical ? previousHeight : previousWidth;
|
|
64
|
+
let nextPanelSize = this.stackedVertical ? nextHeight : nextWidth;
|
|
65
|
+
let deltaMovement = this.stackedVertical ? dy : dx;
|
|
66
|
+
let newPreviousPanelSize = previousPanelSize + deltaMovement;
|
|
67
|
+
let newNextPanelSize = nextPanelSize - deltaMovement;
|
|
68
|
+
if (newPreviousPanelSize < this.minPanelSize || newNextPanelSize < this.minPanelSize) {
|
|
69
|
+
// One of the panels is smaller than it should be.
|
|
70
|
+
// In that case, check if the small panel's size is being increased
|
|
71
|
+
let continueProcessing = (newPreviousPanelSize < this.minPanelSize && newPreviousPanelSize > previousPanelSize) ||
|
|
72
|
+
(newNextPanelSize < this.minPanelSize && newNextPanelSize > nextPanelSize);
|
|
73
|
+
if (!continueProcessing)
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this.stackedVertical) {
|
|
77
|
+
this.previousContainer.resize(previousWidth, newPreviousPanelSize);
|
|
78
|
+
this.nextContainer.resize(nextWidth, newNextPanelSize);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
if (deltaMovement < 0) {
|
|
82
|
+
this.previousContainer.resize(newPreviousPanelSize, previousHeight);
|
|
83
|
+
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
87
|
+
this.previousContainer.resize(newPreviousPanelSize, previousHeight);
|
|
88
|
+
this.nextContainer.resize(newNextPanelSize, nextHeight);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
document.dispatchEvent(this.dockSpawnResizedEvent);
|
|
92
|
+
}
|
|
93
|
+
_startDragging(e) {
|
|
94
|
+
Utils.disableGlobalTextSelection(this.previousContainer.dockManager.config.dialogRootElement);
|
|
95
|
+
if (this.mouseMovedHandler) {
|
|
96
|
+
this.mouseMovedHandler.cancel();
|
|
97
|
+
delete this.mouseMovedHandler;
|
|
98
|
+
}
|
|
99
|
+
if (this.touchMovedHandler) {
|
|
100
|
+
this.touchMovedHandler.cancel();
|
|
101
|
+
delete this.touchMovedHandler;
|
|
102
|
+
}
|
|
103
|
+
if (this.mouseUpHandler) {
|
|
104
|
+
this.mouseUpHandler.cancel();
|
|
105
|
+
delete this.mouseUpHandler;
|
|
106
|
+
}
|
|
107
|
+
if (this.touchUpHandler) {
|
|
108
|
+
this.touchUpHandler.cancel();
|
|
109
|
+
delete this.touchUpHandler;
|
|
110
|
+
}
|
|
111
|
+
this.mouseMovedHandler = new EventHandler(window, 'mousemove', this.onMouseMoved.bind(this));
|
|
112
|
+
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this));
|
|
113
|
+
this.touchMovedHandler = new EventHandler(window, 'touchmove', this.onMouseMoved.bind(this));
|
|
114
|
+
this.touchUpHandler = new EventHandler(window, 'touchend', this.onMouseUp.bind(this));
|
|
115
|
+
if (this.previousContainer.dockManager.iframes) {
|
|
116
|
+
for (let f of this.previousContainer.dockManager.iframes) {
|
|
117
|
+
let mmi = this.onMouseMovedIframe.bind(this);
|
|
118
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mousemove', (e) => mmi(e, f)));
|
|
119
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mouseup', this.onMouseUp.bind(this)));
|
|
120
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchmove', (e) => mmi(e, f)));
|
|
121
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchend', this.onMouseUp.bind(this)));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
this.previousMouseEvent = { x: e.clientX, y: e.clientY };
|
|
125
|
+
}
|
|
126
|
+
_stopDragging() {
|
|
127
|
+
Utils.enableGlobalTextSelection(this.previousContainer.dockManager.config.dialogRootElement);
|
|
128
|
+
if (this.mouseMovedHandler) {
|
|
129
|
+
this.mouseMovedHandler.cancel();
|
|
130
|
+
delete this.mouseMovedHandler;
|
|
131
|
+
}
|
|
132
|
+
if (this.touchMovedHandler) {
|
|
133
|
+
this.touchMovedHandler.cancel();
|
|
134
|
+
delete this.touchMovedHandler;
|
|
135
|
+
}
|
|
136
|
+
if (this.mouseUpHandler) {
|
|
137
|
+
this.mouseUpHandler.cancel();
|
|
138
|
+
delete this.mouseUpHandler;
|
|
139
|
+
}
|
|
140
|
+
if (this.touchUpHandler) {
|
|
141
|
+
this.touchUpHandler.cancel();
|
|
142
|
+
delete this.touchUpHandler;
|
|
143
|
+
}
|
|
144
|
+
for (let e of this.iframeEventHandlers) {
|
|
145
|
+
e.cancel();
|
|
146
|
+
}
|
|
147
|
+
this.iframeEventHandlers = [];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
150
|
//# sourceMappingURL=SplitterBar.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { DockManager } from "./DockManager.js";
|
|
2
|
-
import { SplitterPanel } from "./SplitterPanel.js";
|
|
3
|
-
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
4
|
-
import { ContainerType } from "./ContainerType.js";
|
|
5
|
-
import { ISize } from "./interfaces/ISize.js";
|
|
6
|
-
import { IDockContainerWithSize } from "./interfaces/IDockContainerWithSize.js";
|
|
7
|
-
import { IState } from "./interfaces/IState.js";
|
|
8
|
-
export declare abstract class SplitterDockContainer implements IDockContainerWithSize {
|
|
9
|
-
name: string;
|
|
10
|
-
dockManager: DockManager;
|
|
11
|
-
minimumAllowedChildNodes: number;
|
|
12
|
-
splitterPanel: SplitterPanel;
|
|
13
|
-
stackedVertical: boolean;
|
|
14
|
-
containerElement: HTMLDivElement;
|
|
15
|
-
_cachedWidth: number;
|
|
16
|
-
_cachedHeight: number;
|
|
17
|
-
state: ISize;
|
|
18
|
-
containerType: ContainerType;
|
|
19
|
-
constructor(name: string, dockManager: DockManager, childContainers: IDockContainer[], stackedVertical: boolean);
|
|
20
|
-
resize(width: number, height: number): void;
|
|
21
|
-
performLayout(childContainers: IDockContainer[], relayoutEvenIfEqual?: boolean): void;
|
|
22
|
-
setActiveChild(): void;
|
|
23
|
-
destroy(): void;
|
|
24
|
-
/**
|
|
25
|
-
* Sets the percentage of space the specified [container] takes in the split panel
|
|
26
|
-
* The percentage is specified in [ratio] and is between 0..1
|
|
27
|
-
*/
|
|
28
|
-
setContainerRatio(container: IDockContainer, ratio: number): void;
|
|
29
|
-
getRatios(): number[];
|
|
30
|
-
setRatios(ratios: number[]): void;
|
|
31
|
-
saveState(state: IState): void;
|
|
32
|
-
loadState(state: IState): void;
|
|
33
|
-
get width(): number;
|
|
34
|
-
get height(): number;
|
|
35
|
-
}
|
|
1
|
+
import { DockManager } from "./DockManager.js";
|
|
2
|
+
import { SplitterPanel } from "./SplitterPanel.js";
|
|
3
|
+
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
4
|
+
import { ContainerType } from "./ContainerType.js";
|
|
5
|
+
import { ISize } from "./interfaces/ISize.js";
|
|
6
|
+
import { IDockContainerWithSize } from "./interfaces/IDockContainerWithSize.js";
|
|
7
|
+
import { IState } from "./interfaces/IState.js";
|
|
8
|
+
export declare abstract class SplitterDockContainer implements IDockContainerWithSize {
|
|
9
|
+
name: string;
|
|
10
|
+
dockManager: DockManager;
|
|
11
|
+
minimumAllowedChildNodes: number;
|
|
12
|
+
splitterPanel: SplitterPanel;
|
|
13
|
+
stackedVertical: boolean;
|
|
14
|
+
containerElement: HTMLDivElement;
|
|
15
|
+
_cachedWidth: number;
|
|
16
|
+
_cachedHeight: number;
|
|
17
|
+
state: ISize;
|
|
18
|
+
containerType: ContainerType;
|
|
19
|
+
constructor(name: string, dockManager: DockManager, childContainers: IDockContainer[], stackedVertical: boolean);
|
|
20
|
+
resize(width: number, height: number): void;
|
|
21
|
+
performLayout(childContainers: IDockContainer[], relayoutEvenIfEqual?: boolean): void;
|
|
22
|
+
setActiveChild(): void;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Sets the percentage of space the specified [container] takes in the split panel
|
|
26
|
+
* The percentage is specified in [ratio] and is between 0..1
|
|
27
|
+
*/
|
|
28
|
+
setContainerRatio(container: IDockContainer, ratio: number): void;
|
|
29
|
+
getRatios(): number[];
|
|
30
|
+
setRatios(ratios: number[]): void;
|
|
31
|
+
saveState(state: IState): void;
|
|
32
|
+
loadState(state: IState): void;
|
|
33
|
+
get width(): number;
|
|
34
|
+
get height(): number;
|
|
35
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { SplitterPanel } from "./SplitterPanel.js";
|
|
2
|
-
export class SplitterDockContainer {
|
|
3
|
-
constructor(name, dockManager, childContainers, stackedVertical) {
|
|
4
|
-
// for prototype inheritance purposes only
|
|
5
|
-
if (arguments.length === 0) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
this.name = name;
|
|
9
|
-
this.dockManager = dockManager;
|
|
10
|
-
this.stackedVertical = stackedVertical;
|
|
11
|
-
this.splitterPanel = new SplitterPanel(childContainers, this.stackedVertical);
|
|
12
|
-
this.containerElement = this.splitterPanel.panelElement;
|
|
13
|
-
this.minimumAllowedChildNodes = 2;
|
|
14
|
-
}
|
|
15
|
-
resize(width, height) {
|
|
16
|
-
// if (_cachedWidth === _cachedWidth && _cachedHeight === _height) {
|
|
17
|
-
// // No need to resize
|
|
18
|
-
// return;
|
|
19
|
-
// }
|
|
20
|
-
this.splitterPanel.resize(width, height);
|
|
21
|
-
this._cachedWidth = width;
|
|
22
|
-
this._cachedHeight = height;
|
|
23
|
-
}
|
|
24
|
-
performLayout(childContainers, relayoutEvenIfEqual = false) {
|
|
25
|
-
this.splitterPanel.performLayout(childContainers, relayoutEvenIfEqual);
|
|
26
|
-
}
|
|
27
|
-
setActiveChild( /*child*/) {
|
|
28
|
-
}
|
|
29
|
-
destroy() {
|
|
30
|
-
this.splitterPanel.destroy();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Sets the percentage of space the specified [container] takes in the split panel
|
|
34
|
-
* The percentage is specified in [ratio] and is between 0..1
|
|
35
|
-
*/
|
|
36
|
-
setContainerRatio(container, ratio) {
|
|
37
|
-
this.splitterPanel.setContainerRatio(container, ratio);
|
|
38
|
-
this.resize(this.width, this.height);
|
|
39
|
-
}
|
|
40
|
-
getRatios() {
|
|
41
|
-
return this.splitterPanel.getRatios();
|
|
42
|
-
}
|
|
43
|
-
setRatios(ratios) {
|
|
44
|
-
this.splitterPanel.setRatios(ratios);
|
|
45
|
-
this.resize(this.width, this.height);
|
|
46
|
-
}
|
|
47
|
-
saveState(state) {
|
|
48
|
-
state.width = this.width;
|
|
49
|
-
state.height = this.height;
|
|
50
|
-
}
|
|
51
|
-
loadState(state) {
|
|
52
|
-
this.state = { width: state.width, height: state.height };
|
|
53
|
-
// this.resize(state.width, state.height);
|
|
54
|
-
}
|
|
55
|
-
get width() {
|
|
56
|
-
if (this._cachedWidth === undefined)
|
|
57
|
-
this._cachedWidth = this.splitterPanel.panelElement.clientWidth;
|
|
58
|
-
return this._cachedWidth;
|
|
59
|
-
}
|
|
60
|
-
get height() {
|
|
61
|
-
if (this._cachedHeight === undefined)
|
|
62
|
-
this._cachedHeight = this.splitterPanel.panelElement.clientHeight;
|
|
63
|
-
return this._cachedHeight;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
import { SplitterPanel } from "./SplitterPanel.js";
|
|
2
|
+
export class SplitterDockContainer {
|
|
3
|
+
constructor(name, dockManager, childContainers, stackedVertical) {
|
|
4
|
+
// for prototype inheritance purposes only
|
|
5
|
+
if (arguments.length === 0) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.dockManager = dockManager;
|
|
10
|
+
this.stackedVertical = stackedVertical;
|
|
11
|
+
this.splitterPanel = new SplitterPanel(childContainers, this.stackedVertical);
|
|
12
|
+
this.containerElement = this.splitterPanel.panelElement;
|
|
13
|
+
this.minimumAllowedChildNodes = 2;
|
|
14
|
+
}
|
|
15
|
+
resize(width, height) {
|
|
16
|
+
// if (_cachedWidth === _cachedWidth && _cachedHeight === _height) {
|
|
17
|
+
// // No need to resize
|
|
18
|
+
// return;
|
|
19
|
+
// }
|
|
20
|
+
this.splitterPanel.resize(width, height);
|
|
21
|
+
this._cachedWidth = width;
|
|
22
|
+
this._cachedHeight = height;
|
|
23
|
+
}
|
|
24
|
+
performLayout(childContainers, relayoutEvenIfEqual = false) {
|
|
25
|
+
this.splitterPanel.performLayout(childContainers, relayoutEvenIfEqual);
|
|
26
|
+
}
|
|
27
|
+
setActiveChild( /*child*/) {
|
|
28
|
+
}
|
|
29
|
+
destroy() {
|
|
30
|
+
this.splitterPanel.destroy();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sets the percentage of space the specified [container] takes in the split panel
|
|
34
|
+
* The percentage is specified in [ratio] and is between 0..1
|
|
35
|
+
*/
|
|
36
|
+
setContainerRatio(container, ratio) {
|
|
37
|
+
this.splitterPanel.setContainerRatio(container, ratio);
|
|
38
|
+
this.resize(this.width, this.height);
|
|
39
|
+
}
|
|
40
|
+
getRatios() {
|
|
41
|
+
return this.splitterPanel.getRatios();
|
|
42
|
+
}
|
|
43
|
+
setRatios(ratios) {
|
|
44
|
+
this.splitterPanel.setRatios(ratios);
|
|
45
|
+
this.resize(this.width, this.height);
|
|
46
|
+
}
|
|
47
|
+
saveState(state) {
|
|
48
|
+
state.width = this.width;
|
|
49
|
+
state.height = this.height;
|
|
50
|
+
}
|
|
51
|
+
loadState(state) {
|
|
52
|
+
this.state = { width: state.width, height: state.height };
|
|
53
|
+
// this.resize(state.width, state.height);
|
|
54
|
+
}
|
|
55
|
+
get width() {
|
|
56
|
+
if (this._cachedWidth === undefined)
|
|
57
|
+
this._cachedWidth = this.splitterPanel.panelElement.clientWidth;
|
|
58
|
+
return this._cachedWidth;
|
|
59
|
+
}
|
|
60
|
+
get height() {
|
|
61
|
+
if (this._cachedHeight === undefined)
|
|
62
|
+
this._cachedHeight = this.splitterPanel.panelElement.clientHeight;
|
|
63
|
+
return this._cachedHeight;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
66
|
//# sourceMappingURL=SplitterDockContainer.js.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { SplitterBar } from "./SplitterBar.js";
|
|
2
|
-
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
3
|
-
/**
|
|
4
|
-
* A splitter panel manages the child containers inside it with splitter bars.
|
|
5
|
-
* It can be stacked horizontally or vertically
|
|
6
|
-
*/
|
|
7
|
-
export declare class SplitterPanel {
|
|
8
|
-
panelElement: HTMLDivElement;
|
|
9
|
-
spiltterBars: SplitterBar[];
|
|
10
|
-
stackedVertical: boolean;
|
|
11
|
-
childContainers: IDockContainer[];
|
|
12
|
-
constructor(childContainers: IDockContainer[], stackedVertical: boolean);
|
|
13
|
-
_buildSplitterDOMAndAddElements(): void;
|
|
14
|
-
performLayout(children: IDockContainer[], relayoutEvenIfEqual: boolean): void;
|
|
15
|
-
removeFromDOM(): void;
|
|
16
|
-
destroy(): void;
|
|
17
|
-
_insertContainerIntoPanel(container: IDockContainer, afterElement: HTMLElement): void;
|
|
18
|
-
/**
|
|
19
|
-
* Sets the percentage of space the specified [container] takes in the split panel
|
|
20
|
-
* The percentage is specified in [ratio] and is between 0..1
|
|
21
|
-
*/
|
|
22
|
-
setContainerRatio(container: IDockContainer, ratio: number): void;
|
|
23
|
-
getRatios(): number[];
|
|
24
|
-
setRatios(ratios: number[]): void;
|
|
25
|
-
resize(width: number, height: number): void;
|
|
26
|
-
}
|
|
1
|
+
import { SplitterBar } from "./SplitterBar.js";
|
|
2
|
+
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
3
|
+
/**
|
|
4
|
+
* A splitter panel manages the child containers inside it with splitter bars.
|
|
5
|
+
* It can be stacked horizontally or vertically
|
|
6
|
+
*/
|
|
7
|
+
export declare class SplitterPanel {
|
|
8
|
+
panelElement: HTMLDivElement;
|
|
9
|
+
spiltterBars: SplitterBar[];
|
|
10
|
+
stackedVertical: boolean;
|
|
11
|
+
childContainers: IDockContainer[];
|
|
12
|
+
constructor(childContainers: IDockContainer[], stackedVertical: boolean);
|
|
13
|
+
_buildSplitterDOMAndAddElements(): void;
|
|
14
|
+
performLayout(children: IDockContainer[], relayoutEvenIfEqual: boolean): void;
|
|
15
|
+
removeFromDOM(): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
_insertContainerIntoPanel(container: IDockContainer, afterElement: HTMLElement): void;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the percentage of space the specified [container] takes in the split panel
|
|
20
|
+
* The percentage is specified in [ratio] and is between 0..1
|
|
21
|
+
*/
|
|
22
|
+
setContainerRatio(container: IDockContainer, ratio: number): void;
|
|
23
|
+
getRatios(): number[];
|
|
24
|
+
setRatios(ratios: number[]): void;
|
|
25
|
+
resize(width: number, height: number): void;
|
|
26
|
+
}
|