@aptre/flex-layout 0.1.0

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/LICENSE +22 -0
  2. package/README.md +527 -0
  3. package/declarations/Attribute.d.ts +1 -0
  4. package/declarations/AttributeDefinitions.d.ts +1 -0
  5. package/declarations/DockLocation.d.ts +12 -0
  6. package/declarations/DragDrop.d.ts +15 -0
  7. package/declarations/DropInfo.d.ts +12 -0
  8. package/declarations/I18nLabel.d.ts +14 -0
  9. package/declarations/Orientation.d.ts +7 -0
  10. package/declarations/PopupMenu.d.ts +1 -0
  11. package/declarations/Rect.d.ts +28 -0
  12. package/declarations/Types.d.ts +78 -0
  13. package/declarations/index.d.ts +22 -0
  14. package/declarations/model/Action.d.ts +5 -0
  15. package/declarations/model/Actions.d.ts +110 -0
  16. package/declarations/model/BorderNode.d.ts +34 -0
  17. package/declarations/model/BorderSet.d.ts +4 -0
  18. package/declarations/model/ICloseType.d.ts +5 -0
  19. package/declarations/model/IDraggable.d.ts +2 -0
  20. package/declarations/model/IDropTarget.d.ts +2 -0
  21. package/declarations/model/IJsonModel.d.ts +146 -0
  22. package/declarations/model/Model.d.ts +86 -0
  23. package/declarations/model/Node.d.ts +17 -0
  24. package/declarations/model/RowNode.d.ts +11 -0
  25. package/declarations/model/SplitterNode.d.ts +5 -0
  26. package/declarations/model/TabNode.d.ts +36 -0
  27. package/declarations/model/TabSetNode.d.ts +40 -0
  28. package/declarations/model/Utils.d.ts +1 -0
  29. package/declarations/view/BorderButton.d.ts +1 -0
  30. package/declarations/view/BorderTabSet.d.ts +1 -0
  31. package/declarations/view/ErrorBoundary.d.ts +1 -0
  32. package/declarations/view/FloatingWindow.d.ts +1 -0
  33. package/declarations/view/FloatingWindowTab.d.ts +1 -0
  34. package/declarations/view/Icons.d.ts +6 -0
  35. package/declarations/view/Layout.d.ts +158 -0
  36. package/declarations/view/Splitter.d.ts +1 -0
  37. package/declarations/view/Tab.d.ts +1 -0
  38. package/declarations/view/TabButton.d.ts +1 -0
  39. package/declarations/view/TabButtonStamp.d.ts +1 -0
  40. package/declarations/view/TabFloating.d.ts +1 -0
  41. package/declarations/view/TabOverflowHook.d.ts +1 -0
  42. package/declarations/view/TabSet.d.ts +1 -0
  43. package/declarations/view/Utils.d.ts +1 -0
  44. package/dist/index.js +5669 -0
  45. package/package.json +73 -0
  46. package/style/_base.scss +631 -0
  47. package/style/dark.css +560 -0
  48. package/style/dark.css.map +1 -0
  49. package/style/dark.scss +173 -0
  50. package/style/gray.css +543 -0
  51. package/style/gray.css.map +1 -0
  52. package/style/gray.scss +172 -0
  53. package/style/light.css +544 -0
  54. package/style/light.css.map +1 -0
  55. package/style/light.scss +156 -0
  56. package/style/underline.css +565 -0
  57. package/style/underline.css.map +1 -0
  58. package/style/underline.scss +178 -0
  59. package/tsconfig.json +18 -0
  60. package/typedoc/.nojekyll +1 -0
  61. package/typedoc/assets/highlight.css +106 -0
  62. package/typedoc/assets/main.js +58 -0
  63. package/typedoc/assets/search.js +1 -0
  64. package/typedoc/assets/style.css +1338 -0
  65. package/typedoc/classes/Action.html +134 -0
  66. package/typedoc/classes/Actions.html +499 -0
  67. package/typedoc/classes/BorderNode.html +374 -0
  68. package/typedoc/classes/BorderSet.html +112 -0
  69. package/typedoc/classes/DockLocation.html +163 -0
  70. package/typedoc/classes/DragDrop.html +242 -0
  71. package/typedoc/classes/DropInfo.html +155 -0
  72. package/typedoc/classes/Layout.html +600 -0
  73. package/typedoc/classes/Model.html +396 -0
  74. package/typedoc/classes/Node.html +221 -0
  75. package/typedoc/classes/Orientation.html +148 -0
  76. package/typedoc/classes/Rect.html +312 -0
  77. package/typedoc/classes/RowNode.html +275 -0
  78. package/typedoc/classes/SplitterNode.html +238 -0
  79. package/typedoc/classes/TabNode.html +389 -0
  80. package/typedoc/classes/TabSetNode.html +453 -0
  81. package/typedoc/enums/CLASSES.html +480 -0
  82. package/typedoc/enums/I18nLabel.html +160 -0
  83. package/typedoc/enums/ICloseType.html +115 -0
  84. package/typedoc/index.html +148 -0
  85. package/typedoc/interfaces/IBorderAttributes.html +166 -0
  86. package/typedoc/interfaces/ICustomDropDestination.html +149 -0
  87. package/typedoc/interfaces/IDraggable.html +95 -0
  88. package/typedoc/interfaces/IDropTarget.html +96 -0
  89. package/typedoc/interfaces/IFontValues.html +124 -0
  90. package/typedoc/interfaces/IGlobalAttributes.html +329 -0
  91. package/typedoc/interfaces/IIcons.html +134 -0
  92. package/typedoc/interfaces/IJsonBorderNode.html +188 -0
  93. package/typedoc/interfaces/IJsonModel.html +119 -0
  94. package/typedoc/interfaces/IJsonRowNode.html +141 -0
  95. package/typedoc/interfaces/IJsonTabNode.html +220 -0
  96. package/typedoc/interfaces/IJsonTabSetNode.html +273 -0
  97. package/typedoc/interfaces/ILayoutProps.html +365 -0
  98. package/typedoc/interfaces/ILayoutState.html +144 -0
  99. package/typedoc/interfaces/IRowAttributes.html +131 -0
  100. package/typedoc/interfaces/ITabAttributes.html +201 -0
  101. package/typedoc/interfaces/ITabRenderValues.html +124 -0
  102. package/typedoc/interfaces/ITabSetAttributes.html +241 -0
  103. package/typedoc/interfaces/ITabSetRenderValues.html +134 -0
  104. package/typedoc/interfaces/ITitleObject.html +114 -0
  105. package/typedoc/types/CustomDragCallback.html +108 -0
  106. package/typedoc/types/DragRectRenderCallback.html +104 -0
  107. package/typedoc/types/FloatingTabPlaceholderRenderCallback.html +114 -0
  108. package/typedoc/types/IBorderLocation.html +87 -0
  109. package/typedoc/types/IInsets.html +98 -0
  110. package/typedoc/types/ITabLocation.html +87 -0
  111. package/typedoc/types/IconFactory.html +100 -0
  112. package/typedoc/types/NodeMouseEvent.html +102 -0
  113. package/typedoc/types/ShowOverflowMenuCallback.html +122 -0
  114. package/typedoc/types/TabSetPlaceHolderCallback.html +100 -0
  115. package/typedoc/types/TitleFactory.html +100 -0
