flexlayout-react 0.8.19 → 0.9.1

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 (78) hide show
  1. package/README.md +146 -208
  2. package/dist/index.js +6523 -6395
  3. package/package.json +25 -27
  4. package/style/_base.scss +115 -35
  5. package/style/_themes.scss +719 -49
  6. package/style/alpha_dark.css +865 -0
  7. package/style/alpha_dark.css.map +1 -0
  8. package/style/alpha_dark.scss +6 -0
  9. package/style/alpha_light.css +859 -0
  10. package/style/alpha_light.css.map +1 -0
  11. package/style/alpha_light.scss +6 -0
  12. package/style/alpha_rounded.css +813 -0
  13. package/style/alpha_rounded.css.map +1 -0
  14. package/style/alpha_rounded.scss +6 -0
  15. package/style/combined.css +573 -47
  16. package/style/combined.css.map +1 -1
  17. package/style/combined.scss +25 -1
  18. package/style/dark.css +100 -25
  19. package/style/dark.css.map +1 -1
  20. package/style/gray.css +101 -26
  21. package/style/gray.css.map +1 -1
  22. package/style/light.css +101 -23
  23. package/style/light.css.map +1 -1
  24. package/style/rounded.css +112 -28
  25. package/style/rounded.css.map +1 -1
  26. package/style/underline.css +104 -25
  27. package/style/underline.css.map +1 -1
  28. package/types/index.d.ts +14 -14
  29. package/types/model/Actions.d.ts +62 -31
  30. package/types/model/Attributes.d.ts +42 -0
  31. package/types/model/BorderNode.d.ts +11 -11
  32. package/types/model/BorderSet.d.ts +2 -2
  33. package/types/{DropInfo.d.ts → model/DropInfo.d.ts} +2 -2
  34. package/types/model/IDropTarget.d.ts +2 -2
  35. package/types/model/IJsonModel.d.ts +72 -50
  36. package/types/model/Layout.d.ts +41 -0
  37. package/types/model/Model.d.ts +30 -25
  38. package/types/model/Node.d.ts +18 -10
  39. package/types/{Rect.d.ts → model/Rect.d.ts} +6 -4
  40. package/types/model/RowNode.d.ts +15 -14
  41. package/types/model/TabNode.d.ts +17 -25
  42. package/types/model/TabSetNode.d.ts +15 -21
  43. package/types/view/BorderButton.d.ts +4 -3
  44. package/types/view/BorderTab.d.ts +3 -3
  45. package/types/view/BorderTabSet.d.ts +3 -3
  46. package/types/{Types.d.ts → view/CSSClassNames.d.ts} +11 -3
  47. package/types/view/DragTabButton.d.ts +11 -0
  48. package/types/view/FloatWindow.d.ts +12 -0
  49. package/types/{I18nLabel.d.ts → view/I18nLabel.d.ts} +2 -1
  50. package/types/view/Icons.d.ts +1 -0
  51. package/types/view/Layout.d.ts +21 -197
  52. package/types/view/Overlay.d.ts +2 -2
  53. package/types/view/PopoutWindow.d.ts +6 -6
  54. package/types/view/PopupMenu.d.ts +2 -2
  55. package/types/view/Row.d.ts +3 -3
  56. package/types/view/Splitter.d.ts +2 -4
  57. package/types/view/Tab.d.ts +3 -4
  58. package/types/view/TabButton.d.ts +3 -3
  59. package/types/view/TabButtonStamp.d.ts +3 -3
  60. package/types/view/TabContentRenderer.d.ts +14 -0
  61. package/types/view/TabLayout.d.ts +12 -0
  62. package/types/view/TabOverflowHook.d.ts +3 -3
  63. package/types/view/TabSet.d.ts +3 -3
  64. package/types/view/Utils.d.ts +15 -4
  65. package/types/view/layout/BorderContainer.d.ts +7 -0
  66. package/types/view/layout/DragDropManager.d.ts +48 -0
  67. package/types/view/layout/EdgeIndicators.d.ts +5 -0
  68. package/types/view/layout/FloatingWindowContainer.d.ts +5 -0
  69. package/types/view/layout/LayoutInternal.d.ts +147 -0
  70. package/types/view/layout/LayoutTypes.d.ts +51 -0
  71. package/types/Attribute.d.ts +0 -25
  72. package/types/AttributeDefinitions.d.ts +0 -18
  73. package/types/model/Action.d.ts +0 -5
  74. package/types/model/LayoutWindow.d.ts +0 -44
  75. package/types/view/DragContainer.d.ts +0 -9
  76. package/types/view/SizeTracker.d.ts +0 -13
  77. /package/types/{DockLocation.d.ts → model/DockLocation.d.ts} +0 -0
  78. /package/types/{Orientation.d.ts → model/Orientation.d.ts} +0 -0
