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
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TabPage } from "./TabPage.js";
|
|
2
|
-
import { Utils } from "./Utils.js";
|
|
3
|
-
/**
|
|
4
|
-
* Specialized tab page that doesn't display the panel's frame when docked in a tab page
|
|
5
|
-
*/
|
|
6
|
-
export class DocumentTabPage extends TabPage {
|
|
7
|
-
constructor(host, container) {
|
|
8
|
-
super(host, container);
|
|
9
|
-
// If the container is a panel, extract the content element and set it as the tab's content
|
|
10
|
-
if (this.container.containerType === 'panel') {
|
|
11
|
-
this.panel = container;
|
|
12
|
-
this.containerElement = this.panel.elementContentWrapper;
|
|
13
|
-
// detach the container element from the panel's frame.
|
|
14
|
-
// It will be reattached when this tab page is destroyed
|
|
15
|
-
// This enables the panel's frame (title bar etc) to be hidden
|
|
16
|
-
// inside the tab page
|
|
17
|
-
Utils.removeNode(this.containerElement);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
destroy() {
|
|
21
|
-
super.destroy();
|
|
22
|
-
// Restore the panel content element back into the panel frame
|
|
23
|
-
//Utils.removeNode(this.containerElement);
|
|
24
|
-
this.panel.elementContentHost.appendChild(this.containerElement);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
import { TabPage } from "./TabPage.js";
|
|
2
|
+
import { Utils } from "./Utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Specialized tab page that doesn't display the panel's frame when docked in a tab page
|
|
5
|
+
*/
|
|
6
|
+
export class DocumentTabPage extends TabPage {
|
|
7
|
+
constructor(host, container) {
|
|
8
|
+
super(host, container);
|
|
9
|
+
// If the container is a panel, extract the content element and set it as the tab's content
|
|
10
|
+
if (this.container.containerType === 'panel') {
|
|
11
|
+
this.panel = container;
|
|
12
|
+
this.containerElement = this.panel.elementContentWrapper;
|
|
13
|
+
// detach the container element from the panel's frame.
|
|
14
|
+
// It will be reattached when this tab page is destroyed
|
|
15
|
+
// This enables the panel's frame (title bar etc) to be hidden
|
|
16
|
+
// inside the tab page
|
|
17
|
+
Utils.removeNode(this.containerElement);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
destroy() {
|
|
21
|
+
super.destroy();
|
|
22
|
+
// Restore the panel content element back into the panel frame
|
|
23
|
+
//Utils.removeNode(this.containerElement);
|
|
24
|
+
this.panel.elementContentHost.appendChild(this.containerElement);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=DocumentTabPage.js.map
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { Dialog } from "./Dialog.js";
|
|
2
|
-
import { DockManager } from "./DockManager.js";
|
|
3
|
-
import { EventHandler } from "./EventHandler.js";
|
|
4
|
-
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
5
|
-
import { ContainerType } from "./ContainerType.js";
|
|
6
|
-
import { IState } from "./interfaces/IState.js";
|
|
7
|
-
import { PanelContainer } from "./PanelContainer.js";
|
|
8
|
-
export declare class DraggableContainer implements IDockContainer {
|
|
9
|
-
dialog: Dialog;
|
|
10
|
-
delegate: PanelContainer;
|
|
11
|
-
containerElement: HTMLElement;
|
|
12
|
-
dockManager: DockManager;
|
|
13
|
-
topLevelElement: HTMLElement;
|
|
14
|
-
containerType: ContainerType;
|
|
15
|
-
mouseDownHandler: EventHandler;
|
|
16
|
-
touchDownHandler: EventHandler;
|
|
17
|
-
minimumAllowedChildNodes: number;
|
|
18
|
-
previousMousePosition: {
|
|
19
|
-
x: any;
|
|
20
|
-
y: any;
|
|
21
|
-
};
|
|
22
|
-
mouseMoveHandler: EventHandler;
|
|
23
|
-
touchMoveHandler: EventHandler;
|
|
24
|
-
mouseUpHandler: EventHandler;
|
|
25
|
-
touchUpHandler: EventHandler;
|
|
26
|
-
private iframeEventHandlers;
|
|
27
|
-
constructor(dialog: Dialog, delegate: PanelContainer, topLevelElement: HTMLElement, dragHandle: HTMLElement);
|
|
28
|
-
destroy(): void;
|
|
29
|
-
saveState(state: IState): void;
|
|
30
|
-
loadState(state: IState): void;
|
|
31
|
-
setActiveChild(): void;
|
|
32
|
-
get width(): number;
|
|
33
|
-
get height(): number;
|
|
34
|
-
get name(): string;
|
|
35
|
-
set name(value: string);
|
|
36
|
-
resize(width: number, height: number): void;
|
|
37
|
-
performLayout(children: IDockContainer[]): void;
|
|
38
|
-
removeDecorator(): void;
|
|
39
|
-
onMouseDown(event: TouchEvent | MouseEvent): void;
|
|
40
|
-
onMouseUp(event: any): void;
|
|
41
|
-
_startDragging(event: {
|
|
42
|
-
clientX: number;
|
|
43
|
-
clientY: number;
|
|
44
|
-
}): void;
|
|
45
|
-
_stopDragging(event: any): void;
|
|
46
|
-
onMouseMovedIframe(e: MouseEvent, iframe: HTMLIFrameElement): void;
|
|
47
|
-
onMouseMove(event: TouchEvent | MouseEvent, iframeOffset?: {
|
|
48
|
-
x: number;
|
|
49
|
-
y: number;
|
|
50
|
-
}): void;
|
|
51
|
-
_performDrag(dx: number, dy: number): void;
|
|
52
|
-
}
|
|
1
|
+
import { Dialog } from "./Dialog.js";
|
|
2
|
+
import { DockManager } from "./DockManager.js";
|
|
3
|
+
import { EventHandler } from "./EventHandler.js";
|
|
4
|
+
import { IDockContainer } from "./interfaces/IDockContainer.js";
|
|
5
|
+
import { ContainerType } from "./ContainerType.js";
|
|
6
|
+
import { IState } from "./interfaces/IState.js";
|
|
7
|
+
import { PanelContainer } from "./PanelContainer.js";
|
|
8
|
+
export declare class DraggableContainer implements IDockContainer {
|
|
9
|
+
dialog: Dialog;
|
|
10
|
+
delegate: PanelContainer;
|
|
11
|
+
containerElement: HTMLElement;
|
|
12
|
+
dockManager: DockManager;
|
|
13
|
+
topLevelElement: HTMLElement;
|
|
14
|
+
containerType: ContainerType;
|
|
15
|
+
mouseDownHandler: EventHandler;
|
|
16
|
+
touchDownHandler: EventHandler;
|
|
17
|
+
minimumAllowedChildNodes: number;
|
|
18
|
+
previousMousePosition: {
|
|
19
|
+
x: any;
|
|
20
|
+
y: any;
|
|
21
|
+
};
|
|
22
|
+
mouseMoveHandler: EventHandler;
|
|
23
|
+
touchMoveHandler: EventHandler;
|
|
24
|
+
mouseUpHandler: EventHandler;
|
|
25
|
+
touchUpHandler: EventHandler;
|
|
26
|
+
private iframeEventHandlers;
|
|
27
|
+
constructor(dialog: Dialog, delegate: PanelContainer, topLevelElement: HTMLElement, dragHandle: HTMLElement);
|
|
28
|
+
destroy(): void;
|
|
29
|
+
saveState(state: IState): void;
|
|
30
|
+
loadState(state: IState): void;
|
|
31
|
+
setActiveChild(): void;
|
|
32
|
+
get width(): number;
|
|
33
|
+
get height(): number;
|
|
34
|
+
get name(): string;
|
|
35
|
+
set name(value: string);
|
|
36
|
+
resize(width: number, height: number): void;
|
|
37
|
+
performLayout(children: IDockContainer[]): void;
|
|
38
|
+
removeDecorator(): void;
|
|
39
|
+
onMouseDown(event: TouchEvent | MouseEvent): void;
|
|
40
|
+
onMouseUp(event: any): void;
|
|
41
|
+
_startDragging(event: {
|
|
42
|
+
clientX: number;
|
|
43
|
+
clientY: number;
|
|
44
|
+
}): void;
|
|
45
|
+
_stopDragging(event: any): void;
|
|
46
|
+
onMouseMovedIframe(e: MouseEvent, iframe: HTMLIFrameElement): void;
|
|
47
|
+
onMouseMove(event: TouchEvent | MouseEvent, iframeOffset?: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}): void;
|
|
51
|
+
_performDrag(dx: number, dy: number): void;
|
|
52
|
+
}
|
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
import { EventHandler } from "./EventHandler.js";
|
|
2
|
-
import { Point } from "./Point.js";
|
|
3
|
-
import { Utils } from "./Utils.js";
|
|
4
|
-
export class DraggableContainer {
|
|
5
|
-
constructor(dialog, delegate, topLevelElement, dragHandle) {
|
|
6
|
-
this.dialog = dialog;
|
|
7
|
-
this.delegate = delegate;
|
|
8
|
-
this.containerElement = delegate.containerElement;
|
|
9
|
-
this.dockManager = delegate.dockManager;
|
|
10
|
-
this.topLevelElement = topLevelElement;
|
|
11
|
-
this.containerType = delegate.containerType;
|
|
12
|
-
this.mouseDownHandler = new EventHandler(dragHandle, 'mousedown', this.onMouseDown.bind(this));
|
|
13
|
-
this.touchDownHandler = new EventHandler(dragHandle, 'touchstart', this.onMouseDown.bind(this));
|
|
14
|
-
this.topLevelElement.style.left = topLevelElement.offsetLeft + 'px';
|
|
15
|
-
this.topLevelElement.style.top = topLevelElement.offsetTop + 'px';
|
|
16
|
-
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes;
|
|
17
|
-
this.iframeEventHandlers = [];
|
|
18
|
-
}
|
|
19
|
-
destroy() {
|
|
20
|
-
this.removeDecorator();
|
|
21
|
-
this.delegate.destroy();
|
|
22
|
-
}
|
|
23
|
-
saveState(state) {
|
|
24
|
-
this.delegate.saveState(state);
|
|
25
|
-
}
|
|
26
|
-
loadState(state) {
|
|
27
|
-
this.delegate.loadState(state);
|
|
28
|
-
}
|
|
29
|
-
setActiveChild( /*child*/) {
|
|
30
|
-
}
|
|
31
|
-
get width() {
|
|
32
|
-
return this.delegate.width;
|
|
33
|
-
}
|
|
34
|
-
get height() {
|
|
35
|
-
return this.delegate.height;
|
|
36
|
-
}
|
|
37
|
-
get name() {
|
|
38
|
-
return this.delegate.name;
|
|
39
|
-
}
|
|
40
|
-
set name(value) {
|
|
41
|
-
if (value)
|
|
42
|
-
this.delegate.name = value;
|
|
43
|
-
}
|
|
44
|
-
resize(width, height) {
|
|
45
|
-
this.delegate.resize(width, height);
|
|
46
|
-
}
|
|
47
|
-
performLayout(children) {
|
|
48
|
-
this.delegate.performLayout(children, false);
|
|
49
|
-
}
|
|
50
|
-
removeDecorator() {
|
|
51
|
-
if (this.mouseDownHandler) {
|
|
52
|
-
this.mouseDownHandler.cancel();
|
|
53
|
-
delete this.mouseDownHandler;
|
|
54
|
-
}
|
|
55
|
-
if (this.touchDownHandler) {
|
|
56
|
-
this.touchDownHandler.cancel();
|
|
57
|
-
delete this.touchDownHandler;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
onMouseDown(event) {
|
|
61
|
-
if (event.preventDefault)
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
let touchOrMouseData = null;
|
|
64
|
-
if (event.touches) {
|
|
65
|
-
if (event.touches.length > 1)
|
|
66
|
-
return;
|
|
67
|
-
touchOrMouseData = event.touches[0];
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
touchOrMouseData = event;
|
|
71
|
-
}
|
|
72
|
-
this._startDragging(touchOrMouseData);
|
|
73
|
-
this.previousMousePosition = { x: touchOrMouseData.clientX, y: touchOrMouseData.clientY };
|
|
74
|
-
if (this.mouseMoveHandler) {
|
|
75
|
-
this.mouseMoveHandler.cancel();
|
|
76
|
-
delete this.mouseMoveHandler;
|
|
77
|
-
}
|
|
78
|
-
if (this.touchMoveHandler) {
|
|
79
|
-
this.touchMoveHandler.cancel();
|
|
80
|
-
delete this.touchMoveHandler;
|
|
81
|
-
}
|
|
82
|
-
if (this.mouseUpHandler) {
|
|
83
|
-
this.mouseUpHandler.cancel();
|
|
84
|
-
delete this.mouseUpHandler;
|
|
85
|
-
}
|
|
86
|
-
if (this.touchUpHandler) {
|
|
87
|
-
this.touchUpHandler.cancel();
|
|
88
|
-
delete this.touchUpHandler;
|
|
89
|
-
}
|
|
90
|
-
this.mouseMoveHandler = new EventHandler(window, 'mousemove', this.onMouseMove.bind(this));
|
|
91
|
-
this.touchMoveHandler = new EventHandler(event.target, 'touchmove', this.onMouseMove.bind(this), { passive: false });
|
|
92
|
-
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this));
|
|
93
|
-
this.touchUpHandler = new EventHandler(event.target, 'touchend', this.onMouseUp.bind(this));
|
|
94
|
-
if (this.dockManager.iframes) {
|
|
95
|
-
for (let f of this.dockManager.iframes) {
|
|
96
|
-
let mmi = this.onMouseMovedIframe.bind(this);
|
|
97
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mousemove', (e) => mmi(e, f)));
|
|
98
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mouseup', this.onMouseUp.bind(this)));
|
|
99
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchmove', (e) => mmi(e, f)));
|
|
100
|
-
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchend', this.onMouseUp.bind(this)));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
onMouseUp(event) {
|
|
105
|
-
this._stopDragging(event);
|
|
106
|
-
this.mouseMoveHandler.cancel();
|
|
107
|
-
delete this.mouseMoveHandler;
|
|
108
|
-
this.touchMoveHandler.cancel();
|
|
109
|
-
delete this.touchMoveHandler;
|
|
110
|
-
this.mouseUpHandler.cancel();
|
|
111
|
-
delete this.mouseUpHandler;
|
|
112
|
-
this.touchUpHandler.cancel();
|
|
113
|
-
delete this.touchUpHandler;
|
|
114
|
-
for (let e of this.iframeEventHandlers) {
|
|
115
|
-
e.cancel();
|
|
116
|
-
}
|
|
117
|
-
this.iframeEventHandlers = [];
|
|
118
|
-
}
|
|
119
|
-
_startDragging(event) {
|
|
120
|
-
this.containerElement.classList.add("draggable-dragging-active");
|
|
121
|
-
this.delegate.elementContentContainer.classList.add("draggable-dragging-active");
|
|
122
|
-
if (this.dialog.eventListener)
|
|
123
|
-
this.dialog.eventListener._onDialogDragStarted(this.dialog, event);
|
|
124
|
-
Utils.disableGlobalTextSelection(this.dockManager.config.dialogRootElement);
|
|
125
|
-
}
|
|
126
|
-
_stopDragging(event) {
|
|
127
|
-
this.containerElement.classList.remove("draggable-dragging-active");
|
|
128
|
-
this.delegate.elementContentContainer.classList.remove("draggable-dragging-active");
|
|
129
|
-
if (this.dialog.eventListener)
|
|
130
|
-
this.dialog.eventListener._onDialogDragEnded(this.dialog, event);
|
|
131
|
-
Utils.enableGlobalTextSelection(this.dockManager.config.dialogRootElement);
|
|
132
|
-
}
|
|
133
|
-
onMouseMovedIframe(e, iframe) {
|
|
134
|
-
let posIf = iframe.getBoundingClientRect();
|
|
135
|
-
this.onMouseMove(e, { x: posIf.x, y: posIf.y });
|
|
136
|
-
}
|
|
137
|
-
onMouseMove(event, iframeOffset) {
|
|
138
|
-
if (event.preventDefault)
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
let br = document.body.getBoundingClientRect();
|
|
141
|
-
if (event.touches != null) {
|
|
142
|
-
if (event.touches.length > 1)
|
|
143
|
-
return;
|
|
144
|
-
for (let w in this.dockManager.dockWheel.wheelItems) {
|
|
145
|
-
let item = this.dockManager.dockWheel.wheelItems[w];
|
|
146
|
-
let offset = item.element.getBoundingClientRect();
|
|
147
|
-
if (event.touches[0].clientX > (offset.left - br.left) &&
|
|
148
|
-
event.touches[0].clientX < (offset.left + item.element.clientWidth - br.left) &&
|
|
149
|
-
event.touches[0].clientY > (offset.top - br.top) &&
|
|
150
|
-
event.touches[0].clientY < (offset.top + item.element.clientHeight - br.top)) {
|
|
151
|
-
item.onMouseMoved();
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
if (item.active)
|
|
155
|
-
item.onMouseOut();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
let touchOrMouseData = null;
|
|
160
|
-
if (event.changedTouches) {
|
|
161
|
-
if (event.changedTouches.length > 1)
|
|
162
|
-
return;
|
|
163
|
-
touchOrMouseData = event.changedTouches[0];
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
touchOrMouseData = event;
|
|
167
|
-
}
|
|
168
|
-
let currentMousePosition = new Point(touchOrMouseData.clientX, touchOrMouseData.clientY);
|
|
169
|
-
if (iframeOffset)
|
|
170
|
-
currentMousePosition = new Point(touchOrMouseData.clientX + iframeOffset.x, touchOrMouseData.clientY + iframeOffset.y);
|
|
171
|
-
let dx = this.dockManager.checkXBounds(this.topLevelElement, currentMousePosition, this.previousMousePosition, false, false);
|
|
172
|
-
let dy = this.dockManager.checkYBounds(this.topLevelElement, currentMousePosition, this.previousMousePosition, false, false);
|
|
173
|
-
this._performDrag(dx, dy);
|
|
174
|
-
this.previousMousePosition = currentMousePosition;
|
|
175
|
-
}
|
|
176
|
-
_performDrag(dx, dy) {
|
|
177
|
-
let left = dx + Utils.getPixels(this.topLevelElement.style.left);
|
|
178
|
-
let top = dy + Utils.getPixels(this.topLevelElement.style.top);
|
|
179
|
-
this.topLevelElement.style.left = left + 'px';
|
|
180
|
-
this.topLevelElement.style.top = top + 'px';
|
|
181
|
-
this.dialog.panel.setDialogPosition(left, top);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
1
|
+
import { EventHandler } from "./EventHandler.js";
|
|
2
|
+
import { Point } from "./Point.js";
|
|
3
|
+
import { Utils } from "./Utils.js";
|
|
4
|
+
export class DraggableContainer {
|
|
5
|
+
constructor(dialog, delegate, topLevelElement, dragHandle) {
|
|
6
|
+
this.dialog = dialog;
|
|
7
|
+
this.delegate = delegate;
|
|
8
|
+
this.containerElement = delegate.containerElement;
|
|
9
|
+
this.dockManager = delegate.dockManager;
|
|
10
|
+
this.topLevelElement = topLevelElement;
|
|
11
|
+
this.containerType = delegate.containerType;
|
|
12
|
+
this.mouseDownHandler = new EventHandler(dragHandle, 'mousedown', this.onMouseDown.bind(this));
|
|
13
|
+
this.touchDownHandler = new EventHandler(dragHandle, 'touchstart', this.onMouseDown.bind(this));
|
|
14
|
+
this.topLevelElement.style.left = topLevelElement.offsetLeft + 'px';
|
|
15
|
+
this.topLevelElement.style.top = topLevelElement.offsetTop + 'px';
|
|
16
|
+
this.minimumAllowedChildNodes = delegate.minimumAllowedChildNodes;
|
|
17
|
+
this.iframeEventHandlers = [];
|
|
18
|
+
}
|
|
19
|
+
destroy() {
|
|
20
|
+
this.removeDecorator();
|
|
21
|
+
this.delegate.destroy();
|
|
22
|
+
}
|
|
23
|
+
saveState(state) {
|
|
24
|
+
this.delegate.saveState(state);
|
|
25
|
+
}
|
|
26
|
+
loadState(state) {
|
|
27
|
+
this.delegate.loadState(state);
|
|
28
|
+
}
|
|
29
|
+
setActiveChild( /*child*/) {
|
|
30
|
+
}
|
|
31
|
+
get width() {
|
|
32
|
+
return this.delegate.width;
|
|
33
|
+
}
|
|
34
|
+
get height() {
|
|
35
|
+
return this.delegate.height;
|
|
36
|
+
}
|
|
37
|
+
get name() {
|
|
38
|
+
return this.delegate.name;
|
|
39
|
+
}
|
|
40
|
+
set name(value) {
|
|
41
|
+
if (value)
|
|
42
|
+
this.delegate.name = value;
|
|
43
|
+
}
|
|
44
|
+
resize(width, height) {
|
|
45
|
+
this.delegate.resize(width, height);
|
|
46
|
+
}
|
|
47
|
+
performLayout(children) {
|
|
48
|
+
this.delegate.performLayout(children, false);
|
|
49
|
+
}
|
|
50
|
+
removeDecorator() {
|
|
51
|
+
if (this.mouseDownHandler) {
|
|
52
|
+
this.mouseDownHandler.cancel();
|
|
53
|
+
delete this.mouseDownHandler;
|
|
54
|
+
}
|
|
55
|
+
if (this.touchDownHandler) {
|
|
56
|
+
this.touchDownHandler.cancel();
|
|
57
|
+
delete this.touchDownHandler;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
onMouseDown(event) {
|
|
61
|
+
if (event.preventDefault)
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
let touchOrMouseData = null;
|
|
64
|
+
if (event.touches) {
|
|
65
|
+
if (event.touches.length > 1)
|
|
66
|
+
return;
|
|
67
|
+
touchOrMouseData = event.touches[0];
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
touchOrMouseData = event;
|
|
71
|
+
}
|
|
72
|
+
this._startDragging(touchOrMouseData);
|
|
73
|
+
this.previousMousePosition = { x: touchOrMouseData.clientX, y: touchOrMouseData.clientY };
|
|
74
|
+
if (this.mouseMoveHandler) {
|
|
75
|
+
this.mouseMoveHandler.cancel();
|
|
76
|
+
delete this.mouseMoveHandler;
|
|
77
|
+
}
|
|
78
|
+
if (this.touchMoveHandler) {
|
|
79
|
+
this.touchMoveHandler.cancel();
|
|
80
|
+
delete this.touchMoveHandler;
|
|
81
|
+
}
|
|
82
|
+
if (this.mouseUpHandler) {
|
|
83
|
+
this.mouseUpHandler.cancel();
|
|
84
|
+
delete this.mouseUpHandler;
|
|
85
|
+
}
|
|
86
|
+
if (this.touchUpHandler) {
|
|
87
|
+
this.touchUpHandler.cancel();
|
|
88
|
+
delete this.touchUpHandler;
|
|
89
|
+
}
|
|
90
|
+
this.mouseMoveHandler = new EventHandler(window, 'mousemove', this.onMouseMove.bind(this));
|
|
91
|
+
this.touchMoveHandler = new EventHandler(event.target, 'touchmove', this.onMouseMove.bind(this), { passive: false });
|
|
92
|
+
this.mouseUpHandler = new EventHandler(window, 'mouseup', this.onMouseUp.bind(this));
|
|
93
|
+
this.touchUpHandler = new EventHandler(event.target, 'touchend', this.onMouseUp.bind(this));
|
|
94
|
+
if (this.dockManager.iframes) {
|
|
95
|
+
for (let f of this.dockManager.iframes) {
|
|
96
|
+
let mmi = this.onMouseMovedIframe.bind(this);
|
|
97
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mousemove', (e) => mmi(e, f)));
|
|
98
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'mouseup', this.onMouseUp.bind(this)));
|
|
99
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchmove', (e) => mmi(e, f)));
|
|
100
|
+
this.iframeEventHandlers.push(new EventHandler(f.contentWindow, 'touchend', this.onMouseUp.bind(this)));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
onMouseUp(event) {
|
|
105
|
+
this._stopDragging(event);
|
|
106
|
+
this.mouseMoveHandler.cancel();
|
|
107
|
+
delete this.mouseMoveHandler;
|
|
108
|
+
this.touchMoveHandler.cancel();
|
|
109
|
+
delete this.touchMoveHandler;
|
|
110
|
+
this.mouseUpHandler.cancel();
|
|
111
|
+
delete this.mouseUpHandler;
|
|
112
|
+
this.touchUpHandler.cancel();
|
|
113
|
+
delete this.touchUpHandler;
|
|
114
|
+
for (let e of this.iframeEventHandlers) {
|
|
115
|
+
e.cancel();
|
|
116
|
+
}
|
|
117
|
+
this.iframeEventHandlers = [];
|
|
118
|
+
}
|
|
119
|
+
_startDragging(event) {
|
|
120
|
+
this.containerElement.classList.add("draggable-dragging-active");
|
|
121
|
+
this.delegate.elementContentContainer.classList.add("draggable-dragging-active");
|
|
122
|
+
if (this.dialog.eventListener)
|
|
123
|
+
this.dialog.eventListener._onDialogDragStarted(this.dialog, event);
|
|
124
|
+
Utils.disableGlobalTextSelection(this.dockManager.config.dialogRootElement);
|
|
125
|
+
}
|
|
126
|
+
_stopDragging(event) {
|
|
127
|
+
this.containerElement.classList.remove("draggable-dragging-active");
|
|
128
|
+
this.delegate.elementContentContainer.classList.remove("draggable-dragging-active");
|
|
129
|
+
if (this.dialog.eventListener)
|
|
130
|
+
this.dialog.eventListener._onDialogDragEnded(this.dialog, event);
|
|
131
|
+
Utils.enableGlobalTextSelection(this.dockManager.config.dialogRootElement);
|
|
132
|
+
}
|
|
133
|
+
onMouseMovedIframe(e, iframe) {
|
|
134
|
+
let posIf = iframe.getBoundingClientRect();
|
|
135
|
+
this.onMouseMove(e, { x: posIf.x, y: posIf.y });
|
|
136
|
+
}
|
|
137
|
+
onMouseMove(event, iframeOffset) {
|
|
138
|
+
if (event.preventDefault)
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
let br = document.body.getBoundingClientRect();
|
|
141
|
+
if (event.touches != null) {
|
|
142
|
+
if (event.touches.length > 1)
|
|
143
|
+
return;
|
|
144
|
+
for (let w in this.dockManager.dockWheel.wheelItems) {
|
|
145
|
+
let item = this.dockManager.dockWheel.wheelItems[w];
|
|
146
|
+
let offset = item.element.getBoundingClientRect();
|
|
147
|
+
if (event.touches[0].clientX > (offset.left - br.left) &&
|
|
148
|
+
event.touches[0].clientX < (offset.left + item.element.clientWidth - br.left) &&
|
|
149
|
+
event.touches[0].clientY > (offset.top - br.top) &&
|
|
150
|
+
event.touches[0].clientY < (offset.top + item.element.clientHeight - br.top)) {
|
|
151
|
+
item.onMouseMoved();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
if (item.active)
|
|
155
|
+
item.onMouseOut();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
let touchOrMouseData = null;
|
|
160
|
+
if (event.changedTouches) {
|
|
161
|
+
if (event.changedTouches.length > 1)
|
|
162
|
+
return;
|
|
163
|
+
touchOrMouseData = event.changedTouches[0];
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
touchOrMouseData = event;
|
|
167
|
+
}
|
|
168
|
+
let currentMousePosition = new Point(touchOrMouseData.clientX, touchOrMouseData.clientY);
|
|
169
|
+
if (iframeOffset)
|
|
170
|
+
currentMousePosition = new Point(touchOrMouseData.clientX + iframeOffset.x, touchOrMouseData.clientY + iframeOffset.y);
|
|
171
|
+
let dx = this.dockManager.checkXBounds(this.topLevelElement, currentMousePosition, this.previousMousePosition, false, false);
|
|
172
|
+
let dy = this.dockManager.checkYBounds(this.topLevelElement, currentMousePosition, this.previousMousePosition, false, false);
|
|
173
|
+
this._performDrag(dx, dy);
|
|
174
|
+
this.previousMousePosition = currentMousePosition;
|
|
175
|
+
}
|
|
176
|
+
_performDrag(dx, dy) {
|
|
177
|
+
let left = dx + Utils.getPixels(this.topLevelElement.style.left);
|
|
178
|
+
let top = dy + Utils.getPixels(this.topLevelElement.style.top);
|
|
179
|
+
this.topLevelElement.style.left = left + 'px';
|
|
180
|
+
this.topLevelElement.style.top = top + 'px';
|
|
181
|
+
this.dialog.panel.setDialogPosition(left, top);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
184
|
//# sourceMappingURL=DraggableContainer.js.map
|
package/lib/js/EventHandler.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class EventHandler {
|
|
2
|
-
target: EventListenerOrEventListenerObject;
|
|
3
|
-
eventName: string;
|
|
4
|
-
source: Element | Window;
|
|
5
|
-
constructor(source: Element | Window, eventName: string, target: EventListenerOrEventListenerObject, useCapture?: boolean | AddEventListenerOptions);
|
|
6
|
-
cancel(): void;
|
|
7
|
-
}
|
|
1
|
+
export declare class EventHandler {
|
|
2
|
+
target: EventListenerOrEventListenerObject;
|
|
3
|
+
eventName: string;
|
|
4
|
+
source: Element | Window;
|
|
5
|
+
constructor(source: Element | Window, eventName: string, target: EventListenerOrEventListenerObject, useCapture?: boolean | AddEventListenerOptions);
|
|
6
|
+
cancel(): void;
|
|
7
|
+
}
|
package/lib/js/EventHandler.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export class EventHandler {
|
|
2
|
-
constructor(source, eventName, target, useCapture) {
|
|
3
|
-
this.target = target;
|
|
4
|
-
this.eventName = eventName;
|
|
5
|
-
this.source = source;
|
|
6
|
-
this.source.addEventListener(eventName, this.target, useCapture);
|
|
7
|
-
}
|
|
8
|
-
cancel() {
|
|
9
|
-
this.source.removeEventListener(this.eventName, this.target);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
export class EventHandler {
|
|
2
|
+
constructor(source, eventName, target, useCapture) {
|
|
3
|
+
this.target = target;
|
|
4
|
+
this.eventName = eventName;
|
|
5
|
+
this.source = source;
|
|
6
|
+
this.source.addEventListener(eventName, this.target, useCapture);
|
|
7
|
+
}
|
|
8
|
+
cancel() {
|
|
9
|
+
this.source.removeEventListener(this.eventName, this.target);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=EventHandler.js.map
|
package/lib/js/Exports.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export * from './ContainerType.js';
|
|
2
|
-
export * from './Dialog.js';
|
|
3
|
-
export * from './DockConfig.js';
|
|
4
|
-
export * from './DockGraphSerializer.js';
|
|
5
|
-
export * from './DockLayoutEngine.js';
|
|
6
|
-
export * from './DockManager.js';
|
|
7
|
-
export * from './DockManagerContext.js';
|
|
8
|
-
export * from './DockModel.js';
|
|
9
|
-
export * from './DockNode.js';
|
|
10
|
-
export * from './DockWheel.js';
|
|
11
|
-
export * from './DockWheelItem.js';
|
|
12
|
-
export * from './DocumentManagerContainer.js';
|
|
13
|
-
export * from './DocumentTabPage.js';
|
|
14
|
-
export * from './DraggableContainer.js';
|
|
15
|
-
export * from './EventHandler.js';
|
|
16
|
-
export * from './FillDockContainer.js';
|
|
17
|
-
export * from './HorizontalDockContainer.js';
|
|
18
|
-
export * from './PanelContainer.js';
|
|
19
|
-
export * from './Point.js';
|
|
20
|
-
export * from './ResizableContainer.js';
|
|
21
|
-
export * from './ResizeHandle.js';
|
|
22
|
-
export * from './SplitterBar.js';
|
|
23
|
-
export * from './SplitterDockContainer.js';
|
|
24
|
-
export * from './SplitterPanel.js';
|
|
25
|
-
export * from './TabHandle.js';
|
|
26
|
-
export * from './TabHost.js';
|
|
27
|
-
export * from './TabPage.js';
|
|
28
|
-
export * from './UndockInitiator.js';
|
|
29
|
-
export * from './Utils.js';
|
|
30
|
-
export * from './VerticalDockContainer.js';
|
|
1
|
+
export * from './ContainerType.js';
|
|
2
|
+
export * from './Dialog.js';
|
|
3
|
+
export * from './DockConfig.js';
|
|
4
|
+
export * from './DockGraphSerializer.js';
|
|
5
|
+
export * from './DockLayoutEngine.js';
|
|
6
|
+
export * from './DockManager.js';
|
|
7
|
+
export * from './DockManagerContext.js';
|
|
8
|
+
export * from './DockModel.js';
|
|
9
|
+
export * from './DockNode.js';
|
|
10
|
+
export * from './DockWheel.js';
|
|
11
|
+
export * from './DockWheelItem.js';
|
|
12
|
+
export * from './DocumentManagerContainer.js';
|
|
13
|
+
export * from './DocumentTabPage.js';
|
|
14
|
+
export * from './DraggableContainer.js';
|
|
15
|
+
export * from './EventHandler.js';
|
|
16
|
+
export * from './FillDockContainer.js';
|
|
17
|
+
export * from './HorizontalDockContainer.js';
|
|
18
|
+
export * from './PanelContainer.js';
|
|
19
|
+
export * from './Point.js';
|
|
20
|
+
export * from './ResizableContainer.js';
|
|
21
|
+
export * from './ResizeHandle.js';
|
|
22
|
+
export * from './SplitterBar.js';
|
|
23
|
+
export * from './SplitterDockContainer.js';
|
|
24
|
+
export * from './SplitterPanel.js';
|
|
25
|
+
export * from './TabHandle.js';
|
|
26
|
+
export * from './TabHost.js';
|
|
27
|
+
export * from './TabPage.js';
|
|
28
|
+
export * from './UndockInitiator.js';
|
|
29
|
+
export * from './Utils.js';
|
|
30
|
+
export * from './VerticalDockContainer.js';
|