flexlayout-react 0.6.3 → 0.6.7

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 (115) hide show
  1. package/ChangeLog.txt +13 -0
  2. package/declarations/Types.d.ts +2 -0
  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 +21 -12
  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/Types.js +2 -0
  22. package/lib/Types.js.map +1 -1
  23. package/lib/model/BorderNode.js +31 -31
  24. package/lib/model/BorderNode.js.map +1 -1
  25. package/lib/model/BorderSet.js +18 -14
  26. package/lib/model/BorderSet.js.map +1 -1
  27. package/lib/model/Model.js +40 -35
  28. package/lib/model/Model.js.map +1 -1
  29. package/lib/model/Node.js +29 -28
  30. package/lib/model/Node.js.map +1 -1
  31. package/lib/model/RowNode.js +53 -50
  32. package/lib/model/RowNode.js.map +1 -1
  33. package/lib/model/SplitterNode.js +11 -11
  34. package/lib/model/SplitterNode.js.map +1 -1
  35. package/lib/model/TabNode.js +17 -17
  36. package/lib/model/TabNode.js.map +1 -1
  37. package/lib/model/TabSetNode.js +52 -51
  38. package/lib/model/TabSetNode.js.map +1 -1
  39. package/lib/model/Utils.js +3 -3
  40. package/lib/model/Utils.js.map +1 -1
  41. package/lib/view/BorderButton.js +52 -12
  42. package/lib/view/BorderButton.js.map +1 -1
  43. package/lib/view/BorderTabSet.js +5 -4
  44. package/lib/view/BorderTabSet.js.map +1 -1
  45. package/lib/view/ErrorBoundary.js +1 -1
  46. package/lib/view/ErrorBoundary.js.map +1 -1
  47. package/lib/view/FloatingWindow.js +27 -16
  48. package/lib/view/FloatingWindow.js.map +1 -1
  49. package/lib/view/FloatingWindowTab.js +1 -1
  50. package/lib/view/FloatingWindowTab.js.map +1 -1
  51. package/lib/view/Layout.js +80 -75
  52. package/lib/view/Layout.js.map +1 -1
  53. package/lib/view/Splitter.js +1 -1
  54. package/lib/view/Splitter.js.map +1 -1
  55. package/lib/view/Tab.js +5 -5
  56. package/lib/view/Tab.js.map +1 -1
  57. package/lib/view/TabButton.js +10 -15
  58. package/lib/view/TabButton.js.map +1 -1
  59. package/lib/view/TabButtonStamp.js +2 -2
  60. package/lib/view/TabButtonStamp.js.map +1 -1
  61. package/lib/view/TabFloating.js +8 -2
  62. package/lib/view/TabFloating.js.map +1 -1
  63. package/lib/view/TabOverflowHook.js +1 -1
  64. package/lib/view/TabOverflowHook.js.map +1 -1
  65. package/lib/view/TabSet.js +17 -12
  66. package/lib/view/TabSet.js.map +1 -1
  67. package/lib/view/Utils.js +3 -3
  68. package/lib/view/Utils.js.map +1 -1
  69. package/package.json +22 -16
  70. package/src/Attribute.ts +1 -1
  71. package/src/AttributeDefinitions.ts +16 -12
  72. package/src/DockLocation.ts +9 -9
  73. package/src/DragDrop.ts +42 -38
  74. package/src/Orientation.ts +2 -2
  75. package/src/PopupMenu.tsx +4 -4
  76. package/src/Rect.ts +1 -1
  77. package/src/Types.ts +2 -0
  78. package/src/model/BorderNode.ts +29 -28
  79. package/src/model/BorderSet.ts +16 -16
  80. package/src/model/IDraggable.ts +2 -2
  81. package/src/model/IDropTarget.ts +3 -3
  82. package/src/model/Model.ts +41 -41
  83. package/src/model/Node.ts +38 -38
  84. package/src/model/RowNode.ts +46 -44
  85. package/src/model/SplitterNode.ts +11 -11
  86. package/src/model/TabNode.ts +21 -21
  87. package/src/model/TabSetNode.ts +46 -44
  88. package/src/model/Utils.ts +3 -3
  89. package/src/view/BorderButton.tsx +82 -14
  90. package/src/view/BorderTabSet.tsx +6 -2
  91. package/src/view/ErrorBoundary.tsx +3 -3
  92. package/src/view/FloatingWindow.tsx +8 -6
  93. package/src/view/FloatingWindowTab.tsx +2 -2
  94. package/src/view/Layout.tsx +93 -93
  95. package/src/view/Splitter.tsx +2 -2
  96. package/src/view/Tab.tsx +3 -3
  97. package/src/view/TabButton.tsx +11 -15
  98. package/src/view/TabButtonStamp.tsx +2 -2
  99. package/src/view/TabFloating.tsx +11 -2
  100. package/src/view/TabOverflowHook.tsx +1 -1
  101. package/src/view/TabSet.tsx +6 -5
  102. package/src/view/Utils.tsx +3 -3
  103. package/style/_base.scss +55 -43
  104. package/style/dark.css +86 -45
  105. package/style/dark.css.map +1 -1
  106. package/style/dark.scss +70 -25
  107. package/style/gray.css +84 -60
  108. package/style/gray.css.map +1 -1
  109. package/style/gray.scss +70 -24
  110. package/style/light.css +84 -45
  111. package/style/light.css.map +1 -1
  112. package/style/light.scss +68 -19
  113. package/style/underline.css +557 -0
  114. package/style/underline.css.map +1 -0
  115. package/style/underline.scss +172 -0
