@aptre/flex-layout 0.1.1 → 0.1.3
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/declarations/DragDrop.d.ts +18 -4
- package/declarations/DropInfo.d.ts +7 -1
- package/declarations/I18nLabel.d.ts +1 -1
- package/declarations/Rect.d.ts +4 -1
- package/declarations/Types.d.ts +1 -1
- package/declarations/index.d.ts +22 -22
- package/declarations/model/Actions.d.ts +14 -2
- package/declarations/model/ICloseType.d.ts +1 -1
- package/declarations/model/IDraggable.d.ts +1 -2
- package/declarations/model/IDropTarget.d.ts +1 -2
- package/declarations/model/IJsonModel.d.ts +6 -7
- package/declarations/model/Model.d.ts +6 -2
- package/declarations/model/Node.d.ts +12 -2
- package/declarations/model/TabSetNode.d.ts +4 -1
- package/declarations/view/Layout.d.ts +89 -39
- package/dist/index.mjs +1471 -361
- package/package.json +6 -1
- package/style/_base.scss +20 -18
- package/style/dark.css.map +1 -1
- package/style/dark.scss +3 -3
- package/style/gray.css.map +1 -1
- package/style/gray.scss +4 -5
- package/style/light.css.map +1 -1
- package/style/light.scss +2 -2
- package/style/underline.css.map +1 -1
- package/style/underline.scss +8 -8
- package/typedoc/classes/Rect.html +1 -1
package/dist/index.mjs
CHANGED
|
@@ -48,11 +48,7 @@ var Rect = class _Rect {
|
|
|
48
48
|
return new _Rect(this.x, this.y, this.width, this.height);
|
|
49
49
|
}
|
|
50
50
|
equals(rect) {
|
|
51
|
-
|
|
52
|
-
return true;
|
|
53
|
-
} else {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
51
|
+
return this.x === rect?.x && this.y === rect?.y && this.width === rect?.width && this.height === rect?.height;
|
|
56
52
|
}
|
|
57
53
|
getBottom() {
|
|
58
54
|
return this.y + this.height;
|
|
@@ -82,7 +78,12 @@ var Rect = class _Rect {
|
|
|
82
78
|
}
|
|
83
79
|
}
|
|
84
80
|
removeInsets(insets) {
|
|
85
|
-
return new _Rect(
|
|
81
|
+
return new _Rect(
|
|
82
|
+
this.x + insets.left,
|
|
83
|
+
this.y + insets.top,
|
|
84
|
+
Math.max(0, this.width - insets.left - insets.right),
|
|
85
|
+
Math.max(0, this.height - insets.top - insets.bottom)
|
|
86
|
+
);
|
|
86
87
|
}
|
|
87
88
|
centerInRect(outerRect) {
|
|
88
89
|
this.x = (outerRect.width - this.width) / 2;
|
|
@@ -158,12 +159,22 @@ var DockLocation = class _DockLocation {
|
|
|
158
159
|
if (this === _DockLocation.TOP) {
|
|
159
160
|
return new Rect(r.x, r.y, r.width, r.height / 2);
|
|
160
161
|
} else if (this === _DockLocation.BOTTOM) {
|
|
161
|
-
return new Rect(
|
|
162
|
+
return new Rect(
|
|
163
|
+
r.x,
|
|
164
|
+
r.getBottom() - r.height / 2,
|
|
165
|
+
r.width,
|
|
166
|
+
r.height / 2
|
|
167
|
+
);
|
|
162
168
|
}
|
|
163
169
|
if (this === _DockLocation.LEFT) {
|
|
164
170
|
return new Rect(r.x, r.y, r.width / 2, r.height);
|
|
165
171
|
} else if (this === _DockLocation.RIGHT) {
|
|
166
|
-
return new Rect(
|
|
172
|
+
return new Rect(
|
|
173
|
+
r.getRight() - r.width / 2,
|
|
174
|
+
r.y,
|
|
175
|
+
r.width / 2,
|
|
176
|
+
r.height
|
|
177
|
+
);
|
|
167
178
|
} else {
|
|
168
179
|
return r.clone();
|
|
169
180
|
}
|
|
@@ -172,19 +183,39 @@ var DockLocation = class _DockLocation {
|
|
|
172
183
|
split(rect, size) {
|
|
173
184
|
if (this === _DockLocation.TOP) {
|
|
174
185
|
const r1 = new Rect(rect.x, rect.y, rect.width, size);
|
|
175
|
-
const r2 = new Rect(
|
|
186
|
+
const r2 = new Rect(
|
|
187
|
+
rect.x,
|
|
188
|
+
rect.y + size,
|
|
189
|
+
rect.width,
|
|
190
|
+
rect.height - size
|
|
191
|
+
);
|
|
176
192
|
return { start: r1, end: r2 };
|
|
177
193
|
} else if (this === _DockLocation.LEFT) {
|
|
178
194
|
const r1 = new Rect(rect.x, rect.y, size, rect.height);
|
|
179
|
-
const r2 = new Rect(
|
|
195
|
+
const r2 = new Rect(
|
|
196
|
+
rect.x + size,
|
|
197
|
+
rect.y,
|
|
198
|
+
rect.width - size,
|
|
199
|
+
rect.height
|
|
200
|
+
);
|
|
180
201
|
return { start: r1, end: r2 };
|
|
181
202
|
}
|
|
182
203
|
if (this === _DockLocation.RIGHT) {
|
|
183
|
-
const r1 = new Rect(
|
|
204
|
+
const r1 = new Rect(
|
|
205
|
+
rect.getRight() - size,
|
|
206
|
+
rect.y,
|
|
207
|
+
size,
|
|
208
|
+
rect.height
|
|
209
|
+
);
|
|
184
210
|
const r2 = new Rect(rect.x, rect.y, rect.width - size, rect.height);
|
|
185
211
|
return { start: r1, end: r2 };
|
|
186
212
|
} else {
|
|
187
|
-
const r1 = new Rect(
|
|
213
|
+
const r1 = new Rect(
|
|
214
|
+
rect.x,
|
|
215
|
+
rect.getBottom() - size,
|
|
216
|
+
rect.width,
|
|
217
|
+
size
|
|
218
|
+
);
|
|
188
219
|
const r2 = new Rect(rect.x, rect.y, rect.width, rect.height - size);
|
|
189
220
|
return { start: r1, end: r2 };
|
|
190
221
|
}
|
|
@@ -257,14 +288,23 @@ var DragDrop = class _DragDrop {
|
|
|
257
288
|
this._rootElement = this._document.body;
|
|
258
289
|
}
|
|
259
290
|
this.resizeGlass();
|
|
260
|
-
this._document.defaultView?.addEventListener(
|
|
291
|
+
this._document.defaultView?.addEventListener(
|
|
292
|
+
"resize",
|
|
293
|
+
this.resizeGlass
|
|
294
|
+
);
|
|
261
295
|
this._document.body.appendChild(this._glass);
|
|
262
296
|
this._glass.tabIndex = -1;
|
|
263
297
|
this._glass.focus();
|
|
264
298
|
this._glass.addEventListener("keydown", this._onKeyPress);
|
|
265
|
-
this._glass.addEventListener("dragenter", this._onDragEnter, {
|
|
266
|
-
|
|
267
|
-
|
|
299
|
+
this._glass.addEventListener("dragenter", this._onDragEnter, {
|
|
300
|
+
passive: false
|
|
301
|
+
});
|
|
302
|
+
this._glass.addEventListener("dragover", this._onMouseMove, {
|
|
303
|
+
passive: false
|
|
304
|
+
});
|
|
305
|
+
this._glass.addEventListener("dragleave", this._onDragLeave, {
|
|
306
|
+
passive: false
|
|
307
|
+
});
|
|
268
308
|
this._glassShowing = true;
|
|
269
309
|
this._fDragCancel = fCancel;
|
|
270
310
|
this._manualGlassManagement = false;
|
|
@@ -279,7 +319,10 @@ var DragDrop = class _DragDrop {
|
|
|
279
319
|
hideGlass() {
|
|
280
320
|
if (this._glassShowing) {
|
|
281
321
|
this._document.body.removeChild(this._glass);
|
|
282
|
-
this._document.defaultView?.removeEventListener(
|
|
322
|
+
this._document.defaultView?.removeEventListener(
|
|
323
|
+
"resize",
|
|
324
|
+
this.resizeGlass
|
|
325
|
+
);
|
|
283
326
|
this._glassShowing = false;
|
|
284
327
|
this._document = void 0;
|
|
285
328
|
this._rootElement = void 0;
|
|
@@ -323,7 +366,9 @@ var DragDrop = class _DragDrop {
|
|
|
323
366
|
this._startX = posEvent.clientX;
|
|
324
367
|
this._startY = posEvent.clientY;
|
|
325
368
|
if (!window.matchMedia || window.matchMedia("(pointer: fine)").matches) {
|
|
326
|
-
this._setDefaultGlassCursor(
|
|
369
|
+
this._setDefaultGlassCursor(
|
|
370
|
+
getComputedStyle(event.target).cursor
|
|
371
|
+
);
|
|
327
372
|
}
|
|
328
373
|
this._stopPropagation(event);
|
|
329
374
|
this._preventDefault(event);
|
|
@@ -342,16 +387,34 @@ var DragDrop = class _DragDrop {
|
|
|
342
387
|
this._active = true;
|
|
343
388
|
if (event?.type === "dragenter") {
|
|
344
389
|
this._dragDepth = 1;
|
|
345
|
-
this._rootElement.addEventListener("dragenter", this._onDragEnter, {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this.
|
|
349
|
-
|
|
390
|
+
this._rootElement.addEventListener("dragenter", this._onDragEnter, {
|
|
391
|
+
passive: false
|
|
392
|
+
});
|
|
393
|
+
this._rootElement.addEventListener("dragover", this._onMouseMove, {
|
|
394
|
+
passive: false
|
|
395
|
+
});
|
|
396
|
+
this._rootElement.addEventListener("dragleave", this._onDragLeave, {
|
|
397
|
+
passive: false
|
|
398
|
+
});
|
|
399
|
+
this._document.addEventListener("dragend", this._onDragCancel, {
|
|
400
|
+
passive: false
|
|
401
|
+
});
|
|
402
|
+
this._document.addEventListener("drop", this._onMouseUp, {
|
|
403
|
+
passive: false
|
|
404
|
+
});
|
|
350
405
|
} else {
|
|
351
|
-
this._document.addEventListener("mouseup", this._onMouseUp, {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
this._document.addEventListener("
|
|
406
|
+
this._document.addEventListener("mouseup", this._onMouseUp, {
|
|
407
|
+
passive: false
|
|
408
|
+
});
|
|
409
|
+
this._document.addEventListener("mousemove", this._onMouseMove, {
|
|
410
|
+
passive: false
|
|
411
|
+
});
|
|
412
|
+
this._document.addEventListener("touchend", this._onMouseUp, {
|
|
413
|
+
passive: false
|
|
414
|
+
});
|
|
415
|
+
this._document.addEventListener("touchmove", this._onMouseMove, {
|
|
416
|
+
passive: false
|
|
417
|
+
});
|
|
355
418
|
}
|
|
356
419
|
}
|
|
357
420
|
isDragging() {
|
|
@@ -427,7 +490,10 @@ var DragDrop = class _DragDrop {
|
|
|
427
490
|
this._dragging = true;
|
|
428
491
|
if (this._fDragStart) {
|
|
429
492
|
this._setDefaultGlassCursor("move");
|
|
430
|
-
this._dragging = this._fDragStart({
|
|
493
|
+
this._dragging = this._fDragStart({
|
|
494
|
+
clientX: this._startX,
|
|
495
|
+
clientY: this._startY
|
|
496
|
+
});
|
|
431
497
|
}
|
|
432
498
|
}
|
|
433
499
|
if (this._dragging) {
|
|
@@ -632,7 +698,9 @@ var Actions = class _Actions {
|
|
|
632
698
|
* @returns {Action} the action
|
|
633
699
|
*/
|
|
634
700
|
static setActiveTabset(tabsetNodeId) {
|
|
635
|
-
return new Action(_Actions.SET_ACTIVE_TABSET, {
|
|
701
|
+
return new Action(_Actions.SET_ACTIVE_TABSET, {
|
|
702
|
+
tabsetNode: tabsetNodeId
|
|
703
|
+
});
|
|
636
704
|
}
|
|
637
705
|
/**
|
|
638
706
|
* Adjust the splitter between two tabsets
|
|
@@ -671,7 +739,9 @@ var Actions = class _Actions {
|
|
|
671
739
|
* @returns {Action} the action
|
|
672
740
|
*/
|
|
673
741
|
static updateModelAttributes(attributes) {
|
|
674
|
-
return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, {
|
|
742
|
+
return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, {
|
|
743
|
+
json: attributes
|
|
744
|
+
});
|
|
675
745
|
}
|
|
676
746
|
/**
|
|
677
747
|
* Updates the given nodes json attributes
|
|
@@ -680,7 +750,10 @@ var Actions = class _Actions {
|
|
|
680
750
|
* @returns {Action} the action
|
|
681
751
|
*/
|
|
682
752
|
static updateNodeAttributes(nodeId, attributes) {
|
|
683
|
-
return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, {
|
|
753
|
+
return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, {
|
|
754
|
+
node: nodeId,
|
|
755
|
+
json: attributes
|
|
756
|
+
});
|
|
684
757
|
}
|
|
685
758
|
static floatTab(nodeId) {
|
|
686
759
|
return new Action(_Actions.FLOAT_TAB, { node: nodeId });
|
|
@@ -731,7 +804,12 @@ var AttributeDefinitions = class {
|
|
|
731
804
|
this.nameToAttribute = {};
|
|
732
805
|
}
|
|
733
806
|
addWithAll(name, modelName, defaultValue, alwaysWriteJson) {
|
|
734
|
-
const attr = new Attribute(
|
|
807
|
+
const attr = new Attribute(
|
|
808
|
+
name,
|
|
809
|
+
modelName,
|
|
810
|
+
defaultValue,
|
|
811
|
+
alwaysWriteJson
|
|
812
|
+
);
|
|
735
813
|
this.attributes.push(attr);
|
|
736
814
|
this.nameToAttribute[name] = attr;
|
|
737
815
|
return attr;
|
|
@@ -789,7 +867,9 @@ var AttributeDefinitions = class {
|
|
|
789
867
|
}
|
|
790
868
|
toTypescriptInterface(name, parentAttributes) {
|
|
791
869
|
const lines = [];
|
|
792
|
-
const sorted = this.attributes.sort(
|
|
870
|
+
const sorted = this.attributes.sort(
|
|
871
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
872
|
+
);
|
|
793
873
|
lines.push("export interface I" + name + "Attributes {");
|
|
794
874
|
for (let i = 0; i < sorted.length; i++) {
|
|
795
875
|
const c = sorted[i];
|
|
@@ -1478,7 +1558,9 @@ var RowNode = class _RowNode extends Node {
|
|
|
1478
1558
|
child._setTempSize(0);
|
|
1479
1559
|
} else {
|
|
1480
1560
|
const minSize = child.getMinSize(this.getOrientation());
|
|
1481
|
-
const size = Math.floor(
|
|
1561
|
+
const size = Math.floor(
|
|
1562
|
+
availablePixels * (child.getWeight() / totalWeight)
|
|
1563
|
+
);
|
|
1482
1564
|
child._setTempSize(Math.max(minSize, size));
|
|
1483
1565
|
}
|
|
1484
1566
|
variableSize += child._getTempSize();
|
|
@@ -1492,7 +1574,9 @@ var RowNode = class _RowNode extends Node {
|
|
|
1492
1574
|
while (totalSizeGiven < pixelSize) {
|
|
1493
1575
|
for (const child of drawChildren) {
|
|
1494
1576
|
if (!(child instanceof SplitterNode)) {
|
|
1495
|
-
const prefSize = child._getPrefSize(
|
|
1577
|
+
const prefSize = child._getPrefSize(
|
|
1578
|
+
this.getOrientation()
|
|
1579
|
+
);
|
|
1496
1580
|
if (!child._isFixed() && (prefSize === void 0 || resizePreferred) && totalSizeGiven < pixelSize) {
|
|
1497
1581
|
child._setTempSize(child._getTempSize() + 1);
|
|
1498
1582
|
totalSizeGiven++;
|
|
@@ -1537,9 +1621,25 @@ var RowNode = class _RowNode extends Node {
|
|
|
1537
1621
|
let p = 0;
|
|
1538
1622
|
for (const child of drawChildren) {
|
|
1539
1623
|
if (this.getOrientation() === Orientation.HORZ) {
|
|
1540
|
-
child._layout(
|
|
1624
|
+
child._layout(
|
|
1625
|
+
new Rect(
|
|
1626
|
+
this._rect.x + p,
|
|
1627
|
+
this._rect.y,
|
|
1628
|
+
child._getTempSize(),
|
|
1629
|
+
this._rect.height
|
|
1630
|
+
),
|
|
1631
|
+
metrics
|
|
1632
|
+
);
|
|
1541
1633
|
} else {
|
|
1542
|
-
child._layout(
|
|
1634
|
+
child._layout(
|
|
1635
|
+
new Rect(
|
|
1636
|
+
this._rect.x,
|
|
1637
|
+
this._rect.y + p,
|
|
1638
|
+
this._rect.width,
|
|
1639
|
+
child._getTempSize()
|
|
1640
|
+
),
|
|
1641
|
+
metrics
|
|
1642
|
+
);
|
|
1543
1643
|
}
|
|
1544
1644
|
p += child._getTempSize();
|
|
1545
1645
|
}
|
|
@@ -1669,7 +1769,9 @@ var RowNode = class _RowNode extends Node {
|
|
|
1669
1769
|
}
|
|
1670
1770
|
for (let j = 0; j < subChildChildren.length; j++) {
|
|
1671
1771
|
const subsubChild = subChildChildren[j];
|
|
1672
|
-
subsubChild._setWeight(
|
|
1772
|
+
subsubChild._setWeight(
|
|
1773
|
+
child.getWeight() * subsubChild.getWeight() / subChildrenTotal
|
|
1774
|
+
);
|
|
1673
1775
|
this._addChild(subsubChild, i + j);
|
|
1674
1776
|
}
|
|
1675
1777
|
} else {
|
|
@@ -1715,24 +1817,48 @@ var RowNode = class _RowNode extends Node {
|
|
|
1715
1817
|
const dockLocation = DockLocation.LEFT;
|
|
1716
1818
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1717
1819
|
outlineRect.width = outlineRect.width / 2;
|
|
1718
|
-
dropInfo = new DropInfo(
|
|
1820
|
+
dropInfo = new DropInfo(
|
|
1821
|
+
this,
|
|
1822
|
+
outlineRect,
|
|
1823
|
+
dockLocation,
|
|
1824
|
+
-1,
|
|
1825
|
+
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1826
|
+
);
|
|
1719
1827
|
} else if (x > this._rect.getRight() - margin && yy > h / 2 - half && yy < h / 2 + half) {
|
|
1720
1828
|
const dockLocation = DockLocation.RIGHT;
|
|
1721
1829
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1722
1830
|
outlineRect.width = outlineRect.width / 2;
|
|
1723
1831
|
outlineRect.x += outlineRect.width;
|
|
1724
|
-
dropInfo = new DropInfo(
|
|
1832
|
+
dropInfo = new DropInfo(
|
|
1833
|
+
this,
|
|
1834
|
+
outlineRect,
|
|
1835
|
+
dockLocation,
|
|
1836
|
+
-1,
|
|
1837
|
+
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1838
|
+
);
|
|
1725
1839
|
} else if (y < this._rect.y + margin && xx > w / 2 - half && xx < w / 2 + half) {
|
|
1726
1840
|
const dockLocation = DockLocation.TOP;
|
|
1727
1841
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1728
1842
|
outlineRect.height = outlineRect.height / 2;
|
|
1729
|
-
dropInfo = new DropInfo(
|
|
1843
|
+
dropInfo = new DropInfo(
|
|
1844
|
+
this,
|
|
1845
|
+
outlineRect,
|
|
1846
|
+
dockLocation,
|
|
1847
|
+
-1,
|
|
1848
|
+
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1849
|
+
);
|
|
1730
1850
|
} else if (y > this._rect.getBottom() - margin && xx > w / 2 - half && xx < w / 2 + half) {
|
|
1731
1851
|
const dockLocation = DockLocation.BOTTOM;
|
|
1732
1852
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1733
1853
|
outlineRect.height = outlineRect.height / 2;
|
|
1734
1854
|
outlineRect.y += outlineRect.height;
|
|
1735
|
-
dropInfo = new DropInfo(
|
|
1855
|
+
dropInfo = new DropInfo(
|
|
1856
|
+
this,
|
|
1857
|
+
outlineRect,
|
|
1858
|
+
dockLocation,
|
|
1859
|
+
-1,
|
|
1860
|
+
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1861
|
+
);
|
|
1736
1862
|
}
|
|
1737
1863
|
if (dropInfo !== void 0) {
|
|
1738
1864
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -1760,7 +1886,10 @@ var RowNode = class _RowNode extends Node {
|
|
|
1760
1886
|
tabSet = dragNode;
|
|
1761
1887
|
} else {
|
|
1762
1888
|
const callback = this._model._getOnCreateTabSet();
|
|
1763
|
-
tabSet = new TabSetNode(
|
|
1889
|
+
tabSet = new TabSetNode(
|
|
1890
|
+
this._model,
|
|
1891
|
+
callback ? callback(dragNode) : {}
|
|
1892
|
+
);
|
|
1764
1893
|
tabSet._addChild(dragNode);
|
|
1765
1894
|
}
|
|
1766
1895
|
let size = this._children.reduce((sum, child) => {
|
|
@@ -1885,21 +2014,39 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
1885
2014
|
attributeDefinitions.add("selected", 0).setType(Attribute.NUMBER);
|
|
1886
2015
|
attributeDefinitions.add("name", void 0).setType(Attribute.STRING);
|
|
1887
2016
|
attributeDefinitions.add("config", void 0).setType("any");
|
|
1888
|
-
attributeDefinitions.addInherited(
|
|
2017
|
+
attributeDefinitions.addInherited(
|
|
2018
|
+
"enableDeleteWhenEmpty",
|
|
2019
|
+
"tabSetEnableDeleteWhenEmpty"
|
|
2020
|
+
);
|
|
1889
2021
|
attributeDefinitions.addInherited("enableDrop", "tabSetEnableDrop");
|
|
1890
2022
|
attributeDefinitions.addInherited("enableDrag", "tabSetEnableDrag");
|
|
1891
2023
|
attributeDefinitions.addInherited("enableDivide", "tabSetEnableDivide");
|
|
1892
|
-
attributeDefinitions.addInherited(
|
|
2024
|
+
attributeDefinitions.addInherited(
|
|
2025
|
+
"enableMaximize",
|
|
2026
|
+
"tabSetEnableMaximize"
|
|
2027
|
+
);
|
|
1893
2028
|
attributeDefinitions.addInherited("enableClose", "tabSetEnableClose");
|
|
1894
|
-
attributeDefinitions.addInherited(
|
|
1895
|
-
|
|
1896
|
-
|
|
2029
|
+
attributeDefinitions.addInherited(
|
|
2030
|
+
"classNameTabStrip",
|
|
2031
|
+
"tabSetClassNameTabStrip"
|
|
2032
|
+
);
|
|
2033
|
+
attributeDefinitions.addInherited(
|
|
2034
|
+
"classNameHeader",
|
|
2035
|
+
"tabSetClassNameHeader"
|
|
2036
|
+
);
|
|
2037
|
+
attributeDefinitions.addInherited(
|
|
2038
|
+
"enableTabStrip",
|
|
2039
|
+
"tabSetEnableTabStrip"
|
|
2040
|
+
);
|
|
1897
2041
|
attributeDefinitions.addInherited("borderInsets", "tabSetBorderInsets");
|
|
1898
2042
|
attributeDefinitions.addInherited("marginInsets", "tabSetMarginInsets");
|
|
1899
2043
|
attributeDefinitions.addInherited("minWidth", "tabSetMinWidth");
|
|
1900
2044
|
attributeDefinitions.addInherited("minHeight", "tabSetMinHeight");
|
|
1901
2045
|
attributeDefinitions.addInherited("headerHeight", "tabSetHeaderHeight");
|
|
1902
|
-
attributeDefinitions.addInherited(
|
|
2046
|
+
attributeDefinitions.addInherited(
|
|
2047
|
+
"tabStripHeight",
|
|
2048
|
+
"tabSetTabStripHeight"
|
|
2049
|
+
);
|
|
1903
2050
|
attributeDefinitions.addInherited("tabLocation", "tabSetTabLocation");
|
|
1904
2051
|
attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute.BOOLEAN);
|
|
1905
2052
|
return attributeDefinitions;
|
|
@@ -2043,14 +2190,30 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2043
2190
|
if (dragNode === this) {
|
|
2044
2191
|
const dockLocation = DockLocation.CENTER;
|
|
2045
2192
|
const outlineRect = this._tabHeaderRect;
|
|
2046
|
-
dropInfo = new DropInfo(
|
|
2193
|
+
dropInfo = new DropInfo(
|
|
2194
|
+
this,
|
|
2195
|
+
outlineRect,
|
|
2196
|
+
dockLocation,
|
|
2197
|
+
-1,
|
|
2198
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2199
|
+
);
|
|
2047
2200
|
} else if (this._contentRect.contains(x, y)) {
|
|
2048
2201
|
let dockLocation = DockLocation.CENTER;
|
|
2049
2202
|
if (this._model.getMaximizedTabset() === void 0) {
|
|
2050
|
-
dockLocation = DockLocation.getLocation(
|
|
2203
|
+
dockLocation = DockLocation.getLocation(
|
|
2204
|
+
this._contentRect,
|
|
2205
|
+
x,
|
|
2206
|
+
y
|
|
2207
|
+
);
|
|
2051
2208
|
}
|
|
2052
2209
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
2053
|
-
dropInfo = new DropInfo(
|
|
2210
|
+
dropInfo = new DropInfo(
|
|
2211
|
+
this,
|
|
2212
|
+
outlineRect,
|
|
2213
|
+
dockLocation,
|
|
2214
|
+
-1,
|
|
2215
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2216
|
+
);
|
|
2054
2217
|
} else if (this._tabHeaderRect != null && this._tabHeaderRect.contains(x, y)) {
|
|
2055
2218
|
let r;
|
|
2056
2219
|
let yy;
|
|
@@ -2074,7 +2237,13 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2074
2237
|
if (x >= p && x < childCenter) {
|
|
2075
2238
|
const dockLocation = DockLocation.CENTER;
|
|
2076
2239
|
const outlineRect = new Rect(r.x - 2, yy, 3, h);
|
|
2077
|
-
dropInfo = new DropInfo(
|
|
2240
|
+
dropInfo = new DropInfo(
|
|
2241
|
+
this,
|
|
2242
|
+
outlineRect,
|
|
2243
|
+
dockLocation,
|
|
2244
|
+
i,
|
|
2245
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2246
|
+
);
|
|
2078
2247
|
break;
|
|
2079
2248
|
}
|
|
2080
2249
|
p = childCenter;
|
|
@@ -2083,7 +2252,13 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2083
2252
|
if (dropInfo == null) {
|
|
2084
2253
|
const dockLocation = DockLocation.CENTER;
|
|
2085
2254
|
const outlineRect = new Rect(r.getRight() - 2, yy, 3, h);
|
|
2086
|
-
dropInfo = new DropInfo(
|
|
2255
|
+
dropInfo = new DropInfo(
|
|
2256
|
+
this,
|
|
2257
|
+
outlineRect,
|
|
2258
|
+
dockLocation,
|
|
2259
|
+
this._children.length,
|
|
2260
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2261
|
+
);
|
|
2087
2262
|
}
|
|
2088
2263
|
}
|
|
2089
2264
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -2110,16 +2285,31 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2110
2285
|
}
|
|
2111
2286
|
if (this.isEnableTabStrip()) {
|
|
2112
2287
|
if (this.getTabLocation() === "top") {
|
|
2113
|
-
this._tabHeaderRect = new Rect(
|
|
2288
|
+
this._tabHeaderRect = new Rect(
|
|
2289
|
+
rect.x,
|
|
2290
|
+
rect.y + y,
|
|
2291
|
+
rect.width,
|
|
2292
|
+
this._calculatedTabBarHeight
|
|
2293
|
+
);
|
|
2114
2294
|
} else {
|
|
2115
|
-
this._tabHeaderRect = new Rect(
|
|
2295
|
+
this._tabHeaderRect = new Rect(
|
|
2296
|
+
rect.x,
|
|
2297
|
+
rect.y + rect.height - this._calculatedTabBarHeight,
|
|
2298
|
+
rect.width,
|
|
2299
|
+
this._calculatedTabBarHeight
|
|
2300
|
+
);
|
|
2116
2301
|
}
|
|
2117
2302
|
h += this._calculatedTabBarHeight;
|
|
2118
2303
|
if (this.getTabLocation() === "top") {
|
|
2119
2304
|
y += this._calculatedTabBarHeight;
|
|
2120
2305
|
}
|
|
2121
2306
|
}
|
|
2122
|
-
this._contentRect = new Rect(
|
|
2307
|
+
this._contentRect = new Rect(
|
|
2308
|
+
rect.x,
|
|
2309
|
+
rect.y + y,
|
|
2310
|
+
rect.width,
|
|
2311
|
+
rect.height - h
|
|
2312
|
+
);
|
|
2123
2313
|
for (let i = 0; i < this._children.length; i++) {
|
|
2124
2314
|
const child = this._children[i];
|
|
2125
2315
|
child._layout(this._contentRect, metrics);
|
|
@@ -2180,7 +2370,10 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2180
2370
|
let tabSet;
|
|
2181
2371
|
if (dragNode instanceof TabNode) {
|
|
2182
2372
|
const callback = this._model._getOnCreateTabSet();
|
|
2183
|
-
tabSet = new _TabSetNode(
|
|
2373
|
+
tabSet = new _TabSetNode(
|
|
2374
|
+
this._model,
|
|
2375
|
+
callback ? callback(dragNode) : {}
|
|
2376
|
+
);
|
|
2184
2377
|
tabSet._addChild(dragNode);
|
|
2185
2378
|
dragParent = tabSet;
|
|
2186
2379
|
} else {
|
|
@@ -2349,8 +2542,14 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2349
2542
|
attributeDefinitions.addInherited("barSize", "borderBarSize").setType(Attribute.NUMBER);
|
|
2350
2543
|
attributeDefinitions.addInherited("enableDrop", "borderEnableDrop").setType(Attribute.BOOLEAN);
|
|
2351
2544
|
attributeDefinitions.addInherited("className", "borderClassName").setType(Attribute.STRING);
|
|
2352
|
-
attributeDefinitions.addInherited(
|
|
2353
|
-
|
|
2545
|
+
attributeDefinitions.addInherited(
|
|
2546
|
+
"autoSelectTabWhenOpen",
|
|
2547
|
+
"borderAutoSelectTabWhenOpen"
|
|
2548
|
+
).setType(Attribute.BOOLEAN);
|
|
2549
|
+
attributeDefinitions.addInherited(
|
|
2550
|
+
"autoSelectTabWhenClosed",
|
|
2551
|
+
"borderAutoSelectTabWhenClosed"
|
|
2552
|
+
).setType(Attribute.BOOLEAN);
|
|
2354
2553
|
attributeDefinitions.addInherited("size", "borderSize").setType(Attribute.NUMBER);
|
|
2355
2554
|
attributeDefinitions.addInherited("minSize", "borderMinSize").setType(Attribute.NUMBER);
|
|
2356
2555
|
attributeDefinitions.addInherited("enableAutoHide", "borderEnableAutoHide").setType(Attribute.BOOLEAN);
|
|
@@ -2503,7 +2702,10 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2503
2702
|
_layoutBorderInner(inner, metrics) {
|
|
2504
2703
|
this._drawChildren = [];
|
|
2505
2704
|
const location = this._location;
|
|
2506
|
-
const split1 = location.split(
|
|
2705
|
+
const split1 = location.split(
|
|
2706
|
+
inner,
|
|
2707
|
+
this._adjustedSize + this._model.getSplitterSize()
|
|
2708
|
+
);
|
|
2507
2709
|
const split2 = location.reflect().split(split1.start, this._model.getSplitterSize());
|
|
2508
2710
|
this._contentRect = split2.end;
|
|
2509
2711
|
for (let i = 0; i < this._children.length; i++) {
|
|
@@ -2550,19 +2752,52 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2550
2752
|
childRect = child.getTabRect();
|
|
2551
2753
|
childCenter = childRect.x + childRect.width / 2;
|
|
2552
2754
|
if (x >= pos && x < childCenter) {
|
|
2553
|
-
const outlineRect = new Rect(
|
|
2554
|
-
|
|
2755
|
+
const outlineRect = new Rect(
|
|
2756
|
+
childRect.x - 2,
|
|
2757
|
+
childY,
|
|
2758
|
+
3,
|
|
2759
|
+
childHeight
|
|
2760
|
+
);
|
|
2761
|
+
dropInfo = new DropInfo(
|
|
2762
|
+
this,
|
|
2763
|
+
outlineRect,
|
|
2764
|
+
dockLocation,
|
|
2765
|
+
i,
|
|
2766
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2767
|
+
);
|
|
2555
2768
|
break;
|
|
2556
2769
|
}
|
|
2557
2770
|
pos = childCenter;
|
|
2558
2771
|
}
|
|
2559
2772
|
if (dropInfo == null) {
|
|
2560
|
-
const outlineRect = new Rect(
|
|
2561
|
-
|
|
2773
|
+
const outlineRect = new Rect(
|
|
2774
|
+
childRect.getRight() - 2,
|
|
2775
|
+
childY,
|
|
2776
|
+
3,
|
|
2777
|
+
childHeight
|
|
2778
|
+
);
|
|
2779
|
+
dropInfo = new DropInfo(
|
|
2780
|
+
this,
|
|
2781
|
+
outlineRect,
|
|
2782
|
+
dockLocation,
|
|
2783
|
+
this._children.length,
|
|
2784
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2785
|
+
);
|
|
2562
2786
|
}
|
|
2563
2787
|
} else {
|
|
2564
|
-
const outlineRect = new Rect(
|
|
2565
|
-
|
|
2788
|
+
const outlineRect = new Rect(
|
|
2789
|
+
this._tabHeaderRect.x + 1,
|
|
2790
|
+
this._tabHeaderRect.y + 2,
|
|
2791
|
+
3,
|
|
2792
|
+
18
|
|
2793
|
+
);
|
|
2794
|
+
dropInfo = new DropInfo(
|
|
2795
|
+
this,
|
|
2796
|
+
outlineRect,
|
|
2797
|
+
dockLocation,
|
|
2798
|
+
0,
|
|
2799
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2800
|
+
);
|
|
2566
2801
|
}
|
|
2567
2802
|
} else {
|
|
2568
2803
|
if (this._children.length > 0) {
|
|
@@ -2577,19 +2812,52 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2577
2812
|
childRect = child.getTabRect();
|
|
2578
2813
|
childCenter = childRect.y + childRect.height / 2;
|
|
2579
2814
|
if (y >= pos && y < childCenter) {
|
|
2580
|
-
const outlineRect = new Rect(
|
|
2581
|
-
|
|
2815
|
+
const outlineRect = new Rect(
|
|
2816
|
+
childX,
|
|
2817
|
+
childRect.y - 2,
|
|
2818
|
+
childWidth,
|
|
2819
|
+
3
|
|
2820
|
+
);
|
|
2821
|
+
dropInfo = new DropInfo(
|
|
2822
|
+
this,
|
|
2823
|
+
outlineRect,
|
|
2824
|
+
dockLocation,
|
|
2825
|
+
i,
|
|
2826
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2827
|
+
);
|
|
2582
2828
|
break;
|
|
2583
2829
|
}
|
|
2584
2830
|
pos = childCenter;
|
|
2585
2831
|
}
|
|
2586
2832
|
if (dropInfo == null) {
|
|
2587
|
-
const outlineRect = new Rect(
|
|
2588
|
-
|
|
2833
|
+
const outlineRect = new Rect(
|
|
2834
|
+
childX,
|
|
2835
|
+
childRect.getBottom() - 2,
|
|
2836
|
+
childWidth,
|
|
2837
|
+
3
|
|
2838
|
+
);
|
|
2839
|
+
dropInfo = new DropInfo(
|
|
2840
|
+
this,
|
|
2841
|
+
outlineRect,
|
|
2842
|
+
dockLocation,
|
|
2843
|
+
this._children.length,
|
|
2844
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2845
|
+
);
|
|
2589
2846
|
}
|
|
2590
2847
|
} else {
|
|
2591
|
-
const outlineRect = new Rect(
|
|
2592
|
-
|
|
2848
|
+
const outlineRect = new Rect(
|
|
2849
|
+
this._tabHeaderRect.x + 2,
|
|
2850
|
+
this._tabHeaderRect.y + 1,
|
|
2851
|
+
18,
|
|
2852
|
+
3
|
|
2853
|
+
);
|
|
2854
|
+
dropInfo = new DropInfo(
|
|
2855
|
+
this,
|
|
2856
|
+
outlineRect,
|
|
2857
|
+
dockLocation,
|
|
2858
|
+
0,
|
|
2859
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2860
|
+
);
|
|
2593
2861
|
}
|
|
2594
2862
|
}
|
|
2595
2863
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -2597,7 +2865,13 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2597
2865
|
}
|
|
2598
2866
|
} else if (this.getSelected() !== -1 && this._contentRect.contains(x, y)) {
|
|
2599
2867
|
const outlineRect = this._contentRect;
|
|
2600
|
-
dropInfo = new DropInfo(
|
|
2868
|
+
dropInfo = new DropInfo(
|
|
2869
|
+
this,
|
|
2870
|
+
outlineRect,
|
|
2871
|
+
dockLocation,
|
|
2872
|
+
-1,
|
|
2873
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2874
|
+
);
|
|
2601
2875
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
2602
2876
|
return void 0;
|
|
2603
2877
|
}
|
|
@@ -2635,7 +2909,9 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2635
2909
|
const json = {};
|
|
2636
2910
|
_BorderNode._attributeDefinitions.toJson(json, this._attributes);
|
|
2637
2911
|
json.location = this._location.getName();
|
|
2638
|
-
json.children = this._children.map(
|
|
2912
|
+
json.children = this._children.map(
|
|
2913
|
+
(child) => child.toJson()
|
|
2914
|
+
);
|
|
2639
2915
|
return json;
|
|
2640
2916
|
}
|
|
2641
2917
|
/** @internal */
|
|
@@ -2647,16 +2923,28 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2647
2923
|
const rootRow = this._model.getRoot();
|
|
2648
2924
|
if (this._location === DockLocation.TOP) {
|
|
2649
2925
|
pBounds[0] = outerRect.y + minSize;
|
|
2650
|
-
pBounds[1] = Math.max(
|
|
2926
|
+
pBounds[1] = Math.max(
|
|
2927
|
+
pBounds[0],
|
|
2928
|
+
innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight()
|
|
2929
|
+
);
|
|
2651
2930
|
} else if (this._location === DockLocation.LEFT) {
|
|
2652
2931
|
pBounds[0] = outerRect.x + minSize;
|
|
2653
|
-
pBounds[1] = Math.max(
|
|
2932
|
+
pBounds[1] = Math.max(
|
|
2933
|
+
pBounds[0],
|
|
2934
|
+
innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth()
|
|
2935
|
+
);
|
|
2654
2936
|
} else if (this._location === DockLocation.BOTTOM) {
|
|
2655
2937
|
pBounds[1] = outerRect.getBottom() - splitter.getHeight() - minSize;
|
|
2656
|
-
pBounds[0] = Math.min(
|
|
2938
|
+
pBounds[0] = Math.min(
|
|
2939
|
+
pBounds[1],
|
|
2940
|
+
innerRect.y + rootRow.getMinHeight()
|
|
2941
|
+
);
|
|
2657
2942
|
} else if (this._location === DockLocation.RIGHT) {
|
|
2658
2943
|
pBounds[1] = outerRect.getRight() - splitter.getWidth() - minSize;
|
|
2659
|
-
pBounds[0] = Math.min(
|
|
2944
|
+
pBounds[0] = Math.min(
|
|
2945
|
+
pBounds[1],
|
|
2946
|
+
innerRect.x + rootRow.getMinWidth()
|
|
2947
|
+
);
|
|
2660
2948
|
}
|
|
2661
2949
|
return pBounds;
|
|
2662
2950
|
}
|
|
@@ -2738,13 +3026,36 @@ function getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle) {
|
|
|
2738
3026
|
}
|
|
2739
3027
|
if (leadingContent === void 0 && node.getIcon() !== void 0) {
|
|
2740
3028
|
if (iconAngle !== 0) {
|
|
2741
|
-
leadingContent = /* @__PURE__ */ React.createElement(
|
|
3029
|
+
leadingContent = /* @__PURE__ */ React.createElement(
|
|
3030
|
+
"img",
|
|
3031
|
+
{
|
|
3032
|
+
style: {
|
|
3033
|
+
width: "1em",
|
|
3034
|
+
height: "1em",
|
|
3035
|
+
transform: "rotate(" + iconAngle + "deg)"
|
|
3036
|
+
},
|
|
3037
|
+
src: node.getIcon(),
|
|
3038
|
+
alt: "leadingContent"
|
|
3039
|
+
}
|
|
3040
|
+
);
|
|
2742
3041
|
} else {
|
|
2743
|
-
leadingContent = /* @__PURE__ */ React.createElement(
|
|
3042
|
+
leadingContent = /* @__PURE__ */ React.createElement(
|
|
3043
|
+
"img",
|
|
3044
|
+
{
|
|
3045
|
+
style: { width: "1em", height: "1em" },
|
|
3046
|
+
src: node.getIcon(),
|
|
3047
|
+
alt: "leadingContent"
|
|
3048
|
+
}
|
|
3049
|
+
);
|
|
2744
3050
|
}
|
|
2745
3051
|
}
|
|
2746
3052
|
let buttons = [];
|
|
2747
|
-
const renderState = {
|
|
3053
|
+
const renderState = {
|
|
3054
|
+
leading: leadingContent,
|
|
3055
|
+
content: titleContent,
|
|
3056
|
+
name,
|
|
3057
|
+
buttons
|
|
3058
|
+
};
|
|
2748
3059
|
layout.customizeTab(node, renderState);
|
|
2749
3060
|
node._setRenderedName(renderState.name);
|
|
2750
3061
|
return renderState;
|
|
@@ -2768,12 +3079,28 @@ function isAuxMouseEvent(event) {
|
|
|
2768
3079
|
|
|
2769
3080
|
// src/view/BorderButton.tsx
|
|
2770
3081
|
var BorderButton = (props) => {
|
|
2771
|
-
const {
|
|
3082
|
+
const {
|
|
3083
|
+
layout,
|
|
3084
|
+
node,
|
|
3085
|
+
selected,
|
|
3086
|
+
border,
|
|
3087
|
+
iconFactory,
|
|
3088
|
+
titleFactory,
|
|
3089
|
+
icons,
|
|
3090
|
+
path
|
|
3091
|
+
} = props;
|
|
2772
3092
|
const selfRef = React2.useRef(null);
|
|
2773
3093
|
const contentRef = React2.useRef(null);
|
|
2774
3094
|
const onMouseDown = (event) => {
|
|
2775
3095
|
if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
|
|
2776
|
-
layout.dragStart(
|
|
3096
|
+
layout.dragStart(
|
|
3097
|
+
event,
|
|
3098
|
+
void 0,
|
|
3099
|
+
node,
|
|
3100
|
+
node.isEnableDrag(),
|
|
3101
|
+
onClick,
|
|
3102
|
+
onDoubleClick
|
|
3103
|
+
);
|
|
2777
3104
|
}
|
|
2778
3105
|
};
|
|
2779
3106
|
const onAuxMouseClick = (event) => {
|
|
@@ -2827,7 +3154,14 @@ var BorderButton = (props) => {
|
|
|
2827
3154
|
const updateRect = () => {
|
|
2828
3155
|
const layoutRect = layout.getDomRect();
|
|
2829
3156
|
const r = selfRef.current.getBoundingClientRect();
|
|
2830
|
-
node._setTabRect(
|
|
3157
|
+
node._setTabRect(
|
|
3158
|
+
new Rect(
|
|
3159
|
+
r.left - layoutRect.left,
|
|
3160
|
+
r.top - layoutRect.top,
|
|
3161
|
+
r.width,
|
|
3162
|
+
r.height
|
|
3163
|
+
)
|
|
3164
|
+
);
|
|
2831
3165
|
};
|
|
2832
3166
|
const onTextBoxMouseDown = (event) => {
|
|
2833
3167
|
event.stopPropagation();
|
|
@@ -2837,7 +3171,12 @@ var BorderButton = (props) => {
|
|
|
2837
3171
|
layout.setEditingTab(void 0);
|
|
2838
3172
|
} else if (event.code === "Enter") {
|
|
2839
3173
|
layout.setEditingTab(void 0);
|
|
2840
|
-
layout.doAction(
|
|
3174
|
+
layout.doAction(
|
|
3175
|
+
Actions.renameTab(
|
|
3176
|
+
node.getId(),
|
|
3177
|
+
event.target.value
|
|
3178
|
+
)
|
|
3179
|
+
);
|
|
2841
3180
|
}
|
|
2842
3181
|
};
|
|
2843
3182
|
const cm = layout.getClassName;
|
|
@@ -2858,7 +3197,13 @@ var BorderButton = (props) => {
|
|
|
2858
3197
|
iconAngle = -90;
|
|
2859
3198
|
}
|
|
2860
3199
|
}
|
|
2861
|
-
const renderState = getRenderStateEx(
|
|
3200
|
+
const renderState = getRenderStateEx(
|
|
3201
|
+
layout,
|
|
3202
|
+
node,
|
|
3203
|
+
iconFactory,
|
|
3204
|
+
titleFactory,
|
|
3205
|
+
iconAngle
|
|
3206
|
+
);
|
|
2862
3207
|
let content = renderState.content ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_content" /* FLEXLAYOUT__BORDER_BUTTON_CONTENT */) }, renderState.content) : null;
|
|
2863
3208
|
const leading = renderState.leading ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_leading" /* FLEXLAYOUT__BORDER_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
2864
3209
|
if (layout.getEditingTab() === node) {
|
|
@@ -2924,19 +3269,15 @@ var TabButtonStamp = (props) => {
|
|
|
2924
3269
|
const selfRef = React3.useRef(null);
|
|
2925
3270
|
const cm = layout.getClassName;
|
|
2926
3271
|
let classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
|
|
2927
|
-
const renderState = getRenderStateEx(
|
|
3272
|
+
const renderState = getRenderStateEx(
|
|
3273
|
+
layout,
|
|
3274
|
+
node,
|
|
3275
|
+
iconFactory,
|
|
3276
|
+
titleFactory
|
|
3277
|
+
);
|
|
2928
3278
|
let content = renderState.content ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node._getNameForOverflowMenu();
|
|
2929
3279
|
const leading = renderState.leading ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
2930
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2931
|
-
"div",
|
|
2932
|
-
{
|
|
2933
|
-
ref: selfRef,
|
|
2934
|
-
className: classNames,
|
|
2935
|
-
title: node.getHelpText()
|
|
2936
|
-
},
|
|
2937
|
-
leading,
|
|
2938
|
-
content
|
|
2939
|
-
);
|
|
3280
|
+
return /* @__PURE__ */ React3.createElement("div", { ref: selfRef, className: classNames, title: node.getHelpText() }, leading, content);
|
|
2940
3281
|
};
|
|
2941
3282
|
|
|
2942
3283
|
// src/PopupMenu.tsx
|
|
@@ -2945,7 +3286,7 @@ function showPopup(triggerElement, items, onSelect, layout, iconFactory, titleFa
|
|
|
2945
3286
|
const classNameMapper = layout.getClassName;
|
|
2946
3287
|
const currentDocument = triggerElement.ownerDocument;
|
|
2947
3288
|
const triggerRect = triggerElement.getBoundingClientRect();
|
|
2948
|
-
const layoutRect = layoutDiv
|
|
3289
|
+
const layoutRect = layoutDiv?.getBoundingClientRect() ?? new DOMRect(0, 0, 100, 100);
|
|
2949
3290
|
const elm = currentDocument.createElement("div");
|
|
2950
3291
|
elm.className = classNameMapper("flexlayout__popup_menu_container" /* FLEXLAYOUT__POPUP_MENU_CONTAINER */);
|
|
2951
3292
|
if (triggerRect.left < layoutRect.left + layoutRect.width / 2) {
|
|
@@ -2960,38 +3301,53 @@ function showPopup(triggerElement, items, onSelect, layout, iconFactory, titleFa
|
|
|
2960
3301
|
}
|
|
2961
3302
|
DragDrop.instance.addGlass(() => onHide());
|
|
2962
3303
|
DragDrop.instance.setGlassCursorOverride("default");
|
|
2963
|
-
layoutDiv
|
|
3304
|
+
if (layoutDiv) {
|
|
3305
|
+
layoutDiv.appendChild(elm);
|
|
3306
|
+
}
|
|
2964
3307
|
const onHide = () => {
|
|
2965
3308
|
layout.hidePortal();
|
|
2966
3309
|
DragDrop.instance.hideGlass();
|
|
2967
|
-
layoutDiv
|
|
3310
|
+
if (layoutDiv) {
|
|
3311
|
+
layoutDiv.removeChild(elm);
|
|
3312
|
+
}
|
|
2968
3313
|
elm.removeEventListener("mousedown", onElementMouseDown);
|
|
2969
3314
|
currentDocument.removeEventListener("mousedown", onDocMouseDown);
|
|
2970
3315
|
};
|
|
2971
3316
|
const onElementMouseDown = (event) => {
|
|
2972
3317
|
event.stopPropagation();
|
|
2973
3318
|
};
|
|
2974
|
-
const onDocMouseDown = (
|
|
3319
|
+
const onDocMouseDown = (_event) => {
|
|
2975
3320
|
onHide();
|
|
2976
3321
|
};
|
|
2977
3322
|
elm.addEventListener("mousedown", onElementMouseDown);
|
|
2978
3323
|
currentDocument.addEventListener("mousedown", onDocMouseDown);
|
|
2979
|
-
layout.showPortal(
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3324
|
+
layout.showPortal(
|
|
3325
|
+
/* @__PURE__ */ React4.createElement(
|
|
3326
|
+
PopupMenu,
|
|
3327
|
+
{
|
|
3328
|
+
currentDocument,
|
|
3329
|
+
onSelect,
|
|
3330
|
+
onHide,
|
|
3331
|
+
items,
|
|
3332
|
+
classNameMapper,
|
|
3333
|
+
layout,
|
|
3334
|
+
iconFactory,
|
|
3335
|
+
titleFactory
|
|
3336
|
+
}
|
|
3337
|
+
),
|
|
3338
|
+
elm
|
|
3339
|
+
);
|
|
2992
3340
|
}
|
|
2993
3341
|
var PopupMenu = (props) => {
|
|
2994
|
-
const {
|
|
3342
|
+
const {
|
|
3343
|
+
items,
|
|
3344
|
+
onHide,
|
|
3345
|
+
onSelect,
|
|
3346
|
+
classNameMapper,
|
|
3347
|
+
layout,
|
|
3348
|
+
iconFactory,
|
|
3349
|
+
titleFactory
|
|
3350
|
+
} = props;
|
|
2995
3351
|
const onItemClick = (item, event) => {
|
|
2996
3352
|
onSelect(item);
|
|
2997
3353
|
onHide();
|
|
@@ -3114,8 +3470,14 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
|
|
|
3114
3470
|
}
|
|
3115
3471
|
}
|
|
3116
3472
|
}
|
|
3117
|
-
const extraSpace = Math.max(
|
|
3118
|
-
|
|
3473
|
+
const extraSpace = Math.max(
|
|
3474
|
+
0,
|
|
3475
|
+
endPos - (getFar(lastChild.getTabRect()) + tabMargin + shiftPos)
|
|
3476
|
+
);
|
|
3477
|
+
const newPosition = Math.min(
|
|
3478
|
+
0,
|
|
3479
|
+
position + shiftPos + extraSpace
|
|
3480
|
+
);
|
|
3119
3481
|
const diff = newPosition - position;
|
|
3120
3482
|
const hidden = [];
|
|
3121
3483
|
for (let i = 0; i < node.getChildren().length; i++) {
|
|
@@ -3149,7 +3511,14 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
|
|
|
3149
3511
|
userControlledLeft.current = true;
|
|
3150
3512
|
event.stopPropagation();
|
|
3151
3513
|
};
|
|
3152
|
-
return {
|
|
3514
|
+
return {
|
|
3515
|
+
selfRef,
|
|
3516
|
+
position,
|
|
3517
|
+
userControlledLeft,
|
|
3518
|
+
hiddenTabs,
|
|
3519
|
+
onMouseWheel,
|
|
3520
|
+
tabsTruncated: tabsTruncated.current
|
|
3521
|
+
};
|
|
3153
3522
|
};
|
|
3154
3523
|
|
|
3155
3524
|
// src/view/BorderTabSet.tsx
|
|
@@ -3158,7 +3527,19 @@ var BorderTabSet = (props) => {
|
|
|
3158
3527
|
const toolbarRef = React6.useRef(null);
|
|
3159
3528
|
const overflowbuttonRef = React6.useRef(null);
|
|
3160
3529
|
const stickyButtonsRef = React6.useRef(null);
|
|
3161
|
-
const {
|
|
3530
|
+
const {
|
|
3531
|
+
selfRef,
|
|
3532
|
+
position,
|
|
3533
|
+
userControlledLeft,
|
|
3534
|
+
hiddenTabs,
|
|
3535
|
+
onMouseWheel,
|
|
3536
|
+
tabsTruncated
|
|
3537
|
+
} = useTabOverflow(
|
|
3538
|
+
border,
|
|
3539
|
+
Orientation.flip(border.getOrientation()),
|
|
3540
|
+
toolbarRef,
|
|
3541
|
+
stickyButtonsRef
|
|
3542
|
+
);
|
|
3162
3543
|
const onAuxMouseClick = (event) => {
|
|
3163
3544
|
if (isAuxMouseEvent(event)) {
|
|
3164
3545
|
layout.auxMouseClick(border, event);
|
|
@@ -3222,7 +3603,13 @@ var BorderTabSet = (props) => {
|
|
|
3222
3603
|
);
|
|
3223
3604
|
if (i < border.getChildren().length - 1) {
|
|
3224
3605
|
tabs.push(
|
|
3225
|
-
/* @__PURE__ */ React6.createElement(
|
|
3606
|
+
/* @__PURE__ */ React6.createElement(
|
|
3607
|
+
"div",
|
|
3608
|
+
{
|
|
3609
|
+
key: "divider" + i,
|
|
3610
|
+
className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */)
|
|
3611
|
+
}
|
|
3612
|
+
)
|
|
3226
3613
|
);
|
|
3227
3614
|
}
|
|
3228
3615
|
};
|
|
@@ -3235,7 +3622,13 @@ var BorderTabSet = (props) => {
|
|
|
3235
3622
|
}
|
|
3236
3623
|
let buttons = [];
|
|
3237
3624
|
let stickyButtons = [];
|
|
3238
|
-
const renderState = {
|
|
3625
|
+
const renderState = {
|
|
3626
|
+
headerContent: void 0,
|
|
3627
|
+
buttons,
|
|
3628
|
+
stickyButtons,
|
|
3629
|
+
headerButtons: [],
|
|
3630
|
+
overflowPosition: void 0
|
|
3631
|
+
};
|
|
3239
3632
|
layout.customizeTabSet(border, renderState);
|
|
3240
3633
|
buttons = renderState.buttons;
|
|
3241
3634
|
if (renderState.overflowPosition === void 0) {
|
|
@@ -3245,20 +3638,24 @@ var BorderTabSet = (props) => {
|
|
|
3245
3638
|
if (tabsTruncated) {
|
|
3246
3639
|
buttons = [...stickyButtons, ...buttons];
|
|
3247
3640
|
} else {
|
|
3248
|
-
tabs.push(
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
e
|
|
3641
|
+
tabs.push(
|
|
3642
|
+
/* @__PURE__ */ React6.createElement(
|
|
3643
|
+
"div",
|
|
3644
|
+
{
|
|
3645
|
+
ref: stickyButtonsRef,
|
|
3646
|
+
key: "sticky_buttons_container",
|
|
3647
|
+
onMouseDown: onInterceptMouseDown,
|
|
3648
|
+
onTouchStart: onInterceptMouseDown,
|
|
3649
|
+
onDragStart: (e) => {
|
|
3650
|
+
e.preventDefault();
|
|
3651
|
+
},
|
|
3652
|
+
className: cm(
|
|
3653
|
+
"flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
|
|
3654
|
+
)
|
|
3257
3655
|
},
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
));
|
|
3656
|
+
stickyButtons
|
|
3657
|
+
)
|
|
3658
|
+
);
|
|
3262
3659
|
}
|
|
3263
3660
|
}
|
|
3264
3661
|
if (hiddenTabs.length > 0) {
|
|
@@ -3267,7 +3664,15 @@ var BorderTabSet = (props) => {
|
|
|
3267
3664
|
if (typeof icons.more === "function") {
|
|
3268
3665
|
overflowContent = icons.more(border, hiddenTabs);
|
|
3269
3666
|
} else {
|
|
3270
|
-
overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement(
|
|
3667
|
+
overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement(
|
|
3668
|
+
"div",
|
|
3669
|
+
{
|
|
3670
|
+
className: cm(
|
|
3671
|
+
"flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
|
|
3672
|
+
)
|
|
3673
|
+
},
|
|
3674
|
+
hiddenTabs.length
|
|
3675
|
+
));
|
|
3271
3676
|
}
|
|
3272
3677
|
buttons.splice(
|
|
3273
3678
|
Math.min(renderState.overflowPosition, buttons.length),
|
|
@@ -3277,7 +3682,9 @@ var BorderTabSet = (props) => {
|
|
|
3277
3682
|
{
|
|
3278
3683
|
key: "overflowbutton",
|
|
3279
3684
|
ref: overflowbuttonRef,
|
|
3280
|
-
className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm(
|
|
3685
|
+
className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm(
|
|
3686
|
+
"flexlayout__border_toolbar_button_overflow_" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ */ + border.getLocation().getName()
|
|
3687
|
+
),
|
|
3281
3688
|
title: overflowTitle,
|
|
3282
3689
|
onClick: onOverflowClick,
|
|
3283
3690
|
onMouseDown: onInterceptMouseDown,
|
|
@@ -3308,14 +3715,32 @@ var BorderTabSet = (props) => {
|
|
|
3308
3715
|
);
|
|
3309
3716
|
}
|
|
3310
3717
|
}
|
|
3311
|
-
const toolbar = /* @__PURE__ */ React6.createElement(
|
|
3718
|
+
const toolbar = /* @__PURE__ */ React6.createElement(
|
|
3719
|
+
"div",
|
|
3720
|
+
{
|
|
3721
|
+
key: "toolbar",
|
|
3722
|
+
ref: toolbarRef,
|
|
3723
|
+
className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm(
|
|
3724
|
+
"flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()
|
|
3725
|
+
)
|
|
3726
|
+
},
|
|
3727
|
+
buttons
|
|
3728
|
+
);
|
|
3312
3729
|
style2 = layout.styleFont(style2);
|
|
3313
3730
|
let innerStyle = {};
|
|
3314
3731
|
const borderHeight = border.getBorderBarSize() - 1;
|
|
3315
3732
|
if (border.getLocation() === DockLocation.LEFT) {
|
|
3316
|
-
innerStyle = {
|
|
3733
|
+
innerStyle = {
|
|
3734
|
+
right: borderHeight,
|
|
3735
|
+
height: borderHeight,
|
|
3736
|
+
top: position
|
|
3737
|
+
};
|
|
3317
3738
|
} else if (border.getLocation() === DockLocation.RIGHT) {
|
|
3318
|
-
innerStyle = {
|
|
3739
|
+
innerStyle = {
|
|
3740
|
+
left: borderHeight,
|
|
3741
|
+
height: borderHeight,
|
|
3742
|
+
top: position
|
|
3743
|
+
};
|
|
3319
3744
|
} else {
|
|
3320
3745
|
innerStyle = { height: borderHeight, left: position };
|
|
3321
3746
|
}
|
|
@@ -3332,7 +3757,25 @@ var BorderTabSet = (props) => {
|
|
|
3332
3757
|
onContextMenu,
|
|
3333
3758
|
onWheel: onMouseWheel
|
|
3334
3759
|
},
|
|
3335
|
-
/* @__PURE__ */ React6.createElement(
|
|
3760
|
+
/* @__PURE__ */ React6.createElement(
|
|
3761
|
+
"div",
|
|
3762
|
+
{
|
|
3763
|
+
style: { height: borderHeight },
|
|
3764
|
+
className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm(
|
|
3765
|
+
"flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()
|
|
3766
|
+
)
|
|
3767
|
+
},
|
|
3768
|
+
/* @__PURE__ */ React6.createElement(
|
|
3769
|
+
"div",
|
|
3770
|
+
{
|
|
3771
|
+
style: innerStyle,
|
|
3772
|
+
className: cm("flexlayout__border_inner_tab_container" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER */) + " " + cm(
|
|
3773
|
+
"flexlayout__border_inner_tab_container_" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ */ + border.getLocation().getName()
|
|
3774
|
+
)
|
|
3775
|
+
},
|
|
3776
|
+
tabs
|
|
3777
|
+
)
|
|
3778
|
+
),
|
|
3336
3779
|
toolbar
|
|
3337
3780
|
);
|
|
3338
3781
|
};
|
|
@@ -3345,13 +3788,27 @@ var Splitter = (props) => {
|
|
|
3345
3788
|
const outlineDiv = React7.useRef(void 0);
|
|
3346
3789
|
const parentNode = node.getParent();
|
|
3347
3790
|
const onMouseDown = (event) => {
|
|
3348
|
-
DragDrop.instance.setGlassCursorOverride(
|
|
3349
|
-
|
|
3791
|
+
DragDrop.instance.setGlassCursorOverride(
|
|
3792
|
+
node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
|
|
3793
|
+
);
|
|
3794
|
+
DragDrop.instance.startDrag(
|
|
3795
|
+
event,
|
|
3796
|
+
onDragStart,
|
|
3797
|
+
onDragMove,
|
|
3798
|
+
onDragEnd,
|
|
3799
|
+
onDragCancel,
|
|
3800
|
+
void 0,
|
|
3801
|
+
void 0,
|
|
3802
|
+
layout.getCurrentDocument(),
|
|
3803
|
+
layout.getRootDiv() ?? void 0
|
|
3804
|
+
);
|
|
3350
3805
|
pBounds.current = parentNode._getSplitterBounds(node, true);
|
|
3351
3806
|
const rootdiv = layout.getRootDiv();
|
|
3352
3807
|
outlineDiv.current = layout.getCurrentDocument().createElement("div");
|
|
3353
3808
|
outlineDiv.current.style.position = "absolute";
|
|
3354
|
-
outlineDiv.current.className = layout.getClassName(
|
|
3809
|
+
outlineDiv.current.className = layout.getClassName(
|
|
3810
|
+
"flexlayout__splitter_drag" /* FLEXLAYOUT__SPLITTER_DRAG */
|
|
3811
|
+
);
|
|
3355
3812
|
outlineDiv.current.style.cursor = node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize";
|
|
3356
3813
|
const r2 = node.getRect();
|
|
3357
3814
|
if (node.getOrientation() === Orientation.VERT && r2.width < 2) {
|
|
@@ -3360,11 +3817,15 @@ var Splitter = (props) => {
|
|
|
3360
3817
|
r2.height = 2;
|
|
3361
3818
|
}
|
|
3362
3819
|
r2.positionElement(outlineDiv.current);
|
|
3363
|
-
rootdiv
|
|
3820
|
+
if (rootdiv) {
|
|
3821
|
+
rootdiv.appendChild(outlineDiv.current);
|
|
3822
|
+
}
|
|
3364
3823
|
};
|
|
3365
|
-
const onDragCancel = (
|
|
3824
|
+
const onDragCancel = (_wasDragging) => {
|
|
3366
3825
|
const rootdiv = layout.getRootDiv();
|
|
3367
|
-
rootdiv
|
|
3826
|
+
if (rootdiv) {
|
|
3827
|
+
rootdiv.removeChild(outlineDiv.current);
|
|
3828
|
+
}
|
|
3368
3829
|
};
|
|
3369
3830
|
const onDragStart = () => {
|
|
3370
3831
|
return true;
|
|
@@ -3397,7 +3858,12 @@ var Splitter = (props) => {
|
|
|
3397
3858
|
}
|
|
3398
3859
|
if (parentNode instanceof BorderNode) {
|
|
3399
3860
|
const pos = parentNode._calculateSplit(node, value);
|
|
3400
|
-
layout.doAction(
|
|
3861
|
+
layout.doAction(
|
|
3862
|
+
Actions.adjustBorderSplit(
|
|
3863
|
+
node.getParent().getId(),
|
|
3864
|
+
pos
|
|
3865
|
+
)
|
|
3866
|
+
);
|
|
3401
3867
|
} else {
|
|
3402
3868
|
const splitSpec = parentNode._calculateSplit(node, value);
|
|
3403
3869
|
if (splitSpec !== void 0) {
|
|
@@ -3408,7 +3874,9 @@ var Splitter = (props) => {
|
|
|
3408
3874
|
const onDragEnd = () => {
|
|
3409
3875
|
updateLayout();
|
|
3410
3876
|
const rootdiv = layout.getRootDiv();
|
|
3411
|
-
rootdiv
|
|
3877
|
+
if (rootdiv) {
|
|
3878
|
+
rootdiv.removeChild(outlineDiv.current);
|
|
3879
|
+
}
|
|
3412
3880
|
};
|
|
3413
3881
|
const getBoundPosition = (p) => {
|
|
3414
3882
|
const bounds = pBounds.current;
|
|
@@ -3459,23 +3927,15 @@ var Splitter = (props) => {
|
|
|
3459
3927
|
cursor: node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
|
|
3460
3928
|
});
|
|
3461
3929
|
const className2 = cm("flexlayout__splitter_extra" /* FLEXLAYOUT__SPLITTER_EXTRA */);
|
|
3462
|
-
return /* @__PURE__ */ React7.createElement(
|
|
3930
|
+
return /* @__PURE__ */ React7.createElement("div", { style: style2, "data-layout-path": path, className }, /* @__PURE__ */ React7.createElement(
|
|
3463
3931
|
"div",
|
|
3464
3932
|
{
|
|
3465
|
-
style:
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
{
|
|
3472
|
-
style: style22,
|
|
3473
|
-
className: className2,
|
|
3474
|
-
onTouchStart: onMouseDown,
|
|
3475
|
-
onMouseDown
|
|
3476
|
-
}
|
|
3477
|
-
)
|
|
3478
|
-
);
|
|
3933
|
+
style: style22,
|
|
3934
|
+
className: className2,
|
|
3935
|
+
onTouchStart: onMouseDown,
|
|
3936
|
+
onMouseDown
|
|
3937
|
+
}
|
|
3938
|
+
));
|
|
3479
3939
|
}
|
|
3480
3940
|
};
|
|
3481
3941
|
|
|
@@ -3508,7 +3968,9 @@ var ErrorBoundary = class extends React8.Component {
|
|
|
3508
3968
|
// src/view/Tab.tsx
|
|
3509
3969
|
var Tab = (props) => {
|
|
3510
3970
|
const { layout, selected, node, factory, path } = props;
|
|
3511
|
-
const [renderComponent, setRenderComponent] = React9.useState(
|
|
3971
|
+
const [renderComponent, setRenderComponent] = React9.useState(
|
|
3972
|
+
!props.node.isEnableRenderOnDemand() || props.selected
|
|
3973
|
+
);
|
|
3512
3974
|
React9.useLayoutEffect(() => {
|
|
3513
3975
|
if (!renderComponent && selected) {
|
|
3514
3976
|
setRenderComponent(true);
|
|
@@ -3541,7 +4003,9 @@ var Tab = (props) => {
|
|
|
3541
4003
|
let className = cm("flexlayout__tab" /* FLEXLAYOUT__TAB */);
|
|
3542
4004
|
if (parentNode instanceof BorderNode) {
|
|
3543
4005
|
className += " " + cm("flexlayout__tab_border" /* FLEXLAYOUT__TAB_BORDER */);
|
|
3544
|
-
className += " " + cm(
|
|
4006
|
+
className += " " + cm(
|
|
4007
|
+
"flexlayout__tab_border_" /* FLEXLAYOUT__TAB_BORDER_ */ + parentNode.getLocation().getName()
|
|
4008
|
+
);
|
|
3545
4009
|
}
|
|
3546
4010
|
if (node.getContentClassName() !== void 0) {
|
|
3547
4011
|
className += " " + node.getContentClassName();
|
|
@@ -3555,7 +4019,15 @@ var Tab = (props) => {
|
|
|
3555
4019
|
onTouchStart: onMouseDown,
|
|
3556
4020
|
style: style2
|
|
3557
4021
|
},
|
|
3558
|
-
/* @__PURE__ */ React9.createElement(
|
|
4022
|
+
/* @__PURE__ */ React9.createElement(
|
|
4023
|
+
ErrorBoundary,
|
|
4024
|
+
{
|
|
4025
|
+
message: props.layout.i18nName(
|
|
4026
|
+
"Error rendering component" /* Error_rendering_component */
|
|
4027
|
+
)
|
|
4028
|
+
},
|
|
4029
|
+
/* @__PURE__ */ React9.createElement(Fragment2, null, child)
|
|
4030
|
+
)
|
|
3559
4031
|
);
|
|
3560
4032
|
};
|
|
3561
4033
|
|
|
@@ -3570,7 +4042,14 @@ var TabButton = (props) => {
|
|
|
3570
4042
|
const contentRef = React10.useRef(null);
|
|
3571
4043
|
const onMouseDown = (event) => {
|
|
3572
4044
|
if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
|
|
3573
|
-
layout.dragStart(
|
|
4045
|
+
layout.dragStart(
|
|
4046
|
+
event,
|
|
4047
|
+
void 0,
|
|
4048
|
+
node,
|
|
4049
|
+
node.isEnableDrag(),
|
|
4050
|
+
onClick,
|
|
4051
|
+
onDoubleClick
|
|
4052
|
+
);
|
|
3574
4053
|
}
|
|
3575
4054
|
};
|
|
3576
4055
|
const onAuxMouseClick = (event) => {
|
|
@@ -3632,7 +4111,14 @@ var TabButton = (props) => {
|
|
|
3632
4111
|
const updateRect = () => {
|
|
3633
4112
|
const layoutRect = layout.getDomRect();
|
|
3634
4113
|
const r = selfRef.current.getBoundingClientRect();
|
|
3635
|
-
node._setTabRect(
|
|
4114
|
+
node._setTabRect(
|
|
4115
|
+
new Rect(
|
|
4116
|
+
r.left - layoutRect.left,
|
|
4117
|
+
r.top - layoutRect.top,
|
|
4118
|
+
r.width,
|
|
4119
|
+
r.height
|
|
4120
|
+
)
|
|
4121
|
+
);
|
|
3636
4122
|
};
|
|
3637
4123
|
const onTextBoxMouseDown = (event) => {
|
|
3638
4124
|
event.stopPropagation();
|
|
@@ -3642,7 +4128,12 @@ var TabButton = (props) => {
|
|
|
3642
4128
|
layout.setEditingTab(void 0);
|
|
3643
4129
|
} else if (event.code === "Enter") {
|
|
3644
4130
|
layout.setEditingTab(void 0);
|
|
3645
|
-
layout.doAction(
|
|
4131
|
+
layout.doAction(
|
|
4132
|
+
Actions.renameTab(
|
|
4133
|
+
node.getId(),
|
|
4134
|
+
event.target.value
|
|
4135
|
+
)
|
|
4136
|
+
);
|
|
3646
4137
|
}
|
|
3647
4138
|
};
|
|
3648
4139
|
const cm = layout.getClassName;
|
|
@@ -3658,7 +4149,12 @@ var TabButton = (props) => {
|
|
|
3658
4149
|
if (node.getClassName() !== void 0) {
|
|
3659
4150
|
classNames += " " + node.getClassName();
|
|
3660
4151
|
}
|
|
3661
|
-
const renderState = getRenderStateEx(
|
|
4152
|
+
const renderState = getRenderStateEx(
|
|
4153
|
+
layout,
|
|
4154
|
+
node,
|
|
4155
|
+
iconFactory,
|
|
4156
|
+
titleFactory
|
|
4157
|
+
);
|
|
3662
4158
|
let content = renderState.content ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : null;
|
|
3663
4159
|
const leading = renderState.leading ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
3664
4160
|
if (layout.getEditingTab() === node) {
|
|
@@ -3721,7 +4217,14 @@ var TabSet = (props) => {
|
|
|
3721
4217
|
const overflowbuttonRef = React11.useRef(null);
|
|
3722
4218
|
const tabbarInnerRef = React11.useRef(null);
|
|
3723
4219
|
const stickyButtonsRef = React11.useRef(null);
|
|
3724
|
-
const {
|
|
4220
|
+
const {
|
|
4221
|
+
selfRef,
|
|
4222
|
+
position,
|
|
4223
|
+
userControlledLeft,
|
|
4224
|
+
hiddenTabs,
|
|
4225
|
+
onMouseWheel,
|
|
4226
|
+
tabsTruncated
|
|
4227
|
+
} = useTabOverflow(node, Orientation.HORZ, toolbarRef, stickyButtonsRef);
|
|
3725
4228
|
const onOverflowClick = (event) => {
|
|
3726
4229
|
const callback = layout.getShowOverflowMenu();
|
|
3727
4230
|
if (callback !== void 0) {
|
|
@@ -3755,9 +4258,23 @@ var TabSet = (props) => {
|
|
|
3755
4258
|
if (!layout.getEditingTab()) {
|
|
3756
4259
|
const message = layout.i18nName("Move tabset" /* Move_Tabset */, name);
|
|
3757
4260
|
if (node.getModel().getMaximizedTabset() !== void 0) {
|
|
3758
|
-
layout.dragStart(
|
|
4261
|
+
layout.dragStart(
|
|
4262
|
+
event,
|
|
4263
|
+
message,
|
|
4264
|
+
node,
|
|
4265
|
+
false,
|
|
4266
|
+
(event2) => void 0,
|
|
4267
|
+
onDoubleClick
|
|
4268
|
+
);
|
|
3759
4269
|
} else {
|
|
3760
|
-
layout.dragStart(
|
|
4270
|
+
layout.dragStart(
|
|
4271
|
+
event,
|
|
4272
|
+
message,
|
|
4273
|
+
node,
|
|
4274
|
+
node.isEnableDrag(),
|
|
4275
|
+
(event2) => void 0,
|
|
4276
|
+
onDoubleClick
|
|
4277
|
+
);
|
|
3761
4278
|
}
|
|
3762
4279
|
}
|
|
3763
4280
|
}
|
|
@@ -3825,7 +4342,13 @@ var TabSet = (props) => {
|
|
|
3825
4342
|
);
|
|
3826
4343
|
if (i < node.getChildren().length - 1) {
|
|
3827
4344
|
tabs.push(
|
|
3828
|
-
/* @__PURE__ */ React11.createElement(
|
|
4345
|
+
/* @__PURE__ */ React11.createElement(
|
|
4346
|
+
"div",
|
|
4347
|
+
{
|
|
4348
|
+
key: "divider" + i,
|
|
4349
|
+
className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */)
|
|
4350
|
+
}
|
|
4351
|
+
)
|
|
3829
4352
|
);
|
|
3830
4353
|
}
|
|
3831
4354
|
}
|
|
@@ -3834,7 +4357,13 @@ var TabSet = (props) => {
|
|
|
3834
4357
|
let stickyButtons = [];
|
|
3835
4358
|
let buttons = [];
|
|
3836
4359
|
let headerButtons = [];
|
|
3837
|
-
const renderState = {
|
|
4360
|
+
const renderState = {
|
|
4361
|
+
headerContent: node.getName(),
|
|
4362
|
+
stickyButtons,
|
|
4363
|
+
buttons,
|
|
4364
|
+
headerButtons,
|
|
4365
|
+
overflowPosition: void 0
|
|
4366
|
+
};
|
|
3838
4367
|
layout.customizeTabSet(node, renderState);
|
|
3839
4368
|
const headerContent = renderState.headerContent;
|
|
3840
4369
|
stickyButtons = renderState.stickyButtons;
|
|
@@ -3847,20 +4376,24 @@ var TabSet = (props) => {
|
|
|
3847
4376
|
if (tabsTruncated) {
|
|
3848
4377
|
buttons = [...stickyButtons, ...buttons];
|
|
3849
4378
|
} else {
|
|
3850
|
-
tabs.push(
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
e
|
|
4379
|
+
tabs.push(
|
|
4380
|
+
/* @__PURE__ */ React11.createElement(
|
|
4381
|
+
"div",
|
|
4382
|
+
{
|
|
4383
|
+
ref: stickyButtonsRef,
|
|
4384
|
+
key: "sticky_buttons_container",
|
|
4385
|
+
onMouseDown: onInterceptMouseDown,
|
|
4386
|
+
onTouchStart: onInterceptMouseDown,
|
|
4387
|
+
onDragStart: (e) => {
|
|
4388
|
+
e.preventDefault();
|
|
4389
|
+
},
|
|
4390
|
+
className: cm(
|
|
4391
|
+
"flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
|
|
4392
|
+
)
|
|
3859
4393
|
},
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
));
|
|
4394
|
+
stickyButtons
|
|
4395
|
+
)
|
|
4396
|
+
);
|
|
3864
4397
|
}
|
|
3865
4398
|
}
|
|
3866
4399
|
if (hiddenTabs.length > 0) {
|
|
@@ -3869,7 +4402,15 @@ var TabSet = (props) => {
|
|
|
3869
4402
|
if (typeof icons.more === "function") {
|
|
3870
4403
|
overflowContent = icons.more(node, hiddenTabs);
|
|
3871
4404
|
} else {
|
|
3872
|
-
overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement(
|
|
4405
|
+
overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement(
|
|
4406
|
+
"div",
|
|
4407
|
+
{
|
|
4408
|
+
className: cm(
|
|
4409
|
+
"flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
|
|
4410
|
+
)
|
|
4411
|
+
},
|
|
4412
|
+
hiddenTabs.length
|
|
4413
|
+
));
|
|
3873
4414
|
}
|
|
3874
4415
|
buttons.splice(
|
|
3875
4416
|
Math.min(renderState.overflowPosition, buttons.length),
|
|
@@ -3919,7 +4460,9 @@ var TabSet = (props) => {
|
|
|
3919
4460
|
key: "max",
|
|
3920
4461
|
"data-layout-path": path + "/button/max",
|
|
3921
4462
|
title: node.isMaximized() ? minTitle : maxTitle,
|
|
3922
|
-
className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm(
|
|
4463
|
+
className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm(
|
|
4464
|
+
"flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")
|
|
4465
|
+
),
|
|
3923
4466
|
onClick: onMaximizeToggle,
|
|
3924
4467
|
onMouseDown: onInterceptMouseDown,
|
|
3925
4468
|
onTouchStart: onInterceptMouseDown
|
|
@@ -4015,7 +4558,9 @@ var TabSet = (props) => {
|
|
|
4015
4558
|
headerToolbar
|
|
4016
4559
|
);
|
|
4017
4560
|
}
|
|
4018
|
-
const tabStripStyle = {
|
|
4561
|
+
const tabStripStyle = {
|
|
4562
|
+
height: node.getTabStripHeight() + "px"
|
|
4563
|
+
};
|
|
4019
4564
|
tabStrip = /* @__PURE__ */ React11.createElement(
|
|
4020
4565
|
"div",
|
|
4021
4566
|
{
|
|
@@ -4028,14 +4573,27 @@ var TabSet = (props) => {
|
|
|
4028
4573
|
onAuxClick: onAuxMouseClick,
|
|
4029
4574
|
onTouchStart: onMouseDown
|
|
4030
4575
|
},
|
|
4031
|
-
/* @__PURE__ */ React11.createElement(
|
|
4576
|
+
/* @__PURE__ */ React11.createElement(
|
|
4032
4577
|
"div",
|
|
4033
4578
|
{
|
|
4034
|
-
|
|
4035
|
-
className: cm("
|
|
4579
|
+
ref: tabbarInnerRef,
|
|
4580
|
+
className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm(
|
|
4581
|
+
"flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()
|
|
4582
|
+
)
|
|
4036
4583
|
},
|
|
4037
|
-
|
|
4038
|
-
|
|
4584
|
+
/* @__PURE__ */ React11.createElement(
|
|
4585
|
+
"div",
|
|
4586
|
+
{
|
|
4587
|
+
style: { left: position },
|
|
4588
|
+
className: cm(
|
|
4589
|
+
"flexlayout__tabset_tabbar_inner_tab_container" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER */
|
|
4590
|
+
) + " " + cm(
|
|
4591
|
+
"flexlayout__tabset_tabbar_inner_tab_container_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ */ + node.getTabLocation()
|
|
4592
|
+
)
|
|
4593
|
+
},
|
|
4594
|
+
tabs
|
|
4595
|
+
)
|
|
4596
|
+
),
|
|
4039
4597
|
toolbar
|
|
4040
4598
|
);
|
|
4041
4599
|
style2 = layout.styleFont(style2);
|
|
@@ -4074,33 +4632,42 @@ var FloatingWindow = (props) => {
|
|
|
4074
4632
|
const { title, id, url, rect, onCloseWindow, onSetWindow, children } = props;
|
|
4075
4633
|
const popoutWindow = React12.useRef(null);
|
|
4076
4634
|
const timerId = React12.useRef(null);
|
|
4077
|
-
const [content, setContent] = React12.useState(
|
|
4635
|
+
const [content, setContent] = React12.useState(
|
|
4636
|
+
void 0
|
|
4637
|
+
);
|
|
4078
4638
|
React12.useLayoutEffect(() => {
|
|
4079
4639
|
if (timerId.current) {
|
|
4080
4640
|
clearTimeout(timerId.current);
|
|
4081
4641
|
}
|
|
4082
4642
|
let isMounted = true;
|
|
4083
|
-
const r = rect;
|
|
4084
|
-
const styles = Array.from(window.document.styleSheets).reduce(
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4643
|
+
const r = rect || new Rect(0, 0, 100, 100);
|
|
4644
|
+
const styles = Array.from(window.document.styleSheets).reduce(
|
|
4645
|
+
(result, styleSheet) => {
|
|
4646
|
+
let rules = void 0;
|
|
4647
|
+
try {
|
|
4648
|
+
rules = styleSheet.cssRules;
|
|
4649
|
+
} catch (e) {
|
|
4650
|
+
}
|
|
4651
|
+
try {
|
|
4652
|
+
return [
|
|
4653
|
+
...result,
|
|
4654
|
+
{
|
|
4655
|
+
href: styleSheet.href,
|
|
4656
|
+
type: styleSheet.type,
|
|
4657
|
+
rules: rules ? Array.from(rules).map((rule) => rule.cssText) : null
|
|
4658
|
+
}
|
|
4659
|
+
];
|
|
4660
|
+
} catch (e) {
|
|
4661
|
+
return result;
|
|
4662
|
+
}
|
|
4663
|
+
},
|
|
4664
|
+
[]
|
|
4665
|
+
);
|
|
4666
|
+
popoutWindow.current = window.open(
|
|
4667
|
+
url,
|
|
4668
|
+
id,
|
|
4669
|
+
`left=${r.x},top=${r.y},width=${r.width},height=${r.height}`
|
|
4670
|
+
);
|
|
4104
4671
|
if (popoutWindow.current !== null) {
|
|
4105
4672
|
onSetWindow(id, popoutWindow.current);
|
|
4106
4673
|
window.addEventListener("beforeunload", () => {
|
|
@@ -4119,9 +4686,12 @@ var FloatingWindow = (props) => {
|
|
|
4119
4686
|
copyStyles(popoutDocument, styles).then(() => {
|
|
4120
4687
|
setContent(popoutContent);
|
|
4121
4688
|
});
|
|
4122
|
-
popoutWindow.current.addEventListener(
|
|
4123
|
-
|
|
4124
|
-
|
|
4689
|
+
popoutWindow.current.addEventListener(
|
|
4690
|
+
"beforeunload",
|
|
4691
|
+
() => {
|
|
4692
|
+
onCloseWindow(id);
|
|
4693
|
+
}
|
|
4694
|
+
);
|
|
4125
4695
|
}
|
|
4126
4696
|
});
|
|
4127
4697
|
} else {
|
|
@@ -4155,7 +4725,7 @@ function copyStyles(doc, styleSheets) {
|
|
|
4155
4725
|
styleElement.href = styleSheet.href;
|
|
4156
4726
|
head.appendChild(styleElement);
|
|
4157
4727
|
promises.push(
|
|
4158
|
-
new Promise((resolve
|
|
4728
|
+
new Promise((resolve) => {
|
|
4159
4729
|
styleElement.onload = () => resolve(true);
|
|
4160
4730
|
})
|
|
4161
4731
|
);
|
|
@@ -4179,7 +4749,15 @@ var FloatingWindowTab = (props) => {
|
|
|
4179
4749
|
const { layout, node, factory } = props;
|
|
4180
4750
|
const cm = layout.getClassName;
|
|
4181
4751
|
const child = factory(node);
|
|
4182
|
-
return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(
|
|
4752
|
+
return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(
|
|
4753
|
+
ErrorBoundary,
|
|
4754
|
+
{
|
|
4755
|
+
message: props.layout.i18nName(
|
|
4756
|
+
"Error rendering component" /* Error_rendering_component */
|
|
4757
|
+
)
|
|
4758
|
+
},
|
|
4759
|
+
/* @__PURE__ */ React13.createElement(Fragment4, null, child)
|
|
4760
|
+
));
|
|
4183
4761
|
};
|
|
4184
4762
|
|
|
4185
4763
|
// src/view/TabFloating.tsx
|
|
@@ -4226,7 +4804,16 @@ var TabFloating = (props) => {
|
|
|
4226
4804
|
const dockMessage = layout.i18nName("Dock window" /* Floating_Window_Dock_Window */);
|
|
4227
4805
|
const customRenderCallback = layout.getOnRenderFloatingTabPlaceholder();
|
|
4228
4806
|
if (customRenderCallback) {
|
|
4229
|
-
return /* @__PURE__ */ React14.createElement(
|
|
4807
|
+
return /* @__PURE__ */ React14.createElement(
|
|
4808
|
+
"div",
|
|
4809
|
+
{
|
|
4810
|
+
className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */),
|
|
4811
|
+
onMouseDown,
|
|
4812
|
+
onTouchStart: onMouseDown,
|
|
4813
|
+
style: style2
|
|
4814
|
+
},
|
|
4815
|
+
customRenderCallback(dockPopout, showPopout)
|
|
4816
|
+
);
|
|
4230
4817
|
} else {
|
|
4231
4818
|
return /* @__PURE__ */ React14.createElement(
|
|
4232
4819
|
"div",
|
|
@@ -4244,15 +4831,62 @@ var TabFloating = (props) => {
|
|
|
4244
4831
|
|
|
4245
4832
|
// src/view/Icons.tsx
|
|
4246
4833
|
import * as React15 from "react";
|
|
4247
|
-
var style = {
|
|
4834
|
+
var style = {
|
|
4835
|
+
width: "1em",
|
|
4836
|
+
height: "1em",
|
|
4837
|
+
display: "flex",
|
|
4838
|
+
alignItems: "center"
|
|
4839
|
+
};
|
|
4248
4840
|
var CloseIcon = () => {
|
|
4249
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4841
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4842
|
+
"svg",
|
|
4843
|
+
{
|
|
4844
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4845
|
+
style,
|
|
4846
|
+
viewBox: "0 0 24 24"
|
|
4847
|
+
},
|
|
4848
|
+
/* @__PURE__ */ React15.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }),
|
|
4849
|
+
/* @__PURE__ */ React15.createElement(
|
|
4850
|
+
"path",
|
|
4851
|
+
{
|
|
4852
|
+
stroke: "var(--color-icon)",
|
|
4853
|
+
fill: "var(--color-icon)",
|
|
4854
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
4855
|
+
}
|
|
4856
|
+
)
|
|
4857
|
+
);
|
|
4250
4858
|
};
|
|
4251
4859
|
var MaximizeIcon = () => {
|
|
4252
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4860
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4861
|
+
"svg",
|
|
4862
|
+
{
|
|
4863
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4864
|
+
style,
|
|
4865
|
+
viewBox: "0 0 24 24",
|
|
4866
|
+
fill: "var(--color-icon)"
|
|
4867
|
+
},
|
|
4868
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4869
|
+
/* @__PURE__ */ React15.createElement(
|
|
4870
|
+
"path",
|
|
4871
|
+
{
|
|
4872
|
+
stroke: "var(--color-icon)",
|
|
4873
|
+
d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
|
|
4874
|
+
}
|
|
4875
|
+
)
|
|
4876
|
+
);
|
|
4253
4877
|
};
|
|
4254
4878
|
var OverflowIcon = () => {
|
|
4255
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4879
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4880
|
+
"svg",
|
|
4881
|
+
{
|
|
4882
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4883
|
+
style,
|
|
4884
|
+
viewBox: "0 0 24 24",
|
|
4885
|
+
fill: "var(--color-icon)"
|
|
4886
|
+
},
|
|
4887
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4888
|
+
/* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" })
|
|
4889
|
+
);
|
|
4256
4890
|
};
|
|
4257
4891
|
var PopoutIcon = () => {
|
|
4258
4892
|
return (
|
|
@@ -4260,11 +4894,37 @@ var PopoutIcon = () => {
|
|
|
4260
4894
|
// <svg xmlns="http://www.w3.org/2000/svg" style={style} fill="none" viewBox="0 0 24 24" stroke="var(--color-icon)" stroke-width="2">
|
|
4261
4895
|
// <path stroke-linecap="round" stroke-linejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
|
4262
4896
|
// </svg>
|
|
4263
|
-
/* @__PURE__ */ React15.createElement(
|
|
4897
|
+
/* @__PURE__ */ React15.createElement(
|
|
4898
|
+
"svg",
|
|
4899
|
+
{
|
|
4900
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4901
|
+
style,
|
|
4902
|
+
viewBox: "0 0 20 20",
|
|
4903
|
+
fill: "var(--color-icon)"
|
|
4904
|
+
},
|
|
4905
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" }),
|
|
4906
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" })
|
|
4907
|
+
)
|
|
4264
4908
|
);
|
|
4265
4909
|
};
|
|
4266
4910
|
var RestoreIcon = () => {
|
|
4267
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4911
|
+
return /* @__PURE__ */ React15.createElement(
|
|
4912
|
+
"svg",
|
|
4913
|
+
{
|
|
4914
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4915
|
+
style,
|
|
4916
|
+
viewBox: "0 0 24 24",
|
|
4917
|
+
fill: "var(--color-icon)"
|
|
4918
|
+
},
|
|
4919
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4920
|
+
/* @__PURE__ */ React15.createElement(
|
|
4921
|
+
"path",
|
|
4922
|
+
{
|
|
4923
|
+
stroke: "var(--color-icon)",
|
|
4924
|
+
d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"
|
|
4925
|
+
}
|
|
4926
|
+
)
|
|
4927
|
+
);
|
|
4268
4928
|
};
|
|
4269
4929
|
|
|
4270
4930
|
// src/view/Layout.tsx
|
|
@@ -4276,9 +4936,8 @@ var defaultIcons = {
|
|
|
4276
4936
|
restore: /* @__PURE__ */ React16.createElement(RestoreIcon, null),
|
|
4277
4937
|
more: /* @__PURE__ */ React16.createElement(OverflowIcon, null)
|
|
4278
4938
|
};
|
|
4279
|
-
var isIEorEdge = typeof window !== "undefined" && (window.document.documentMode || /Edge\//.test(window.navigator.userAgent));
|
|
4280
4939
|
var isDesktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
4281
|
-
var defaultSupportsPopout = isDesktop
|
|
4940
|
+
var defaultSupportsPopout = isDesktop;
|
|
4282
4941
|
var Layout = class extends React16.Component {
|
|
4283
4942
|
constructor(props) {
|
|
4284
4943
|
super(props);
|
|
@@ -4300,7 +4959,13 @@ var Layout = class extends React16.Component {
|
|
|
4300
4959
|
}
|
|
4301
4960
|
};
|
|
4302
4961
|
/** @internal */
|
|
4303
|
-
this.updateRect = (domRect
|
|
4962
|
+
this.updateRect = (domRect) => {
|
|
4963
|
+
if (!domRect) {
|
|
4964
|
+
domRect = this.getDomRect();
|
|
4965
|
+
}
|
|
4966
|
+
if (!domRect) {
|
|
4967
|
+
return;
|
|
4968
|
+
}
|
|
4304
4969
|
const rect = new Rect(0, 0, domRect.width, domRect.height);
|
|
4305
4970
|
if (!rect.equals(this.state.rect) && rect.width !== 0 && rect.height !== 0) {
|
|
4306
4971
|
this.setState({ rect });
|
|
@@ -4350,7 +5015,9 @@ var Layout = class extends React16.Component {
|
|
|
4350
5015
|
/** @internal */
|
|
4351
5016
|
this.onCancelAdd = () => {
|
|
4352
5017
|
const rootdiv = this.selfRef.current;
|
|
4353
|
-
rootdiv
|
|
5018
|
+
if (rootdiv && this.dragDiv) {
|
|
5019
|
+
rootdiv.removeChild(this.dragDiv);
|
|
5020
|
+
}
|
|
4354
5021
|
this.dragDiv = void 0;
|
|
4355
5022
|
this.hidePortal();
|
|
4356
5023
|
if (this.fnNewNodeDropped != null) {
|
|
@@ -4370,13 +5037,19 @@ var Layout = class extends React16.Component {
|
|
|
4370
5037
|
this.onCancelDrag = (wasDragging) => {
|
|
4371
5038
|
if (wasDragging) {
|
|
4372
5039
|
const rootdiv = this.selfRef.current;
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
5040
|
+
const outlineDiv = this.outlineDiv;
|
|
5041
|
+
if (rootdiv && outlineDiv) {
|
|
5042
|
+
try {
|
|
5043
|
+
rootdiv.removeChild(outlineDiv);
|
|
5044
|
+
} catch (e) {
|
|
5045
|
+
}
|
|
4376
5046
|
}
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
5047
|
+
const dragDiv = this.dragDiv;
|
|
5048
|
+
if (rootdiv && dragDiv) {
|
|
5049
|
+
try {
|
|
5050
|
+
rootdiv.removeChild(dragDiv);
|
|
5051
|
+
} catch (e) {
|
|
5052
|
+
}
|
|
4380
5053
|
}
|
|
4381
5054
|
this.dragDiv = void 0;
|
|
4382
5055
|
this.hidePortal();
|
|
@@ -4399,16 +5072,43 @@ var Layout = class extends React16.Component {
|
|
|
4399
5072
|
/** @internal */
|
|
4400
5073
|
this.onDragDivMouseDown = (event) => {
|
|
4401
5074
|
event.preventDefault();
|
|
4402
|
-
this.dragStart(
|
|
5075
|
+
this.dragStart(
|
|
5076
|
+
event,
|
|
5077
|
+
this.dragDivText,
|
|
5078
|
+
TabNode._fromJson(this.newTabJson, this.props.model, false),
|
|
5079
|
+
true,
|
|
5080
|
+
void 0,
|
|
5081
|
+
void 0
|
|
5082
|
+
);
|
|
4403
5083
|
};
|
|
4404
5084
|
/** @internal */
|
|
4405
5085
|
this.dragStart = (event, dragDivText, node, allowDrag, onClick, onDoubleClick) => {
|
|
4406
5086
|
if (!allowDrag) {
|
|
4407
|
-
DragDrop.instance.startDrag(
|
|
5087
|
+
DragDrop.instance.startDrag(
|
|
5088
|
+
event,
|
|
5089
|
+
void 0,
|
|
5090
|
+
void 0,
|
|
5091
|
+
void 0,
|
|
5092
|
+
void 0,
|
|
5093
|
+
onClick,
|
|
5094
|
+
onDoubleClick,
|
|
5095
|
+
this.currentDocument,
|
|
5096
|
+
this.selfRef.current ?? void 0
|
|
5097
|
+
);
|
|
4408
5098
|
} else {
|
|
4409
5099
|
this.dragNode = node;
|
|
4410
5100
|
this.dragDivText = dragDivText;
|
|
4411
|
-
DragDrop.instance.startDrag(
|
|
5101
|
+
DragDrop.instance.startDrag(
|
|
5102
|
+
event,
|
|
5103
|
+
this.onDragStart,
|
|
5104
|
+
this.onDragMove,
|
|
5105
|
+
this.onDragEnd,
|
|
5106
|
+
this.onCancelDrag,
|
|
5107
|
+
onClick,
|
|
5108
|
+
onDoubleClick,
|
|
5109
|
+
this.currentDocument,
|
|
5110
|
+
this.selfRef.current ?? void 0
|
|
5111
|
+
);
|
|
4412
5112
|
}
|
|
4413
5113
|
};
|
|
4414
5114
|
/** @internal */
|
|
@@ -4430,26 +5130,33 @@ var Layout = class extends React16.Component {
|
|
|
4430
5130
|
}
|
|
4431
5131
|
}
|
|
4432
5132
|
if (this.props.onRenderDragRect !== void 0) {
|
|
4433
|
-
const customContent = this.props.onRenderDragRect(
|
|
5133
|
+
const customContent = this.props.onRenderDragRect(
|
|
5134
|
+
content,
|
|
5135
|
+
node,
|
|
5136
|
+
json
|
|
5137
|
+
);
|
|
4434
5138
|
if (customContent !== void 0) {
|
|
4435
5139
|
content = customContent;
|
|
4436
5140
|
}
|
|
4437
5141
|
}
|
|
4438
|
-
this.dragDiv.style.visibility = "hidden";
|
|
4439
5142
|
this.dragRectRendered = false;
|
|
4440
|
-
this.
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
5143
|
+
const dragDiv = this.dragDiv;
|
|
5144
|
+
if (dragDiv) {
|
|
5145
|
+
dragDiv.style.visibility = "hidden";
|
|
5146
|
+
this.showPortal(
|
|
5147
|
+
/* @__PURE__ */ React16.createElement(
|
|
5148
|
+
DragRectRenderWrapper,
|
|
5149
|
+
{
|
|
5150
|
+
onRendered: () => {
|
|
5151
|
+
this.dragRectRendered = true;
|
|
5152
|
+
onRendered?.();
|
|
5153
|
+
}
|
|
5154
|
+
},
|
|
5155
|
+
content
|
|
5156
|
+
),
|
|
5157
|
+
dragDiv
|
|
5158
|
+
);
|
|
5159
|
+
}
|
|
4453
5160
|
};
|
|
4454
5161
|
/** @internal */
|
|
4455
5162
|
this.showPortal = (control, element) => {
|
|
@@ -4466,21 +5173,33 @@ var Layout = class extends React16.Component {
|
|
|
4466
5173
|
this.customDrop = void 0;
|
|
4467
5174
|
const rootdiv = this.selfRef.current;
|
|
4468
5175
|
this.outlineDiv = this.currentDocument.createElement("div");
|
|
4469
|
-
this.outlineDiv.className = this.getClassName(
|
|
5176
|
+
this.outlineDiv.className = this.getClassName(
|
|
5177
|
+
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
5178
|
+
);
|
|
4470
5179
|
this.outlineDiv.style.visibility = "hidden";
|
|
4471
|
-
rootdiv
|
|
5180
|
+
if (rootdiv) {
|
|
5181
|
+
rootdiv.appendChild(this.outlineDiv);
|
|
5182
|
+
}
|
|
4472
5183
|
if (this.dragDiv == null) {
|
|
4473
5184
|
this.dragDiv = this.currentDocument.createElement("div");
|
|
4474
|
-
this.dragDiv.className = this.getClassName(
|
|
5185
|
+
this.dragDiv.className = this.getClassName(
|
|
5186
|
+
"flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
|
|
5187
|
+
);
|
|
4475
5188
|
this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
|
|
4476
|
-
this.dragRectRender(
|
|
4477
|
-
|
|
5189
|
+
this.dragRectRender(
|
|
5190
|
+
this.dragDivText,
|
|
5191
|
+
this.dragNode,
|
|
5192
|
+
this.newTabJson
|
|
5193
|
+
);
|
|
5194
|
+
if (rootdiv) {
|
|
5195
|
+
rootdiv.appendChild(this.dragDiv);
|
|
5196
|
+
}
|
|
4478
5197
|
}
|
|
4479
5198
|
if (this.props.model.getMaximizedTabset() === void 0) {
|
|
4480
5199
|
this.setState({ showEdges: this.props.model.isEnableEdgeDock() });
|
|
4481
5200
|
}
|
|
4482
|
-
if (this.dragNode
|
|
4483
|
-
this.dragNode.getTabRect()
|
|
5201
|
+
if (this.dragNode && this.outlineDiv && this.dragNode instanceof TabNode && this.dragNode.getTabRect() !== void 0) {
|
|
5202
|
+
this.dragNode.getTabRect()?.positionElement(this.outlineDiv);
|
|
4484
5203
|
}
|
|
4485
5204
|
this.firstMove = true;
|
|
4486
5205
|
return true;
|
|
@@ -4488,44 +5207,64 @@ var Layout = class extends React16.Component {
|
|
|
4488
5207
|
/** @internal */
|
|
4489
5208
|
this.onDragMove = (event) => {
|
|
4490
5209
|
if (this.firstMove === false) {
|
|
4491
|
-
const speed = this.props.model._getAttribute(
|
|
4492
|
-
|
|
5210
|
+
const speed = this.props.model._getAttribute(
|
|
5211
|
+
"tabDragSpeed"
|
|
5212
|
+
);
|
|
5213
|
+
if (this.outlineDiv) {
|
|
5214
|
+
this.outlineDiv.style.transition = `top ${speed}s, left ${speed}s, width ${speed}s, height ${speed}s`;
|
|
5215
|
+
}
|
|
4493
5216
|
}
|
|
4494
5217
|
this.firstMove = false;
|
|
4495
|
-
const clientRect = this.selfRef.current
|
|
5218
|
+
const clientRect = this.selfRef.current?.getBoundingClientRect();
|
|
4496
5219
|
const pos = {
|
|
4497
|
-
x: event.clientX - clientRect
|
|
4498
|
-
y: event.clientY - clientRect
|
|
5220
|
+
x: event.clientX - (clientRect?.left ?? 0),
|
|
5221
|
+
y: event.clientY - (clientRect?.top ?? 0)
|
|
4499
5222
|
};
|
|
4500
5223
|
this.checkForBorderToShow(pos.x, pos.y);
|
|
4501
|
-
const dragRect = this.dragDiv
|
|
5224
|
+
const dragRect = this.dragDiv?.getBoundingClientRect() ?? new DOMRect(0, 0, 100, 100);
|
|
4502
5225
|
let newLeft = pos.x - dragRect.width / 2;
|
|
4503
|
-
if (newLeft + dragRect.width > clientRect
|
|
4504
|
-
newLeft = clientRect
|
|
5226
|
+
if (newLeft + dragRect.width > (clientRect?.width ?? 0)) {
|
|
5227
|
+
newLeft = (clientRect?.width ?? 0) - dragRect.width;
|
|
4505
5228
|
}
|
|
4506
5229
|
newLeft = Math.max(0, newLeft);
|
|
4507
|
-
this.dragDiv
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
this.dragDiv.style.visibility
|
|
5230
|
+
if (this.dragDiv) {
|
|
5231
|
+
this.dragDiv.style.left = newLeft + "px";
|
|
5232
|
+
this.dragDiv.style.top = pos.y + 5 + "px";
|
|
5233
|
+
if (this.dragRectRendered && this.dragDiv.style.visibility === "hidden") {
|
|
5234
|
+
this.dragDiv.style.visibility = "visible";
|
|
5235
|
+
}
|
|
4511
5236
|
}
|
|
4512
|
-
let dropInfo = this.props.model._findDropTargetNode(
|
|
5237
|
+
let dropInfo = this.props.model._findDropTargetNode(
|
|
5238
|
+
this.dragNode,
|
|
5239
|
+
pos.x,
|
|
5240
|
+
pos.y
|
|
5241
|
+
);
|
|
4513
5242
|
if (dropInfo) {
|
|
4514
5243
|
if (this.props.onTabDrag) {
|
|
4515
5244
|
this.handleCustomTabDrag(dropInfo, pos, event);
|
|
4516
5245
|
} else {
|
|
4517
5246
|
this.dropInfo = dropInfo;
|
|
4518
|
-
this.outlineDiv
|
|
4519
|
-
|
|
4520
|
-
|
|
5247
|
+
if (this.outlineDiv) {
|
|
5248
|
+
this.outlineDiv.className = this.getClassName(
|
|
5249
|
+
dropInfo.className
|
|
5250
|
+
);
|
|
5251
|
+
dropInfo.rect.positionElement(this.outlineDiv);
|
|
5252
|
+
this.outlineDiv.style.visibility = "visible";
|
|
5253
|
+
}
|
|
4521
5254
|
}
|
|
4522
5255
|
}
|
|
4523
5256
|
};
|
|
4524
5257
|
/** @internal */
|
|
4525
5258
|
this.onDragEnd = (event) => {
|
|
4526
5259
|
const rootdiv = this.selfRef.current;
|
|
4527
|
-
rootdiv
|
|
4528
|
-
|
|
5260
|
+
if (rootdiv) {
|
|
5261
|
+
if (this.outlineDiv) {
|
|
5262
|
+
rootdiv.removeChild(this.outlineDiv);
|
|
5263
|
+
}
|
|
5264
|
+
if (this.dragDiv) {
|
|
5265
|
+
rootdiv.removeChild(this.dragDiv);
|
|
5266
|
+
}
|
|
5267
|
+
}
|
|
4529
5268
|
this.dragDiv = void 0;
|
|
4530
5269
|
this.hidePortal();
|
|
4531
5270
|
this.setState({ showEdges: false });
|
|
@@ -4544,14 +5283,28 @@ var Layout = class extends React16.Component {
|
|
|
4544
5283
|
console.error(e);
|
|
4545
5284
|
}
|
|
4546
5285
|
} else if (this.newTabJson !== void 0) {
|
|
4547
|
-
const newNode = this.doAction(
|
|
5286
|
+
const newNode = this.doAction(
|
|
5287
|
+
Actions.addNode(
|
|
5288
|
+
this.newTabJson,
|
|
5289
|
+
this.dropInfo.node.getId(),
|
|
5290
|
+
this.dropInfo.location,
|
|
5291
|
+
this.dropInfo.index
|
|
5292
|
+
)
|
|
5293
|
+
);
|
|
4548
5294
|
if (this.fnNewNodeDropped != null) {
|
|
4549
5295
|
this.fnNewNodeDropped(newNode, event);
|
|
4550
5296
|
this.fnNewNodeDropped = void 0;
|
|
4551
5297
|
}
|
|
4552
5298
|
this.newTabJson = void 0;
|
|
4553
5299
|
} else if (this.dragNode !== void 0) {
|
|
4554
|
-
this.doAction(
|
|
5300
|
+
this.doAction(
|
|
5301
|
+
Actions.moveNode(
|
|
5302
|
+
this.dragNode.getId(),
|
|
5303
|
+
this.dropInfo.node.getId(),
|
|
5304
|
+
this.dropInfo.location,
|
|
5305
|
+
this.dropInfo.index
|
|
5306
|
+
)
|
|
5307
|
+
);
|
|
4555
5308
|
}
|
|
4556
5309
|
}
|
|
4557
5310
|
this.setState({ showHiddenBorder: DockLocation.CENTER });
|
|
@@ -4581,10 +5334,16 @@ var Layout = class extends React16.Component {
|
|
|
4581
5334
|
if (this.props.font) {
|
|
4582
5335
|
if (this.selfRef.current) {
|
|
4583
5336
|
if (this.props.font.size) {
|
|
4584
|
-
this.selfRef.current.style.setProperty(
|
|
5337
|
+
this.selfRef.current.style.setProperty(
|
|
5338
|
+
"--font-size",
|
|
5339
|
+
this.props.font.size
|
|
5340
|
+
);
|
|
4585
5341
|
}
|
|
4586
5342
|
if (this.props.font.family) {
|
|
4587
|
-
this.selfRef.current.style.setProperty(
|
|
5343
|
+
this.selfRef.current.style.setProperty(
|
|
5344
|
+
"--font-family",
|
|
5345
|
+
this.props.font.family
|
|
5346
|
+
);
|
|
4588
5347
|
}
|
|
4589
5348
|
}
|
|
4590
5349
|
if (this.props.font.style) {
|
|
@@ -4617,7 +5376,10 @@ var Layout = class extends React16.Component {
|
|
|
4617
5376
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
4618
5377
|
this.updateRect(entries[0].contentRect);
|
|
4619
5378
|
});
|
|
4620
|
-
this.
|
|
5379
|
+
const selfRefCurr = this.selfRef.current;
|
|
5380
|
+
if (selfRefCurr) {
|
|
5381
|
+
this.resizeObserver.observe(selfRefCurr);
|
|
5382
|
+
}
|
|
4621
5383
|
}
|
|
4622
5384
|
/** @internal */
|
|
4623
5385
|
componentDidUpdate() {
|
|
@@ -4636,7 +5398,7 @@ var Layout = class extends React16.Component {
|
|
|
4636
5398
|
}
|
|
4637
5399
|
/** @internal */
|
|
4638
5400
|
getDomRect() {
|
|
4639
|
-
return this.selfRef.current
|
|
5401
|
+
return this.selfRef.current?.getBoundingClientRect();
|
|
4640
5402
|
}
|
|
4641
5403
|
/** @internal */
|
|
4642
5404
|
getRootDiv() {
|
|
@@ -4660,7 +5422,10 @@ var Layout = class extends React16.Component {
|
|
|
4660
5422
|
}
|
|
4661
5423
|
/** @internal */
|
|
4662
5424
|
componentWillUnmount() {
|
|
4663
|
-
this.
|
|
5425
|
+
const selfRefCurr = this.selfRef.current;
|
|
5426
|
+
if (selfRefCurr) {
|
|
5427
|
+
this.resizeObserver?.unobserve(selfRefCurr);
|
|
5428
|
+
}
|
|
4664
5429
|
}
|
|
4665
5430
|
/** @internal */
|
|
4666
5431
|
setEditingTab(tabNode) {
|
|
@@ -4673,9 +5438,18 @@ var Layout = class extends React16.Component {
|
|
|
4673
5438
|
/** @internal */
|
|
4674
5439
|
render() {
|
|
4675
5440
|
if (!this.selfRef.current) {
|
|
4676
|
-
return /* @__PURE__ */ React16.createElement(
|
|
5441
|
+
return /* @__PURE__ */ React16.createElement(
|
|
5442
|
+
"div",
|
|
5443
|
+
{
|
|
5444
|
+
ref: this.selfRef,
|
|
5445
|
+
className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */)
|
|
5446
|
+
},
|
|
5447
|
+
this.metricsElements()
|
|
5448
|
+
);
|
|
4677
5449
|
}
|
|
4678
|
-
this.props.model._setPointerFine(
|
|
5450
|
+
this.props.model._setPointerFine(
|
|
5451
|
+
window && window.matchMedia && window.matchMedia("(pointer: fine)").matches
|
|
5452
|
+
);
|
|
4679
5453
|
const borderComponents = [];
|
|
4680
5454
|
const tabSetComponents = [];
|
|
4681
5455
|
const floatingWindows = [];
|
|
@@ -4688,8 +5462,21 @@ var Layout = class extends React16.Component {
|
|
|
4688
5462
|
};
|
|
4689
5463
|
this.props.model._setShowHiddenBorder(this.state.showHiddenBorder);
|
|
4690
5464
|
this.centerRect = this.props.model._layout(this.state.rect, metrics);
|
|
4691
|
-
this.renderBorder(
|
|
4692
|
-
|
|
5465
|
+
this.renderBorder(
|
|
5466
|
+
this.props.model.getBorderSet(),
|
|
5467
|
+
borderComponents,
|
|
5468
|
+
tabComponents,
|
|
5469
|
+
floatingWindows,
|
|
5470
|
+
splitterComponents
|
|
5471
|
+
);
|
|
5472
|
+
this.renderChildren(
|
|
5473
|
+
"",
|
|
5474
|
+
this.props.model.getRoot(),
|
|
5475
|
+
tabSetComponents,
|
|
5476
|
+
tabComponents,
|
|
5477
|
+
floatingWindows,
|
|
5478
|
+
splitterComponents
|
|
5479
|
+
);
|
|
4693
5480
|
const nextTopIds = [];
|
|
4694
5481
|
const nextTopIdsMap = {};
|
|
4695
5482
|
for (const t of this.tabIds) {
|
|
@@ -4712,19 +5499,131 @@ var Layout = class extends React16.Component {
|
|
|
4712
5499
|
const offset = this.edgeRectLength / 2;
|
|
4713
5500
|
const className = this.getClassName("flexlayout__edge_rect" /* FLEXLAYOUT__EDGE_RECT */);
|
|
4714
5501
|
const radius = 50;
|
|
4715
|
-
edges.push(
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
5502
|
+
edges.push(
|
|
5503
|
+
/* @__PURE__ */ React16.createElement(
|
|
5504
|
+
"div",
|
|
5505
|
+
{
|
|
5506
|
+
key: "North",
|
|
5507
|
+
style: {
|
|
5508
|
+
top: r.y,
|
|
5509
|
+
left: r.x + r.width / 2 - offset,
|
|
5510
|
+
width: length,
|
|
5511
|
+
height: width,
|
|
5512
|
+
borderBottomLeftRadius: radius,
|
|
5513
|
+
borderBottomRightRadius: radius
|
|
5514
|
+
},
|
|
5515
|
+
className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */)
|
|
5516
|
+
}
|
|
5517
|
+
)
|
|
5518
|
+
);
|
|
5519
|
+
edges.push(
|
|
5520
|
+
/* @__PURE__ */ React16.createElement(
|
|
5521
|
+
"div",
|
|
5522
|
+
{
|
|
5523
|
+
key: "West",
|
|
5524
|
+
style: {
|
|
5525
|
+
top: r.y + r.height / 2 - offset,
|
|
5526
|
+
left: r.x,
|
|
5527
|
+
width,
|
|
5528
|
+
height: length,
|
|
5529
|
+
borderTopRightRadius: radius,
|
|
5530
|
+
borderBottomRightRadius: radius
|
|
5531
|
+
},
|
|
5532
|
+
className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */)
|
|
5533
|
+
}
|
|
5534
|
+
)
|
|
5535
|
+
);
|
|
5536
|
+
edges.push(
|
|
5537
|
+
/* @__PURE__ */ React16.createElement(
|
|
5538
|
+
"div",
|
|
5539
|
+
{
|
|
5540
|
+
key: "South",
|
|
5541
|
+
style: {
|
|
5542
|
+
top: r.y + r.height - width,
|
|
5543
|
+
left: r.x + r.width / 2 - offset,
|
|
5544
|
+
width: length,
|
|
5545
|
+
height: width,
|
|
5546
|
+
borderTopLeftRadius: radius,
|
|
5547
|
+
borderTopRightRadius: radius
|
|
5548
|
+
},
|
|
5549
|
+
className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */)
|
|
5550
|
+
}
|
|
5551
|
+
)
|
|
5552
|
+
);
|
|
5553
|
+
edges.push(
|
|
5554
|
+
/* @__PURE__ */ React16.createElement(
|
|
5555
|
+
"div",
|
|
5556
|
+
{
|
|
5557
|
+
key: "East",
|
|
5558
|
+
style: {
|
|
5559
|
+
top: r.y + r.height / 2 - offset,
|
|
5560
|
+
left: r.x + r.width - width,
|
|
5561
|
+
width,
|
|
5562
|
+
height: length,
|
|
5563
|
+
borderTopLeftRadius: radius,
|
|
5564
|
+
borderBottomLeftRadius: radius
|
|
5565
|
+
},
|
|
5566
|
+
className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */)
|
|
5567
|
+
}
|
|
5568
|
+
)
|
|
5569
|
+
);
|
|
4719
5570
|
}
|
|
4720
|
-
return /* @__PURE__ */ React16.createElement(
|
|
4721
|
-
|
|
4722
|
-
|
|
5571
|
+
return /* @__PURE__ */ React16.createElement(
|
|
5572
|
+
"div",
|
|
5573
|
+
{
|
|
5574
|
+
ref: this.selfRef,
|
|
5575
|
+
className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */),
|
|
5576
|
+
onDragEnter: this.props.onExternalDrag ? this.onDragEnter : void 0
|
|
5577
|
+
},
|
|
5578
|
+
tabSetComponents,
|
|
5579
|
+
this.tabIds.map((t) => {
|
|
5580
|
+
return tabComponents[t];
|
|
5581
|
+
}),
|
|
5582
|
+
borderComponents,
|
|
5583
|
+
splitterComponents,
|
|
5584
|
+
edges,
|
|
5585
|
+
floatingWindows,
|
|
5586
|
+
this.metricsElements(),
|
|
5587
|
+
this.state.portal
|
|
5588
|
+
);
|
|
4723
5589
|
}
|
|
4724
5590
|
/** @internal */
|
|
4725
5591
|
metricsElements() {
|
|
4726
5592
|
const fontStyle = this.styleFont({ visibility: "hidden" });
|
|
4727
|
-
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
5593
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
5594
|
+
"div",
|
|
5595
|
+
{
|
|
5596
|
+
key: "findHeaderBarSize",
|
|
5597
|
+
ref: this.findHeaderBarSizeRef,
|
|
5598
|
+
style: fontStyle,
|
|
5599
|
+
className: this.getClassName(
|
|
5600
|
+
"flexlayout__tabset_header_sizer" /* FLEXLAYOUT__TABSET_HEADER_SIZER */
|
|
5601
|
+
)
|
|
5602
|
+
},
|
|
5603
|
+
"FindHeaderBarSize"
|
|
5604
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5605
|
+
"div",
|
|
5606
|
+
{
|
|
5607
|
+
key: "findTabBarSize",
|
|
5608
|
+
ref: this.findTabBarSizeRef,
|
|
5609
|
+
style: fontStyle,
|
|
5610
|
+
className: this.getClassName(
|
|
5611
|
+
"flexlayout__tabset_sizer" /* FLEXLAYOUT__TABSET_SIZER */
|
|
5612
|
+
)
|
|
5613
|
+
},
|
|
5614
|
+
"FindTabBarSize"
|
|
5615
|
+
), /* @__PURE__ */ React16.createElement(
|
|
5616
|
+
"div",
|
|
5617
|
+
{
|
|
5618
|
+
key: "findBorderBarSize",
|
|
5619
|
+
ref: this.findBorderBarSizeRef,
|
|
5620
|
+
style: fontStyle,
|
|
5621
|
+
className: this.getClassName(
|
|
5622
|
+
"flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */
|
|
5623
|
+
)
|
|
5624
|
+
},
|
|
5625
|
+
"FindBorderBarSize"
|
|
5626
|
+
));
|
|
4728
5627
|
}
|
|
4729
5628
|
/** @internal */
|
|
4730
5629
|
renderBorder(borderSet, borderComponents, tabComponents, floatingWindows, splitterComponents) {
|
|
@@ -4751,17 +5650,29 @@ var Layout = class extends React16.Component {
|
|
|
4751
5650
|
for (const child of drawChildren) {
|
|
4752
5651
|
if (child instanceof SplitterNode) {
|
|
4753
5652
|
let path = borderPath + "/s";
|
|
4754
|
-
splitterComponents.push(
|
|
5653
|
+
splitterComponents.push(
|
|
5654
|
+
/* @__PURE__ */ React16.createElement(
|
|
5655
|
+
Splitter,
|
|
5656
|
+
{
|
|
5657
|
+
key: child.getId(),
|
|
5658
|
+
layout: this,
|
|
5659
|
+
node: child,
|
|
5660
|
+
path
|
|
5661
|
+
}
|
|
5662
|
+
)
|
|
5663
|
+
);
|
|
4755
5664
|
} else if (child instanceof TabNode) {
|
|
4756
5665
|
let path = borderPath + "/t" + tabCount++;
|
|
4757
5666
|
if (this.supportsPopout && child.isFloating()) {
|
|
4758
5667
|
const rect = this._getScreenRect(child);
|
|
4759
5668
|
const tabBorderWidth = child._getAttr("borderWidth");
|
|
4760
5669
|
const tabBorderHeight = child._getAttr("borderHeight");
|
|
4761
|
-
if (
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
5670
|
+
if (rect) {
|
|
5671
|
+
if (tabBorderWidth !== -1 && border.getLocation().getOrientation() === Orientation.HORZ) {
|
|
5672
|
+
rect.width = tabBorderWidth;
|
|
5673
|
+
} else if (tabBorderHeight !== -1 && border.getLocation().getOrientation() === Orientation.VERT) {
|
|
5674
|
+
rect.height = tabBorderHeight;
|
|
5675
|
+
}
|
|
4765
5676
|
}
|
|
4766
5677
|
floatingWindows.push(
|
|
4767
5678
|
/* @__PURE__ */ React16.createElement(
|
|
@@ -4775,7 +5686,14 @@ var Layout = class extends React16.Component {
|
|
|
4775
5686
|
onSetWindow: this.onSetWindow,
|
|
4776
5687
|
onCloseWindow: this.onCloseWindow
|
|
4777
5688
|
},
|
|
4778
|
-
/* @__PURE__ */ React16.createElement(
|
|
5689
|
+
/* @__PURE__ */ React16.createElement(
|
|
5690
|
+
FloatingWindowTab,
|
|
5691
|
+
{
|
|
5692
|
+
layout: this,
|
|
5693
|
+
node: child,
|
|
5694
|
+
factory: this.props.factory
|
|
5695
|
+
}
|
|
5696
|
+
)
|
|
4779
5697
|
)
|
|
4780
5698
|
);
|
|
4781
5699
|
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
@@ -4816,11 +5734,41 @@ var Layout = class extends React16.Component {
|
|
|
4816
5734
|
for (const child of drawChildren) {
|
|
4817
5735
|
if (child instanceof SplitterNode) {
|
|
4818
5736
|
const newPath = path + "/s" + splitterCount++;
|
|
4819
|
-
splitterComponents.push(
|
|
5737
|
+
splitterComponents.push(
|
|
5738
|
+
/* @__PURE__ */ React16.createElement(
|
|
5739
|
+
Splitter,
|
|
5740
|
+
{
|
|
5741
|
+
key: child.getId(),
|
|
5742
|
+
layout: this,
|
|
5743
|
+
path: newPath,
|
|
5744
|
+
node: child
|
|
5745
|
+
}
|
|
5746
|
+
)
|
|
5747
|
+
);
|
|
4820
5748
|
} else if (child instanceof TabSetNode) {
|
|
4821
5749
|
const newPath = path + "/ts" + rowCount++;
|
|
4822
|
-
tabSetComponents.push(
|
|
4823
|
-
|
|
5750
|
+
tabSetComponents.push(
|
|
5751
|
+
/* @__PURE__ */ React16.createElement(
|
|
5752
|
+
TabSet,
|
|
5753
|
+
{
|
|
5754
|
+
key: child.getId(),
|
|
5755
|
+
layout: this,
|
|
5756
|
+
path: newPath,
|
|
5757
|
+
node: child,
|
|
5758
|
+
iconFactory: this.props.iconFactory,
|
|
5759
|
+
titleFactory: this.props.titleFactory,
|
|
5760
|
+
icons: this.icons
|
|
5761
|
+
}
|
|
5762
|
+
)
|
|
5763
|
+
);
|
|
5764
|
+
this.renderChildren(
|
|
5765
|
+
newPath,
|
|
5766
|
+
child,
|
|
5767
|
+
tabSetComponents,
|
|
5768
|
+
tabComponents,
|
|
5769
|
+
floatingWindows,
|
|
5770
|
+
splitterComponents
|
|
5771
|
+
);
|
|
4824
5772
|
} else if (child instanceof TabNode) {
|
|
4825
5773
|
const newPath = path + "/t" + tabCount++;
|
|
4826
5774
|
const selectedTab = child.getParent().getChildren()[child.getParent().getSelected()];
|
|
@@ -4841,16 +5789,49 @@ var Layout = class extends React16.Component {
|
|
|
4841
5789
|
onSetWindow: this.onSetWindow,
|
|
4842
5790
|
onCloseWindow: this.onCloseWindow
|
|
4843
5791
|
},
|
|
4844
|
-
/* @__PURE__ */ React16.createElement(
|
|
5792
|
+
/* @__PURE__ */ React16.createElement(
|
|
5793
|
+
FloatingWindowTab,
|
|
5794
|
+
{
|
|
5795
|
+
layout: this,
|
|
5796
|
+
node: child,
|
|
5797
|
+
factory: this.props.factory
|
|
5798
|
+
}
|
|
5799
|
+
)
|
|
4845
5800
|
)
|
|
4846
5801
|
);
|
|
4847
|
-
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5802
|
+
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5803
|
+
TabFloating,
|
|
5804
|
+
{
|
|
5805
|
+
key: child.getId(),
|
|
5806
|
+
layout: this,
|
|
5807
|
+
path: newPath,
|
|
5808
|
+
node: child,
|
|
5809
|
+
selected: child === selectedTab
|
|
5810
|
+
}
|
|
5811
|
+
);
|
|
4848
5812
|
} else {
|
|
4849
|
-
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5813
|
+
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5814
|
+
Tab,
|
|
5815
|
+
{
|
|
5816
|
+
key: child.getId(),
|
|
5817
|
+
layout: this,
|
|
5818
|
+
path: newPath,
|
|
5819
|
+
node: child,
|
|
5820
|
+
selected: child === selectedTab,
|
|
5821
|
+
factory: this.props.factory
|
|
5822
|
+
}
|
|
5823
|
+
);
|
|
4850
5824
|
}
|
|
4851
5825
|
} else {
|
|
4852
5826
|
const newPath = path + (child.getOrientation() === Orientation.HORZ ? "/r" : "/c") + rowCount++;
|
|
4853
|
-
this.renderChildren(
|
|
5827
|
+
this.renderChildren(
|
|
5828
|
+
newPath,
|
|
5829
|
+
child,
|
|
5830
|
+
tabSetComponents,
|
|
5831
|
+
tabComponents,
|
|
5832
|
+
floatingWindows,
|
|
5833
|
+
splitterComponents
|
|
5834
|
+
);
|
|
4854
5835
|
}
|
|
4855
5836
|
}
|
|
4856
5837
|
}
|
|
@@ -4858,8 +5839,17 @@ var Layout = class extends React16.Component {
|
|
|
4858
5839
|
_getScreenRect(node) {
|
|
4859
5840
|
const rect = node.getRect().clone();
|
|
4860
5841
|
const bodyRect = this.selfRef.current.getBoundingClientRect();
|
|
4861
|
-
|
|
4862
|
-
|
|
5842
|
+
if (!bodyRect) {
|
|
5843
|
+
return null;
|
|
5844
|
+
}
|
|
5845
|
+
const navHeight = Math.min(
|
|
5846
|
+
80,
|
|
5847
|
+
this.currentWindow.outerHeight - this.currentWindow.innerHeight
|
|
5848
|
+
);
|
|
5849
|
+
const navWidth = Math.min(
|
|
5850
|
+
80,
|
|
5851
|
+
this.currentWindow.outerWidth - this.currentWindow.innerWidth
|
|
5852
|
+
);
|
|
4863
5853
|
rect.x = rect.x + bodyRect.x + this.currentWindow.screenX + navWidth;
|
|
4864
5854
|
rect.y = rect.y + bodyRect.y + this.currentWindow.screenY + navHeight;
|
|
4865
5855
|
return rect;
|
|
@@ -4872,7 +5862,9 @@ var Layout = class extends React16.Component {
|
|
|
4872
5862
|
addTabToTabSet(tabsetId, json) {
|
|
4873
5863
|
const tabsetNode = this.props.model.getNodeById(tabsetId);
|
|
4874
5864
|
if (tabsetNode !== void 0) {
|
|
4875
|
-
this.doAction(
|
|
5865
|
+
this.doAction(
|
|
5866
|
+
Actions.addNode(json, tabsetId, DockLocation.CENTER, -1)
|
|
5867
|
+
);
|
|
4876
5868
|
}
|
|
4877
5869
|
}
|
|
4878
5870
|
/**
|
|
@@ -4882,7 +5874,14 @@ var Layout = class extends React16.Component {
|
|
|
4882
5874
|
addTabToActiveTabSet(json) {
|
|
4883
5875
|
const tabsetNode = this.props.model.getActiveTabset();
|
|
4884
5876
|
if (tabsetNode !== void 0) {
|
|
4885
|
-
this.doAction(
|
|
5877
|
+
this.doAction(
|
|
5878
|
+
Actions.addNode(
|
|
5879
|
+
json,
|
|
5880
|
+
tabsetNode.getId(),
|
|
5881
|
+
DockLocation.CENTER,
|
|
5882
|
+
-1
|
|
5883
|
+
)
|
|
5884
|
+
);
|
|
4886
5885
|
}
|
|
4887
5886
|
}
|
|
4888
5887
|
/**
|
|
@@ -4894,7 +5893,14 @@ var Layout = class extends React16.Component {
|
|
|
4894
5893
|
addTabWithDragAndDrop(dragText, json, onDrop) {
|
|
4895
5894
|
this.fnNewNodeDropped = onDrop;
|
|
4896
5895
|
this.newTabJson = json;
|
|
4897
|
-
this.dragStart(
|
|
5896
|
+
this.dragStart(
|
|
5897
|
+
void 0,
|
|
5898
|
+
dragText,
|
|
5899
|
+
TabNode._fromJson(json, this.props.model, false),
|
|
5900
|
+
true,
|
|
5901
|
+
void 0,
|
|
5902
|
+
void 0
|
|
5903
|
+
);
|
|
4898
5904
|
}
|
|
4899
5905
|
/**
|
|
4900
5906
|
* Move a tab/tabset using drag and drop
|
|
@@ -4918,20 +5924,32 @@ var Layout = class extends React16.Component {
|
|
|
4918
5924
|
DragDrop.instance.addGlass(this.onCancelAdd);
|
|
4919
5925
|
this.dragDivText = dragText;
|
|
4920
5926
|
this.dragDiv = this.currentDocument.createElement("div");
|
|
4921
|
-
this.dragDiv.className = this.getClassName(
|
|
5927
|
+
this.dragDiv.className = this.getClassName(
|
|
5928
|
+
"flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
|
|
5929
|
+
);
|
|
4922
5930
|
this.dragDiv.addEventListener("mousedown", this.onDragDivMouseDown);
|
|
4923
|
-
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, {
|
|
4924
|
-
|
|
4925
|
-
if (this.dragDiv) {
|
|
4926
|
-
this.dragDiv.style.visibility = "visible";
|
|
4927
|
-
const domRect = this.dragDiv.getBoundingClientRect();
|
|
4928
|
-
const r = new Rect(0, 0, domRect?.width, domRect?.height);
|
|
4929
|
-
r.centerInRect(this.state.rect);
|
|
4930
|
-
this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
|
|
4931
|
-
this.dragDiv.style.left = r.x + "px";
|
|
4932
|
-
this.dragDiv.style.top = r.y + "px";
|
|
4933
|
-
}
|
|
5931
|
+
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, {
|
|
5932
|
+
passive: false
|
|
4934
5933
|
});
|
|
5934
|
+
this.dragRectRender(
|
|
5935
|
+
this.dragDivText,
|
|
5936
|
+
void 0,
|
|
5937
|
+
this.newTabJson,
|
|
5938
|
+
() => {
|
|
5939
|
+
if (this.dragDiv) {
|
|
5940
|
+
this.dragDiv.style.visibility = "visible";
|
|
5941
|
+
const domRect = this.dragDiv.getBoundingClientRect();
|
|
5942
|
+
const r = new Rect(0, 0, domRect?.width, domRect?.height);
|
|
5943
|
+
r.centerInRect(this.state.rect);
|
|
5944
|
+
this.dragDiv.setAttribute(
|
|
5945
|
+
"data-layout-path",
|
|
5946
|
+
"/drag-rectangle"
|
|
5947
|
+
);
|
|
5948
|
+
this.dragDiv.style.left = r.x + "px";
|
|
5949
|
+
this.dragDiv.style.top = r.y + "px";
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
);
|
|
4935
5953
|
const rootdiv = this.selfRef.current;
|
|
4936
5954
|
rootdiv.appendChild(this.dragDiv);
|
|
4937
5955
|
}
|
|
@@ -4947,10 +5965,22 @@ var Layout = class extends React16.Component {
|
|
|
4947
5965
|
if (selected && tabRect?.contains(pos.x, pos.y)) {
|
|
4948
5966
|
let customDrop = void 0;
|
|
4949
5967
|
try {
|
|
4950
|
-
const dest = this.onTabDrag(
|
|
5968
|
+
const dest = this.onTabDrag(
|
|
5969
|
+
dragging,
|
|
5970
|
+
selected,
|
|
5971
|
+
pos.x - tabRect.x,
|
|
5972
|
+
pos.y - tabRect.y,
|
|
5973
|
+
dropInfo.location,
|
|
5974
|
+
() => this.onDragMove(event)
|
|
5975
|
+
);
|
|
4951
5976
|
if (dest) {
|
|
4952
5977
|
customDrop = {
|
|
4953
|
-
rect: new Rect(
|
|
5978
|
+
rect: new Rect(
|
|
5979
|
+
dest.x + tabRect.x,
|
|
5980
|
+
dest.y + tabRect.y,
|
|
5981
|
+
dest.width,
|
|
5982
|
+
dest.height
|
|
5983
|
+
),
|
|
4954
5984
|
callback: dest.callback,
|
|
4955
5985
|
invalidated: dest.invalidated,
|
|
4956
5986
|
dragging,
|
|
@@ -4971,14 +6001,20 @@ var Layout = class extends React16.Component {
|
|
|
4971
6001
|
}
|
|
4972
6002
|
}
|
|
4973
6003
|
this.dropInfo = dropInfo;
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
6004
|
+
if (this.outlineDiv) {
|
|
6005
|
+
this.outlineDiv.className = this.getClassName(
|
|
6006
|
+
this.customDrop ? "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */ : dropInfo.className
|
|
6007
|
+
);
|
|
6008
|
+
if (this.customDrop) {
|
|
6009
|
+
this.customDrop.rect.positionElement(this.outlineDiv);
|
|
6010
|
+
} else {
|
|
6011
|
+
dropInfo.rect.positionElement(this.outlineDiv);
|
|
6012
|
+
}
|
|
4979
6013
|
}
|
|
4980
6014
|
DragDrop.instance.setGlassCursorOverride(this.customDrop?.cursor);
|
|
4981
|
-
this.outlineDiv
|
|
6015
|
+
if (this.outlineDiv) {
|
|
6016
|
+
this.outlineDiv.style.visibility = "visible";
|
|
6017
|
+
}
|
|
4982
6018
|
try {
|
|
4983
6019
|
invalidated?.();
|
|
4984
6020
|
} catch (e) {
|
|
@@ -4993,7 +6029,14 @@ var Layout = class extends React16.Component {
|
|
|
4993
6029
|
if (drag) {
|
|
4994
6030
|
this.fnNewNodeDropped = drag.onDrop;
|
|
4995
6031
|
this.newTabJson = drag.json;
|
|
4996
|
-
this.dragStart(
|
|
6032
|
+
this.dragStart(
|
|
6033
|
+
event,
|
|
6034
|
+
drag.dragText,
|
|
6035
|
+
TabNode._fromJson(drag.json, this.props.model, false),
|
|
6036
|
+
true,
|
|
6037
|
+
void 0,
|
|
6038
|
+
void 0
|
|
6039
|
+
);
|
|
4997
6040
|
}
|
|
4998
6041
|
}
|
|
4999
6042
|
/** @internal */
|
|
@@ -5088,7 +6131,9 @@ var BorderSet = class _BorderSet {
|
|
|
5088
6131
|
/** @internal */
|
|
5089
6132
|
static _fromJson(json, model) {
|
|
5090
6133
|
const borderSet = new _BorderSet(model);
|
|
5091
|
-
borderSet._borders = json.map(
|
|
6134
|
+
borderSet._borders = json.map(
|
|
6135
|
+
(borderJson) => BorderNode._fromJson(borderJson, model)
|
|
6136
|
+
);
|
|
5092
6137
|
return borderSet;
|
|
5093
6138
|
}
|
|
5094
6139
|
/** @internal */
|
|
@@ -5122,7 +6167,9 @@ var BorderSet = class _BorderSet {
|
|
|
5122
6167
|
let sumWidth = 0;
|
|
5123
6168
|
let adjustableHeight = 0;
|
|
5124
6169
|
let adjustableWidth = 0;
|
|
5125
|
-
const showingBorders = this._borders.filter(
|
|
6170
|
+
const showingBorders = this._borders.filter(
|
|
6171
|
+
(border) => border.isShowing()
|
|
6172
|
+
);
|
|
5126
6173
|
for (const border of showingBorders) {
|
|
5127
6174
|
border._setAdjustedSize(border.getSize());
|
|
5128
6175
|
const visible = border.getSelected() !== -1;
|
|
@@ -5170,11 +6217,17 @@ var BorderSet = class _BorderSet {
|
|
|
5170
6217
|
}
|
|
5171
6218
|
}
|
|
5172
6219
|
for (const border of showingBorders) {
|
|
5173
|
-
outerInnerRects.outer = border._layoutBorderOuter(
|
|
6220
|
+
outerInnerRects.outer = border._layoutBorderOuter(
|
|
6221
|
+
outerInnerRects.outer,
|
|
6222
|
+
metrics
|
|
6223
|
+
);
|
|
5174
6224
|
}
|
|
5175
6225
|
outerInnerRects.inner = outerInnerRects.outer;
|
|
5176
6226
|
for (const border of showingBorders) {
|
|
5177
|
-
outerInnerRects.inner = border._layoutBorderInner(
|
|
6227
|
+
outerInnerRects.inner = border._layoutBorderInner(
|
|
6228
|
+
outerInnerRects.inner,
|
|
6229
|
+
metrics
|
|
6230
|
+
);
|
|
5178
6231
|
}
|
|
5179
6232
|
return outerInnerRects;
|
|
5180
6233
|
}
|
|
@@ -5200,7 +6253,10 @@ var Model = class _Model {
|
|
|
5200
6253
|
*/
|
|
5201
6254
|
constructor() {
|
|
5202
6255
|
/** @internal */
|
|
5203
|
-
this._borderRects = {
|
|
6256
|
+
this._borderRects = {
|
|
6257
|
+
inner: Rect.empty(),
|
|
6258
|
+
outer: Rect.empty()
|
|
6259
|
+
};
|
|
5204
6260
|
this._attributes = {};
|
|
5205
6261
|
this._idMap = {};
|
|
5206
6262
|
this._borders = new BorderSet(this);
|
|
@@ -5388,7 +6444,12 @@ var Model = class _Model {
|
|
|
5388
6444
|
const newNode = new TabNode(this, action.data.json, true);
|
|
5389
6445
|
const toNode = this._idMap[action.data.toNode];
|
|
5390
6446
|
if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
|
|
5391
|
-
toNode.drop(
|
|
6447
|
+
toNode.drop(
|
|
6448
|
+
newNode,
|
|
6449
|
+
DockLocation.getByName(action.data.location),
|
|
6450
|
+
action.data.index,
|
|
6451
|
+
action.data.select
|
|
6452
|
+
);
|
|
5392
6453
|
returnVal = newNode;
|
|
5393
6454
|
}
|
|
5394
6455
|
break;
|
|
@@ -5398,7 +6459,12 @@ var Model = class _Model {
|
|
|
5398
6459
|
if (fromNode instanceof TabNode || fromNode instanceof TabSetNode) {
|
|
5399
6460
|
const toNode = this._idMap[action.data.toNode];
|
|
5400
6461
|
if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
|
|
5401
|
-
toNode.drop(
|
|
6462
|
+
toNode.drop(
|
|
6463
|
+
fromNode,
|
|
6464
|
+
DockLocation.getByName(action.data.location),
|
|
6465
|
+
action.data.index,
|
|
6466
|
+
action.data.select
|
|
6467
|
+
);
|
|
5402
6468
|
}
|
|
5403
6469
|
}
|
|
5404
6470
|
break;
|
|
@@ -5485,8 +6551,16 @@ var Model = class _Model {
|
|
|
5485
6551
|
const node1 = this._idMap[action.data.node1];
|
|
5486
6552
|
const node2 = this._idMap[action.data.node2];
|
|
5487
6553
|
if ((node1 instanceof TabSetNode || node1 instanceof RowNode) && (node2 instanceof TabSetNode || node2 instanceof RowNode)) {
|
|
5488
|
-
this._adjustSplitSide(
|
|
5489
|
-
|
|
6554
|
+
this._adjustSplitSide(
|
|
6555
|
+
node1,
|
|
6556
|
+
action.data.weight1,
|
|
6557
|
+
action.data.pixelWidth1
|
|
6558
|
+
);
|
|
6559
|
+
this._adjustSplitSide(
|
|
6560
|
+
node2,
|
|
6561
|
+
action.data.weight2,
|
|
6562
|
+
action.data.pixelWidth2
|
|
6563
|
+
);
|
|
5490
6564
|
}
|
|
5491
6565
|
break;
|
|
5492
6566
|
}
|
|
@@ -5551,7 +6625,11 @@ var Model = class _Model {
|
|
|
5551
6625
|
this.visitNodes((node) => {
|
|
5552
6626
|
node._fireEvent("save", void 0);
|
|
5553
6627
|
});
|
|
5554
|
-
return {
|
|
6628
|
+
return {
|
|
6629
|
+
global,
|
|
6630
|
+
borders: this._borders._toJson(),
|
|
6631
|
+
layout: this._root.toJson()
|
|
6632
|
+
};
|
|
5555
6633
|
}
|
|
5556
6634
|
getSplitterSize() {
|
|
5557
6635
|
let splitterSize = this._attributes.splitterSize;
|
|
@@ -5573,7 +6651,9 @@ var Model = class _Model {
|
|
|
5573
6651
|
_addNode(node) {
|
|
5574
6652
|
const id = node.getId();
|
|
5575
6653
|
if (this._idMap[id] !== void 0) {
|
|
5576
|
-
throw new Error(
|
|
6654
|
+
throw new Error(
|
|
6655
|
+
`Error: each node must have a unique id, duplicate id:${node.getId()}`
|
|
6656
|
+
);
|
|
5577
6657
|
}
|
|
5578
6658
|
if (node.getType() !== "splitter") {
|
|
5579
6659
|
this._idMap[id] = node;
|
|
@@ -5581,8 +6661,13 @@ var Model = class _Model {
|
|
|
5581
6661
|
}
|
|
5582
6662
|
/** @internal */
|
|
5583
6663
|
_layout(rect, metrics) {
|
|
5584
|
-
this._borderRects = this._borders._layoutBorder(
|
|
5585
|
-
|
|
6664
|
+
this._borderRects = this._borders._layoutBorder(
|
|
6665
|
+
{ outer: rect, inner: rect },
|
|
6666
|
+
metrics
|
|
6667
|
+
);
|
|
6668
|
+
rect = this._borderRects.inner.removeInsets(
|
|
6669
|
+
this._getAttribute("marginInsets")
|
|
6670
|
+
);
|
|
5586
6671
|
this._root?.calcMinSize();
|
|
5587
6672
|
this._root._layout(rect, metrics);
|
|
5588
6673
|
return rect;
|
|
@@ -5626,7 +6711,7 @@ var Model = class _Model {
|
|
|
5626
6711
|
* set callback called when a new TabSet is created.
|
|
5627
6712
|
* The tabNode can be undefined if it's the auto created first tabset in the root row (when the last
|
|
5628
6713
|
* tab is deleted, the root tabset can be recreated)
|
|
5629
|
-
* @param onCreateTabSet
|
|
6714
|
+
* @param onCreateTabSet
|
|
5630
6715
|
*/
|
|
5631
6716
|
setOnCreateTabSet(onCreateTabSet) {
|
|
5632
6717
|
this._onCreateTabSet = onCreateTabSet;
|
|
@@ -5636,11 +6721,36 @@ var Model = class _Model {
|
|
|
5636
6721
|
return this._onCreateTabSet;
|
|
5637
6722
|
}
|
|
5638
6723
|
static toTypescriptInterfaces() {
|
|
5639
|
-
console.log(
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
6724
|
+
console.log(
|
|
6725
|
+
_Model._attributeDefinitions.toTypescriptInterface(
|
|
6726
|
+
"Global",
|
|
6727
|
+
void 0
|
|
6728
|
+
)
|
|
6729
|
+
);
|
|
6730
|
+
console.log(
|
|
6731
|
+
RowNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6732
|
+
"Row",
|
|
6733
|
+
_Model._attributeDefinitions
|
|
6734
|
+
)
|
|
6735
|
+
);
|
|
6736
|
+
console.log(
|
|
6737
|
+
TabSetNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6738
|
+
"TabSet",
|
|
6739
|
+
_Model._attributeDefinitions
|
|
6740
|
+
)
|
|
6741
|
+
);
|
|
6742
|
+
console.log(
|
|
6743
|
+
TabNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6744
|
+
"Tab",
|
|
6745
|
+
_Model._attributeDefinitions
|
|
6746
|
+
)
|
|
6747
|
+
);
|
|
6748
|
+
console.log(
|
|
6749
|
+
BorderNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6750
|
+
"Border",
|
|
6751
|
+
_Model._attributeDefinitions
|
|
6752
|
+
)
|
|
6753
|
+
);
|
|
5644
6754
|
}
|
|
5645
6755
|
toString() {
|
|
5646
6756
|
return JSON.stringify(this.toJson());
|