@mintplayer/ng-bootstrap 15.24.1 → 15.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dock/src/dock/dock.component.d.ts +3 -1
- package/dock/src/dock-panel-header/dock-panel-header.component.d.ts +5 -4
- package/dock/src/index.d.ts +1 -0
- package/dock/src/panes/content-pane.d.ts +1 -0
- package/dock/src/panes/dock-pane.d.ts +1 -0
- package/dock/src/panes/document-host-pane.d.ts +1 -0
- package/dock/src/panes/floating-pane.d.ts +2 -1
- package/dock/src/panes/split-pane.d.ts +1 -0
- package/dock/src/panes/tab-group-pane.d.ts +1 -0
- package/dock/src/services/dock/dock.service.d.ts +14 -0
- package/dock/src/services/index.d.ts +1 -0
- package/esm2020/dock/src/dock/dock.component.mjs +10 -2
- package/esm2020/dock/src/dock-panel-header/dock-panel-header.component.mjs +202 -96
- package/esm2020/dock/src/index.mjs +2 -1
- package/esm2020/dock/src/panes/content-pane.mjs +4 -1
- package/esm2020/dock/src/panes/dock-pane.mjs +1 -1
- package/esm2020/dock/src/panes/document-host-pane.mjs +4 -1
- package/esm2020/dock/src/panes/floating-pane.mjs +7 -2
- package/esm2020/dock/src/panes/split-pane.mjs +4 -1
- package/esm2020/dock/src/panes/tab-group-pane.mjs +4 -1
- package/esm2020/dock/src/services/dock/dock.service.mjs +56 -0
- package/esm2020/dock/src/services/index.mjs +2 -0
- package/esm2020/list-group/src/list-group-item/list-group-item.component.mjs +9 -7
- package/esm2020/resizable/src/resize-glyph/resize-glyph.directive.mjs +1 -1
- package/esm2020/treeview/index.mjs +2 -0
- package/esm2020/treeview/mintplayer-ng-bootstrap-treeview.mjs +5 -0
- package/esm2020/treeview/src/index.mjs +4 -0
- package/esm2020/treeview/src/treeview/treeview.component.mjs +46 -0
- package/esm2020/treeview/src/treeview-item/treeview-item.component.mjs +27 -0
- package/esm2020/treeview/src/treeview.module.mjs +21 -0
- package/fesm2015/mintplayer-ng-bootstrap-dock.mjs +287 -111
- package/fesm2015/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2015/mintplayer-ng-bootstrap-list-group.mjs +8 -6
- package/fesm2015/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
- package/fesm2015/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2015/mintplayer-ng-bootstrap-treeview.mjs +93 -0
- package/fesm2015/mintplayer-ng-bootstrap-treeview.mjs.map +1 -0
- package/fesm2020/mintplayer-ng-bootstrap-dock.mjs +285 -111
- package/fesm2020/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2020/mintplayer-ng-bootstrap-list-group.mjs +8 -6
- package/fesm2020/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
- package/fesm2020/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2020/mintplayer-ng-bootstrap-treeview.mjs +91 -0
- package/fesm2020/mintplayer-ng-bootstrap-treeview.mjs.map +1 -0
- package/list-group/src/list-group-item/list-group-item.component.d.ts +2 -4
- package/package.json +10 -2
- package/resizable/src/resize-glyph/resize-glyph.directive.d.ts +1 -1
- package/treeview/index.d.ts +1 -0
- package/treeview/src/index.d.ts +3 -0
- package/treeview/src/treeview/treeview.component.d.ts +16 -0
- package/treeview/src/treeview-item/treeview-item.component.d.ts +10 -0
- package/treeview/src/treeview.module.d.ts +11 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ViewChild, Input, ContentChildren, ViewChildren, HostBinding, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { Component, ViewChild, Input, ContentChildren, ViewChildren, HostBinding, Injectable, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i3 from '@angular/cdk/portal';
|
|
@@ -13,7 +13,8 @@ import * as i6 from '@mintplayer/ng-bootstrap/tab-control';
|
|
|
13
13
|
import { BsTabControlModule } from '@mintplayer/ng-bootstrap/tab-control';
|
|
14
14
|
import * as i4 from '@mintplayer/ng-bootstrap/instance-of';
|
|
15
15
|
import { BsInstanceOfModule } from '@mintplayer/ng-bootstrap/instance-of';
|
|
16
|
-
import { BehaviorSubject, Subject, takeUntil, take } from 'rxjs';
|
|
16
|
+
import { BehaviorSubject, Subject, takeUntil, map, take } from 'rxjs';
|
|
17
|
+
import { deepClone } from '@mintplayer/parentify';
|
|
17
18
|
import * as i1 from '@angular/cdk/overlay';
|
|
18
19
|
|
|
19
20
|
class BsDockPanelComponent {
|
|
@@ -49,6 +50,9 @@ class BsTabGroupPane extends BsDockPane {
|
|
|
49
50
|
this.panes = [];
|
|
50
51
|
Object.assign(this, data);
|
|
51
52
|
}
|
|
53
|
+
get isEmpty() {
|
|
54
|
+
return this.panes.length === 0;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
class BsDocumentHost extends BsDockPane {
|
|
@@ -56,38 +60,53 @@ class BsDocumentHost extends BsDockPane {
|
|
|
56
60
|
super();
|
|
57
61
|
Object.assign(this, data);
|
|
58
62
|
}
|
|
63
|
+
get isEmpty() {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
return (_b = (_a = this.rootPane) === null || _a === void 0 ? void 0 : _a.isEmpty) !== null && _b !== void 0 ? _b : true;
|
|
66
|
+
}
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
(function (EPaneType) {
|
|
63
|
-
EPaneType[EPaneType["documentHost"] = 1] = "documentHost";
|
|
64
|
-
EPaneType[EPaneType["splitPane"] = 2] = "splitPane";
|
|
65
|
-
EPaneType[EPaneType["contentPane"] = 3] = "contentPane";
|
|
66
|
-
EPaneType[EPaneType["tabGroupPane"] = 4] = "tabGroupPane";
|
|
67
|
-
})(EPaneType || (EPaneType = {}));
|
|
68
|
-
|
|
69
|
-
class BsSplitPane extends BsDockPane {
|
|
69
|
+
class BsContentPane extends BsDockPane {
|
|
70
70
|
constructor(data) {
|
|
71
71
|
super();
|
|
72
|
-
this.orientation = 'horizontal';
|
|
73
|
-
this.panes = [];
|
|
74
72
|
Object.assign(this, data);
|
|
75
73
|
}
|
|
74
|
+
get isEmpty() {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
class
|
|
79
|
+
class BsFloatingPane extends BsDockPane {
|
|
79
80
|
constructor(data) {
|
|
80
81
|
super();
|
|
81
82
|
Object.assign(this, data);
|
|
82
83
|
}
|
|
84
|
+
get isEmpty() {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
return (_b = (_a = this.pane) === null || _a === void 0 ? void 0 : _a.isEmpty) !== null && _b !== void 0 ? _b : true;
|
|
87
|
+
}
|
|
83
88
|
}
|
|
84
89
|
|
|
85
|
-
class
|
|
90
|
+
class BsSplitPane extends BsDockPane {
|
|
86
91
|
constructor(data) {
|
|
92
|
+
super();
|
|
93
|
+
this.orientation = 'horizontal';
|
|
94
|
+
this.panes = [];
|
|
87
95
|
Object.assign(this, data);
|
|
88
96
|
}
|
|
97
|
+
get isEmpty() {
|
|
98
|
+
return this.panes.length === 0;
|
|
99
|
+
}
|
|
89
100
|
}
|
|
90
101
|
|
|
102
|
+
var EPaneType;
|
|
103
|
+
(function (EPaneType) {
|
|
104
|
+
EPaneType[EPaneType["documentHost"] = 1] = "documentHost";
|
|
105
|
+
EPaneType[EPaneType["splitPane"] = 2] = "splitPane";
|
|
106
|
+
EPaneType[EPaneType["contentPane"] = 3] = "contentPane";
|
|
107
|
+
EPaneType[EPaneType["tabGroupPane"] = 4] = "tabGroupPane";
|
|
108
|
+
})(EPaneType || (EPaneType = {}));
|
|
109
|
+
|
|
91
110
|
class BsDockPaneRendererComponent {
|
|
92
111
|
constructor(overlay, element) {
|
|
93
112
|
this.overlay = overlay;
|
|
@@ -154,6 +173,10 @@ class BsDockComponent {
|
|
|
154
173
|
.subscribe((floating) => {
|
|
155
174
|
floating.forEach((panel) => panel.moveToOverlay());
|
|
156
175
|
});
|
|
176
|
+
this.parentifiedLayout$ = this.layout$.pipe(map(layout => deepClone(layout, true,
|
|
177
|
+
// []
|
|
178
|
+
[BsContentPane, BsDocumentHost, BsFloatingPane, BsSplitPane, BsTabGroupPane], true)));
|
|
179
|
+
this.parentifiedLayout$.pipe(takeUntil(this.destroyed$)).subscribe(console.log);
|
|
157
180
|
}
|
|
158
181
|
set panels(value) {
|
|
159
182
|
this.panels$.next(value.toArray());
|
|
@@ -202,13 +225,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
202
225
|
args: ['style.right']
|
|
203
226
|
}] } });
|
|
204
227
|
|
|
228
|
+
class BsDockService {
|
|
229
|
+
buildTraces(layout) {
|
|
230
|
+
const result = [layout.rootPane, ...layout.floatingPanes].map(pane => this.buildTracesPrivate([pane]));
|
|
231
|
+
// const result = this.buildTracesPrivate([layout.rootPane]);
|
|
232
|
+
return result.flatMap(traceGroup => traceGroup);
|
|
233
|
+
}
|
|
234
|
+
buildTracesPrivate(currentSequence) {
|
|
235
|
+
const children = this.getChildPanes(currentSequence[currentSequence.length - 1]);
|
|
236
|
+
if (children.length === 0) {
|
|
237
|
+
return [{
|
|
238
|
+
finished: true,
|
|
239
|
+
trace: currentSequence
|
|
240
|
+
}];
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
const result = children.map(child => this.buildTracesPrivate([...currentSequence, child]));
|
|
244
|
+
return result.flatMap(r => r);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
getChildPanes(pane) {
|
|
248
|
+
if (pane instanceof BsContentPane) {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
else if (pane instanceof BsTabGroupPane) {
|
|
252
|
+
return pane.panes;
|
|
253
|
+
}
|
|
254
|
+
else if (pane instanceof BsSplitPane) {
|
|
255
|
+
return pane.panes;
|
|
256
|
+
}
|
|
257
|
+
else if (pane instanceof BsFloatingPane) {
|
|
258
|
+
return pane.pane ? [pane.pane] : [];
|
|
259
|
+
}
|
|
260
|
+
else if (pane instanceof BsDocumentHost) {
|
|
261
|
+
return pane.rootPane ? [pane.rootPane] : [];
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
return [];
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
BsDockService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
269
|
+
BsDockService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockService, providedIn: 'root' });
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockService, decorators: [{
|
|
271
|
+
type: Injectable,
|
|
272
|
+
args: [{
|
|
273
|
+
providedIn: 'root'
|
|
274
|
+
}]
|
|
275
|
+
}] });
|
|
276
|
+
|
|
205
277
|
class BsDockPanelHeaderComponent {
|
|
206
|
-
constructor(dockPanel, dock, element) {
|
|
278
|
+
constructor(dockPanel, dock, dockService, element) {
|
|
207
279
|
this.dockPanel = dockPanel;
|
|
208
280
|
this.dock = dock;
|
|
281
|
+
this.dockService = dockService;
|
|
209
282
|
this.element = element;
|
|
210
283
|
this.isMouseDown = false;
|
|
211
|
-
this.
|
|
284
|
+
this.isDragging = false;
|
|
212
285
|
this.dBlock = true;
|
|
213
286
|
}
|
|
214
287
|
onMouseDown(ev) {
|
|
@@ -217,131 +290,234 @@ class BsDockPanelHeaderComponent {
|
|
|
217
290
|
}
|
|
218
291
|
onMouseMove(ev) {
|
|
219
292
|
if (this.isMouseDown) {
|
|
220
|
-
if (!this.
|
|
221
|
-
this.
|
|
222
|
-
this.dock.
|
|
293
|
+
if (!this.isDragging) {
|
|
294
|
+
this.isDragging = true;
|
|
295
|
+
this.dock.parentifiedLayout$.pipe(take(1)).subscribe((layout) => {
|
|
223
296
|
var _a, _b, _c, _d;
|
|
224
|
-
|
|
225
|
-
|
|
297
|
+
// this.dock.layout$.pipe(take(1)).subscribe((layout) => {
|
|
298
|
+
const traces = this.dockService.buildTraces(layout);
|
|
299
|
+
console.log('traces', { layout, traces });
|
|
300
|
+
const matching = traces.filter(t => {
|
|
301
|
+
const lastPane = t.trace[t.trace.length - 1];
|
|
302
|
+
// return (lastPane instanceof BsContentPane) && (lastPane.dockPanel === this.dockPanel);
|
|
303
|
+
return (lastPane instanceof BsContentPane) && (lastPane.dockPanel === this.dockPanel);
|
|
304
|
+
});
|
|
305
|
+
console.log('matching', matching);
|
|
306
|
+
if (matching.length !== 1) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
// const tabs = matching[0].trace.filter(pane => pane instanceof BsTabGroupPane);
|
|
310
|
+
// const lastTabGroup = tabs[tabs.length - 1];
|
|
311
|
+
// // console.log('last tabgroup', lastTabGroup);
|
|
312
|
+
let tabControlEl = this.element.nativeElement;
|
|
226
313
|
do {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
314
|
+
if (tabControlEl.parentElement) {
|
|
315
|
+
tabControlEl = tabControlEl.parentElement;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
throw 'No more parents';
|
|
319
|
+
}
|
|
320
|
+
} while (tabControlEl.tagName.toUpperCase() !== 'BS-TAB-CONTROL');
|
|
321
|
+
const coords = {
|
|
322
|
+
width: tabControlEl.clientWidth,
|
|
323
|
+
height: tabControlEl.clientHeight,
|
|
324
|
+
left: ev.clientX - ev.offsetX,
|
|
325
|
+
top: ev.clientY - ev.offsetY,
|
|
326
|
+
};
|
|
327
|
+
// this.dockPanel.headerPortal?.isAttached && this.dockPanel.headerPortal?.detach();
|
|
328
|
+
// this.dockPanel.contentPortal?.isAttached && this.dockPanel.contentPortal?.detach();
|
|
329
|
+
// this.removeFromPane(layout.rootPane, this.dockPanel);
|
|
330
|
+
const trace = [...matching[0].trace];
|
|
331
|
+
((_a = this.dockPanel.headerPortal) === null || _a === void 0 ? void 0 : _a.isAttached) && ((_b = this.dockPanel.headerPortal) === null || _b === void 0 ? void 0 : _b.detach());
|
|
332
|
+
((_c = this.dockPanel.contentPortal) === null || _c === void 0 ? void 0 : _c.isAttached) && ((_d = this.dockPanel.contentPortal) === null || _d === void 0 ? void 0 : _d.detach());
|
|
333
|
+
for (let index = trace.length - 1; index >= 0; index--) {
|
|
334
|
+
if (index > 0) {
|
|
335
|
+
this.removeFromPaneBis(trace[index - 1], trace[index]);
|
|
336
|
+
if (!trace[index - 1].isEmpty)
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
const floatingIndex = layout.floatingPanes.indexOf(trace[0]);
|
|
341
|
+
if (trace[0].isEmpty && (floatingIndex > -1)) {
|
|
342
|
+
layout.floatingPanes.splice(floatingIndex, 1);
|
|
256
343
|
}
|
|
257
|
-
}
|
|
258
|
-
this.dragOperation = {
|
|
259
|
-
offsetX: ev.offsetX,
|
|
260
|
-
offsetY: ev.offsetY,
|
|
261
|
-
floatingPane
|
|
262
|
-
};
|
|
263
|
-
layout.floatingPanes.push(floatingPane);
|
|
264
|
-
this.dock.layout$.next(layout);
|
|
344
|
+
}
|
|
265
345
|
}
|
|
346
|
+
// this.removeFromPane((<any>matching[0].trace[0])['$original'], this.dockPanel);
|
|
347
|
+
const floatingPane = new BsFloatingPane({
|
|
348
|
+
pane: new BsTabGroupPane({
|
|
349
|
+
panes: [
|
|
350
|
+
new BsContentPane({
|
|
351
|
+
dockPanel: this.dockPanel
|
|
352
|
+
})
|
|
353
|
+
]
|
|
354
|
+
}),
|
|
355
|
+
size: {
|
|
356
|
+
width: coords.width,
|
|
357
|
+
height: coords.height,
|
|
358
|
+
},
|
|
359
|
+
location: {
|
|
360
|
+
x: coords.left,
|
|
361
|
+
y: coords.top,
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
this.dragOperation = {
|
|
365
|
+
offsetX: ev.offsetX,
|
|
366
|
+
offsetY: ev.offsetY,
|
|
367
|
+
floatingPane
|
|
368
|
+
};
|
|
369
|
+
layout.floatingPanes.push(floatingPane);
|
|
370
|
+
setTimeout(() => this.dock.layout$.next(layout), 5);
|
|
371
|
+
// console.log('traces', { traces, matching, dockPanel: this.dockPanel, equals: traces[2].trace[3] });
|
|
372
|
+
// let element: HTMLElement | null = this.element.nativeElement;
|
|
373
|
+
// let tree: HTMLElement[] = [];
|
|
374
|
+
// do {
|
|
375
|
+
// tree.push(element!);
|
|
376
|
+
// element = element!.parentElement;
|
|
377
|
+
// } while (element);
|
|
378
|
+
// const tabControls = tree.filter(el => el.tagName.toUpperCase() === 'BS-TAB-CONTROL');
|
|
379
|
+
// if (tabControls.length > 0) {
|
|
380
|
+
// const coords = {
|
|
381
|
+
// width: tabControls[0].clientWidth,
|
|
382
|
+
// height: tabControls[0].clientHeight,
|
|
383
|
+
// left: ev.clientX - ev.offsetX,
|
|
384
|
+
// top: ev.clientY - ev.offsetY,
|
|
385
|
+
// };
|
|
386
|
+
// this.dockPanel.headerPortal?.isAttached && this.dockPanel.headerPortal?.detach();
|
|
387
|
+
// this.dockPanel.contentPortal?.isAttached && this.dockPanel.contentPortal?.detach();
|
|
388
|
+
// this.removeFromPane(layout.rootPane, this.dockPanel);
|
|
389
|
+
// const floatingPane = new BsFloatingPane({
|
|
390
|
+
// pane: new BsTabGroupPane({
|
|
391
|
+
// panes: [
|
|
392
|
+
// new BsContentPane({
|
|
393
|
+
// dockPanel: this.dockPanel
|
|
394
|
+
// })
|
|
395
|
+
// ]
|
|
396
|
+
// }),
|
|
397
|
+
// size: {
|
|
398
|
+
// width: coords.width,
|
|
399
|
+
// height: coords.height,
|
|
400
|
+
// },
|
|
401
|
+
// location: {
|
|
402
|
+
// x: coords.left,
|
|
403
|
+
// y: coords.top,
|
|
404
|
+
// }
|
|
405
|
+
// });
|
|
406
|
+
// this.dragOperation = {
|
|
407
|
+
// offsetX: ev.offsetX,
|
|
408
|
+
// offsetY: ev.offsetY,
|
|
409
|
+
// floatingPane
|
|
410
|
+
// };
|
|
411
|
+
// layout.floatingPanes.push(floatingPane);
|
|
412
|
+
// this.dock.layout$.next(layout);
|
|
413
|
+
// }
|
|
266
414
|
});
|
|
267
415
|
}
|
|
268
|
-
else
|
|
269
|
-
if (this.dragOperation
|
|
270
|
-
this.dragOperation.floatingPane.location
|
|
271
|
-
|
|
416
|
+
else {
|
|
417
|
+
if (this.dragOperation) {
|
|
418
|
+
if (this.dragOperation.floatingPane.location) {
|
|
419
|
+
this.dragOperation.floatingPane.location.x = ev.clientX - this.dragOperation.offsetX;
|
|
420
|
+
this.dragOperation.floatingPane.location.y = ev.clientY - this.dragOperation.offsetY;
|
|
421
|
+
}
|
|
422
|
+
// } else {
|
|
423
|
+
// const traces = this.dockService.buildTraces(this.dock.layout);
|
|
424
|
+
// const matchingTrace = traces.filter(trace => {
|
|
425
|
+
// const pane = trace.trace[trace.trace.length - 1];
|
|
426
|
+
// return (pane instanceof BsContentPane) && (pane.dockPanel === this.dockPanel);
|
|
427
|
+
// });
|
|
428
|
+
// console.log('matching', { traces, matchingTrace });
|
|
429
|
+
// // this.dragOperation = {
|
|
430
|
+
// // }
|
|
272
431
|
}
|
|
273
432
|
}
|
|
274
433
|
}
|
|
275
434
|
}
|
|
276
|
-
|
|
435
|
+
removeFromPaneBis(host, pane) {
|
|
277
436
|
if (host instanceof BsContentPane) {
|
|
278
|
-
return { paneRemoved: false, hostIsEmpty: false };
|
|
279
437
|
}
|
|
280
438
|
else if (host instanceof BsDocumentHost) {
|
|
281
439
|
// Actually documentHost should never be removed
|
|
282
|
-
if (!host.rootPane) {
|
|
283
|
-
return { paneRemoved: false, hostIsEmpty: true };
|
|
284
|
-
}
|
|
285
|
-
const result = this.removeFromPane(host.rootPane, panel);
|
|
286
|
-
return { paneRemoved: result.paneRemoved, hostIsEmpty: result.hostIsEmpty };
|
|
287
440
|
}
|
|
288
441
|
else if (host instanceof BsTabGroupPane) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
host.panes.splice(
|
|
292
|
-
return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
// ATM. all panes are ContentPanes anyway.
|
|
296
|
-
// So unless you'd want to have splitters inside the tabs,
|
|
297
|
-
// This code will not be hit.
|
|
298
|
-
// const result = host.panes
|
|
299
|
-
// .map(parentPane => this.removeFromPane(parentPane, panel))
|
|
300
|
-
// .filter(r => r.paneRemoved);
|
|
301
|
-
//
|
|
302
|
-
// if (result.length > 0) {
|
|
303
|
-
// return { paneRemoved: true, hostIsEmpty: }
|
|
304
|
-
// }
|
|
305
|
-
return { paneRemoved: false, hostIsEmpty: host.panes.length === 0 };
|
|
442
|
+
if (pane instanceof BsContentPane) {
|
|
443
|
+
const index = host.panes.indexOf(pane);
|
|
444
|
+
host.panes.splice(index, 1);
|
|
306
445
|
}
|
|
307
446
|
}
|
|
308
447
|
else if (host instanceof BsSplitPane) {
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (matching.length > 0) {
|
|
314
|
-
host.panes.splice(host.panes.findIndex(p => (p instanceof BsContentPane) && matching.includes(p)), 1);
|
|
315
|
-
// TODO: Remove splitter if only 1 pane left?
|
|
316
|
-
return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
for (let splitPane of host.panes) {
|
|
320
|
-
const result = this.removeFromPane(splitPane, panel);
|
|
321
|
-
if (result.paneRemoved && result.hostIsEmpty) {
|
|
322
|
-
// splitPane is empty now, so we can remove it from this splitter
|
|
323
|
-
host.panes.splice(host.panes.indexOf(splitPane), 1);
|
|
324
|
-
return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return { paneRemoved: false, hostIsEmpty: host.panes.length === 0 };
|
|
448
|
+
const index = host.panes.indexOf(pane);
|
|
449
|
+
host.panes.splice(index, 1);
|
|
450
|
+
}
|
|
451
|
+
else if (host instanceof BsFloatingPane) {
|
|
329
452
|
}
|
|
330
453
|
else {
|
|
331
|
-
throw '
|
|
454
|
+
throw 'Unknown pane type';
|
|
332
455
|
}
|
|
333
456
|
}
|
|
457
|
+
// removeFromPane(host: BsDockPane, panel: BsDockPanelComponent /*, parents: BsDockPane[] */): RemoveFromPaneResult {
|
|
458
|
+
// if (host instanceof BsContentPane) {
|
|
459
|
+
// return { paneRemoved: false, hostIsEmpty: false };
|
|
460
|
+
// } else if (host instanceof BsDocumentHost) {
|
|
461
|
+
// // Actually documentHost should never be removed
|
|
462
|
+
// if (!host.rootPane) {
|
|
463
|
+
// return { paneRemoved: false, hostIsEmpty: true };
|
|
464
|
+
// }
|
|
465
|
+
// const result = this.removeFromPane(host.rootPane, panel);
|
|
466
|
+
// return { paneRemoved: result.paneRemoved, hostIsEmpty: result.hostIsEmpty };
|
|
467
|
+
// } else if (host instanceof BsTabGroupPane) {
|
|
468
|
+
// const matching = host.panes.filter(p => p.dockPanel === panel);
|
|
469
|
+
// if (matching.length > 0) {
|
|
470
|
+
// host.panes.splice(host.panes.findIndex(p => p.dockPanel === panel), 1);
|
|
471
|
+
// return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
472
|
+
// } else {
|
|
473
|
+
// // ATM. all panes are ContentPanes anyway.
|
|
474
|
+
// // So unless you'd want to have splitters inside the tabs,
|
|
475
|
+
// // This code will not be hit.
|
|
476
|
+
// // const result = host.panes
|
|
477
|
+
// // .map(parentPane => this.removeFromPane(parentPane, panel))
|
|
478
|
+
// // .filter(r => r.paneRemoved);
|
|
479
|
+
// //
|
|
480
|
+
// // if (result.length > 0) {
|
|
481
|
+
// // return { paneRemoved: true, hostIsEmpty: }
|
|
482
|
+
// // }
|
|
483
|
+
// return { paneRemoved: false, hostIsEmpty: host.panes.length === 0 };
|
|
484
|
+
// }
|
|
485
|
+
// } else if (host instanceof BsSplitPane) {
|
|
486
|
+
// const matching = host.panes
|
|
487
|
+
// .filter(p => p instanceof BsContentPane)
|
|
488
|
+
// .map(p => <BsContentPane>p)
|
|
489
|
+
// .filter(p => p.dockPanel === panel);
|
|
490
|
+
// if (matching.length > 0) {
|
|
491
|
+
// host.panes.splice(host.panes.findIndex(p => (p instanceof BsContentPane) && matching.includes(p)), 1);
|
|
492
|
+
// // TODO: Remove splitter if only 1 pane left?
|
|
493
|
+
// return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
494
|
+
// } else {
|
|
495
|
+
// for (let splitPane of host.panes) {
|
|
496
|
+
// const result = this.removeFromPane(splitPane, panel);
|
|
497
|
+
// if (result.paneRemoved && result.hostIsEmpty) {
|
|
498
|
+
// // splitPane is empty now, so we can remove it from this splitter
|
|
499
|
+
// host.panes.splice(host.panes.indexOf(splitPane), 1);
|
|
500
|
+
// return { paneRemoved: true, hostIsEmpty: host.panes.length === 0 };
|
|
501
|
+
// }
|
|
502
|
+
// }
|
|
503
|
+
// }
|
|
504
|
+
// return { paneRemoved: false, hostIsEmpty: host.panes.length === 0 };
|
|
505
|
+
// } else {
|
|
506
|
+
// throw 'unknown host type';
|
|
507
|
+
// }
|
|
508
|
+
// }
|
|
334
509
|
onMouseUp(ev) {
|
|
335
510
|
this.isMouseDown = false;
|
|
511
|
+
this.isDragging = false;
|
|
336
512
|
this.dragOperation = undefined;
|
|
337
513
|
}
|
|
338
514
|
}
|
|
339
|
-
BsDockPanelHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockPanelHeaderComponent, deps: [{ token: BsDockPanelComponent }, { token: BsDockComponent }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
515
|
+
BsDockPanelHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockPanelHeaderComponent, deps: [{ token: BsDockPanelComponent }, { token: BsDockComponent }, { token: BsDockService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
340
516
|
BsDockPanelHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: BsDockPanelHeaderComponent, selector: "bs-dock-panel-header", host: { listeners: { "mousedown": "onMouseDown($event)", "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp($event)" }, properties: { "class.d-block": "this.dBlock" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);margin:calc(-1 * var(--bs-nav-link-padding-y)) calc(-1 * var(--bs-nav-link-padding-x))}\n"] });
|
|
341
517
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: BsDockPanelHeaderComponent, decorators: [{
|
|
342
518
|
type: Component,
|
|
343
519
|
args: [{ selector: 'bs-dock-panel-header', template: "<ng-content></ng-content>", styles: [":host{padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);margin:calc(-1 * var(--bs-nav-link-padding-y)) calc(-1 * var(--bs-nav-link-padding-x))}\n"] }]
|
|
344
|
-
}], ctorParameters: function () { return [{ type: BsDockPanelComponent }, { type: BsDockComponent }, { type: i0.ElementRef }]; }, propDecorators: { onMouseDown: [{
|
|
520
|
+
}], ctorParameters: function () { return [{ type: BsDockPanelComponent }, { type: BsDockComponent }, { type: BsDockService }, { type: i0.ElementRef }]; }, propDecorators: { onMouseDown: [{
|
|
345
521
|
type: HostListener,
|
|
346
522
|
args: ['mousedown', ['$event']]
|
|
347
523
|
}], onMouseMove: [{
|
|
@@ -409,5 +585,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
409
585
|
* Generated bundle index. Do not edit.
|
|
410
586
|
*/
|
|
411
587
|
|
|
412
|
-
export { BsContentPane, BsDockComponent, BsDockModule, BsDockPane, BsDockPaneRendererComponent, BsDockPanelComponent, BsDockPanelHeaderComponent, BsDocumentHost, BsFloatingPane, BsSplitPane, BsTabGroupPane, EPaneType };
|
|
588
|
+
export { BsContentPane, BsDockComponent, BsDockModule, BsDockPane, BsDockPaneRendererComponent, BsDockPanelComponent, BsDockPanelHeaderComponent, BsDockService, BsDocumentHost, BsFloatingPane, BsSplitPane, BsTabGroupPane, EPaneType };
|
|
413
589
|
//# sourceMappingURL=mintplayer-ng-bootstrap-dock.mjs.map
|