flexlayout-react 0.6.3 → 0.6.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 (106) hide show
  1. package/ChangeLog.txt +4 -0
  2. package/README.md +1 -1
  3. package/declarations/model/Model.d.ts +1 -2
  4. package/declarations/model/RowNode.d.ts +0 -2
  5. package/dist/flexlayout.js +193 -319
  6. package/dist/flexlayout_min.js +1 -1
  7. package/lib/Attribute.js +1 -1
  8. package/lib/Attribute.js.map +1 -1
  9. package/lib/AttributeDefinitions.js +13 -9
  10. package/lib/AttributeDefinitions.js.map +1 -1
  11. package/lib/DockLocation.js +6 -6
  12. package/lib/DockLocation.js.map +1 -1
  13. package/lib/DragDrop.js +24 -22
  14. package/lib/DragDrop.js.map +1 -1
  15. package/lib/Orientation.js +1 -1
  16. package/lib/Orientation.js.map +1 -1
  17. package/lib/PopupMenu.js +6 -6
  18. package/lib/PopupMenu.js.map +1 -1
  19. package/lib/Rect.js +1 -1
  20. package/lib/Rect.js.map +1 -1
  21. package/lib/model/BorderNode.js +31 -31
  22. package/lib/model/BorderNode.js.map +1 -1
  23. package/lib/model/BorderSet.js +18 -14
  24. package/lib/model/BorderSet.js.map +1 -1
  25. package/lib/model/Model.js +40 -35
  26. package/lib/model/Model.js.map +1 -1
  27. package/lib/model/Node.js +29 -28
  28. package/lib/model/Node.js.map +1 -1
  29. package/lib/model/RowNode.js +53 -50
  30. package/lib/model/RowNode.js.map +1 -1
  31. package/lib/model/SplitterNode.js +11 -11
  32. package/lib/model/SplitterNode.js.map +1 -1
  33. package/lib/model/TabNode.js +17 -17
  34. package/lib/model/TabNode.js.map +1 -1
  35. package/lib/model/TabSetNode.js +52 -51
  36. package/lib/model/TabSetNode.js.map +1 -1
  37. package/lib/model/Utils.js +3 -3
  38. package/lib/model/Utils.js.map +1 -1
  39. package/lib/view/BorderButton.js +52 -12
  40. package/lib/view/BorderButton.js.map +1 -1
  41. package/lib/view/BorderTabSet.js +4 -4
  42. package/lib/view/BorderTabSet.js.map +1 -1
  43. package/lib/view/ErrorBoundary.js +1 -1
  44. package/lib/view/ErrorBoundary.js.map +1 -1
  45. package/lib/view/FloatingWindow.js +27 -16
  46. package/lib/view/FloatingWindow.js.map +1 -1
  47. package/lib/view/FloatingWindowTab.js +1 -1
  48. package/lib/view/FloatingWindowTab.js.map +1 -1
  49. package/lib/view/Layout.js +80 -75
  50. package/lib/view/Layout.js.map +1 -1
  51. package/lib/view/Splitter.js +1 -1
  52. package/lib/view/Splitter.js.map +1 -1
  53. package/lib/view/Tab.js +5 -5
  54. package/lib/view/Tab.js.map +1 -1
  55. package/lib/view/TabButton.js +10 -15
  56. package/lib/view/TabButton.js.map +1 -1
  57. package/lib/view/TabButtonStamp.js +2 -2
  58. package/lib/view/TabButtonStamp.js.map +1 -1
  59. package/lib/view/TabFloating.js +2 -2
  60. package/lib/view/TabFloating.js.map +1 -1
  61. package/lib/view/TabOverflowHook.js +1 -1
  62. package/lib/view/TabOverflowHook.js.map +1 -1
  63. package/lib/view/TabSet.js +16 -12
  64. package/lib/view/TabSet.js.map +1 -1
  65. package/lib/view/Utils.js +3 -3
  66. package/lib/view/Utils.js.map +1 -1
  67. package/package.json +20 -14
  68. package/src/Attribute.ts +1 -1
  69. package/src/AttributeDefinitions.ts +9 -9
  70. package/src/DockLocation.ts +9 -9
  71. package/src/DragDrop.ts +42 -38
  72. package/src/Orientation.ts +2 -2
  73. package/src/PopupMenu.tsx +4 -4
  74. package/src/Rect.ts +1 -1
  75. package/src/model/BorderNode.ts +29 -28
  76. package/src/model/BorderSet.ts +16 -16
  77. package/src/model/IDraggable.ts +2 -2
  78. package/src/model/IDropTarget.ts +3 -3
  79. package/src/model/Model.ts +41 -41
  80. package/src/model/Node.ts +38 -38
  81. package/src/model/RowNode.ts +46 -44
  82. package/src/model/SplitterNode.ts +11 -11
  83. package/src/model/TabNode.ts +21 -21
  84. package/src/model/TabSetNode.ts +46 -44
  85. package/src/model/Utils.ts +3 -3
  86. package/src/view/BorderButton.tsx +82 -14
  87. package/src/view/BorderTabSet.tsx +2 -2
  88. package/src/view/ErrorBoundary.tsx +3 -3
  89. package/src/view/FloatingWindow.tsx +8 -6
  90. package/src/view/FloatingWindowTab.tsx +2 -2
  91. package/src/view/Layout.tsx +93 -93
  92. package/src/view/Splitter.tsx +2 -2
  93. package/src/view/Tab.tsx +3 -3
  94. package/src/view/TabButton.tsx +11 -15
  95. package/src/view/TabButtonStamp.tsx +2 -2
  96. package/src/view/TabFloating.tsx +2 -2
  97. package/src/view/TabOverflowHook.tsx +1 -1
  98. package/src/view/TabSet.tsx +2 -3
  99. package/src/view/Utils.tsx +3 -3
  100. package/style/_base.scss +1 -0
  101. package/style/dark.css +1 -0
  102. package/style/dark.css.map +1 -1
  103. package/style/gray.css +1 -0
  104. package/style/gray.css.map +1 -1
  105. package/style/light.css +1 -0
  106. package/style/light.css.map +1 -1
