@aptre/flex-layout 0.5.13 → 0.6.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.
- package/README.md +11 -59
- package/dist/I18nLabel.d.ts +0 -1
- package/dist/Types.d.ts +0 -7
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +595 -1208
- package/dist/model/Action.d.ts +1 -34
- package/dist/model/Actions.d.ts +1 -30
- package/dist/model/IJsonModel.d.ts +0 -55
- package/dist/model/Model.d.ts +4 -7
- package/dist/model/RowNode.d.ts +0 -1
- package/dist/model/TabNode.d.ts +0 -6
- package/dist/model/TabSetNode.d.ts +1 -1
- package/dist/view/BorderTab.d.ts +1 -2
- package/dist/view/Icons.d.ts +6 -8
- package/dist/view/Layout.d.ts +25 -32
- package/dist/view/OptimizedLayout.d.ts +3 -3
- package/dist/view/SizeTracker.d.ts +3 -3
- package/dist/view/Utils.d.ts +2 -8
- package/package.json +31 -31
- package/tsconfig.json +1 -1
- package/typedoc/assets/hierarchy.js +1 -1
- package/typedoc/assets/navigation.js +1 -1
- package/typedoc/assets/search.js +1 -1
- package/typedoc/classes/Actions.html +4 -21
- package/typedoc/classes/BorderNode.html +1 -1
- package/typedoc/classes/Layout.html +17 -17
- package/typedoc/classes/Model.html +9 -11
- package/typedoc/classes/Node.html +1 -1
- package/typedoc/classes/RowNode.html +2 -3
- package/typedoc/classes/TabNode.html +2 -8
- package/typedoc/classes/TabSetNode.html +1 -1
- package/typedoc/enums/CLASSES.html +1 -8
- package/typedoc/enums/I18nLabel.html +1 -2
- package/typedoc/hierarchy.html +1 -1
- package/typedoc/index.html +1 -1
- package/typedoc/interfaces/ActionDataMap.html +2 -6
- package/typedoc/interfaces/IBorderAttributes.html +1 -1
- package/typedoc/interfaces/IGlobalAttributes.html +2 -15
- package/typedoc/interfaces/IIcons.html +2 -3
- package/typedoc/interfaces/IJsonBorderNode.html +1 -1
- package/typedoc/interfaces/IJsonModel.html +2 -3
- package/typedoc/interfaces/IJsonRowNode.html +1 -1
- package/typedoc/interfaces/IJsonTabNode.html +4 -17
- package/typedoc/interfaces/IJsonTabSetNode.html +1 -1
- package/typedoc/interfaces/ILayoutProps.html +3 -9
- package/typedoc/interfaces/IOptimizedLayoutProps.html +4 -10
- package/typedoc/interfaces/IRowAttributes.html +1 -1
- package/typedoc/interfaces/ITabAttributes.html +2 -15
- package/typedoc/interfaces/ITabSetAttributes.html +1 -1
- package/typedoc/types/Action.html +1 -1
- package/typedoc/types/DragRectRenderCallback.html +1 -1
- package/typedoc/types/NodeMouseEvent.html +1 -1
- package/typedoc/types/ShowOverflowMenuCallback.html +1 -1
- package/typedoc/types/TabSetPlaceHolderCallback.html +1 -1
- package/typedoc/variables/ActionType.html +2 -2
- package/dist/model/LayoutWindow.d.ts +0 -28
- package/dist/view/PopoutWindow.d.ts +0 -1
- package/typedoc/classes/LayoutWindow.html +0 -12
- package/typedoc/interfaces/CloseWindowData.html +0 -2
- package/typedoc/interfaces/CreateWindowData.html +0 -3
- package/typedoc/interfaces/IJsonPopout.html +0 -3
- package/typedoc/interfaces/PopoutTabData.html +0 -2
- package/typedoc/interfaces/PopoutTabsetData.html +0 -2
package/dist/model/Action.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IJsonTabNode, IGlobalAttributes, ITabAttributes, ITabSetAttributes, IRowAttributes, IBorderAttributes } from "./IJsonModel";
|
|
2
2
|
/** Action type constants */
|
|
3
3
|
export declare const ActionType: {
|
|
4
4
|
readonly ADD_NODE: "FlexLayout_AddNode";
|
|
@@ -13,10 +13,6 @@ export declare const ActionType: {
|
|
|
13
13
|
readonly MAXIMIZE_TOGGLE: "FlexLayout_MaximizeToggle";
|
|
14
14
|
readonly UPDATE_MODEL_ATTRIBUTES: "FlexLayout_UpdateModelAttributes";
|
|
15
15
|
readonly UPDATE_NODE_ATTRIBUTES: "FlexLayout_UpdateNodeAttributes";
|
|
16
|
-
readonly POPOUT_TAB: "FlexLayout_PopoutTab";
|
|
17
|
-
readonly POPOUT_TABSET: "FlexLayout_PopoutTabset";
|
|
18
|
-
readonly CLOSE_WINDOW: "FlexLayout_CloseWindow";
|
|
19
|
-
readonly CREATE_WINDOW: "FlexLayout_CreateWindow";
|
|
20
16
|
};
|
|
21
17
|
export type ActionTypeValue = (typeof ActionType)[keyof typeof ActionType];
|
|
22
18
|
/** Data types for each action */
|
|
@@ -73,19 +69,6 @@ export interface UpdateNodeAttributesData {
|
|
|
73
69
|
node: string;
|
|
74
70
|
json: NodeAttributes;
|
|
75
71
|
}
|
|
76
|
-
export interface PopoutTabData {
|
|
77
|
-
node: string;
|
|
78
|
-
}
|
|
79
|
-
export interface PopoutTabsetData {
|
|
80
|
-
node: string;
|
|
81
|
-
}
|
|
82
|
-
export interface CloseWindowData {
|
|
83
|
-
windowId: string;
|
|
84
|
-
}
|
|
85
|
-
export interface CreateWindowData {
|
|
86
|
-
layout: IJsonRowNode;
|
|
87
|
-
rect: IJsonRect;
|
|
88
|
-
}
|
|
89
72
|
/** Map from action type to its data type */
|
|
90
73
|
export interface ActionDataMap {
|
|
91
74
|
[ActionType.ADD_NODE]: AddNodeData;
|
|
@@ -100,10 +83,6 @@ export interface ActionDataMap {
|
|
|
100
83
|
[ActionType.MAXIMIZE_TOGGLE]: MaximizeToggleData;
|
|
101
84
|
[ActionType.UPDATE_MODEL_ATTRIBUTES]: UpdateModelAttributesData;
|
|
102
85
|
[ActionType.UPDATE_NODE_ATTRIBUTES]: UpdateNodeAttributesData;
|
|
103
|
-
[ActionType.POPOUT_TAB]: PopoutTabData;
|
|
104
|
-
[ActionType.POPOUT_TABSET]: PopoutTabsetData;
|
|
105
|
-
[ActionType.CLOSE_WINDOW]: CloseWindowData;
|
|
106
|
-
[ActionType.CREATE_WINDOW]: CreateWindowData;
|
|
107
86
|
}
|
|
108
87
|
/** Discriminated union of all Action types */
|
|
109
88
|
export type Action = {
|
|
@@ -142,18 +121,6 @@ export type Action = {
|
|
|
142
121
|
} | {
|
|
143
122
|
type: typeof ActionType.UPDATE_NODE_ATTRIBUTES;
|
|
144
123
|
data: UpdateNodeAttributesData;
|
|
145
|
-
} | {
|
|
146
|
-
type: typeof ActionType.POPOUT_TAB;
|
|
147
|
-
data: PopoutTabData;
|
|
148
|
-
} | {
|
|
149
|
-
type: typeof ActionType.POPOUT_TABSET;
|
|
150
|
-
data: PopoutTabsetData;
|
|
151
|
-
} | {
|
|
152
|
-
type: typeof ActionType.CLOSE_WINDOW;
|
|
153
|
-
data: CloseWindowData;
|
|
154
|
-
} | {
|
|
155
|
-
type: typeof ActionType.CREATE_WINDOW;
|
|
156
|
-
data: CreateWindowData;
|
|
157
124
|
};
|
|
158
125
|
/** Factory function for creating typed actions */
|
|
159
126
|
export declare function createAction<T extends ActionTypeValue>(type: T, data: ActionDataMap[T]): Action;
|
package/dist/model/Actions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DockLocation } from "../DockLocation";
|
|
2
2
|
import { Action, NodeAttributes } from "./Action";
|
|
3
|
-
import {
|
|
3
|
+
import { IJsonTabNode, IGlobalAttributes } from "./IJsonModel";
|
|
4
4
|
/**
|
|
5
5
|
* The Action creator class for FlexLayout model actions
|
|
6
6
|
*/
|
|
@@ -17,10 +17,6 @@ export declare class Actions {
|
|
|
17
17
|
static MAXIMIZE_TOGGLE: "FlexLayout_MaximizeToggle";
|
|
18
18
|
static UPDATE_MODEL_ATTRIBUTES: "FlexLayout_UpdateModelAttributes";
|
|
19
19
|
static UPDATE_NODE_ATTRIBUTES: "FlexLayout_UpdateNodeAttributes";
|
|
20
|
-
static POPOUT_TAB: "FlexLayout_PopoutTab";
|
|
21
|
-
static POPOUT_TABSET: "FlexLayout_PopoutTabset";
|
|
22
|
-
static CLOSE_WINDOW: "FlexLayout_CloseWindow";
|
|
23
|
-
static CREATE_WINDOW: "FlexLayout_CreateWindow";
|
|
24
20
|
/**
|
|
25
21
|
* Adds a tab node to the given tabset node
|
|
26
22
|
* @param json the json for the new tab node e.g {type:"tab", component:"table"}
|
|
@@ -99,29 +95,4 @@ export declare class Actions {
|
|
|
99
95
|
* @returns {Action} the action
|
|
100
96
|
*/
|
|
101
97
|
static updateNodeAttributes(nodeId: string, attributes: NodeAttributes): Action;
|
|
102
|
-
/**
|
|
103
|
-
* Pops out the given tab node into a new browser window
|
|
104
|
-
* @param nodeId the tab node to popout
|
|
105
|
-
* @returns
|
|
106
|
-
*/
|
|
107
|
-
static popoutTab(nodeId: string): Action;
|
|
108
|
-
/**
|
|
109
|
-
* Pops out the given tab set node into a new browser window
|
|
110
|
-
* @param nodeId the tab set node to popout
|
|
111
|
-
* @returns
|
|
112
|
-
*/
|
|
113
|
-
static popoutTabset(nodeId: string): Action;
|
|
114
|
-
/**
|
|
115
|
-
* Closes the popout window
|
|
116
|
-
* @param windowId the id of the popout window to close
|
|
117
|
-
* @returns
|
|
118
|
-
*/
|
|
119
|
-
static closeWindow(windowId: string): Action;
|
|
120
|
-
/**
|
|
121
|
-
* Creates a new empty popout window with the given layout
|
|
122
|
-
* @param layout the json layout for the new window
|
|
123
|
-
* @param rect the window rectangle in screen coordinates
|
|
124
|
-
* @returns
|
|
125
|
-
*/
|
|
126
|
-
static createWindow(layout: IJsonRowNode, rect: IJsonRect): Action;
|
|
127
98
|
}
|
|
@@ -5,7 +5,6 @@ export interface IJsonModel {
|
|
|
5
5
|
global?: IGlobalAttributes;
|
|
6
6
|
borders?: IJsonBorderNode[];
|
|
7
7
|
layout: IJsonRowNode;
|
|
8
|
-
popouts?: Record<string, IJsonPopout>;
|
|
9
8
|
}
|
|
10
9
|
export interface IJsonRect {
|
|
11
10
|
x: number;
|
|
@@ -13,10 +12,6 @@ export interface IJsonRect {
|
|
|
13
12
|
width: number;
|
|
14
13
|
height: number;
|
|
15
14
|
}
|
|
16
|
-
export interface IJsonPopout {
|
|
17
|
-
layout: IJsonRowNode;
|
|
18
|
-
rect: IJsonRect;
|
|
19
|
-
}
|
|
20
15
|
export interface IJsonBorderNode extends IBorderAttributes {
|
|
21
16
|
location: IBorderLocation;
|
|
22
17
|
children: IJsonTabNode[];
|
|
@@ -198,31 +193,6 @@ export interface IGlobalAttributes {
|
|
|
198
193
|
Default: true
|
|
199
194
|
*/
|
|
200
195
|
tabEnableDrag?: boolean;
|
|
201
|
-
/**
|
|
202
|
-
Value for TabNode attribute enablePopout if not overridden
|
|
203
|
-
|
|
204
|
-
enable popout (in popout capable browser)
|
|
205
|
-
|
|
206
|
-
Default: false
|
|
207
|
-
*/
|
|
208
|
-
tabEnablePopout?: boolean;
|
|
209
|
-
/**
|
|
210
|
-
Value for TabNode attribute enablePopoutIcon if not overridden
|
|
211
|
-
|
|
212
|
-
whether to show the popout icon in the tabset header if this tab enables popouts
|
|
213
|
-
|
|
214
|
-
Default: true
|
|
215
|
-
*/
|
|
216
|
-
tabEnablePopoutIcon?: boolean;
|
|
217
|
-
/**
|
|
218
|
-
Value for TabNode attribute enablePopoutOverlay if not overridden
|
|
219
|
-
|
|
220
|
-
if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
|
|
221
|
-
then enabling this option will gray out this tab
|
|
222
|
-
|
|
223
|
-
Default: false
|
|
224
|
-
*/
|
|
225
|
-
tabEnablePopoutOverlay?: boolean;
|
|
226
196
|
/**
|
|
227
197
|
Value for TabNode attribute enableRename if not overridden
|
|
228
198
|
|
|
@@ -629,25 +599,6 @@ export interface ITabAttributes {
|
|
|
629
599
|
Default: inherited from Global attribute tabEnableDrag (default true)
|
|
630
600
|
*/
|
|
631
601
|
enableDrag?: boolean;
|
|
632
|
-
/**
|
|
633
|
-
enable popout (in popout capable browser)
|
|
634
|
-
|
|
635
|
-
Default: inherited from Global attribute tabEnablePopout (default false)
|
|
636
|
-
*/
|
|
637
|
-
enablePopout?: boolean;
|
|
638
|
-
/**
|
|
639
|
-
whether to show the popout icon in the tabset header if this tab enables popouts
|
|
640
|
-
|
|
641
|
-
Default: inherited from Global attribute tabEnablePopoutIcon (default true)
|
|
642
|
-
*/
|
|
643
|
-
enablePopoutIcon?: boolean;
|
|
644
|
-
/**
|
|
645
|
-
if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
|
|
646
|
-
then enabling this option will gray out this tab
|
|
647
|
-
|
|
648
|
-
Default: inherited from Global attribute tabEnablePopoutOverlay (default false)
|
|
649
|
-
*/
|
|
650
|
-
enablePopoutOverlay?: boolean;
|
|
651
602
|
/**
|
|
652
603
|
allow user to rename tabs by double clicking
|
|
653
604
|
|
|
@@ -660,12 +611,6 @@ export interface ITabAttributes {
|
|
|
660
611
|
Default: inherited from Global attribute tabEnableRenderOnDemand (default true)
|
|
661
612
|
*/
|
|
662
613
|
enableRenderOnDemand?: boolean;
|
|
663
|
-
/**
|
|
664
|
-
if enabled the tab will re-mount when popped out/in
|
|
665
|
-
|
|
666
|
-
Default: false
|
|
667
|
-
*/
|
|
668
|
-
enableWindowReMount?: boolean;
|
|
669
614
|
/**
|
|
670
615
|
An optional help text for the tab to be displayed upon tab hover.
|
|
671
616
|
|
package/dist/model/Model.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { Node } from "./Node";
|
|
|
6
6
|
import { RowNode } from "./RowNode";
|
|
7
7
|
import { TabNode } from "./TabNode";
|
|
8
8
|
import { TabSetNode } from "./TabSetNode";
|
|
9
|
-
import { LayoutWindow } from "./LayoutWindow";
|
|
10
9
|
/**
|
|
11
10
|
* Class containing the Tree of Nodes used by the FlexLayout component
|
|
12
11
|
*/
|
|
@@ -16,22 +15,22 @@ export declare class Model {
|
|
|
16
15
|
* Update the node tree by performing the given action,
|
|
17
16
|
* Actions should be generated via static methods on the Actions class
|
|
18
17
|
* @param action the action to perform
|
|
19
|
-
* @returns added Node for Actions.addNode
|
|
18
|
+
* @returns added Node for Actions.addNode
|
|
20
19
|
*/
|
|
21
20
|
doAction(action: Action): Node | string | undefined;
|
|
22
21
|
/**
|
|
23
22
|
* Get the currently active tabset node
|
|
24
23
|
*/
|
|
25
|
-
getActiveTabset(
|
|
24
|
+
getActiveTabset(_windowId?: string): TabSetNode | undefined;
|
|
26
25
|
/**
|
|
27
26
|
* Get the currently maximized tabset node
|
|
28
27
|
*/
|
|
29
|
-
getMaximizedTabset(
|
|
28
|
+
getMaximizedTabset(_windowId?: string): TabSetNode | undefined;
|
|
30
29
|
/**
|
|
31
30
|
* Gets the root RowNode of the model
|
|
32
31
|
* @returns {RowNode}
|
|
33
32
|
*/
|
|
34
|
-
getRoot(
|
|
33
|
+
getRoot(_windowId?: string): RowNode;
|
|
35
34
|
isRootOrientationVertical(): boolean;
|
|
36
35
|
isEnableRotateBorderIcons(): boolean;
|
|
37
36
|
/**
|
|
@@ -39,13 +38,11 @@ export declare class Model {
|
|
|
39
38
|
* @returns {BorderSet|*}
|
|
40
39
|
*/
|
|
41
40
|
getBorderSet(): BorderSet;
|
|
42
|
-
getwindowsMap(): Map<string, LayoutWindow>;
|
|
43
41
|
/**
|
|
44
42
|
* Visits all the nodes in the model and calls the given function for each
|
|
45
43
|
* @param fn a function that takes visited node and a integer level as parameters
|
|
46
44
|
*/
|
|
47
45
|
visitNodes(fn: (node: Node, level: number) => void): void;
|
|
48
|
-
visitWindowNodes(windowId: string, fn: (node: Node, level: number) => void): void;
|
|
49
46
|
/**
|
|
50
47
|
* Gets a node by its id
|
|
51
48
|
* @param id the id to find
|
package/dist/model/RowNode.d.ts
CHANGED
package/dist/model/TabNode.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export declare class TabNode extends Node implements IDraggable {
|
|
|
8
8
|
getHelpText(): string | undefined;
|
|
9
9
|
getComponent(): string | undefined;
|
|
10
10
|
getWindowId(): string;
|
|
11
|
-
getWindow(): Window | undefined;
|
|
12
11
|
/**
|
|
13
12
|
* Returns the config attribute that can be used to store node specific data that
|
|
14
13
|
* WILL be saved to the json. The config attribute should be changed via the action Actions.updateNodeAttributes rather
|
|
@@ -22,17 +21,12 @@ export declare class TabNode extends Node implements IDraggable {
|
|
|
22
21
|
* NOT be saved in the json.
|
|
23
22
|
*/
|
|
24
23
|
getExtraData(): Record<string, unknown>;
|
|
25
|
-
isPoppedOut(): boolean;
|
|
26
24
|
isSelected(): boolean;
|
|
27
25
|
getIcon(): string | undefined;
|
|
28
26
|
isEnableClose(): boolean;
|
|
29
27
|
getCloseType(): ICloseType;
|
|
30
|
-
isEnablePopout(): boolean;
|
|
31
|
-
isEnablePopoutIcon(): boolean;
|
|
32
|
-
isEnablePopoutOverlay(): boolean;
|
|
33
28
|
isEnableDrag(): boolean;
|
|
34
29
|
isEnableRename(): boolean;
|
|
35
|
-
isEnableWindowReMount(): boolean;
|
|
36
30
|
getClassName(): string | undefined;
|
|
37
31
|
getContentClassName(): string | undefined;
|
|
38
32
|
getTabSetClassName(): string | undefined;
|
|
@@ -39,6 +39,6 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
39
39
|
isAutoSelectTab(): boolean;
|
|
40
40
|
getClassNameTabStrip(): string | undefined;
|
|
41
41
|
getTabLocation(): string;
|
|
42
|
-
toJson(): IJsonTabSetNode;
|
|
43
42
|
getWindowId(): string;
|
|
43
|
+
toJson(): IJsonTabSetNode;
|
|
44
44
|
}
|
package/dist/view/BorderTab.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function BorderTab(props: IBorderTabProps): React.JSX.Element;
|
|
1
|
+
export declare function BorderTab(props: IBorderTabProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/view/Icons.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const RestoreIcon: () => React.JSX.Element;
|
|
8
|
-
export declare const AsterickIcon: () => React.JSX.Element;
|
|
1
|
+
export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MaximizeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const OverflowIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const EdgeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const RestoreIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const AsterickIcon: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/view/Layout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component, DragEvent as ReactDragEvent, MouseEvent as ReactMouseEvent, ReactNode } from "react";
|
|
2
2
|
import { I18nLabel } from "../I18nLabel";
|
|
3
3
|
import { Action } from "../model/Action";
|
|
4
4
|
import { BorderNode } from "../model/BorderNode";
|
|
@@ -11,8 +11,8 @@ export interface ILayoutProps {
|
|
|
11
11
|
/** the model for this layout */
|
|
12
12
|
model: Model;
|
|
13
13
|
/** factory function for creating the tab components */
|
|
14
|
-
factory: (node: TabNode) =>
|
|
15
|
-
/** object mapping keys among close, maximize, restore, more
|
|
14
|
+
factory: (node: TabNode) => ReactNode;
|
|
15
|
+
/** object mapping keys among close, maximize, restore, more to React nodes to use in place of the default icons, can alternatively return functions for creating the React nodes */
|
|
16
16
|
icons?: IIcons;
|
|
17
17
|
/** function called whenever the layout generates an action to update the model (allows for intercepting actions before they are dispatched to the model, for example, asking the user to confirm a tab close.) Returning undefined from the function will halt the action, otherwise return the action to continue */
|
|
18
18
|
onAction?: (action: Action) => Action | undefined;
|
|
@@ -23,18 +23,14 @@ export interface ILayoutProps {
|
|
|
23
23
|
/** function called when model has changed */
|
|
24
24
|
onModelChange?: (model: Model, action: Action) => void;
|
|
25
25
|
/** 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. */
|
|
26
|
-
onExternalDrag?: (event:
|
|
26
|
+
onExternalDrag?: (event: ReactDragEvent<HTMLElement>) => undefined | {
|
|
27
27
|
json: IJsonTabNode;
|
|
28
|
-
onDrop?: (node?: Node, event?:
|
|
28
|
+
onDrop?: (node?: Node, event?: ReactDragEvent<HTMLElement>) => void;
|
|
29
29
|
};
|
|
30
30
|
/** function called with default css class name, return value is class name that will be used. Mainly for use with css modules. */
|
|
31
31
|
classNameMapper?: (defaultClassName: string) => string;
|
|
32
32
|
/** function called for each I18nLabel to allow user translation, currently used for tab and tabset move messages, return undefined to use default values */
|
|
33
33
|
i18nMapper?: (id: I18nLabel, param?: string) => string | undefined;
|
|
34
|
-
/** if left undefined will do simple check based on userAgent */
|
|
35
|
-
supportsPopout?: boolean | undefined;
|
|
36
|
-
/** URL of popout window relative to origin, defaults to popout.html */
|
|
37
|
-
popoutURL?: string | undefined;
|
|
38
34
|
/** boolean value, defaults to false, resize tabs as splitters are dragged. Warning: this can cause resizing to become choppy when tabs are slow to draw */
|
|
39
35
|
realtimeResize?: boolean | undefined;
|
|
40
36
|
/** callback for rendering the drag rectangles */
|
|
@@ -47,15 +43,13 @@ export interface ILayoutProps {
|
|
|
47
43
|
onShowOverflowMenu?: ShowOverflowMenuCallback;
|
|
48
44
|
/** callback for rendering a placeholder when a tabset is empty */
|
|
49
45
|
onTabSetPlaceHolder?: TabSetPlaceHolderCallback;
|
|
50
|
-
/** Name given to popout windows, defaults to 'Popout Window' */
|
|
51
|
-
popoutWindowName?: string;
|
|
52
46
|
/** callback for when drag state changes, useful for OptimizedLayout to set pointer-events: none on external tab container during drag */
|
|
53
47
|
onDragStateChange?: (isDragging: boolean) => void;
|
|
54
48
|
}
|
|
55
49
|
/**
|
|
56
50
|
* A React component that hosts a multi-tabbed layout
|
|
57
51
|
*/
|
|
58
|
-
export declare class Layout extends
|
|
52
|
+
export declare class Layout extends Component<ILayoutProps> {
|
|
59
53
|
/** re-render the layout */
|
|
60
54
|
redraw(): void;
|
|
61
55
|
/**
|
|
@@ -73,7 +67,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
73
67
|
* @param json the json for the new tab node
|
|
74
68
|
* @param onDrop a callback to call when the drag is complete
|
|
75
69
|
*/
|
|
76
|
-
addTabWithDragAndDrop(event: DragEvent, json: IJsonTabNode, onDrop?: (node?: Node, event?:
|
|
70
|
+
addTabWithDragAndDrop(event: DragEvent, json: IJsonTabNode, onDrop?: (node?: Node, event?: ReactDragEvent<HTMLElement>) => void): void;
|
|
77
71
|
/**
|
|
78
72
|
* Move a tab/tabset using drag and drop, must be called from within an HTML
|
|
79
73
|
* drag start handler
|
|
@@ -94,26 +88,26 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
94
88
|
* @param x the x position of the drag cursor on the image
|
|
95
89
|
* @param y the x position of the drag cursor on the image
|
|
96
90
|
*/
|
|
97
|
-
setDragComponent(event: DragEvent, component:
|
|
91
|
+
setDragComponent(event: DragEvent, component: ReactNode, x: number, y: number): void;
|
|
98
92
|
/** Get the root div element of the layout */
|
|
99
93
|
getRootDiv(): HTMLDivElement | null;
|
|
100
94
|
}
|
|
101
95
|
export declare const FlexLayoutVersion = "0.8.1";
|
|
102
|
-
export type DragRectRenderCallback = (content:
|
|
103
|
-
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event:
|
|
104
|
-
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent:
|
|
96
|
+
export type DragRectRenderCallback = (content: ReactNode | undefined, node?: Node, json?: IJsonTabNode) => ReactNode | undefined;
|
|
97
|
+
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: ReactMouseEvent<HTMLElement>) => void;
|
|
98
|
+
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: ReactMouseEvent<HTMLElement>, items: {
|
|
105
99
|
index: number;
|
|
106
100
|
node: TabNode;
|
|
107
101
|
}[], onSelect: (item: {
|
|
108
102
|
index: number;
|
|
109
103
|
node: TabNode;
|
|
110
104
|
}) => void) => void;
|
|
111
|
-
export type TabSetPlaceHolderCallback = (node: TabSetNode) =>
|
|
105
|
+
export type TabSetPlaceHolderCallback = (node: TabSetNode) => ReactNode;
|
|
112
106
|
export interface ITabSetRenderValues {
|
|
113
107
|
/** components that will be added after the tabs */
|
|
114
|
-
stickyButtons:
|
|
108
|
+
stickyButtons: ReactNode[];
|
|
115
109
|
/** components that will be added at the end of the tabset */
|
|
116
|
-
buttons:
|
|
110
|
+
buttons: ReactNode[];
|
|
117
111
|
/** position to insert overflow button within [...stickyButtons, ...buttons]
|
|
118
112
|
* if left undefined position will be after the sticky buttons (if any)
|
|
119
113
|
*/
|
|
@@ -121,22 +115,21 @@ export interface ITabSetRenderValues {
|
|
|
121
115
|
}
|
|
122
116
|
export interface ITabRenderValues {
|
|
123
117
|
/** the icon or other leading component */
|
|
124
|
-
leading:
|
|
118
|
+
leading: ReactNode;
|
|
125
119
|
/** the main tab text/component */
|
|
126
|
-
content:
|
|
120
|
+
content: ReactNode;
|
|
127
121
|
/** a set of react components to add to the tab after the content */
|
|
128
|
-
buttons:
|
|
122
|
+
buttons: ReactNode[];
|
|
129
123
|
}
|
|
130
124
|
export interface IIcons {
|
|
131
|
-
close?:
|
|
132
|
-
closeTabset?:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
more?: React.ReactNode | ((tabSetNode: TabSetNode | BorderNode, hiddenTabs: {
|
|
125
|
+
close?: ReactNode | ((tabNode: TabNode) => ReactNode);
|
|
126
|
+
closeTabset?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
|
|
127
|
+
maximize?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
|
|
128
|
+
restore?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
|
|
129
|
+
more?: ReactNode | ((tabSetNode: TabSetNode | BorderNode, hiddenTabs: {
|
|
137
130
|
node: TabNode;
|
|
138
131
|
index: number;
|
|
139
|
-
}[]) =>
|
|
140
|
-
edgeArrow?:
|
|
141
|
-
activeTabset?:
|
|
132
|
+
}[]) => ReactNode);
|
|
133
|
+
edgeArrow?: ReactNode;
|
|
134
|
+
activeTabset?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
|
|
142
135
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { TabNode } from "../model/TabNode";
|
|
3
3
|
import { ILayoutProps } from "./Layout";
|
|
4
4
|
/**
|
|
@@ -6,7 +6,7 @@ import { ILayoutProps } from "./Layout";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IOptimizedLayoutProps extends Omit<ILayoutProps, "factory"> {
|
|
8
8
|
/** Function to render tab content - receives TabNode, returns React element */
|
|
9
|
-
renderTab: (node: TabNode) =>
|
|
9
|
+
renderTab: (node: TabNode) => ReactNode;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* OptimizedLayout - A wrapper around FlexLayout that renders tab content outside of
|
|
@@ -26,4 +26,4 @@ export interface IOptimizedLayoutProps extends Omit<ILayoutProps, "factory"> {
|
|
|
26
26
|
*
|
|
27
27
|
* @see https://github.com/caplin/FlexLayout/issues/456
|
|
28
28
|
*/
|
|
29
|
-
export declare function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }: IOptimizedLayoutProps):
|
|
29
|
+
export declare function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }: IOptimizedLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { Rect } from "../Rect";
|
|
3
3
|
export interface ISizeTrackerProps {
|
|
4
4
|
rect: Rect;
|
|
5
5
|
selected: boolean;
|
|
6
6
|
forceRevision: number;
|
|
7
7
|
tabsRevision: number;
|
|
8
|
-
children:
|
|
8
|
+
children: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const SizeTracker:
|
|
10
|
+
export declare const SizeTracker: import("react").MemoExoticComponent<({ children }: ISizeTrackerProps) => import("react/jsx-runtime").JSX.Element>;
|
package/dist/view/Utils.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Node } from "../model/Node";
|
|
3
|
-
import { Rect } from "../Rect";
|
|
1
|
+
import { PointerEvent as ReactPointerEvent } from "react";
|
|
4
2
|
export declare function enablePointerOnIFrames(enable: boolean, currentDocument: Document): void;
|
|
5
3
|
export declare function getElementsByTagName(tag: string, currentDocument: Document): Element[];
|
|
6
|
-
export declare function startDrag(doc: Document, event:
|
|
7
|
-
export declare function canDockToWindow(node: Node): boolean;
|
|
8
|
-
export declare function keepOnScreen(rect: Rect): Rect;
|
|
9
|
-
export declare function isOnScreen(rect: Rect): boolean;
|
|
10
|
-
export declare function copyInlineStyles(source: HTMLElement, target: HTMLElement): boolean;
|
|
4
|
+
export declare function startDrag(doc: Document, event: ReactPointerEvent<HTMLElement>, drag: (x: number, y: number) => void, dragEnd: () => void, dragCancel: () => void): void;
|
|
11
5
|
export declare function isSafari(): boolean;
|
package/package.json
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
"name": "@aptre/flex-layout",
|
|
3
3
|
"author": "Caplin Systems Ltd",
|
|
4
4
|
"description": "A multi-tab docking layout manager",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.1",
|
|
6
6
|
"license": "ISC",
|
|
7
|
+
"homepage": "https://flexlayout.spacewave.app",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/aperturerobotics/flex-layout.git"
|
|
@@ -12,7 +13,6 @@
|
|
|
12
13
|
"react",
|
|
13
14
|
"layout",
|
|
14
15
|
"dock",
|
|
15
|
-
"popout",
|
|
16
16
|
"tabs",
|
|
17
17
|
"tabset",
|
|
18
18
|
"splitter",
|
|
@@ -79,46 +79,46 @@
|
|
|
79
79
|
"release:version": "npm version patch -m \"release: v%s\" --no-git-tag-version",
|
|
80
80
|
"release:version:minor": "npm version minor -m \"release: v%s\" --no-git-tag-version",
|
|
81
81
|
"release:commit": "git reset && git add package.json && git commit -s -m \"release: v$(node -p \"require('./package.json').version\")\" && git tag v$(node -p \"require('./package.json').version\")",
|
|
82
|
-
"release:publish": "git push && git push --tags"
|
|
82
|
+
"release:publish": "git push && git push --tags",
|
|
83
|
+
"website:build": "bun run build:style && bun run build:doc && cd website && bun install && bun run build && cp -r ../typedoc dist/typedoc",
|
|
84
|
+
"website:dev": "cd website && bun run dev",
|
|
85
|
+
"website:preview": "cd website && bun run preview"
|
|
83
86
|
},
|
|
84
87
|
"peerDependencies": {
|
|
85
|
-
"react": "^
|
|
86
|
-
"react-dom": "^
|
|
88
|
+
"react": "^19.2.4",
|
|
89
|
+
"react-dom": "^19.2.4"
|
|
87
90
|
},
|
|
88
91
|
"devDependencies": {
|
|
89
92
|
"@eslint/eslintrc": "^3.2.0",
|
|
90
|
-
"@eslint/js": "^
|
|
93
|
+
"@eslint/js": "^10.0.1",
|
|
91
94
|
"@testing-library/dom": "^10.4.0",
|
|
92
95
|
"@testing-library/jest-dom": "^6.9.1",
|
|
93
|
-
"@testing-library/react": "^16.2
|
|
94
|
-
"@types/node": "^25.
|
|
95
|
-
"@types/
|
|
96
|
-
"@types/react": "^19.0.0",
|
|
96
|
+
"@testing-library/react": "^16.3.2",
|
|
97
|
+
"@types/node": "^25.2.3",
|
|
98
|
+
"@types/react": "^19.2.13",
|
|
97
99
|
"@types/react-dom": "^19.0.0",
|
|
98
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
99
|
-
"@typescript-eslint/parser": "^8.
|
|
100
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
101
|
-
"@vitejs/plugin-react": "^5.
|
|
102
|
-
"@vitest/browser": "^4.0.
|
|
103
|
-
"@vitest/browser-playwright": "^4.0.
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
101
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
102
|
+
"@typescript/native-preview": "^7.0.0-dev.20260210.1",
|
|
103
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
104
|
+
"@vitest/browser": "^4.0.18",
|
|
105
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
104
106
|
"cross-env": "^10.1.0",
|
|
105
|
-
"esbuild": "^0.27.
|
|
106
|
-
"eslint": "^
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"react": "^19.0.0",
|
|
115
|
-
"react-dom": "^19.0.0",
|
|
107
|
+
"esbuild": "^0.27.3",
|
|
108
|
+
"eslint": "^10.0.0",
|
|
109
|
+
"globals": "^17.3.0",
|
|
110
|
+
"happy-dom": "^20.6.0",
|
|
111
|
+
"jsdom": "^28.0.0",
|
|
112
|
+
"playwright": "^1.58.2",
|
|
113
|
+
"prettier": "^3.8.1",
|
|
114
|
+
"react": "^19.2.4",
|
|
115
|
+
"react-dom": "^19.2.4",
|
|
116
116
|
"rimraf": "^6.0.1",
|
|
117
|
-
"sass": "^1.
|
|
117
|
+
"sass": "^1.97.3",
|
|
118
118
|
"typedoc": "^0.28.0",
|
|
119
119
|
"typescript": "^5.0.0",
|
|
120
|
-
"typescript-eslint": "^8.
|
|
121
|
-
"vitest": "^4.0.
|
|
122
|
-
"vitest-browser-react": "^2.0.
|
|
120
|
+
"typescript-eslint": "^8.55.0",
|
|
121
|
+
"vitest": "^4.0.18",
|
|
122
|
+
"vitest-browser-react": "^2.0.5"
|
|
123
123
|
}
|
|
124
124
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
window.hierarchyData = "
|
|
1
|
+
window.hierarchyData = "eJydlE9zgjAQxb/LnmPNAgHDrZ1e2kMP1lvHQ5SoTJF0kjgeHL97J6LypziEnsgkj/d7Wdg9gVbKGki/EKOQ8IgRzihBygOCGFxWMcEQcUlAy00h1zZXpYH0BAly9yjFXkIKL0pnUn+oTAKB77zMIMVgRuCgC0hhXQhjpJnWqqed3RdAqhNIwZps4l6bVBtnAjxiDf+3Vy22W7Eqav+AxTf/vLRSb8RammktfIi4q93hLi8yLUtXAuZuPcN46eiMtunqZyH0Vtph/E05lp8gJxi5ot8yJK0KvBtV9pT5QY622iOLA3LaBc7V0Zd2lfqi/txtIVaf0vrSarUfEGkQ9BBH4MaweIs1V8dna3W+Olhphmgt8dh/iHO6rALEzQBVsfwzdPXjY7BLDAxoJ8aoDP8P4L52lSAKmwmqjvAP0dWPLkRSFSJEbMQYGpMeA/LB5GiOMLfTgHY7uYc71MH32ew4DetuH/VYD/VPbT3DuG3dHQr97kPD4Ao4n38BP8E9vg=="
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.navigationData = "
|
|
1
|
+
window.navigationData = "eJyNmEtz0zAUhf+L1x1KCy2lu7YpECahnTiUBcNCtm8SEcXySHLSwPDfGcdOrOeVtzrnfH5Iulf2z7+JgleV3CYPk7s0fUyTs6QiapXcJlDWG3neDb9ZqQ1LzpI1LYvk9ubf2Sk3vrgpJyQDZidPApJ9YFzCfF+BEz4p4fRdrigvZR/NGZES5HknmMmLSz17z0UB4hsvwI33WpyQggoBUlBYfsTz9YTnpLlVF6GrKEXwalwuuIfQKVh6Qva89jxAO44lp7zQZ/wYPAxjOf8bj73rJ0GhVIFXpYkYYwa550mbUTTFd/5b7gQsOyeZP9sJkWwKKhjvNIzQboIRUWRKqh5CSwViQfLTNukcJury6lpHFUVztcbpB/U6jvldS9VtjopRhQA9zjj6B9DlSskIVnNhyBEwUDAnWRBnOAahJISf2TZhwHH7au6UEjSrFUgv0XGhyJEgyyXJGPhZJzkC4dWciKVeFU3KUUcxnxnPCIs9nu1CkePcaBU65yCh4a+Sl76OoVNMTxRnFVCb5CmkHohZ02yGW9t8CLvAORRfofOAnGpng7xVzw9ySp+H5S2BFq7tY8+CV4Gp1wwo6KlSdEP/QBEl+pwoesZ3sYVuWFDYnGQxmGGJwWZQFiBeCKsRnG6KAVNQA27QcA1ADrpNy4dhp+T1MIlzvlyycN9zbSiUbwFto7oBA82gJBu0MxkOHCXpH3jcQqmeiSAb/9tzXBgyBQa5wu7OcOAo1ZxRtrHW6fFh2O9VQRQcKmy/yoLwoDt+iWYyB1/BNWMXeKGSZpRRtY9NntcZQysuZiBr5u8uhgM9luXmkV3tq9O508q9/fjh4urSyTZfgIf96oec5BitOb40/bCtAA+EsYzkaxvqd8XYj5sqMA0t1dZjvO7c5n4ctjhLjtLmJAuiNC3Gadqu2ZRbxnE8lj/soG7l2Axdi3HMfWKTTHUI6zAxoQXhGAYT/UvBkofQpryWbcYH69UYK13x3dMWxILx3RTKOvTIIV+M33bYZ0Zy+MIZssmCxuEVoUduiaDNV4leEEzOOx3xicFrezB7ASGNHdGTHBMCzAUQBXadW9Rl+wvqXNdNzPV7DbOgZXHcSPf7ceFD2R4EZx1CfTTLgsB2hK09Xyw9yjA4oF//AW387AA="
|