flexlayout-react 0.7.1 → 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 (103) hide show
  1. package/ChangeLog.txt +12 -0
  2. package/README.md +33 -34
  3. package/declarations/view/Icons.d.ts +1 -0
  4. package/declarations/view/Layout.d.ts +1 -0
  5. package/dist/flexlayout.js +96 -184
  6. package/dist/flexlayout_min.js +1 -1
  7. package/lib/Attribute.js +12 -17
  8. package/lib/Attribute.js.map +1 -1
  9. package/lib/AttributeDefinitions.js +44 -53
  10. package/lib/AttributeDefinitions.js.map +1 -1
  11. package/lib/DockLocation.js +41 -46
  12. package/lib/DockLocation.js.map +1 -1
  13. package/lib/DragDrop.js +55 -60
  14. package/lib/DragDrop.js.map +1 -1
  15. package/lib/DropInfo.js +3 -8
  16. package/lib/DropInfo.js.map +1 -1
  17. package/lib/I18nLabel.js +2 -5
  18. package/lib/I18nLabel.js.map +1 -1
  19. package/lib/Orientation.js +11 -16
  20. package/lib/Orientation.js.map +1 -1
  21. package/lib/PopupMenu.js +24 -28
  22. package/lib/PopupMenu.js.map +1 -1
  23. package/lib/Rect.js +35 -41
  24. package/lib/Rect.js.map +1 -1
  25. package/lib/Types.js +2 -5
  26. package/lib/Types.js.map +1 -1
  27. package/lib/index.js +22 -38
  28. package/lib/index.js.map +1 -1
  29. package/lib/model/Action.js +3 -8
  30. package/lib/model/Action.js.map +1 -1
  31. package/lib/model/Actions.js +68 -75
  32. package/lib/model/Actions.js.map +1 -1
  33. package/lib/model/BorderNode.js +189 -206
  34. package/lib/model/BorderNode.js.map +1 -1
  35. package/lib/model/BorderSet.js +44 -55
  36. package/lib/model/BorderSet.js.map +1 -1
  37. package/lib/model/ICloseType.js +2 -5
  38. package/lib/model/ICloseType.js.map +1 -1
  39. package/lib/model/IDraggable.js +1 -2
  40. package/lib/model/IDropTarget.js +1 -2
  41. package/lib/model/IJsonModel.js +1 -2
  42. package/lib/model/Model.js +217 -232
  43. package/lib/model/Model.js.map +1 -1
  44. package/lib/model/Node.js +87 -94
  45. package/lib/model/Node.js.map +1 -1
  46. package/lib/model/RowNode.js +204 -250
  47. package/lib/model/RowNode.js.map +1 -1
  48. package/lib/model/SplitterNode.js +35 -57
  49. package/lib/model/SplitterNode.js.map +1 -1
  50. package/lib/model/TabNode.js +100 -124
  51. package/lib/model/TabNode.js.map +1 -1
  52. package/lib/model/TabSetNode.js +181 -197
  53. package/lib/model/TabSetNode.js.map +1 -1
  54. package/lib/model/Utils.js +20 -26
  55. package/lib/model/Utils.js.map +1 -1
  56. package/lib/view/BorderButton.js +45 -49
  57. package/lib/view/BorderButton.js.map +1 -1
  58. package/lib/view/BorderTabSet.js +57 -61
  59. package/lib/view/BorderTabSet.js.map +1 -1
  60. package/lib/view/ErrorBoundary.js +15 -37
  61. package/lib/view/ErrorBoundary.js.map +1 -1
  62. package/lib/view/FloatingWindow.js +43 -56
  63. package/lib/view/FloatingWindow.js.map +1 -1
  64. package/lib/view/FloatingWindowTab.js +12 -16
  65. package/lib/view/FloatingWindowTab.js.map +1 -1
  66. package/lib/view/Icons.js +17 -25
  67. package/lib/view/Icons.js.map +1 -1
  68. package/lib/view/Layout.js +396 -508
  69. package/lib/view/Layout.js.map +1 -1
  70. package/lib/view/Splitter.js +53 -57
  71. package/lib/view/Splitter.js.map +1 -1
  72. package/lib/view/Tab.js +31 -35
  73. package/lib/view/Tab.js.map +1 -1
  74. package/lib/view/TabButton.js +46 -50
  75. package/lib/view/TabButton.js.map +1 -1
  76. package/lib/view/TabButtonStamp.js +11 -15
  77. package/lib/view/TabButtonStamp.js.map +1 -1
  78. package/lib/view/TabFloating.js +30 -34
  79. package/lib/view/TabFloating.js.map +1 -1
  80. package/lib/view/TabOverflowHook.js +46 -50
  81. package/lib/view/TabOverflowHook.js.map +1 -1
  82. package/lib/view/TabSet.js +93 -106
  83. package/lib/view/TabSet.js.map +1 -1
  84. package/lib/view/Utils.js +11 -17
  85. package/lib/view/Utils.js.map +1 -1
  86. package/package.json +5 -3
  87. package/src/model/BorderNode.ts +6 -1
  88. package/src/model/TabSetNode.ts +6 -1
  89. package/src/view/FloatingWindow.tsx +5 -1
  90. package/src/view/Icons.tsx +7 -7
  91. package/src/view/Layout.tsx +23 -104
  92. package/style/dark.css +1 -0
  93. package/style/dark.css.map +1 -1
  94. package/style/dark.scss +1 -0
  95. package/style/gray.css +1 -0
  96. package/style/gray.css.map +1 -1
  97. package/style/gray.scss +1 -0
  98. package/style/light.css +1 -0
  99. package/style/light.css.map +1 -1
  100. package/style/light.scss +1 -0
  101. package/style/underline.css +1 -0
  102. package/style/underline.css.map +1 -1
  103. package/style/underline.scss +1 -0
