flexlayout-react 0.8.18 → 0.9.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.
- package/README.md +144 -206
- package/dist/index.js +6451 -6398
- package/package.json +31 -34
- package/style/_base.scss +109 -33
- package/style/_themes.scss +720 -49
- package/style/alpha_dark.css +862 -0
- package/style/alpha_dark.css.map +1 -0
- package/style/alpha_dark.scss +6 -0
- package/style/alpha_light.css +856 -0
- package/style/alpha_light.css.map +1 -0
- package/style/alpha_light.scss +6 -0
- package/style/alpha_rounded.css +811 -0
- package/style/alpha_rounded.css.map +1 -0
- package/style/alpha_rounded.scss +6 -0
- package/style/combined.css +569 -44
- package/style/combined.css.map +1 -1
- package/style/combined.scss +25 -1
- package/style/dark.css +95 -22
- package/style/dark.css.map +1 -1
- package/style/gray.css +96 -23
- package/style/gray.css.map +1 -1
- package/style/light.css +96 -20
- package/style/light.css.map +1 -1
- package/style/rounded.css +107 -25
- package/style/rounded.css.map +1 -1
- package/style/underline.css +99 -22
- package/style/underline.css.map +1 -1
- package/types/index.d.ts +14 -14
- package/types/model/Actions.d.ts +62 -31
- package/types/model/Attributes.d.ts +42 -0
- package/types/model/BorderNode.d.ts +11 -11
- package/types/model/BorderSet.d.ts +2 -2
- package/types/{DropInfo.d.ts → model/DropInfo.d.ts} +2 -2
- package/types/model/IDropTarget.d.ts +2 -2
- package/types/model/IJsonModel.d.ts +70 -48
- package/types/model/Layout.d.ts +41 -0
- package/types/model/Model.d.ts +31 -26
- package/types/model/Node.d.ts +18 -10
- package/types/{Rect.d.ts → model/Rect.d.ts} +6 -3
- package/types/model/RowNode.d.ts +15 -14
- package/types/model/TabNode.d.ts +15 -21
- package/types/model/TabSetNode.d.ts +15 -21
- package/types/view/BorderButton.d.ts +4 -3
- package/types/view/BorderTab.d.ts +3 -3
- package/types/view/BorderTabSet.d.ts +3 -3
- package/types/{Types.d.ts → view/CSSClassNames.d.ts} +9 -2
- package/types/view/DragContainer.d.ts +6 -4
- package/types/view/FloatWindow.d.ts +11 -0
- package/types/{I18nLabel.d.ts → view/I18nLabel.d.ts} +1 -0
- package/types/view/Icons.d.ts +1 -0
- package/types/view/Layout.d.ts +34 -212
- package/types/view/Overlay.d.ts +2 -2
- package/types/view/PopoutWindow.d.ts +6 -6
- package/types/view/PopupMenu.d.ts +2 -2
- package/types/view/Row.d.ts +3 -3
- package/types/view/Splitter.d.ts +2 -4
- package/types/view/Tab.d.ts +3 -4
- package/types/view/TabButton.d.ts +3 -3
- package/types/view/TabButtonStamp.d.ts +3 -3
- package/types/view/TabContentRenderer.d.ts +14 -0
- package/types/view/TabLayout.d.ts +12 -0
- package/types/view/TabOverflowHook.d.ts +3 -3
- package/types/view/TabSet.d.ts +3 -3
- package/types/view/Utils.d.ts +7 -4
- package/types/view/layout/BorderContainer.d.ts +7 -0
- package/types/view/layout/DragDropManager.d.ts +48 -0
- package/types/view/layout/EdgeIndicators.d.ts +5 -0
- package/types/view/layout/FloatingWindowContainer.d.ts +5 -0
- package/types/view/layout/LayoutInternal.d.ts +151 -0
- package/types/view/layout/LayoutTypes.d.ts +51 -0
- package/types/Attribute.d.ts +0 -25
- package/types/AttributeDefinitions.d.ts +0 -18
- package/types/model/Action.d.ts +0 -5
- package/types/model/LayoutWindow.d.ts +0 -44
- package/types/view/SizeTracker.d.ts +0 -13
- /package/types/{DockLocation.d.ts → model/DockLocation.d.ts} +0 -0
- /package/types/{Orientation.d.ts → model/Orientation.d.ts} +0 -0
package/types/model/TabNode.d.ts
CHANGED
|
@@ -1,38 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Rect } from "
|
|
1
|
+
import { Attributes } from "./Attributes";
|
|
2
|
+
import { Rect } from "./Rect";
|
|
3
3
|
import { IDraggable } from "./IDraggable";
|
|
4
|
-
import { IJsonTabNode } from "./IJsonModel";
|
|
4
|
+
import { IJsonTabNode, ITabAttributes } from "./IJsonModel";
|
|
5
5
|
import { Model } from "./Model";
|
|
6
6
|
import { Node } from "./Node";
|
|
7
7
|
export declare class TabNode extends Node implements IDraggable {
|
|
8
8
|
static readonly TYPE = "tab";
|
|
9
9
|
/** @internal */
|
|
10
|
-
static fromJson(json:
|
|
11
|
-
/** @internal */
|
|
10
|
+
static fromJson(json: IJsonTabNode, model: Model, addToModel?: boolean): TabNode;
|
|
12
11
|
private tabRect;
|
|
13
|
-
/** @internal */
|
|
14
12
|
private moveableElement;
|
|
15
|
-
/** @internal */
|
|
16
|
-
private tabStamp;
|
|
17
|
-
/** @internal */
|
|
18
13
|
private renderedName?;
|
|
19
|
-
/** @internal */
|
|
20
14
|
private extra;
|
|
21
|
-
/** @internal */
|
|
22
15
|
private visible;
|
|
23
|
-
/** @internal */
|
|
24
16
|
private rendered;
|
|
25
|
-
/** @internal */
|
|
26
17
|
private scrollTop?;
|
|
27
|
-
/** @internal */
|
|
28
18
|
private scrollLeft?;
|
|
19
|
+
private tabStamp;
|
|
29
20
|
/** @internal */
|
|
30
|
-
constructor(model: Model, json:
|
|
21
|
+
constructor(model: Model, json: IJsonTabNode, addToModel?: boolean);
|
|
31
22
|
getName(): string;
|
|
23
|
+
getIcon(): string | undefined;
|
|
24
|
+
getSubLayoutId(): string | undefined;
|
|
32
25
|
getHelpText(): string | undefined;
|
|
33
26
|
getComponent(): string | undefined;
|
|
34
|
-
getWindowId(): string;
|
|
35
|
-
getWindow(): Window | undefined;
|
|
27
|
+
getWindowId(): string | undefined;
|
|
36
28
|
/**
|
|
37
29
|
* Returns the config attribute that can be used to store node specific data that
|
|
38
30
|
* WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
|
|
@@ -48,11 +40,13 @@ export declare class TabNode extends Node implements IDraggable {
|
|
|
48
40
|
getExtraData(): Record<string, any>;
|
|
49
41
|
isPoppedOut(): boolean;
|
|
50
42
|
isSelected(): boolean;
|
|
51
|
-
|
|
43
|
+
isCloseable(): boolean;
|
|
44
|
+
isAllowedInWindow(): boolean;
|
|
52
45
|
isEnableClose(): boolean;
|
|
53
46
|
getCloseType(): number;
|
|
54
47
|
isEnablePopout(): boolean;
|
|
55
48
|
isEnablePopoutIcon(): boolean;
|
|
49
|
+
isEnablePopoutFloatIcon(): boolean;
|
|
56
50
|
isEnablePopoutOverlay(): boolean;
|
|
57
51
|
isEnableDrag(): boolean;
|
|
58
52
|
isEnableRename(): boolean;
|
|
@@ -108,15 +102,15 @@ export declare class TabNode extends Node implements IDraggable {
|
|
|
108
102
|
/** @internal */
|
|
109
103
|
delete(): void;
|
|
110
104
|
/** @internal */
|
|
111
|
-
updateAttrs(json:
|
|
105
|
+
updateAttrs(json: ITabAttributes): void;
|
|
112
106
|
/** @internal */
|
|
113
|
-
getAttributeDefinitions():
|
|
107
|
+
getAttributeDefinitions(): Attributes;
|
|
114
108
|
/** @internal */
|
|
115
109
|
setBorderWidth(width: number): void;
|
|
116
110
|
/** @internal */
|
|
117
111
|
setBorderHeight(height: number): void;
|
|
118
112
|
/** @internal */
|
|
119
|
-
static getAttributeDefinitions():
|
|
113
|
+
static getAttributeDefinitions(): Attributes;
|
|
120
114
|
/** @internal */
|
|
121
115
|
private static attributeDefinitions;
|
|
122
116
|
/** @internal */
|
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DockLocation } from "
|
|
3
|
-
import { DropInfo } from "
|
|
4
|
-
import { Orientation } from "
|
|
5
|
-
import { Rect } from "
|
|
1
|
+
import { Attributes } from "./Attributes";
|
|
2
|
+
import { DockLocation } from "./DockLocation";
|
|
3
|
+
import { DropInfo } from "./DropInfo";
|
|
4
|
+
import { Orientation } from "./Orientation";
|
|
5
|
+
import { Rect } from "./Rect";
|
|
6
6
|
import { IDraggable } from "./IDraggable";
|
|
7
7
|
import { IDropTarget } from "./IDropTarget";
|
|
8
|
-
import { IJsonTabSetNode } from "./IJsonModel";
|
|
9
|
-
import {
|
|
8
|
+
import { IJsonTabSetNode, ITabSetAttributes } from "./IJsonModel";
|
|
9
|
+
import { Layout } from "./Layout";
|
|
10
10
|
import { Model } from "./Model";
|
|
11
11
|
import { Node } from "./Node";
|
|
12
12
|
import { TabNode } from "./TabNode";
|
|
13
13
|
export declare class TabSetNode extends Node implements IDraggable, IDropTarget {
|
|
14
14
|
static readonly TYPE = "tabset";
|
|
15
15
|
/** @internal */
|
|
16
|
-
static fromJson(json:
|
|
17
|
-
/** @internal */
|
|
16
|
+
static fromJson(json: IJsonTabSetNode, model: Model, layout: Layout): TabSetNode;
|
|
18
17
|
private static attributeDefinitions;
|
|
19
|
-
/** @internal */
|
|
20
18
|
private tabStripRect;
|
|
21
|
-
/** @internal */
|
|
22
19
|
private contentRect;
|
|
23
|
-
/** @internal */
|
|
24
20
|
private calculatedMinHeight;
|
|
25
|
-
/** @internal */
|
|
26
21
|
private calculatedMinWidth;
|
|
27
|
-
/** @internal */
|
|
28
22
|
private calculatedMaxHeight;
|
|
29
|
-
/** @internal */
|
|
30
23
|
private calculatedMaxWidth;
|
|
31
24
|
/** @internal */
|
|
32
|
-
constructor(model: Model, json:
|
|
25
|
+
constructor(model: Model, json: IJsonTabSetNode);
|
|
33
26
|
getName(): string | undefined;
|
|
34
27
|
isEnableActiveIcon(): boolean;
|
|
35
28
|
getSelected(): number;
|
|
@@ -47,6 +40,7 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
47
40
|
getMaxHeight(): number;
|
|
48
41
|
/** @internal */
|
|
49
42
|
getMaxSize(orientation: Orientation): number;
|
|
43
|
+
isCloseable(): boolean;
|
|
50
44
|
/**
|
|
51
45
|
* Returns the config attribute that can be used to store node specific data that
|
|
52
46
|
* WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
|
|
@@ -59,13 +53,14 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
59
53
|
isActive(): boolean;
|
|
60
54
|
isEnableDeleteWhenEmpty(): boolean;
|
|
61
55
|
isEnableDrop(): boolean;
|
|
56
|
+
isEnableTabStrip(): boolean;
|
|
62
57
|
isEnableTabWrap(): boolean;
|
|
63
58
|
isEnableDrag(): boolean;
|
|
64
59
|
isEnableDivide(): boolean;
|
|
65
60
|
isEnableMaximize(): boolean;
|
|
66
61
|
isEnableClose(): boolean;
|
|
62
|
+
isEnableCloseButton(): boolean;
|
|
67
63
|
isEnableSingleTabStretch(): boolean;
|
|
68
|
-
isEnableTabStrip(): boolean;
|
|
69
64
|
isAutoSelectTab(): boolean;
|
|
70
65
|
isEnableTabScrollbar(): boolean;
|
|
71
66
|
getClassNameTabStrip(): string | undefined;
|
|
@@ -85,7 +80,6 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
85
80
|
setWeight(weight: number): void;
|
|
86
81
|
/** @internal */
|
|
87
82
|
setSelected(index: number): void;
|
|
88
|
-
getWindowId(): string;
|
|
89
83
|
/** @internal */
|
|
90
84
|
canDrop(dragNode: Node & IDraggable, x: number, y: number): DropInfo | undefined;
|
|
91
85
|
/** @internal */
|
|
@@ -95,11 +89,11 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
95
89
|
/** @internal */
|
|
96
90
|
drop(dragNode: Node, location: DockLocation, index: number, select?: boolean): void;
|
|
97
91
|
/** @internal */
|
|
98
|
-
updateAttrs(json:
|
|
92
|
+
updateAttrs(json: ITabSetAttributes): void;
|
|
99
93
|
/** @internal */
|
|
100
|
-
getAttributeDefinitions():
|
|
94
|
+
getAttributeDefinitions(): Attributes;
|
|
101
95
|
/** @internal */
|
|
102
|
-
static getAttributeDefinitions():
|
|
96
|
+
static getAttributeDefinitions(): Attributes;
|
|
103
97
|
/** @internal */
|
|
104
98
|
private static createAttributeDefinitions;
|
|
105
99
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TabNode } from "../model/TabNode";
|
|
2
|
-
import { IIcons
|
|
2
|
+
import { IIcons } from "../view/layout/LayoutTypes";
|
|
3
|
+
import { LayoutController } from "../view/layout/LayoutInternal";
|
|
3
4
|
/** @internal */
|
|
4
5
|
export interface IBorderButtonProps {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
controller: LayoutController;
|
|
7
|
+
tabNode: TabNode;
|
|
7
8
|
selected: boolean;
|
|
8
9
|
border: string;
|
|
9
10
|
icons: IIcons;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
2
2
|
import { BorderNode } from "../model/BorderNode";
|
|
3
3
|
/** @internal */
|
|
4
4
|
export interface IBorderTabProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
controller: LayoutController;
|
|
6
|
+
borderNode: BorderNode;
|
|
7
7
|
show: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare function BorderTab(props: IBorderTabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BorderNode } from "../model/BorderNode";
|
|
2
|
-
import {
|
|
2
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
3
|
/** @internal */
|
|
4
4
|
export interface IBorderTabSetProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
borderNode: BorderNode;
|
|
6
|
+
controller: LayoutController;
|
|
7
7
|
size: number;
|
|
8
8
|
}
|
|
9
9
|
/** @internal */
|
|
@@ -30,6 +30,9 @@ export declare enum CLASSES {
|
|
|
30
30
|
FLEXLAYOUT__EDGE_RECT_RIGHT = "flexlayout__edge_rect_right",
|
|
31
31
|
FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER = "flexlayout__error_boundary_container",
|
|
32
32
|
FLEXLAYOUT__ERROR_BOUNDARY_CONTENT = "flexlayout__error_boundary_content",
|
|
33
|
+
FLEXLAYOUT__FLOAT_WINDOW = "flexlayout__float_window",
|
|
34
|
+
FLEXLAYOUT__FLOAT_WINDOW_HEADER = "flexlayout__float_window_header",
|
|
35
|
+
FLEXLAYOUT__FLOAT_WINDOW_CONTENT = "flexlayout__float_window_content",
|
|
33
36
|
FLEXLAYOUT__FLOATING_WINDOW_CONTENT = "flexlayout__floating_window_content",
|
|
34
37
|
FLEXLAYOUT__LAYOUT = "flexlayout__layout",
|
|
35
38
|
FLEXLAYOUT__LAYOUT_MOVEABLES = "flexlayout__layout_moveables",
|
|
@@ -53,13 +56,17 @@ export declare enum CLASSES {
|
|
|
53
56
|
FLEXLAYOUT__TAB_POSITION = "flexlayout__tab_position",
|
|
54
57
|
FLEXLAYOUT__TAB_MOVEABLE = "flexlayout__tab_moveable",
|
|
55
58
|
FLEXLAYOUT__TAB_OVERLAY = "flexlayout__tab_overlay",
|
|
59
|
+
FLEXLAYOUT__TAB_LAYOUT_CONTAINER = "flexlayout__tab_layout_container",
|
|
60
|
+
FLEXLAYOUT__TAB_LAYOUT_CONTAINER_USER = "flexlayout__tab_layout_container_user",
|
|
56
61
|
FLEXLAYOUT__TABSET = "flexlayout__tabset",
|
|
57
62
|
FLEXLAYOUT__TABSET_CONTAINER = "flexlayout__tabset_container",
|
|
58
|
-
FLEXLAYOUT__TABSET_HEADER = "flexlayout__tabset_header",
|
|
59
|
-
FLEXLAYOUT__TABSET_HEADER_CONTENT = "flexlayout__tabset_header_content",
|
|
60
63
|
FLEXLAYOUT__TABSET_MAXIMIZED = "flexlayout__tabset-maximized",
|
|
61
64
|
FLEXLAYOUT__TABSET_SELECTED = "flexlayout__tabset-selected",
|
|
65
|
+
FLEXLAYOUT__TABSET_TAB_SPACER = "flexlayout__tabset_tab_spacer",
|
|
62
66
|
FLEXLAYOUT__TABSET_TAB_DIVIDER = "flexlayout__tabset_tab_divider",
|
|
67
|
+
FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_BEFORE = "flexlayout__tabset_tab_divider_selected_before",
|
|
68
|
+
FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_AFTER = "flexlayout__tabset_tab_divider_selected_after",
|
|
69
|
+
FLEXLAYOUT__TABSET_TAB_DIVIDER_INNER = "flexlayout__tabset_tab_divider_inner",
|
|
63
70
|
FLEXLAYOUT__TABSET_CONTENT = "flexlayout__tabset_content",
|
|
64
71
|
FLEXLAYOUT__TABSET_TABBAR_INNER = "flexlayout__tabset_tabbar_inner",
|
|
65
72
|
FLEXLAYOUT__TABSET_TABBAR_INNER_ = "flexlayout__tabset_tabbar_inner_",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { TabNode } from "../model/TabNode";
|
|
2
|
-
import {
|
|
3
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
4
|
/** @internal */
|
|
4
5
|
export interface IDragContainerProps {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
tabNode: TabNode;
|
|
7
|
+
controller: LayoutController;
|
|
8
|
+
dragging: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** @internal */
|
|
9
|
-
export declare const DragContainer: (props: IDragContainerProps) => import("react/jsx-runtime").JSX.Element
|
|
11
|
+
export declare const DragContainer: React.MemoExoticComponent<(props: IDragContainerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
|
+
import { Layout } from "../model/Layout";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export interface IFloatWindowProps {
|
|
6
|
+
controller: LayoutController;
|
|
7
|
+
layout: Layout;
|
|
8
|
+
onCloseLayout: (layout: Layout) => void;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const FloatWindow: (props: React.PropsWithChildren<IFloatWindowProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ export declare enum I18nLabel {
|
|
|
7
7
|
Maximize = "Maximize tab set",
|
|
8
8
|
Restore = "Restore tab set",
|
|
9
9
|
Popout_Tab = "Popout selected tab",
|
|
10
|
+
Popout_Tab_Float = "Float selected tab",
|
|
10
11
|
Overflow_Menu_Tooltip = "Hidden tabs",
|
|
11
12
|
Error_rendering_component = "Error rendering component",
|
|
12
13
|
Error_rendering_component_retry = "Retry"
|
package/types/view/Icons.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const MaximizeIcon: () => import("react/jsx-runtime").JSX.Element
|
|
|
3
3
|
export declare const OverflowIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const EdgeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare const PopoutIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const PopoutFloatIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export declare const RestoreIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare const AsterickIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare const AddIcon: () => import("react/jsx-runtime").JSX.Element;
|
package/types/view/Layout.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DockLocation } from "../DockLocation";
|
|
3
|
-
import { I18nLabel } from "../I18nLabel";
|
|
4
|
-
import { Rect } from "../Rect";
|
|
5
|
-
import { Action } from "../model/Action";
|
|
6
|
-
import { BorderNode } from "../model/BorderNode";
|
|
7
|
-
import { IDraggable } from "../model/IDraggable";
|
|
8
|
-
import { IJsonTabNode } from "../model/IJsonModel";
|
|
9
|
-
import { Model } from "../model/Model";
|
|
10
|
-
import { Node } from "../model/Node";
|
|
11
2
|
import { TabNode } from "../model/TabNode";
|
|
12
3
|
import { TabSetNode } from "../model/TabSetNode";
|
|
13
|
-
import {
|
|
4
|
+
import { IJsonTabNode } from "../model/IJsonModel";
|
|
5
|
+
import { Node } from "../model/Node";
|
|
6
|
+
import { Action } from "../model/Actions";
|
|
7
|
+
import { BorderNode } from "../model/BorderNode";
|
|
8
|
+
import { Model } from "../model/Model";
|
|
9
|
+
import { I18nLabel } from "./I18nLabel";
|
|
10
|
+
import { DragRectRenderCallback, NodeMouseEvent, ShowOverflowMenuCallback, TabSetPlaceHolderCallback, ITabSetRenderValues, ITabRenderValues, IIcons } from "./layout/LayoutTypes";
|
|
14
11
|
export interface ILayoutProps {
|
|
15
12
|
/** the model for this layout */
|
|
16
13
|
model: Model;
|
|
@@ -30,7 +27,7 @@ export interface ILayoutProps {
|
|
|
30
27
|
onModelChange?: (model: Model, action: Action) => void;
|
|
31
28
|
/** function called when an external object (not a tab) gets dragged onto the layout, with a single dragenter argument. Should return either undefined to reject the drag/drop or an object with keys dragText, jsonDrop, to create a tab via drag (similar to a call to addTabToTabSet). Function onDropis passed the added tabNodeand thedrop DragEvent`, unless the drag was canceled. */
|
|
32
29
|
onExternalDrag?: (event: React.DragEvent<HTMLElement>) => undefined | {
|
|
33
|
-
json:
|
|
30
|
+
json: IJsonTabNode;
|
|
34
31
|
onDrop?: (node?: Node, event?: React.DragEvent<HTMLElement>) => void;
|
|
35
32
|
};
|
|
36
33
|
/** function called with default css class name, return value is class name that will be used. Mainly for use with css modules. */
|
|
@@ -55,25 +52,18 @@ export interface ILayoutProps {
|
|
|
55
52
|
onTabSetPlaceHolder?: TabSetPlaceHolderCallback;
|
|
56
53
|
/** Name given to popout windows, defaults to 'Popout Window' */
|
|
57
54
|
popoutWindowName?: string;
|
|
55
|
+
/** the transition speed of the drag rectangle from one position to another, default is 0.3 secs */
|
|
56
|
+
tabDragSpeed?: number;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
* A React component that hosts a multi-tabbed layout
|
|
61
|
-
*/
|
|
62
|
-
export declare class Layout extends React.Component<ILayoutProps> {
|
|
63
|
-
/** @internal */
|
|
64
|
-
private selfRef;
|
|
65
|
-
/** @internal */
|
|
66
|
-
private revision;
|
|
67
|
-
/** @internal */
|
|
68
|
-
constructor(props: ILayoutProps);
|
|
58
|
+
export interface ILayoutApi {
|
|
69
59
|
/** re-render the layout */
|
|
70
60
|
redraw(): void;
|
|
71
61
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
* Adds a new tab to the given tabset
|
|
63
|
+
* @param tabsetId the id of the tabset where the new tab will be added
|
|
64
|
+
* @param json the json for the new tab node
|
|
65
|
+
* @returns the added tab node or undefined
|
|
66
|
+
*/
|
|
77
67
|
addTabToTabSet(tabsetId: string, json: IJsonTabNode): TabNode | undefined;
|
|
78
68
|
/**
|
|
79
69
|
* Adds a new tab by dragging an item to the drop location, must be called from within an HTML
|
|
@@ -92,195 +82,27 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
92
82
|
*/
|
|
93
83
|
moveTabWithDragAndDrop(event: DragEvent, node: (TabNode | TabSetNode)): void;
|
|
94
84
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
* Adds a new tab to the active tabset (if there is one)
|
|
86
|
+
* @param json the json for the new tab node
|
|
87
|
+
* @returns the added tab node or undefined
|
|
88
|
+
*/
|
|
99
89
|
addTabToActiveTabSet(json: IJsonTabNode): TabNode | undefined;
|
|
100
90
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
* Sets the drag image from a react component for a drag event
|
|
92
|
+
* @param event the drag event
|
|
93
|
+
* @param component the react component to be used for the drag image
|
|
94
|
+
* @param x the x position of the drag cursor on the image
|
|
95
|
+
* @param y the x position of the drag cursor on the image
|
|
96
|
+
*/
|
|
107
97
|
setDragComponent(event: DragEvent, component: React.ReactNode, x: number, y: number): void;
|
|
108
98
|
/** Get the root div element of the layout */
|
|
109
|
-
getRootDiv(): HTMLDivElement | null;
|
|
110
|
-
/** @internal */
|
|
111
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
112
|
-
}
|
|
113
|
-
/** @internal */
|
|
114
|
-
interface ILayoutInternalProps extends ILayoutProps {
|
|
115
|
-
renderRevision: number;
|
|
116
|
-
windowId?: string;
|
|
117
|
-
mainLayout?: LayoutInternal;
|
|
118
|
-
}
|
|
119
|
-
/** @internal */
|
|
120
|
-
interface ILayoutInternalState {
|
|
121
|
-
rect: Rect;
|
|
122
|
-
editingTab?: TabNode;
|
|
123
|
-
portal?: React.ReactPortal;
|
|
124
|
-
showEdges: boolean;
|
|
125
|
-
showOverlay: boolean;
|
|
126
|
-
calculatedBorderBarSize: number;
|
|
127
|
-
layoutRevision: number;
|
|
128
|
-
forceRevision: number;
|
|
129
|
-
showHiddenBorder: DockLocation;
|
|
130
|
-
}
|
|
131
|
-
/** @internal */
|
|
132
|
-
export declare class LayoutInternal extends React.Component<ILayoutInternalProps, ILayoutInternalState> {
|
|
133
|
-
static dragState: DragState | undefined;
|
|
134
|
-
private selfRef;
|
|
135
|
-
private moveablesRef;
|
|
136
|
-
private findBorderBarSizeRef;
|
|
137
|
-
private mainRef;
|
|
138
|
-
private previousModel?;
|
|
139
|
-
private orderedTabIds;
|
|
140
|
-
private orderedTabMoveableIds;
|
|
141
|
-
private moveableElementMap;
|
|
142
|
-
private dropInfo;
|
|
143
|
-
private outlineDiv?;
|
|
144
|
-
private currentDocument?;
|
|
145
|
-
private currentWindow?;
|
|
146
|
-
private supportsPopout;
|
|
147
|
-
private popoutURL;
|
|
148
|
-
private icons;
|
|
149
|
-
private resizeObserver?;
|
|
150
|
-
private dragEnterCount;
|
|
151
|
-
private dragging;
|
|
152
|
-
private windowId;
|
|
153
|
-
private layoutWindow;
|
|
154
|
-
private mainLayout;
|
|
155
|
-
private isMainWindow;
|
|
156
|
-
private isDraggingOverWindow;
|
|
157
|
-
private styleObserver;
|
|
158
|
-
private popoutWindowName;
|
|
159
|
-
constructor(props: ILayoutInternalProps);
|
|
160
|
-
componentDidMount(): void;
|
|
161
|
-
componentDidUpdate(): void;
|
|
162
|
-
componentWillUnmount(): void;
|
|
163
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
164
|
-
renderBorders(inner: React.ReactNode): import("react/jsx-runtime").JSX.Element;
|
|
165
|
-
renderLayout(): import("react/jsx-runtime").JSX.Element;
|
|
166
|
-
renderEdgeIndicators(): React.ReactNode[];
|
|
167
|
-
renderWindows(): React.ReactNode[];
|
|
168
|
-
renderTabMoveables(): Map<string, React.ReactNode>;
|
|
169
|
-
renderTabStamps(): React.ReactNode[];
|
|
170
|
-
renderTabs(): Map<string, React.ReactNode>;
|
|
171
|
-
renderMetricsElements(): import("react/jsx-runtime").JSX.Element;
|
|
172
|
-
checkForBorderToShow(x: number, y: number): void;
|
|
173
|
-
updateLayoutMetrics: () => void;
|
|
174
|
-
tidyMoveablesMap(): void;
|
|
175
|
-
reorderComponents(components: Map<string, React.ReactNode>, ids: string[]): React.ReactNode[];
|
|
176
|
-
onModelChange: (action: Action) => void;
|
|
177
|
-
redraw(type?: string): void;
|
|
178
|
-
redrawInternal(type: string): void;
|
|
179
|
-
doAction(action: Action): Node | undefined;
|
|
180
|
-
updateRect: () => void;
|
|
181
|
-
getBoundingClientRect(div: HTMLElement): Rect;
|
|
182
|
-
getMoveableContainer(): HTMLDivElement | null;
|
|
183
|
-
getMoveableElement(id: string): HTMLElement;
|
|
184
|
-
getMainLayout(): LayoutInternal;
|
|
185
|
-
getClassName: (defaultClassName: string) => string;
|
|
186
|
-
getCurrentDocument(): Document | undefined;
|
|
187
|
-
getDomRect(): Rect;
|
|
188
|
-
getWindowId(): string;
|
|
189
|
-
getRootDiv(): HTMLDivElement | null;
|
|
190
|
-
getMainElement(): HTMLDivElement | null;
|
|
191
|
-
getFactory(): (node: TabNode) => React.ReactNode;
|
|
192
|
-
isSupportsPopout(): boolean;
|
|
193
|
-
isRealtimeResize(): boolean;
|
|
194
|
-
getPopoutURL(): string;
|
|
195
|
-
setEditingTab(tabNode?: TabNode): void;
|
|
196
|
-
getEditingTab(): TabNode | undefined;
|
|
197
|
-
getModel(): Model;
|
|
198
|
-
onCloseWindow: (windowLayout: LayoutWindow) => void;
|
|
199
|
-
onSetWindow: (windowLayout: LayoutWindow, window: Window) => void;
|
|
200
|
-
getScreenRect(inRect: Rect): Rect;
|
|
201
|
-
addTabToTabSet(tabsetId: string, json: IJsonTabNode): TabNode | undefined;
|
|
202
|
-
addTabToActiveTabSet(json: IJsonTabNode): TabNode | undefined;
|
|
203
|
-
showControlInPortal: (control: React.ReactNode, element: HTMLElement) => void;
|
|
204
|
-
hideControlInPortal: () => void;
|
|
205
|
-
getIcons: () => IIcons;
|
|
206
|
-
maximize(tabsetNode: TabSetNode): void;
|
|
207
|
-
customizeTab(tabNode: TabNode, renderValues: ITabRenderValues): void;
|
|
208
|
-
customizeTabSet(tabSetNode: TabSetNode | BorderNode, renderValues: ITabSetRenderValues): void;
|
|
209
|
-
i18nName(id: I18nLabel, param?: string): string;
|
|
210
|
-
getShowOverflowMenu(): ShowOverflowMenuCallback | undefined;
|
|
211
|
-
getTabSetPlaceHolderCallback(): TabSetPlaceHolderCallback | undefined;
|
|
212
|
-
showContextMenu(node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>): void;
|
|
213
|
-
auxMouseClick(node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>): void;
|
|
214
|
-
showOverlay(show: boolean): void;
|
|
215
|
-
addTabWithDragAndDrop(event: DragEvent, json: IJsonTabNode, onDrop?: (node?: Node, event?: React.DragEvent<HTMLElement>) => void): void;
|
|
216
|
-
moveTabWithDragAndDrop(event: DragEvent, node: (TabNode | TabSetNode)): void;
|
|
217
|
-
setDragNode: (event: DragEvent, node: Node & IDraggable) => void;
|
|
218
|
-
setDragComponent(event: DragEvent, component: React.ReactNode, x: number, y: number): void;
|
|
219
|
-
setDraggingOverWindow(overWindow: boolean): void;
|
|
220
|
-
onDragEnterRaw: (event: React.DragEvent<HTMLElement>) => void;
|
|
221
|
-
onDragLeaveRaw: (event: React.DragEvent<HTMLElement>) => void;
|
|
222
|
-
clearDragMain(): void;
|
|
223
|
-
clearDragLocal(): void;
|
|
224
|
-
onDragEnter: (event: React.DragEvent<HTMLElement>) => void;
|
|
225
|
-
onDragOver: (event: React.DragEvent<HTMLElement>) => void;
|
|
226
|
-
onDragLeave: (event: React.DragEvent<HTMLElement>) => void;
|
|
227
|
-
onDrop: (event: React.DragEvent<HTMLElement>) => void;
|
|
99
|
+
getRootDiv(): HTMLDivElement | null | undefined;
|
|
228
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* A React component that hosts a multi-tabbed layout.
|
|
103
|
+
* @category Components
|
|
104
|
+
* @group Main Layout
|
|
105
|
+
*/
|
|
106
|
+
declare const Layout: React.ForwardRefExoticComponent<ILayoutProps & React.RefAttributes<ILayoutApi>>;
|
|
107
|
+
export { Layout };
|
|
229
108
|
export declare const FlexLayoutVersion: string;
|
|
230
|
-
export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
|
|
231
|
-
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
232
|
-
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {
|
|
233
|
-
index: number;
|
|
234
|
-
node: TabNode;
|
|
235
|
-
}[], onSelect: (item: {
|
|
236
|
-
index: number;
|
|
237
|
-
node: TabNode;
|
|
238
|
-
}) => void) => void;
|
|
239
|
-
export type TabSetPlaceHolderCallback = (node: TabSetNode) => React.ReactNode;
|
|
240
|
-
export interface ITabSetRenderValues {
|
|
241
|
-
/** a component to be placed before the tabs */
|
|
242
|
-
leading: React.ReactNode;
|
|
243
|
-
/** components that will be added after the tabs */
|
|
244
|
-
stickyButtons: React.ReactNode[];
|
|
245
|
-
/** components that will be added at the end of the tabset */
|
|
246
|
-
buttons: React.ReactNode[];
|
|
247
|
-
/** position to insert overflow button within [...stickyButtons, ...buttons]
|
|
248
|
-
* if left undefined position will be after the sticky buttons (if any)
|
|
249
|
-
*/
|
|
250
|
-
overflowPosition: number | undefined;
|
|
251
|
-
}
|
|
252
|
-
export interface ITabRenderValues {
|
|
253
|
-
/** the icon or other leading component */
|
|
254
|
-
leading: React.ReactNode;
|
|
255
|
-
/** the main tab text/component */
|
|
256
|
-
content: React.ReactNode;
|
|
257
|
-
/** a set of react components to add to the tab after the content */
|
|
258
|
-
buttons: React.ReactNode[];
|
|
259
|
-
}
|
|
260
|
-
export interface IIcons {
|
|
261
|
-
close?: (React.ReactNode | ((tabNode: TabNode) => React.ReactNode));
|
|
262
|
-
closeTabset?: (React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode));
|
|
263
|
-
popout?: (React.ReactNode | ((tabNode: TabNode) => React.ReactNode));
|
|
264
|
-
maximize?: (React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode));
|
|
265
|
-
restore?: (React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode));
|
|
266
|
-
more?: (React.ReactNode | ((tabSetNode: (TabSetNode | BorderNode), hiddenTabs: {
|
|
267
|
-
node: TabNode;
|
|
268
|
-
index: number;
|
|
269
|
-
}[]) => React.ReactNode));
|
|
270
|
-
edgeArrow?: React.ReactNode;
|
|
271
|
-
activeTabset?: (React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode));
|
|
272
|
-
}
|
|
273
|
-
declare enum DragSource {
|
|
274
|
-
Internal = "internal",
|
|
275
|
-
External = "external",
|
|
276
|
-
Add = "add"
|
|
277
|
-
}
|
|
278
|
-
declare class DragState {
|
|
279
|
-
readonly mainLayout: LayoutInternal;
|
|
280
|
-
readonly dragSource: DragSource;
|
|
281
|
-
readonly dragNode: Node & IDraggable | undefined;
|
|
282
|
-
readonly dragJson: IJsonTabNode | undefined;
|
|
283
|
-
readonly fnNewNodeDropped: ((node?: Node, event?: React.DragEvent<HTMLElement>) => void) | undefined;
|
|
284
|
-
constructor(mainLayout: LayoutInternal, dragSource: DragSource, dragNode: Node & IDraggable | undefined, dragJson: IJsonTabNode | undefined, fnNewNodeDropped: ((node?: Node, event?: React.DragEvent<HTMLElement>) => void) | undefined);
|
|
285
|
-
}
|
|
286
|
-
export {};
|
package/types/view/Overlay.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
|
+
import { Layout } from "../model/Layout";
|
|
4
4
|
/** @internal */
|
|
5
5
|
export interface IPopoutWindowProps {
|
|
6
6
|
title: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
controller: LayoutController;
|
|
8
|
+
layout: Layout;
|
|
9
9
|
url: string;
|
|
10
|
-
|
|
11
|
-
onSetWindow: (
|
|
10
|
+
onCloseLayout: (layout: Layout) => void;
|
|
11
|
+
onSetWindow: (layout: Layout, window: Window) => void;
|
|
12
12
|
}
|
|
13
13
|
/** @internal */
|
|
14
14
|
export declare const PopoutWindow: (props: React.PropsWithChildren<IPopoutWindowProps>) => React.ReactPortal | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TabNode } from "../model/TabNode";
|
|
2
|
-
import {
|
|
2
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
3
|
import { TabSetNode } from "../model/TabSetNode";
|
|
4
4
|
import { BorderNode } from "../model/BorderNode";
|
|
5
5
|
/** @internal */
|
|
@@ -9,4 +9,4 @@ export declare function showPopup(triggerElement: Element, parentNode: TabSetNod
|
|
|
9
9
|
}[], onSelect: (item: {
|
|
10
10
|
index: number;
|
|
11
11
|
node: TabNode;
|
|
12
|
-
}) => void,
|
|
12
|
+
}) => void, controller: LayoutController): void;
|
package/types/view/Row.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RowNode } from "../model/RowNode";
|
|
2
|
-
import {
|
|
2
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
3
3
|
/** @internal */
|
|
4
4
|
export interface IRowProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
controller: LayoutController;
|
|
6
|
+
rowNode: RowNode;
|
|
7
7
|
}
|
|
8
8
|
/** @internal */
|
|
9
9
|
export declare const Row: (props: IRowProps) => import("react/jsx-runtime").JSX.Element;
|
package/types/view/Splitter.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { BorderNode } from "../model/BorderNode";
|
|
2
2
|
import { RowNode } from "../model/RowNode";
|
|
3
|
-
import {
|
|
3
|
+
import { LayoutController } from "./layout/LayoutInternal";
|
|
4
4
|
/** @internal */
|
|
5
5
|
export interface ISplitterProps {
|
|
6
|
-
|
|
6
|
+
controller: LayoutController;
|
|
7
7
|
node: RowNode | BorderNode;
|
|
8
8
|
index: number;
|
|
9
9
|
horizontal: boolean;
|
|
10
10
|
}
|
|
11
11
|
/** @internal */
|
|
12
|
-
export declare let splitterDragging: boolean;
|
|
13
|
-
/** @internal */
|
|
14
12
|
export declare const Splitter: (props: ISplitterProps) => import("react/jsx-runtime").JSX.Element;
|