flexlayout-react 0.7.3 → 0.7.4

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 (86) hide show
  1. package/ChangeLog.txt +4 -0
  2. package/declarations/view/Icons.d.ts +1 -0
  3. package/dist/flexlayout.js +96 -184
  4. package/dist/flexlayout_min.js +1 -1
  5. package/lib/Attribute.js +12 -17
  6. package/lib/Attribute.js.map +1 -1
  7. package/lib/AttributeDefinitions.js +44 -53
  8. package/lib/AttributeDefinitions.js.map +1 -1
  9. package/lib/DockLocation.js +41 -46
  10. package/lib/DockLocation.js.map +1 -1
  11. package/lib/DragDrop.js +55 -60
  12. package/lib/DragDrop.js.map +1 -1
  13. package/lib/DropInfo.js +3 -8
  14. package/lib/DropInfo.js.map +1 -1
  15. package/lib/I18nLabel.js +2 -5
  16. package/lib/I18nLabel.js.map +1 -1
  17. package/lib/Orientation.js +11 -16
  18. package/lib/Orientation.js.map +1 -1
  19. package/lib/PopupMenu.js +24 -28
  20. package/lib/PopupMenu.js.map +1 -1
  21. package/lib/Rect.js +35 -41
  22. package/lib/Rect.js.map +1 -1
  23. package/lib/Types.js +2 -5
  24. package/lib/Types.js.map +1 -1
  25. package/lib/index.js +22 -38
  26. package/lib/index.js.map +1 -1
  27. package/lib/model/Action.js +3 -8
  28. package/lib/model/Action.js.map +1 -1
  29. package/lib/model/Actions.js +68 -75
  30. package/lib/model/Actions.js.map +1 -1
  31. package/lib/model/BorderNode.js +183 -206
  32. package/lib/model/BorderNode.js.map +1 -1
  33. package/lib/model/BorderSet.js +44 -55
  34. package/lib/model/BorderSet.js.map +1 -1
  35. package/lib/model/ICloseType.js +2 -5
  36. package/lib/model/ICloseType.js.map +1 -1
  37. package/lib/model/IDraggable.js +1 -2
  38. package/lib/model/IDropTarget.js +1 -2
  39. package/lib/model/IJsonModel.js +1 -2
  40. package/lib/model/Model.js +217 -232
  41. package/lib/model/Model.js.map +1 -1
  42. package/lib/model/Node.js +87 -94
  43. package/lib/model/Node.js.map +1 -1
  44. package/lib/model/RowNode.js +204 -250
  45. package/lib/model/RowNode.js.map +1 -1
  46. package/lib/model/SplitterNode.js +35 -57
  47. package/lib/model/SplitterNode.js.map +1 -1
  48. package/lib/model/TabNode.js +100 -124
  49. package/lib/model/TabNode.js.map +1 -1
  50. package/lib/model/TabSetNode.js +176 -199
  51. package/lib/model/TabSetNode.js.map +1 -1
  52. package/lib/model/Utils.js +20 -26
  53. package/lib/model/Utils.js.map +1 -1
  54. package/lib/view/BorderButton.js +45 -49
  55. package/lib/view/BorderButton.js.map +1 -1
  56. package/lib/view/BorderTabSet.js +57 -61
  57. package/lib/view/BorderTabSet.js.map +1 -1
  58. package/lib/view/ErrorBoundary.js +15 -37
  59. package/lib/view/ErrorBoundary.js.map +1 -1
  60. package/lib/view/FloatingWindow.js +43 -56
  61. package/lib/view/FloatingWindow.js.map +1 -1
  62. package/lib/view/FloatingWindowTab.js +12 -16
  63. package/lib/view/FloatingWindowTab.js.map +1 -1
  64. package/lib/view/Icons.js +7 -15
  65. package/lib/view/Icons.js.map +1 -1
  66. package/lib/view/Layout.js +392 -449
  67. package/lib/view/Layout.js.map +1 -1
  68. package/lib/view/Splitter.js +53 -57
  69. package/lib/view/Splitter.js.map +1 -1
  70. package/lib/view/Tab.js +31 -35
  71. package/lib/view/Tab.js.map +1 -1
  72. package/lib/view/TabButton.js +46 -50
  73. package/lib/view/TabButton.js.map +1 -1
  74. package/lib/view/TabButtonStamp.js +11 -15
  75. package/lib/view/TabButtonStamp.js.map +1 -1
  76. package/lib/view/TabFloating.js +30 -34
  77. package/lib/view/TabFloating.js.map +1 -1
  78. package/lib/view/TabOverflowHook.js +46 -50
  79. package/lib/view/TabOverflowHook.js.map +1 -1
  80. package/lib/view/TabSet.js +93 -106
  81. package/lib/view/TabSet.js.map +1 -1
  82. package/lib/view/Utils.js +11 -17
  83. package/lib/view/Utils.js.map +1 -1
  84. package/package.json +1 -1
  85. package/src/view/FloatingWindow.tsx +5 -1
  86. package/src/view/Layout.tsx +1 -5