@@ -1,10 +1,13 @@
1
1
  import { ICloseType } from "./ICloseType";
2
2
  export type IBorderLocation = "top" | "bottom" | "left" | "right";
3
3
  export type ITabLocation = "top" | "bottom";
4
+ export type ILayoutType = "window" | "float" | "tab";
4
5
  export interface IJsonModel {
5
6
  global?: IGlobalAttributes;
6
7
  borders?: IJsonBorderNode[];
7
8
  layout: IJsonRowNode;
9
+ subLayouts?: Record<string, IJsonSubLayout>;
10
+ /** @deprecated Use `subLayouts` instead. */
8
11
  popouts?: Record<string, IJsonPopout>;
9
12
  }
10
13
  export interface IJsonRect {
@@ -13,16 +16,19 @@ export interface IJsonRect {
13
16
  width: number;
14
17
  height: number;
15
18
  }
16
- export interface IJsonPopout {
19
+ export interface IJsonSubLayout {
17
20
  layout: IJsonRowNode;
18
- rect: IJsonRect;
21
+ rect?: IJsonRect;
22
+ type?: ILayoutType;
19
23
  }
24
+ /** @deprecated Use `IJsonSubLayout` instead. */
25
+ export type IJsonPopout = IJsonSubLayout;
20
26
  export interface IJsonBorderNode extends IBorderAttributes {
21
27
  location: IBorderLocation;
22
- children: IJsonTabNode[];
28
+ children?: IJsonTabNode[];
23
29
  }
24
30
  export interface IJsonRowNode extends IRowAttributes {
25
- children: (IJsonRowNode | IJsonTabSetNode)[];
31
+ children?: (IJsonRowNode | IJsonTabSetNode)[];
26
32
  }
27
33
  export interface IJsonTabSetNode extends ITabSetAttributes {
28
34
  /** Marks this as the active tab set, read from initial json but
@@ -31,10 +37,9 @@ export interface IJsonTabSetNode extends ITabSetAttributes {
31
37
  /** Marks this tab set as being maximized, read from initial json but
32
38
  * must subseqently be set on the model (only one tab set can be maximized) */
33
39
  maximized?: boolean;
34
- children: IJsonTabNode[];
35
- }
36
- export interface IJsonTabNode extends ITabAttributes {
40
+ children?: IJsonTabNode[];
37
41
  }
42
+ export type IJsonTabNode = ITabAttributes;
38
43
  export interface IGlobalAttributes {
39
44
  /**
40
45
  Value for BorderNode attribute autoSelectTabWhenClosed if not overridden
@@ -97,7 +102,7 @@ export interface IGlobalAttributes {
97
102
 
98
103
  the minimum size of the tab area
99
104
 
100
- Default: 0
105
+ Default: 1
101
106
  */
102
107
  borderMinSize?: number;
103
108
  /**
@@ -109,11 +114,17 @@ export interface IGlobalAttributes {
109
114
  */
110
115
  borderSize?: number;
111
116
  /**
112
- enable docking to the edges of the layout, this will show the edge indicators
117
+ enable docking to the edges of the layout
113
118
 
114
119
  Default: true
115
120
  */
116
121
  enableEdgeDock?: boolean;
122
+ /**
123
+ show the edge indicators when dragging
124
+
125
+ Default: true
126
+ */
127
+ enableEdgeDockIndicators?: boolean;
117
128
  /**
118
129
  boolean indicating if tab icons should rotate with the text in the left and right borders
119
130
 
@@ -126,24 +137,6 @@ export interface IGlobalAttributes {
126
137
  Default: false
127
138
  */
128
139
  rootOrientationVertical?: boolean;
129
- /**
130
- enable a small centralized handle on all splitters
131
-
132
- Default: false
133
- */
134
- splitterEnableHandle?: boolean;
135
- /**
136
- additional width in pixels of the splitter hit test area
137
-
138
- Default: 0
139
- */
140
- splitterExtra?: number;
141
- /**
142
- width in pixels of all splitters between tabsets/borders
143
-
144
- Default: 8
145
- */
146
- splitterSize?: number;
147
140
  /**
148
141
  Value for TabNode attribute borderHeight if not overridden
149
142
 
@@ -184,12 +177,6 @@ export interface IGlobalAttributes {
184
177
  Default: undefined
185
178
  */
186
179
  tabContentClassName?: string;
187
- /**
188
-
189
-
190
- Default: 0.3
191
- */
192
- tabDragSpeed?: number;
193
180
  /**
194
181
  Value for TabNode attribute enableClose if not overridden
195
182
 
@@ -209,11 +196,19 @@ export interface IGlobalAttributes {
209
196
  /**
210
197
  Value for TabNode attribute enablePopout if not overridden
211
198
 
212
- enable popout (in popout capable browser)
199
+ enable window popout (in popout capable browser), to show an icon in the tabset header also set the enablePopoutIcon attribute
213
200
 
214
201
  Default: false
215
202
  */
216
203
  tabEnablePopout?: boolean;
204
+ /**
205
+ Value for TabNode attribute enablePopoutFloatIcon if not overridden
206
+
207
+ whether to show the popout float icon in the tabset header if this tab enables floating popouts
208
+
209
+ Default: false
210
+ */
211
+ tabEnablePopoutFloatIcon?: boolean;
217
212
  /**
218
213
  Value for TabNode attribute enablePopoutIcon if not overridden
219
214
 
@@ -276,7 +271,7 @@ export interface IGlobalAttributes {
276
271
 
277
272
  the min height of this tab
278
273
 
279
- Default: 0
274
+ Default: 1
280
275
  */
281
276
  tabMinHeight?: number;
282
277
  /**
@@ -284,7 +279,7 @@ export interface IGlobalAttributes {
284
279
 
285
280
  the min width of this tab
286
281
 
287
- Default: 0
282
+ Default: 1
288
283
  */
289
284
  tabMinWidth?: number;
290
285
  /**
@@ -314,11 +309,19 @@ export interface IGlobalAttributes {
314
309
  /**
315
310
  Value for TabSetNode attribute enableClose if not overridden
316
311
 
317
- allow user to close tabset via a close button
312
+ can this tabset be closed
318
313
 
319
- Default: false
314
+ Default: true
320
315
  */
321
316
  tabSetEnableClose?: boolean;
317
+ /**
318
+ Value for TabSetNode attribute enableCloseButton if not overridden
319
+
320
+ if the tabset can be closed then show a close button
321
+
322
+ Default: false
323
+ */
324
+ tabSetEnableCloseButton?: boolean;
322
325
  /**
323
326
  Value for TabSetNode attribute enableDeleteWhenEmpty if not overridden
324
327
 
@@ -412,7 +415,7 @@ export interface IGlobalAttributes {
412
415
 
413
416
  minimum height (in px) for this tabset
414
417
 
415
- Default: 0
418
+ Default: 1
416
419
  */
417
420
  tabSetMinHeight?: number;
418
421
  /**
@@ -420,7 +423,7 @@ export interface IGlobalAttributes {
420
423
 
421
424
  minimum width (in px) for this tabset
422
425
 
423
- Default: 0
426
+ Default: 1
424
427
  */
425
428
  tabSetMinWidth?: number;
426
429
  /**
@@ -478,11 +481,17 @@ export interface ITabSetAttributes {
478
481
  */
479
482
  enableActiveIcon?: boolean;
480
483
  /**
481
- allow user to close tabset via a close button
484
+ can this tabset be closed
482
485
 
483
- Default: inherited from Global attribute tabSetEnableClose (default false)
486
+ Default: inherited from Global attribute tabSetEnableClose (default true)
484
487
  */
485
488
  enableClose?: boolean;
489
+ /**
490
+ if the tabset can be closed then show a close button
491
+
492
+ Default: inherited from Global attribute tabSetEnableCloseButton (default false)
493
+ */
494
+ enableCloseButton?: boolean;
486
495
  /**
487
496
  whether to delete this tabset when is has no tabs
488
497
 
@@ -558,13 +567,13 @@ export interface ITabSetAttributes {
558
567
  /**
559
568
  minimum height (in px) for this tabset
560
569
 
561
- Default: inherited from Global attribute tabSetMinHeight (default 0)
570
+ Default: inherited from Global attribute tabSetMinHeight (default 1)
562
571
  */
563
572
  minHeight?: number;
564
573
  /**
565
574
  minimum width (in px) for this tabset
566
575
 
567
- Default: inherited from Global attribute tabSetMinWidth (default 0)
576
+ Default: inherited from Global attribute tabSetMinWidth (default 1)
568
577
  */
569
578
  minWidth?: number;
570
579
  /**
@@ -630,7 +639,7 @@ export interface ITabAttributes {
630
639
  */
631
640
  closeType?: ICloseType;
632
641
  /**
633
- string identifying which component to run (for factory)
642
+ string identifying which component to render in this tab (used in the layout factory function)
634
643
 
635
644
  Default: undefined
636
645
  */
@@ -660,11 +669,17 @@ export interface ITabAttributes {
660
669
  */
661
670
  enableDrag?: boolean;
662
671
  /**
663
- enable popout (in popout capable browser)
672
+ enable window popout (in popout capable browser), to show an icon in the tabset header also set the enablePopoutIcon attribute
664
673
 
665
674
  Default: inherited from Global attribute tabEnablePopout (default false)
666
675
  */
667
676
  enablePopout?: boolean;
677
+ /**
678
+ whether to show the popout float icon in the tabset header if this tab enables floating popouts
679
+
680
+ Default: inherited from Global attribute tabEnablePopoutFloatIcon (default false)
681
+ */
682
+ enablePopoutFloatIcon?: boolean;
668
683
  /**
669
684
  whether to show the popout icon in the tabset header if this tab enables popouts
670
685
 
@@ -697,7 +712,7 @@ export interface ITabAttributes {
697
712
  */
698
713
  enableWindowReMount?: boolean;
699
714
  /**
700
- An optional help text for the tab to be displayed upon tab hover.
715
+ help text for the tab to be displayed upon tab hover.
701
716
 
702
717
  Default: undefined
703
718
  */
@@ -729,13 +744,13 @@ export interface ITabAttributes {
729
744
  /**
730
745
  the min height of this tab
731
746
 
732
- Default: inherited from Global attribute tabMinHeight (default 0)
747
+ Default: inherited from Global attribute tabMinHeight (default 1)
733
748
  */
734
749
  minHeight?: number;
735
750
  /**
736
751
  the min width of this tab
737
752
 
738
- Default: inherited from Global attribute tabMinWidth (default 0)
753
+ Default: inherited from Global attribute tabMinWidth (default 1)
739
754
  */
740
755
  minWidth?: number;
741
756
  /**
@@ -744,6 +759,13 @@ export interface ITabAttributes {
744
759
  Default: "[Unnamed Tab]"
745
760
  */
746
761
  name?: string;
762
+ /**
763
+ the Id of the sub layout to render in this tab, defined in the subLayouts section of the model json (if
764
+ component is also defined then use the <TabLayout> component in the factory to render the sublayout)
765
+
766
+ Default: undefined
767
+ */
768
+ subLayoutId?: string;
747
769
  /**
748
770
  class applied to parent tabset when this is the only tab and it is stretched to fill the tabset
749
771
 
@@ -809,7 +831,7 @@ export interface IBorderAttributes {
809
831
  /**
810
832
  the minimum size of the tab area
811
833
 
812
- Default: inherited from Global attribute borderMinSize (default 0)
834
+ Default: inherited from Global attribute borderMinSize (default 1)
813
835
  */
814
836
  minSize?: number;
815
837
  /**
@@ -0,0 +1,41 @@
1
+ import { Rect } from "./Rect";
2
+ import { IJsonSubLayout } from "./IJsonModel";
3
+ import { Model } from "./Model";
4
+ import { RowNode } from "./RowNode";
5
+ import { Node } from "./Node";
6
+ import { TabSetNode } from "./TabSetNode";
7
+ import { LayoutController } from "../view/layout/LayoutInternal";
8
+ import { ILayoutType } from "./IJsonModel";
9
+ /** @internal */
10
+ export declare class Layout {
11
+ private _layoutId;
12
+ private _type;
13
+ private _rect;
14
+ private _controller;
15
+ private _rootRow?;
16
+ private _maximizedTabSet?;
17
+ private _activeTabSet?;
18
+ private _toExportRectFunction;
19
+ constructor(layoutId: string, type: ILayoutType, rect: Rect);
20
+ visitNodes(fn: (node: Node, level: number) => void): void;
21
+ isMainLayout(): boolean;
22
+ getLayoutId(): string;
23
+ getType(): ILayoutType;
24
+ setType(value: ILayoutType): void;
25
+ getRect(): Rect;
26
+ getController(): LayoutController | undefined;
27
+ getWindow(): Window | undefined;
28
+ getRootRow(): RowNode | undefined;
29
+ getMaximizedTabSet(): TabSetNode | undefined;
30
+ getActiveTabSet(): TabSetNode | undefined;
31
+ setRect(value: Rect): void;
32
+ setController(value: LayoutController | undefined): void;
33
+ getWindowId(): string | undefined;
34
+ setRootRow(rowNode: RowNode | undefined): void;
35
+ setMaximizedTabSet(value: TabSetNode | undefined): void;
36
+ setActiveTabSet(value: TabSetNode | undefined): void;
37
+ getToExportRectFunction(): (rect: Rect, type: ILayoutType) => Rect;
38
+ setToExportRectFunction(value: (rect: Rect, type: ILayoutType) => Rect): void;
39
+ toJson(): IJsonSubLayout;
40
+ static fromJson(layoutJson: IJsonSubLayout, model: Model, layoutId: string): Layout;
41
+ }
@@ -1,13 +1,13 @@
1
- import { DropInfo } from "../DropInfo";
2
- import { Action } from "./Action";
1
+ import { DropInfo } from "./DropInfo";
2
+ import { Action } from "./Actions";
3
3
  import { BorderSet } from "./BorderSet";
4
4
  import { IDraggable } from "./IDraggable";
5
- import { IJsonModel, ITabSetAttributes } from "./IJsonModel";
5
+ import { IGlobalAttributes, IJsonModel, ITabSetAttributes } from "./IJsonModel";
6
6
  import { Node } from "./Node";
7
7
  import { RowNode } from "./RowNode";
8
8
  import { TabNode } from "./TabNode";
9
9
  import { TabSetNode } from "./TabSetNode";
10
- import { LayoutWindow } from "./LayoutWindow";
10
+ import { Layout } from "./Layout";
11
11
  /** @internal */
12
12
  export declare const DefaultMin = 1;
13
13
  /** @internal */
@@ -16,25 +16,27 @@ export declare const DefaultMax = 99999;
16
16
  * Class containing the Tree of Nodes used by the FlexLayout component
17
17
  */
18
18
  export declare class Model {
19
- static MAIN_WINDOW_ID: string;
19
+ static MAIN_LAYOUT_ID: string;
20
20
  /** @internal */
21
21
  private static attributeDefinitions;
22
22
  /** @internal */
23
23
  private attributes;
24
24
  /** @internal */
25
- private idMap;
25
+ private layouts;
26
+ /** @internal */
27
+ private borders;
26
28
  /** @internal */
27
29
  private changeListeners;
28
30
  /** @internal */
29
- private borders;
31
+ private idMap;
30
32
  /** @internal */
31
- private onAllowDrop?;
33
+ private mainLayout;
32
34
  /** @internal */
33
- private onCreateTabSet?;
35
+ private splitterSize?;
34
36
  /** @internal */
35
- private windows;
37
+ private onAllowDrop?;
36
38
  /** @internal */
37
- private rootWindow;
39
+ private onCreateTabSet?;
38
40
  /**
39
41
  * 'private' constructor. Use the static method Model.fromJson(json) to create a model
40
42
  * @internal
@@ -44,22 +46,22 @@ export declare class Model {
44
46
  * Update the node tree by performing the given action,
45
47
  * Actions should be generated via static methods on the Actions class
46
48
  * @param action the action to perform
47
- * @returns added Node for Actions.addNode, windowId for createWindow
49
+ * @returns added Node for Actions.addTab, layoutId for createPopout
48
50
  */
49
51
  doAction(action: Action): any;
50
52
  /**
51
53
  * Get the currently active tabset node
52
54
  */
53
- getActiveTabset(windowId?: string): TabSetNode | undefined;
55
+ getActiveTabset(layoutId?: string): TabSetNode | undefined;
54
56
  /**
55
57
  * Get the currently maximized tabset node
56
58
  */
57
- getMaximizedTabset(windowId?: string): TabSetNode | undefined;
59
+ getMaximizedTabset(layoutId?: string): TabSetNode | undefined;
58
60
  /**
59
61
  * Gets the root RowNode of the model
60
62
  * @returns {RowNode}
61
63
  */
62
- getRoot(windowId?: string): RowNode;
64
+ getRootRow(layoutId?: string): RowNode;
63
65
  isRootOrientationVertical(): boolean;
64
66
  isEnableRotateBorderIcons(): boolean;
65
67
  /**
@@ -67,13 +69,12 @@ export declare class Model {
67
69
  * @returns {BorderSet|*}
68
70
  */
69
71
  getBorderSet(): BorderSet;
70
- getwindowsMap(): Map<string, LayoutWindow>;
71
72
  /**
72
73
  * Visits all the nodes in the model and calls the given function for each
73
74
  * @param fn a function that takes visited node and a integer level as parameters
74
75
  */
75
76
  visitNodes(fn: (node: Node, level: number) => void): void;
76
- visitWindowNodes(windowId: string, fn: (node: Node, level: number) => void): void;
77
+ visitLayoutNodes(layoutId: string, fn: (node: Node, level: number) => void): void;
77
78
  /**
78
79
  * Gets a node by its id
79
80
  * @param id the id to find
@@ -96,10 +97,10 @@ export declare class Model {
96
97
  * @returns {IJsonModel} json object that represents this model
97
98
  */
98
99
  toJson(): IJsonModel;
99
- getSplitterSize(): number;
100
- getSplitterExtra(): number;
100
+ getSplitterSize(): number | undefined;
101
+ setSplitterSize(size?: number): void;
101
102
  isEnableEdgeDock(): boolean;
102
- isSplitterEnableHandle(): boolean;
103
+ isEnableEdgeDockIndicators(): boolean;
103
104
  /**
104
105
  * Sets a function to allow/deny dropping a node
105
106
  * @param onAllowDrop function that takes the drag node and DropInfo and returns true if the drop is allowed
@@ -117,21 +118,25 @@ export declare class Model {
117
118
  toString(): string;
118
119
  /***********************internal ********************************/
119
120
  /** @internal */
120
- removeEmptyWindows(): void;
121
+ getMainLayout(): Layout;
122
+ /** @internal */
123
+ getLayouts(): Map<string, Layout>;
124
+ /** @internal */
125
+ sortLayouts(): void;
121
126
  /** @internal */
122
- setActiveTabset(tabsetNode: TabSetNode | undefined, windowId: string): void;
127
+ setActiveTabset(tabsetNode: TabSetNode | undefined, layoutId: string): void;
123
128
  /** @internal */
124
- setMaximizedTabset(tabsetNode: (TabSetNode | undefined), windowId: string): void;
129
+ setMaximizedTabset(tabsetNode: (TabSetNode | undefined), layoutId: string): void;
125
130
  /** @internal */
126
131
  updateIdMap(): void;
127
132
  /** @internal */
128
133
  addNode(node: Node): void;
129
134
  /** @internal */
130
- findDropTargetNode(windowId: string, dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
135
+ findDropTargetNode(layoutId: string, dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
131
136
  /** @internal */
132
137
  tidy(): void;
133
138
  /** @internal */
134
- updateAttrs(json: any): void;
139
+ updateAttrs(json: IGlobalAttributes): void;
135
140
  /** @internal */
136
141
  nextUniqueId(): string;
137
142
  /** @internal */
@@ -1,10 +1,12 @@
1
- import { AttributeDefinitions } from "../AttributeDefinitions";
2
- import { DropInfo } from "../DropInfo";
3
- import { Orientation } from "../Orientation";
4
- import { Rect } from "../Rect";
1
+ import type * as React from "react";
2
+ import { Attributes } from "./Attributes";
3
+ import { DropInfo } from "./DropInfo";
4
+ import { Orientation } from "./Orientation";
5
+ import { Rect } from "./Rect";
5
6
  import { IDraggable } from "./IDraggable";
6
7
  import { IJsonBorderNode, IJsonRowNode, IJsonTabNode, IJsonTabSetNode } from "./IJsonModel";
7
8
  import { Model } from "./Model";
9
+ import { Layout } from "./Layout";
8
10
  export declare abstract class Node {
9
11
  /** @internal */
10
12
  protected model: Model;
@@ -29,14 +31,19 @@ export declare abstract class Node {
29
31
  getChildren(): Node[];
30
32
  getRect(): Rect;
31
33
  getPath(): string;
34
+ isCloseable(): boolean;
35
+ isAllowedInWindow(): boolean;
32
36
  getOrientation(): Orientation;
33
- setEventListener(event: string, callback: (params: any) => void): void;
34
- removeEventListener(event: string): void;
37
+ getLayoutId(): string;
38
+ /** @internal */
39
+ getLayout(): Layout;
40
+ setEventListener(event: NodeEventType, callback: (params: any) => void): void;
41
+ removeEventListener(event: NodeEventType): void;
35
42
  abstract toJson(): IJsonRowNode | IJsonBorderNode | IJsonTabSetNode | IJsonTabNode | undefined;
36
43
  /** @internal */
37
44
  setId(id: string): void;
38
45
  /** @internal */
39
- fireEvent(event: string, params: any): void;
46
+ fireEvent(event: NodeEventType, params: any): void;
40
47
  /** @internal */
41
48
  getAttr(name: string): any;
42
49
  /** @internal */
@@ -54,7 +61,7 @@ export declare abstract class Node {
54
61
  /** @internal */
55
62
  setSelected(index: number): void;
56
63
  /** @internal */
57
- findDropTargetNode(windowId: string, dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
64
+ findDropTargetNode(layoutId: string, dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
58
65
  /** @internal */
59
66
  canDrop(dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
60
67
  /** @internal */
@@ -66,7 +73,7 @@ export declare abstract class Node {
66
73
  /** @internal */
67
74
  removeAll(): void;
68
75
  /** @internal */
69
- styleWithPosition(style?: Record<string, any>): Record<string, any>;
76
+ styleWithPosition(style?: React.CSSProperties): React.CSSProperties;
70
77
  /** @internal */
71
78
  isEnableDivide(): boolean;
72
79
  /** @internal */
@@ -74,5 +81,6 @@ export declare abstract class Node {
74
81
  /** @internal */
75
82
  abstract updateAttrs(json: any): void;
76
83
  /** @internal */
77
- abstract getAttributeDefinitions(): AttributeDefinitions;
84
+ abstract getAttributeDefinitions(): Attributes;
78
85
  }
86
+ export type NodeEventType = "save" | "resize" | "visibility" | "close";
@@ -1,4 +1,5 @@
1
- import { IJsonRect } from "./model/IJsonModel";
1
+ import type * as React from "react";
2
+ import { IJsonRect } from "./IJsonModel";
2
3
  import { Orientation } from "./Orientation";
3
4
  export declare class Rect {
4
5
  static empty(): Rect;
@@ -21,7 +22,7 @@ export declare class Rect {
21
22
  relativeTo(r: Rect | DOMRect): Rect;
22
23
  clone(): Rect;
23
24
  equals(rect: Rect | null | undefined): boolean;
24
- aboutEquals(rect: Rect | null | undefined): boolean;
25
+ equalsWhenRounded(rect: Rect | null | undefined): boolean;
25
26
  equalSize(rect: Rect | null | undefined): boolean;
26
27
  getBottom(): number;
27
28
  getRight(): number;
@@ -31,8 +32,8 @@ export declare class Rect {
31
32
  x: number;
32
33
  y: number;
33
34
  };
34
- positionElement(element: HTMLElement, position?: string): void;
35
- styleWithPosition(style: Record<string, any>, position?: string): Record<string, any>;
35
+ positionElement(element: HTMLElement, position?: React.CSSProperties["position"]): void;
36
+ styleWithPosition(style: React.CSSProperties, position?: React.CSSProperties["position"]): React.CSSProperties;
36
37
  contains(x: number, y: number): boolean;
37
38
  removeInsets(insets: {
38
39
  top: number;
@@ -41,6 +42,7 @@ export declare class Rect {
41
42
  right: number;
42
43
  }): Rect;
43
44
  centerInRect(outerRect: Rect): void;
45
+ clamp(outerRect: Rect): void;
44
46
  /** @internal */
45
47
  _getSize(orientation: Orientation): number;
46
48
  toString(): string;
@@ -1,21 +1,21 @@
1
- import { AttributeDefinitions } from "../AttributeDefinitions";
2
- import { DockLocation } from "../DockLocation";
3
- import { DropInfo } from "../DropInfo";
4
- import { Orientation } from "../Orientation";
1
+ import { Attributes } from "./Attributes";
2
+ import { DockLocation } from "./DockLocation";
3
+ import { DropInfo } from "./DropInfo";
4
+ import { Orientation } from "./Orientation";
5
5
  import { IDraggable } from "./IDraggable";
6
6
  import { IDropTarget } from "./IDropTarget";
7
- import { IJsonRowNode } from "./IJsonModel";
7
+ import { IJsonRowNode, IRowAttributes } from "./IJsonModel";
8
8
  import { Model } from "./Model";
9
9
  import { Node } from "./Node";
10
- import { LayoutWindow } from "./LayoutWindow";
10
+ import { Layout } from "./Layout";
11
11
  export declare class RowNode extends Node implements IDropTarget {
12
12
  static readonly TYPE = "row";
13
13
  /** @internal */
14
- static fromJson(json: any, model: Model, layoutWindow: LayoutWindow): RowNode;
14
+ static fromJson(json: IJsonRowNode, model: Model, layout: Layout): RowNode;
15
15
  /** @internal */
16
16
  private static attributeDefinitions;
17
17
  /** @internal */
18
- private windowId;
18
+ private layout?;
19
19
  /** @internal */
20
20
  private minHeight;
21
21
  /** @internal */
@@ -25,12 +25,13 @@ export declare class RowNode extends Node implements IDropTarget {
25
25
  /** @internal */
26
26
  private maxWidth;
27
27
  /** @internal */
28
- constructor(model: Model, windowId: string, json: any);
28
+ constructor(model: Model, json: IJsonRowNode);
29
29
  getWeight(): number;
30
30
  toJson(): IJsonRowNode;
31
31
  /** @internal */
32
- getWindowId(): string;
33
- setWindowId(windowId: string): void;
32
+ getLayout(): Layout;
33
+ /** @internal */
34
+ setLayout(layout: Layout): void;
34
35
  /** @internal */
35
36
  setWeight(weight: number): void;
36
37
  /** @internal */
@@ -66,11 +67,11 @@ export declare class RowNode extends Node implements IDropTarget {
66
67
  /** @internal */
67
68
  isEnableDrop(): boolean;
68
69
  /** @internal */
69
- getAttributeDefinitions(): AttributeDefinitions;
70
+ getAttributeDefinitions(): Attributes;
70
71
  /** @internal */
71
- updateAttrs(json: any): void;
72
+ updateAttrs(json: IRowAttributes): void;
72
73
  /** @internal */
73
- static getAttributeDefinitions(): AttributeDefinitions;
74
+ static getAttributeDefinitions(): Attributes;
74
75
  normalizeWeights(): void;
75
76
  /** @internal */
76
77
  private static createAttributeDefinitions;