@aptre/flex-layout 0.1.6 → 0.1.7
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/README.md +73 -71
- package/dist/index.mjs +287 -1225
- package/package.json +1 -1
- package/style/_base.scss +21 -0
- package/style/dark.css +17 -0
- package/style/dark.css.map +1 -1
- package/style/dark.scss +6 -0
- package/style/gray.css +17 -0
- package/style/gray.css.map +1 -1
- package/style/gray.scss +6 -0
- package/style/light.css +17 -0
- package/style/light.css.map +1 -1
- package/style/light.scss +6 -0
- package/style/underline.css +17 -0
- package/style/underline.css.map +1 -1
- package/style/underline.scss +6 -0
- package/typedoc/assets/search.js +1 -1
- package/typedoc/classes/Layout.html +6 -4
- package/typedoc/classes/TabSetNode.html +8 -0
- package/typedoc/enums/CLASSES.html +5 -0
- package/typedoc/interfaces/IGlobalAttributes.html +5 -0
- package/typedoc/interfaces/IJsonTabSetNode.html +6 -0
- package/typedoc/interfaces/ITabSetAttributes.html +5 -0
package/dist/index.mjs
CHANGED
|
@@ -159,22 +159,12 @@ var DockLocation = class _DockLocation {
|
|
|
159
159
|
if (this === _DockLocation.TOP) {
|
|
160
160
|
return new Rect(r.x, r.y, r.width, r.height / 2);
|
|
161
161
|
} else if (this === _DockLocation.BOTTOM) {
|
|
162
|
-
return new Rect(
|
|
163
|
-
r.x,
|
|
164
|
-
r.getBottom() - r.height / 2,
|
|
165
|
-
r.width,
|
|
166
|
-
r.height / 2
|
|
167
|
-
);
|
|
162
|
+
return new Rect(r.x, r.getBottom() - r.height / 2, r.width, r.height / 2);
|
|
168
163
|
}
|
|
169
164
|
if (this === _DockLocation.LEFT) {
|
|
170
165
|
return new Rect(r.x, r.y, r.width / 2, r.height);
|
|
171
166
|
} else if (this === _DockLocation.RIGHT) {
|
|
172
|
-
return new Rect(
|
|
173
|
-
r.getRight() - r.width / 2,
|
|
174
|
-
r.y,
|
|
175
|
-
r.width / 2,
|
|
176
|
-
r.height
|
|
177
|
-
);
|
|
167
|
+
return new Rect(r.getRight() - r.width / 2, r.y, r.width / 2, r.height);
|
|
178
168
|
} else {
|
|
179
169
|
return r.clone();
|
|
180
170
|
}
|
|
@@ -183,39 +173,19 @@ var DockLocation = class _DockLocation {
|
|
|
183
173
|
split(rect, size) {
|
|
184
174
|
if (this === _DockLocation.TOP) {
|
|
185
175
|
const r1 = new Rect(rect.x, rect.y, rect.width, size);
|
|
186
|
-
const r2 = new Rect(
|
|
187
|
-
rect.x,
|
|
188
|
-
rect.y + size,
|
|
189
|
-
rect.width,
|
|
190
|
-
rect.height - size
|
|
191
|
-
);
|
|
176
|
+
const r2 = new Rect(rect.x, rect.y + size, rect.width, rect.height - size);
|
|
192
177
|
return { start: r1, end: r2 };
|
|
193
178
|
} else if (this === _DockLocation.LEFT) {
|
|
194
179
|
const r1 = new Rect(rect.x, rect.y, size, rect.height);
|
|
195
|
-
const r2 = new Rect(
|
|
196
|
-
rect.x + size,
|
|
197
|
-
rect.y,
|
|
198
|
-
rect.width - size,
|
|
199
|
-
rect.height
|
|
200
|
-
);
|
|
180
|
+
const r2 = new Rect(rect.x + size, rect.y, rect.width - size, rect.height);
|
|
201
181
|
return { start: r1, end: r2 };
|
|
202
182
|
}
|
|
203
183
|
if (this === _DockLocation.RIGHT) {
|
|
204
|
-
const r1 = new Rect(
|
|
205
|
-
rect.getRight() - size,
|
|
206
|
-
rect.y,
|
|
207
|
-
size,
|
|
208
|
-
rect.height
|
|
209
|
-
);
|
|
184
|
+
const r1 = new Rect(rect.getRight() - size, rect.y, size, rect.height);
|
|
210
185
|
const r2 = new Rect(rect.x, rect.y, rect.width - size, rect.height);
|
|
211
186
|
return { start: r1, end: r2 };
|
|
212
187
|
} else {
|
|
213
|
-
const r1 = new Rect(
|
|
214
|
-
rect.x,
|
|
215
|
-
rect.getBottom() - size,
|
|
216
|
-
rect.width,
|
|
217
|
-
size
|
|
218
|
-
);
|
|
188
|
+
const r1 = new Rect(rect.x, rect.getBottom() - size, rect.width, size);
|
|
219
189
|
const r2 = new Rect(rect.x, rect.y, rect.width, rect.height - size);
|
|
220
190
|
return { start: r1, end: r2 };
|
|
221
191
|
}
|
|
@@ -698,9 +668,7 @@ var Actions = class _Actions {
|
|
|
698
668
|
* @returns {Action} the action
|
|
699
669
|
*/
|
|
700
670
|
static setActiveTabset(tabsetNodeId) {
|
|
701
|
-
return new Action(_Actions.SET_ACTIVE_TABSET, {
|
|
702
|
-
tabsetNode: tabsetNodeId
|
|
703
|
-
});
|
|
671
|
+
return new Action(_Actions.SET_ACTIVE_TABSET, { tabsetNode: tabsetNodeId });
|
|
704
672
|
}
|
|
705
673
|
/**
|
|
706
674
|
* Adjust the splitter between two tabsets
|
|
@@ -739,9 +707,7 @@ var Actions = class _Actions {
|
|
|
739
707
|
* @returns {Action} the action
|
|
740
708
|
*/
|
|
741
709
|
static updateModelAttributes(attributes) {
|
|
742
|
-
return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, {
|
|
743
|
-
json: attributes
|
|
744
|
-
});
|
|
710
|
+
return new Action(_Actions.UPDATE_MODEL_ATTRIBUTES, { json: attributes });
|
|
745
711
|
}
|
|
746
712
|
/**
|
|
747
713
|
* Updates the given nodes json attributes
|
|
@@ -750,10 +716,7 @@ var Actions = class _Actions {
|
|
|
750
716
|
* @returns {Action} the action
|
|
751
717
|
*/
|
|
752
718
|
static updateNodeAttributes(nodeId, attributes) {
|
|
753
|
-
return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, {
|
|
754
|
-
node: nodeId,
|
|
755
|
-
json: attributes
|
|
756
|
-
});
|
|
719
|
+
return new Action(_Actions.UPDATE_NODE_ATTRIBUTES, { node: nodeId, json: attributes });
|
|
757
720
|
}
|
|
758
721
|
static floatTab(nodeId) {
|
|
759
722
|
return new Action(_Actions.FLOAT_TAB, { node: nodeId });
|
|
@@ -804,12 +767,7 @@ var AttributeDefinitions = class {
|
|
|
804
767
|
this.nameToAttribute = {};
|
|
805
768
|
}
|
|
806
769
|
addWithAll(name, modelName, defaultValue, alwaysWriteJson) {
|
|
807
|
-
const attr = new Attribute(
|
|
808
|
-
name,
|
|
809
|
-
modelName,
|
|
810
|
-
defaultValue,
|
|
811
|
-
alwaysWriteJson
|
|
812
|
-
);
|
|
770
|
+
const attr = new Attribute(name, modelName, defaultValue, alwaysWriteJson);
|
|
813
771
|
this.attributes.push(attr);
|
|
814
772
|
this.nameToAttribute[name] = attr;
|
|
815
773
|
return attr;
|
|
@@ -867,9 +825,7 @@ var AttributeDefinitions = class {
|
|
|
867
825
|
}
|
|
868
826
|
toTypescriptInterface(name, parentAttributes) {
|
|
869
827
|
const lines = [];
|
|
870
|
-
const sorted = this.attributes.sort(
|
|
871
|
-
(a, b) => a.name.localeCompare(b.name)
|
|
872
|
-
);
|
|
828
|
+
const sorted = this.attributes.sort((a, b) => a.name.localeCompare(b.name));
|
|
873
829
|
lines.push("export interface I" + name + "Attributes {");
|
|
874
830
|
for (let i = 0; i < sorted.length; i++) {
|
|
875
831
|
const c = sorted[i];
|
|
@@ -972,6 +928,7 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
|
|
|
972
928
|
CLASSES2["FLEXLAYOUT__TAB_BORDER"] = "flexlayout__tab_border";
|
|
973
929
|
CLASSES2["FLEXLAYOUT__TAB_BORDER_"] = "flexlayout__tab_border_";
|
|
974
930
|
CLASSES2["FLEXLAYOUT__TAB_BUTTON"] = "flexlayout__tab_button";
|
|
931
|
+
CLASSES2["FLEXLAYOUT__TAB_BUTTON_STRETCH"] = "flexlayout__tab_button_stretch";
|
|
975
932
|
CLASSES2["FLEXLAYOUT__TAB_BUTTON_CONTENT"] = "flexlayout__tab_button_content";
|
|
976
933
|
CLASSES2["FLEXLAYOUT__TAB_BUTTON_LEADING"] = "flexlayout__tab_button_leading";
|
|
977
934
|
CLASSES2["FLEXLAYOUT__TAB_BUTTON_OVERFLOW"] = "flexlayout__tab_button_overflow";
|
|
@@ -1558,9 +1515,7 @@ var RowNode = class _RowNode extends Node {
|
|
|
1558
1515
|
child._setTempSize(0);
|
|
1559
1516
|
} else {
|
|
1560
1517
|
const minSize = child.getMinSize(this.getOrientation());
|
|
1561
|
-
const size = Math.floor(
|
|
1562
|
-
availablePixels * (child.getWeight() / totalWeight)
|
|
1563
|
-
);
|
|
1518
|
+
const size = Math.floor(availablePixels * (child.getWeight() / totalWeight));
|
|
1564
1519
|
child._setTempSize(Math.max(minSize, size));
|
|
1565
1520
|
}
|
|
1566
1521
|
variableSize += child._getTempSize();
|
|
@@ -1574,9 +1529,7 @@ var RowNode = class _RowNode extends Node {
|
|
|
1574
1529
|
while (totalSizeGiven < pixelSize) {
|
|
1575
1530
|
for (const child of drawChildren) {
|
|
1576
1531
|
if (!(child instanceof SplitterNode)) {
|
|
1577
|
-
const prefSize = child._getPrefSize(
|
|
1578
|
-
this.getOrientation()
|
|
1579
|
-
);
|
|
1532
|
+
const prefSize = child._getPrefSize(this.getOrientation());
|
|
1580
1533
|
if (!child._isFixed() && (prefSize === void 0 || resizePreferred) && totalSizeGiven < pixelSize) {
|
|
1581
1534
|
child._setTempSize(child._getTempSize() + 1);
|
|
1582
1535
|
totalSizeGiven++;
|
|
@@ -1621,25 +1574,9 @@ var RowNode = class _RowNode extends Node {
|
|
|
1621
1574
|
let p = 0;
|
|
1622
1575
|
for (const child of drawChildren) {
|
|
1623
1576
|
if (this.getOrientation() === Orientation.HORZ) {
|
|
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
|
-
);
|
|
1577
|
+
child._layout(new Rect(this._rect.x + p, this._rect.y, child._getTempSize(), this._rect.height), metrics);
|
|
1633
1578
|
} else {
|
|
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
|
-
);
|
|
1579
|
+
child._layout(new Rect(this._rect.x, this._rect.y + p, this._rect.width, child._getTempSize()), metrics);
|
|
1643
1580
|
}
|
|
1644
1581
|
p += child._getTempSize();
|
|
1645
1582
|
}
|
|
@@ -1769,9 +1706,7 @@ var RowNode = class _RowNode extends Node {
|
|
|
1769
1706
|
}
|
|
1770
1707
|
for (let j = 0; j < subChildChildren.length; j++) {
|
|
1771
1708
|
const subsubChild = subChildChildren[j];
|
|
1772
|
-
subsubChild._setWeight(
|
|
1773
|
-
child.getWeight() * subsubChild.getWeight() / subChildrenTotal
|
|
1774
|
-
);
|
|
1709
|
+
subsubChild._setWeight(child.getWeight() * subsubChild.getWeight() / subChildrenTotal);
|
|
1775
1710
|
this._addChild(subsubChild, i + j);
|
|
1776
1711
|
}
|
|
1777
1712
|
} else {
|
|
@@ -1817,48 +1752,24 @@ var RowNode = class _RowNode extends Node {
|
|
|
1817
1752
|
const dockLocation = DockLocation.LEFT;
|
|
1818
1753
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1819
1754
|
outlineRect.width = outlineRect.width / 2;
|
|
1820
|
-
dropInfo = new DropInfo(
|
|
1821
|
-
this,
|
|
1822
|
-
outlineRect,
|
|
1823
|
-
dockLocation,
|
|
1824
|
-
-1,
|
|
1825
|
-
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1826
|
-
);
|
|
1755
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
|
|
1827
1756
|
} else if (x > this._rect.getRight() - margin && yy > h / 2 - half && yy < h / 2 + half) {
|
|
1828
1757
|
const dockLocation = DockLocation.RIGHT;
|
|
1829
1758
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1830
1759
|
outlineRect.width = outlineRect.width / 2;
|
|
1831
1760
|
outlineRect.x += outlineRect.width;
|
|
1832
|
-
dropInfo = new DropInfo(
|
|
1833
|
-
this,
|
|
1834
|
-
outlineRect,
|
|
1835
|
-
dockLocation,
|
|
1836
|
-
-1,
|
|
1837
|
-
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1838
|
-
);
|
|
1761
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
|
|
1839
1762
|
} else if (y < this._rect.y + margin && xx > w / 2 - half && xx < w / 2 + half) {
|
|
1840
1763
|
const dockLocation = DockLocation.TOP;
|
|
1841
1764
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1842
1765
|
outlineRect.height = outlineRect.height / 2;
|
|
1843
|
-
dropInfo = new DropInfo(
|
|
1844
|
-
this,
|
|
1845
|
-
outlineRect,
|
|
1846
|
-
dockLocation,
|
|
1847
|
-
-1,
|
|
1848
|
-
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1849
|
-
);
|
|
1766
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
|
|
1850
1767
|
} else if (y > this._rect.getBottom() - margin && xx > w / 2 - half && xx < w / 2 + half) {
|
|
1851
1768
|
const dockLocation = DockLocation.BOTTOM;
|
|
1852
1769
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
1853
1770
|
outlineRect.height = outlineRect.height / 2;
|
|
1854
1771
|
outlineRect.y += outlineRect.height;
|
|
1855
|
-
dropInfo = new DropInfo(
|
|
1856
|
-
this,
|
|
1857
|
-
outlineRect,
|
|
1858
|
-
dockLocation,
|
|
1859
|
-
-1,
|
|
1860
|
-
"flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */
|
|
1861
|
-
);
|
|
1772
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect_edge" /* FLEXLAYOUT__OUTLINE_RECT_EDGE */);
|
|
1862
1773
|
}
|
|
1863
1774
|
if (dropInfo !== void 0) {
|
|
1864
1775
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -1886,10 +1797,7 @@ var RowNode = class _RowNode extends Node {
|
|
|
1886
1797
|
tabSet = dragNode;
|
|
1887
1798
|
} else {
|
|
1888
1799
|
const callback = this._model._getOnCreateTabSet();
|
|
1889
|
-
tabSet = new TabSetNode(
|
|
1890
|
-
this._model,
|
|
1891
|
-
callback ? callback(dragNode) : {}
|
|
1892
|
-
);
|
|
1800
|
+
tabSet = new TabSetNode(this._model, callback ? callback(dragNode) : {});
|
|
1893
1801
|
tabSet._addChild(dragNode);
|
|
1894
1802
|
}
|
|
1895
1803
|
let size = this._children.reduce((sum, child) => {
|
|
@@ -2014,39 +1922,22 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2014
1922
|
attributeDefinitions.add("selected", 0).setType(Attribute.NUMBER);
|
|
2015
1923
|
attributeDefinitions.add("name", void 0).setType(Attribute.STRING);
|
|
2016
1924
|
attributeDefinitions.add("config", void 0).setType("any");
|
|
2017
|
-
attributeDefinitions.addInherited(
|
|
2018
|
-
"enableDeleteWhenEmpty",
|
|
2019
|
-
"tabSetEnableDeleteWhenEmpty"
|
|
2020
|
-
);
|
|
1925
|
+
attributeDefinitions.addInherited("enableDeleteWhenEmpty", "tabSetEnableDeleteWhenEmpty");
|
|
2021
1926
|
attributeDefinitions.addInherited("enableDrop", "tabSetEnableDrop");
|
|
2022
1927
|
attributeDefinitions.addInherited("enableDrag", "tabSetEnableDrag");
|
|
2023
1928
|
attributeDefinitions.addInherited("enableDivide", "tabSetEnableDivide");
|
|
2024
|
-
attributeDefinitions.addInherited(
|
|
2025
|
-
"enableMaximize",
|
|
2026
|
-
"tabSetEnableMaximize"
|
|
2027
|
-
);
|
|
1929
|
+
attributeDefinitions.addInherited("enableMaximize", "tabSetEnableMaximize");
|
|
2028
1930
|
attributeDefinitions.addInherited("enableClose", "tabSetEnableClose");
|
|
2029
|
-
attributeDefinitions.addInherited(
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
);
|
|
2033
|
-
attributeDefinitions.addInherited(
|
|
2034
|
-
"classNameHeader",
|
|
2035
|
-
"tabSetClassNameHeader"
|
|
2036
|
-
);
|
|
2037
|
-
attributeDefinitions.addInherited(
|
|
2038
|
-
"enableTabStrip",
|
|
2039
|
-
"tabSetEnableTabStrip"
|
|
2040
|
-
);
|
|
1931
|
+
attributeDefinitions.addInherited("enableSingleTabStretch", "tabSetEnableSingleTabStretch");
|
|
1932
|
+
attributeDefinitions.addInherited("classNameTabStrip", "tabSetClassNameTabStrip");
|
|
1933
|
+
attributeDefinitions.addInherited("classNameHeader", "tabSetClassNameHeader");
|
|
1934
|
+
attributeDefinitions.addInherited("enableTabStrip", "tabSetEnableTabStrip");
|
|
2041
1935
|
attributeDefinitions.addInherited("borderInsets", "tabSetBorderInsets");
|
|
2042
1936
|
attributeDefinitions.addInherited("marginInsets", "tabSetMarginInsets");
|
|
2043
1937
|
attributeDefinitions.addInherited("minWidth", "tabSetMinWidth");
|
|
2044
1938
|
attributeDefinitions.addInherited("minHeight", "tabSetMinHeight");
|
|
2045
1939
|
attributeDefinitions.addInherited("headerHeight", "tabSetHeaderHeight");
|
|
2046
|
-
attributeDefinitions.addInherited(
|
|
2047
|
-
"tabStripHeight",
|
|
2048
|
-
"tabSetTabStripHeight"
|
|
2049
|
-
);
|
|
1940
|
+
attributeDefinitions.addInherited("tabStripHeight", "tabSetTabStripHeight");
|
|
2050
1941
|
attributeDefinitions.addInherited("tabLocation", "tabSetTabLocation");
|
|
2051
1942
|
attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute.BOOLEAN);
|
|
2052
1943
|
return attributeDefinitions;
|
|
@@ -2125,6 +2016,9 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2125
2016
|
isEnableClose() {
|
|
2126
2017
|
return this._getAttr("enableClose");
|
|
2127
2018
|
}
|
|
2019
|
+
isEnableSingleTabStretch() {
|
|
2020
|
+
return this._getAttr("enableSingleTabStretch");
|
|
2021
|
+
}
|
|
2128
2022
|
canMaximize() {
|
|
2129
2023
|
if (this.isEnableMaximize()) {
|
|
2130
2024
|
if (this.getModel().getMaximizedTabset() === this) {
|
|
@@ -2190,30 +2084,14 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2190
2084
|
if (dragNode === this) {
|
|
2191
2085
|
const dockLocation = DockLocation.CENTER;
|
|
2192
2086
|
const outlineRect = this._tabHeaderRect;
|
|
2193
|
-
dropInfo = new DropInfo(
|
|
2194
|
-
this,
|
|
2195
|
-
outlineRect,
|
|
2196
|
-
dockLocation,
|
|
2197
|
-
-1,
|
|
2198
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2199
|
-
);
|
|
2087
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2200
2088
|
} else if (this._contentRect.contains(x, y)) {
|
|
2201
2089
|
let dockLocation = DockLocation.CENTER;
|
|
2202
2090
|
if (this._model.getMaximizedTabset() === void 0) {
|
|
2203
|
-
dockLocation = DockLocation.getLocation(
|
|
2204
|
-
this._contentRect,
|
|
2205
|
-
x,
|
|
2206
|
-
y
|
|
2207
|
-
);
|
|
2091
|
+
dockLocation = DockLocation.getLocation(this._contentRect, x, y);
|
|
2208
2092
|
}
|
|
2209
2093
|
const outlineRect = dockLocation.getDockRect(this._rect);
|
|
2210
|
-
dropInfo = new DropInfo(
|
|
2211
|
-
this,
|
|
2212
|
-
outlineRect,
|
|
2213
|
-
dockLocation,
|
|
2214
|
-
-1,
|
|
2215
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2216
|
-
);
|
|
2094
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2217
2095
|
} else if (this._tabHeaderRect != null && this._tabHeaderRect.contains(x, y)) {
|
|
2218
2096
|
let r;
|
|
2219
2097
|
let yy;
|
|
@@ -2237,13 +2115,7 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2237
2115
|
if (x >= p && x < childCenter) {
|
|
2238
2116
|
const dockLocation = DockLocation.CENTER;
|
|
2239
2117
|
const outlineRect = new Rect(r.x - 2, yy, 3, h);
|
|
2240
|
-
dropInfo = new DropInfo(
|
|
2241
|
-
this,
|
|
2242
|
-
outlineRect,
|
|
2243
|
-
dockLocation,
|
|
2244
|
-
i,
|
|
2245
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2246
|
-
);
|
|
2118
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2247
2119
|
break;
|
|
2248
2120
|
}
|
|
2249
2121
|
p = childCenter;
|
|
@@ -2252,13 +2124,7 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2252
2124
|
if (dropInfo == null) {
|
|
2253
2125
|
const dockLocation = DockLocation.CENTER;
|
|
2254
2126
|
const outlineRect = new Rect(r.getRight() - 2, yy, 3, h);
|
|
2255
|
-
dropInfo = new DropInfo(
|
|
2256
|
-
this,
|
|
2257
|
-
outlineRect,
|
|
2258
|
-
dockLocation,
|
|
2259
|
-
this._children.length,
|
|
2260
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2261
|
-
);
|
|
2127
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2262
2128
|
}
|
|
2263
2129
|
}
|
|
2264
2130
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -2285,31 +2151,16 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2285
2151
|
}
|
|
2286
2152
|
if (this.isEnableTabStrip()) {
|
|
2287
2153
|
if (this.getTabLocation() === "top") {
|
|
2288
|
-
this._tabHeaderRect = new Rect(
|
|
2289
|
-
rect.x,
|
|
2290
|
-
rect.y + y,
|
|
2291
|
-
rect.width,
|
|
2292
|
-
this._calculatedTabBarHeight
|
|
2293
|
-
);
|
|
2154
|
+
this._tabHeaderRect = new Rect(rect.x, rect.y + y, rect.width, this._calculatedTabBarHeight);
|
|
2294
2155
|
} else {
|
|
2295
|
-
this._tabHeaderRect = new Rect(
|
|
2296
|
-
rect.x,
|
|
2297
|
-
rect.y + rect.height - this._calculatedTabBarHeight,
|
|
2298
|
-
rect.width,
|
|
2299
|
-
this._calculatedTabBarHeight
|
|
2300
|
-
);
|
|
2156
|
+
this._tabHeaderRect = new Rect(rect.x, rect.y + rect.height - this._calculatedTabBarHeight, rect.width, this._calculatedTabBarHeight);
|
|
2301
2157
|
}
|
|
2302
2158
|
h += this._calculatedTabBarHeight;
|
|
2303
2159
|
if (this.getTabLocation() === "top") {
|
|
2304
2160
|
y += this._calculatedTabBarHeight;
|
|
2305
2161
|
}
|
|
2306
2162
|
}
|
|
2307
|
-
this._contentRect = new Rect(
|
|
2308
|
-
rect.x,
|
|
2309
|
-
rect.y + y,
|
|
2310
|
-
rect.width,
|
|
2311
|
-
rect.height - h
|
|
2312
|
-
);
|
|
2163
|
+
this._contentRect = new Rect(rect.x, rect.y + y, rect.width, rect.height - h);
|
|
2313
2164
|
for (let i = 0; i < this._children.length; i++) {
|
|
2314
2165
|
const child = this._children[i];
|
|
2315
2166
|
child._layout(this._contentRect, metrics);
|
|
@@ -2370,10 +2221,7 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
2370
2221
|
let tabSet;
|
|
2371
2222
|
if (dragNode instanceof TabNode) {
|
|
2372
2223
|
const callback = this._model._getOnCreateTabSet();
|
|
2373
|
-
tabSet = new _TabSetNode(
|
|
2374
|
-
this._model,
|
|
2375
|
-
callback ? callback(dragNode) : {}
|
|
2376
|
-
);
|
|
2224
|
+
tabSet = new _TabSetNode(this._model, callback ? callback(dragNode) : {});
|
|
2377
2225
|
tabSet._addChild(dragNode);
|
|
2378
2226
|
dragParent = tabSet;
|
|
2379
2227
|
} else {
|
|
@@ -2542,14 +2390,8 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2542
2390
|
attributeDefinitions.addInherited("barSize", "borderBarSize").setType(Attribute.NUMBER);
|
|
2543
2391
|
attributeDefinitions.addInherited("enableDrop", "borderEnableDrop").setType(Attribute.BOOLEAN);
|
|
2544
2392
|
attributeDefinitions.addInherited("className", "borderClassName").setType(Attribute.STRING);
|
|
2545
|
-
attributeDefinitions.addInherited(
|
|
2546
|
-
|
|
2547
|
-
"borderAutoSelectTabWhenOpen"
|
|
2548
|
-
).setType(Attribute.BOOLEAN);
|
|
2549
|
-
attributeDefinitions.addInherited(
|
|
2550
|
-
"autoSelectTabWhenClosed",
|
|
2551
|
-
"borderAutoSelectTabWhenClosed"
|
|
2552
|
-
).setType(Attribute.BOOLEAN);
|
|
2393
|
+
attributeDefinitions.addInherited("autoSelectTabWhenOpen", "borderAutoSelectTabWhenOpen").setType(Attribute.BOOLEAN);
|
|
2394
|
+
attributeDefinitions.addInherited("autoSelectTabWhenClosed", "borderAutoSelectTabWhenClosed").setType(Attribute.BOOLEAN);
|
|
2553
2395
|
attributeDefinitions.addInherited("size", "borderSize").setType(Attribute.NUMBER);
|
|
2554
2396
|
attributeDefinitions.addInherited("minSize", "borderMinSize").setType(Attribute.NUMBER);
|
|
2555
2397
|
attributeDefinitions.addInherited("enableAutoHide", "borderEnableAutoHide").setType(Attribute.BOOLEAN);
|
|
@@ -2702,10 +2544,7 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2702
2544
|
_layoutBorderInner(inner, metrics) {
|
|
2703
2545
|
this._drawChildren = [];
|
|
2704
2546
|
const location = this._location;
|
|
2705
|
-
const split1 = location.split(
|
|
2706
|
-
inner,
|
|
2707
|
-
this._adjustedSize + this._model.getSplitterSize()
|
|
2708
|
-
);
|
|
2547
|
+
const split1 = location.split(inner, this._adjustedSize + this._model.getSplitterSize());
|
|
2709
2548
|
const split2 = location.reflect().split(split1.start, this._model.getSplitterSize());
|
|
2710
2549
|
this._contentRect = split2.end;
|
|
2711
2550
|
for (let i = 0; i < this._children.length; i++) {
|
|
@@ -2752,52 +2591,19 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2752
2591
|
childRect = child.getTabRect();
|
|
2753
2592
|
childCenter = childRect.x + childRect.width / 2;
|
|
2754
2593
|
if (x >= pos && x < childCenter) {
|
|
2755
|
-
const outlineRect = new Rect(
|
|
2756
|
-
|
|
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
|
-
);
|
|
2594
|
+
const outlineRect = new Rect(childRect.x - 2, childY, 3, childHeight);
|
|
2595
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2768
2596
|
break;
|
|
2769
2597
|
}
|
|
2770
2598
|
pos = childCenter;
|
|
2771
2599
|
}
|
|
2772
2600
|
if (dropInfo == null) {
|
|
2773
|
-
const outlineRect = new Rect(
|
|
2774
|
-
|
|
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
|
-
);
|
|
2601
|
+
const outlineRect = new Rect(childRect.getRight() - 2, childY, 3, childHeight);
|
|
2602
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2786
2603
|
}
|
|
2787
2604
|
} else {
|
|
2788
|
-
const outlineRect = new Rect(
|
|
2789
|
-
|
|
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
|
-
);
|
|
2605
|
+
const outlineRect = new Rect(this._tabHeaderRect.x + 1, this._tabHeaderRect.y + 2, 3, 18);
|
|
2606
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2801
2607
|
}
|
|
2802
2608
|
} else {
|
|
2803
2609
|
if (this._children.length > 0) {
|
|
@@ -2812,52 +2618,19 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2812
2618
|
childRect = child.getTabRect();
|
|
2813
2619
|
childCenter = childRect.y + childRect.height / 2;
|
|
2814
2620
|
if (y >= pos && y < childCenter) {
|
|
2815
|
-
const outlineRect = new Rect(
|
|
2816
|
-
|
|
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
|
-
);
|
|
2621
|
+
const outlineRect = new Rect(childX, childRect.y - 2, childWidth, 3);
|
|
2622
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, i, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2828
2623
|
break;
|
|
2829
2624
|
}
|
|
2830
2625
|
pos = childCenter;
|
|
2831
2626
|
}
|
|
2832
2627
|
if (dropInfo == null) {
|
|
2833
|
-
const outlineRect = new Rect(
|
|
2834
|
-
|
|
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
|
-
);
|
|
2628
|
+
const outlineRect = new Rect(childX, childRect.getBottom() - 2, childWidth, 3);
|
|
2629
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2846
2630
|
}
|
|
2847
2631
|
} else {
|
|
2848
|
-
const outlineRect = new Rect(
|
|
2849
|
-
|
|
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
|
-
);
|
|
2632
|
+
const outlineRect = new Rect(this._tabHeaderRect.x + 2, this._tabHeaderRect.y + 1, 18, 3);
|
|
2633
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2861
2634
|
}
|
|
2862
2635
|
}
|
|
2863
2636
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
@@ -2865,13 +2638,7 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2865
2638
|
}
|
|
2866
2639
|
} else if (this.getSelected() !== -1 && this._contentRect.contains(x, y)) {
|
|
2867
2640
|
const outlineRect = this._contentRect;
|
|
2868
|
-
dropInfo = new DropInfo(
|
|
2869
|
-
this,
|
|
2870
|
-
outlineRect,
|
|
2871
|
-
dockLocation,
|
|
2872
|
-
-1,
|
|
2873
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
2874
|
-
);
|
|
2641
|
+
dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
2875
2642
|
if (!dragNode._canDockInto(dragNode, dropInfo)) {
|
|
2876
2643
|
return void 0;
|
|
2877
2644
|
}
|
|
@@ -2909,9 +2676,7 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2909
2676
|
const json = {};
|
|
2910
2677
|
_BorderNode._attributeDefinitions.toJson(json, this._attributes);
|
|
2911
2678
|
json.location = this._location.getName();
|
|
2912
|
-
json.children = this._children.map(
|
|
2913
|
-
(child) => child.toJson()
|
|
2914
|
-
);
|
|
2679
|
+
json.children = this._children.map((child) => child.toJson());
|
|
2915
2680
|
return json;
|
|
2916
2681
|
}
|
|
2917
2682
|
/** @internal */
|
|
@@ -2923,28 +2688,16 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
2923
2688
|
const rootRow = this._model.getRoot();
|
|
2924
2689
|
if (this._location === DockLocation.TOP) {
|
|
2925
2690
|
pBounds[0] = outerRect.y + minSize;
|
|
2926
|
-
pBounds[1] = Math.max(
|
|
2927
|
-
pBounds[0],
|
|
2928
|
-
innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight()
|
|
2929
|
-
);
|
|
2691
|
+
pBounds[1] = Math.max(pBounds[0], innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight());
|
|
2930
2692
|
} else if (this._location === DockLocation.LEFT) {
|
|
2931
2693
|
pBounds[0] = outerRect.x + minSize;
|
|
2932
|
-
pBounds[1] = Math.max(
|
|
2933
|
-
pBounds[0],
|
|
2934
|
-
innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth()
|
|
2935
|
-
);
|
|
2694
|
+
pBounds[1] = Math.max(pBounds[0], innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth());
|
|
2936
2695
|
} else if (this._location === DockLocation.BOTTOM) {
|
|
2937
2696
|
pBounds[1] = outerRect.getBottom() - splitter.getHeight() - minSize;
|
|
2938
|
-
pBounds[0] = Math.min(
|
|
2939
|
-
pBounds[1],
|
|
2940
|
-
innerRect.y + rootRow.getMinHeight()
|
|
2941
|
-
);
|
|
2697
|
+
pBounds[0] = Math.min(pBounds[1], innerRect.y + rootRow.getMinHeight());
|
|
2942
2698
|
} else if (this._location === DockLocation.RIGHT) {
|
|
2943
2699
|
pBounds[1] = outerRect.getRight() - splitter.getWidth() - minSize;
|
|
2944
|
-
pBounds[0] = Math.min(
|
|
2945
|
-
pBounds[1],
|
|
2946
|
-
innerRect.x + rootRow.getMinWidth()
|
|
2947
|
-
);
|
|
2700
|
+
pBounds[0] = Math.min(pBounds[1], innerRect.x + rootRow.getMinWidth());
|
|
2948
2701
|
}
|
|
2949
2702
|
return pBounds;
|
|
2950
2703
|
}
|
|
@@ -3026,36 +2779,13 @@ function getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle) {
|
|
|
3026
2779
|
}
|
|
3027
2780
|
if (leadingContent === void 0 && node.getIcon() !== void 0) {
|
|
3028
2781
|
if (iconAngle !== 0) {
|
|
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
|
-
);
|
|
2782
|
+
leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em", transform: "rotate(" + iconAngle + "deg)" }, src: node.getIcon(), alt: "leadingContent" });
|
|
3041
2783
|
} else {
|
|
3042
|
-
leadingContent = /* @__PURE__ */ React.createElement(
|
|
3043
|
-
"img",
|
|
3044
|
-
{
|
|
3045
|
-
style: { width: "1em", height: "1em" },
|
|
3046
|
-
src: node.getIcon(),
|
|
3047
|
-
alt: "leadingContent"
|
|
3048
|
-
}
|
|
3049
|
-
);
|
|
2784
|
+
leadingContent = /* @__PURE__ */ React.createElement("img", { style: { width: "1em", height: "1em" }, src: node.getIcon(), alt: "leadingContent" });
|
|
3050
2785
|
}
|
|
3051
2786
|
}
|
|
3052
2787
|
let buttons = [];
|
|
3053
|
-
const renderState = {
|
|
3054
|
-
leading: leadingContent,
|
|
3055
|
-
content: titleContent,
|
|
3056
|
-
name,
|
|
3057
|
-
buttons
|
|
3058
|
-
};
|
|
2788
|
+
const renderState = { leading: leadingContent, content: titleContent, name, buttons };
|
|
3059
2789
|
layout.customizeTab(node, renderState);
|
|
3060
2790
|
node._setRenderedName(renderState.name);
|
|
3061
2791
|
return renderState;
|
|
@@ -3079,28 +2809,12 @@ function isAuxMouseEvent(event) {
|
|
|
3079
2809
|
|
|
3080
2810
|
// src/view/BorderButton.tsx
|
|
3081
2811
|
var BorderButton = (props) => {
|
|
3082
|
-
const {
|
|
3083
|
-
layout,
|
|
3084
|
-
node,
|
|
3085
|
-
selected,
|
|
3086
|
-
border,
|
|
3087
|
-
iconFactory,
|
|
3088
|
-
titleFactory,
|
|
3089
|
-
icons,
|
|
3090
|
-
path
|
|
3091
|
-
} = props;
|
|
2812
|
+
const { layout, node, selected, border, iconFactory, titleFactory, icons, path } = props;
|
|
3092
2813
|
const selfRef = React2.useRef(null);
|
|
3093
2814
|
const contentRef = React2.useRef(null);
|
|
3094
2815
|
const onMouseDown = (event) => {
|
|
3095
2816
|
if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
|
|
3096
|
-
layout.dragStart(
|
|
3097
|
-
event,
|
|
3098
|
-
void 0,
|
|
3099
|
-
node,
|
|
3100
|
-
node.isEnableDrag(),
|
|
3101
|
-
onClick,
|
|
3102
|
-
onDoubleClick
|
|
3103
|
-
);
|
|
2817
|
+
layout.dragStart(event, void 0, node, node.isEnableDrag(), onClick, onDoubleClick);
|
|
3104
2818
|
}
|
|
3105
2819
|
};
|
|
3106
2820
|
const onAuxMouseClick = (event) => {
|
|
@@ -3173,12 +2887,7 @@ var BorderButton = (props) => {
|
|
|
3173
2887
|
layout.setEditingTab(void 0);
|
|
3174
2888
|
} else if (event.code === "Enter") {
|
|
3175
2889
|
layout.setEditingTab(void 0);
|
|
3176
|
-
layout.doAction(
|
|
3177
|
-
Actions.renameTab(
|
|
3178
|
-
node.getId(),
|
|
3179
|
-
event.target.value
|
|
3180
|
-
)
|
|
3181
|
-
);
|
|
2890
|
+
layout.doAction(Actions.renameTab(node.getId(), event.target.value));
|
|
3182
2891
|
}
|
|
3183
2892
|
};
|
|
3184
2893
|
const cm = layout.getClassName;
|
|
@@ -3199,13 +2908,7 @@ var BorderButton = (props) => {
|
|
|
3199
2908
|
iconAngle = -90;
|
|
3200
2909
|
}
|
|
3201
2910
|
}
|
|
3202
|
-
const renderState = getRenderStateEx(
|
|
3203
|
-
layout,
|
|
3204
|
-
node,
|
|
3205
|
-
iconFactory,
|
|
3206
|
-
titleFactory,
|
|
3207
|
-
iconAngle
|
|
3208
|
-
);
|
|
2911
|
+
const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory, iconAngle);
|
|
3209
2912
|
let content = renderState.content ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_content" /* FLEXLAYOUT__BORDER_BUTTON_CONTENT */) }, renderState.content) : null;
|
|
3210
2913
|
const leading = renderState.leading ? /* @__PURE__ */ React2.createElement("div", { className: cm("flexlayout__border_button_leading" /* FLEXLAYOUT__BORDER_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
3211
2914
|
if (layout.getEditingTab() === node) {
|
|
@@ -3271,15 +2974,19 @@ var TabButtonStamp = (props) => {
|
|
|
3271
2974
|
const selfRef = React3.useRef(null);
|
|
3272
2975
|
const cm = layout.getClassName;
|
|
3273
2976
|
let classNames = cm("flexlayout__tab_button_stamp" /* FLEXLAYOUT__TAB_BUTTON_STAMP */);
|
|
3274
|
-
const renderState = getRenderStateEx(
|
|
3275
|
-
layout,
|
|
3276
|
-
node,
|
|
3277
|
-
iconFactory,
|
|
3278
|
-
titleFactory
|
|
3279
|
-
);
|
|
2977
|
+
const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
|
|
3280
2978
|
let content = renderState.content ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : node._getNameForOverflowMenu();
|
|
3281
2979
|
const leading = renderState.leading ? /* @__PURE__ */ React3.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
3282
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2980
|
+
return /* @__PURE__ */ React3.createElement(
|
|
2981
|
+
"div",
|
|
2982
|
+
{
|
|
2983
|
+
ref: selfRef,
|
|
2984
|
+
className: classNames,
|
|
2985
|
+
title: node.getHelpText()
|
|
2986
|
+
},
|
|
2987
|
+
leading,
|
|
2988
|
+
content
|
|
2989
|
+
);
|
|
3283
2990
|
};
|
|
3284
2991
|
|
|
3285
2992
|
// src/PopupMenu.tsx
|
|
@@ -3475,14 +3182,8 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
|
|
|
3475
3182
|
}
|
|
3476
3183
|
}
|
|
3477
3184
|
}
|
|
3478
|
-
const extraSpace = Math.max(
|
|
3479
|
-
|
|
3480
|
-
endPos - (getFar(lastChild.getTabRect()) + tabMargin + shiftPos)
|
|
3481
|
-
);
|
|
3482
|
-
const newPosition = Math.min(
|
|
3483
|
-
0,
|
|
3484
|
-
position + shiftPos + extraSpace
|
|
3485
|
-
);
|
|
3185
|
+
const extraSpace = Math.max(0, endPos - (getFar(lastChild.getTabRect()) + tabMargin + shiftPos));
|
|
3186
|
+
const newPosition = Math.min(0, position + shiftPos + extraSpace);
|
|
3486
3187
|
const diff = newPosition - position;
|
|
3487
3188
|
const hidden = [];
|
|
3488
3189
|
for (let i = 0; i < node.getChildren().length; i++) {
|
|
@@ -3516,14 +3217,7 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
|
|
|
3516
3217
|
userControlledLeft.current = true;
|
|
3517
3218
|
event.stopPropagation();
|
|
3518
3219
|
};
|
|
3519
|
-
return {
|
|
3520
|
-
selfRef,
|
|
3521
|
-
position,
|
|
3522
|
-
userControlledLeft,
|
|
3523
|
-
hiddenTabs,
|
|
3524
|
-
onMouseWheel,
|
|
3525
|
-
tabsTruncated: tabsTruncated.current
|
|
3526
|
-
};
|
|
3220
|
+
return { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated: tabsTruncated.current };
|
|
3527
3221
|
};
|
|
3528
3222
|
|
|
3529
3223
|
// src/view/BorderTabSet.tsx
|
|
@@ -3532,19 +3226,7 @@ var BorderTabSet = (props) => {
|
|
|
3532
3226
|
const toolbarRef = React6.useRef(null);
|
|
3533
3227
|
const overflowbuttonRef = React6.useRef(null);
|
|
3534
3228
|
const stickyButtonsRef = React6.useRef(null);
|
|
3535
|
-
const {
|
|
3536
|
-
selfRef,
|
|
3537
|
-
position,
|
|
3538
|
-
userControlledLeft,
|
|
3539
|
-
hiddenTabs,
|
|
3540
|
-
onMouseWheel,
|
|
3541
|
-
tabsTruncated
|
|
3542
|
-
} = useTabOverflow(
|
|
3543
|
-
border,
|
|
3544
|
-
Orientation.flip(border.getOrientation()),
|
|
3545
|
-
toolbarRef,
|
|
3546
|
-
stickyButtonsRef
|
|
3547
|
-
);
|
|
3229
|
+
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(border, Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
|
|
3548
3230
|
const onAuxMouseClick = (event) => {
|
|
3549
3231
|
if (isAuxMouseEvent(event)) {
|
|
3550
3232
|
layout.auxMouseClick(border, event);
|
|
@@ -3608,13 +3290,7 @@ var BorderTabSet = (props) => {
|
|
|
3608
3290
|
);
|
|
3609
3291
|
if (i < border.getChildren().length - 1) {
|
|
3610
3292
|
tabs.push(
|
|
3611
|
-
/* @__PURE__ */ React6.createElement(
|
|
3612
|
-
"div",
|
|
3613
|
-
{
|
|
3614
|
-
key: "divider" + i,
|
|
3615
|
-
className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */)
|
|
3616
|
-
}
|
|
3617
|
-
)
|
|
3293
|
+
/* @__PURE__ */ React6.createElement("div", { key: "divider" + i, className: cm("flexlayout__border_tab_divider" /* FLEXLAYOUT__BORDER_TAB_DIVIDER */) })
|
|
3618
3294
|
);
|
|
3619
3295
|
}
|
|
3620
3296
|
};
|
|
@@ -3627,13 +3303,7 @@ var BorderTabSet = (props) => {
|
|
|
3627
3303
|
}
|
|
3628
3304
|
let buttons = [];
|
|
3629
3305
|
let stickyButtons = [];
|
|
3630
|
-
const renderState = {
|
|
3631
|
-
headerContent: void 0,
|
|
3632
|
-
buttons,
|
|
3633
|
-
stickyButtons,
|
|
3634
|
-
headerButtons: [],
|
|
3635
|
-
overflowPosition: void 0
|
|
3636
|
-
};
|
|
3306
|
+
const renderState = { headerContent: void 0, buttons, stickyButtons, headerButtons: [], overflowPosition: void 0 };
|
|
3637
3307
|
layout.customizeTabSet(border, renderState);
|
|
3638
3308
|
buttons = renderState.buttons;
|
|
3639
3309
|
if (renderState.overflowPosition === void 0) {
|
|
@@ -3643,24 +3313,20 @@ var BorderTabSet = (props) => {
|
|
|
3643
3313
|
if (tabsTruncated) {
|
|
3644
3314
|
buttons = [...stickyButtons, ...buttons];
|
|
3645
3315
|
} else {
|
|
3646
|
-
tabs.push(
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
e.preventDefault();
|
|
3656
|
-
},
|
|
3657
|
-
className: cm(
|
|
3658
|
-
"flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
|
|
3659
|
-
)
|
|
3316
|
+
tabs.push(/* @__PURE__ */ React6.createElement(
|
|
3317
|
+
"div",
|
|
3318
|
+
{
|
|
3319
|
+
ref: stickyButtonsRef,
|
|
3320
|
+
key: "sticky_buttons_container",
|
|
3321
|
+
onMouseDown: onInterceptMouseDown,
|
|
3322
|
+
onTouchStart: onInterceptMouseDown,
|
|
3323
|
+
onDragStart: (e) => {
|
|
3324
|
+
e.preventDefault();
|
|
3660
3325
|
},
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3326
|
+
className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
|
|
3327
|
+
},
|
|
3328
|
+
stickyButtons
|
|
3329
|
+
));
|
|
3664
3330
|
}
|
|
3665
3331
|
}
|
|
3666
3332
|
if (hiddenTabs.length > 0) {
|
|
@@ -3669,15 +3335,7 @@ var BorderTabSet = (props) => {
|
|
|
3669
3335
|
if (typeof icons.more === "function") {
|
|
3670
3336
|
overflowContent = icons.more(border, hiddenTabs);
|
|
3671
3337
|
} else {
|
|
3672
|
-
overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement(
|
|
3673
|
-
"div",
|
|
3674
|
-
{
|
|
3675
|
-
className: cm(
|
|
3676
|
-
"flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
|
|
3677
|
-
)
|
|
3678
|
-
},
|
|
3679
|
-
hiddenTabs.length
|
|
3680
|
-
));
|
|
3338
|
+
overflowContent = /* @__PURE__ */ React6.createElement(React6.Fragment, null, icons.more, /* @__PURE__ */ React6.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
|
|
3681
3339
|
}
|
|
3682
3340
|
buttons.splice(
|
|
3683
3341
|
Math.min(renderState.overflowPosition, buttons.length),
|
|
@@ -3687,9 +3345,7 @@ var BorderTabSet = (props) => {
|
|
|
3687
3345
|
{
|
|
3688
3346
|
key: "overflowbutton",
|
|
3689
3347
|
ref: overflowbuttonRef,
|
|
3690
|
-
className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm(
|
|
3691
|
-
"flexlayout__border_toolbar_button_overflow_" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ */ + border.getLocation().getName()
|
|
3692
|
-
),
|
|
3348
|
+
className: cm("flexlayout__border_toolbar_button" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON */) + " " + cm("flexlayout__border_toolbar_button_overflow" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW */) + " " + cm("flexlayout__border_toolbar_button_overflow_" /* FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ */ + border.getLocation().getName()),
|
|
3693
3349
|
title: overflowTitle,
|
|
3694
3350
|
onClick: onOverflowClick,
|
|
3695
3351
|
onMouseDown: onInterceptMouseDown,
|
|
@@ -3720,32 +3376,14 @@ var BorderTabSet = (props) => {
|
|
|
3720
3376
|
);
|
|
3721
3377
|
}
|
|
3722
3378
|
}
|
|
3723
|
-
const toolbar = /* @__PURE__ */ React6.createElement(
|
|
3724
|
-
"div",
|
|
3725
|
-
{
|
|
3726
|
-
key: "toolbar",
|
|
3727
|
-
ref: toolbarRef,
|
|
3728
|
-
className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm(
|
|
3729
|
-
"flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()
|
|
3730
|
-
)
|
|
3731
|
-
},
|
|
3732
|
-
buttons
|
|
3733
|
-
);
|
|
3379
|
+
const toolbar = /* @__PURE__ */ React6.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm("flexlayout__border_toolbar" /* FLEXLAYOUT__BORDER_TOOLBAR */) + " " + cm("flexlayout__border_toolbar_" /* FLEXLAYOUT__BORDER_TOOLBAR_ */ + border.getLocation().getName()) }, buttons);
|
|
3734
3380
|
style2 = layout.styleFont(style2);
|
|
3735
3381
|
let innerStyle = {};
|
|
3736
3382
|
const borderHeight = border.getBorderBarSize() - 1;
|
|
3737
3383
|
if (border.getLocation() === DockLocation.LEFT) {
|
|
3738
|
-
innerStyle = {
|
|
3739
|
-
right: borderHeight,
|
|
3740
|
-
height: borderHeight,
|
|
3741
|
-
top: position
|
|
3742
|
-
};
|
|
3384
|
+
innerStyle = { right: borderHeight, height: borderHeight, top: position };
|
|
3743
3385
|
} else if (border.getLocation() === DockLocation.RIGHT) {
|
|
3744
|
-
innerStyle = {
|
|
3745
|
-
left: borderHeight,
|
|
3746
|
-
height: borderHeight,
|
|
3747
|
-
top: position
|
|
3748
|
-
};
|
|
3386
|
+
innerStyle = { left: borderHeight, height: borderHeight, top: position };
|
|
3749
3387
|
} else {
|
|
3750
3388
|
innerStyle = { height: borderHeight, left: position };
|
|
3751
3389
|
}
|
|
@@ -3762,25 +3400,7 @@ var BorderTabSet = (props) => {
|
|
|
3762
3400
|
onContextMenu,
|
|
3763
3401
|
onWheel: onMouseWheel
|
|
3764
3402
|
},
|
|
3765
|
-
/* @__PURE__ */ React6.createElement(
|
|
3766
|
-
"div",
|
|
3767
|
-
{
|
|
3768
|
-
style: { height: borderHeight },
|
|
3769
|
-
className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm(
|
|
3770
|
-
"flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()
|
|
3771
|
-
)
|
|
3772
|
-
},
|
|
3773
|
-
/* @__PURE__ */ React6.createElement(
|
|
3774
|
-
"div",
|
|
3775
|
-
{
|
|
3776
|
-
style: innerStyle,
|
|
3777
|
-
className: cm("flexlayout__border_inner_tab_container" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER */) + " " + cm(
|
|
3778
|
-
"flexlayout__border_inner_tab_container_" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ */ + border.getLocation().getName()
|
|
3779
|
-
)
|
|
3780
|
-
},
|
|
3781
|
-
tabs
|
|
3782
|
-
)
|
|
3783
|
-
),
|
|
3403
|
+
/* @__PURE__ */ React6.createElement("div", { style: { height: borderHeight }, className: cm("flexlayout__border_inner" /* FLEXLAYOUT__BORDER_INNER */) + " " + cm("flexlayout__border_inner_" /* FLEXLAYOUT__BORDER_INNER_ */ + border.getLocation().getName()) }, /* @__PURE__ */ React6.createElement("div", { style: innerStyle, className: cm("flexlayout__border_inner_tab_container" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER */) + " " + cm("flexlayout__border_inner_tab_container_" /* FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ */ + border.getLocation().getName()) }, tabs)),
|
|
3784
3404
|
toolbar
|
|
3785
3405
|
);
|
|
3786
3406
|
};
|
|
@@ -3811,9 +3431,7 @@ var Splitter = (props) => {
|
|
|
3811
3431
|
const rootdiv = layout.getRootDiv();
|
|
3812
3432
|
outlineDiv.current = layout.getCurrentDocument().createElement("div");
|
|
3813
3433
|
outlineDiv.current.style.position = "absolute";
|
|
3814
|
-
outlineDiv.current.className = layout.getClassName(
|
|
3815
|
-
"flexlayout__splitter_drag" /* FLEXLAYOUT__SPLITTER_DRAG */
|
|
3816
|
-
);
|
|
3434
|
+
outlineDiv.current.className = layout.getClassName("flexlayout__splitter_drag" /* FLEXLAYOUT__SPLITTER_DRAG */);
|
|
3817
3435
|
outlineDiv.current.style.cursor = node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize";
|
|
3818
3436
|
const r2 = node.getRect();
|
|
3819
3437
|
if (node.getOrientation() === Orientation.VERT && r2.width < 2) {
|
|
@@ -3866,12 +3484,7 @@ var Splitter = (props) => {
|
|
|
3866
3484
|
}
|
|
3867
3485
|
if (parentNode instanceof BorderNode) {
|
|
3868
3486
|
const pos = parentNode._calculateSplit(node, value);
|
|
3869
|
-
layout.doAction(
|
|
3870
|
-
Actions.adjustBorderSplit(
|
|
3871
|
-
node.getParent().getId(),
|
|
3872
|
-
pos
|
|
3873
|
-
)
|
|
3874
|
-
);
|
|
3487
|
+
layout.doAction(Actions.adjustBorderSplit(node.getParent().getId(), pos));
|
|
3875
3488
|
} else {
|
|
3876
3489
|
const splitSpec = parentNode._calculateSplit(node, value);
|
|
3877
3490
|
if (splitSpec !== void 0) {
|
|
@@ -3935,15 +3548,23 @@ var Splitter = (props) => {
|
|
|
3935
3548
|
cursor: node.getOrientation() === Orientation.HORZ ? "ns-resize" : "ew-resize"
|
|
3936
3549
|
});
|
|
3937
3550
|
const className2 = cm("flexlayout__splitter_extra" /* FLEXLAYOUT__SPLITTER_EXTRA */);
|
|
3938
|
-
return /* @__PURE__ */ React7.createElement(
|
|
3551
|
+
return /* @__PURE__ */ React7.createElement(
|
|
3939
3552
|
"div",
|
|
3940
3553
|
{
|
|
3941
|
-
style:
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3554
|
+
style: style2,
|
|
3555
|
+
"data-layout-path": path,
|
|
3556
|
+
className
|
|
3557
|
+
},
|
|
3558
|
+
/* @__PURE__ */ React7.createElement(
|
|
3559
|
+
"div",
|
|
3560
|
+
{
|
|
3561
|
+
style: style22,
|
|
3562
|
+
className: className2,
|
|
3563
|
+
onTouchStart: onMouseDown,
|
|
3564
|
+
onMouseDown
|
|
3565
|
+
}
|
|
3566
|
+
)
|
|
3567
|
+
);
|
|
3947
3568
|
}
|
|
3948
3569
|
};
|
|
3949
3570
|
|
|
@@ -3976,9 +3597,7 @@ var ErrorBoundary = class extends React8.Component {
|
|
|
3976
3597
|
// src/view/Tab.tsx
|
|
3977
3598
|
var Tab = (props) => {
|
|
3978
3599
|
const { layout, selected, node, factory, path } = props;
|
|
3979
|
-
const [renderComponent, setRenderComponent] = React9.useState(
|
|
3980
|
-
!props.node.isEnableRenderOnDemand() || props.selected
|
|
3981
|
-
);
|
|
3600
|
+
const [renderComponent, setRenderComponent] = React9.useState(!props.node.isEnableRenderOnDemand() || props.selected);
|
|
3982
3601
|
React9.useLayoutEffect(() => {
|
|
3983
3602
|
if (!renderComponent && selected) {
|
|
3984
3603
|
setRenderComponent(true);
|
|
@@ -4011,9 +3630,7 @@ var Tab = (props) => {
|
|
|
4011
3630
|
let className = cm("flexlayout__tab" /* FLEXLAYOUT__TAB */);
|
|
4012
3631
|
if (parentNode instanceof BorderNode) {
|
|
4013
3632
|
className += " " + cm("flexlayout__tab_border" /* FLEXLAYOUT__TAB_BORDER */);
|
|
4014
|
-
className += " " + cm(
|
|
4015
|
-
"flexlayout__tab_border_" /* FLEXLAYOUT__TAB_BORDER_ */ + parentNode.getLocation().getName()
|
|
4016
|
-
);
|
|
3633
|
+
className += " " + cm("flexlayout__tab_border_" /* FLEXLAYOUT__TAB_BORDER_ */ + parentNode.getLocation().getName());
|
|
4017
3634
|
}
|
|
4018
3635
|
if (node.getContentClassName() !== void 0) {
|
|
4019
3636
|
className += " " + node.getContentClassName();
|
|
@@ -4027,15 +3644,7 @@ var Tab = (props) => {
|
|
|
4027
3644
|
onTouchStart: onMouseDown,
|
|
4028
3645
|
style: style2
|
|
4029
3646
|
},
|
|
4030
|
-
/* @__PURE__ */ React9.createElement(
|
|
4031
|
-
ErrorBoundary,
|
|
4032
|
-
{
|
|
4033
|
-
message: props.layout.i18nName(
|
|
4034
|
-
"Error rendering component" /* Error_rendering_component */
|
|
4035
|
-
)
|
|
4036
|
-
},
|
|
4037
|
-
/* @__PURE__ */ React9.createElement(Fragment2, null, child)
|
|
4038
|
-
)
|
|
3647
|
+
/* @__PURE__ */ React9.createElement(ErrorBoundary, { message: props.layout.i18nName("Error rendering component" /* Error_rendering_component */) }, /* @__PURE__ */ React9.createElement(Fragment2, null, child))
|
|
4039
3648
|
);
|
|
4040
3649
|
};
|
|
4041
3650
|
|
|
@@ -4050,14 +3659,7 @@ var TabButton = (props) => {
|
|
|
4050
3659
|
const contentRef = React10.useRef(null);
|
|
4051
3660
|
const onMouseDown = (event) => {
|
|
4052
3661
|
if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
|
|
4053
|
-
layout.dragStart(
|
|
4054
|
-
event,
|
|
4055
|
-
void 0,
|
|
4056
|
-
node,
|
|
4057
|
-
node.isEnableDrag(),
|
|
4058
|
-
onClick,
|
|
4059
|
-
onDoubleClick
|
|
4060
|
-
);
|
|
3662
|
+
layout.dragStart(event, void 0, node, node.isEnableDrag(), onClick, onDoubleClick);
|
|
4061
3663
|
}
|
|
4062
3664
|
};
|
|
4063
3665
|
const onAuxMouseClick = (event) => {
|
|
@@ -4138,33 +3740,26 @@ var TabButton = (props) => {
|
|
|
4138
3740
|
layout.setEditingTab(void 0);
|
|
4139
3741
|
} else if (event.code === "Enter") {
|
|
4140
3742
|
layout.setEditingTab(void 0);
|
|
4141
|
-
layout.doAction(
|
|
4142
|
-
Actions.renameTab(
|
|
4143
|
-
node.getId(),
|
|
4144
|
-
event.target.value
|
|
4145
|
-
)
|
|
4146
|
-
);
|
|
3743
|
+
layout.doAction(Actions.renameTab(node.getId(), event.target.value));
|
|
4147
3744
|
}
|
|
4148
3745
|
};
|
|
4149
3746
|
const cm = layout.getClassName;
|
|
4150
3747
|
const parentNode = node.getParent();
|
|
4151
|
-
|
|
3748
|
+
const isStretch = parentNode.isEnableSingleTabStretch() && parentNode.getChildren().length === 1;
|
|
3749
|
+
let baseClassName = isStretch ? "flexlayout__tab_button_stretch" /* FLEXLAYOUT__TAB_BUTTON_STRETCH */ : "flexlayout__tab_button" /* FLEXLAYOUT__TAB_BUTTON */;
|
|
4152
3750
|
let classNames = cm(baseClassName);
|
|
4153
3751
|
classNames += " " + cm(baseClassName + "_" + parentNode.getTabLocation());
|
|
4154
|
-
if (
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
3752
|
+
if (!isStretch) {
|
|
3753
|
+
if (selected) {
|
|
3754
|
+
classNames += " " + cm(baseClassName + "--selected");
|
|
3755
|
+
} else {
|
|
3756
|
+
classNames += " " + cm(baseClassName + "--unselected");
|
|
3757
|
+
}
|
|
4158
3758
|
}
|
|
4159
3759
|
if (node.getClassName() !== void 0) {
|
|
4160
3760
|
classNames += " " + node.getClassName();
|
|
4161
3761
|
}
|
|
4162
|
-
const renderState = getRenderStateEx(
|
|
4163
|
-
layout,
|
|
4164
|
-
node,
|
|
4165
|
-
iconFactory,
|
|
4166
|
-
titleFactory
|
|
4167
|
-
);
|
|
3762
|
+
const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
|
|
4168
3763
|
let content = renderState.content ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_content" /* FLEXLAYOUT__TAB_BUTTON_CONTENT */) }, renderState.content) : null;
|
|
4169
3764
|
const leading = renderState.leading ? /* @__PURE__ */ React10.createElement("div", { className: cm("flexlayout__tab_button_leading" /* FLEXLAYOUT__TAB_BUTTON_LEADING */) }, renderState.leading) : null;
|
|
4170
3765
|
if (layout.getEditingTab() === node) {
|
|
@@ -4183,7 +3778,7 @@ var TabButton = (props) => {
|
|
|
4183
3778
|
}
|
|
4184
3779
|
);
|
|
4185
3780
|
}
|
|
4186
|
-
if (node.isEnableClose()) {
|
|
3781
|
+
if (node.isEnableClose() && !isStretch) {
|
|
4187
3782
|
const closeTitle = layout.i18nName("Close" /* Close_Tab */);
|
|
4188
3783
|
renderState.buttons.push(
|
|
4189
3784
|
/* @__PURE__ */ React10.createElement(
|
|
@@ -4227,14 +3822,7 @@ var TabSet = (props) => {
|
|
|
4227
3822
|
const overflowbuttonRef = React11.useRef(null);
|
|
4228
3823
|
const tabbarInnerRef = React11.useRef(null);
|
|
4229
3824
|
const stickyButtonsRef = React11.useRef(null);
|
|
4230
|
-
const {
|
|
4231
|
-
selfRef,
|
|
4232
|
-
position,
|
|
4233
|
-
userControlledLeft,
|
|
4234
|
-
hiddenTabs,
|
|
4235
|
-
onMouseWheel,
|
|
4236
|
-
tabsTruncated
|
|
4237
|
-
} = useTabOverflow(node, Orientation.HORZ, toolbarRef, stickyButtonsRef);
|
|
3825
|
+
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(node, Orientation.HORZ, toolbarRef, stickyButtonsRef);
|
|
4238
3826
|
const onOverflowClick = (event) => {
|
|
4239
3827
|
const callback = layout.getShowOverflowMenu();
|
|
4240
3828
|
if (callback !== void 0) {
|
|
@@ -4268,23 +3856,9 @@ var TabSet = (props) => {
|
|
|
4268
3856
|
if (!layout.getEditingTab()) {
|
|
4269
3857
|
const message = layout.i18nName("Move tabset" /* Move_Tabset */, name);
|
|
4270
3858
|
if (node.getModel().getMaximizedTabset() !== void 0) {
|
|
4271
|
-
layout.dragStart(
|
|
4272
|
-
event,
|
|
4273
|
-
message,
|
|
4274
|
-
node,
|
|
4275
|
-
false,
|
|
4276
|
-
(event2) => void 0,
|
|
4277
|
-
onDoubleClick
|
|
4278
|
-
);
|
|
3859
|
+
layout.dragStart(event, message, node, false, (event2) => void 0, onDoubleClick);
|
|
4279
3860
|
} else {
|
|
4280
|
-
layout.dragStart(
|
|
4281
|
-
event,
|
|
4282
|
-
message,
|
|
4283
|
-
node,
|
|
4284
|
-
node.isEnableDrag(),
|
|
4285
|
-
(event2) => void 0,
|
|
4286
|
-
onDoubleClick
|
|
4287
|
-
);
|
|
3861
|
+
layout.dragStart(event, message, node, node.isEnableDrag(), (event2) => void 0, onDoubleClick);
|
|
4288
3862
|
}
|
|
4289
3863
|
}
|
|
4290
3864
|
}
|
|
@@ -4310,6 +3884,10 @@ var TabSet = (props) => {
|
|
|
4310
3884
|
layout.doAction(Actions.deleteTabset(node.getId()));
|
|
4311
3885
|
event.stopPropagation();
|
|
4312
3886
|
};
|
|
3887
|
+
const onCloseTab = (event) => {
|
|
3888
|
+
layout.doAction(Actions.deleteTab(node.getChildren()[0].getId()));
|
|
3889
|
+
event.stopPropagation();
|
|
3890
|
+
};
|
|
4313
3891
|
const onFloatTab = (event) => {
|
|
4314
3892
|
if (selectedTabNode !== void 0) {
|
|
4315
3893
|
layout.doAction(Actions.floatTab(selectedTabNode.getId()));
|
|
@@ -4352,13 +3930,7 @@ var TabSet = (props) => {
|
|
|
4352
3930
|
);
|
|
4353
3931
|
if (i < node.getChildren().length - 1) {
|
|
4354
3932
|
tabs.push(
|
|
4355
|
-
/* @__PURE__ */ React11.createElement(
|
|
4356
|
-
"div",
|
|
4357
|
-
{
|
|
4358
|
-
key: "divider" + i,
|
|
4359
|
-
className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */)
|
|
4360
|
-
}
|
|
4361
|
-
)
|
|
3933
|
+
/* @__PURE__ */ React11.createElement("div", { key: "divider" + i, className: cm("flexlayout__tabset_tab_divider" /* FLEXLAYOUT__TABSET_TAB_DIVIDER */) })
|
|
4362
3934
|
);
|
|
4363
3935
|
}
|
|
4364
3936
|
}
|
|
@@ -4367,43 +3939,35 @@ var TabSet = (props) => {
|
|
|
4367
3939
|
let stickyButtons = [];
|
|
4368
3940
|
let buttons = [];
|
|
4369
3941
|
let headerButtons = [];
|
|
4370
|
-
const renderState = {
|
|
4371
|
-
headerContent: node.getName(),
|
|
4372
|
-
stickyButtons,
|
|
4373
|
-
buttons,
|
|
4374
|
-
headerButtons,
|
|
4375
|
-
overflowPosition: void 0
|
|
4376
|
-
};
|
|
3942
|
+
const renderState = { headerContent: node.getName(), stickyButtons, buttons, headerButtons, overflowPosition: void 0 };
|
|
4377
3943
|
layout.customizeTabSet(node, renderState);
|
|
4378
3944
|
const headerContent = renderState.headerContent;
|
|
4379
3945
|
stickyButtons = renderState.stickyButtons;
|
|
4380
3946
|
buttons = renderState.buttons;
|
|
4381
3947
|
headerButtons = renderState.headerButtons;
|
|
3948
|
+
const isTabStretch = node.isEnableSingleTabStretch() && node.getChildren().length === 1;
|
|
3949
|
+
const showClose = isTabStretch && node.getChildren()[0].isEnableClose() || node.isEnableClose();
|
|
4382
3950
|
if (renderState.overflowPosition === void 0) {
|
|
4383
3951
|
renderState.overflowPosition = stickyButtons.length;
|
|
4384
3952
|
}
|
|
4385
3953
|
if (stickyButtons.length > 0) {
|
|
4386
|
-
if (tabsTruncated) {
|
|
3954
|
+
if (tabsTruncated || isTabStretch) {
|
|
4387
3955
|
buttons = [...stickyButtons, ...buttons];
|
|
4388
3956
|
} else {
|
|
4389
|
-
tabs.push(
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
e.preventDefault();
|
|
4399
|
-
},
|
|
4400
|
-
className: cm(
|
|
4401
|
-
"flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */
|
|
4402
|
-
)
|
|
3957
|
+
tabs.push(/* @__PURE__ */ React11.createElement(
|
|
3958
|
+
"div",
|
|
3959
|
+
{
|
|
3960
|
+
ref: stickyButtonsRef,
|
|
3961
|
+
key: "sticky_buttons_container",
|
|
3962
|
+
onMouseDown: onInterceptMouseDown,
|
|
3963
|
+
onTouchStart: onInterceptMouseDown,
|
|
3964
|
+
onDragStart: (e) => {
|
|
3965
|
+
e.preventDefault();
|
|
4403
3966
|
},
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
3967
|
+
className: cm("flexlayout__tab_toolbar_sticky_buttons_container" /* FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER */)
|
|
3968
|
+
},
|
|
3969
|
+
stickyButtons
|
|
3970
|
+
));
|
|
4407
3971
|
}
|
|
4408
3972
|
}
|
|
4409
3973
|
if (hiddenTabs.length > 0) {
|
|
@@ -4412,15 +3976,7 @@ var TabSet = (props) => {
|
|
|
4412
3976
|
if (typeof icons.more === "function") {
|
|
4413
3977
|
overflowContent = icons.more(node, hiddenTabs);
|
|
4414
3978
|
} else {
|
|
4415
|
-
overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement(
|
|
4416
|
-
"div",
|
|
4417
|
-
{
|
|
4418
|
-
className: cm(
|
|
4419
|
-
"flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */
|
|
4420
|
-
)
|
|
4421
|
-
},
|
|
4422
|
-
hiddenTabs.length
|
|
4423
|
-
));
|
|
3979
|
+
overflowContent = /* @__PURE__ */ React11.createElement(React11.Fragment, null, icons.more, /* @__PURE__ */ React11.createElement("div", { className: cm("flexlayout__tab_button_overflow_count" /* FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT */) }, hiddenTabs.length));
|
|
4424
3980
|
}
|
|
4425
3981
|
buttons.splice(
|
|
4426
3982
|
Math.min(renderState.overflowPosition, buttons.length),
|
|
@@ -4470,9 +4026,7 @@ var TabSet = (props) => {
|
|
|
4470
4026
|
key: "max",
|
|
4471
4027
|
"data-layout-path": path + "/button/max",
|
|
4472
4028
|
title: node.isMaximized() ? minTitle : maxTitle,
|
|
4473
|
-
className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm(
|
|
4474
|
-
"flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")
|
|
4475
|
-
),
|
|
4029
|
+
className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ */ + (node.isMaximized() ? "max" : "min")),
|
|
4476
4030
|
onClick: onMaximizeToggle,
|
|
4477
4031
|
onMouseDown: onInterceptMouseDown,
|
|
4478
4032
|
onTouchStart: onInterceptMouseDown
|
|
@@ -4481,8 +4035,8 @@ var TabSet = (props) => {
|
|
|
4481
4035
|
)
|
|
4482
4036
|
);
|
|
4483
4037
|
}
|
|
4484
|
-
if (!node.isMaximized() &&
|
|
4485
|
-
const title = layout.i18nName("Close tabset" /* Close_Tabset */);
|
|
4038
|
+
if (!node.isMaximized() && showClose) {
|
|
4039
|
+
const title = isTabStretch ? layout.i18nName("Close" /* Close_Tab */) : layout.i18nName("Close tabset" /* Close_Tabset */);
|
|
4486
4040
|
const btns = showHeader ? headerButtons : buttons;
|
|
4487
4041
|
btns.push(
|
|
4488
4042
|
/* @__PURE__ */ React11.createElement(
|
|
@@ -4492,7 +4046,7 @@ var TabSet = (props) => {
|
|
|
4492
4046
|
"data-layout-path": path + "/button/close",
|
|
4493
4047
|
title,
|
|
4494
4048
|
className: cm("flexlayout__tab_toolbar_button" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON */) + " " + cm("flexlayout__tab_toolbar_button-close" /* FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE */),
|
|
4495
|
-
onClick: onClose,
|
|
4049
|
+
onClick: isTabStretch ? onCloseTab : onClose,
|
|
4496
4050
|
onMouseDown: onInterceptMouseDown,
|
|
4497
4051
|
onTouchStart: onInterceptMouseDown
|
|
4498
4052
|
},
|
|
@@ -4568,9 +4122,7 @@ var TabSet = (props) => {
|
|
|
4568
4122
|
headerToolbar
|
|
4569
4123
|
);
|
|
4570
4124
|
}
|
|
4571
|
-
const tabStripStyle = {
|
|
4572
|
-
height: node.getTabStripHeight() + "px"
|
|
4573
|
-
};
|
|
4125
|
+
const tabStripStyle = { height: node.getTabStripHeight() + "px" };
|
|
4574
4126
|
tabStrip = /* @__PURE__ */ React11.createElement(
|
|
4575
4127
|
"div",
|
|
4576
4128
|
{
|
|
@@ -4583,27 +4135,14 @@ var TabSet = (props) => {
|
|
|
4583
4135
|
onAuxClick: onAuxMouseClick,
|
|
4584
4136
|
onTouchStart: onMouseDown
|
|
4585
4137
|
},
|
|
4586
|
-
/* @__PURE__ */ React11.createElement(
|
|
4138
|
+
/* @__PURE__ */ React11.createElement("div", { ref: tabbarInnerRef, className: cm("flexlayout__tabset_tabbar_inner" /* FLEXLAYOUT__TABSET_TABBAR_INNER */) + " " + cm("flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()) }, /* @__PURE__ */ React11.createElement(
|
|
4587
4139
|
"div",
|
|
4588
4140
|
{
|
|
4589
|
-
|
|
4590
|
-
className: cm("
|
|
4591
|
-
"flexlayout__tabset_tabbar_inner_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_ */ + node.getTabLocation()
|
|
4592
|
-
)
|
|
4141
|
+
style: { left: position, width: isTabStretch ? "100%" : "10000px" },
|
|
4142
|
+
className: cm("flexlayout__tabset_tabbar_inner_tab_container" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER */) + " " + cm("flexlayout__tabset_tabbar_inner_tab_container_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ */ + node.getTabLocation())
|
|
4593
4143
|
},
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
{
|
|
4597
|
-
style: { left: position },
|
|
4598
|
-
className: cm(
|
|
4599
|
-
"flexlayout__tabset_tabbar_inner_tab_container" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER */
|
|
4600
|
-
) + " " + cm(
|
|
4601
|
-
"flexlayout__tabset_tabbar_inner_tab_container_" /* FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ */ + node.getTabLocation()
|
|
4602
|
-
)
|
|
4603
|
-
},
|
|
4604
|
-
tabs
|
|
4605
|
-
)
|
|
4606
|
-
),
|
|
4144
|
+
tabs
|
|
4145
|
+
)),
|
|
4607
4146
|
toolbar
|
|
4608
4147
|
);
|
|
4609
4148
|
style2 = layout.styleFont(style2);
|
|
@@ -4642,42 +4181,33 @@ var FloatingWindow = (props) => {
|
|
|
4642
4181
|
const { title, id, url, rect, onCloseWindow, onSetWindow, children } = props;
|
|
4643
4182
|
const popoutWindow = React12.useRef(null);
|
|
4644
4183
|
const timerId = React12.useRef(null);
|
|
4645
|
-
const [content, setContent] = React12.useState(
|
|
4646
|
-
void 0
|
|
4647
|
-
);
|
|
4184
|
+
const [content, setContent] = React12.useState(void 0);
|
|
4648
4185
|
React12.useLayoutEffect(() => {
|
|
4649
4186
|
if (timerId.current) {
|
|
4650
4187
|
clearTimeout(timerId.current);
|
|
4651
4188
|
}
|
|
4652
4189
|
let isMounted = true;
|
|
4653
4190
|
const r = rect || new Rect(0, 0, 100, 100);
|
|
4654
|
-
const styles = Array.from(window.document.styleSheets).reduce(
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
[]
|
|
4675
|
-
);
|
|
4676
|
-
popoutWindow.current = window.open(
|
|
4677
|
-
url,
|
|
4678
|
-
id,
|
|
4679
|
-
`left=${r.x},top=${r.y},width=${r.width},height=${r.height}`
|
|
4680
|
-
);
|
|
4191
|
+
const styles = Array.from(window.document.styleSheets).reduce((result, styleSheet) => {
|
|
4192
|
+
let rules = void 0;
|
|
4193
|
+
try {
|
|
4194
|
+
rules = styleSheet.cssRules;
|
|
4195
|
+
} catch (e) {
|
|
4196
|
+
}
|
|
4197
|
+
try {
|
|
4198
|
+
return [
|
|
4199
|
+
...result,
|
|
4200
|
+
{
|
|
4201
|
+
href: styleSheet.href,
|
|
4202
|
+
type: styleSheet.type,
|
|
4203
|
+
rules: rules ? Array.from(rules).map((rule) => rule.cssText) : null
|
|
4204
|
+
}
|
|
4205
|
+
];
|
|
4206
|
+
} catch (e) {
|
|
4207
|
+
return result;
|
|
4208
|
+
}
|
|
4209
|
+
}, []);
|
|
4210
|
+
popoutWindow.current = window.open(url, id, `left=${r.x},top=${r.y},width=${r.width},height=${r.height}`);
|
|
4681
4211
|
if (popoutWindow.current !== null) {
|
|
4682
4212
|
onSetWindow(id, popoutWindow.current);
|
|
4683
4213
|
window.addEventListener("beforeunload", () => {
|
|
@@ -4696,12 +4226,9 @@ var FloatingWindow = (props) => {
|
|
|
4696
4226
|
copyStyles(popoutDocument, styles).then(() => {
|
|
4697
4227
|
setContent(popoutContent);
|
|
4698
4228
|
});
|
|
4699
|
-
popoutWindow.current.addEventListener(
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
onCloseWindow(id);
|
|
4703
|
-
}
|
|
4704
|
-
);
|
|
4229
|
+
popoutWindow.current.addEventListener("beforeunload", () => {
|
|
4230
|
+
onCloseWindow(id);
|
|
4231
|
+
});
|
|
4705
4232
|
}
|
|
4706
4233
|
});
|
|
4707
4234
|
} else {
|
|
@@ -4759,15 +4286,7 @@ var FloatingWindowTab = (props) => {
|
|
|
4759
4286
|
const { layout, node, factory } = props;
|
|
4760
4287
|
const cm = layout.getClassName;
|
|
4761
4288
|
const child = factory(node);
|
|
4762
|
-
return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(
|
|
4763
|
-
ErrorBoundary,
|
|
4764
|
-
{
|
|
4765
|
-
message: props.layout.i18nName(
|
|
4766
|
-
"Error rendering component" /* Error_rendering_component */
|
|
4767
|
-
)
|
|
4768
|
-
},
|
|
4769
|
-
/* @__PURE__ */ React13.createElement(Fragment4, null, child)
|
|
4770
|
-
));
|
|
4289
|
+
return /* @__PURE__ */ React13.createElement("div", { className: cm("flexlayout__floating_window_tab" /* FLEXLAYOUT__FLOATING_WINDOW_TAB */) }, /* @__PURE__ */ React13.createElement(ErrorBoundary, { message: props.layout.i18nName("Error rendering component" /* Error_rendering_component */) }, /* @__PURE__ */ React13.createElement(Fragment4, null, child)));
|
|
4771
4290
|
};
|
|
4772
4291
|
|
|
4773
4292
|
// src/view/TabFloating.tsx
|
|
@@ -4814,16 +4333,7 @@ var TabFloating = (props) => {
|
|
|
4814
4333
|
const dockMessage = layout.i18nName("Dock window" /* Floating_Window_Dock_Window */);
|
|
4815
4334
|
const customRenderCallback = layout.getOnRenderFloatingTabPlaceholder();
|
|
4816
4335
|
if (customRenderCallback) {
|
|
4817
|
-
return /* @__PURE__ */ React14.createElement(
|
|
4818
|
-
"div",
|
|
4819
|
-
{
|
|
4820
|
-
className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */),
|
|
4821
|
-
onMouseDown,
|
|
4822
|
-
onTouchStart: onMouseDown,
|
|
4823
|
-
style: style2
|
|
4824
|
-
},
|
|
4825
|
-
customRenderCallback(dockPopout, showPopout)
|
|
4826
|
-
);
|
|
4336
|
+
return /* @__PURE__ */ React14.createElement("div", { className: cm("flexlayout__tab_floating" /* FLEXLAYOUT__TAB_FLOATING */), onMouseDown, onTouchStart: onMouseDown, style: style2 }, customRenderCallback(dockPopout, showPopout));
|
|
4827
4337
|
} else {
|
|
4828
4338
|
return /* @__PURE__ */ React14.createElement(
|
|
4829
4339
|
"div",
|
|
@@ -4841,62 +4351,15 @@ var TabFloating = (props) => {
|
|
|
4841
4351
|
|
|
4842
4352
|
// src/view/Icons.tsx
|
|
4843
4353
|
import * as React15 from "react";
|
|
4844
|
-
var style = {
|
|
4845
|
-
width: "1em",
|
|
4846
|
-
height: "1em",
|
|
4847
|
-
display: "flex",
|
|
4848
|
-
alignItems: "center"
|
|
4849
|
-
};
|
|
4354
|
+
var style = { width: "1em", height: "1em", display: "flex", alignItems: "center" };
|
|
4850
4355
|
var CloseIcon = () => {
|
|
4851
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4852
|
-
"svg",
|
|
4853
|
-
{
|
|
4854
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4855
|
-
style,
|
|
4856
|
-
viewBox: "0 0 24 24"
|
|
4857
|
-
},
|
|
4858
|
-
/* @__PURE__ */ React15.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }),
|
|
4859
|
-
/* @__PURE__ */ React15.createElement(
|
|
4860
|
-
"path",
|
|
4861
|
-
{
|
|
4862
|
-
stroke: "var(--color-icon)",
|
|
4863
|
-
fill: "var(--color-icon)",
|
|
4864
|
-
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"
|
|
4865
|
-
}
|
|
4866
|
-
)
|
|
4867
|
-
);
|
|
4356
|
+
return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24" }, /* @__PURE__ */ React15.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", fill: "var(--color-icon)", 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" }));
|
|
4868
4357
|
};
|
|
4869
4358
|
var MaximizeIcon = () => {
|
|
4870
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4871
|
-
"svg",
|
|
4872
|
-
{
|
|
4873
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4874
|
-
style,
|
|
4875
|
-
viewBox: "0 0 24 24",
|
|
4876
|
-
fill: "var(--color-icon)"
|
|
4877
|
-
},
|
|
4878
|
-
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4879
|
-
/* @__PURE__ */ React15.createElement(
|
|
4880
|
-
"path",
|
|
4881
|
-
{
|
|
4882
|
-
stroke: "var(--color-icon)",
|
|
4883
|
-
d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
|
|
4884
|
-
}
|
|
4885
|
-
)
|
|
4886
|
-
);
|
|
4359
|
+
return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
|
|
4887
4360
|
};
|
|
4888
4361
|
var OverflowIcon = () => {
|
|
4889
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4890
|
-
"svg",
|
|
4891
|
-
{
|
|
4892
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4893
|
-
style,
|
|
4894
|
-
viewBox: "0 0 24 24",
|
|
4895
|
-
fill: "var(--color-icon)"
|
|
4896
|
-
},
|
|
4897
|
-
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4898
|
-
/* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" })
|
|
4899
|
-
);
|
|
4362
|
+
return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M7 10l5 5 5-5z" }));
|
|
4900
4363
|
};
|
|
4901
4364
|
var PopoutIcon = () => {
|
|
4902
4365
|
return (
|
|
@@ -4904,37 +4367,11 @@ var PopoutIcon = () => {
|
|
|
4904
4367
|
// <svg xmlns="http://www.w3.org/2000/svg" style={style} fill="none" viewBox="0 0 24 24" stroke="var(--color-icon)" stroke-width="2">
|
|
4905
4368
|
// <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" />
|
|
4906
4369
|
// </svg>
|
|
4907
|
-
/* @__PURE__ */ React15.createElement(
|
|
4908
|
-
"svg",
|
|
4909
|
-
{
|
|
4910
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4911
|
-
style,
|
|
4912
|
-
viewBox: "0 0 20 20",
|
|
4913
|
-
fill: "var(--color-icon)"
|
|
4914
|
-
},
|
|
4915
|
-
/* @__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" }),
|
|
4916
|
-
/* @__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" })
|
|
4917
|
-
)
|
|
4370
|
+
/* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 20 20", fill: "var(--color-icon)" }, /* @__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" }), /* @__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" }))
|
|
4918
4371
|
);
|
|
4919
4372
|
};
|
|
4920
4373
|
var RestoreIcon = () => {
|
|
4921
|
-
return /* @__PURE__ */ React15.createElement(
|
|
4922
|
-
"svg",
|
|
4923
|
-
{
|
|
4924
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4925
|
-
style,
|
|
4926
|
-
viewBox: "0 0 24 24",
|
|
4927
|
-
fill: "var(--color-icon)"
|
|
4928
|
-
},
|
|
4929
|
-
/* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
4930
|
-
/* @__PURE__ */ React15.createElement(
|
|
4931
|
-
"path",
|
|
4932
|
-
{
|
|
4933
|
-
stroke: "var(--color-icon)",
|
|
4934
|
-
d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"
|
|
4935
|
-
}
|
|
4936
|
-
)
|
|
4937
|
-
);
|
|
4374
|
+
return /* @__PURE__ */ React15.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", style, viewBox: "0 0 24 24", fill: "var(--color-icon)" }, /* @__PURE__ */ React15.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), /* @__PURE__ */ React15.createElement("path", { stroke: "var(--color-icon)", d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }));
|
|
4938
4375
|
};
|
|
4939
4376
|
|
|
4940
4377
|
// src/view/Layout.tsx
|
|
@@ -4946,8 +4383,9 @@ var defaultIcons = {
|
|
|
4946
4383
|
restore: /* @__PURE__ */ React16.createElement(RestoreIcon, null),
|
|
4947
4384
|
more: /* @__PURE__ */ React16.createElement(OverflowIcon, null)
|
|
4948
4385
|
};
|
|
4386
|
+
var isIEorEdge = typeof window !== "undefined" && (window.document.documentMode || /Edge\//.test(window.navigator.userAgent));
|
|
4949
4387
|
var isDesktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
4950
|
-
var defaultSupportsPopout = isDesktop;
|
|
4388
|
+
var defaultSupportsPopout = isDesktop && !isIEorEdge;
|
|
4951
4389
|
var Layout = class extends React16.Component {
|
|
4952
4390
|
constructor(props) {
|
|
4953
4391
|
super(props);
|
|
@@ -5082,14 +4520,7 @@ var Layout = class extends React16.Component {
|
|
|
5082
4520
|
/** @internal */
|
|
5083
4521
|
this.onDragDivMouseDown = (event) => {
|
|
5084
4522
|
event.preventDefault();
|
|
5085
|
-
this.dragStart(
|
|
5086
|
-
event,
|
|
5087
|
-
this.dragDivText,
|
|
5088
|
-
TabNode._fromJson(this.newTabJson, this.props.model, false),
|
|
5089
|
-
true,
|
|
5090
|
-
void 0,
|
|
5091
|
-
void 0
|
|
5092
|
-
);
|
|
4523
|
+
this.dragStart(event, this.dragDivText, TabNode._fromJson(this.newTabJson, this.props.model, false), true, void 0, void 0);
|
|
5093
4524
|
};
|
|
5094
4525
|
/** @internal */
|
|
5095
4526
|
this.dragStart = (event, dragDivText, node, allowDrag, onClick, onDoubleClick) => {
|
|
@@ -5140,11 +4571,7 @@ var Layout = class extends React16.Component {
|
|
|
5140
4571
|
}
|
|
5141
4572
|
}
|
|
5142
4573
|
if (this.props.onRenderDragRect !== void 0) {
|
|
5143
|
-
const customContent = this.props.onRenderDragRect(
|
|
5144
|
-
content,
|
|
5145
|
-
node,
|
|
5146
|
-
json
|
|
5147
|
-
);
|
|
4574
|
+
const customContent = this.props.onRenderDragRect(content, node, json);
|
|
5148
4575
|
if (customContent !== void 0) {
|
|
5149
4576
|
content = customContent;
|
|
5150
4577
|
}
|
|
@@ -5183,24 +4610,16 @@ var Layout = class extends React16.Component {
|
|
|
5183
4610
|
this.customDrop = void 0;
|
|
5184
4611
|
const rootdiv = this.selfRef.current;
|
|
5185
4612
|
this.outlineDiv = this.currentDocument.createElement("div");
|
|
5186
|
-
this.outlineDiv.className = this.getClassName(
|
|
5187
|
-
"flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */
|
|
5188
|
-
);
|
|
4613
|
+
this.outlineDiv.className = this.getClassName("flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */);
|
|
5189
4614
|
this.outlineDiv.style.visibility = "hidden";
|
|
5190
4615
|
if (rootdiv) {
|
|
5191
4616
|
rootdiv.appendChild(this.outlineDiv);
|
|
5192
4617
|
}
|
|
5193
4618
|
if (this.dragDiv == null) {
|
|
5194
4619
|
this.dragDiv = this.currentDocument.createElement("div");
|
|
5195
|
-
this.dragDiv.className = this.getClassName(
|
|
5196
|
-
"flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
|
|
5197
|
-
);
|
|
4620
|
+
this.dragDiv.className = this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */);
|
|
5198
4621
|
this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
|
|
5199
|
-
this.dragRectRender(
|
|
5200
|
-
this.dragDivText,
|
|
5201
|
-
this.dragNode,
|
|
5202
|
-
this.newTabJson
|
|
5203
|
-
);
|
|
4622
|
+
this.dragRectRender(this.dragDivText, this.dragNode, this.newTabJson);
|
|
5204
4623
|
if (rootdiv) {
|
|
5205
4624
|
rootdiv.appendChild(this.dragDiv);
|
|
5206
4625
|
}
|
|
@@ -5217,9 +4636,7 @@ var Layout = class extends React16.Component {
|
|
|
5217
4636
|
/** @internal */
|
|
5218
4637
|
this.onDragMove = (event) => {
|
|
5219
4638
|
if (this.firstMove === false) {
|
|
5220
|
-
const speed = this.props.model._getAttribute(
|
|
5221
|
-
"tabDragSpeed"
|
|
5222
|
-
);
|
|
4639
|
+
const speed = this.props.model._getAttribute("tabDragSpeed");
|
|
5223
4640
|
if (this.outlineDiv) {
|
|
5224
4641
|
this.outlineDiv.style.transition = `top ${speed}s, left ${speed}s, width ${speed}s, height ${speed}s`;
|
|
5225
4642
|
}
|
|
@@ -5244,20 +4661,14 @@ var Layout = class extends React16.Component {
|
|
|
5244
4661
|
this.dragDiv.style.visibility = "visible";
|
|
5245
4662
|
}
|
|
5246
4663
|
}
|
|
5247
|
-
let dropInfo = this.props.model._findDropTargetNode(
|
|
5248
|
-
this.dragNode,
|
|
5249
|
-
pos.x,
|
|
5250
|
-
pos.y
|
|
5251
|
-
);
|
|
4664
|
+
let dropInfo = this.props.model._findDropTargetNode(this.dragNode, pos.x, pos.y);
|
|
5252
4665
|
if (dropInfo) {
|
|
5253
4666
|
if (this.props.onTabDrag) {
|
|
5254
4667
|
this.handleCustomTabDrag(dropInfo, pos, event);
|
|
5255
4668
|
} else {
|
|
5256
4669
|
this.dropInfo = dropInfo;
|
|
5257
4670
|
if (this.outlineDiv) {
|
|
5258
|
-
this.outlineDiv.className = this.getClassName(
|
|
5259
|
-
dropInfo.className
|
|
5260
|
-
);
|
|
4671
|
+
this.outlineDiv.className = this.getClassName(dropInfo.className);
|
|
5261
4672
|
dropInfo.rect.positionElement(this.outlineDiv);
|
|
5262
4673
|
this.outlineDiv.style.visibility = "visible";
|
|
5263
4674
|
}
|
|
@@ -5293,28 +4704,14 @@ var Layout = class extends React16.Component {
|
|
|
5293
4704
|
console.error(e);
|
|
5294
4705
|
}
|
|
5295
4706
|
} else if (this.newTabJson !== void 0) {
|
|
5296
|
-
const newNode = this.doAction(
|
|
5297
|
-
Actions.addNode(
|
|
5298
|
-
this.newTabJson,
|
|
5299
|
-
this.dropInfo.node.getId(),
|
|
5300
|
-
this.dropInfo.location,
|
|
5301
|
-
this.dropInfo.index
|
|
5302
|
-
)
|
|
5303
|
-
);
|
|
4707
|
+
const newNode = this.doAction(Actions.addNode(this.newTabJson, this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
|
|
5304
4708
|
if (this.fnNewNodeDropped != null) {
|
|
5305
4709
|
this.fnNewNodeDropped(newNode, event);
|
|
5306
4710
|
this.fnNewNodeDropped = void 0;
|
|
5307
4711
|
}
|
|
5308
4712
|
this.newTabJson = void 0;
|
|
5309
4713
|
} else if (this.dragNode !== void 0) {
|
|
5310
|
-
this.doAction(
|
|
5311
|
-
Actions.moveNode(
|
|
5312
|
-
this.dragNode.getId(),
|
|
5313
|
-
this.dropInfo.node.getId(),
|
|
5314
|
-
this.dropInfo.location,
|
|
5315
|
-
this.dropInfo.index
|
|
5316
|
-
)
|
|
5317
|
-
);
|
|
4714
|
+
this.doAction(Actions.moveNode(this.dragNode.getId(), this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
|
|
5318
4715
|
}
|
|
5319
4716
|
}
|
|
5320
4717
|
this.setState({ showHiddenBorder: DockLocation.CENTER });
|
|
@@ -5344,16 +4741,10 @@ var Layout = class extends React16.Component {
|
|
|
5344
4741
|
if (this.props.font) {
|
|
5345
4742
|
if (this.selfRef.current) {
|
|
5346
4743
|
if (this.props.font.size) {
|
|
5347
|
-
this.selfRef.current.style.setProperty(
|
|
5348
|
-
"--font-size",
|
|
5349
|
-
this.props.font.size
|
|
5350
|
-
);
|
|
4744
|
+
this.selfRef.current.style.setProperty("--font-size", this.props.font.size);
|
|
5351
4745
|
}
|
|
5352
4746
|
if (this.props.font.family) {
|
|
5353
|
-
this.selfRef.current.style.setProperty(
|
|
5354
|
-
"--font-family",
|
|
5355
|
-
this.props.font.family
|
|
5356
|
-
);
|
|
4747
|
+
this.selfRef.current.style.setProperty("--font-family", this.props.font.family);
|
|
5357
4748
|
}
|
|
5358
4749
|
}
|
|
5359
4750
|
if (this.props.font.style) {
|
|
@@ -5448,18 +4839,9 @@ var Layout = class extends React16.Component {
|
|
|
5448
4839
|
/** @internal */
|
|
5449
4840
|
render() {
|
|
5450
4841
|
if (!this.selfRef.current) {
|
|
5451
|
-
return /* @__PURE__ */ React16.createElement(
|
|
5452
|
-
"div",
|
|
5453
|
-
{
|
|
5454
|
-
ref: this.selfRef,
|
|
5455
|
-
className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */)
|
|
5456
|
-
},
|
|
5457
|
-
this.metricsElements()
|
|
5458
|
-
);
|
|
4842
|
+
return /* @__PURE__ */ React16.createElement("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */) }, this.metricsElements());
|
|
5459
4843
|
}
|
|
5460
|
-
this.props.model._setPointerFine(
|
|
5461
|
-
window && window.matchMedia && window.matchMedia("(pointer: fine)").matches
|
|
5462
|
-
);
|
|
4844
|
+
this.props.model._setPointerFine(window && window.matchMedia && window.matchMedia("(pointer: fine)").matches);
|
|
5463
4845
|
const borderComponents = [];
|
|
5464
4846
|
const tabSetComponents = [];
|
|
5465
4847
|
const floatingWindows = [];
|
|
@@ -5472,21 +4854,8 @@ var Layout = class extends React16.Component {
|
|
|
5472
4854
|
};
|
|
5473
4855
|
this.props.model._setShowHiddenBorder(this.state.showHiddenBorder);
|
|
5474
4856
|
this.centerRect = this.props.model._layout(this.state.rect, metrics);
|
|
5475
|
-
this.renderBorder(
|
|
5476
|
-
|
|
5477
|
-
borderComponents,
|
|
5478
|
-
tabComponents,
|
|
5479
|
-
floatingWindows,
|
|
5480
|
-
splitterComponents
|
|
5481
|
-
);
|
|
5482
|
-
this.renderChildren(
|
|
5483
|
-
"",
|
|
5484
|
-
this.props.model.getRoot(),
|
|
5485
|
-
tabSetComponents,
|
|
5486
|
-
tabComponents,
|
|
5487
|
-
floatingWindows,
|
|
5488
|
-
splitterComponents
|
|
5489
|
-
);
|
|
4857
|
+
this.renderBorder(this.props.model.getBorderSet(), borderComponents, tabComponents, floatingWindows, splitterComponents);
|
|
4858
|
+
this.renderChildren("", this.props.model.getRoot(), tabSetComponents, tabComponents, floatingWindows, splitterComponents);
|
|
5490
4859
|
const nextTopIds = [];
|
|
5491
4860
|
const nextTopIdsMap = {};
|
|
5492
4861
|
for (const t of this.tabIds) {
|
|
@@ -5509,131 +4878,19 @@ var Layout = class extends React16.Component {
|
|
|
5509
4878
|
const offset = this.edgeRectLength / 2;
|
|
5510
4879
|
const className = this.getClassName("flexlayout__edge_rect" /* FLEXLAYOUT__EDGE_RECT */);
|
|
5511
4880
|
const radius = 50;
|
|
5512
|
-
edges.push(
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
key: "North",
|
|
5517
|
-
style: {
|
|
5518
|
-
top: r.y,
|
|
5519
|
-
left: r.x + r.width / 2 - offset,
|
|
5520
|
-
width: length,
|
|
5521
|
-
height: width,
|
|
5522
|
-
borderBottomLeftRadius: radius,
|
|
5523
|
-
borderBottomRightRadius: radius
|
|
5524
|
-
},
|
|
5525
|
-
className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */)
|
|
5526
|
-
}
|
|
5527
|
-
)
|
|
5528
|
-
);
|
|
5529
|
-
edges.push(
|
|
5530
|
-
/* @__PURE__ */ React16.createElement(
|
|
5531
|
-
"div",
|
|
5532
|
-
{
|
|
5533
|
-
key: "West",
|
|
5534
|
-
style: {
|
|
5535
|
-
top: r.y + r.height / 2 - offset,
|
|
5536
|
-
left: r.x,
|
|
5537
|
-
width,
|
|
5538
|
-
height: length,
|
|
5539
|
-
borderTopRightRadius: radius,
|
|
5540
|
-
borderBottomRightRadius: radius
|
|
5541
|
-
},
|
|
5542
|
-
className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */)
|
|
5543
|
-
}
|
|
5544
|
-
)
|
|
5545
|
-
);
|
|
5546
|
-
edges.push(
|
|
5547
|
-
/* @__PURE__ */ React16.createElement(
|
|
5548
|
-
"div",
|
|
5549
|
-
{
|
|
5550
|
-
key: "South",
|
|
5551
|
-
style: {
|
|
5552
|
-
top: r.y + r.height - width,
|
|
5553
|
-
left: r.x + r.width / 2 - offset,
|
|
5554
|
-
width: length,
|
|
5555
|
-
height: width,
|
|
5556
|
-
borderTopLeftRadius: radius,
|
|
5557
|
-
borderTopRightRadius: radius
|
|
5558
|
-
},
|
|
5559
|
-
className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */)
|
|
5560
|
-
}
|
|
5561
|
-
)
|
|
5562
|
-
);
|
|
5563
|
-
edges.push(
|
|
5564
|
-
/* @__PURE__ */ React16.createElement(
|
|
5565
|
-
"div",
|
|
5566
|
-
{
|
|
5567
|
-
key: "East",
|
|
5568
|
-
style: {
|
|
5569
|
-
top: r.y + r.height / 2 - offset,
|
|
5570
|
-
left: r.x + r.width - width,
|
|
5571
|
-
width,
|
|
5572
|
-
height: length,
|
|
5573
|
-
borderTopLeftRadius: radius,
|
|
5574
|
-
borderBottomLeftRadius: radius
|
|
5575
|
-
},
|
|
5576
|
-
className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */)
|
|
5577
|
-
}
|
|
5578
|
-
)
|
|
5579
|
-
);
|
|
4881
|
+
edges.push(/* @__PURE__ */ React16.createElement("div", { key: "North", style: { top: r.y, left: r.x + r.width / 2 - offset, width: length, height: width, borderBottomLeftRadius: radius, borderBottomRightRadius: radius }, className: className + " " + this.getClassName("flexlayout__edge_rect_top" /* FLEXLAYOUT__EDGE_RECT_TOP */) }));
|
|
4882
|
+
edges.push(/* @__PURE__ */ React16.createElement("div", { key: "West", style: { top: r.y + r.height / 2 - offset, left: r.x, width, height: length, borderTopRightRadius: radius, borderBottomRightRadius: radius }, className: className + " " + this.getClassName("flexlayout__edge_rect_left" /* FLEXLAYOUT__EDGE_RECT_LEFT */) }));
|
|
4883
|
+
edges.push(/* @__PURE__ */ React16.createElement("div", { key: "South", style: { top: r.y + r.height - width, left: r.x + r.width / 2 - offset, width: length, height: width, borderTopLeftRadius: radius, borderTopRightRadius: radius }, className: className + " " + this.getClassName("flexlayout__edge_rect_bottom" /* FLEXLAYOUT__EDGE_RECT_BOTTOM */) }));
|
|
4884
|
+
edges.push(/* @__PURE__ */ React16.createElement("div", { key: "East", style: { top: r.y + r.height / 2 - offset, left: r.x + r.width - width, width, height: length, borderTopLeftRadius: radius, borderBottomLeftRadius: radius }, className: className + " " + this.getClassName("flexlayout__edge_rect_right" /* FLEXLAYOUT__EDGE_RECT_RIGHT */) }));
|
|
5580
4885
|
}
|
|
5581
|
-
return /* @__PURE__ */ React16.createElement(
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
ref: this.selfRef,
|
|
5585
|
-
className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */),
|
|
5586
|
-
onDragEnter: this.props.onExternalDrag ? this.onDragEnter : void 0
|
|
5587
|
-
},
|
|
5588
|
-
tabSetComponents,
|
|
5589
|
-
this.tabIds.map((t) => {
|
|
5590
|
-
return tabComponents[t];
|
|
5591
|
-
}),
|
|
5592
|
-
borderComponents,
|
|
5593
|
-
splitterComponents,
|
|
5594
|
-
edges,
|
|
5595
|
-
floatingWindows,
|
|
5596
|
-
this.metricsElements(),
|
|
5597
|
-
this.state.portal
|
|
5598
|
-
);
|
|
4886
|
+
return /* @__PURE__ */ React16.createElement("div", { ref: this.selfRef, className: this.getClassName("flexlayout__layout" /* FLEXLAYOUT__LAYOUT */), onDragEnter: this.props.onExternalDrag ? this.onDragEnter : void 0 }, tabSetComponents, this.tabIds.map((t) => {
|
|
4887
|
+
return tabComponents[t];
|
|
4888
|
+
}), borderComponents, splitterComponents, edges, floatingWindows, this.metricsElements(), this.state.portal);
|
|
5599
4889
|
}
|
|
5600
4890
|
/** @internal */
|
|
5601
4891
|
metricsElements() {
|
|
5602
4892
|
const fontStyle = this.styleFont({ visibility: "hidden" });
|
|
5603
|
-
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
5604
|
-
"div",
|
|
5605
|
-
{
|
|
5606
|
-
key: "findHeaderBarSize",
|
|
5607
|
-
ref: this.findHeaderBarSizeRef,
|
|
5608
|
-
style: fontStyle,
|
|
5609
|
-
className: this.getClassName(
|
|
5610
|
-
"flexlayout__tabset_header_sizer" /* FLEXLAYOUT__TABSET_HEADER_SIZER */
|
|
5611
|
-
)
|
|
5612
|
-
},
|
|
5613
|
-
"FindHeaderBarSize"
|
|
5614
|
-
), /* @__PURE__ */ React16.createElement(
|
|
5615
|
-
"div",
|
|
5616
|
-
{
|
|
5617
|
-
key: "findTabBarSize",
|
|
5618
|
-
ref: this.findTabBarSizeRef,
|
|
5619
|
-
style: fontStyle,
|
|
5620
|
-
className: this.getClassName(
|
|
5621
|
-
"flexlayout__tabset_sizer" /* FLEXLAYOUT__TABSET_SIZER */
|
|
5622
|
-
)
|
|
5623
|
-
},
|
|
5624
|
-
"FindTabBarSize"
|
|
5625
|
-
), /* @__PURE__ */ React16.createElement(
|
|
5626
|
-
"div",
|
|
5627
|
-
{
|
|
5628
|
-
key: "findBorderBarSize",
|
|
5629
|
-
ref: this.findBorderBarSizeRef,
|
|
5630
|
-
style: fontStyle,
|
|
5631
|
-
className: this.getClassName(
|
|
5632
|
-
"flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */
|
|
5633
|
-
)
|
|
5634
|
-
},
|
|
5635
|
-
"FindBorderBarSize"
|
|
5636
|
-
));
|
|
4893
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", { key: "findHeaderBarSize", ref: this.findHeaderBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__tabset_header_sizer" /* FLEXLAYOUT__TABSET_HEADER_SIZER */) }, "FindHeaderBarSize"), /* @__PURE__ */ React16.createElement("div", { key: "findTabBarSize", ref: this.findTabBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__tabset_sizer" /* FLEXLAYOUT__TABSET_SIZER */) }, "FindTabBarSize"), /* @__PURE__ */ React16.createElement("div", { key: "findBorderBarSize", ref: this.findBorderBarSizeRef, style: fontStyle, className: this.getClassName("flexlayout__border_sizer" /* FLEXLAYOUT__BORDER_SIZER */) }, "FindBorderBarSize"));
|
|
5637
4894
|
}
|
|
5638
4895
|
/** @internal */
|
|
5639
4896
|
renderBorder(borderSet, borderComponents, tabComponents, floatingWindows, splitterComponents) {
|
|
@@ -5660,17 +4917,7 @@ var Layout = class extends React16.Component {
|
|
|
5660
4917
|
for (const child of drawChildren) {
|
|
5661
4918
|
if (child instanceof SplitterNode) {
|
|
5662
4919
|
let path = borderPath + "/s";
|
|
5663
|
-
splitterComponents.push(
|
|
5664
|
-
/* @__PURE__ */ React16.createElement(
|
|
5665
|
-
Splitter,
|
|
5666
|
-
{
|
|
5667
|
-
key: child.getId(),
|
|
5668
|
-
layout: this,
|
|
5669
|
-
node: child,
|
|
5670
|
-
path
|
|
5671
|
-
}
|
|
5672
|
-
)
|
|
5673
|
-
);
|
|
4920
|
+
splitterComponents.push(/* @__PURE__ */ React16.createElement(Splitter, { key: child.getId(), layout: this, node: child, path }));
|
|
5674
4921
|
} else if (child instanceof TabNode) {
|
|
5675
4922
|
let path = borderPath + "/t" + tabCount++;
|
|
5676
4923
|
if (this.supportsPopout && child.isFloating()) {
|
|
@@ -5696,14 +4943,7 @@ var Layout = class extends React16.Component {
|
|
|
5696
4943
|
onSetWindow: this.onSetWindow,
|
|
5697
4944
|
onCloseWindow: this.onCloseWindow
|
|
5698
4945
|
},
|
|
5699
|
-
/* @__PURE__ */ React16.createElement(
|
|
5700
|
-
FloatingWindowTab,
|
|
5701
|
-
{
|
|
5702
|
-
layout: this,
|
|
5703
|
-
node: child,
|
|
5704
|
-
factory: this.props.factory
|
|
5705
|
-
}
|
|
5706
|
-
)
|
|
4946
|
+
/* @__PURE__ */ React16.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })
|
|
5707
4947
|
)
|
|
5708
4948
|
);
|
|
5709
4949
|
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
@@ -5744,41 +4984,11 @@ var Layout = class extends React16.Component {
|
|
|
5744
4984
|
for (const child of drawChildren) {
|
|
5745
4985
|
if (child instanceof SplitterNode) {
|
|
5746
4986
|
const newPath = path + "/s" + splitterCount++;
|
|
5747
|
-
splitterComponents.push(
|
|
5748
|
-
/* @__PURE__ */ React16.createElement(
|
|
5749
|
-
Splitter,
|
|
5750
|
-
{
|
|
5751
|
-
key: child.getId(),
|
|
5752
|
-
layout: this,
|
|
5753
|
-
path: newPath,
|
|
5754
|
-
node: child
|
|
5755
|
-
}
|
|
5756
|
-
)
|
|
5757
|
-
);
|
|
4987
|
+
splitterComponents.push(/* @__PURE__ */ React16.createElement(Splitter, { key: child.getId(), layout: this, path: newPath, node: child }));
|
|
5758
4988
|
} else if (child instanceof TabSetNode) {
|
|
5759
4989
|
const newPath = path + "/ts" + rowCount++;
|
|
5760
|
-
tabSetComponents.push(
|
|
5761
|
-
|
|
5762
|
-
TabSet,
|
|
5763
|
-
{
|
|
5764
|
-
key: child.getId(),
|
|
5765
|
-
layout: this,
|
|
5766
|
-
path: newPath,
|
|
5767
|
-
node: child,
|
|
5768
|
-
iconFactory: this.props.iconFactory,
|
|
5769
|
-
titleFactory: this.props.titleFactory,
|
|
5770
|
-
icons: this.icons
|
|
5771
|
-
}
|
|
5772
|
-
)
|
|
5773
|
-
);
|
|
5774
|
-
this.renderChildren(
|
|
5775
|
-
newPath,
|
|
5776
|
-
child,
|
|
5777
|
-
tabSetComponents,
|
|
5778
|
-
tabComponents,
|
|
5779
|
-
floatingWindows,
|
|
5780
|
-
splitterComponents
|
|
5781
|
-
);
|
|
4990
|
+
tabSetComponents.push(/* @__PURE__ */ React16.createElement(TabSet, { key: child.getId(), layout: this, path: newPath, node: child, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons }));
|
|
4991
|
+
this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
|
|
5782
4992
|
} else if (child instanceof TabNode) {
|
|
5783
4993
|
const newPath = path + "/t" + tabCount++;
|
|
5784
4994
|
const selectedTab = child.getParent().getChildren()[child.getParent().getSelected()];
|
|
@@ -5799,49 +5009,16 @@ var Layout = class extends React16.Component {
|
|
|
5799
5009
|
onSetWindow: this.onSetWindow,
|
|
5800
5010
|
onCloseWindow: this.onCloseWindow
|
|
5801
5011
|
},
|
|
5802
|
-
/* @__PURE__ */ React16.createElement(
|
|
5803
|
-
FloatingWindowTab,
|
|
5804
|
-
{
|
|
5805
|
-
layout: this,
|
|
5806
|
-
node: child,
|
|
5807
|
-
factory: this.props.factory
|
|
5808
|
-
}
|
|
5809
|
-
)
|
|
5012
|
+
/* @__PURE__ */ React16.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })
|
|
5810
5013
|
)
|
|
5811
5014
|
);
|
|
5812
|
-
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5813
|
-
TabFloating,
|
|
5814
|
-
{
|
|
5815
|
-
key: child.getId(),
|
|
5816
|
-
layout: this,
|
|
5817
|
-
path: newPath,
|
|
5818
|
-
node: child,
|
|
5819
|
-
selected: child === selectedTab
|
|
5820
|
-
}
|
|
5821
|
-
);
|
|
5015
|
+
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(TabFloating, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab });
|
|
5822
5016
|
} else {
|
|
5823
|
-
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(
|
|
5824
|
-
Tab,
|
|
5825
|
-
{
|
|
5826
|
-
key: child.getId(),
|
|
5827
|
-
layout: this,
|
|
5828
|
-
path: newPath,
|
|
5829
|
-
node: child,
|
|
5830
|
-
selected: child === selectedTab,
|
|
5831
|
-
factory: this.props.factory
|
|
5832
|
-
}
|
|
5833
|
-
);
|
|
5017
|
+
tabComponents[child.getId()] = /* @__PURE__ */ React16.createElement(Tab, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab, factory: this.props.factory });
|
|
5834
5018
|
}
|
|
5835
5019
|
} else {
|
|
5836
5020
|
const newPath = path + (child.getOrientation() === Orientation.HORZ ? "/r" : "/c") + rowCount++;
|
|
5837
|
-
this.renderChildren(
|
|
5838
|
-
newPath,
|
|
5839
|
-
child,
|
|
5840
|
-
tabSetComponents,
|
|
5841
|
-
tabComponents,
|
|
5842
|
-
floatingWindows,
|
|
5843
|
-
splitterComponents
|
|
5844
|
-
);
|
|
5021
|
+
this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
|
|
5845
5022
|
}
|
|
5846
5023
|
}
|
|
5847
5024
|
}
|
|
@@ -5852,14 +5029,8 @@ var Layout = class extends React16.Component {
|
|
|
5852
5029
|
if (!bodyRect) {
|
|
5853
5030
|
return null;
|
|
5854
5031
|
}
|
|
5855
|
-
const navHeight = Math.min(
|
|
5856
|
-
|
|
5857
|
-
this.currentWindow.outerHeight - this.currentWindow.innerHeight
|
|
5858
|
-
);
|
|
5859
|
-
const navWidth = Math.min(
|
|
5860
|
-
80,
|
|
5861
|
-
this.currentWindow.outerWidth - this.currentWindow.innerWidth
|
|
5862
|
-
);
|
|
5032
|
+
const navHeight = Math.min(80, this.currentWindow.outerHeight - this.currentWindow.innerHeight);
|
|
5033
|
+
const navWidth = Math.min(80, this.currentWindow.outerWidth - this.currentWindow.innerWidth);
|
|
5863
5034
|
rect.x = rect.x + bodyRect.x + this.currentWindow.screenX + navWidth;
|
|
5864
5035
|
rect.y = rect.y + bodyRect.y + this.currentWindow.screenY + navHeight;
|
|
5865
5036
|
return rect;
|
|
@@ -5868,31 +5039,28 @@ var Layout = class extends React16.Component {
|
|
|
5868
5039
|
* Adds a new tab to the given tabset
|
|
5869
5040
|
* @param tabsetId the id of the tabset where the new tab will be added
|
|
5870
5041
|
* @param json the json for the new tab node
|
|
5042
|
+
* @returns the added tab node or undefined
|
|
5871
5043
|
*/
|
|
5872
5044
|
addTabToTabSet(tabsetId, json) {
|
|
5873
5045
|
const tabsetNode = this.props.model.getNodeById(tabsetId);
|
|
5874
5046
|
if (tabsetNode !== void 0) {
|
|
5875
|
-
this.doAction(
|
|
5876
|
-
|
|
5877
|
-
);
|
|
5047
|
+
const node = this.doAction(Actions.addNode(json, tabsetId, DockLocation.CENTER, -1));
|
|
5048
|
+
return node;
|
|
5878
5049
|
}
|
|
5050
|
+
return void 0;
|
|
5879
5051
|
}
|
|
5880
5052
|
/**
|
|
5881
5053
|
* Adds a new tab to the active tabset (if there is one)
|
|
5882
5054
|
* @param json the json for the new tab node
|
|
5055
|
+
* @returns the added tab node or undefined
|
|
5883
5056
|
*/
|
|
5884
5057
|
addTabToActiveTabSet(json) {
|
|
5885
5058
|
const tabsetNode = this.props.model.getActiveTabset();
|
|
5886
5059
|
if (tabsetNode !== void 0) {
|
|
5887
|
-
this.doAction(
|
|
5888
|
-
|
|
5889
|
-
json,
|
|
5890
|
-
tabsetNode.getId(),
|
|
5891
|
-
DockLocation.CENTER,
|
|
5892
|
-
-1
|
|
5893
|
-
)
|
|
5894
|
-
);
|
|
5060
|
+
const node = this.doAction(Actions.addNode(json, tabsetNode.getId(), DockLocation.CENTER, -1));
|
|
5061
|
+
return node;
|
|
5895
5062
|
}
|
|
5063
|
+
return void 0;
|
|
5896
5064
|
}
|
|
5897
5065
|
/**
|
|
5898
5066
|
* Adds a new tab by dragging a labeled panel to the drop location, dragging starts immediatelly
|
|
@@ -5903,14 +5071,7 @@ var Layout = class extends React16.Component {
|
|
|
5903
5071
|
addTabWithDragAndDrop(dragText, json, onDrop) {
|
|
5904
5072
|
this.fnNewNodeDropped = onDrop;
|
|
5905
5073
|
this.newTabJson = json;
|
|
5906
|
-
this.dragStart(
|
|
5907
|
-
void 0,
|
|
5908
|
-
dragText,
|
|
5909
|
-
TabNode._fromJson(json, this.props.model, false),
|
|
5910
|
-
true,
|
|
5911
|
-
void 0,
|
|
5912
|
-
void 0
|
|
5913
|
-
);
|
|
5074
|
+
this.dragStart(void 0, dragText, TabNode._fromJson(json, this.props.model, false), true, void 0, void 0);
|
|
5914
5075
|
}
|
|
5915
5076
|
/**
|
|
5916
5077
|
* Move a tab/tabset using drag and drop
|
|
@@ -5934,32 +5095,20 @@ var Layout = class extends React16.Component {
|
|
|
5934
5095
|
DragDrop.instance.addGlass(this.onCancelAdd);
|
|
5935
5096
|
this.dragDivText = dragText;
|
|
5936
5097
|
this.dragDiv = this.currentDocument.createElement("div");
|
|
5937
|
-
this.dragDiv.className = this.getClassName(
|
|
5938
|
-
"flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */
|
|
5939
|
-
);
|
|
5098
|
+
this.dragDiv.className = this.getClassName("flexlayout__drag_rect" /* FLEXLAYOUT__DRAG_RECT */);
|
|
5940
5099
|
this.dragDiv.addEventListener("mousedown", this.onDragDivMouseDown);
|
|
5941
|
-
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, {
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
const domRect = this.dragDiv.getBoundingClientRect();
|
|
5952
|
-
const r = new Rect(0, 0, domRect?.width, domRect?.height);
|
|
5953
|
-
r.centerInRect(this.state.rect);
|
|
5954
|
-
this.dragDiv.setAttribute(
|
|
5955
|
-
"data-layout-path",
|
|
5956
|
-
"/drag-rectangle"
|
|
5957
|
-
);
|
|
5958
|
-
this.dragDiv.style.left = r.x + "px";
|
|
5959
|
-
this.dragDiv.style.top = r.y + "px";
|
|
5960
|
-
}
|
|
5100
|
+
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, { passive: false });
|
|
5101
|
+
this.dragRectRender(this.dragDivText, void 0, this.newTabJson, () => {
|
|
5102
|
+
if (this.dragDiv) {
|
|
5103
|
+
this.dragDiv.style.visibility = "visible";
|
|
5104
|
+
const domRect = this.dragDiv.getBoundingClientRect();
|
|
5105
|
+
const r = new Rect(0, 0, domRect?.width, domRect?.height);
|
|
5106
|
+
r.centerInRect(this.state.rect);
|
|
5107
|
+
this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
|
|
5108
|
+
this.dragDiv.style.left = r.x + "px";
|
|
5109
|
+
this.dragDiv.style.top = r.y + "px";
|
|
5961
5110
|
}
|
|
5962
|
-
);
|
|
5111
|
+
});
|
|
5963
5112
|
const rootdiv = this.selfRef.current;
|
|
5964
5113
|
rootdiv.appendChild(this.dragDiv);
|
|
5965
5114
|
}
|
|
@@ -5975,22 +5124,10 @@ var Layout = class extends React16.Component {
|
|
|
5975
5124
|
if (selected && tabRect?.contains(pos.x, pos.y)) {
|
|
5976
5125
|
let customDrop = void 0;
|
|
5977
5126
|
try {
|
|
5978
|
-
const dest = this.onTabDrag(
|
|
5979
|
-
dragging,
|
|
5980
|
-
selected,
|
|
5981
|
-
pos.x - tabRect.x,
|
|
5982
|
-
pos.y - tabRect.y,
|
|
5983
|
-
dropInfo.location,
|
|
5984
|
-
() => this.onDragMove(event)
|
|
5985
|
-
);
|
|
5127
|
+
const dest = this.onTabDrag(dragging, selected, pos.x - tabRect.x, pos.y - tabRect.y, dropInfo.location, () => this.onDragMove(event));
|
|
5986
5128
|
if (dest) {
|
|
5987
5129
|
customDrop = {
|
|
5988
|
-
rect: new Rect(
|
|
5989
|
-
dest.x + tabRect.x,
|
|
5990
|
-
dest.y + tabRect.y,
|
|
5991
|
-
dest.width,
|
|
5992
|
-
dest.height
|
|
5993
|
-
),
|
|
5130
|
+
rect: new Rect(dest.x + tabRect.x, dest.y + tabRect.y, dest.width, dest.height),
|
|
5994
5131
|
callback: dest.callback,
|
|
5995
5132
|
invalidated: dest.invalidated,
|
|
5996
5133
|
dragging,
|
|
@@ -6012,9 +5149,7 @@ var Layout = class extends React16.Component {
|
|
|
6012
5149
|
}
|
|
6013
5150
|
this.dropInfo = dropInfo;
|
|
6014
5151
|
if (this.outlineDiv) {
|
|
6015
|
-
this.outlineDiv.className = this.getClassName(
|
|
6016
|
-
this.customDrop ? "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */ : dropInfo.className
|
|
6017
|
-
);
|
|
5152
|
+
this.outlineDiv.className = this.getClassName(this.customDrop ? "flexlayout__outline_rect" /* FLEXLAYOUT__OUTLINE_RECT */ : dropInfo.className);
|
|
6018
5153
|
if (this.customDrop) {
|
|
6019
5154
|
this.customDrop.rect.positionElement(this.outlineDiv);
|
|
6020
5155
|
} else {
|
|
@@ -6039,14 +5174,7 @@ var Layout = class extends React16.Component {
|
|
|
6039
5174
|
if (drag) {
|
|
6040
5175
|
this.fnNewNodeDropped = drag.onDrop;
|
|
6041
5176
|
this.newTabJson = drag.json;
|
|
6042
|
-
this.dragStart(
|
|
6043
|
-
event,
|
|
6044
|
-
drag.dragText,
|
|
6045
|
-
TabNode._fromJson(drag.json, this.props.model, false),
|
|
6046
|
-
true,
|
|
6047
|
-
void 0,
|
|
6048
|
-
void 0
|
|
6049
|
-
);
|
|
5177
|
+
this.dragStart(event, drag.dragText, TabNode._fromJson(drag.json, this.props.model, false), true, void 0, void 0);
|
|
6050
5178
|
}
|
|
6051
5179
|
}
|
|
6052
5180
|
/** @internal */
|
|
@@ -6141,9 +5269,7 @@ var BorderSet = class _BorderSet {
|
|
|
6141
5269
|
/** @internal */
|
|
6142
5270
|
static _fromJson(json, model) {
|
|
6143
5271
|
const borderSet = new _BorderSet(model);
|
|
6144
|
-
borderSet._borders = json.map(
|
|
6145
|
-
(borderJson) => BorderNode._fromJson(borderJson, model)
|
|
6146
|
-
);
|
|
5272
|
+
borderSet._borders = json.map((borderJson) => BorderNode._fromJson(borderJson, model));
|
|
6147
5273
|
return borderSet;
|
|
6148
5274
|
}
|
|
6149
5275
|
/** @internal */
|
|
@@ -6177,9 +5303,7 @@ var BorderSet = class _BorderSet {
|
|
|
6177
5303
|
let sumWidth = 0;
|
|
6178
5304
|
let adjustableHeight = 0;
|
|
6179
5305
|
let adjustableWidth = 0;
|
|
6180
|
-
const showingBorders = this._borders.filter(
|
|
6181
|
-
(border) => border.isShowing()
|
|
6182
|
-
);
|
|
5306
|
+
const showingBorders = this._borders.filter((border) => border.isShowing());
|
|
6183
5307
|
for (const border of showingBorders) {
|
|
6184
5308
|
border._setAdjustedSize(border.getSize());
|
|
6185
5309
|
const visible = border.getSelected() !== -1;
|
|
@@ -6227,17 +5351,11 @@ var BorderSet = class _BorderSet {
|
|
|
6227
5351
|
}
|
|
6228
5352
|
}
|
|
6229
5353
|
for (const border of showingBorders) {
|
|
6230
|
-
outerInnerRects.outer = border._layoutBorderOuter(
|
|
6231
|
-
outerInnerRects.outer,
|
|
6232
|
-
metrics
|
|
6233
|
-
);
|
|
5354
|
+
outerInnerRects.outer = border._layoutBorderOuter(outerInnerRects.outer, metrics);
|
|
6234
5355
|
}
|
|
6235
5356
|
outerInnerRects.inner = outerInnerRects.outer;
|
|
6236
5357
|
for (const border of showingBorders) {
|
|
6237
|
-
outerInnerRects.inner = border._layoutBorderInner(
|
|
6238
|
-
outerInnerRects.inner,
|
|
6239
|
-
metrics
|
|
6240
|
-
);
|
|
5358
|
+
outerInnerRects.inner = border._layoutBorderInner(outerInnerRects.inner, metrics);
|
|
6241
5359
|
}
|
|
6242
5360
|
return outerInnerRects;
|
|
6243
5361
|
}
|
|
@@ -6263,10 +5381,7 @@ var Model = class _Model {
|
|
|
6263
5381
|
*/
|
|
6264
5382
|
constructor() {
|
|
6265
5383
|
/** @internal */
|
|
6266
|
-
this._borderRects = {
|
|
6267
|
-
inner: Rect.empty(),
|
|
6268
|
-
outer: Rect.empty()
|
|
6269
|
-
};
|
|
5384
|
+
this._borderRects = { inner: Rect.empty(), outer: Rect.empty() };
|
|
6270
5385
|
this._attributes = {};
|
|
6271
5386
|
this._idMap = {};
|
|
6272
5387
|
this._borders = new BorderSet(this);
|
|
@@ -6321,6 +5436,7 @@ var Model = class _Model {
|
|
|
6321
5436
|
attributeDefinitions.add("tabSetEnableDivide", true).setType(Attribute.BOOLEAN);
|
|
6322
5437
|
attributeDefinitions.add("tabSetEnableMaximize", true).setType(Attribute.BOOLEAN);
|
|
6323
5438
|
attributeDefinitions.add("tabSetEnableClose", false).setType(Attribute.BOOLEAN);
|
|
5439
|
+
attributeDefinitions.add("tabSetEnableSingleTabStretch", false).setType(Attribute.BOOLEAN);
|
|
6324
5440
|
attributeDefinitions.add("tabSetAutoSelectTab", true).setType(Attribute.BOOLEAN);
|
|
6325
5441
|
attributeDefinitions.add("tabSetClassNameTabStrip", void 0).setType(Attribute.STRING);
|
|
6326
5442
|
attributeDefinitions.add("tabSetClassNameHeader", void 0).setType(Attribute.STRING);
|
|
@@ -6454,12 +5570,7 @@ var Model = class _Model {
|
|
|
6454
5570
|
const newNode = new TabNode(this, action.data.json, true);
|
|
6455
5571
|
const toNode = this._idMap[action.data.toNode];
|
|
6456
5572
|
if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
|
|
6457
|
-
toNode.drop(
|
|
6458
|
-
newNode,
|
|
6459
|
-
DockLocation.getByName(action.data.location),
|
|
6460
|
-
action.data.index,
|
|
6461
|
-
action.data.select
|
|
6462
|
-
);
|
|
5573
|
+
toNode.drop(newNode, DockLocation.getByName(action.data.location), action.data.index, action.data.select);
|
|
6463
5574
|
returnVal = newNode;
|
|
6464
5575
|
}
|
|
6465
5576
|
break;
|
|
@@ -6469,12 +5580,7 @@ var Model = class _Model {
|
|
|
6469
5580
|
if (fromNode instanceof TabNode || fromNode instanceof TabSetNode) {
|
|
6470
5581
|
const toNode = this._idMap[action.data.toNode];
|
|
6471
5582
|
if (toNode instanceof TabSetNode || toNode instanceof BorderNode || toNode instanceof RowNode) {
|
|
6472
|
-
toNode.drop(
|
|
6473
|
-
fromNode,
|
|
6474
|
-
DockLocation.getByName(action.data.location),
|
|
6475
|
-
action.data.index,
|
|
6476
|
-
action.data.select
|
|
6477
|
-
);
|
|
5583
|
+
toNode.drop(fromNode, DockLocation.getByName(action.data.location), action.data.index, action.data.select);
|
|
6478
5584
|
}
|
|
6479
5585
|
}
|
|
6480
5586
|
break;
|
|
@@ -6561,16 +5667,8 @@ var Model = class _Model {
|
|
|
6561
5667
|
const node1 = this._idMap[action.data.node1];
|
|
6562
5668
|
const node2 = this._idMap[action.data.node2];
|
|
6563
5669
|
if ((node1 instanceof TabSetNode || node1 instanceof RowNode) && (node2 instanceof TabSetNode || node2 instanceof RowNode)) {
|
|
6564
|
-
this._adjustSplitSide(
|
|
6565
|
-
|
|
6566
|
-
action.data.weight1,
|
|
6567
|
-
action.data.pixelWidth1
|
|
6568
|
-
);
|
|
6569
|
-
this._adjustSplitSide(
|
|
6570
|
-
node2,
|
|
6571
|
-
action.data.weight2,
|
|
6572
|
-
action.data.pixelWidth2
|
|
6573
|
-
);
|
|
5670
|
+
this._adjustSplitSide(node1, action.data.weight1, action.data.pixelWidth1);
|
|
5671
|
+
this._adjustSplitSide(node2, action.data.weight2, action.data.pixelWidth2);
|
|
6574
5672
|
}
|
|
6575
5673
|
break;
|
|
6576
5674
|
}
|
|
@@ -6635,11 +5733,7 @@ var Model = class _Model {
|
|
|
6635
5733
|
this.visitNodes((node) => {
|
|
6636
5734
|
node._fireEvent("save", void 0);
|
|
6637
5735
|
});
|
|
6638
|
-
return {
|
|
6639
|
-
global,
|
|
6640
|
-
borders: this._borders._toJson(),
|
|
6641
|
-
layout: this._root.toJson()
|
|
6642
|
-
};
|
|
5736
|
+
return { global, borders: this._borders._toJson(), layout: this._root.toJson() };
|
|
6643
5737
|
}
|
|
6644
5738
|
getSplitterSize() {
|
|
6645
5739
|
let splitterSize = this._attributes.splitterSize;
|
|
@@ -6661,9 +5755,7 @@ var Model = class _Model {
|
|
|
6661
5755
|
_addNode(node) {
|
|
6662
5756
|
const id = node.getId();
|
|
6663
5757
|
if (this._idMap[id] !== void 0) {
|
|
6664
|
-
throw new Error(
|
|
6665
|
-
`Error: each node must have a unique id, duplicate id:${node.getId()}`
|
|
6666
|
-
);
|
|
5758
|
+
throw new Error(`Error: each node must have a unique id, duplicate id:${node.getId()}`);
|
|
6667
5759
|
}
|
|
6668
5760
|
if (node.getType() !== "splitter") {
|
|
6669
5761
|
this._idMap[id] = node;
|
|
@@ -6671,13 +5763,8 @@ var Model = class _Model {
|
|
|
6671
5763
|
}
|
|
6672
5764
|
/** @internal */
|
|
6673
5765
|
_layout(rect, metrics) {
|
|
6674
|
-
this._borderRects = this._borders._layoutBorder(
|
|
6675
|
-
|
|
6676
|
-
metrics
|
|
6677
|
-
);
|
|
6678
|
-
rect = this._borderRects.inner.removeInsets(
|
|
6679
|
-
this._getAttribute("marginInsets")
|
|
6680
|
-
);
|
|
5766
|
+
this._borderRects = this._borders._layoutBorder({ outer: rect, inner: rect }, metrics);
|
|
5767
|
+
rect = this._borderRects.inner.removeInsets(this._getAttribute("marginInsets"));
|
|
6681
5768
|
this._root?.calcMinSize();
|
|
6682
5769
|
this._root._layout(rect, metrics);
|
|
6683
5770
|
return rect;
|
|
@@ -6721,7 +5808,7 @@ var Model = class _Model {
|
|
|
6721
5808
|
* set callback called when a new TabSet is created.
|
|
6722
5809
|
* The tabNode can be undefined if it's the auto created first tabset in the root row (when the last
|
|
6723
5810
|
* tab is deleted, the root tabset can be recreated)
|
|
6724
|
-
* @param onCreateTabSet
|
|
5811
|
+
* @param onCreateTabSet
|
|
6725
5812
|
*/
|
|
6726
5813
|
setOnCreateTabSet(onCreateTabSet) {
|
|
6727
5814
|
this._onCreateTabSet = onCreateTabSet;
|
|
@@ -6731,36 +5818,11 @@ var Model = class _Model {
|
|
|
6731
5818
|
return this._onCreateTabSet;
|
|
6732
5819
|
}
|
|
6733
5820
|
static toTypescriptInterfaces() {
|
|
6734
|
-
console.log(
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
);
|
|
6740
|
-
console.log(
|
|
6741
|
-
RowNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6742
|
-
"Row",
|
|
6743
|
-
_Model._attributeDefinitions
|
|
6744
|
-
)
|
|
6745
|
-
);
|
|
6746
|
-
console.log(
|
|
6747
|
-
TabSetNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6748
|
-
"TabSet",
|
|
6749
|
-
_Model._attributeDefinitions
|
|
6750
|
-
)
|
|
6751
|
-
);
|
|
6752
|
-
console.log(
|
|
6753
|
-
TabNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6754
|
-
"Tab",
|
|
6755
|
-
_Model._attributeDefinitions
|
|
6756
|
-
)
|
|
6757
|
-
);
|
|
6758
|
-
console.log(
|
|
6759
|
-
BorderNode.getAttributeDefinitions().toTypescriptInterface(
|
|
6760
|
-
"Border",
|
|
6761
|
-
_Model._attributeDefinitions
|
|
6762
|
-
)
|
|
6763
|
-
);
|
|
5821
|
+
console.log(_Model._attributeDefinitions.toTypescriptInterface("Global", void 0));
|
|
5822
|
+
console.log(RowNode.getAttributeDefinitions().toTypescriptInterface("Row", _Model._attributeDefinitions));
|
|
5823
|
+
console.log(TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet", _Model._attributeDefinitions));
|
|
5824
|
+
console.log(TabNode.getAttributeDefinitions().toTypescriptInterface("Tab", _Model._attributeDefinitions));
|
|
5825
|
+
console.log(BorderNode.getAttributeDefinitions().toTypescriptInterface("Border", _Model._attributeDefinitions));
|
|
6764
5826
|
}
|
|
6765
5827
|
toString() {
|
|
6766
5828
|
return JSON.stringify(this.toJson());
|