@@ -25,7 +25,7 @@ import { FloatingWindow } from "./FloatingWindow";
25
25
  import { FloatingWindowTab } from "./FloatingWindowTab";
26
26
  import { TabFloating } from "./TabFloating";
27
27
  import { IJsonTabNode } from "../model/IJsonModel";
28
- import { Orientation } from "..";
28
+ import { Orientation } from "../Orientation";
29
29
  import { CloseIcon, MaximizeIcon, OverflowIcon, PopoutIcon, RestoreIcon } from "./Icons";
30
30
  import { TabButtonStamp } from "./TabButtonStamp";
31
31
 
@@ -150,7 +150,7 @@ export interface ICustomDropDestination {
150
150
  cursor: string | undefined;
151
151
  }
152
152
 
153
- /** @hidden @internal */
153
+ /** @internal */
154
154
  export interface ILayoutCallbacks {
155
155
  i18nName(id: I18nLabel, param?: string): string;
156
156
  maximize(tabsetNode: TabSetNode): void;
@@ -192,12 +192,12 @@ export interface ILayoutCallbacks {
192
192
  // Popout windows work in latest browsers based on webkit (Chrome, Opera, Safari, latest Edge) and Firefox. They do
193
193
  // not work on any version if IE or the original Edge browser
194
194
  // Assume any recent desktop browser not IE or original Edge will work
195
- /** @hidden @internal */
195
+ /** @internal */
196
196
  // @ts-ignore
197
197
  const isIEorEdge = typeof window !== "undefined" && (window.document.documentMode || /Edge\//.test(window.navigator.userAgent));
198
- /** @hidden @internal */
198
+ /** @internal */
199
199
  const isDesktop = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(hover: hover) and (pointer: fine)").matches;
200
- /** @hidden @internal */
200
+ /** @internal */
201
201
  const defaultSupportsPopout: boolean = isDesktop && !isIEorEdge;
202
202
 
203
203
  /**
@@ -205,74 +205,74 @@ const defaultSupportsPopout: boolean = isDesktop && !isIEorEdge;
205
205
  */
206
206
  export class Layout extends React.Component<ILayoutProps, ILayoutState> {
207
207
 
208
- /** @hidden @internal */
208
+ /** @internal */
209
209
  private selfRef: React.RefObject<HTMLDivElement>;
210
- /** @hidden @internal */
210
+ /** @internal */
211
211
  private findHeaderBarSizeRef: React.RefObject<HTMLDivElement>;
212
- /** @hidden @internal */
212
+ /** @internal */
213
213
  private findTabBarSizeRef: React.RefObject<HTMLDivElement>;
214
- /** @hidden @internal */
214
+ /** @internal */
215
215
  private findBorderBarSizeRef: React.RefObject<HTMLDivElement>;
216
- /** @hidden @internal */
216
+ /** @internal */
217
217
  private previousModel?: Model;
218
- /** @hidden @internal */
218
+ /** @internal */
219
219
  private centerRect?: Rect;
220
220
 
221
- /** @hidden @internal */
221
+ /** @internal */
222
222
  // private start: number = 0;
223
- /** @hidden @internal */
223
+ /** @internal */
224
224
  // private layoutTime: number = 0;
225
225
 
226
- /** @hidden @internal */
226
+ /** @internal */
227
227
  private tabIds: string[];
228
- /** @hidden @internal */
228
+ /** @internal */
229
229
  private newTabJson: IJsonTabNode | undefined;
230
- /** @hidden @internal */
230
+ /** @internal */
231
231
  private firstMove: boolean = false;
232
- /** @hidden @internal */
232
+ /** @internal */
233
233
  private dragNode?: Node & IDraggable;
234
- /** @hidden @internal */
234
+ /** @internal */
235
235
  private dragDiv?: HTMLDivElement;
236
- /** @hidden @internal */
236
+ /** @internal */
237
237
  private dragRectRendered: boolean = true;
238
- /** @hidden @internal */
238
+ /** @internal */
239
239
  private dragDivText: string | undefined = undefined;
240
- /** @hidden @internal */
240
+ /** @internal */
241
241
  private dropInfo: DropInfo | undefined;
242
- /** @hidden @internal */
242
+ /** @internal */
243
243
  private customDrop: ICustomDropDestination | undefined;
244
- /** @hidden @internal */
244
+ /** @internal */
245
245
  private outlineDiv?: HTMLDivElement;
246
246
 
247
- /** @hidden @internal */
247
+ /** @internal */
248
248
  private edgeRectLength = 100;
249
- /** @hidden @internal */
249
+ /** @internal */
250
250
  private edgeRectWidth = 10;
251
- /** @hidden @internal */
251
+ /** @internal */
252
252
  private edgesShown = false;
253
- /** @hidden @internal */
253
+ /** @internal */
254
254
  private edgeRightDiv?: HTMLDivElement;
255
- /** @hidden @internal */
255
+ /** @internal */
256
256
  private edgeBottomDiv?: HTMLDivElement;
257
- /** @hidden @internal */
257
+ /** @internal */
258
258
  private edgeLeftDiv?: HTMLDivElement;
259
- /** @hidden @internal */
259
+ /** @internal */
260
260
  private edgeTopDiv?: HTMLDivElement;
261
- /** @hidden @internal */
261
+ /** @internal */
262
262
  private fnNewNodeDropped?: (node?: Node, event?: Event) => void;
263
- /** @hidden @internal */
263
+ /** @internal */
264
264
  private currentDocument?: HTMLDocument;
265
- /** @hidden @internal */
265
+ /** @internal */
266
266
  private currentWindow?: Window;
267
- /** @hidden @internal */
267
+ /** @internal */
268
268
  private supportsPopout: boolean;
269
- /** @hidden @internal */
269
+ /** @internal */
270
270
  private popoutURL: string;
271
- /** @hidden @internal */
271
+ /** @internal */
272
272
  private icons: IIcons;
273
- /** @hidden @internal */
273
+ /** @internal */
274
274
  private firstRender: boolean;
275
- /** @hidden @internal */
275
+ /** @internal */
276
276
  private resizeObserver?: ResizeObserver;
277
277
 
278
278
  constructor(props: ILayoutProps) {
@@ -300,7 +300,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
300
300
  this.onDragEnter = this.onDragEnter.bind(this);
301
301
  }
302
302
 
303
- /** @hidden @internal */
303
+ /** @internal */
304
304
  styleFont(style: Record<string, string>): Record<string, string> {
305
305
  if (this.props.font) {
306
306
  if (this.selfRef.current) {
@@ -321,7 +321,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
321
321
  return style;
322
322
  }
323
323
 
324
- /** @hidden @internal */
324
+ /** @internal */
325
325
  onModelChange = () => {
326
326
  this.forceUpdate();
327
327
  if (this.props.onModelChange) {
@@ -329,7 +329,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
329
329
  }
330
330
  };
331
331
 
332
- /** @hidden @internal */
332
+ /** @internal */
333
333
  doAction(action: Action): Node | undefined {
334
334
  if (this.props.onAction !== undefined) {
335
335
  const outcome = this.props.onAction(action);
@@ -342,7 +342,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
342
342
  }
343
343
  }
344
344
 
345
- /** @hidden @internal */
345
+ /** @internal */
346
346
  componentDidMount() {
347
347
  this.updateRect();
348
348
  this.updateLayoutMetrics();
@@ -356,7 +356,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
356
356
  this.resizeObserver.observe(this.selfRef.current!);
357
357
  }
358
358
 
359
- /** @hidden @internal */
359
+ /** @internal */
360
360
  componentDidUpdate() {
361
361
  this.updateLayoutMetrics();
362
362
  if (this.props.model !== this.previousModel) {
@@ -369,7 +369,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
369
369
  // console.log("Layout time: " + this.layoutTime + "ms Render time: " + (Date.now() - this.start) + "ms");
370
370
  }
371
371
 
372
- /** @hidden @internal */
372
+ /** @internal */
373
373
  updateRect = (domRect: DOMRectReadOnly = this.getDomRect()) => {
374
374
  const rect = new Rect(0, 0, domRect.width, domRect.height);
375
375
  if (!rect.equals(this.state.rect) && rect.width !== 0 && rect.height !== 0) {
@@ -377,7 +377,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
377
377
  }
378
378
  };
379
379
 
380
- /** @hidden @internal */
380
+ /** @internal */
381
381
  updateLayoutMetrics = () => {
382
382
  if (this.findHeaderBarSizeRef.current) {
383
383
  const headerBarSize = this.findHeaderBarSizeRef.current.getBoundingClientRect().height;
@@ -399,7 +399,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
399
399
  }
400
400
  };
401
401
 
402
- /** @hidden @internal */
402
+ /** @internal */
403
403
  getClassName = (defaultClassName: string) => {
404
404
  if (this.props.classNameMapper === undefined) {
405
405
  return defaultClassName;
@@ -408,57 +408,57 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
408
408
  }
409
409
  };
410
410
 
411
- /** @hidden @internal */
411
+ /** @internal */
412
412
  getCurrentDocument() {
413
413
  return this.currentDocument;
414
414
  }
415
415
 
416
- /** @hidden @internal */
416
+ /** @internal */
417
417
  getDomRect() {
418
418
  return this.selfRef.current!.getBoundingClientRect();
419
419
  }
420
420
 
421
- /** @hidden @internal */
421
+ /** @internal */
422
422
  getRootDiv() {
423
423
  return this.selfRef.current!;
424
424
  }
425
425
 
426
- /** @hidden @internal */
426
+ /** @internal */
427
427
  isSupportsPopout() {
428
428
  return this.supportsPopout;
429
429
  }
430
430
 
431
- /** @hidden @internal */
431
+ /** @internal */
432
432
  isRealtimeResize() {
433
433
  return this.props.realtimeResize ?? false;
434
434
  }
435
435
 
436
- /** @hidden @internal */
436
+ /** @internal */
437
437
  onTabDrag(...args: Parameters<Required<ILayoutProps>['onTabDrag']>) {
438
438
  return this.props.onTabDrag?.(...args);
439
439
  }
440
440
 
441
- /** @hidden @internal */
441
+ /** @internal */
442
442
  getPopoutURL() {
443
443
  return this.popoutURL;
444
444
  }
445
445
 
446
- /** @hidden @internal */
446
+ /** @internal */
447
447
  componentWillUnmount() {
448
448
  this.resizeObserver?.unobserve(this.selfRef.current!)
449
449
  }
450
450
 
451
- /** @hidden @internal */
451
+ /** @internal */
452
452
  setEditingTab(tabNode?: TabNode) {
453
453
  this.setState({ editingTab: tabNode });
454
454
  }
455
455
 
456
- /** @hidden @internal */
456
+ /** @internal */
457
457
  getEditingTab() {
458
458
  return this.state.editingTab;
459
459
  }
460
460
 
461
- /** @hidden @internal */
461
+ /** @internal */
462
462
  render() {
463
463
  // first render will be used to find the size (via selfRef)
464
464
  if (this.firstRender) {
@@ -498,20 +498,20 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
498
498
  const nextTopIdsMap: Record<string, string> = {};
499
499
 
500
500
  // Keep any previous tabs in the same DOM order as before, removing any that have been deleted
501
- this.tabIds.forEach((t) => {
501
+ for (const t of this.tabIds) {
502
502
  if (tabComponents[t]) {
503
503
  nextTopIds.push(t);
504
504
  nextTopIdsMap[t] = t;
505
505
  }
506
- });
506
+ }
507
507
  this.tabIds = nextTopIds;
508
508
 
509
509
  // Add tabs that have been added to the DOM
510
- Object.keys(tabComponents).forEach((t) => {
510
+ for (const t of Object.keys(tabComponents)) {
511
511
  if (!nextTopIdsMap[t]) {
512
512
  this.tabIds.push(t);
513
513
  }
514
- });
514
+ }
515
515
 
516
516
  // this.layoutTime = (Date.now() - this.start);
517
517
 
@@ -530,7 +530,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
530
530
  );
531
531
  }
532
532
 
533
- /** @hidden @internal */
533
+ /** @internal */
534
534
  metricsElements() {
535
535
  // used to measure the tab and border tab sizes
536
536
  const fontStyle = this.styleFont({ visibility: "hidden" });
@@ -549,7 +549,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
549
549
  );
550
550
  }
551
551
 
552
- /** @hidden @internal */
552
+ /** @internal */
553
553
  onCloseWindow = (id: string) => {
554
554
  this.doAction(Actions.unFloatTab(id));
555
555
  try {
@@ -559,12 +559,12 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
559
559
  }
560
560
  };
561
561
 
562
- /** @hidden @internal */
562
+ /** @internal */
563
563
  onSetWindow = (id: string, window: Window) => {
564
564
  (this.props.model.getNodeById(id) as TabNode)._setWindow(window);
565
565
  };
566
566
 
567
- /** @hidden @internal */
567
+ /** @internal */
568
568
  renderBorder(borderSet: BorderSet, borderComponents: React.ReactNode[], tabComponents: Record<string, React.ReactNode>, floatingWindows: React.ReactNode[], splitterComponents: React.ReactNode[]) {
569
569
  for (const border of borderSet.getBorders()) {
570
570
  const borderPath = `/border/${border.getLocation().getName()}`;
@@ -625,7 +625,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
625
625
  }
626
626
  }
627
627
 
628
- /** @hidden @internal */
628
+ /** @internal */
629
629
  renderChildren(path: string, node: RowNode | TabSetNode, tabSetComponents: React.ReactNode[], tabComponents: Record<string, React.ReactNode>, floatingWindows: React.ReactNode[], splitterComponents: React.ReactNode[]) {
630
630
  const drawChildren = node._getDrawChildren();
631
631
  let splitterCount = 0;
@@ -674,7 +674,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
674
674
  }
675
675
  }
676
676
 
677
- /** @hidden @internal */
677
+ /** @internal */
678
678
  _getScreenRect(node: TabNode) {
679
679
  const rect = node!.getRect()!.clone();
680
680
  const bodyRect: DOMRect = this.selfRef.current!.getBoundingClientRect();
@@ -757,7 +757,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
757
757
  rootdiv!.appendChild(this.dragDiv);
758
758
  }
759
759
 
760
- /** @hidden @internal */
760
+ /** @internal */
761
761
  onCancelAdd = () => {
762
762
  const rootdiv = this.selfRef.current;
763
763
  rootdiv!.removeChild(this.dragDiv!);
@@ -779,7 +779,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
779
779
  this.customDrop = undefined;
780
780
  };
781
781
 
782
- /** @hidden @internal */
782
+ /** @internal */
783
783
  onCancelDrag = (wasDragging: boolean) => {
784
784
  if (wasDragging) {
785
785
  const rootdiv = this.selfRef.current!;
@@ -814,13 +814,13 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
814
814
 
815
815
  };
816
816
 
817
- /** @hidden @internal */
817
+ /** @internal */
818
818
  onDragDivMouseDown = (event: Event) => {
819
819
  event.preventDefault();
820
820
  this.dragStart(event, this.dragDivText, TabNode._fromJson(this.newTabJson, this.props.model, false), true, undefined, undefined);
821
821
  };
822
822
 
823
- /** @hidden @internal */
823
+ /** @internal */
824
824
  dragStart = (
825
825
  event: Event | React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement> | undefined,
826
826
  dragDivText: string | undefined,
@@ -838,7 +838,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
838
838
  }
839
839
  };
840
840
 
841
- /** @hidden @internal */
841
+ /** @internal */
842
842
  dragRectRender = (text: String | undefined, node?: Node, json?: IJsonTabNode, onRendered?: () => void) => {
843
843
  let content: React.ReactElement | undefined;
844
844
 
@@ -877,18 +877,18 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
877
877
  this.dragDiv!);
878
878
  };
879
879
 
880
- /** @hidden @internal */
880
+ /** @internal */
881
881
  showPortal = (control: React.ReactNode, element: HTMLElement) => {
882
882
  const portal = ReactDOM.createPortal(control, element);
883
883
  this.setState({ portal });
884
884
  };
885
885
 
886
- /** @hidden @internal */
886
+ /** @internal */
887
887
  hidePortal = () => {
888
888
  this.setState({ portal: undefined });
889
889
  };
890
890
 
891
- /** @hidden @internal */
891
+ /** @internal */
892
892
  onDragStart = () => {
893
893
  this.dropInfo = undefined;
894
894
  this.customDrop = undefined;
@@ -917,7 +917,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
917
917
  return true;
918
918
  };
919
919
 
920
- /** @hidden @internal */
920
+ /** @internal */
921
921
  onDragMove = (event: React.MouseEvent<Element>) => {
922
922
  if (this.firstMove === false) {
923
923
  const speed = this.props.model._getAttribute("tabDragSpeed") as number;
@@ -960,7 +960,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
960
960
  }
961
961
  };
962
962
 
963
- /** @hidden @internal */
963
+ /** @internal */
964
964
  onDragEnd = (event: Event) => {
965
965
  const rootdiv = this.selfRef.current!;
966
966
  rootdiv.removeChild(this.outlineDiv!);
@@ -1000,7 +1000,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1000
1000
  this.setState({ showHiddenBorder: DockLocation.CENTER });
1001
1001
  };
1002
1002
 
1003
- /** @hidden @internal */
1003
+ /** @internal */
1004
1004
  private handleCustomTabDrag(dropInfo: DropInfo, pos: { x: number; y: number; }, event: React.MouseEvent<Element, MouseEvent>) {
1005
1005
  let invalidated = this.customDrop?.invalidated;
1006
1006
  const currentCallback = this.customDrop?.callback;
@@ -1061,7 +1061,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1061
1061
  }
1062
1062
  }
1063
1063
 
1064
- /** @hidden @internal */
1064
+ /** @internal */
1065
1065
  onDragEnter(event: React.DragEvent<HTMLDivElement>) {
1066
1066
  // DragDrop keeps track of number of dragenters minus the number of
1067
1067
  // dragleaves. Only start a new drag if there isn't one already.
@@ -1077,7 +1077,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1077
1077
  }
1078
1078
 
1079
1079
 
1080
- /** @hidden @internal */
1080
+ /** @internal */
1081
1081
  checkForBorderToShow(x: number, y: number) {
1082
1082
  const r = this.props.model._getOuterInnerRects().outer;
1083
1083
  const c = r.getCenter();
@@ -1110,7 +1110,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1110
1110
  }
1111
1111
  }
1112
1112
 
1113
- /** @hidden @internal */
1113
+ /** @internal */
1114
1114
  showEdges(rootdiv: HTMLElement) {
1115
1115
  if (this.props.model.isEnableEdgeDock()) {
1116
1116
  const length = this.edgeRectLength + "px";
@@ -1156,7 +1156,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1156
1156
  }
1157
1157
  }
1158
1158
 
1159
- /** @hidden @internal */
1159
+ /** @internal */
1160
1160
  repositionEdges(domRect: Rect) {
1161
1161
  if (this.props.model.isEnableEdgeDock()) {
1162
1162
  const r = this.centerRect!;
@@ -1175,7 +1175,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1175
1175
  }
1176
1176
  }
1177
1177
 
1178
- /** @hidden @internal */
1178
+ /** @internal */
1179
1179
  hideEdges(rootdiv: HTMLElement) {
1180
1180
  if (this.props.model.isEnableEdgeDock()) {
1181
1181
  try {
@@ -1189,12 +1189,12 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1189
1189
  this.edgesShown = false;
1190
1190
  }
1191
1191
 
1192
- /** @hidden @internal */
1192
+ /** @internal */
1193
1193
  maximize(tabsetNode: TabSetNode) {
1194
1194
  this.doAction(Actions.maximizeToggle(tabsetNode.getId()));
1195
1195
  }
1196
1196
 
1197
- /** @hidden @internal */
1197
+ /** @internal */
1198
1198
  customizeTab(
1199
1199
  tabNode: TabNode,
1200
1200
  renderValues: ITabRenderValues,
@@ -1204,7 +1204,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1204
1204
  }
1205
1205
  }
1206
1206
 
1207
- /** @hidden @internal */
1207
+ /** @internal */
1208
1208
  customizeTabSet(
1209
1209
  tabSetNode: TabSetNode | BorderNode,
1210
1210
  renderValues: ITabSetRenderValues,
@@ -1214,7 +1214,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1214
1214
  }
1215
1215
  }
1216
1216
 
1217
- /** @hidden @internal */
1217
+ /** @internal */
1218
1218
  i18nName(id: I18nLabel, param?: string) {
1219
1219
  let message;
1220
1220
  if (this.props.i18nMapper) {
@@ -1226,23 +1226,23 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1226
1226
  return message;
1227
1227
  }
1228
1228
 
1229
- /** @hidden @internal */
1229
+ /** @internal */
1230
1230
  getOnRenderFloatingTabPlaceholder() {
1231
1231
  return this.props.onRenderFloatingTabPlaceholder;
1232
1232
  }
1233
1233
 
1234
- /** @hidden @internal */
1234
+ /** @internal */
1235
1235
  getShowOverflowMenu() {
1236
1236
  return this.props.onShowOverflowMenu;
1237
1237
  }
1238
- /** @hidden @internal */
1238
+ /** @internal */
1239
1239
  showContextMenu(node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) {
1240
1240
  if (this.props.onContextMenu) {
1241
1241
  this.props.onContextMenu(node, event);
1242
1242
  }
1243
1243
  }
1244
1244
 
1245
- /** @hidden @internal */
1245
+ /** @internal */
1246
1246
  auxMouseClick(node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) {
1247
1247
  if (this.props.onAuxMouseClick) {
1248
1248
  this.props.onAuxMouseClick(node, event);
@@ -1253,13 +1253,13 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
1253
1253
  // wrapper round the drag rect renderer that can call
1254
1254
  // a method once the rendering is written to the dom
1255
1255
 
1256
- /** @hidden @internal */
1256
+ /** @internal */
1257
1257
  interface IDragRectRenderWrapper {
1258
1258
  onRendered?: () => void;
1259
1259
  children: React.ReactNode;
1260
1260
  }
1261
1261
 
1262
- /** @hidden @internal */
1262
+ /** @internal */
1263
1263
  const DragRectRenderWrapper = (props: IDragRectRenderWrapper) => {
1264
1264
  React.useEffect(() => {
1265
1265
  props.onRendered?.();
@@ -9,14 +9,14 @@ import { Orientation } from "../Orientation";
9
9
  import { CLASSES } from "../Types";
10
10
  import { ILayoutCallbacks } from "./Layout";
11
11
 
12
- /** @hidden @internal */
12
+ /** @internal */
13
13
  export interface ISplitterProps {
14
14
  layout: ILayoutCallbacks;
15
15
  node: SplitterNode;
16
16
  path: string;
17
17
  }
18
18
 
19
- /** @hidden @internal */
19
+ /** @internal */
20
20
  export const Splitter = (props: ISplitterProps) => {
21
21
  const { layout, node, path } = props;
22
22
 
package/src/view/Tab.tsx CHANGED
@@ -7,10 +7,10 @@ import { CLASSES } from "../Types";
7
7
  import { ILayoutCallbacks } from "./Layout";
8
8
  import { ErrorBoundary } from "./ErrorBoundary";
9
9
  import { I18nLabel } from "../I18nLabel";
10
- import { BorderNode } from "..";
10
+ import { BorderNode } from "../model/BorderNode";
11
11
  import { hideElement } from "./Utils";
12
12
 
13
- /** @hidden @internal */
13
+ /** @internal */
14
14
  export interface ITabProps {
15
15
  layout: ILayoutCallbacks;
16
16
  selected: boolean;
@@ -19,7 +19,7 @@ export interface ITabProps {
19
19
  path: string;
20
20
  }
21
21
 
22
- /** @hidden @internal */
22
+ /** @internal */
23
23
  export const Tab = (props: ITabProps) => {
24
24
  const { layout, selected, node, factory, path } = props;
25
25
  const [renderComponent, setRenderComponent] = React.useState<boolean>(!props.node.isEnableRenderOnDemand() || props.selected);
@@ -9,24 +9,22 @@ import { ICloseType } from "../model/ICloseType";
9
9
  import { CLASSES } from "../Types";
10
10
  import { getRenderStateEx, isAuxMouseEvent } from "./Utils";
11
11
 
12
- /** @hidden @internal */
12
+ /** @internal */
13
13
  export interface ITabButtonProps {
14
14
  layout: ILayoutCallbacks;
15
15
  node: TabNode;
16
16
  selected: boolean;
17
- height: number;
18
17
  iconFactory?: (node: TabNode) => React.ReactNode | undefined;
19
18
  titleFactory?: (node: TabNode) => React.ReactNode | undefined;
20
19
  icons: IIcons;
21
20
  path: string;
22
21
  }
23
22
 
24
- /** @hidden @internal */
23
+ /** @internal */
25
24
  export const TabButton = (props: ITabButtonProps) => {
26
25
  const { layout, node, selected, iconFactory, titleFactory, icons, path } = props;
27
26
  const selfRef = React.useRef<HTMLDivElement | null>(null);
28
27
  const contentRef = React.useRef<HTMLInputElement | null>(null);
29
- const contentWidth = React.useRef<number>(0);
30
28
 
31
29
  const onMouseDown = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>) => {
32
30
 
@@ -51,16 +49,14 @@ export const TabButton = (props: ITabButtonProps) => {
51
49
 
52
50
  const onDoubleClick = (event: Event) => {
53
51
  if (node.isEnableRename()) {
54
- layout.setEditingTab(node);
55
- layout.getCurrentDocument()!.body.addEventListener("mousedown", onEndEdit);
56
- layout.getCurrentDocument()!.body.addEventListener("touchstart", onEndEdit);
52
+ onRename();
57
53
  }
58
- // else {
59
- // const parentNode = node.getParent() as TabSetNode;
60
- // if (parentNode.canMaximize()) {
61
- // layout.maximize(parentNode);
62
- // }
63
- // }
54
+ };
55
+
56
+ const onRename = () => {
57
+ layout.setEditingTab(node);
58
+ layout.getCurrentDocument()!.body.addEventListener("mousedown", onEndEdit);
59
+ layout.getCurrentDocument()!.body.addEventListener("touchstart", onEndEdit);
64
60
  };
65
61
 
66
62
  const onEndEdit = (event: Event) => {
@@ -109,7 +105,6 @@ export const TabButton = (props: ITabButtonProps) => {
109
105
  const layoutRect = layout.getDomRect();
110
106
  const r = selfRef.current!.getBoundingClientRect();
111
107
  node._setTabRect(new Rect(r.left - layoutRect.left, r.top - layoutRect.top, r.width, r.height));
112
- contentWidth.current = selfRef.current!.getBoundingClientRect().width;
113
108
  };
114
109
 
115
110
  const onTextBoxMouseDown = (event: React.MouseEvent<HTMLInputElement> | React.TouchEvent<HTMLInputElement>) => {
@@ -182,7 +177,8 @@ export const TabButton = (props: ITabButtonProps) => {
182
177
  data-layout-path={path + "/button/close"}
183
178
  title={closeTitle}
184
179
  className={cm(CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING)}
185
- onMouseDown={onCloseMouseDown} onClick={onClose}
180
+ onMouseDown={onCloseMouseDown}
181
+ onClick={onClose}
186
182
  onTouchStart={onCloseMouseDown}>
187
183
  {(typeof icons.close === "function") ? icons.close(node) : icons.close}
188
184
  </div>