@@ -0,0 +1,78 @@
1
+ export declare enum CLASSES {
2
+ FLEXLAYOUT__BORDER = "flexlayout__border",
3
+ FLEXLAYOUT__BORDER_ = "flexlayout__border_",
4
+ FLEXLAYOUT__BORDER_BUTTON = "flexlayout__border_button",
5
+ FLEXLAYOUT__BORDER_BUTTON_ = "flexlayout__border_button_",
6
+ FLEXLAYOUT__BORDER_BUTTON_CONTENT = "flexlayout__border_button_content",
7
+ FLEXLAYOUT__BORDER_BUTTON_LEADING = "flexlayout__border_button_leading",
8
+ FLEXLAYOUT__BORDER_BUTTON_TRAILING = "flexlayout__border_button_trailing",
9
+ FLEXLAYOUT__BORDER_BUTTON__SELECTED = "flexlayout__border_button--selected",
10
+ FLEXLAYOUT__BORDER_BUTTON__UNSELECTED = "flexlayout__border_button--unselected",
11
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW = "flexlayout__border_toolbar_button_overflow",
12
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ = "flexlayout__border_toolbar_button_overflow_",
13
+ FLEXLAYOUT__BORDER_INNER = "flexlayout__border_inner",
14
+ FLEXLAYOUT__BORDER_INNER_ = "flexlayout__border_inner_",
15
+ FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER = "flexlayout__border_inner_tab_container",
16
+ FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ = "flexlayout__border_inner_tab_container_",
17
+ FLEXLAYOUT__BORDER_TAB_DIVIDER = "flexlayout__border_tab_divider",
18
+ FLEXLAYOUT__BORDER_SIZER = "flexlayout__border_sizer",
19
+ FLEXLAYOUT__BORDER_TOOLBAR = "flexlayout__border_toolbar",
20
+ FLEXLAYOUT__BORDER_TOOLBAR_ = "flexlayout__border_toolbar_",
21
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON = "flexlayout__border_toolbar_button",
22
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT = "flexlayout__border_toolbar_button-float",
23
+ FLEXLAYOUT__DRAG_RECT = "flexlayout__drag_rect",
24
+ FLEXLAYOUT__EDGE_RECT = "flexlayout__edge_rect",
25
+ FLEXLAYOUT__EDGE_RECT_TOP = "flexlayout__edge_rect_top",
26
+ FLEXLAYOUT__EDGE_RECT_LEFT = "flexlayout__edge_rect_left",
27
+ FLEXLAYOUT__EDGE_RECT_BOTTOM = "flexlayout__edge_rect_bottom",
28
+ FLEXLAYOUT__EDGE_RECT_RIGHT = "flexlayout__edge_rect_right",
29
+ FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER = "flexlayout__error_boundary_container",
30
+ FLEXLAYOUT__ERROR_BOUNDARY_CONTENT = "flexlayout__error_boundary_content",
31
+ FLEXLAYOUT__FLOATING_WINDOW_CONTENT = "flexlayout__floating_window_content",
32
+ FLEXLAYOUT__FLOATING_WINDOW_TAB = "flexlayout__floating_window_tab",
33
+ FLEXLAYOUT__LAYOUT = "flexlayout__layout",
34
+ FLEXLAYOUT__OUTLINE_RECT = "flexlayout__outline_rect",
35
+ FLEXLAYOUT__OUTLINE_RECT_EDGE = "flexlayout__outline_rect_edge",
36
+ FLEXLAYOUT__SPLITTER = "flexlayout__splitter",
37
+ FLEXLAYOUT__SPLITTER_EXTRA = "flexlayout__splitter_extra",
38
+ FLEXLAYOUT__SPLITTER_ = "flexlayout__splitter_",
39
+ FLEXLAYOUT__SPLITTER_BORDER = "flexlayout__splitter_border",
40
+ FLEXLAYOUT__SPLITTER_DRAG = "flexlayout__splitter_drag",
41
+ FLEXLAYOUT__TAB = "flexlayout__tab",
42
+ FLEXLAYOUT__TABSET = "flexlayout__tabset",
43
+ FLEXLAYOUT__TABSET_HEADER = "flexlayout__tabset_header",
44
+ FLEXLAYOUT__TABSET_HEADER_SIZER = "flexlayout__tabset_header_sizer",
45
+ FLEXLAYOUT__TABSET_HEADER_CONTENT = "flexlayout__tabset_header_content",
46
+ FLEXLAYOUT__TABSET_MAXIMIZED = "flexlayout__tabset-maximized",
47
+ FLEXLAYOUT__TABSET_SELECTED = "flexlayout__tabset-selected",
48
+ FLEXLAYOUT__TABSET_SIZER = "flexlayout__tabset_sizer",
49
+ FLEXLAYOUT__TABSET_TAB_DIVIDER = "flexlayout__tabset_tab_divider",
50
+ FLEXLAYOUT__TABSET_CONTENT = "flexlayout__tabset_content",
51
+ FLEXLAYOUT__TABSET_TABBAR_INNER = "flexlayout__tabset_tabbar_inner",
52
+ FLEXLAYOUT__TABSET_TABBAR_INNER_ = "flexlayout__tabset_tabbar_inner_",
53
+ FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER = "flexlayout__tabset_tabbar_inner_tab_container",
54
+ FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ = "flexlayout__tabset_tabbar_inner_tab_container_",
55
+ FLEXLAYOUT__TABSET_TABBAR_OUTER = "flexlayout__tabset_tabbar_outer",
56
+ FLEXLAYOUT__TABSET_TABBAR_OUTER_ = "flexlayout__tabset_tabbar_outer_",
57
+ FLEXLAYOUT__TAB_BORDER = "flexlayout__tab_border",
58
+ FLEXLAYOUT__TAB_BORDER_ = "flexlayout__tab_border_",
59
+ FLEXLAYOUT__TAB_BUTTON = "flexlayout__tab_button",
60
+ FLEXLAYOUT__TAB_BUTTON_CONTENT = "flexlayout__tab_button_content",
61
+ FLEXLAYOUT__TAB_BUTTON_LEADING = "flexlayout__tab_button_leading",
62
+ FLEXLAYOUT__TAB_BUTTON_OVERFLOW = "flexlayout__tab_button_overflow",
63
+ FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT = "flexlayout__tab_button_overflow_count",
64
+ FLEXLAYOUT__TAB_BUTTON_TEXTBOX = "flexlayout__tab_button_textbox",
65
+ FLEXLAYOUT__TAB_BUTTON_TRAILING = "flexlayout__tab_button_trailing",
66
+ FLEXLAYOUT__TAB_BUTTON_STAMP = "flexlayout__tab_button_stamp",
67
+ FLEXLAYOUT__TAB_FLOATING = "flexlayout__tab_floating",
68
+ FLEXLAYOUT__TAB_FLOATING_INNER = "flexlayout__tab_floating_inner",
69
+ FLEXLAYOUT__TAB_TOOLBAR = "flexlayout__tab_toolbar",
70
+ FLEXLAYOUT__TAB_TOOLBAR_BUTTON = "flexlayout__tab_toolbar_button",
71
+ FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ = "flexlayout__tab_toolbar_button-",
72
+ FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT = "flexlayout__tab_toolbar_button-float",
73
+ FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER = "flexlayout__tab_toolbar_sticky_buttons_container",
74
+ FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close",
75
+ FLEXLAYOUT__POPUP_MENU_CONTAINER = "flexlayout__popup_menu_container",
76
+ FLEXLAYOUT__POPUP_MENU_ITEM = "flexlayout__popup_menu_item",
77
+ FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu"
78
+ }
@@ -0,0 +1,22 @@
1
+ export * from './view/Layout';
2
+ export * from './model/Action';
3
+ export * from './model/Actions';
4
+ export * from './model/BorderNode';
5
+ export * from './model/BorderSet';
6
+ export * from './model/ICloseType';
7
+ export * from './model/IDraggable';
8
+ export * from './model/IDropTarget';
9
+ export * from './model/IJsonModel';
10
+ export * from './model/Model';
11
+ export * from './model/Node';
12
+ export * from './model/RowNode';
13
+ export * from './model/SplitterNode';
14
+ export * from './model/TabNode';
15
+ export * from './model/TabSetNode';
16
+ export * from './DockLocation';
17
+ export * from './DragDrop';
18
+ export * from './DropInfo';
19
+ export * from './I18nLabel';
20
+ export * from './Orientation';
21
+ export * from './Rect';
22
+ export * from './Types';
@@ -0,0 +1,5 @@
1
+ export declare class Action {
2
+ type: string;
3
+ data: Record<string, any>;
4
+ constructor(type: string, data: Record<string, any>);
5
+ }
@@ -0,0 +1,110 @@
1
+ import { DockLocation } from "../DockLocation";
2
+ import { Action } from "./Action";
3
+ /**
4
+ * The Action creator class for FlexLayout model actions
5
+ */
6
+ export declare class Actions {
7
+ static ADD_NODE: string;
8
+ static MOVE_NODE: string;
9
+ static DELETE_TAB: string;
10
+ static DELETE_TABSET: string;
11
+ static RENAME_TAB: string;
12
+ static SELECT_TAB: string;
13
+ static SET_ACTIVE_TABSET: string;
14
+ static ADJUST_SPLIT: string;
15
+ static ADJUST_BORDER_SPLIT: string;
16
+ static MAXIMIZE_TOGGLE: string;
17
+ static UPDATE_MODEL_ATTRIBUTES: string;
18
+ static UPDATE_NODE_ATTRIBUTES: string;
19
+ static FLOAT_TAB: string;
20
+ static UNFLOAT_TAB: string;
21
+ /**
22
+ * Adds a tab node to the given tabset node
23
+ * @param json the json for the new tab node e.g {type:"tab", component:"table"}
24
+ * @param toNodeId the new tab node will be added to the tabset with this node id
25
+ * @param location the location where the new tab will be added, one of the DockLocation enum values.
26
+ * @param index for docking to the center this value is the index of the tab, use -1 to add to the end.
27
+ * @param select (optional) whether to select the new tab, overriding autoSelectTab
28
+ * @returns {Action} the action
29
+ */
30
+ static addNode(json: any, toNodeId: string, location: DockLocation, index: number, select?: boolean): Action;
31
+ /**
32
+ * Moves a node (tab or tabset) from one location to another
33
+ * @param fromNodeId the id of the node to move
34
+ * @param toNodeId the id of the node to receive the moved node
35
+ * @param location the location where the moved node will be added, one of the DockLocation enum values.
36
+ * @param index for docking to the center this value is the index of the tab, use -1 to add to the end.
37
+ * @param select (optional) whether to select the moved tab(s) in new tabset, overriding autoSelectTab
38
+ * @returns {Action} the action
39
+ */
40
+ static moveNode(fromNodeId: string, toNodeId: string, location: DockLocation, index: number, select?: boolean): Action;
41
+ /**
42
+ * Deletes a tab node from the layout
43
+ * @param tabsetNodeId the id of the tab node to delete
44
+ * @returns {Action} the action
45
+ */
46
+ static deleteTab(tabNodeId: string): Action;
47
+ /**
48
+ * Deletes a tabset node and all it's child tab nodes from the layout
49
+ * @param tabsetNodeId the id of the tabset node to delete
50
+ * @returns {Action} the action
51
+ */
52
+ static deleteTabset(tabsetNodeId: string): Action;
53
+ /**
54
+ * Change the given nodes tab text
55
+ * @param tabNodeId the id of the node to rename
56
+ * @param text the test of the tab
57
+ * @returns {Action} the action
58
+ */
59
+ static renameTab(tabNodeId: string, text: string): Action;
60
+ /**
61
+ * Selects the given tab in its parent tabset
62
+ * @param tabNodeId the id of the node to set selected
63
+ * @returns {Action} the action
64
+ */
65
+ static selectTab(tabNodeId: string): Action;
66
+ /**
67
+ * Set the given tabset node as the active tabset
68
+ * @param tabsetNodeId the id of the tabset node to set as active
69
+ * @returns {Action} the action
70
+ */
71
+ static setActiveTabset(tabsetNodeId: string | undefined): Action;
72
+ /**
73
+ * Adjust the splitter between two tabsets
74
+ * @example
75
+ * Actions.adjustSplit({node1: "1", weight1:30, pixelWidth1:300, node2: "2", weight2:70, pixelWidth2:700});
76
+ *
77
+ * @param splitSpec an object the defines the new split between two tabsets, see example below.
78
+ * @returns {Action} the action
79
+ */
80
+ static adjustSplit(splitSpec: {
81
+ node1Id: string;
82
+ weight1: number;
83
+ pixelWidth1: number;
84
+ node2Id: string;
85
+ weight2: number;
86
+ pixelWidth2: number;
87
+ }): Action;
88
+ static adjustBorderSplit(nodeId: string, pos: number): Action;
89
+ /**
90
+ * Maximizes the given tabset
91
+ * @param tabsetNodeId the id of the tabset to maximize
92
+ * @returns {Action} the action
93
+ */
94
+ static maximizeToggle(tabsetNodeId: string): Action;
95
+ /**
96
+ * Updates the global model jsone attributes
97
+ * @param attributes the json for the model attributes to update (merge into the existing attributes)
98
+ * @returns {Action} the action
99
+ */
100
+ static updateModelAttributes(attributes: any): Action;
101
+ /**
102
+ * Updates the given nodes json attributes
103
+ * @param nodeId the id of the node to update
104
+ * @param attributes the json attributes to update (merge with the existing attributes)
105
+ * @returns {Action} the action
106
+ */
107
+ static updateNodeAttributes(nodeId: string, attributes: any): Action;
108
+ static floatTab(nodeId: string): Action;
109
+ static unFloatTab(nodeId: string): Action;
110
+ }
@@ -0,0 +1,34 @@
1
+ import { DockLocation } from "../DockLocation";
2
+ import { Orientation } from "../Orientation";
3
+ import { Rect } from "../Rect";
4
+ import { IDropTarget } from "./IDropTarget";
5
+ import { IJsonBorderNode } from "./IJsonModel";
6
+ import { Node } from "./Node";
7
+ export declare class BorderNode extends Node implements IDropTarget {
8
+ static readonly TYPE = "border";
9
+ getLocation(): DockLocation;
10
+ getTabHeaderRect(): Rect | undefined;
11
+ getRect(): Rect;
12
+ getContentRect(): Rect | undefined;
13
+ isEnableDrop(): boolean;
14
+ isAutoSelectTab(whenOpen?: boolean): boolean;
15
+ getClassName(): string | undefined;
16
+ getBorderBarSize(): number;
17
+ getSize(): any;
18
+ getMinSize(): number;
19
+ getSelected(): number;
20
+ getSelectedNode(): Node | undefined;
21
+ getOrientation(): Orientation;
22
+ /**
23
+ * Returns the config attribute that can be used to store node specific data that
24
+ * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
25
+ * than directly, for example:
26
+ * this.state.model.doAction(
27
+ * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
28
+ */
29
+ getConfig(): any;
30
+ isMaximized(): boolean;
31
+ isShowing(): boolean;
32
+ isAutoHide(): boolean;
33
+ toJson(): IJsonBorderNode;
34
+ }
@@ -0,0 +1,4 @@
1
+ import { BorderNode } from "./BorderNode";
2
+ export declare class BorderSet {
3
+ getBorders(): BorderNode[];
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum ICloseType {
2
+ Visible = 1,
3
+ Always = 2,
4
+ Selected = 3
5
+ }
@@ -0,0 +1,2 @@
1
+ export interface IDraggable {
2
+ }
@@ -0,0 +1,2 @@
1
+ export interface IDropTarget {
2
+ }
@@ -0,0 +1,146 @@
1
+ import { ICloseType } from './ICloseType';
2
+ export type IBorderLocation = "top" | "bottom" | "left" | "right";
3
+ export type ITabLocation = "top" | "bottom";
4
+ export type IInsets = {
5
+ "top": number;
6
+ "right": number;
7
+ "bottom": number;
8
+ "left": number;
9
+ };
10
+ export interface IJsonModel {
11
+ global?: IGlobalAttributes;
12
+ borders?: IJsonBorderNode[];
13
+ layout: IJsonRowNode;
14
+ }
15
+ export interface IJsonBorderNode extends IBorderAttributes {
16
+ location: IBorderLocation;
17
+ children: IJsonTabNode[];
18
+ }
19
+ export interface IJsonRowNode extends IRowAttributes {
20
+ children: (IJsonRowNode | IJsonTabSetNode)[];
21
+ }
22
+ export interface IJsonTabSetNode extends ITabSetAttributes {
23
+ active?: boolean;
24
+ maximized?: boolean;
25
+ children: IJsonTabNode[];
26
+ }
27
+ export interface IJsonTabNode extends ITabAttributes {
28
+ }
29
+ export interface IGlobalAttributes {
30
+ borderAutoSelectTabWhenClosed?: boolean;
31
+ borderAutoSelectTabWhenOpen?: boolean;
32
+ borderBarSize?: number;
33
+ borderClassName?: string;
34
+ borderEnableAutoHide?: boolean;
35
+ borderEnableDrop?: boolean;
36
+ borderMinSize?: number;
37
+ borderSize?: number;
38
+ enableEdgeDock?: boolean;
39
+ enableRotateBorderIcons?: boolean;
40
+ enableUseVisibility?: boolean;
41
+ legacyOverflowMenu?: boolean;
42
+ marginInsets?: IInsets;
43
+ rootOrientationVertical?: boolean;
44
+ splitterExtra?: number;
45
+ splitterSize?: number;
46
+ tabBorderHeight?: number;
47
+ tabBorderWidth?: number;
48
+ tabClassName?: string;
49
+ tabCloseType?: ICloseType;
50
+ tabContentClassName?: string;
51
+ tabDragSpeed?: number;
52
+ tabEnableClose?: boolean;
53
+ tabEnableDrag?: boolean;
54
+ tabEnableFloat?: boolean;
55
+ tabEnableRename?: boolean;
56
+ tabEnableRenderOnDemand?: boolean;
57
+ tabIcon?: string;
58
+ tabSetAutoSelectTab?: boolean;
59
+ tabSetBorderInsets?: IInsets;
60
+ tabSetClassNameHeader?: string;
61
+ tabSetClassNameTabStrip?: string;
62
+ tabSetEnableClose?: boolean;
63
+ tabSetEnableDeleteWhenEmpty?: boolean;
64
+ tabSetEnableDivide?: boolean;
65
+ tabSetEnableDrag?: boolean;
66
+ tabSetEnableDrop?: boolean;
67
+ tabSetEnableMaximize?: boolean;
68
+ tabSetEnableTabStrip?: boolean;
69
+ tabSetHeaderHeight?: number;
70
+ tabSetMarginInsets?: IInsets;
71
+ tabSetMinHeight?: number;
72
+ tabSetMinWidth?: number;
73
+ tabSetTabLocation?: ITabLocation;
74
+ tabSetTabStripHeight?: number;
75
+ }
76
+ export interface IRowAttributes {
77
+ height?: number;
78
+ id?: string;
79
+ type: "row";
80
+ weight?: number;
81
+ width?: number;
82
+ }
83
+ export interface ITabSetAttributes {
84
+ autoSelectTab?: boolean;
85
+ borderInsets?: IInsets;
86
+ classNameHeader?: string;
87
+ classNameTabStrip?: string;
88
+ config?: any;
89
+ enableClose?: boolean;
90
+ enableDeleteWhenEmpty?: boolean;
91
+ enableDivide?: boolean;
92
+ enableDrag?: boolean;
93
+ enableDrop?: boolean;
94
+ enableMaximize?: boolean;
95
+ enableTabStrip?: boolean;
96
+ headerHeight?: number;
97
+ height?: number;
98
+ id?: string;
99
+ marginInsets?: IInsets;
100
+ minHeight?: number;
101
+ minWidth?: number;
102
+ name?: string;
103
+ selected?: number;
104
+ tabLocation?: ITabLocation;
105
+ tabStripHeight?: number;
106
+ type: "tabset";
107
+ weight?: number;
108
+ width?: number;
109
+ maximized?: boolean;
110
+ active?: boolean;
111
+ }
112
+ export interface ITabAttributes {
113
+ altName?: string;
114
+ borderHeight?: number;
115
+ borderWidth?: number;
116
+ className?: string;
117
+ closeType?: ICloseType;
118
+ component?: string;
119
+ config?: any;
120
+ contentClassName?: string;
121
+ enableClose?: boolean;
122
+ enableDrag?: boolean;
123
+ enableFloat?: boolean;
124
+ enableRename?: boolean;
125
+ enableRenderOnDemand?: boolean;
126
+ floating?: boolean;
127
+ helpText?: string;
128
+ icon?: string;
129
+ id?: string;
130
+ name?: string;
131
+ type?: string;
132
+ }
133
+ export interface IBorderAttributes {
134
+ autoSelectTabWhenClosed?: boolean;
135
+ autoSelectTabWhenOpen?: boolean;
136
+ barSize?: number;
137
+ className?: string;
138
+ config?: any;
139
+ enableAutoHide?: boolean;
140
+ enableDrop?: boolean;
141
+ minSize?: number;
142
+ selected?: number;
143
+ show?: boolean;
144
+ size?: number;
145
+ type: "border";
146
+ }
@@ -0,0 +1,86 @@
1
+ import { DropInfo } from "../DropInfo";
2
+ import { Action } from "./Action";
3
+ import { BorderSet } from "./BorderSet";
4
+ import { IJsonModel, ITabSetAttributes } from "./IJsonModel";
5
+ import { Node } from "./Node";
6
+ import { RowNode } from "./RowNode";
7
+ import { TabNode } from "./TabNode";
8
+ import { TabSetNode } from "./TabSetNode";
9
+ /**
10
+ * Class containing the Tree of Nodes used by the FlexLayout component
11
+ */
12
+ export declare class Model {
13
+ /**
14
+ * Loads the model from the given json object
15
+ * @param json the json model to load
16
+ * @returns {Model} a new Model object
17
+ */
18
+ static fromJson(json: IJsonModel): Model;
19
+ /**
20
+ * Get the currently active tabset node
21
+ */
22
+ getActiveTabset(): TabSetNode | undefined;
23
+ /**
24
+ * Get the currently maximized tabset node
25
+ */
26
+ getMaximizedTabset(): TabSetNode | undefined;
27
+ /**
28
+ * Gets the root RowNode of the model
29
+ * @returns {RowNode}
30
+ */
31
+ getRoot(): RowNode;
32
+ isRootOrientationVertical(): boolean;
33
+ isUseVisibility(): boolean;
34
+ isEnableRotateBorderIcons(): boolean;
35
+ /**
36
+ * Gets the
37
+ * @returns {BorderSet|*}
38
+ */
39
+ getBorderSet(): BorderSet;
40
+ /**
41
+ * Visits all the nodes in the model and calls the given function for each
42
+ * @param fn a function that takes visited node and a integer level as parameters
43
+ */
44
+ visitNodes(fn: (node: Node, level: number) => void): void;
45
+ /**
46
+ * Gets a node by its id
47
+ * @param id the id to find
48
+ */
49
+ getNodeById(id: string): Node | undefined;
50
+ /**
51
+ * Finds the first/top left tab set of the given node.
52
+ * @param node The top node you want to begin searching from, deafults to the root node
53
+ * @returns The first Tab Set
54
+ */
55
+ getFirstTabSet(node?: Node): Node;
56
+ /**
57
+ * Update the node tree by performing the given action,
58
+ * Actions should be generated via static methods on the Actions class
59
+ * @param action the action to perform
60
+ * @returns added Node for Actions.addNode; undefined otherwise
61
+ */
62
+ doAction(action: Action): Node | undefined;
63
+ /**
64
+ * Converts the model to a json object
65
+ * @returns {IJsonModel} json object that represents this model
66
+ */
67
+ toJson(): IJsonModel;
68
+ getSplitterSize(): number;
69
+ isLegacyOverflowMenu(): boolean;
70
+ getSplitterExtra(): number;
71
+ isEnableEdgeDock(): boolean;
72
+ /**
73
+ * Sets a function to allow/deny dropping a node
74
+ * @param onAllowDrop function that takes the drag node and DropInfo and returns true if the drop is allowed
75
+ */
76
+ setOnAllowDrop(onAllowDrop: (dragNode: Node, dropInfo: DropInfo) => boolean): void;
77
+ /**
78
+ * set callback called when a new TabSet is created.
79
+ * The tabNode can be undefined if it's the auto created first tabset in the root row (when the last
80
+ * tab is deleted, the root tabset can be recreated)
81
+ * @param onCreateTabSet
82
+ */
83
+ setOnCreateTabSet(onCreateTabSet: (tabNode?: TabNode) => ITabSetAttributes): void;
84
+ static toTypescriptInterfaces(): void;
85
+ toString(): string;
86
+ }
@@ -0,0 +1,17 @@
1
+ import { Orientation } from "../Orientation";
2
+ import { Rect } from "../Rect";
3
+ import { IJsonBorderNode, IJsonRowNode, IJsonTabNode, IJsonTabSetNode } from "./IJsonModel";
4
+ import { Model } from "./Model";
5
+ export declare abstract class Node {
6
+ getId(): string;
7
+ getModel(): Model;
8
+ getType(): string;
9
+ getParent(): Node | undefined;
10
+ getChildren(): Node[];
11
+ getRect(): Rect;
12
+ isVisible(): boolean;
13
+ getOrientation(): Orientation;
14
+ setEventListener(event: string, callback: (params: any) => void): void;
15
+ removeEventListener(event: string): void;
16
+ abstract toJson(): IJsonRowNode | IJsonBorderNode | IJsonTabSetNode | IJsonTabNode | undefined;
17
+ }
@@ -0,0 +1,11 @@
1
+ import { IDropTarget } from "./IDropTarget";
2
+ import { IJsonRowNode } from "./IJsonModel";
3
+ import { Node } from "./Node";
4
+ export declare class RowNode extends Node implements IDropTarget {
5
+ static readonly TYPE = "row";
6
+ getWeight(): number;
7
+ getWidth(): number | undefined;
8
+ getHeight(): number | undefined;
9
+ toJson(): IJsonRowNode;
10
+ isEnableDrop(): boolean;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { Node } from "./Node";
2
+ export declare class SplitterNode extends Node {
3
+ static readonly TYPE: string;
4
+ toJson(): undefined;
5
+ }
@@ -0,0 +1,36 @@
1
+ import { Rect } from "../Rect";
2
+ import { IDraggable } from "./IDraggable";
3
+ import { IJsonTabNode } from "./IJsonModel";
4
+ import { Node } from "./Node";
5
+ export declare class TabNode extends Node implements IDraggable {
6
+ static readonly TYPE = "tab";
7
+ getWindow(): Window | undefined;
8
+ getTabRect(): Rect | undefined;
9
+ getName(): string;
10
+ getHelpText(): string | undefined;
11
+ getComponent(): string | undefined;
12
+ /**
13
+ * Returns the config attribute that can be used to store node specific data that
14
+ * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
15
+ * than directly, for example:
16
+ * this.state.model.doAction(
17
+ * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
18
+ */
19
+ getConfig(): any;
20
+ /**
21
+ * Returns an object that can be used to store transient node specific data that will
22
+ * NOT be saved in the json.
23
+ */
24
+ getExtraData(): Record<string, any>;
25
+ isFloating(): boolean;
26
+ getIcon(): string | undefined;
27
+ isEnableClose(): boolean;
28
+ getCloseType(): number;
29
+ isEnableFloat(): boolean;
30
+ isEnableDrag(): boolean;
31
+ isEnableRename(): boolean;
32
+ getClassName(): string | undefined;
33
+ getContentClassName(): string | undefined;
34
+ isEnableRenderOnDemand(): boolean;
35
+ toJson(): IJsonTabNode;
36
+ }
@@ -0,0 +1,40 @@
1
+ import { IDraggable } from "./IDraggable";
2
+ import { IDropTarget } from "./IDropTarget";
3
+ import { IJsonTabSetNode } from "./IJsonModel";
4
+ import { Node } from "./Node";
5
+ export declare class TabSetNode extends Node implements IDraggable, IDropTarget {
6
+ static readonly TYPE = "tabset";
7
+ getName(): string | undefined;
8
+ getSelected(): number;
9
+ getSelectedNode(): Node | undefined;
10
+ getWeight(): number;
11
+ getWidth(): number | undefined;
12
+ getMinWidth(): number;
13
+ getHeight(): number | undefined;
14
+ getMinHeight(): number;
15
+ /**
16
+ * Returns the config attribute that can be used to store node specific data that
17
+ * WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
18
+ * than directly, for example:
19
+ * this.state.model.doAction(
20
+ * FlexLayout.Actions.updateNodeAttributes(node.getId(), {config:myConfigObject}));
21
+ */
22
+ getConfig(): any;
23
+ isMaximized(): boolean;
24
+ isActive(): boolean;
25
+ isEnableDeleteWhenEmpty(): boolean;
26
+ isEnableDrop(): boolean;
27
+ isEnableDrag(): boolean;
28
+ isEnableDivide(): boolean;
29
+ isEnableMaximize(): boolean;
30
+ isEnableClose(): boolean;
31
+ canMaximize(): boolean;
32
+ isEnableTabStrip(): boolean;
33
+ isAutoSelectTab(): boolean;
34
+ getClassNameTabStrip(): string | undefined;
35
+ getClassNameHeader(): string | undefined;
36
+ getHeaderHeight(): number;
37
+ getTabStripHeight(): number;
38
+ getTabLocation(): string;
39
+ toJson(): IJsonTabSetNode;
40
+ }
@@ -0,0 +1 @@
1
+ export declare function randomUUID(): any;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const CloseIcon: () => JSX.Element;
3
+ export declare const MaximizeIcon: () => JSX.Element;
4
+ export declare const OverflowIcon: () => JSX.Element;
5
+ export declare const PopoutIcon: () => JSX.Element;
6
+ export declare const RestoreIcon: () => JSX.Element;