flexlayout-react 0.7.14 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/ChangeLog.txt +26 -0
  2. package/README.md +157 -330
  3. package/Screenshot_light.png +0 -0
  4. package/Screenshot_rounded.png +0 -0
  5. package/declarations/Attribute.d.ts +1 -1
  6. package/declarations/AttributeDefinitions.d.ts +1 -1
  7. package/declarations/DockLocation.d.ts +12 -12
  8. package/declarations/DropInfo.d.ts +12 -12
  9. package/declarations/I18nLabel.d.ts +12 -14
  10. package/declarations/Orientation.d.ts +7 -7
  11. package/declarations/PopupMenu.d.ts +1 -1
  12. package/declarations/Rect.d.ts +41 -28
  13. package/declarations/Types.d.ts +95 -79
  14. package/declarations/examples/demo/Utils.d.ts +4 -0
  15. package/declarations/index.d.ts +21 -22
  16. package/declarations/model/Action.d.ts +5 -5
  17. package/declarations/model/Actions.d.ts +127 -110
  18. package/declarations/model/BorderNode.d.ts +30 -34
  19. package/declarations/model/BorderSet.d.ts +3 -4
  20. package/declarations/model/ICloseType.d.ts +5 -5
  21. package/declarations/model/IDraggable.d.ts +2 -2
  22. package/declarations/model/IDropTarget.d.ts +2 -2
  23. package/declarations/model/IJsonModel.d.ts +811 -149
  24. package/declarations/model/LayoutWindow.d.ts +28 -0
  25. package/declarations/model/Model.d.ts +91 -86
  26. package/declarations/model/Node.d.ts +17 -17
  27. package/declarations/model/RowNode.d.ts +10 -11
  28. package/declarations/model/TabNode.d.ts +44 -37
  29. package/declarations/model/TabSetNode.d.ts +44 -41
  30. package/declarations/model/Utils.d.ts +1 -1
  31. package/declarations/model/WindowLayout.d.ts +24 -0
  32. package/declarations/src/Attribute.d.ts +1 -0
  33. package/declarations/src/AttributeDefinitions.d.ts +1 -0
  34. package/declarations/src/DockLocation.d.ts +12 -0
  35. package/declarations/src/DropInfo.d.ts +12 -0
  36. package/declarations/src/I18nLabel.d.ts +10 -0
  37. package/declarations/src/Orientation.d.ts +7 -0
  38. package/declarations/src/PopupMenu.d.ts +1 -0
  39. package/declarations/src/Rect.d.ts +31 -0
  40. package/declarations/src/Types.d.ts +92 -0
  41. package/declarations/src/index.d.ts +20 -0
  42. package/declarations/src/model/Action.d.ts +5 -0
  43. package/declarations/src/model/Actions.d.ts +110 -0
  44. package/declarations/src/model/BorderNode.d.ts +28 -0
  45. package/declarations/src/model/BorderSet.d.ts +3 -0
  46. package/declarations/src/model/ICloseType.d.ts +5 -0
  47. package/declarations/src/model/IDraggable.d.ts +2 -0
  48. package/declarations/src/model/IDropTarget.d.ts +2 -0
  49. package/declarations/src/model/IJsonModel.d.ts +153 -0
  50. package/declarations/src/model/Model.d.ts +98 -0
  51. package/declarations/src/model/Node.d.ts +16 -0
  52. package/declarations/src/model/RowNode.d.ts +11 -0
  53. package/declarations/src/model/TabNode.d.ts +36 -0
  54. package/declarations/src/model/TabSetNode.d.ts +37 -0
  55. package/declarations/src/model/Utils.d.ts +1 -0
  56. package/declarations/src/view/BorderButton.d.ts +1 -0
  57. package/declarations/src/view/BorderTab.d.ts +2 -0
  58. package/declarations/src/view/BorderTabSet.d.ts +1 -0
  59. package/declarations/src/view/DragContainer.d.ts +1 -0
  60. package/declarations/src/view/ErrorBoundary.d.ts +1 -0
  61. package/declarations/src/view/FloatingWindow.d.ts +1 -0
  62. package/declarations/src/view/Icons.d.ts +7 -0
  63. package/declarations/src/view/Layout.d.ts +113 -0
  64. package/declarations/src/view/Overlay.d.ts +1 -0
  65. package/declarations/src/view/PopupMenu.d.ts +1 -0
  66. package/declarations/src/view/Row.d.ts +1 -0
  67. package/declarations/src/view/Splitter.d.ts +1 -0
  68. package/declarations/src/view/Tab.d.ts +1 -0
  69. package/declarations/src/view/TabButton.d.ts +1 -0
  70. package/declarations/src/view/TabButtonStamp.d.ts +1 -0
  71. package/declarations/src/view/TabOverflowHook.d.ts +1 -0
  72. package/declarations/src/view/TabSet.d.ts +1 -0
  73. package/declarations/src/view/Utils.d.ts +4 -0
  74. package/declarations/view/BorderButton.d.ts +1 -1
  75. package/declarations/view/BorderTab.d.ts +2 -0
  76. package/declarations/view/BorderTabSet.d.ts +1 -1
  77. package/declarations/view/DragContainer.d.ts +1 -0
  78. package/declarations/view/ErrorBoundary.d.ts +1 -1
  79. package/declarations/view/ExtendedResizeObserver.d.ts +23 -0
  80. package/declarations/view/FloatingWindow.d.ts +1 -1
  81. package/declarations/view/Icons.d.ts +8 -6
  82. package/declarations/view/Layout.d.ts +139 -160
  83. package/declarations/view/Overlay.d.ts +1 -0
  84. package/declarations/view/PopoutWindow.d.ts +1 -0
  85. package/declarations/view/PopupMenu.d.ts +1 -0
  86. package/declarations/view/Row.d.ts +1 -0
  87. package/declarations/view/SizeTracker.d.ts +10 -0
  88. package/declarations/view/Splitter.d.ts +1 -1
  89. package/declarations/view/Tab.d.ts +1 -1
  90. package/declarations/view/TabButton.d.ts +1 -1
  91. package/declarations/view/TabButtonStamp.d.ts +1 -1
  92. package/declarations/view/TabOverflowHook.d.ts +1 -1
  93. package/declarations/view/TabSet.d.ts +1 -1
  94. package/declarations/view/Utils.d.ts +11 -1
  95. package/dist/bundles/demo.js +232052 -0
  96. package/dist/bundles/demo.js.map +1 -0
  97. package/dist/flexlayout.js +122 -92
  98. package/dist/flexlayout_min.js +1 -1
  99. package/lib/Attribute.js +42 -31
  100. package/lib/Attribute.js.map +1 -1
  101. package/lib/AttributeDefinitions.js +131 -108
  102. package/lib/AttributeDefinitions.js.map +1 -1
  103. package/lib/DockLocation.js +120 -124
  104. package/lib/DockLocation.js.map +1 -1
  105. package/lib/DropInfo.js +9 -13
  106. package/lib/DropInfo.js.map +1 -1
  107. package/lib/I18nLabel.js +13 -18
  108. package/lib/I18nLabel.js.map +1 -1
  109. package/lib/Orientation.js +22 -26
  110. package/lib/Orientation.js.map +1 -1
  111. package/lib/Rect.js +104 -72
  112. package/lib/Rect.js.map +1 -1
  113. package/lib/Types.js +96 -83
  114. package/lib/Types.js.map +1 -1
  115. package/lib/index.js +21 -38
  116. package/lib/index.js.map +1 -1
  117. package/lib/model/Action.js +6 -10
  118. package/lib/model/Action.js.map +1 -1
  119. package/lib/model/Actions.js +169 -155
  120. package/lib/model/Actions.js.map +1 -1
  121. package/lib/model/BorderNode.js +385 -406
  122. package/lib/model/BorderNode.js.map +1 -1
  123. package/lib/model/BorderSet.js +66 -121
  124. package/lib/model/BorderSet.js.map +1 -1
  125. package/lib/model/ICloseType.js +6 -9
  126. package/lib/model/ICloseType.js.map +1 -1
  127. package/lib/model/IDraggable.js +1 -2
  128. package/lib/model/IDropTarget.js +1 -2
  129. package/lib/model/IJsonModel.js +1 -2
  130. package/lib/model/LayoutWindow.js +83 -0
  131. package/lib/model/LayoutWindow.js.map +1 -0
  132. package/lib/model/Model.js +614 -496
  133. package/lib/model/Model.js.map +1 -1
  134. package/lib/model/Node.js +217 -228
  135. package/lib/model/Node.js.map +1 -1
  136. package/lib/model/RowNode.js +491 -504
  137. package/lib/model/RowNode.js.map +1 -1
  138. package/lib/model/TabNode.js +289 -184
  139. package/lib/model/TabNode.js.map +1 -1
  140. package/lib/model/TabSetNode.js +457 -446
  141. package/lib/model/TabSetNode.js.map +1 -1
  142. package/lib/model/Utils.js +47 -82
  143. package/lib/model/Utils.js.map +1 -1
  144. package/lib/view/BorderButton.js +124 -138
  145. package/lib/view/BorderButton.js.map +1 -1
  146. package/lib/view/BorderTab.js +47 -0
  147. package/lib/view/BorderTab.js.map +1 -0
  148. package/lib/view/BorderTabSet.js +134 -128
  149. package/lib/view/BorderTabSet.js.map +1 -1
  150. package/lib/view/DragContainer.js +16 -0
  151. package/lib/view/DragContainer.js.map +1 -0
  152. package/lib/view/ErrorBoundary.js +23 -27
  153. package/lib/view/ErrorBoundary.js.map +1 -1
  154. package/lib/view/Icons.js +40 -40
  155. package/lib/view/Icons.js.map +1 -1
  156. package/lib/view/Layout.js +918 -901
  157. package/lib/view/Layout.js.map +1 -1
  158. package/lib/view/Overlay.js +9 -0
  159. package/lib/view/Overlay.js.map +1 -0
  160. package/lib/view/PopoutWindow.js +129 -0
  161. package/lib/view/PopoutWindow.js.map +1 -0
  162. package/lib/view/PopupMenu.js +71 -0
  163. package/lib/view/PopupMenu.js.map +1 -0
  164. package/lib/view/Row.js +45 -0
  165. package/lib/view/Row.js.map +1 -0
  166. package/lib/view/SizeTracker.js +11 -0
  167. package/lib/view/SizeTracker.js.map +1 -0
  168. package/lib/view/Splitter.js +191 -147
  169. package/lib/view/Splitter.js.map +1 -1
  170. package/lib/view/Tab.js +86 -60
  171. package/lib/view/Tab.js.map +1 -1
  172. package/lib/view/TabButton.js +122 -135
  173. package/lib/view/TabButton.js.map +1 -1
  174. package/lib/view/TabButtonStamp.js +16 -21
  175. package/lib/view/TabButtonStamp.js.map +1 -1
  176. package/lib/view/TabOverflowHook.js +150 -149
  177. package/lib/view/TabOverflowHook.js.map +1 -1
  178. package/lib/view/TabSet.js +267 -234
  179. package/lib/view/TabSet.js.map +1 -1
  180. package/lib/view/Utils.js +126 -68
  181. package/lib/view/Utils.js.map +1 -1
  182. package/package.json +36 -30
  183. package/src/Attribute.ts +23 -0
  184. package/src/AttributeDefinitions.ts +38 -15
  185. package/src/DockLocation.ts +13 -13
  186. package/src/I18nLabel.ts +7 -9
  187. package/src/Rect.ts +53 -1
  188. package/src/Types.ts +16 -0
  189. package/src/index.ts +1 -2
  190. package/src/model/Actions.ts +49 -29
  191. package/src/model/BorderNode.ts +208 -214
  192. package/src/model/BorderSet.ts +42 -91
  193. package/src/model/IJsonModel.ts +883 -103
  194. package/src/model/LayoutWindow.ts +121 -0
  195. package/src/model/Model.ts +488 -366
  196. package/src/model/Node.ts +98 -111
  197. package/src/model/RowNode.ts +323 -319
  198. package/src/model/TabNode.ts +294 -110
  199. package/src/model/TabSetNode.ts +300 -242
  200. package/src/model/Utils.ts +6 -32
  201. package/src/view/BorderButton.tsx +32 -52
  202. package/src/view/BorderTab.tsx +70 -0
  203. package/src/view/BorderTabSet.tsx +64 -52
  204. package/src/view/DragContainer.tsx +32 -0
  205. package/src/view/Icons.tsx +13 -0
  206. package/src/view/Layout.tsx +1071 -1047
  207. package/src/view/Overlay.tsx +22 -0
  208. package/src/view/PopoutWindow.tsx +152 -0
  209. package/src/{PopupMenu.tsx → view/PopupMenu.tsx} +36 -31
  210. package/src/view/Row.tsx +68 -0
  211. package/src/view/SizeTracker.tsx +20 -0
  212. package/src/view/Splitter.tsx +167 -112
  213. package/src/view/Tab.tsx +76 -42
  214. package/src/view/TabButton.tsx +36 -55
  215. package/src/view/TabButtonStamp.tsx +5 -9
  216. package/src/view/TabOverflowHook.tsx +14 -9
  217. package/src/view/TabSet.tsx +217 -176
  218. package/src/view/Utils.tsx +119 -39
  219. package/style/_base.scss +143 -35
  220. package/style/dark.css +685 -577
  221. package/style/dark.css.map +1 -1
  222. package/style/dark.scss +4 -1
  223. package/style/gray.css +668 -560
  224. package/style/gray.css.map +1 -1
  225. package/style/gray.scss +4 -1
  226. package/style/light.css +669 -561
  227. package/style/light.css.map +1 -1
  228. package/style/light.scss +6 -3
  229. package/style/rounded.css +697 -0
  230. package/style/rounded.css.map +1 -0
  231. package/style/rounded.scss +194 -0
  232. package/style/underline.css +690 -582
  233. package/style/underline.css.map +1 -1
  234. package/style/underline.scss +4 -1
  235. package/cypress.config.ts +0 -16
  236. package/lib/DragDrop.js +0 -316
  237. package/lib/DragDrop.js.map +0 -1
  238. package/lib/PopupMenu.js +0 -68
  239. package/lib/PopupMenu.js.map +0 -1
  240. package/lib/model/SplitterNode.js +0 -72
  241. package/lib/model/SplitterNode.js.map +0 -1
  242. package/lib/view/FloatingWindow.js +0 -123
  243. package/lib/view/FloatingWindow.js.map +0 -1
  244. package/lib/view/FloatingWindowTab.js +0 -19
  245. package/lib/view/FloatingWindowTab.js.map +0 -1
  246. package/lib/view/TabFloating.js +0 -66
  247. package/lib/view/TabFloating.js.map +0 -1
  248. package/src/DragDrop.ts +0 -392
  249. package/src/model/SplitterNode.ts +0 -78
  250. package/src/view/FloatingWindow.tsx +0 -140
  251. package/src/view/FloatingWindowTab.tsx +0 -29
  252. package/src/view/TabFloating.tsx +0 -101
