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