@@ -18,15 +18,15 @@ import { adjustSelectedIndex } from "./Utils";
18
18
  export class TabSetNode extends Node implements IDraggable, IDropTarget {
19
19
  static readonly TYPE = "tabset";
20
20
 
21
- /** @hidden @internal */
21
+ /** @internal */
22
22
  static _fromJson(json: any, model: Model) {
23
23
  const newLayoutNode = new TabSetNode(model, json);
24
24
 
25
25
  if (json.children != null) {
26
- json.children.forEach((jsonChild: any) => {
26
+ for (const jsonChild of json.children) {
27
27
  const child = TabNode._fromJson(jsonChild, model);
28
28
  newLayoutNode._addChild(child);
29
- });
29
+ }
30
30
  }
31
31
  if (newLayoutNode._children.length === 0) {
32
32
  newLayoutNode._setSelected(-1);
@@ -42,10 +42,10 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
42
42
 
43
43
  return newLayoutNode;
44
44
  }
45
- /** @hidden @internal */
45
+ /** @internal */
46
46
  private static _attributeDefinitions: AttributeDefinitions = TabSetNode._createAttributeDefinitions();
47
47
 
48
- /** @hidden @internal */
48
+ /** @internal */
49
49
  private static _createAttributeDefinitions(): AttributeDefinitions {
50
50
  const attributeDefinitions = new AttributeDefinitions();
51
51
  attributeDefinitions.add("type", TabSetNode.TYPE, true).setType(Attribute.STRING).setFixed();
@@ -79,23 +79,23 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
79
79
  return attributeDefinitions;
80
80
  }
81
81
 
82
- /** @hidden @internal */
82
+ /** @internal */
83
83
  private _contentRect?: Rect;
84
- /** @hidden @internal */
84
+ /** @internal */
85
85
  private _tabHeaderRect?: Rect;
86
- /** @hidden @internal */
87
- private calculatedTabBarHeight: number;
88
- /** @hidden @internal */
89
- private calculatedHeaderBarHeight: number;
86
+ /** @internal */
87
+ private _calculatedTabBarHeight: number;
88
+ /** @internal */
89
+ private _calculatedHeaderBarHeight: number;
90
90
 
91
- /** @hidden @internal */
91
+ /** @internal */
92
92
  constructor(model: Model, json: any) {
93
93
  super(model);
94
94
 
95
95
  TabSetNode._attributeDefinitions.fromJson(json, this._attributes);
96
96
  model._addNode(this);
97
- this.calculatedTabBarHeight = 0;
98
- this.calculatedHeaderBarHeight = 0;
97
+ this._calculatedTabBarHeight = 0;
98
+ this._calculatedHeaderBarHeight = 0;
99
99
  }
100
100
 
101
101
  getName() {
@@ -138,7 +138,7 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
138
138
  return this._getAttr("minHeight") as number;
139
139
  }
140
140
 
141
- /** @hidden @internal */
141
+ /** @internal */
142
142
  getMinSize(orientation: Orientation) {
143
143
  if (orientation === Orientation.HORZ) {
144
144
  return this.getMinWidth();
@@ -221,51 +221,51 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
221
221
  return this._getAttr("classNameHeader") as string | undefined;
222
222
  }
223
223
 
224
- /** @hidden @internal */
224
+ /** @internal */
225
225
  calculateHeaderBarHeight(metrics: ILayoutMetrics) {
226
226
  const headerBarHeight = this._getAttr("headerHeight") as number;
227
227
  if (headerBarHeight !== 0) {
228
228
  // its defined
229
- this.calculatedHeaderBarHeight = headerBarHeight;
229
+ this._calculatedHeaderBarHeight = headerBarHeight;
230
230
  } else {
231
- this.calculatedHeaderBarHeight = metrics.headerBarSize;
231
+ this._calculatedHeaderBarHeight = metrics.headerBarSize;
232
232
  }
233
233
  }
234
234
 
235
- /** @hidden @internal */
235
+ /** @internal */
236
236
  calculateTabBarHeight(metrics: ILayoutMetrics) {
237
237
  const tabBarHeight = this._getAttr("tabStripHeight") as number;
238
238
  if (tabBarHeight !== 0) {
239
239
  // its defined
240
- this.calculatedTabBarHeight = tabBarHeight;
240
+ this._calculatedTabBarHeight = tabBarHeight;
241
241
  } else {
242
- this.calculatedTabBarHeight = metrics.tabBarSize;
242
+ this._calculatedTabBarHeight = metrics.tabBarSize;
243
243
  }
244
244
  }
245
245
 
246
246
  getHeaderHeight() {
247
- return this.calculatedHeaderBarHeight;
247
+ return this._calculatedHeaderBarHeight;
248
248
  }
249
249
 
250
250
  getTabStripHeight() {
251
- return this.calculatedTabBarHeight;
251
+ return this._calculatedTabBarHeight;
252
252
  }
253
253
 
254
254
  getTabLocation() {
255
255
  return this._getAttr("tabLocation") as string;
256
256
  }
257
257
 
258
- /** @hidden @internal */
258
+ /** @internal */
259
259
  _setWeight(weight: number) {
260
260
  this._attributes.weight = weight;
261
261
  }
262
262
 
263
- /** @hidden @internal */
263
+ /** @internal */
264
264
  _setSelected(index: number) {
265
265
  this._attributes.selected = index;
266
266
  }
267
267
 
268
- /** @hidden @internal */
268
+ /** @internal */
269
269
  canDrop(dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined {
270
270
  let dropInfo;
271
271
 
@@ -320,7 +320,7 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
320
320
  return dropInfo;
321
321
  }
322
322
 
323
- /** @hidden @internal */
323
+ /** @internal */
324
324
  _layout(rect: Rect, metrics: ILayoutMetrics) {
325
325
  this.calculateHeaderBarHeight(metrics);
326
326
  this.calculateTabBarHeight(metrics);
@@ -337,34 +337,35 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
337
337
  let y = 0;
338
338
  let h = 0;
339
339
  if (showHeader) {
340
- y += this.calculatedHeaderBarHeight;
341
- h += this.calculatedHeaderBarHeight;
340
+ y += this._calculatedHeaderBarHeight;
341
+ h += this._calculatedHeaderBarHeight;
342
342
  }
343
343
  if (this.isEnableTabStrip()) {
344
344
  if (this.getTabLocation() === "top") {
345
- this._tabHeaderRect = new Rect(rect.x, rect.y + y, rect.width, this.calculatedTabBarHeight);
345
+ this._tabHeaderRect = new Rect(rect.x, rect.y + y, rect.width, this._calculatedTabBarHeight);
346
346
  } else {
347
- this._tabHeaderRect = new Rect(rect.x, rect.y + rect.height - this.calculatedTabBarHeight, rect.width, this.calculatedTabBarHeight);
347
+ this._tabHeaderRect = new Rect(rect.x, rect.y + rect.height - this._calculatedTabBarHeight, rect.width, this._calculatedTabBarHeight);
348
348
  }
349
- h += this.calculatedTabBarHeight;
349
+ h += this._calculatedTabBarHeight;
350
350
  if (this.getTabLocation() === "top") {
351
- y += this.calculatedTabBarHeight;
351
+ y += this._calculatedTabBarHeight;
352
352
  }
353
353
  }
354
354
  this._contentRect = new Rect(rect.x, rect.y + y, rect.width, rect.height - h);
355
355
 
356
- this._children.forEach((child, i) => {
356
+ for (let i = 0; i < this._children.length; i++) {
357
+ const child = this._children[i];
357
358
  child._layout(this._contentRect!, metrics);
358
359
  child._setVisible(i === this.getSelected());
359
- });
360
+ }
360
361
  }
361
362
 
362
- /** @hidden @internal */
363
+ /** @internal */
363
364
  _delete() {
364
365
  (this._parent as RowNode)._removeChild(this);
365
366
  }
366
367
 
367
- /** @hidden @internal */
368
+ /** @internal */
368
369
  _remove(node: TabNode) {
369
370
  const removedIndex = this._removeChild(node);
370
371
  this._model._tidy();
@@ -372,7 +373,7 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
372
373
  adjustSelectedIndex(this, removedIndex);
373
374
  }
374
375
 
375
- /** @hidden @internal */
376
+ /** @internal */
376
377
  drop(dragNode: Node & IDraggable, location: DockLocation, index: number, select?: boolean) {
377
378
  const dockLocation = location;
378
379
 
@@ -407,11 +408,12 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
407
408
  }
408
409
  // console.log("added child at : " + insertPos);
409
410
  } else {
410
- dragNode.getChildren().forEach((child, i) => {
411
+ for (let i = 0; i < dragNode.getChildren().length; i++) {
412
+ const child = dragNode.getChildren()[i];
411
413
  this._addChild(child, insertPos);
412
414
  // console.log("added child at : " + insertPos);
413
415
  insertPos++;
414
- });
416
+ }
415
417
  }
416
418
  this._model._setActiveTabset(this);
417
419
  } else {
@@ -471,17 +473,17 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
471
473
  return json;
472
474
  }
473
475
 
474
- /** @hidden @internal */
476
+ /** @internal */
475
477
  _updateAttrs(json: any) {
476
478
  TabSetNode._attributeDefinitions.update(json, this._attributes);
477
479
  }
478
480
 
479
- /** @hidden @internal */
481
+ /** @internal */
480
482
  _getAttributeDefinitions() {
481
483
  return TabSetNode._attributeDefinitions;
482
484
  }
483
485
 
484
- /** @hidden @internal */
486
+ /** @internal */
485
487
  _getPrefSize(orientation: Orientation) {
486
488
  let prefSize = this.getWidth();
487
489
  if (orientation === Orientation.VERT) {
@@ -491,7 +493,7 @@ export class TabSetNode extends Node implements IDraggable, IDropTarget {
491
493
  }
492
494
 
493
495
 
494
- /** @hidden @internal */
496
+ /** @internal */
495
497
  static getAttributeDefinitions() {
496
498
  return TabSetNode._attributeDefinitions;
497
499
  }
@@ -3,7 +3,7 @@ import { BorderNode } from "./BorderNode";
3
3
  import { RowNode } from "./RowNode";
4
4
  import { TabNode } from "./TabNode";
5
5
 
6
- /** @hidden @internal */
6
+ /** @internal */
7
7
  export function adjustSelectedIndexAfterFloat(node: TabNode) {
8
8
  const parent = node.getParent();
9
9
  if (parent !== null) {
@@ -29,7 +29,7 @@ export function adjustSelectedIndexAfterFloat(node: TabNode) {
29
29
  }
30
30
  }
31
31
 
32
- /** @hidden @internal */
32
+ /** @internal */
33
33
  export function adjustSelectedIndexAfterDock(node: TabNode) {
34
34
  const parent = node.getParent();
35
35
  if (parent !== null && (parent instanceof TabSetNode || parent instanceof BorderNode)) {
@@ -44,7 +44,7 @@ export function adjustSelectedIndexAfterDock(node: TabNode) {
44
44
  }
45
45
  }
46
46
 
47
- /** @hidden @internal */
47
+ /** @internal */
48
48
  export function adjustSelectedIndex(parent: TabSetNode | BorderNode | RowNode, removedIndex: number) {
49
49
  // for the tabset/border being removed from set the selected index
50
50
  if (parent !== undefined && (parent.getType() === TabSetNode.TYPE || parent.getType() === BorderNode.TYPE)) {
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { I18nLabel } from "..";
2
+ import { I18nLabel } from "../I18nLabel";
3
3
  import { Actions } from "../model/Actions";
4
4
  import { TabNode } from "../model/TabNode";
5
5
  import { Rect } from "../Rect";
@@ -8,7 +8,7 @@ import { ICloseType } from "../model/ICloseType";
8
8
  import { CLASSES } from "../Types";
9
9
  import { getRenderStateEx, isAuxMouseEvent } from "./Utils";
10
10
 
11
- /** @hidden @internal */
11
+ /** @internal */
12
12
  export interface IBorderButtonProps {
13
13
  layout: ILayoutCallbacks;
14
14
  node: TabNode;
@@ -16,18 +16,20 @@ export interface IBorderButtonProps {
16
16
  border: string;
17
17
  iconFactory?: (node: TabNode) => React.ReactNode | undefined;
18
18
  titleFactory?: (node: TabNode) => React.ReactNode | undefined;
19
- icons?: IIcons;
19
+ icons: IIcons;
20
20
  path: string;
21
21
  }
22
22
 
23
- /** @hidden @internal */
23
+ /** @internal */
24
24
  export const BorderButton = (props: IBorderButtonProps) => {
25
25
  const { layout, node, selected, border, iconFactory, titleFactory, icons, path } = props;
26
26
  const selfRef = React.useRef<HTMLDivElement | null>(null);
27
+ const contentRef = React.useRef<HTMLInputElement | null>(null);
27
28
 
28
29
  const onMouseDown = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>) => {
29
- if (!isAuxMouseEvent(event)) {
30
- props.layout.dragStart(event, undefined, node, node.isEnableDrag(), onClick, (event2: Event) => undefined);
30
+
31
+ if (!isAuxMouseEvent(event) && !layout.getEditingTab()) {
32
+ layout.dragStart(event, undefined, node, node.isEnableDrag(), onClick, onDoubleClick);
31
33
  }
32
34
  };
33
35
 
@@ -45,6 +47,26 @@ export const BorderButton = (props: IBorderButtonProps) => {
45
47
  layout.doAction(Actions.selectTab(node.getId()));
46
48
  };
47
49
 
50
+ const onDoubleClick = (event: Event) => {
51
+ // if (node.isEnableRename()) {
52
+ // onRename();
53
+ // }
54
+ };
55
+
56
+ // const onRename = () => {
57
+ // layout.setEditingTab(node);
58
+ // layout.getCurrentDocument()!.body.addEventListener("mousedown", onEndEdit);
59
+ // layout.getCurrentDocument()!.body.addEventListener("touchstart", onEndEdit);
60
+ // };
61
+
62
+ const onEndEdit = (event: Event) => {
63
+ if (event.target !== contentRef.current!) {
64
+ layout.getCurrentDocument()!.body.removeEventListener("mousedown", onEndEdit);
65
+ layout.getCurrentDocument()!.body.removeEventListener("touchstart", onEndEdit);
66
+ layout.setEditingTab(undefined);
67
+ }
68
+ };
69
+
48
70
  const isClosable = () => {
49
71
  const closeType = node.getCloseType();
50
72
  if (selected || closeType === ICloseType.Always) {
@@ -73,13 +95,33 @@ export const BorderButton = (props: IBorderButtonProps) => {
73
95
 
74
96
  React.useLayoutEffect(() => {
75
97
  updateRect();
98
+ if (layout.getEditingTab() === node) {
99
+ (contentRef.current! as HTMLInputElement).select();
100
+ }
76
101
  });
77
102
 
78
103
  const updateRect = () => {
79
- // record position of tab in border
80
- const clientRect = layout.getDomRect();
104
+ // record position of tab in node
105
+ const layoutRect = layout.getDomRect();
81
106
  const r = selfRef.current!.getBoundingClientRect();
82
- node._setTabRect(new Rect(r.left - clientRect.left, r.top - clientRect.top, r.width, r.height));
107
+ node._setTabRect(new Rect(r.left - layoutRect.left, r.top - layoutRect.top, r.width, r.height));
108
+ };
109
+
110
+ const onTextBoxMouseDown = (event: React.MouseEvent<HTMLInputElement> | React.TouchEvent<HTMLInputElement>) => {
111
+ // console.log("onTextBoxMouseDown");
112
+ event.stopPropagation();
113
+ };
114
+
115
+ const onTextBoxKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
116
+ // console.log(event, event.keyCode);
117
+ if (event.keyCode === 27) {
118
+ // esc
119
+ layout.setEditingTab(undefined);
120
+ } else if (event.keyCode === 13) {
121
+ // enter
122
+ layout.setEditingTab(undefined);
123
+ layout.doAction(Actions.renameTab(node.getId(), (event.target as HTMLInputElement).value));
124
+ }
83
125
  };
84
126
 
85
127
  const cm = layout.getClassName;
@@ -97,8 +139,31 @@ export const BorderButton = (props: IBorderButtonProps) => {
97
139
 
98
140
  const renderState = getRenderStateEx(layout, node, iconFactory, titleFactory);
99
141
 
100
- const content = renderState.content ? (<div className={cm(CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)}>{renderState.content}</div>) : null;
101
- const leading = renderState.leading ? (<div className={cm(CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)}>{renderState.leading}</div>) : null;
142
+ let content = renderState.content ? (
143
+ <div className={cm(CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)}>
144
+ {renderState.content}
145
+ </div>) : null;
146
+
147
+ const leading = renderState.leading ? (
148
+ <div className={cm(CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)}>
149
+ {renderState.leading}
150
+ </div>) : null;
151
+
152
+ if (layout.getEditingTab() === node) {
153
+ content = (
154
+ <input
155
+ ref={contentRef}
156
+ className={cm(CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX)}
157
+ data-layout-path={path + "/textbox"}
158
+ type="text"
159
+ autoFocus={true}
160
+ defaultValue={node.getName()}
161
+ onKeyDown={onTextBoxKeyPress}
162
+ onMouseDown={onTextBoxMouseDown}
163
+ onTouchStart={onTextBoxMouseDown}
164
+ />
165
+ );
166
+ }
102
167
 
103
168
  if (node.isEnableClose()) {
104
169
  const closeTitle = layout.i18nName(I18nLabel.Close_Tab);
@@ -111,20 +176,23 @@ export const BorderButton = (props: IBorderButtonProps) => {
111
176
  onMouseDown={onCloseMouseDown}
112
177
  onClick={onClose}
113
178
  onTouchStart={onCloseMouseDown}>
114
- {icons?.close}
179
+ {(typeof icons.close === "function") ? icons.close(node) : icons.close}
115
180
  </div>
116
181
  );
117
182
  }
118
183
 
119
184
  return (
120
- <div ref={selfRef} style={{}} className={classNames}
185
+ <div
186
+ ref={selfRef}
121
187
  data-layout-path={path}
188
+ className={classNames}
122
189
  onMouseDown={onMouseDown}
123
190
  onClick={onAuxMouseClick}
124
191
  onAuxClick={onAuxMouseClick}
125
192
  onContextMenu={onContextMenu}
126
193
  onTouchStart={onMouseDown}
127
- title={node.getHelpText()}>
194
+ title={node.getHelpText()}
195
+ >
128
196
  {leading}
129
197
  {content}
130
198
  {renderState.buttons}
@@ -12,7 +12,7 @@ import { Orientation } from "../Orientation";
12
12
  import { CLASSES } from "../Types";
13
13
  import { isAuxMouseEvent } from "./Utils";
14
14
 
15
- /** @hidden @internal */
15
+ /** @internal */
16
16
  export interface IBorderTabSetProps {
17
17
  border: BorderNode;
18
18
  layout: ILayoutCallbacks;
@@ -22,7 +22,7 @@ export interface IBorderTabSetProps {
22
22
  path: string;
23
23
  }
24
24
 
25
- /** @hidden @internal */
25
+ /** @internal */
26
26
  export const BorderTabSet = (props: IBorderTabSetProps) => {
27
27
  const { border, layout, iconFactory, titleFactory, icons, path } = props;
28
28
 
@@ -2,16 +2,16 @@ import * as React from "react";
2
2
  import { ErrorInfo } from "react";
3
3
  import { CLASSES } from "../Types";
4
4
 
5
- /** @hidden @internal */
5
+ /** @internal */
6
6
  export interface IErrorBoundaryProps {
7
7
  message: string;
8
8
  }
9
- /** @hidden @internal */
9
+ /** @internal */
10
10
  export interface IErrorBoundaryState {
11
11
  hasError: boolean;
12
12
  }
13
13
 
14
- /** @hidden @internal */
14
+ /** @internal */
15
15
  export class ErrorBoundary extends React.Component<IErrorBoundaryProps, IErrorBoundaryState> {
16
16
  constructor(props: IErrorBoundaryProps) {
17
17
  super(props);
@@ -3,7 +3,7 @@ import { createPortal } from "react-dom";
3
3
  import { Rect } from "../Rect";
4
4
  import { CLASSES } from "../Types";
5
5
 
6
- /** @hidden @internal */
6
+ /** @internal */
7
7
  export interface IFloatingWindowProps {
8
8
  title: string;
9
9
  id: string;
@@ -19,7 +19,7 @@ interface IStyleSheet {
19
19
  rules: string[] | null;
20
20
  }
21
21
 
22
- /** @hidden @internal */
22
+ /** @internal */
23
23
  export const FloatingWindow = (props: React.PropsWithChildren<IFloatingWindowProps>) => {
24
24
  const { title, id, url, rect, onCloseWindow, onSetWindow, children } = props;
25
25
  const popoutWindow = React.useRef<Window | null>(null);
@@ -101,11 +101,11 @@ export const FloatingWindow = (props: React.PropsWithChildren<IFloatingWindowPro
101
101
  }
102
102
  };
103
103
 
104
- /** @hidden @internal */
104
+ /** @internal */
105
105
  function copyStyles(doc: Document, styleSheets: IStyleSheet[]): Promise<boolean[]> {
106
106
  const head = doc.head;
107
107
  const promises: Promise<boolean>[] = [];
108
- styleSheets.forEach((styleSheet) => {
108
+ for (const styleSheet of styleSheets) {
109
109
  if (styleSheet.href) {
110
110
  // prefer links since they will keep paths to images etc
111
111
  const styleElement = doc.createElement("link");
@@ -121,10 +121,12 @@ function copyStyles(doc: Document, styleSheets: IStyleSheet[]): Promise<boolean[
121
121
  } else {
122
122
  if (styleSheet.rules) {
123
123
  const style = doc.createElement("style");
124
- styleSheet.rules.forEach(rule => style.appendChild(doc.createTextNode(rule)));
124
+ for (const rule of styleSheet.rules) {
125
+ style.appendChild(doc.createTextNode(rule));
126
+ }
125
127
  head.appendChild(style);
126
128
  }
127
129
  }
128
- });
130
+ }
129
131
  return Promise.all(promises);
130
132
  }
@@ -6,14 +6,14 @@ import { I18nLabel } from "../I18nLabel";
6
6
  import { Fragment } from "react";
7
7
  import { CLASSES } from "../Types";
8
8
 
9
- /** @hidden @internal */
9
+ /** @internal */
10
10
  export interface IFloatingWindowTabProps {
11
11
  layout: ILayoutCallbacks;
12
12
  node: TabNode;
13
13
  factory: (node: TabNode) => React.ReactNode;
14
14
  }
15
15
 
16
- /** @hidden @internal */
16
+ /** @internal */
17
17
  export const FloatingWindowTab = (props: IFloatingWindowTabProps) => {
18
18
  const { layout, node, factory } = props;
19
19
  const cm = layout.getClassName;