@@ -1,51 +1,30 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.TabSetNode = void 0;
19
- var Attribute_1 = require("../Attribute");
20
- var AttributeDefinitions_1 = require("../AttributeDefinitions");
21
- var DockLocation_1 = require("../DockLocation");
22
- var DropInfo_1 = require("../DropInfo");
23
- var Orientation_1 = require("../Orientation");
24
- var Rect_1 = require("../Rect");
25
- var Types_1 = require("../Types");
26
- var BorderNode_1 = require("./BorderNode");
27
- var Node_1 = require("./Node");
28
- var RowNode_1 = require("./RowNode");
29
- var TabNode_1 = require("./TabNode");
30
- var Utils_1 = require("./Utils");
31
- var TabSetNode = /** @class */ (function (_super) {
32
- __extends(TabSetNode, _super);
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 { BorderNode } from "./BorderNode";
9
+ import { Node } from "./Node";
10
+ import { RowNode } from "./RowNode";
11
+ import { TabNode } from "./TabNode";
12
+ import { adjustSelectedIndex } from "./Utils";
13
+ export class TabSetNode extends Node {
33
14
  /** @internal */
34
- function TabSetNode(model, json) {
35
- var _this = _super.call(this, model) || this;
36
- TabSetNode._attributeDefinitions.fromJson(json, _this._attributes);
37
- model._addNode(_this);
38
- _this._calculatedTabBarHeight = 0;
39
- _this._calculatedHeaderBarHeight = 0;
40
- return _this;
15
+ constructor(model, json) {
16
+ super(model);
17
+ TabSetNode._attributeDefinitions.fromJson(json, this._attributes);
18
+ model._addNode(this);
19
+ this._calculatedTabBarHeight = 0;
20
+ this._calculatedHeaderBarHeight = 0;
41
21
  }
42
22
  /** @internal */
43
- TabSetNode._fromJson = function (json, model) {
44
- var newLayoutNode = new TabSetNode(model, json);
23
+ static _fromJson(json, model) {
24
+ const newLayoutNode = new TabSetNode(model, json);
45
25
  if (json.children != null) {
46
- for (var _i = 0, _a = json.children; _i < _a.length; _i++) {
47
- var jsonChild = _a[_i];
48
- var child = TabNode_1.TabNode._fromJson(jsonChild, model);
26
+ for (const jsonChild of json.children) {
27
+ const child = TabNode._fromJson(jsonChild, model);
49
28
  newLayoutNode._addChild(child);
50
29
  }
51
30
  }
@@ -59,17 +38,17 @@ var TabSetNode = /** @class */ (function (_super) {
59
38
  model._setActiveTabset(newLayoutNode);
60
39
  }
61
40
  return newLayoutNode;
62
- };
41
+ }
63
42
  /** @internal */
64
- TabSetNode._createAttributeDefinitions = function () {
65
- var attributeDefinitions = new AttributeDefinitions_1.AttributeDefinitions();
66
- attributeDefinitions.add("type", TabSetNode.TYPE, true).setType(Attribute_1.Attribute.STRING).setFixed();
67
- attributeDefinitions.add("id", undefined).setType(Attribute_1.Attribute.STRING);
68
- attributeDefinitions.add("weight", 100).setType(Attribute_1.Attribute.NUMBER);
69
- attributeDefinitions.add("width", undefined).setType(Attribute_1.Attribute.NUMBER);
70
- attributeDefinitions.add("height", undefined).setType(Attribute_1.Attribute.NUMBER);
71
- attributeDefinitions.add("selected", 0).setType(Attribute_1.Attribute.NUMBER);
72
- attributeDefinitions.add("name", undefined).setType(Attribute_1.Attribute.STRING);
43
+ static _createAttributeDefinitions() {
44
+ const attributeDefinitions = new AttributeDefinitions();
45
+ attributeDefinitions.add("type", TabSetNode.TYPE, true).setType(Attribute.STRING).setFixed();
46
+ attributeDefinitions.add("id", undefined).setType(Attribute.STRING);
47
+ attributeDefinitions.add("weight", 100).setType(Attribute.NUMBER);
48
+ attributeDefinitions.add("width", undefined).setType(Attribute.NUMBER);
49
+ attributeDefinitions.add("height", undefined).setType(Attribute.NUMBER);
50
+ attributeDefinitions.add("selected", 0).setType(Attribute.NUMBER);
51
+ attributeDefinitions.add("name", undefined).setType(Attribute.STRING);
73
52
  attributeDefinitions.add("config", undefined).setType("any");
74
53
  attributeDefinitions.addInherited("enableDeleteWhenEmpty", "tabSetEnableDeleteWhenEmpty");
75
54
  attributeDefinitions.addInherited("enableDrop", "tabSetEnableDrop");
@@ -87,50 +66,50 @@ var TabSetNode = /** @class */ (function (_super) {
87
66
  attributeDefinitions.addInherited("headerHeight", "tabSetHeaderHeight");
88
67
  attributeDefinitions.addInherited("tabStripHeight", "tabSetTabStripHeight");
89
68
  attributeDefinitions.addInherited("tabLocation", "tabSetTabLocation");
90
- attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute_1.Attribute.BOOLEAN);
69
+ attributeDefinitions.addInherited("autoSelectTab", "tabSetAutoSelectTab").setType(Attribute.BOOLEAN);
91
70
  return attributeDefinitions;
92
- };
93
- TabSetNode.prototype.getName = function () {
71
+ }
72
+ getName() {
94
73
  return this._getAttr("name");
95
- };
96
- TabSetNode.prototype.getSelected = function () {
97
- var selected = this._attributes.selected;
74
+ }
75
+ getSelected() {
76
+ const selected = this._attributes.selected;
98
77
  if (selected !== undefined) {
99
78
  return selected;
100
79
  }
101
80
  return -1;
102
- };
103
- TabSetNode.prototype.getSelectedNode = function () {
104
- var selected = this.getSelected();
81
+ }
82
+ getSelectedNode() {
83
+ const selected = this.getSelected();
105
84
  if (selected !== -1) {
106
85
  return this._children[selected];
107
86
  }
108
87
  return undefined;
109
- };
110
- TabSetNode.prototype.getWeight = function () {
88
+ }
89
+ getWeight() {
111
90
  return this._getAttr("weight");
112
- };
113
- TabSetNode.prototype.getWidth = function () {
91
+ }
92
+ getWidth() {
114
93
  return this._getAttr("width");
115
- };
116
- TabSetNode.prototype.getMinWidth = function () {
94
+ }
95
+ getMinWidth() {
117
96
  return this._getAttr("minWidth");
118
- };
119
- TabSetNode.prototype.getHeight = function () {
97
+ }
98
+ getHeight() {
120
99
  return this._getAttr("height");
121
- };
122
- TabSetNode.prototype.getMinHeight = function () {
100
+ }
101
+ getMinHeight() {
123
102
  return this._getAttr("minHeight");
124
- };
103
+ }
125
104
  /** @internal */
126
- TabSetNode.prototype.getMinSize = function (orientation) {
127
- if (orientation === Orientation_1.Orientation.HORZ) {
105
+ getMinSize(orientation) {
106
+ if (orientation === Orientation.HORZ) {
128
107
  return this.getMinWidth();
129
108
  }
130
109
  else {
131
110
  return this.getMinHeight();
132
111
  }
133
- };
112
+ }
134
113
  /**
135
114
  * Returns the config attribute that can be used to store node specific data that
136
115
  * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
@@ -138,34 +117,34 @@ var TabSetNode = /** @class */ (function (_super) {
138
117
  * this.state.model.doAction(
139
118
  * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
140
119
  */
141
- TabSetNode.prototype.getConfig = function () {
120
+ getConfig() {
142
121
  return this._attributes.config;
143
- };
144
- TabSetNode.prototype.isMaximized = function () {
122
+ }
123
+ isMaximized() {
145
124
  return this._model.getMaximizedTabset() === this;
146
- };
147
- TabSetNode.prototype.isActive = function () {
125
+ }
126
+ isActive() {
148
127
  return this._model.getActiveTabset() === this;
149
- };
150
- TabSetNode.prototype.isEnableDeleteWhenEmpty = function () {
128
+ }
129
+ isEnableDeleteWhenEmpty() {
151
130
  return this._getAttr("enableDeleteWhenEmpty");
152
- };
153
- TabSetNode.prototype.isEnableDrop = function () {
131
+ }
132
+ isEnableDrop() {
154
133
  return this._getAttr("enableDrop");
155
- };
156
- TabSetNode.prototype.isEnableDrag = function () {
134
+ }
135
+ isEnableDrag() {
157
136
  return this._getAttr("enableDrag");
158
- };
159
- TabSetNode.prototype.isEnableDivide = function () {
137
+ }
138
+ isEnableDivide() {
160
139
  return this._getAttr("enableDivide");
161
- };
162
- TabSetNode.prototype.isEnableMaximize = function () {
140
+ }
141
+ isEnableMaximize() {
163
142
  return this._getAttr("enableMaximize");
164
- };
165
- TabSetNode.prototype.isEnableClose = function () {
143
+ }
144
+ isEnableClose() {
166
145
  return this._getAttr("enableClose");
167
- };
168
- TabSetNode.prototype.canMaximize = function () {
146
+ }
147
+ canMaximize() {
169
148
  if (this.isEnableMaximize()) {
170
149
  // always allow maximize toggle if already maximized
171
150
  if (this.getModel().getMaximizedTabset() === this) {
@@ -178,22 +157,22 @@ var TabSetNode = /** @class */ (function (_super) {
178
157
  return true;
179
158
  }
180
159
  return false;
181
- };
182
- TabSetNode.prototype.isEnableTabStrip = function () {
160
+ }
161
+ isEnableTabStrip() {
183
162
  return this._getAttr("enableTabStrip");
184
- };
185
- TabSetNode.prototype.isAutoSelectTab = function () {
163
+ }
164
+ isAutoSelectTab() {
186
165
  return this._getAttr("autoSelectTab");
187
- };
188
- TabSetNode.prototype.getClassNameTabStrip = function () {
166
+ }
167
+ getClassNameTabStrip() {
189
168
  return this._getAttr("classNameTabStrip");
190
- };
191
- TabSetNode.prototype.getClassNameHeader = function () {
169
+ }
170
+ getClassNameHeader() {
192
171
  return this._getAttr("classNameHeader");
193
- };
172
+ }
194
173
  /** @internal */
195
- TabSetNode.prototype.calculateHeaderBarHeight = function (metrics) {
196
- var headerBarHeight = this._getAttr("headerHeight");
174
+ calculateHeaderBarHeight(metrics) {
175
+ const headerBarHeight = this._getAttr("headerHeight");
197
176
  if (headerBarHeight !== 0) {
198
177
  // its defined
199
178
  this._calculatedHeaderBarHeight = headerBarHeight;
@@ -201,10 +180,10 @@ var TabSetNode = /** @class */ (function (_super) {
201
180
  else {
202
181
  this._calculatedHeaderBarHeight = metrics.headerBarSize;
203
182
  }
204
- };
183
+ }
205
184
  /** @internal */
206
- TabSetNode.prototype.calculateTabBarHeight = function (metrics) {
207
- var tabBarHeight = this._getAttr("tabStripHeight");
185
+ calculateTabBarHeight(metrics) {
186
+ const tabBarHeight = this._getAttr("tabStripHeight");
208
187
  if (tabBarHeight !== 0) {
209
188
  // its defined
210
189
  this._calculatedTabBarHeight = tabBarHeight;
@@ -212,44 +191,44 @@ var TabSetNode = /** @class */ (function (_super) {
212
191
  else {
213
192
  this._calculatedTabBarHeight = metrics.tabBarSize;
214
193
  }
215
- };
216
- TabSetNode.prototype.getHeaderHeight = function () {
194
+ }
195
+ getHeaderHeight() {
217
196
  return this._calculatedHeaderBarHeight;
218
- };
219
- TabSetNode.prototype.getTabStripHeight = function () {
197
+ }
198
+ getTabStripHeight() {
220
199
  return this._calculatedTabBarHeight;
221
- };
222
- TabSetNode.prototype.getTabLocation = function () {
200
+ }
201
+ getTabLocation() {
223
202
  return this._getAttr("tabLocation");
224
- };
203
+ }
225
204
  /** @internal */
226
- TabSetNode.prototype._setWeight = function (weight) {
205
+ _setWeight(weight) {
227
206
  this._attributes.weight = weight;
228
- };
207
+ }
229
208
  /** @internal */
230
- TabSetNode.prototype._setSelected = function (index) {
209
+ _setSelected(index) {
231
210
  this._attributes.selected = index;
232
- };
211
+ }
233
212
  /** @internal */
234
- TabSetNode.prototype.canDrop = function (dragNode, x, y) {
235
- var dropInfo;
213
+ canDrop(dragNode, x, y) {
214
+ let dropInfo;
236
215
  if (dragNode === this) {
237
- var dockLocation = DockLocation_1.DockLocation.CENTER;
238
- var outlineRect = this._tabHeaderRect;
239
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, -1, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
216
+ const dockLocation = DockLocation.CENTER;
217
+ const outlineRect = this._tabHeaderRect;
218
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
240
219
  }
241
220
  else if (this._contentRect.contains(x, y)) {
242
- var dockLocation = DockLocation_1.DockLocation.CENTER;
221
+ let dockLocation = DockLocation.CENTER;
243
222
  if (this._model.getMaximizedTabset() === undefined) {
244
- dockLocation = DockLocation_1.DockLocation.getLocation(this._contentRect, x, y);
223
+ dockLocation = DockLocation.getLocation(this._contentRect, x, y);
245
224
  }
246
- var outlineRect = dockLocation.getDockRect(this._rect);
247
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, -1, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
225
+ const outlineRect = dockLocation.getDockRect(this._rect);
226
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, -1, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
248
227
  }
249
228
  else if (this._tabHeaderRect != null && this._tabHeaderRect.contains(x, y)) {
250
- var r = void 0;
251
- var yy = void 0;
252
- var h = void 0;
229
+ let r;
230
+ let yy;
231
+ let h;
253
232
  if (this._children.length === 0) {
254
233
  r = this._tabHeaderRect.clone();
255
234
  yy = r.y + 3;
@@ -257,38 +236,38 @@ var TabSetNode = /** @class */ (function (_super) {
257
236
  r.width = 2;
258
237
  }
259
238
  else {
260
- var child = this._children[0];
239
+ let child = this._children[0];
261
240
  r = child.getTabRect();
262
241
  yy = r.y;
263
242
  h = r.height;
264
- var p = this._tabHeaderRect.x;
265
- var childCenter = 0;
266
- for (var i = 0; i < this._children.length; i++) {
243
+ let p = this._tabHeaderRect.x;
244
+ let childCenter = 0;
245
+ for (let i = 0; i < this._children.length; i++) {
267
246
  child = this._children[i];
268
247
  r = child.getTabRect();
269
248
  childCenter = r.x + r.width / 2;
270
249
  if (x >= p && x < childCenter) {
271
- var dockLocation = DockLocation_1.DockLocation.CENTER;
272
- var outlineRect = new Rect_1.Rect(r.x - 2, yy, 3, h);
273
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, i, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
250
+ const dockLocation = DockLocation.CENTER;
251
+ const outlineRect = new Rect(r.x - 2, yy, 3, h);
252
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, i, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
274
253
  break;
275
254
  }
276
255
  p = childCenter;
277
256
  }
278
257
  }
279
258
  if (dropInfo == null) {
280
- var dockLocation = DockLocation_1.DockLocation.CENTER;
281
- var outlineRect = new Rect_1.Rect(r.getRight() - 2, yy, 3, h);
282
- dropInfo = new DropInfo_1.DropInfo(this, outlineRect, dockLocation, this._children.length, Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
259
+ const dockLocation = DockLocation.CENTER;
260
+ const outlineRect = new Rect(r.getRight() - 2, yy, 3, h);
261
+ dropInfo = new DropInfo(this, outlineRect, dockLocation, this._children.length, CLASSES.FLEXLAYOUT__OUTLINE_RECT);
283
262
  }
284
263
  }
285
264
  if (!dragNode._canDockInto(dragNode, dropInfo)) {
286
265
  return undefined;
287
266
  }
288
267
  return dropInfo;
289
- };
268
+ }
290
269
  /** @internal */
291
- TabSetNode.prototype._layout = function (rect, metrics) {
270
+ _layout(rect, metrics) {
292
271
  this.calculateHeaderBarHeight(metrics);
293
272
  this.calculateTabBarHeight(metrics);
294
273
  if (this.isMaximized()) {
@@ -297,72 +276,72 @@ var TabSetNode = /** @class */ (function (_super) {
297
276
  rect = rect.removeInsets(this._getAttr("marginInsets"));
298
277
  this._rect = rect;
299
278
  rect = rect.removeInsets(this._getAttr("borderInsets"));
300
- var showHeader = this.getName() !== undefined;
301
- var y = 0;
302
- var h = 0;
279
+ const showHeader = this.getName() !== undefined;
280
+ let y = 0;
281
+ let h = 0;
303
282
  if (showHeader) {
304
283
  y += this._calculatedHeaderBarHeight;
305
284
  h += this._calculatedHeaderBarHeight;
306
285
  }
307
286
  if (this.isEnableTabStrip()) {
308
287
  if (this.getTabLocation() === "top") {
309
- this._tabHeaderRect = new Rect_1.Rect(rect.x, rect.y + y, rect.width, this._calculatedTabBarHeight);
288
+ this._tabHeaderRect = new Rect(rect.x, rect.y + y, rect.width, this._calculatedTabBarHeight);
310
289
  }
311
290
  else {
312
- this._tabHeaderRect = new Rect_1.Rect(rect.x, rect.y + rect.height - this._calculatedTabBarHeight, rect.width, this._calculatedTabBarHeight);
291
+ this._tabHeaderRect = new Rect(rect.x, rect.y + rect.height - this._calculatedTabBarHeight, rect.width, this._calculatedTabBarHeight);
313
292
  }
314
293
  h += this._calculatedTabBarHeight;
315
294
  if (this.getTabLocation() === "top") {
316
295
  y += this._calculatedTabBarHeight;
317
296
  }
318
297
  }
319
- this._contentRect = new Rect_1.Rect(rect.x, rect.y + y, rect.width, rect.height - h);
320
- for (var i = 0; i < this._children.length; i++) {
321
- var child = this._children[i];
298
+ this._contentRect = new Rect(rect.x, rect.y + y, rect.width, rect.height - h);
299
+ for (let i = 0; i < this._children.length; i++) {
300
+ const child = this._children[i];
322
301
  child._layout(this._contentRect, metrics);
323
302
  child._setVisible(i === this.getSelected());
324
303
  }
325
- };
304
+ }
326
305
  /** @internal */
327
- TabSetNode.prototype._delete = function () {
306
+ _delete() {
328
307
  this._parent._removeChild(this);
329
- };
308
+ }
330
309
  /** @internal */
331
- TabSetNode.prototype._remove = function (node) {
332
- var removedIndex = this._removeChild(node);
310
+ _remove(node) {
311
+ const removedIndex = this._removeChild(node);
333
312
  this._model._tidy();
334
- (0, Utils_1.adjustSelectedIndex)(this, removedIndex);
335
- };
313
+ adjustSelectedIndex(this, removedIndex);
314
+ }
336
315
  /** @internal */
337
- TabSetNode.prototype.drop = function (dragNode, location, index, select) {
338
- var dockLocation = location;
316
+ drop(dragNode, location, index, select) {
317
+ const dockLocation = location;
339
318
  if (this === dragNode) {
340
319
  // tabset drop into itself
341
320
  return; // dock back to itself
342
321
  }
343
- var dragParent = dragNode.getParent();
344
- var fromIndex = 0;
322
+ let dragParent = dragNode.getParent();
323
+ let fromIndex = 0;
345
324
  if (dragParent !== undefined) {
346
325
  fromIndex = dragParent._removeChild(dragNode);
347
326
  // if selected node in border is being docked into tabset then deselect border tabs
348
- if (dragParent instanceof BorderNode_1.BorderNode && dragParent.getSelected() === fromIndex) {
327
+ if (dragParent instanceof BorderNode && dragParent.getSelected() === fromIndex) {
349
328
  dragParent._setSelected(-1);
350
329
  }
351
330
  else {
352
- (0, Utils_1.adjustSelectedIndex)(dragParent, fromIndex);
331
+ adjustSelectedIndex(dragParent, fromIndex);
353
332
  }
354
333
  }
355
334
  // if dropping a tab back to same tabset and moving to forward position then reduce insertion index
356
- if (dragNode.getType() === TabNode_1.TabNode.TYPE && dragParent === this && fromIndex < index && index > 0) {
335
+ if (dragNode.getType() === TabNode.TYPE && dragParent === this && fromIndex < index && index > 0) {
357
336
  index--;
358
337
  }
359
338
  // simple_bundled dock to existing tabset
360
- if (dockLocation === DockLocation_1.DockLocation.CENTER) {
361
- var insertPos = index;
339
+ if (dockLocation === DockLocation.CENTER) {
340
+ let insertPos = index;
362
341
  if (insertPos === -1) {
363
342
  insertPos = this._children.length;
364
343
  }
365
- if (dragNode.getType() === TabNode_1.TabNode.TYPE) {
344
+ if (dragNode.getType() === TabNode.TYPE) {
366
345
  this._addChild(dragNode, insertPos);
367
346
  if (select || (select !== false && this.isAutoSelectTab())) {
368
347
  this._setSelected(insertPos);
@@ -370,8 +349,8 @@ var TabSetNode = /** @class */ (function (_super) {
370
349
  // console.log("added child at : " + insertPos);
371
350
  }
372
351
  else {
373
- for (var i = 0; i < dragNode.getChildren().length; i++) {
374
- var child = dragNode.getChildren()[i];
352
+ for (let i = 0; i < dragNode.getChildren().length; i++) {
353
+ const child = dragNode.getChildren()[i];
375
354
  this._addChild(child, insertPos);
376
355
  // console.log("added child at : " + insertPos);
377
356
  insertPos++;
@@ -380,11 +359,11 @@ var TabSetNode = /** @class */ (function (_super) {
380
359
  this._model._setActiveTabset(this);
381
360
  }
382
361
  else {
383
- var tabSet = void 0;
384
- if (dragNode instanceof TabNode_1.TabNode) {
362
+ let tabSet;
363
+ if (dragNode instanceof TabNode) {
385
364
  // create new tabset parent
386
365
  // console.log("create a new tabset");
387
- var callback = this._model._getOnCreateTabSet();
366
+ const callback = this._model._getOnCreateTabSet();
388
367
  tabSet = new TabSetNode(this._model, callback ? callback(dragNode) : {});
389
368
  tabSet._addChild(dragNode);
390
369
  // console.log("added child at end");
@@ -393,8 +372,8 @@ var TabSetNode = /** @class */ (function (_super) {
393
372
  else {
394
373
  tabSet = dragNode;
395
374
  }
396
- var parentRow = this._parent;
397
- var pos = parentRow.getChildren().indexOf(this);
375
+ const parentRow = this._parent;
376
+ const pos = parentRow.getChildren().indexOf(this);
398
377
  if (parentRow.getOrientation() === dockLocation._orientation) {
399
378
  tabSet._setWeight(this.getWeight() / 2);
400
379
  this._setWeight(this.getWeight() / 2);
@@ -404,7 +383,7 @@ var TabSetNode = /** @class */ (function (_super) {
404
383
  else {
405
384
  // create a new row to host the new tabset (it will go in the opposite direction)
406
385
  // console.log("create a new row");
407
- var newRow = new RowNode_1.RowNode(this._model, {});
386
+ const newRow = new RowNode(this._model, {});
408
387
  newRow._setWeight(this.getWeight());
409
388
  newRow._addChild(this);
410
389
  this._setWeight(50);
@@ -417,11 +396,11 @@ var TabSetNode = /** @class */ (function (_super) {
417
396
  this._model._setActiveTabset(tabSet);
418
397
  }
419
398
  this._model._tidy();
420
- };
421
- TabSetNode.prototype.toJson = function () {
422
- var json = {};
399
+ }
400
+ toJson() {
401
+ const json = {};
423
402
  TabSetNode._attributeDefinitions.toJson(json, this._attributes);
424
- json.children = this._children.map(function (child) { return child.toJson(); });
403
+ json.children = this._children.map((child) => child.toJson());
425
404
  if (this.isActive()) {
426
405
  json.active = true;
427
406
  }
@@ -429,31 +408,29 @@ var TabSetNode = /** @class */ (function (_super) {
429
408
  json.maximized = true;
430
409
  }
431
410
  return json;
432
- };
411
+ }
433
412
  /** @internal */
434
- TabSetNode.prototype._updateAttrs = function (json) {
413
+ _updateAttrs(json) {
435
414
  TabSetNode._attributeDefinitions.update(json, this._attributes);
436
- };
415
+ }
437
416
  /** @internal */
438
- TabSetNode.prototype._getAttributeDefinitions = function () {
417
+ _getAttributeDefinitions() {
439
418
  return TabSetNode._attributeDefinitions;
440
- };
419
+ }
441
420
  /** @internal */
442
- TabSetNode.prototype._getPrefSize = function (orientation) {
443
- var prefSize = this.getWidth();
444
- if (orientation === Orientation_1.Orientation.VERT) {
421
+ _getPrefSize(orientation) {
422
+ let prefSize = this.getWidth();
423
+ if (orientation === Orientation.VERT) {
445
424
  prefSize = this.getHeight();
446
425
  }
447
426
  return prefSize;
448
- };
427
+ }
449
428
  /** @internal */
450
- TabSetNode.getAttributeDefinitions = function () {
429
+ static getAttributeDefinitions() {
451
430
  return TabSetNode._attributeDefinitions;
452
- };
453
- TabSetNode.TYPE = "tabset";
454
- /** @internal */
455
- TabSetNode._attributeDefinitions = TabSetNode._createAttributeDefinitions();
456
- return TabSetNode;
457
- }(Node_1.Node));
458
- exports.TabSetNode = TabSetNode;
431
+ }
432
+ }
433
+ TabSetNode.TYPE = "tabset";
434
+ /** @internal */
435
+ TabSetNode._attributeDefinitions = TabSetNode._createAttributeDefinitions();
459
436
  //# sourceMappingURL=TabSetNode.js.map