@@ -1,407 +1,386 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BorderNode = void 0;
4
- const Attribute_1 = require("../Attribute");
5
- const AttributeDefinitions_1 = require("../AttributeDefinitions");
6
- const DockLocation_1 = require("../DockLocation");
7
- const DropInfo_1 = require("../DropInfo");
8
- const Orientation_1 = require("../Orientation");
9
- const Rect_1 = require("../Rect");
10
- const Types_1 = require("../Types");
11
- const Node_1 = require("./Node");
12
- const SplitterNode_1 = require("./SplitterNode");
13
- const TabNode_1 = require("./TabNode");
14
- const Utils_1 = require("./Utils");
15
- class BorderNode extends Node_1.Node {
16
- /** @internal */
17
- static _fromJson(json, model) {
18
- const location = DockLocation_1.DockLocation.getByName(json.location);
19
- const border = new BorderNode(location, json, model);
20
- if (json.children) {
21
- border._children = json.children.map((jsonChild) => {
22
- const child = TabNode_1.TabNode._fromJson(jsonChild, model);
23
- child._setParent(border);
24
- return child;
25
- });
26
- }
27
- return border;
28
- }
29
- /** @internal */
30
- static _createAttributeDefinitions() {
31
- const attributeDefinitions = new AttributeDefinitions_1.AttributeDefinitions();
32
- attributeDefinitions.add("type", BorderNode.TYPE, true).setType(Attribute_1.Attribute.STRING).setFixed();
33
- attributeDefinitions.add("selected", -1).setType(Attribute_1.Attribute.NUMBER);
34
- attributeDefinitions.add("show", true).setType(Attribute_1.Attribute.BOOLEAN);
35
- attributeDefinitions.add("config", undefined).setType("any");
36
- attributeDefinitions.addInherited("barSize", "borderBarSize").setType(Attribute_1.Attribute.NUMBER);
37
- attributeDefinitions.addInherited("enableDrop", "borderEnableDrop").setType(Attribute_1.Attribute.BOOLEAN);
38
- attributeDefinitions.addInherited("className", "borderClassName").setType(Attribute_1.Attribute.STRING);
39
- attributeDefinitions.addInherited("autoSelectTabWhenOpen", "borderAutoSelectTabWhenOpen").setType(Attribute_1.Attribute.BOOLEAN);
40
- attributeDefinitions.addInherited("autoSelectTabWhenClosed", "borderAutoSelectTabWhenClosed").setType(Attribute_1.Attribute.BOOLEAN);
41
- attributeDefinitions.addInherited("size", "borderSize").setType(Attribute_1.Attribute.NUMBER);
42
- attributeDefinitions.addInherited("minSize", "borderMinSize").setType(Attribute_1.Attribute.NUMBER);
43
- attributeDefinitions.addInherited("enableAutoHide", "borderEnableAutoHide").setType(Attribute_1.Attribute.BOOLEAN);
44
- return attributeDefinitions;
45
- }
46
- /** @internal */
47
- constructor(location, json, model) {
48
- super(model);
49
- /** @internal */
50
- this._adjustedSize = 0;
51
- /** @internal */
52
- this._calculatedBorderBarSize = 0;
53
- this._location = location;
54
- this._drawChildren = [];
55
- this._attributes.id = `border_${location.getName()}`;
56
- BorderNode._attributeDefinitions.fromJson(json, this._attributes);
57
- model._addNode(this);
58
- }
59
- getLocation() {
60
- return this._location;
61
- }
62
- getTabHeaderRect() {
63
- return this._tabHeaderRect;
64
- }
65
- getRect() {
66
- return this._tabHeaderRect;
67
- }
68
- getContentRect() {
69
- return this._contentRect;
70
- }
71
- isEnableDrop() {
72
- return this._getAttr("enableDrop");
73
- }
74
- isAutoSelectTab(whenOpen) {
75
- if (whenOpen == null) {
76
- whenOpen = this.getSelected() !== -1;
77
- }
78
- if (whenOpen) {
79
- return this._getAttr("autoSelectTabWhenOpen");
80
- }
81
- else {
82
- return this._getAttr("autoSelectTabWhenClosed");
83
- }
84
- }
85
- getClassName() {
86
- return this._getAttr("className");
87
- }
88
- /** @internal */
89
- calcBorderBarSize(metrics) {
90
- const barSize = this._getAttr("barSize");
91
- if (barSize !== 0) {
92
- // its defined
93
- this._calculatedBorderBarSize = barSize;
94
- }
95
- else {
96
- this._calculatedBorderBarSize = metrics.borderBarSize;
97
- }
98
- }
99
- getBorderBarSize() {
100
- return this._calculatedBorderBarSize;
101
- }
102
- getSize() {
103
- const defaultSize = this._getAttr("size");
104
- const selected = this.getSelected();
105
- if (selected === -1) {
106
- return defaultSize;
107
- }
108
- else {
109
- const tabNode = this._children[selected];
110
- const tabBorderSize = (this._location._orientation === Orientation_1.Orientation.HORZ) ? tabNode._getAttr("borderWidth") : tabNode._getAttr("borderHeight");
111
- if (tabBorderSize === -1) {
112
- return defaultSize;
113
- }
114
- else {
115
- return tabBorderSize;
116
- }
117
- }
118
- }
119
- getMinSize() {
120
- return this._getAttr("minSize");
121
- }
122
- getSelected() {
123
- return this._attributes.selected;
124
- }
125
- getSelectedNode() {
126
- if (this.getSelected() !== -1) {
127
- return this._children[this.getSelected()];
128
- }
129
- return undefined;
130
- }
131
- getOrientation() {
132
- return this._location.getOrientation();
133
- }
134
- /**
135
- * Returns the config attribute that can be used to store node specific data that
136
- * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
137
- * than directly, for example:
138
- * this.state.model.doAction(
139
- * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
140
- */
141
- getConfig() {
142
- return this._attributes.config;
143
- }
144
- isMaximized() {
145
- return false;
146
- }
147
- isShowing() {
148
- const show = this._attributes.show;
149
- if (show) {
150
- if (this._model._getShowHiddenBorder() !== this._location && this.isAutoHide() && this._children.length === 0) {
151
- return false;
152
- }
153
- return true;
154
- }
155
- else {
156
- return false;
157
- }
158
- }
159
- isAutoHide() {
160
- return this._getAttr("enableAutoHide");
161
- }
162
- /** @internal */
163
- _setSelected(index) {
164
- this._attributes.selected = index;
165
- }
166
- /** @internal */
167
- _setSize(pos) {
168
- const selected = this.getSelected();
169
- if (selected === -1) {
170
- this._attributes.size = pos;
171
- }
172
- else {
173
- const tabNode = this._children[selected];
174
- const tabBorderSize = (this._location._orientation === Orientation_1.Orientation.HORZ) ? tabNode._getAttr("borderWidth") : tabNode._getAttr("borderHeight");
175
- if (tabBorderSize === -1) {
176
- this._attributes.size = pos;
177
- }
178
- else {
179
- if (this._location._orientation === Orientation_1.Orientation.HORZ) {
180
- tabNode._setBorderWidth(pos);
181
- }
182
- else {
183
- tabNode._setBorderHeight(pos);
184
- }
185
- }
186
- }
187
- }
188
- /** @internal */
189
- _updateAttrs(json) {
190
- BorderNode._attributeDefinitions.update(json, this._attributes);
191
- }
192
- /** @internal */
193
- _getDrawChildren() {
194
- return this._drawChildren;
195
- }
196
- /** @internal */
197
- _setAdjustedSize(size) {
198
- this._adjustedSize = size;
199
- }
200
- /** @internal */
201
- _getAdjustedSize() {
202
- return this._adjustedSize;
203
- }
204
- /** @internal */
205
- _layoutBorderOuter(outer, metrics) {
206
- this.calcBorderBarSize(metrics);
207
- const split1 = this._location.split(outer, this.getBorderBarSize()); // split border outer
208
- this._tabHeaderRect = split1.start;
209
- return split1.end;
210
- }
211
- /** @internal */
212
- _layoutBorderInner(inner, metrics) {
213
- this._drawChildren = [];
214
- const location = this._location;
215
- const split1 = location.split(inner, this._adjustedSize + this._model.getSplitterSize()); // split off tab contents
216
- const split2 = location.reflect().split(split1.start, this._model.getSplitterSize()); // split contents into content and splitter
217
- this._contentRect = split2.end;
218
- for (let i = 0; i < this._children.length; i++) {
219
- const child = this._children[i];
220
- child._layout(this._contentRect, metrics);
221
- child._setVisible(i === this.getSelected());
222
- this._drawChildren.push(child);
223
- }
224
- if (this.getSelected() === -1) {
225
- return inner;
226
- }
227
- else {
228
- const newSplitter = new SplitterNode_1.SplitterNode(this._model);
229
- newSplitter._setParent(this);
230
- newSplitter._setRect(split2.start);
231
- this._drawChildren.push(newSplitter);
232
- return split1.end;
233
- }
234
- }
235
- /** @internal */
236
- _remove(node) {
237
- const removedIndex = this._removeChild(node);
238
- if (this.getSelected() !== -1) {
239
- (0, Utils_1.adjustSelectedIndex)(this, removedIndex);
240
- }
241
- }
242
- /** @internal */
243
- canDrop(dragNode, x, y) {
244
- if (dragNode.getType() !== TabNode_1.TabNode.TYPE) {
245
- return undefined;
246
- }
247
- let dropInfo;
248
- const dockLocation = DockLocation_1.DockLocation.CENTER;
249
- if (this._tabHeaderRect.contains(x, y)) {
250
- if (this._location._orientation === Orientation_1.Orientation.VERT) {
251
- if (this._children.length > 0) {
252
- let child = this._children[0];
253
- let childRect = child.getTabRect();
254
- const childY = childRect.y;
255
- const childHeight = childRect.height;
256
- let pos = this._tabHeaderRect.x;
257
- let childCenter = 0;
258
- for (let i = 0; i < this._children.length; i++) {
259
- child = this._children[i];
260
- childRect = child.getTabRect();
261
- childCenter = childRect.x + childRect.width / 2;
262
- if (x >= pos && x < childCenter) {
263
- const outlineRect = new Rect_1.Rect(childRect.x - 2, childY, 3, childHeight);
264
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, i, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
265
- break;
266
- }
267
- pos = childCenter;
268
- }
269
- if (dropInfo == null) {
270
- const outlineRect = new Rect_1.Rect(childRect.getRight() - 2, childY, 3, childHeight);
271
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, this._children.length, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
272
- }
273
- }
274
- else {
275
- const outlineRect = new Rect_1.Rect(this._tabHeaderRect.x + 1, this._tabHeaderRect.y + 2, 3, 18);
276
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, 0, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
277
- }
278
- }
279
- else {
280
- if (this._children.length > 0) {
281
- let child = this._children[0];
282
- let childRect = child.getTabRect();
283
- const childX = childRect.x;
284
- const childWidth = childRect.width;
285
- let pos = this._tabHeaderRect.y;
286
- let childCenter = 0;
287
- for (let i = 0; i < this._children.length; i++) {
288
- child = this._children[i];
289
- childRect = child.getTabRect();
290
- childCenter = childRect.y + childRect.height / 2;
291
- if (y >= pos && y < childCenter) {
292
- const outlineRect = new Rect_1.Rect(childX, childRect.y - 2, childWidth, 3);
293
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, i, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
294
- break;
295
- }
296
- pos = childCenter;
297
- }
298
- if (dropInfo == null) {
299
- const outlineRect = new Rect_1.Rect(childX, childRect.getBottom() - 2, childWidth, 3);
300
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, this._children.length, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
301
- }
302
- }
303
- else {
304
- const outlineRect = new Rect_1.Rect(this._tabHeaderRect.x + 2, this._tabHeaderRect.y + 1, 18, 3);
305
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, 0, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
306
- }
307
- }
308
- if (!dragNode._canDockInto(dragNode, dropInfo)) {
309
- return undefined;
310
- }
311
- }
312
- else if (this.getSelected() !== -1 && this._contentRect.contains(x, y)) {
313
- const outlineRect = this._contentRect;
314
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, -1, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
315
- if (!dragNode._canDockInto(dragNode, dropInfo)) {
316
- return undefined;
317
- }
318
- }
319
- return dropInfo;
320
- }
321
- /** @internal */
322
- drop(dragNode, location, index, select) {
323
- let fromIndex = 0;
324
- const dragParent = dragNode.getParent();
325
- if (dragParent !== undefined) {
326
- fromIndex = dragParent._removeChild(dragNode);
327
- // if selected node in border is being docked into a different border then deselect border tabs
328
- if (dragParent !== this && dragParent instanceof BorderNode && dragParent.getSelected() === fromIndex) {
329
- dragParent._setSelected(-1);
330
- }
331
- else {
332
- (0, Utils_1.adjustSelectedIndex)(dragParent, fromIndex);
333
- }
334
- }
335
- // if dropping a tab back to same tabset and moving to forward position then reduce insertion index
336
- if (dragNode.getType() === TabNode_1.TabNode.TYPE && dragParent === this && fromIndex < index && index > 0) {
337
- index--;
338
- }
339
- // simple_bundled dock to existing tabset
340
- let insertPos = index;
341
- if (insertPos === -1) {
342
- insertPos = this._children.length;
343
- }
344
- if (dragNode.getType() === TabNode_1.TabNode.TYPE) {
345
- this._addChild(dragNode, insertPos);
346
- }
347
- if (select || (select !== false && this.isAutoSelectTab())) {
348
- this._setSelected(insertPos);
349
- }
350
- this._model._tidy();
351
- }
352
- toJson() {
353
- const json = {};
354
- BorderNode._attributeDefinitions.toJson(json, this._attributes);
355
- json.location = this._location.getName();
356
- json.children = this._children.map((child) => child.toJson());
357
- return json;
358
- }
359
- /** @internal */
360
- _getSplitterBounds(splitter, useMinSize = false) {
361
- const pBounds = [0, 0];
362
- const minSize = useMinSize ? this.getMinSize() : 0;
363
- const outerRect = this._model._getOuterInnerRects().outer;
364
- const innerRect = this._model._getOuterInnerRects().inner;
365
- const rootRow = this._model.getRoot();
366
- if (this._location === DockLocation_1.DockLocation.TOP) {
367
- pBounds[0] = outerRect.y + minSize;
368
- pBounds[1] = Math.max(pBounds[0], innerRect.getBottom() - splitter.getHeight() - rootRow.getMinHeight());
369
- }
370
- else if (this._location === DockLocation_1.DockLocation.LEFT) {
371
- pBounds[0] = outerRect.x + minSize;
372
- pBounds[1] = Math.max(pBounds[0], innerRect.getRight() - splitter.getWidth() - rootRow.getMinWidth());
373
- }
374
- else if (this._location === DockLocation_1.DockLocation.BOTTOM) {
375
- pBounds[1] = outerRect.getBottom() - splitter.getHeight() - minSize;
376
- pBounds[0] = Math.min(pBounds[1], innerRect.y + rootRow.getMinHeight());
377
- }
378
- else if (this._location === DockLocation_1.DockLocation.RIGHT) {
379
- pBounds[1] = outerRect.getRight() - splitter.getWidth() - minSize;
380
- pBounds[0] = Math.min(pBounds[1], innerRect.x + rootRow.getMinWidth());
381
- }
382
- return pBounds;
383
- }
384
- /** @internal */
385
- _calculateSplit(splitter, splitterPos) {
386
- const pBounds = this._getSplitterBounds(splitter);
387
- if (this._location === DockLocation_1.DockLocation.BOTTOM || this._location === DockLocation_1.DockLocation.RIGHT) {
388
- return Math.max(0, pBounds[1] - splitterPos);
389
- }
390
- else {
391
- return Math.max(0, splitterPos - pBounds[0]);
392
- }
393
- }
394
- /** @internal */
395
- _getAttributeDefinitions() {
396
- return BorderNode._attributeDefinitions;
397
- }
398
- /** @internal */
399
- static getAttributeDefinitions() {
400
- return BorderNode._attributeDefinitions;
401
- }
402
- }
403
- exports.BorderNode = BorderNode;
404
- BorderNode.TYPE = "border";
405
- /** @internal */
406
- BorderNode._attributeDefinitions = BorderNode._createAttributeDefinitions();
1
+ import { Attribute } from "../Attribute";
2
+ import { AttributeDefinitions } from "../AttributeDefinitions";
3
+ import { DockLocation } from "../DockLocation";
4
+ import { DropInfo } from "../DropInfo";
5
+ import { Orientation } from "../Orientation";
6
+ import { Rect } from "../Rect";
7
+ import { CLASSES } from "../Types";
8
+ import { Model } from "./Model";
9
+ import { Node } from "./Node";
10
+ import { TabNode } from "./TabNode";
11
+ import { adjustSelectedIndex } from "./Utils";
12
+ export class BorderNode extends Node {
13
+ /** @internal */
14
+ static fromJson(json, model) {
15
+ const location = DockLocation.getByName(json.location);
16
+ const border = new BorderNode(location, json, model);
17
+ if (json.children) {
18
+ border.children = json.children.map((jsonChild) => {
19
+ const child = TabNode.fromJson(jsonChild, model);
20
+ child.setParent(border);
21
+ return child;
22
+ });
23
+ }
24
+ return border;
25
+ }
26
+ /** @internal */
27
+ constructor(location, json, model) {
28
+ super(model);
29
+ /** @internal */
30
+ this.outerRect = Rect.empty();
31
+ /** @internal */
32
+ this.contentRect = Rect.empty();
33
+ /** @internal */
34
+ this.tabHeaderRect = Rect.empty();
35
+ this.location = location;
36
+ this.attributes.id = `border_${location.getName()}`;
37
+ BorderNode.attributeDefinitions.fromJson(json, this.attributes);
38
+ model.addNode(this);
39
+ }
40
+ getLocation() {
41
+ return this.location;
42
+ }
43
+ getClassName() {
44
+ return this.getAttr("className");
45
+ }
46
+ isHorizontal() {
47
+ return this.location.orientation === Orientation.HORZ;
48
+ }
49
+ getSize() {
50
+ const defaultSize = this.getAttr("size");
51
+ const selected = this.getSelected();
52
+ if (selected === -1) {
53
+ return defaultSize;
54
+ }
55
+ else {
56
+ const tabNode = this.children[selected];
57
+ const tabBorderSize = this.isHorizontal() ? tabNode.getAttr("borderWidth") : tabNode.getAttr("borderHeight");
58
+ if (tabBorderSize === -1) {
59
+ return defaultSize;
60
+ }
61
+ else {
62
+ return tabBorderSize;
63
+ }
64
+ }
65
+ }
66
+ getMinSize() {
67
+ const selectedNode = this.getSelectedNode();
68
+ let min = this.getAttr("minSize");
69
+ if (selectedNode) {
70
+ const nodeMin = this.isHorizontal() ? selectedNode.getMinWidth() : selectedNode.getMinHeight();
71
+ min = Math.max(min, nodeMin);
72
+ }
73
+ return min;
74
+ }
75
+ getMaxSize() {
76
+ const selectedNode = this.getSelectedNode();
77
+ let max = this.getAttr("maxSize");
78
+ if (selectedNode) {
79
+ const nodeMax = this.isHorizontal() ? selectedNode.getMaxWidth() : selectedNode.getMaxHeight();
80
+ max = Math.min(max, nodeMax);
81
+ }
82
+ return max;
83
+ }
84
+ getSelected() {
85
+ return this.attributes.selected;
86
+ }
87
+ isAutoHide() {
88
+ return this.getAttr("enableAutoHide");
89
+ }
90
+ getSelectedNode() {
91
+ if (this.getSelected() !== -1) {
92
+ return this.children[this.getSelected()];
93
+ }
94
+ return undefined;
95
+ }
96
+ getOrientation() {
97
+ return this.location.getOrientation();
98
+ }
99
+ /**
100
+ * Returns the config attribute that can be used to store node specific data that
101
+ * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
102
+ * than directly, for example:
103
+ * this.state.model.doAction(
104
+ * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
105
+ */
106
+ getConfig() {
107
+ return this.attributes.config;
108
+ }
109
+ isMaximized() {
110
+ return false;
111
+ }
112
+ isShowing() {
113
+ return this.attributes.show;
114
+ }
115
+ toJson() {
116
+ const json = {};
117
+ BorderNode.attributeDefinitions.toJson(json, this.attributes);
118
+ json.location = this.location.getName();
119
+ json.children = this.children.map((child) => child.toJson());
120
+ return json;
121
+ }
122
+ /** @internal */
123
+ isAutoSelectTab(whenOpen) {
124
+ if (whenOpen == null) {
125
+ whenOpen = this.getSelected() !== -1;
126
+ }
127
+ if (whenOpen) {
128
+ return this.getAttr("autoSelectTabWhenOpen");
129
+ }
130
+ else {
131
+ return this.getAttr("autoSelectTabWhenClosed");
132
+ }
133
+ }
134
+ /** @internal */
135
+ setSelected(index) {
136
+ this.attributes.selected = index;
137
+ }
138
+ /** @internal */
139
+ getTabHeaderRect() {
140
+ return this.tabHeaderRect;
141
+ }
142
+ /** @internal */
143
+ setTabHeaderRect(r) {
144
+ this.tabHeaderRect = r;
145
+ }
146
+ /** @internal */
147
+ getOuterRect() {
148
+ return this.outerRect;
149
+ }
150
+ /** @internal */
151
+ setOuterRect(r) {
152
+ this.outerRect = r;
153
+ }
154
+ /** @internal */
155
+ getRect() {
156
+ return this.tabHeaderRect;
157
+ }
158
+ /** @internal */
159
+ getContentRect() {
160
+ return this.contentRect;
161
+ }
162
+ /** @internal */
163
+ setContentRect(r) {
164
+ this.contentRect = r;
165
+ }
166
+ /** @internal */
167
+ isEnableDrop() {
168
+ return this.getAttr("enableDrop");
169
+ }
170
+ /** @internal */
171
+ setSize(pos) {
172
+ const selected = this.getSelected();
173
+ if (selected === -1) {
174
+ this.attributes.size = pos;
175
+ }
176
+ else {
177
+ const tabNode = this.children[selected];
178
+ const tabBorderSize = this.isHorizontal() ? tabNode.getAttr("borderWidth") : tabNode.getAttr("borderHeight");
179
+ if (tabBorderSize === -1) {
180
+ this.attributes.size = pos;
181
+ }
182
+ else {
183
+ if (this.isHorizontal()) {
184
+ tabNode.setBorderWidth(pos);
185
+ }
186
+ else {
187
+ tabNode.setBorderHeight(pos);
188
+ }
189
+ }
190
+ }
191
+ }
192
+ /** @internal */
193
+ updateAttrs(json) {
194
+ BorderNode.attributeDefinitions.update(json, this.attributes);
195
+ }
196
+ /** @internal */
197
+ remove(node) {
198
+ const removedIndex = this.removeChild(node);
199
+ if (this.getSelected() !== -1) {
200
+ adjustSelectedIndex(this, removedIndex);
201
+ }
202
+ }
203
+ /** @internal */
204
+ canDrop(dragNode, x, y) {
205
+ if (!(dragNode instanceof TabNode)) {
206
+ return undefined;
207
+ }
208
+ let dropInfo;
209
+ const dockLocation = DockLocation.CENTER;
210
+ if (this.tabHeaderRect.contains(x, y)) {
211
+ if (this.location.orientation === Orientation.VERT) {
212
+ if (this.children.length > 0) {
213
+ let child = this.children[0];
214
+ let childRect = child.getTabRect();
215
+ const childY = childRect.y;
216
+ const childHeight = childRect.height;
217
+ let pos = this.tabHeaderRect.x;
218
+ let childCenter = 0;
219
+ for (let i = 0; i < this.children.length; i++) {
220
+ child = this.children[i];
221
+ childRect = child.getTabRect();
222
+ childCenter = childRect.x + childRect.width / 2;
223
+ if (x >= pos && x < childCenter) {
224
+ const outlineRect = new Rect(childRect.x - 2, childY, 3, childHeight);
225
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
226
+ break;
227
+ }
228
+ pos = childCenter;
229
+ }
230
+ if (dropInfo == null) {
231
+ const outlineRect = new Rect(childRect.getRight() - 2, childY, 3, childHeight);
232
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this.children.length, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
233
+ }
234
+ }
235
+ else {
236
+ const outlineRect = new Rect(this.tabHeaderRect.x + 1, this.tabHeaderRect.y + 2, 3, 18);
237
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
238
+ }
239
+ }
240
+ else {
241
+ if (this.children.length > 0) {
242
+ let child = this.children[0];
243
+ let childRect = child.getTabRect();
244
+ const childX = childRect.x;
245
+ const childWidth = childRect.width;
246
+ let pos = this.tabHeaderRect.y;
247
+ let childCenter = 0;
248
+ for (let i = 0; i < this.children.length; i++) {
249
+ child = this.children[i];
250
+ childRect = child.getTabRect();
251
+ childCenter = childRect.y + childRect.height / 2;
252
+ if (y >= pos && y < childCenter) {
253
+ const outlineRect = new Rect(childX, childRect.y - 2, childWidth, 3);
254
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
255
+ break;
256
+ }
257
+ pos = childCenter;
258
+ }
259
+ if (dropInfo == null) {
260
+ const outlineRect = new Rect(childX, childRect.getBottom() - 2, childWidth, 3);
261
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this.children.length, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
262
+ }
263
+ }
264
+ else {
265
+ const outlineRect = new Rect(this.tabHeaderRect.x + 2, this.tabHeaderRect.y + 1, 18, 3);
266
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, 0, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
267
+ }
268
+ }
269
+ if (!dragNode.canDockInto(dragNode, dropInfo)) {
270
+ return undefined;
271
+ }
272
+ }
273
+ else if (this.getSelected() !== -1 && this.outerRect.contains(x, y)) {
274
+ const outlineRect = this.outerRect;
275
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
276
+ if (!dragNode.canDockInto(dragNode, dropInfo)) {
277
+ return undefined;
278
+ }
279
+ }
280
+ return dropInfo;
281
+ }
282
+ /** @internal */
283
+ drop(dragNode, location, index, select) {
284
+ let fromIndex = 0;
285
+ const dragParent = dragNode.getParent();
286
+ if (dragParent !== undefined) {
287
+ fromIndex = dragParent.removeChild(dragNode);
288
+ // if selected node in border is being docked into a different border then deselect border tabs
289
+ if (dragParent !== this && dragParent instanceof BorderNode && dragParent.getSelected() === fromIndex) {
290
+ dragParent.setSelected(-1);
291
+ }
292
+ else {
293
+ adjustSelectedIndex(dragParent, fromIndex);
294
+ }
295
+ }
296
+ // if dropping a tab back to same tabset and moving to forward position then reduce insertion index
297
+ if (dragNode instanceof TabNode && dragParent === this && fromIndex < index && index > 0) {
298
+ index--;
299
+ }
300
+ // simple_bundled dock to existing tabset
301
+ let insertPos = index;
302
+ if (insertPos === -1) {
303
+ insertPos = this.children.length;
304
+ }
305
+ if (dragNode instanceof TabNode) {
306
+ this.addChild(dragNode, insertPos);
307
+ }
308
+ if (select || (select !== false && this.isAutoSelectTab())) {
309
+ this.setSelected(insertPos);
310
+ }
311
+ this.model.tidy();
312
+ }
313
+ /** @internal */
314
+ getSplitterBounds(index, useMinSize = false) {
315
+ const pBounds = [0, 0];
316
+ const minSize = useMinSize ? this.getMinSize() : 0;
317
+ const maxSize = useMinSize ? this.getMaxSize() : 99999;
318
+ const rootRow = this.model.getRoot(Model.MAIN_WINDOW_ID);
319
+ const innerRect = rootRow.getRect();
320
+ const splitterSize = this.model.getSplitterSize();
321
+ if (this.location === DockLocation.TOP) {
322
+ pBounds[0] = this.tabHeaderRect.getBottom() + minSize;
323
+ const maxPos = this.tabHeaderRect.getBottom() + maxSize;
324
+ pBounds[1] = Math.max(pBounds[0], innerRect.getBottom() - rootRow.getMinHeight() - splitterSize);
325
+ pBounds[1] = Math.min(pBounds[1], maxPos);
326
+ }
327
+ else if (this.location === DockLocation.LEFT) {
328
+ pBounds[0] = this.tabHeaderRect.getRight() + minSize;
329
+ const maxPos = this.tabHeaderRect.getRight() + maxSize;
330
+ pBounds[1] = Math.max(pBounds[0], innerRect.getRight() - rootRow.getMinWidth() - splitterSize);
331
+ pBounds[1] = Math.min(pBounds[1], maxPos);
332
+ }
333
+ else if (this.location === DockLocation.BOTTOM) {
334
+ pBounds[1] = this.tabHeaderRect.y - minSize - splitterSize;
335
+ const maxPos = this.tabHeaderRect.y - maxSize - splitterSize;
336
+ pBounds[0] = Math.min(pBounds[1], innerRect.y + rootRow.getMinHeight());
337
+ pBounds[0] = Math.max(pBounds[0], maxPos);
338
+ }
339
+ else if (this.location === DockLocation.RIGHT) {
340
+ pBounds[1] = this.tabHeaderRect.x - minSize - splitterSize;
341
+ const maxPos = this.tabHeaderRect.x - maxSize - splitterSize;
342
+ pBounds[0] = Math.min(pBounds[1], innerRect.x + rootRow.getMinWidth());
343
+ pBounds[0] = Math.max(pBounds[0], maxPos);
344
+ }
345
+ return pBounds;
346
+ }
347
+ /** @internal */
348
+ calculateSplit(splitter, splitterPos) {
349
+ const pBounds = this.getSplitterBounds(splitterPos);
350
+ if (this.location === DockLocation.BOTTOM || this.location === DockLocation.RIGHT) {
351
+ return Math.max(0, pBounds[1] - splitterPos);
352
+ }
353
+ else {
354
+ return Math.max(0, splitterPos - pBounds[0]);
355
+ }
356
+ }
357
+ /** @internal */
358
+ getAttributeDefinitions() {
359
+ return BorderNode.attributeDefinitions;
360
+ }
361
+ /** @internal */
362
+ static getAttributeDefinitions() {
363
+ return BorderNode.attributeDefinitions;
364
+ }
365
+ /** @internal */
366
+ static createAttributeDefinitions() {
367
+ const attributeDefinitions = new AttributeDefinitions();
368
+ attributeDefinitions.add("type", BorderNode.TYPE, true).setType(Attribute.STRING).setFixed();
369
+ attributeDefinitions.add("selected", -1).setType(Attribute.NUMBER).setDescription(`index of selected/visible tab in border; -1 means no tab selected`);
370
+ attributeDefinitions.add("show", true).setType(Attribute.BOOLEAN).setDescription(`show/hide this border`);
371
+ attributeDefinitions.add("config", undefined).setType("any").setDescription(`a place to hold json config used in your own code`);
372
+ attributeDefinitions.addInherited("enableDrop", "borderEnableDrop").setType(Attribute.BOOLEAN).setDescription(`whether tabs can be dropped into this border`);
373
+ attributeDefinitions.addInherited("className", "borderClassName").setType(Attribute.STRING).setDescription(`class applied to tab button`);
374
+ attributeDefinitions.addInherited("autoSelectTabWhenOpen", "borderAutoSelectTabWhenOpen").setType(Attribute.BOOLEAN).setDescription(`whether to select new/moved tabs in border when the border is already open`);
375
+ attributeDefinitions.addInherited("autoSelectTabWhenClosed", "borderAutoSelectTabWhenClosed").setType(Attribute.BOOLEAN).setDescription(`whether to select new/moved tabs in border when the border is currently closed`);
376
+ attributeDefinitions.addInherited("size", "borderSize").setType(Attribute.NUMBER).setDescription(`size of the tab area when selected`);
377
+ attributeDefinitions.addInherited("minSize", "borderMinSize").setType(Attribute.NUMBER).setDescription(`the minimum size of the tab area`);
378
+ attributeDefinitions.addInherited("maxSize", "borderMaxSize").setType(Attribute.NUMBER).setDescription(`the maximum size of the tab area`);
379
+ attributeDefinitions.addInherited("enableAutoHide", "borderEnableAutoHide").setType(Attribute.BOOLEAN).setDescription(`hide border if it has zero tabs`);
380
+ return attributeDefinitions;
381
+ }
382
+ }
383
+ BorderNode.TYPE = "border";
384
+ /** @internal */
385
+ BorderNode.attributeDefinitions = BorderNode.createAttributeDefinitions();
407
386
  //# sourceMappingURL=BorderNode.js.map