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