@@ -1,391 +1,348 @@
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
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
- if (ar || !(i in from)) {
31
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
- ar[i] = from[i];
33
- }
34
- }
35
- return to.concat(ar || Array.prototype.slice.call(from));
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.Layout = void 0;
39
- var React = require("react");
40
- var react_dom_1 = require("react-dom");
41
- var DockLocation_1 = require("../DockLocation");
42
- var DragDrop_1 = require("../DragDrop");
43
- var Actions_1 = require("../model/Actions");
44
- var BorderNode_1 = require("../model/BorderNode");
45
- var SplitterNode_1 = require("../model/SplitterNode");
46
- var TabNode_1 = require("../model/TabNode");
47
- var TabSetNode_1 = require("../model/TabSetNode");
48
- var Rect_1 = require("../Rect");
49
- var Types_1 = require("../Types");
50
- var BorderTabSet_1 = require("./BorderTabSet");
51
- var Splitter_1 = require("./Splitter");
52
- var Tab_1 = require("./Tab");
53
- var TabSet_1 = require("./TabSet");
54
- var FloatingWindow_1 = require("./FloatingWindow");
55
- var FloatingWindowTab_1 = require("./FloatingWindowTab");
56
- var TabFloating_1 = require("./TabFloating");
57
- var Orientation_1 = require("../Orientation");
58
- var Icons_1 = require("./Icons");
59
- var TabButtonStamp_1 = require("./TabButtonStamp");
60
- var defaultIcons = {
61
- close: React.createElement(Icons_1.CloseIcon, null),
62
- closeTabset: React.createElement(Icons_1.CloseIcon, null),
63
- popout: React.createElement(Icons_1.PopoutIcon, null),
64
- maximize: React.createElement(Icons_1.MaximizeIcon, null),
65
- restore: React.createElement(Icons_1.RestoreIcon, null),
66
- more: React.createElement(Icons_1.OverflowIcon, null),
1
+ import * as React from "react";
2
+ import { createPortal } from "react-dom";
3
+ import { DockLocation } from "../DockLocation";
4
+ import { DragDrop } from "../DragDrop";
5
+ import { Actions } from "../model/Actions";
6
+ import { BorderNode } from "../model/BorderNode";
7
+ import { SplitterNode } from "../model/SplitterNode";
8
+ import { TabNode } from "../model/TabNode";
9
+ import { TabSetNode } from "../model/TabSetNode";
10
+ import { Rect } from "../Rect";
11
+ import { CLASSES } from "../Types";
12
+ import { BorderTabSet } from "./BorderTabSet";
13
+ import { Splitter } from "./Splitter";
14
+ import { Tab } from "./Tab";
15
+ import { TabSet } from "./TabSet";
16
+ import { FloatingWindow } from "./FloatingWindow";
17
+ import { FloatingWindowTab } from "./FloatingWindowTab";
18
+ import { TabFloating } from "./TabFloating";
19
+ import { Orientation } from "../Orientation";
20
+ import { CloseIcon, MaximizeIcon, OverflowIcon, PopoutIcon, RestoreIcon } from "./Icons";
21
+ import { TabButtonStamp } from "./TabButtonStamp";
22
+ const defaultIcons = {
23
+ close: React.createElement(CloseIcon, null),
24
+ closeTabset: React.createElement(CloseIcon, null),
25
+ popout: React.createElement(PopoutIcon, null),
26
+ maximize: React.createElement(MaximizeIcon, null),
27
+ restore: React.createElement(RestoreIcon, null),
28
+ more: React.createElement(OverflowIcon, null),
67
29
  };
68
30
  // Popout windows work in latest browsers based on webkit (Chrome, Opera, Safari, latest Edge) and Firefox. They do
69
31
  // not work on any version if IE or the original Edge browser
70
32
  // Assume any recent desktop browser not IE or original Edge will work
71
33
  /** @internal */
72
34
  // @ts-ignore
73
- var isIEorEdge = typeof window !== "undefined" && (window.document.documentMode || /Edge\//.test(window.navigator.userAgent));
35
+ const isIEorEdge = typeof window !== "undefined" && (window.document.documentMode || /Edge\//.test(window.navigator.userAgent));
74
36
  /** @internal */
75
- var isDesktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
37
+ const isDesktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
76
38
  /** @internal */
77
- var defaultSupportsPopout = isDesktop && !isIEorEdge;
39
+ const defaultSupportsPopout = isDesktop && !isIEorEdge;
78
40
  /**
79
41
  * A React component that hosts a multi-tabbed layout
80
42
  */
81
- var Layout = /** @class */ (function (_super) {
82
- __extends(Layout, _super);
83
- function Layout(props) {
84
- var _this = _super.call(this, props) || this;
85
- /** @internal */
86
- _this.firstMove = false;
43
+ export class Layout extends React.Component {
44
+ constructor(props) {
45
+ super(props);
87
46
  /** @internal */
88
- _this.dragRectRendered = true;
47
+ this.firstMove = false;
89
48
  /** @internal */
90
- _this.dragDivText = undefined;
49
+ this.dragRectRendered = true;
91
50
  /** @internal */
92
- _this.edgeRectLength = 100;
51
+ this.dragDivText = undefined;
93
52
  /** @internal */
94
- _this.edgeRectWidth = 10;
53
+ this.edgeRectLength = 100;
95
54
  /** @internal */
96
- _this.edgesShown = false;
55
+ this.edgeRectWidth = 10;
97
56
  /** @internal */
98
- _this.onModelChange = function () {
99
- _this.forceUpdate();
100
- if (_this.props.onModelChange) {
101
- _this.props.onModelChange(_this.props.model);
57
+ this.onModelChange = () => {
58
+ this.forceUpdate();
59
+ if (this.props.onModelChange) {
60
+ this.props.onModelChange(this.props.model);
102
61
  }
103
62
  };
104
63
  /** @internal */
105
- _this.updateRect = function (domRect) {
106
- if (domRect === void 0) { domRect = _this.getDomRect(); }
107
- var rect = new Rect_1.Rect(0, 0, domRect.width, domRect.height);
108
- if (!rect.equals(_this.state.rect) && rect.width !== 0 && rect.height !== 0) {
109
- _this.setState({ rect: rect });
64
+ this.updateRect = (domRect = this.getDomRect()) => {
65
+ const rect = new Rect(0, 0, domRect.width, domRect.height);
66
+ if (!rect.equals(this.state.rect) && rect.width !== 0 && rect.height !== 0) {
67
+ this.setState({ rect });
110
68
  }
111
69
  };
112
70
  /** @internal */
113
- _this.updateLayoutMetrics = function () {
114
- if (_this.findHeaderBarSizeRef.current) {
115
- var headerBarSize = _this.findHeaderBarSizeRef.current.getBoundingClientRect().height;
116
- if (headerBarSize !== _this.state.calculatedHeaderBarSize) {
117
- _this.setState({ calculatedHeaderBarSize: headerBarSize });
71
+ this.updateLayoutMetrics = () => {
72
+ if (this.findHeaderBarSizeRef.current) {
73
+ const headerBarSize = this.findHeaderBarSizeRef.current.getBoundingClientRect().height;
74
+ if (headerBarSize !== this.state.calculatedHeaderBarSize) {
75
+ this.setState({ calculatedHeaderBarSize: headerBarSize });
118
76
  }
119
77
  }
120
- if (_this.findTabBarSizeRef.current) {
121
- var tabBarSize = _this.findTabBarSizeRef.current.getBoundingClientRect().height;
122
- if (tabBarSize !== _this.state.calculatedTabBarSize) {
123
- _this.setState({ calculatedTabBarSize: tabBarSize });
78
+ if (this.findTabBarSizeRef.current) {
79
+ const tabBarSize = this.findTabBarSizeRef.current.getBoundingClientRect().height;
80
+ if (tabBarSize !== this.state.calculatedTabBarSize) {
81
+ this.setState({ calculatedTabBarSize: tabBarSize });
124
82
  }
125
83
  }
126
- if (_this.findBorderBarSizeRef.current) {
127
- var borderBarSize = _this.findBorderBarSizeRef.current.getBoundingClientRect().height;
128
- if (borderBarSize !== _this.state.calculatedBorderBarSize) {
129
- _this.setState({ calculatedBorderBarSize: borderBarSize });
84
+ if (this.findBorderBarSizeRef.current) {
85
+ const borderBarSize = this.findBorderBarSizeRef.current.getBoundingClientRect().height;
86
+ if (borderBarSize !== this.state.calculatedBorderBarSize) {
87
+ this.setState({ calculatedBorderBarSize: borderBarSize });
130
88
  }
131
89
  }
132
90
  };
133
91
  /** @internal */
134
- _this.getClassName = function (defaultClassName) {
135
- if (_this.props.classNameMapper === undefined) {
92
+ this.getClassName = (defaultClassName) => {
93
+ if (this.props.classNameMapper === undefined) {
136
94
  return defaultClassName;
137
95
  }
138
96
  else {
139
- return _this.props.classNameMapper(defaultClassName);
97
+ return this.props.classNameMapper(defaultClassName);
140
98
  }
141
99
  };
142
100
  /** @internal */
143
- _this.onCloseWindow = function (id) {
144
- _this.doAction(Actions_1.Actions.unFloatTab(id));
101
+ this.onCloseWindow = (id) => {
102
+ this.doAction(Actions.unFloatTab(id));
145
103
  try {
146
- _this.props.model.getNodeById(id)._setWindow(undefined);
104
+ this.props.model.getNodeById(id)._setWindow(undefined);
147
105
  }
148
106
  catch (e) {
149
107
  // catch incase it was a model change
150
108
  }
151
109
  };
152
110
  /** @internal */
153
- _this.onSetWindow = function (id, window) {
154
- _this.props.model.getNodeById(id)._setWindow(window);
111
+ this.onSetWindow = (id, window) => {
112
+ this.props.model.getNodeById(id)._setWindow(window);
155
113
  };
156
114
  /** @internal */
157
- _this.onCancelAdd = function () {
115
+ this.onCancelAdd = () => {
158
116
  var _a, _b;
159
- var rootdiv = _this.selfRef.current;
160
- rootdiv.removeChild(_this.dragDiv);
161
- _this.dragDiv = undefined;
162
- _this.hidePortal();
163
- if (_this.fnNewNodeDropped != null) {
164
- _this.fnNewNodeDropped();
165
- _this.fnNewNodeDropped = undefined;
117
+ const rootdiv = this.selfRef.current;
118
+ rootdiv.removeChild(this.dragDiv);
119
+ this.dragDiv = undefined;
120
+ this.hidePortal();
121
+ if (this.fnNewNodeDropped != null) {
122
+ this.fnNewNodeDropped();
123
+ this.fnNewNodeDropped = undefined;
166
124
  }
167
125
  try {
168
- (_b = (_a = _this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated) === null || _b === void 0 ? void 0 : _b.call(_a);
126
+ (_b = (_a = this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated) === null || _b === void 0 ? void 0 : _b.call(_a);
169
127
  }
170
128
  catch (e) {
171
129
  console.error(e);
172
130
  }
173
- DragDrop_1.DragDrop.instance.hideGlass();
174
- _this.newTabJson = undefined;
175
- _this.customDrop = undefined;
131
+ DragDrop.instance.hideGlass();
132
+ this.newTabJson = undefined;
133
+ this.customDrop = undefined;
176
134
  };
177
135
  /** @internal */
178
- _this.onCancelDrag = function (wasDragging) {
136
+ this.onCancelDrag = (wasDragging) => {
179
137
  var _a, _b;
180
138
  if (wasDragging) {
181
- var rootdiv = _this.selfRef.current;
139
+ const rootdiv = this.selfRef.current;
182
140
  try {
183
- rootdiv.removeChild(_this.outlineDiv);
141
+ rootdiv.removeChild(this.outlineDiv);
184
142
  }
185
143
  catch (e) { }
186
144
  try {
187
- rootdiv.removeChild(_this.dragDiv);
145
+ rootdiv.removeChild(this.dragDiv);
188
146
  }
189
147
  catch (e) { }
190
- _this.dragDiv = undefined;
191
- _this.hidePortal();
192
- _this.hideEdges(rootdiv);
193
- if (_this.fnNewNodeDropped != null) {
194
- _this.fnNewNodeDropped();
195
- _this.fnNewNodeDropped = undefined;
148
+ this.dragDiv = undefined;
149
+ this.hidePortal();
150
+ this.setState({ showEdges: false });
151
+ if (this.fnNewNodeDropped != null) {
152
+ this.fnNewNodeDropped();
153
+ this.fnNewNodeDropped = undefined;
196
154
  }
197
155
  try {
198
- (_b = (_a = _this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated) === null || _b === void 0 ? void 0 : _b.call(_a);
156
+ (_b = (_a = this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated) === null || _b === void 0 ? void 0 : _b.call(_a);
199
157
  }
200
158
  catch (e) {
201
159
  console.error(e);
202
160
  }
203
- DragDrop_1.DragDrop.instance.hideGlass();
204
- _this.newTabJson = undefined;
205
- _this.customDrop = undefined;
161
+ DragDrop.instance.hideGlass();
162
+ this.newTabJson = undefined;
163
+ this.customDrop = undefined;
206
164
  }
207
- _this.setState({ showHiddenBorder: DockLocation_1.DockLocation.CENTER });
165
+ this.setState({ showHiddenBorder: DockLocation.CENTER });
208
166
  };
209
167
  /** @internal */
210
- _this.onDragDivMouseDown = function (event) {
168
+ this.onDragDivMouseDown = (event) => {
211
169
  event.preventDefault();
212
- _this.dragStart(event, _this.dragDivText, TabNode_1.TabNode._fromJson(_this.newTabJson, _this.props.model, false), true, undefined, undefined);
170
+ this.dragStart(event, this.dragDivText, TabNode._fromJson(this.newTabJson, this.props.model, false), true, undefined, undefined);
213
171
  };
214
172
  /** @internal */
215
- _this.dragStart = function (event, dragDivText, node, allowDrag, onClick, onDoubleClick) {
173
+ this.dragStart = (event, dragDivText, node, allowDrag, onClick, onDoubleClick) => {
216
174
  if (!allowDrag) {
217
- DragDrop_1.DragDrop.instance.startDrag(event, undefined, undefined, undefined, undefined, onClick, onDoubleClick, _this.currentDocument, _this.selfRef.current);
175
+ DragDrop.instance.startDrag(event, undefined, undefined, undefined, undefined, onClick, onDoubleClick, this.currentDocument, this.selfRef.current);
218
176
  }
219
177
  else {
220
- _this.dragNode = node;
221
- _this.dragDivText = dragDivText;
222
- DragDrop_1.DragDrop.instance.startDrag(event, _this.onDragStart, _this.onDragMove, _this.onDragEnd, _this.onCancelDrag, onClick, onDoubleClick, _this.currentDocument, _this.selfRef.current);
178
+ this.dragNode = node;
179
+ this.dragDivText = dragDivText;
180
+ DragDrop.instance.startDrag(event, this.onDragStart, this.onDragMove, this.onDragEnd, this.onCancelDrag, onClick, onDoubleClick, this.currentDocument, this.selfRef.current);
223
181
  }
224
182
  };
225
183
  /** @internal */
226
- _this.dragRectRender = function (text, node, json, onRendered) {
227
- var content;
184
+ this.dragRectRender = (text, node, json, onRendered) => {
185
+ let content;
228
186
  if (text !== undefined) {
229
187
  content = React.createElement("div", { style: { whiteSpace: "pre" } }, text.replace("<br>", "\n"));
230
188
  }
231
189
  else {
232
- if (node && node instanceof TabNode_1.TabNode) {
233
- content = (React.createElement(TabButtonStamp_1.TabButtonStamp, { node: node, layout: _this, iconFactory: _this.props.iconFactory, titleFactory: _this.props.titleFactory }));
190
+ if (node && node instanceof TabNode) {
191
+ content = (React.createElement(TabButtonStamp, { node: node, layout: this, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory }));
234
192
  }
235
193
  }
236
- if (_this.props.onRenderDragRect !== undefined) {
237
- var customContent = _this.props.onRenderDragRect(content, node, json);
194
+ if (this.props.onRenderDragRect !== undefined) {
195
+ const customContent = this.props.onRenderDragRect(content, node, json);
238
196
  if (customContent !== undefined) {
239
197
  content = customContent;
240
198
  }
241
199
  }
242
200
  // hide div until the render is complete
243
- _this.dragDiv.style.visibility = "hidden";
244
- _this.dragRectRendered = false;
245
- _this.showPortal(React.createElement(DragRectRenderWrapper
201
+ this.dragDiv.style.visibility = "hidden";
202
+ this.dragRectRendered = false;
203
+ this.showPortal(React.createElement(DragRectRenderWrapper
246
204
  // wait for it to be rendered
247
205
  , {
248
206
  // wait for it to be rendered
249
- onRendered: function () {
250
- _this.dragRectRendered = true;
207
+ onRendered: () => {
208
+ this.dragRectRendered = true;
251
209
  onRendered === null || onRendered === void 0 ? void 0 : onRendered();
252
- } }, content), _this.dragDiv);
210
+ } }, content), this.dragDiv);
253
211
  };
254
212
  /** @internal */
255
- _this.showPortal = function (control, element) {
256
- var portal = (0, react_dom_1.createPortal)(control, element);
257
- _this.setState({ portal: portal });
213
+ this.showPortal = (control, element) => {
214
+ const portal = createPortal(control, element);
215
+ this.setState({ portal });
258
216
  };
259
217
  /** @internal */
260
- _this.hidePortal = function () {
261
- _this.setState({ portal: undefined });
218
+ this.hidePortal = () => {
219
+ this.setState({ portal: undefined });
262
220
  };
263
221
  /** @internal */
264
- _this.onDragStart = function () {
265
- _this.dropInfo = undefined;
266
- _this.customDrop = undefined;
267
- var rootdiv = _this.selfRef.current;
268
- _this.outlineDiv = _this.currentDocument.createElement("div");
269
- _this.outlineDiv.className = _this.getClassName(Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT);
270
- _this.outlineDiv.style.visibility = "hidden";
271
- rootdiv.appendChild(_this.outlineDiv);
272
- if (_this.dragDiv == null) {
273
- _this.dragDiv = _this.currentDocument.createElement("div");
274
- _this.dragDiv.className = _this.getClassName(Types_1.CLASSES.FLEXLAYOUT__DRAG_RECT);
275
- _this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
276
- _this.dragRectRender(_this.dragDivText, _this.dragNode, _this.newTabJson);
277
- rootdiv.appendChild(_this.dragDiv);
222
+ this.onDragStart = () => {
223
+ this.dropInfo = undefined;
224
+ this.customDrop = undefined;
225
+ const rootdiv = this.selfRef.current;
226
+ this.outlineDiv = this.currentDocument.createElement("div");
227
+ this.outlineDiv.className = this.getClassName(CLASSES.FLEXLAYOUT__OUTLINE_RECT);
228
+ this.outlineDiv.style.visibility = "hidden";
229
+ rootdiv.appendChild(this.outlineDiv);
230
+ if (this.dragDiv == null) {
231
+ this.dragDiv = this.currentDocument.createElement("div");
232
+ this.dragDiv.className = this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT);
233
+ this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
234
+ this.dragRectRender(this.dragDivText, this.dragNode, this.newTabJson);
235
+ rootdiv.appendChild(this.dragDiv);
278
236
  }
279
237
  // add edge indicators
280
- if (_this.props.model.getMaximizedTabset() === undefined) {
281
- _this.showEdges(rootdiv);
238
+ if (this.props.model.getMaximizedTabset() === undefined) {
239
+ this.setState({ showEdges: true });
282
240
  }
283
- if (_this.dragNode !== undefined && _this.dragNode instanceof TabNode_1.TabNode && _this.dragNode.getTabRect() !== undefined) {
284
- _this.dragNode.getTabRect().positionElement(_this.outlineDiv);
241
+ if (this.dragNode !== undefined && this.dragNode instanceof TabNode && this.dragNode.getTabRect() !== undefined) {
242
+ this.dragNode.getTabRect().positionElement(this.outlineDiv);
285
243
  }
286
- _this.firstMove = true;
244
+ this.firstMove = true;
287
245
  return true;
288
246
  };
289
247
  /** @internal */
290
- _this.onDragMove = function (event) {
291
- if (_this.firstMove === false) {
292
- var speed = _this.props.model._getAttribute("tabDragSpeed");
293
- _this.outlineDiv.style.transition = "top ".concat(speed, "s, left ").concat(speed, "s, width ").concat(speed, "s, height ").concat(speed, "s");
294
- }
295
- _this.firstMove = false;
296
- var clientRect = _this.selfRef.current.getBoundingClientRect();
297
- var pos = {
248
+ this.onDragMove = (event) => {
249
+ if (this.firstMove === false) {
250
+ const speed = this.props.model._getAttribute("tabDragSpeed");
251
+ this.outlineDiv.style.transition = `top ${speed}s, left ${speed}s, width ${speed}s, height ${speed}s`;
252
+ }
253
+ this.firstMove = false;
254
+ const clientRect = this.selfRef.current.getBoundingClientRect();
255
+ const pos = {
298
256
  x: event.clientX - clientRect.left,
299
257
  y: event.clientY - clientRect.top,
300
258
  };
301
- _this.checkForBorderToShow(pos.x, pos.y);
259
+ this.checkForBorderToShow(pos.x, pos.y);
302
260
  // keep it between left & right
303
- var dragRect = _this.dragDiv.getBoundingClientRect();
304
- var newLeft = pos.x - dragRect.width / 2;
261
+ const dragRect = this.dragDiv.getBoundingClientRect();
262
+ let newLeft = pos.x - dragRect.width / 2;
305
263
  if (newLeft + dragRect.width > clientRect.width) {
306
264
  newLeft = clientRect.width - dragRect.width;
307
265
  }
308
266
  newLeft = Math.max(0, newLeft);
309
- _this.dragDiv.style.left = newLeft + "px";
310
- _this.dragDiv.style.top = pos.y + 5 + "px";
311
- if (_this.dragRectRendered && _this.dragDiv.style.visibility === "hidden") {
267
+ this.dragDiv.style.left = newLeft + "px";
268
+ this.dragDiv.style.top = pos.y + 5 + "px";
269
+ if (this.dragRectRendered && this.dragDiv.style.visibility === "hidden") {
312
270
  // make visible once the drag rect has been rendered
313
- _this.dragDiv.style.visibility = "visible";
271
+ this.dragDiv.style.visibility = "visible";
314
272
  }
315
- var dropInfo = _this.props.model._findDropTargetNode(_this.dragNode, pos.x, pos.y);
273
+ let dropInfo = this.props.model._findDropTargetNode(this.dragNode, pos.x, pos.y);
316
274
  if (dropInfo) {
317
- if (_this.props.onTabDrag) {
318
- _this.handleCustomTabDrag(dropInfo, pos, event);
275
+ if (this.props.onTabDrag) {
276
+ this.handleCustomTabDrag(dropInfo, pos, event);
319
277
  }
320
278
  else {
321
- _this.dropInfo = dropInfo;
322
- _this.outlineDiv.className = _this.getClassName(dropInfo.className);
323
- dropInfo.rect.positionElement(_this.outlineDiv);
324
- _this.outlineDiv.style.visibility = "visible";
279
+ this.dropInfo = dropInfo;
280
+ this.outlineDiv.className = this.getClassName(dropInfo.className);
281
+ dropInfo.rect.positionElement(this.outlineDiv);
282
+ this.outlineDiv.style.visibility = "visible";
325
283
  }
326
284
  }
327
285
  };
328
286
  /** @internal */
329
- _this.onDragEnd = function (event) {
330
- var rootdiv = _this.selfRef.current;
331
- rootdiv.removeChild(_this.outlineDiv);
332
- rootdiv.removeChild(_this.dragDiv);
333
- _this.dragDiv = undefined;
334
- _this.hidePortal();
335
- _this.hideEdges(rootdiv);
336
- DragDrop_1.DragDrop.instance.hideGlass();
337
- if (_this.dropInfo) {
338
- if (_this.customDrop) {
339
- _this.newTabJson = undefined;
287
+ this.onDragEnd = (event) => {
288
+ const rootdiv = this.selfRef.current;
289
+ rootdiv.removeChild(this.outlineDiv);
290
+ rootdiv.removeChild(this.dragDiv);
291
+ this.dragDiv = undefined;
292
+ this.hidePortal();
293
+ this.setState({ showEdges: false });
294
+ DragDrop.instance.hideGlass();
295
+ if (this.dropInfo) {
296
+ if (this.customDrop) {
297
+ this.newTabJson = undefined;
340
298
  try {
341
- var _a = _this.customDrop, callback = _a.callback, dragging = _a.dragging, over = _a.over, x = _a.x, y = _a.y, location_1 = _a.location;
342
- callback(dragging, over, x, y, location_1);
343
- if (_this.fnNewNodeDropped != null) {
344
- _this.fnNewNodeDropped();
345
- _this.fnNewNodeDropped = undefined;
299
+ const { callback, dragging, over, x, y, location } = this.customDrop;
300
+ callback(dragging, over, x, y, location);
301
+ if (this.fnNewNodeDropped != null) {
302
+ this.fnNewNodeDropped();
303
+ this.fnNewNodeDropped = undefined;
346
304
  }
347
305
  }
348
306
  catch (e) {
349
307
  console.error(e);
350
308
  }
351
309
  }
352
- else if (_this.newTabJson !== undefined) {
353
- var newNode = _this.doAction(Actions_1.Actions.addNode(_this.newTabJson, _this.dropInfo.node.getId(), _this.dropInfo.location, _this.dropInfo.index));
354
- if (_this.fnNewNodeDropped != null) {
355
- _this.fnNewNodeDropped(newNode, event);
356
- _this.fnNewNodeDropped = undefined;
310
+ else if (this.newTabJson !== undefined) {
311
+ const newNode = this.doAction(Actions.addNode(this.newTabJson, this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
312
+ if (this.fnNewNodeDropped != null) {
313
+ this.fnNewNodeDropped(newNode, event);
314
+ this.fnNewNodeDropped = undefined;
357
315
  }
358
- _this.newTabJson = undefined;
316
+ this.newTabJson = undefined;
359
317
  }
360
- else if (_this.dragNode !== undefined) {
361
- _this.doAction(Actions_1.Actions.moveNode(_this.dragNode.getId(), _this.dropInfo.node.getId(), _this.dropInfo.location, _this.dropInfo.index));
318
+ else if (this.dragNode !== undefined) {
319
+ this.doAction(Actions.moveNode(this.dragNode.getId(), this.dropInfo.node.getId(), this.dropInfo.location, this.dropInfo.index));
362
320
  }
363
321
  }
364
- _this.setState({ showHiddenBorder: DockLocation_1.DockLocation.CENTER });
322
+ this.setState({ showHiddenBorder: DockLocation.CENTER });
365
323
  };
366
- _this.props.model._setChangeListener(_this.onModelChange);
367
- _this.tabIds = [];
368
- _this.selfRef = React.createRef();
369
- _this.findHeaderBarSizeRef = React.createRef();
370
- _this.findTabBarSizeRef = React.createRef();
371
- _this.findBorderBarSizeRef = React.createRef();
372
- _this.supportsPopout = props.supportsPopout !== undefined ? props.supportsPopout : defaultSupportsPopout;
373
- _this.popoutURL = props.popoutURL ? props.popoutURL : "popout.html";
374
- _this.icons = __assign(__assign({}, defaultIcons), props.icons);
375
- _this.firstRender = true;
376
- _this.state = {
377
- rect: new Rect_1.Rect(0, 0, 0, 0),
324
+ this.props.model._setChangeListener(this.onModelChange);
325
+ this.tabIds = [];
326
+ this.selfRef = React.createRef();
327
+ this.findHeaderBarSizeRef = React.createRef();
328
+ this.findTabBarSizeRef = React.createRef();
329
+ this.findBorderBarSizeRef = React.createRef();
330
+ this.supportsPopout = props.supportsPopout !== undefined ? props.supportsPopout : defaultSupportsPopout;
331
+ this.popoutURL = props.popoutURL ? props.popoutURL : "popout.html";
332
+ this.icons = Object.assign(Object.assign({}, defaultIcons), props.icons);
333
+ this.state = {
334
+ rect: new Rect(0, 0, 0, 0),
378
335
  calculatedHeaderBarSize: 25,
379
336
  calculatedTabBarSize: 26,
380
337
  calculatedBorderBarSize: 30,
381
338
  editingTab: undefined,
382
- showHiddenBorder: DockLocation_1.DockLocation.CENTER,
339
+ showHiddenBorder: DockLocation.CENTER,
340
+ showEdges: false,
383
341
  };
384
- _this.onDragEnter = _this.onDragEnter.bind(_this);
385
- return _this;
342
+ this.onDragEnter = this.onDragEnter.bind(this);
386
343
  }
387
344
  /** @internal */
388
- Layout.prototype.styleFont = function (style) {
345
+ styleFont(style) {
389
346
  if (this.props.font) {
390
347
  if (this.selfRef.current) {
391
348
  if (this.props.font.size) {
@@ -403,11 +360,11 @@ var Layout = /** @class */ (function (_super) {
403
360
  }
404
361
  }
405
362
  return style;
406
- };
363
+ }
407
364
  /** @internal */
408
- Layout.prototype.doAction = function (action) {
365
+ doAction(action) {
409
366
  if (this.props.onAction !== undefined) {
410
- var outcome = this.props.onAction(action);
367
+ const outcome = this.props.onAction(action);
411
368
  if (outcome !== undefined) {
412
369
  return this.props.model.doAction(outcome);
413
370
  }
@@ -416,22 +373,21 @@ var Layout = /** @class */ (function (_super) {
416
373
  else {
417
374
  return this.props.model.doAction(action);
418
375
  }
419
- };
376
+ }
420
377
  /** @internal */
421
- Layout.prototype.componentDidMount = function () {
422
- var _this = this;
378
+ componentDidMount() {
423
379
  this.updateRect();
424
380
  this.updateLayoutMetrics();
425
381
  // need to re-render if size changes
426
382
  this.currentDocument = this.selfRef.current.ownerDocument;
427
383
  this.currentWindow = this.currentDocument.defaultView;
428
- this.resizeObserver = new ResizeObserver(function (entries) {
429
- _this.updateRect(entries[0].contentRect);
384
+ this.resizeObserver = new ResizeObserver(entries => {
385
+ this.updateRect(entries[0].contentRect);
430
386
  });
431
387
  this.resizeObserver.observe(this.selfRef.current);
432
- };
388
+ }
433
389
  /** @internal */
434
- Layout.prototype.componentDidUpdate = function () {
390
+ componentDidUpdate() {
435
391
  this.updateLayoutMetrics();
436
392
  if (this.props.model !== this.previousModel) {
437
393
  if (this.previousModel !== undefined) {
@@ -441,69 +397,64 @@ var Layout = /** @class */ (function (_super) {
441
397
  this.previousModel = this.props.model;
442
398
  }
443
399
  // console.log("Layout time: " + this.layoutTime + "ms Render time: " + (Date.now() - this.start) + "ms");
444
- };
400
+ }
445
401
  /** @internal */
446
- Layout.prototype.getCurrentDocument = function () {
402
+ getCurrentDocument() {
447
403
  return this.currentDocument;
448
- };
404
+ }
449
405
  /** @internal */
450
- Layout.prototype.getDomRect = function () {
406
+ getDomRect() {
451
407
  return this.selfRef.current.getBoundingClientRect();
452
- };
408
+ }
453
409
  /** @internal */
454
- Layout.prototype.getRootDiv = function () {
410
+ getRootDiv() {
455
411
  return this.selfRef.current;
456
- };
412
+ }
457
413
  /** @internal */
458
- Layout.prototype.isSupportsPopout = function () {
414
+ isSupportsPopout() {
459
415
  return this.supportsPopout;
460
- };
416
+ }
461
417
  /** @internal */
462
- Layout.prototype.isRealtimeResize = function () {
418
+ isRealtimeResize() {
463
419
  var _a;
464
420
  return (_a = this.props.realtimeResize) !== null && _a !== void 0 ? _a : false;
465
- };
421
+ }
466
422
  /** @internal */
467
- Layout.prototype.onTabDrag = function () {
423
+ onTabDrag(...args) {
468
424
  var _a, _b;
469
- var args = [];
470
- for (var _i = 0; _i < arguments.length; _i++) {
471
- args[_i] = arguments[_i];
472
- }
473
- return (_b = (_a = this.props).onTabDrag) === null || _b === void 0 ? void 0 : _b.call.apply(_b, __spreadArray([_a], args, false));
474
- };
425
+ return (_b = (_a = this.props).onTabDrag) === null || _b === void 0 ? void 0 : _b.call(_a, ...args);
426
+ }
475
427
  /** @internal */
476
- Layout.prototype.getPopoutURL = function () {
428
+ getPopoutURL() {
477
429
  return this.popoutURL;
478
- };
430
+ }
479
431
  /** @internal */
480
- Layout.prototype.componentWillUnmount = function () {
432
+ componentWillUnmount() {
481
433
  var _a;
482
434
  (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.unobserve(this.selfRef.current);
483
- };
435
+ }
484
436
  /** @internal */
485
- Layout.prototype.setEditingTab = function (tabNode) {
437
+ setEditingTab(tabNode) {
486
438
  this.setState({ editingTab: tabNode });
487
- };
439
+ }
488
440
  /** @internal */
489
- Layout.prototype.getEditingTab = function () {
441
+ getEditingTab() {
490
442
  return this.state.editingTab;
491
- };
443
+ }
492
444
  /** @internal */
493
- Layout.prototype.render = function () {
445
+ render() {
494
446
  // first render will be used to find the size (via selfRef)
495
- if (this.firstRender) {
496
- this.firstRender = false;
497
- return (React.createElement("div", { ref: this.selfRef, className: this.getClassName(Types_1.CLASSES.FLEXLAYOUT__LAYOUT) }, this.metricsElements()));
447
+ if (!this.selfRef.current) {
448
+ return (React.createElement("div", { ref: this.selfRef, className: this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT) }, this.metricsElements()));
498
449
  }
499
450
  this.props.model._setPointerFine(window && window.matchMedia && window.matchMedia("(pointer: fine)").matches);
500
451
  // this.start = Date.now();
501
- var borderComponents = [];
502
- var tabSetComponents = [];
503
- var floatingWindows = [];
504
- var tabComponents = {};
505
- var splitterComponents = [];
506
- var metrics = {
452
+ const borderComponents = [];
453
+ const tabSetComponents = [];
454
+ const floatingWindows = [];
455
+ const tabComponents = {};
456
+ const splitterComponents = [];
457
+ const metrics = {
507
458
  headerBarSize: this.state.calculatedHeaderBarSize,
508
459
  tabBarSize: this.state.calculatedTabBarSize,
509
460
  borderBarSize: this.state.calculatedBorderBarSize
@@ -512,14 +463,10 @@ var Layout = /** @class */ (function (_super) {
512
463
  this.centerRect = this.props.model._layout(this.state.rect, metrics);
513
464
  this.renderBorder(this.props.model.getBorderSet(), borderComponents, tabComponents, floatingWindows, splitterComponents);
514
465
  this.renderChildren("", this.props.model.getRoot(), tabSetComponents, tabComponents, floatingWindows, splitterComponents);
515
- if (this.edgesShown) {
516
- this.repositionEdges(this.state.rect);
517
- }
518
- var nextTopIds = [];
519
- var nextTopIdsMap = {};
466
+ const nextTopIds = [];
467
+ const nextTopIdsMap = {};
520
468
  // Keep any previous tabs in the same DOM order as before, removing any that have been deleted
521
- for (var _i = 0, _a = this.tabIds; _i < _a.length; _i++) {
522
- var t = _a[_i];
469
+ for (const t of this.tabIds) {
523
470
  if (tabComponents[t]) {
524
471
  nextTopIds.push(t);
525
472
  nextTopIdsMap[t] = t;
@@ -527,157 +474,167 @@ var Layout = /** @class */ (function (_super) {
527
474
  }
528
475
  this.tabIds = nextTopIds;
529
476
  // Add tabs that have been added to the DOM
530
- for (var _b = 0, _c = Object.keys(tabComponents); _b < _c.length; _b++) {
531
- var t = _c[_b];
477
+ for (const t of Object.keys(tabComponents)) {
532
478
  if (!nextTopIdsMap[t]) {
533
479
  this.tabIds.push(t);
534
480
  }
535
481
  }
482
+ const edges = [];
483
+ if (this.state.showEdges) {
484
+ const r = this.centerRect;
485
+ const length = this.edgeRectLength;
486
+ const width = this.edgeRectWidth;
487
+ const offset = this.edgeRectLength / 2;
488
+ const className = this.getClassName(CLASSES.FLEXLAYOUT__EDGE_RECT);
489
+ const radius = 50;
490
+ edges.push(React.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 }));
491
+ edges.push(React.createElement("div", { key: "West", style: { top: r.y + r.height / 2 - offset, left: r.x, width: width, height: length, borderTopRightRadius: radius, borderBottomRightRadius: radius }, className: className }));
492
+ edges.push(React.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 }));
493
+ edges.push(React.createElement("div", { key: "East", style: { top: r.y + r.height / 2 - offset, left: r.x + r.width - width, width: width, height: length, borderTopLeftRadius: radius, borderBottomLeftRadius: radius }, className: className }));
494
+ }
536
495
  // this.layoutTime = (Date.now() - this.start);
537
- return (React.createElement("div", { ref: this.selfRef, className: this.getClassName(Types_1.CLASSES.FLEXLAYOUT__LAYOUT), onDragEnter: this.props.onExternalDrag ? this.onDragEnter : undefined },
496
+ return (React.createElement("div", { ref: this.selfRef, className: this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT), onDragEnter: this.props.onExternalDrag ? this.onDragEnter : undefined },
538
497
  tabSetComponents,
539
- this.tabIds.map(function (t) {
498
+ this.tabIds.map((t) => {
540
499
  return tabComponents[t];
541
500
  }),
542
501
  borderComponents,
543
502
  splitterComponents,
503
+ edges,
544
504
  floatingWindows,
545
505
  this.metricsElements(),
546
506
  this.state.portal));
547
- };
507
+ }
548
508
  /** @internal */
549
- Layout.prototype.metricsElements = function () {
509
+ metricsElements() {
550
510
  // used to measure the tab and border tab sizes
551
- var fontStyle = this.styleFont({ visibility: "hidden" });
511
+ const fontStyle = this.styleFont({ visibility: "hidden" });
552
512
  return (React.createElement(React.Fragment, null,
553
- React.createElement("div", { key: "findHeaderBarSize", ref: this.findHeaderBarSizeRef, style: fontStyle, className: this.getClassName(Types_1.CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER) }, "FindHeaderBarSize"),
554
- React.createElement("div", { key: "findTabBarSize", ref: this.findTabBarSizeRef, style: fontStyle, className: this.getClassName(Types_1.CLASSES.FLEXLAYOUT__TABSET_SIZER) }, "FindTabBarSize"),
555
- React.createElement("div", { key: "findBorderBarSize", ref: this.findBorderBarSizeRef, style: fontStyle, className: this.getClassName(Types_1.CLASSES.FLEXLAYOUT__BORDER_SIZER) }, "FindBorderBarSize")));
556
- };
513
+ React.createElement("div", { key: "findHeaderBarSize", ref: this.findHeaderBarSizeRef, style: fontStyle, className: this.getClassName(CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER) }, "FindHeaderBarSize"),
514
+ React.createElement("div", { key: "findTabBarSize", ref: this.findTabBarSizeRef, style: fontStyle, className: this.getClassName(CLASSES.FLEXLAYOUT__TABSET_SIZER) }, "FindTabBarSize"),
515
+ React.createElement("div", { key: "findBorderBarSize", ref: this.findBorderBarSizeRef, style: fontStyle, className: this.getClassName(CLASSES.FLEXLAYOUT__BORDER_SIZER) }, "FindBorderBarSize")));
516
+ }
557
517
  /** @internal */
558
- Layout.prototype.renderBorder = function (borderSet, borderComponents, tabComponents, floatingWindows, splitterComponents) {
559
- for (var _i = 0, _a = borderSet.getBorders(); _i < _a.length; _i++) {
560
- var border = _a[_i];
561
- var borderPath = "/border/".concat(border.getLocation().getName());
518
+ renderBorder(borderSet, borderComponents, tabComponents, floatingWindows, splitterComponents) {
519
+ for (const border of borderSet.getBorders()) {
520
+ const borderPath = `/border/${border.getLocation().getName()}`;
562
521
  if (border.isShowing()) {
563
- borderComponents.push(React.createElement(BorderTabSet_1.BorderTabSet, { key: "border_".concat(border.getLocation().getName()), path: borderPath, border: border, layout: this, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons }));
564
- var drawChildren = border._getDrawChildren();
565
- var i = 0;
566
- var tabCount = 0;
567
- for (var _b = 0, drawChildren_1 = drawChildren; _b < drawChildren_1.length; _b++) {
568
- var child = drawChildren_1[_b];
569
- if (child instanceof SplitterNode_1.SplitterNode) {
570
- var path = borderPath + "/s";
571
- splitterComponents.push(React.createElement(Splitter_1.Splitter, { key: child.getId(), layout: this, node: child, path: path }));
522
+ borderComponents.push(React.createElement(BorderTabSet, { key: `border_${border.getLocation().getName()}`, path: borderPath, border: border, layout: this, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons }));
523
+ const drawChildren = border._getDrawChildren();
524
+ let i = 0;
525
+ let tabCount = 0;
526
+ for (const child of drawChildren) {
527
+ if (child instanceof SplitterNode) {
528
+ let path = borderPath + "/s";
529
+ splitterComponents.push(React.createElement(Splitter, { key: child.getId(), layout: this, node: child, path: path }));
572
530
  }
573
- else if (child instanceof TabNode_1.TabNode) {
574
- var path = borderPath + "/t" + tabCount++;
531
+ else if (child instanceof TabNode) {
532
+ let path = borderPath + "/t" + tabCount++;
575
533
  if (this.supportsPopout && child.isFloating()) {
576
- var rect = this._getScreenRect(child);
577
- floatingWindows.push(React.createElement(FloatingWindow_1.FloatingWindow, { key: child.getId(), url: this.popoutURL, rect: rect, title: child.getName(), id: child.getId(), onSetWindow: this.onSetWindow, onCloseWindow: this.onCloseWindow },
578
- React.createElement(FloatingWindowTab_1.FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })));
579
- tabComponents[child.getId()] = React.createElement(TabFloating_1.TabFloating, { key: child.getId(), layout: this, path: path, node: child, selected: i === border.getSelected() });
534
+ const rect = this._getScreenRect(child);
535
+ floatingWindows.push(React.createElement(FloatingWindow, { key: child.getId(), url: this.popoutURL, rect: rect, title: child.getName(), id: child.getId(), onSetWindow: this.onSetWindow, onCloseWindow: this.onCloseWindow },
536
+ React.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })));
537
+ tabComponents[child.getId()] = React.createElement(TabFloating, { key: child.getId(), layout: this, path: path, node: child, selected: i === border.getSelected() });
580
538
  }
581
539
  else {
582
- tabComponents[child.getId()] = React.createElement(Tab_1.Tab, { key: child.getId(), layout: this, path: path, node: child, selected: i === border.getSelected(), factory: this.props.factory });
540
+ tabComponents[child.getId()] = React.createElement(Tab, { key: child.getId(), layout: this, path: path, node: child, selected: i === border.getSelected(), factory: this.props.factory });
583
541
  }
584
542
  }
585
543
  i++;
586
544
  }
587
545
  }
588
546
  }
589
- };
547
+ }
590
548
  /** @internal */
591
- Layout.prototype.renderChildren = function (path, node, tabSetComponents, tabComponents, floatingWindows, splitterComponents) {
592
- var drawChildren = node._getDrawChildren();
593
- var splitterCount = 0;
594
- var tabCount = 0;
595
- var rowCount = 0;
596
- for (var _i = 0, _a = drawChildren; _i < _a.length; _i++) {
597
- var child = _a[_i];
598
- if (child instanceof SplitterNode_1.SplitterNode) {
599
- var newPath = path + "/s" + (splitterCount++);
600
- splitterComponents.push(React.createElement(Splitter_1.Splitter, { key: child.getId(), layout: this, path: newPath, node: child }));
601
- }
602
- else if (child instanceof TabSetNode_1.TabSetNode) {
603
- var newPath = path + "/ts" + (rowCount++);
604
- tabSetComponents.push(React.createElement(TabSet_1.TabSet, { key: child.getId(), layout: this, path: newPath, node: child, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons }));
549
+ renderChildren(path, node, tabSetComponents, tabComponents, floatingWindows, splitterComponents) {
550
+ const drawChildren = node._getDrawChildren();
551
+ let splitterCount = 0;
552
+ let tabCount = 0;
553
+ let rowCount = 0;
554
+ for (const child of drawChildren) {
555
+ if (child instanceof SplitterNode) {
556
+ const newPath = path + "/s" + (splitterCount++);
557
+ splitterComponents.push(React.createElement(Splitter, { key: child.getId(), layout: this, path: newPath, node: child }));
558
+ }
559
+ else if (child instanceof TabSetNode) {
560
+ const newPath = path + "/ts" + (rowCount++);
561
+ tabSetComponents.push(React.createElement(TabSet, { key: child.getId(), layout: this, path: newPath, node: child, iconFactory: this.props.iconFactory, titleFactory: this.props.titleFactory, icons: this.icons }));
605
562
  this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
606
563
  }
607
- else if (child instanceof TabNode_1.TabNode) {
608
- var newPath = path + "/t" + (tabCount++);
609
- var selectedTab = child.getParent().getChildren()[child.getParent().getSelected()];
564
+ else if (child instanceof TabNode) {
565
+ const newPath = path + "/t" + (tabCount++);
566
+ const selectedTab = child.getParent().getChildren()[child.getParent().getSelected()];
610
567
  if (selectedTab === undefined) {
611
568
  // this should not happen!
612
569
  console.warn("undefined selectedTab should not happen");
613
570
  }
614
571
  if (this.supportsPopout && child.isFloating()) {
615
- var rect = this._getScreenRect(child);
616
- floatingWindows.push(React.createElement(FloatingWindow_1.FloatingWindow, { key: child.getId(), url: this.popoutURL, rect: rect, title: child.getName(), id: child.getId(), onSetWindow: this.onSetWindow, onCloseWindow: this.onCloseWindow },
617
- React.createElement(FloatingWindowTab_1.FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })));
618
- tabComponents[child.getId()] = React.createElement(TabFloating_1.TabFloating, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab });
572
+ const rect = this._getScreenRect(child);
573
+ floatingWindows.push(React.createElement(FloatingWindow, { key: child.getId(), url: this.popoutURL, rect: rect, title: child.getName(), id: child.getId(), onSetWindow: this.onSetWindow, onCloseWindow: this.onCloseWindow },
574
+ React.createElement(FloatingWindowTab, { layout: this, node: child, factory: this.props.factory })));
575
+ tabComponents[child.getId()] = React.createElement(TabFloating, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab });
619
576
  }
620
577
  else {
621
- tabComponents[child.getId()] = React.createElement(Tab_1.Tab, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab, factory: this.props.factory });
578
+ tabComponents[child.getId()] = React.createElement(Tab, { key: child.getId(), layout: this, path: newPath, node: child, selected: child === selectedTab, factory: this.props.factory });
622
579
  }
623
580
  }
624
581
  else {
625
582
  // is row
626
- var newPath = path + ((child.getOrientation() === Orientation_1.Orientation.HORZ) ? "/r" : "/c") + (rowCount++);
583
+ const newPath = path + ((child.getOrientation() === Orientation.HORZ) ? "/r" : "/c") + (rowCount++);
627
584
  this.renderChildren(newPath, child, tabSetComponents, tabComponents, floatingWindows, splitterComponents);
628
585
  }
629
586
  }
630
- };
587
+ }
631
588
  /** @internal */
632
- Layout.prototype._getScreenRect = function (node) {
633
- var rect = node.getRect().clone();
634
- var bodyRect = this.selfRef.current.getBoundingClientRect();
635
- var navHeight = Math.min(80, this.currentWindow.outerHeight - this.currentWindow.innerHeight);
636
- var navWidth = Math.min(80, this.currentWindow.outerWidth - this.currentWindow.innerWidth);
589
+ _getScreenRect(node) {
590
+ const rect = node.getRect().clone();
591
+ const bodyRect = this.selfRef.current.getBoundingClientRect();
592
+ const navHeight = Math.min(80, this.currentWindow.outerHeight - this.currentWindow.innerHeight);
593
+ const navWidth = Math.min(80, this.currentWindow.outerWidth - this.currentWindow.innerWidth);
637
594
  rect.x = rect.x + bodyRect.x + this.currentWindow.screenX + navWidth;
638
595
  rect.y = rect.y + bodyRect.y + this.currentWindow.screenY + navHeight;
639
596
  return rect;
640
- };
597
+ }
641
598
  /**
642
599
  * Adds a new tab to the given tabset
643
600
  * @param tabsetId the id of the tabset where the new tab will be added
644
601
  * @param json the json for the new tab node
645
602
  */
646
- Layout.prototype.addTabToTabSet = function (tabsetId, json) {
647
- var tabsetNode = this.props.model.getNodeById(tabsetId);
603
+ addTabToTabSet(tabsetId, json) {
604
+ const tabsetNode = this.props.model.getNodeById(tabsetId);
648
605
  if (tabsetNode !== undefined) {
649
- this.doAction(Actions_1.Actions.addNode(json, tabsetId, DockLocation_1.DockLocation.CENTER, -1));
606
+ this.doAction(Actions.addNode(json, tabsetId, DockLocation.CENTER, -1));
650
607
  }
651
- };
608
+ }
652
609
  /**
653
610
  * Adds a new tab to the active tabset (if there is one)
654
611
  * @param json the json for the new tab node
655
612
  */
656
- Layout.prototype.addTabToActiveTabSet = function (json) {
657
- var tabsetNode = this.props.model.getActiveTabset();
613
+ addTabToActiveTabSet(json) {
614
+ const tabsetNode = this.props.model.getActiveTabset();
658
615
  if (tabsetNode !== undefined) {
659
- this.doAction(Actions_1.Actions.addNode(json, tabsetNode.getId(), DockLocation_1.DockLocation.CENTER, -1));
616
+ this.doAction(Actions.addNode(json, tabsetNode.getId(), DockLocation.CENTER, -1));
660
617
  }
661
- };
618
+ }
662
619
  /**
663
620
  * Adds a new tab by dragging a labeled panel to the drop location, dragging starts immediatelly
664
621
  * @param dragText the text to show on the drag panel
665
622
  * @param json the json for the new tab node
666
623
  * @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
667
624
  */
668
- Layout.prototype.addTabWithDragAndDrop = function (dragText, json, onDrop) {
625
+ addTabWithDragAndDrop(dragText, json, onDrop) {
669
626
  this.fnNewNodeDropped = onDrop;
670
627
  this.newTabJson = json;
671
- this.dragStart(undefined, dragText, TabNode_1.TabNode._fromJson(json, this.props.model, false), true, undefined, undefined);
672
- };
628
+ this.dragStart(undefined, dragText, TabNode._fromJson(json, this.props.model, false), true, undefined, undefined);
629
+ }
673
630
  /**
674
631
  * Move a tab/tabset using drag and drop
675
632
  * @param node the tab or tabset to drag
676
633
  * @param dragText the text to show on the drag panel
677
634
  */
678
- Layout.prototype.moveTabWithDragAndDrop = function (node, dragText) {
635
+ moveTabWithDragAndDrop(node, dragText) {
679
636
  this.dragStart(undefined, dragText, node, true, undefined, undefined);
680
- };
637
+ }
681
638
  /**
682
639
  * Adds a new tab by dragging a labeled panel to the drop location, dragging starts when you
683
640
  * mouse down on the panel
@@ -686,49 +643,47 @@ var Layout = /** @class */ (function (_super) {
686
643
  * @param json the json for the new tab node
687
644
  * @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
688
645
  */
689
- Layout.prototype.addTabWithDragAndDropIndirect = function (dragText, json, onDrop) {
690
- var _this = this;
646
+ addTabWithDragAndDropIndirect(dragText, json, onDrop) {
691
647
  this.fnNewNodeDropped = onDrop;
692
648
  this.newTabJson = json;
693
- DragDrop_1.DragDrop.instance.addGlass(this.onCancelAdd);
649
+ DragDrop.instance.addGlass(this.onCancelAdd);
694
650
  this.dragDivText = dragText;
695
651
  this.dragDiv = this.currentDocument.createElement("div");
696
- this.dragDiv.className = this.getClassName(Types_1.CLASSES.FLEXLAYOUT__DRAG_RECT);
652
+ this.dragDiv.className = this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT);
697
653
  this.dragDiv.addEventListener("mousedown", this.onDragDivMouseDown);
698
654
  this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, { passive: false });
699
- this.dragRectRender(this.dragDivText, undefined, this.newTabJson, function () {
700
- if (_this.dragDiv) {
655
+ this.dragRectRender(this.dragDivText, undefined, this.newTabJson, () => {
656
+ if (this.dragDiv) {
701
657
  // now it's been rendered into the dom it can be centered
702
- _this.dragDiv.style.visibility = "visible";
703
- var domRect = _this.dragDiv.getBoundingClientRect();
704
- var r = new Rect_1.Rect(0, 0, domRect === null || domRect === void 0 ? void 0 : domRect.width, domRect === null || domRect === void 0 ? void 0 : domRect.height);
705
- r.centerInRect(_this.state.rect);
706
- _this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
707
- _this.dragDiv.style.left = r.x + "px";
708
- _this.dragDiv.style.top = r.y + "px";
658
+ this.dragDiv.style.visibility = "visible";
659
+ const domRect = this.dragDiv.getBoundingClientRect();
660
+ const r = new Rect(0, 0, domRect === null || domRect === void 0 ? void 0 : domRect.width, domRect === null || domRect === void 0 ? void 0 : domRect.height);
661
+ r.centerInRect(this.state.rect);
662
+ this.dragDiv.setAttribute("data-layout-path", "/drag-rectangle");
663
+ this.dragDiv.style.left = r.x + "px";
664
+ this.dragDiv.style.top = r.y + "px";
709
665
  }
710
666
  });
711
- var rootdiv = this.selfRef.current;
667
+ const rootdiv = this.selfRef.current;
712
668
  rootdiv.appendChild(this.dragDiv);
713
- };
669
+ }
714
670
  /** @internal */
715
- Layout.prototype.handleCustomTabDrag = function (dropInfo, pos, event) {
716
- var _this = this;
671
+ handleCustomTabDrag(dropInfo, pos, event) {
717
672
  var _a, _b, _c;
718
- var invalidated = (_a = this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated;
719
- var currentCallback = (_b = this.customDrop) === null || _b === void 0 ? void 0 : _b.callback;
673
+ let invalidated = (_a = this.customDrop) === null || _a === void 0 ? void 0 : _a.invalidated;
674
+ const currentCallback = (_b = this.customDrop) === null || _b === void 0 ? void 0 : _b.callback;
720
675
  this.customDrop = undefined;
721
- var dragging = this.newTabJson || (this.dragNode instanceof TabNode_1.TabNode ? this.dragNode : undefined);
722
- if (dragging && (dropInfo.node instanceof TabSetNode_1.TabSetNode || dropInfo.node instanceof BorderNode_1.BorderNode) && dropInfo.index === -1) {
723
- var selected = dropInfo.node.getSelectedNode();
724
- var tabRect = selected === null || selected === void 0 ? void 0 : selected.getRect();
676
+ const dragging = this.newTabJson || (this.dragNode instanceof TabNode ? this.dragNode : undefined);
677
+ if (dragging && (dropInfo.node instanceof TabSetNode || dropInfo.node instanceof BorderNode) && dropInfo.index === -1) {
678
+ const selected = dropInfo.node.getSelectedNode();
679
+ const tabRect = selected === null || selected === void 0 ? void 0 : selected.getRect();
725
680
  if (selected && (tabRect === null || tabRect === void 0 ? void 0 : tabRect.contains(pos.x, pos.y))) {
726
- var customDrop = undefined;
681
+ let customDrop = undefined;
727
682
  try {
728
- var dest = this.onTabDrag(dragging, selected, pos.x - tabRect.x, pos.y - tabRect.y, dropInfo.location, function () { return _this.onDragMove(event); });
683
+ const dest = this.onTabDrag(dragging, selected, pos.x - tabRect.x, pos.y - tabRect.y, dropInfo.location, () => this.onDragMove(event));
729
684
  if (dest) {
730
685
  customDrop = {
731
- rect: new Rect_1.Rect(dest.x + tabRect.x, dest.y + tabRect.y, dest.width, dest.height),
686
+ rect: new Rect(dest.x + tabRect.x, dest.y + tabRect.y, dest.width, dest.height),
732
687
  callback: dest.callback,
733
688
  invalidated: dest.invalidated,
734
689
  dragging: dragging,
@@ -750,14 +705,14 @@ var Layout = /** @class */ (function (_super) {
750
705
  }
751
706
  }
752
707
  this.dropInfo = dropInfo;
753
- this.outlineDiv.className = this.getClassName(this.customDrop ? Types_1.CLASSES.FLEXLAYOUT__OUTLINE_RECT : dropInfo.className);
708
+ this.outlineDiv.className = this.getClassName(this.customDrop ? CLASSES.FLEXLAYOUT__OUTLINE_RECT : dropInfo.className);
754
709
  if (this.customDrop) {
755
710
  this.customDrop.rect.positionElement(this.outlineDiv);
756
711
  }
757
712
  else {
758
713
  dropInfo.rect.positionElement(this.outlineDiv);
759
714
  }
760
- DragDrop_1.DragDrop.instance.setGlassCursorOverride((_c = this.customDrop) === null || _c === void 0 ? void 0 : _c.cursor);
715
+ DragDrop.instance.setGlassCursorOverride((_c = this.customDrop) === null || _c === void 0 ? void 0 : _c.cursor);
761
716
  this.outlineDiv.style.visibility = "visible";
762
717
  try {
763
718
  invalidated === null || invalidated === void 0 ? void 0 : invalidated();
@@ -765,137 +720,72 @@ var Layout = /** @class */ (function (_super) {
765
720
  catch (e) {
766
721
  console.error(e);
767
722
  }
768
- };
723
+ }
769
724
  /** @internal */
770
- Layout.prototype.onDragEnter = function (event) {
725
+ onDragEnter(event) {
771
726
  // DragDrop keeps track of number of dragenters minus the number of
772
727
  // dragleaves. Only start a new drag if there isn't one already.
773
- if (DragDrop_1.DragDrop.instance.isDragging())
728
+ if (DragDrop.instance.isDragging())
774
729
  return;
775
- var drag = this.props.onExternalDrag(event);
730
+ const drag = this.props.onExternalDrag(event);
776
731
  if (drag) {
777
732
  // Mimic addTabWithDragAndDrop, but pass in DragEvent
778
733
  this.fnNewNodeDropped = drag.onDrop;
779
734
  this.newTabJson = drag.json;
780
- this.dragStart(event, drag.dragText, TabNode_1.TabNode._fromJson(drag.json, this.props.model, false), true, undefined, undefined);
735
+ this.dragStart(event, drag.dragText, TabNode._fromJson(drag.json, this.props.model, false), true, undefined, undefined);
781
736
  }
782
- };
737
+ }
783
738
  /** @internal */
784
- Layout.prototype.checkForBorderToShow = function (x, y) {
785
- var r = this.props.model._getOuterInnerRects().outer;
786
- var c = r.getCenter();
787
- var margin = this.edgeRectWidth;
788
- var offset = this.edgeRectLength / 2;
789
- var overEdge = false;
790
- if (this.props.model.isEnableEdgeDock() && this.state.showHiddenBorder === DockLocation_1.DockLocation.CENTER) {
739
+ checkForBorderToShow(x, y) {
740
+ const r = this.props.model._getOuterInnerRects().outer;
741
+ const c = r.getCenter();
742
+ const margin = this.edgeRectWidth;
743
+ const offset = this.edgeRectLength / 2;
744
+ let overEdge = false;
745
+ if (this.props.model.isEnableEdgeDock() && this.state.showHiddenBorder === DockLocation.CENTER) {
791
746
  if ((y > c.y - offset && y < c.y + offset) ||
792
747
  (x > c.x - offset && x < c.x + offset)) {
793
748
  overEdge = true;
794
749
  }
795
750
  }
796
- var location = DockLocation_1.DockLocation.CENTER;
751
+ let location = DockLocation.CENTER;
797
752
  if (!overEdge) {
798
753
  if (x <= r.x + margin) {
799
- location = DockLocation_1.DockLocation.LEFT;
754
+ location = DockLocation.LEFT;
800
755
  }
801
756
  else if (x >= r.getRight() - margin) {
802
- location = DockLocation_1.DockLocation.RIGHT;
757
+ location = DockLocation.RIGHT;
803
758
  }
804
759
  else if (y <= r.y + margin) {
805
- location = DockLocation_1.DockLocation.TOP;
760
+ location = DockLocation.TOP;
806
761
  }
807
762
  else if (y >= r.getBottom() - margin) {
808
- location = DockLocation_1.DockLocation.BOTTOM;
763
+ location = DockLocation.BOTTOM;
809
764
  }
810
765
  }
811
766
  if (location !== this.state.showHiddenBorder) {
812
767
  this.setState({ showHiddenBorder: location });
813
768
  }
814
- };
815
- /** @internal */
816
- Layout.prototype.showEdges = function (rootdiv) {
817
- if (this.props.model.isEnableEdgeDock()) {
818
- var length_1 = this.edgeRectLength + "px";
819
- var radius = "50px";
820
- var width = this.edgeRectWidth + "px";
821
- this.edgeTopDiv = this.currentDocument.createElement("div");
822
- this.edgeTopDiv.className = this.getClassName(Types_1.CLASSES.FLEXLAYOUT__EDGE_RECT);
823
- this.edgeTopDiv.style.width = length_1;
824
- this.edgeTopDiv.style.height = width;
825
- this.edgeTopDiv.style.borderBottomLeftRadius = radius;
826
- this.edgeTopDiv.style.borderBottomRightRadius = radius;
827
- this.edgeLeftDiv = this.currentDocument.createElement("div");
828
- this.edgeLeftDiv.className = this.getClassName(Types_1.CLASSES.FLEXLAYOUT__EDGE_RECT);
829
- this.edgeLeftDiv.style.width = width;
830
- this.edgeLeftDiv.style.height = length_1;
831
- this.edgeLeftDiv.style.borderTopRightRadius = radius;
832
- this.edgeLeftDiv.style.borderBottomRightRadius = radius;
833
- this.edgeBottomDiv = this.currentDocument.createElement("div");
834
- this.edgeBottomDiv.className = this.getClassName(Types_1.CLASSES.FLEXLAYOUT__EDGE_RECT);
835
- this.edgeBottomDiv.style.width = length_1;
836
- this.edgeBottomDiv.style.height = width;
837
- this.edgeBottomDiv.style.borderTopLeftRadius = radius;
838
- this.edgeBottomDiv.style.borderTopRightRadius = radius;
839
- this.edgeRightDiv = this.currentDocument.createElement("div");
840
- this.edgeRightDiv.className = this.getClassName(Types_1.CLASSES.FLEXLAYOUT__EDGE_RECT);
841
- this.edgeRightDiv.style.width = width;
842
- this.edgeRightDiv.style.height = length_1;
843
- this.edgeRightDiv.style.borderTopLeftRadius = radius;
844
- this.edgeRightDiv.style.borderBottomLeftRadius = radius;
845
- this.repositionEdges(this.state.rect);
846
- rootdiv.appendChild(this.edgeTopDiv);
847
- rootdiv.appendChild(this.edgeLeftDiv);
848
- rootdiv.appendChild(this.edgeBottomDiv);
849
- rootdiv.appendChild(this.edgeRightDiv);
850
- this.edgesShown = true;
851
- }
852
- };
853
- /** @internal */
854
- Layout.prototype.repositionEdges = function (domRect) {
855
- if (this.props.model.isEnableEdgeDock()) {
856
- var r = this.centerRect;
857
- this.edgeTopDiv.style.top = r.y + "px";
858
- this.edgeTopDiv.style.left = r.x + (r.width - this.edgeRectLength) / 2 + "px";
859
- this.edgeLeftDiv.style.top = r.y + (r.height - this.edgeRectLength) / 2 + "px";
860
- this.edgeLeftDiv.style.left = r.x + "px";
861
- this.edgeBottomDiv.style.bottom = domRect.height - r.getBottom() + "px";
862
- this.edgeBottomDiv.style.left = r.x + (r.width - this.edgeRectLength) / 2 + "px";
863
- this.edgeRightDiv.style.top = r.y + (r.height - this.edgeRectLength) / 2 + "px";
864
- this.edgeRightDiv.style.right = domRect.width - r.getRight() + "px";
865
- }
866
- };
867
- /** @internal */
868
- Layout.prototype.hideEdges = function (rootdiv) {
869
- if (this.props.model.isEnableEdgeDock()) {
870
- try {
871
- rootdiv.removeChild(this.edgeTopDiv);
872
- rootdiv.removeChild(this.edgeLeftDiv);
873
- rootdiv.removeChild(this.edgeBottomDiv);
874
- rootdiv.removeChild(this.edgeRightDiv);
875
- }
876
- catch (e) { }
877
- }
878
- this.edgesShown = false;
879
- };
769
+ }
880
770
  /** @internal */
881
- Layout.prototype.maximize = function (tabsetNode) {
882
- this.doAction(Actions_1.Actions.maximizeToggle(tabsetNode.getId()));
883
- };
771
+ maximize(tabsetNode) {
772
+ this.doAction(Actions.maximizeToggle(tabsetNode.getId()));
773
+ }
884
774
  /** @internal */
885
- Layout.prototype.customizeTab = function (tabNode, renderValues) {
775
+ customizeTab(tabNode, renderValues) {
886
776
  if (this.props.onRenderTab) {
887
777
  this.props.onRenderTab(tabNode, renderValues);
888
778
  }
889
- };
779
+ }
890
780
  /** @internal */
891
- Layout.prototype.customizeTabSet = function (tabSetNode, renderValues) {
781
+ customizeTabSet(tabSetNode, renderValues) {
892
782
  if (this.props.onRenderTabSet) {
893
783
  this.props.onRenderTabSet(tabSetNode, renderValues);
894
784
  }
895
- };
785
+ }
896
786
  /** @internal */
897
- Layout.prototype.i18nName = function (id, param) {
898
- var message;
787
+ i18nName(id, param) {
788
+ let message;
899
789
  if (this.props.i18nMapper) {
900
790
  message = this.props.i18nMapper(id, param);
901
791
  }
@@ -903,37 +793,35 @@ var Layout = /** @class */ (function (_super) {
903
793
  message = id + (param === undefined ? "" : param);
904
794
  }
905
795
  return message;
906
- };
796
+ }
907
797
  /** @internal */
908
- Layout.prototype.getOnRenderFloatingTabPlaceholder = function () {
798
+ getOnRenderFloatingTabPlaceholder() {
909
799
  return this.props.onRenderFloatingTabPlaceholder;
910
- };
800
+ }
911
801
  /** @internal */
912
- Layout.prototype.getShowOverflowMenu = function () {
802
+ getShowOverflowMenu() {
913
803
  return this.props.onShowOverflowMenu;
914
- };
804
+ }
915
805
  /** @internal */
916
- Layout.prototype.getTabSetPlaceHolderCallback = function () {
806
+ getTabSetPlaceHolderCallback() {
917
807
  return this.props.onTabSetPlaceHolder;
918
- };
808
+ }
919
809
  /** @internal */
920
- Layout.prototype.showContextMenu = function (node, event) {
810
+ showContextMenu(node, event) {
921
811
  if (this.props.onContextMenu) {
922
812
  this.props.onContextMenu(node, event);
923
813
  }
924
- };
814
+ }
925
815
  /** @internal */
926
- Layout.prototype.auxMouseClick = function (node, event) {
816
+ auxMouseClick(node, event) {
927
817
  if (this.props.onAuxMouseClick) {
928
818
  this.props.onAuxMouseClick(node, event);
929
819
  }
930
- };
931
- return Layout;
932
- }(React.Component));
933
- exports.Layout = Layout;
820
+ }
821
+ }
934
822
  /** @internal */
935
- var DragRectRenderWrapper = function (props) {
936
- React.useEffect(function () {
823
+ const DragRectRenderWrapper = (props) => {
824
+ React.useEffect(() => {
937
825
  var _a;
938
826
  (_a = props.onRendered) === null || _a === void 0 ? void 0 : _a.call(props);
939
827
  }, [props]);