dock-spawn-ts 2.230.0 → 2.270.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/css/dock-manager.css +15 -0
- package/lib/es5/dock-spawn-ts.js +1 -1
- package/lib/js/Dialog.d.ts +2 -1
- package/lib/js/Dialog.js +12 -2
- package/lib/js/Dialog.js.map +1 -1
- package/lib/js/DockManager.d.ts +1 -1
- package/lib/js/DockManager.js +8 -8
- package/lib/js/DockManager.js.map +1 -1
- package/lib/js/DocumentTabPage.js +1 -1
- package/lib/js/DocumentTabPage.js.map +1 -1
- package/lib/js/PanelContainer.d.ts +3 -0
- package/lib/js/PanelContainer.js +31 -4
- package/lib/js/PanelContainer.js.map +1 -1
- package/lib/js/TabHandle.js +1 -1
- package/lib/js/TabHandle.js.map +1 -1
- package/package.json +10 -10
- package/src/Dialog.ts +16 -3
- package/src/DockManager.ts +8 -8
- package/src/DocumentTabPage.ts +1 -1
- package/src/PanelContainer.ts +36 -4
- package/src/TabHandle.ts +1 -1
package/src/PanelContainer.ts
CHANGED
|
@@ -25,6 +25,7 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
25
25
|
name: string;
|
|
26
26
|
state: ISize;
|
|
27
27
|
elementContent: HTMLElement & { resizeHandler?: any, _dockSpawnPanelContainer: PanelContainer };
|
|
28
|
+
elementContentWrapper: HTMLElement;
|
|
28
29
|
dockManager: DockManager;
|
|
29
30
|
title: string;
|
|
30
31
|
containerType: ContainerType;
|
|
@@ -46,6 +47,7 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
46
47
|
_cachedWidth: number;
|
|
47
48
|
_cachedHeight: number;
|
|
48
49
|
_hideCloseButton: boolean;
|
|
50
|
+
_grayOut: HTMLDivElement;
|
|
49
51
|
|
|
50
52
|
constructor(elementContent: HTMLElement, dockManager: DockManager, title?: string, panelType?: PanelType, hideCloseButton?: boolean) {
|
|
51
53
|
if (!title)
|
|
@@ -53,6 +55,7 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
53
55
|
if (!panelType)
|
|
54
56
|
panelType = PanelType.panel;
|
|
55
57
|
this.panelType = panelType;
|
|
58
|
+
|
|
56
59
|
this.elementContent = Object.assign(elementContent, { _dockSpawnPanelContainer: this });
|
|
57
60
|
this.dockManager = dockManager;
|
|
58
61
|
this.title = title;
|
|
@@ -130,6 +133,31 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
130
133
|
return this.elementPanel;
|
|
131
134
|
}
|
|
132
135
|
|
|
136
|
+
grayOut(show: boolean) {
|
|
137
|
+
if (!show && this._grayOut) {
|
|
138
|
+
this.elementContentWrapper.removeChild(this._grayOut);
|
|
139
|
+
this.elementButtonClose.style.display = this._hideCloseButton ? 'none' : 'block';
|
|
140
|
+
this._grayOut = null;
|
|
141
|
+
if (!this._hideCloseButton)
|
|
142
|
+
this.eventListeners.forEach((listener) => {
|
|
143
|
+
if (listener.onHideCloseButton) {
|
|
144
|
+
listener.onHideCloseButton({ self: this, state: this._hideCloseButton });
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
else if (show && !this._grayOut) {
|
|
149
|
+
this._grayOut = document.createElement('div');
|
|
150
|
+
this._grayOut.className = 'panel-grayout';
|
|
151
|
+
this.elementButtonClose.style.display = 'none';
|
|
152
|
+
this.elementContentWrapper.appendChild(this._grayOut);
|
|
153
|
+
this.eventListeners.forEach((listener) => {
|
|
154
|
+
if (listener.onHideCloseButton) {
|
|
155
|
+
listener.onHideCloseButton({ self: this, state: true });
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
133
161
|
_initialize() {
|
|
134
162
|
this.name = Utils.getNextId('panel_');
|
|
135
163
|
this.elementPanel = document.createElement('div');
|
|
@@ -166,8 +194,12 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
166
194
|
new EventHandler(this.elementButtonClose, 'touchstart', this.onCloseButtonClicked.bind(this));
|
|
167
195
|
}
|
|
168
196
|
|
|
169
|
-
|
|
170
|
-
this.
|
|
197
|
+
this.elementContentWrapper = document.createElement("div");
|
|
198
|
+
this.elementContentWrapper.classList.add('panel-content-wrapper');
|
|
199
|
+
this.elementContentWrapper.appendChild(this.elementContent);
|
|
200
|
+
|
|
201
|
+
Utils.removeNode(this.elementContentWrapper);
|
|
202
|
+
this.elementContentHost.appendChild(this.elementContentWrapper);
|
|
171
203
|
|
|
172
204
|
// Extract the title from the content element's attribute
|
|
173
205
|
let contentTitle = this.elementContent.dataset.panelCaption;
|
|
@@ -226,7 +258,7 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
226
258
|
performUndockToDialog(e, dragOffset: Point) {
|
|
227
259
|
this.isDialog = true;
|
|
228
260
|
this.undockInitiator.enabled = false;
|
|
229
|
-
this.
|
|
261
|
+
this.elementContentWrapper.style.display = "block";
|
|
230
262
|
this.elementPanel.style.position = "";
|
|
231
263
|
return this.dockManager.requestUndockToDialog(this, e, dragOffset);
|
|
232
264
|
}
|
|
@@ -237,7 +269,7 @@ export class PanelContainer implements IDockContainerWithSize {
|
|
|
237
269
|
performClose() {
|
|
238
270
|
this.isDialog = true;
|
|
239
271
|
this.undockInitiator.enabled = false;
|
|
240
|
-
this.
|
|
272
|
+
this.elementContentWrapper.style.display = "block";
|
|
241
273
|
this.elementPanel.style.position = "";
|
|
242
274
|
this.dockManager.requestClose(this);
|
|
243
275
|
}
|
package/src/TabHandle.ts
CHANGED
|
@@ -50,7 +50,7 @@ export class TabHandle {
|
|
|
50
50
|
this.elementBase.appendChild(this.elementText);
|
|
51
51
|
if (this.parent.host.displayCloseButton)
|
|
52
52
|
this.elementBase.appendChild(this.elementCloseButton);
|
|
53
|
-
if ((<PanelContainer>this.parent.container)._hideCloseButton)
|
|
53
|
+
if ((<PanelContainer>this.parent.container)._hideCloseButton || (<PanelContainer>this.parent.container)._grayOut)
|
|
54
54
|
this.elementCloseButton.style.display = 'none';
|
|
55
55
|
this.parent.host.tabListElement.appendChild(this.elementBase);
|
|
56
56
|
|