flexlayout-react 0.6.9 → 0.7.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/ChangeLog.txt +11 -0
- package/README.md +16 -18
- package/declarations/model/Floating.d.ts +15 -0
- package/declarations/model/FloatingSet.d.ts +9 -0
- package/declarations/view/Icons.d.ts +0 -1
- package/declarations/view/Layout.d.ts +11 -3
- package/dist/flexlayout.js +8 -8
- package/dist/flexlayout_min.js +1 -1
- package/lib/PopupMenu.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/model/Floating.js +61 -0
- package/lib/model/Floating.js.map +1 -0
- package/lib/model/FloatingSet.js +58 -0
- package/lib/model/FloatingSet.js.map +1 -0
- package/lib/view/BorderTabSet.js +4 -2
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/ErrorBoundary.js.map +1 -1
- package/lib/view/Icons.js +8 -3
- package/lib/view/Icons.js.map +1 -1
- package/lib/view/Layout.js +11 -3
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/TabOverflowHook.js +1 -1
- package/lib/view/TabOverflowHook.js.map +1 -1
- package/lib/view/TabSet.js +3 -1
- package/lib/view/TabSet.js.map +1 -1
- package/lib/view/Utils.js.map +1 -1
- package/package.json +18 -20
- package/src/PopupMenu.tsx +5 -5
- package/src/view/BorderButton.tsx +3 -3
- package/src/view/BorderTabSet.tsx +9 -7
- package/src/view/ErrorBoundary.tsx +1 -0
- package/src/view/Icons.tsx +17 -7
- package/src/view/Layout.tsx +17 -6
- package/src/view/TabButton.tsx +3 -3
- package/src/view/TabButtonStamp.tsx +3 -3
- package/src/view/TabOverflowHook.tsx +1 -1
- package/src/view/TabSet.tsx +8 -6
- package/src/view/Utils.tsx +3 -3
- package/style/_base.scss +1 -1
- package/style/dark.css +3 -3
- package/style/gray.css +3 -3
- package/style/light.css +3 -3
- package/style/underline.css +12 -7
- package/style/underline.css.map +1 -1
- package/style/underline.scss +10 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flexlayout-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "A multi-tab docking layout manager",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./declarations/index.d.ts",
|
|
@@ -36,35 +36,33 @@
|
|
|
36
36
|
"repository": "https://github.com/caplin/FlexLayout",
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"react": "^
|
|
40
|
-
"react-dom": "^
|
|
39
|
+
"react": "^18.0.0",
|
|
40
|
+
"react-dom": "^18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"eslintConfig": {
|
|
43
43
|
"extends": "react-app"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@types/
|
|
46
|
+
"@types/react": "^18.0.5",
|
|
47
|
+
"@types/react-dom": "^18.0.1",
|
|
48
|
+
"@cypress/react": "^5.12.4",
|
|
49
|
+
"@cypress/webpack-dev-server": "^1.8.4",
|
|
50
|
+
"@types/node": "^17.0.24",
|
|
51
51
|
"@types/uuid": "^8.3.3",
|
|
52
|
-
"css-loader": "^6.
|
|
53
|
-
"cypress": "^9.
|
|
52
|
+
"css-loader": "^6.7.1",
|
|
53
|
+
"cypress": "^9.5.4",
|
|
54
54
|
"html-webpack-plugin": "^5.5.0",
|
|
55
|
-
"prettier": "^2.
|
|
56
|
-
"react": "
|
|
57
|
-
"
|
|
58
|
-
"react-scripts": "5.0.0",
|
|
59
|
-
"sass": "^1.45.0",
|
|
55
|
+
"prettier": "^2.6.2",
|
|
56
|
+
"react-scripts": "5.0.1",
|
|
57
|
+
"sass": "^1.50.0",
|
|
60
58
|
"source-map-loader": "^3.0.0",
|
|
61
59
|
"style-loader": "^3.3.1",
|
|
62
|
-
"ts-loader": "~9.2.
|
|
63
|
-
"typedoc": "^0.22.
|
|
64
|
-
"typescript": "^4.
|
|
65
|
-
"webpack": "^5.
|
|
60
|
+
"ts-loader": "~9.2.8",
|
|
61
|
+
"typedoc": "^0.22.15",
|
|
62
|
+
"typescript": "^4.6.3",
|
|
63
|
+
"webpack": "^5.72.0",
|
|
66
64
|
"webpack-cli": "^4.9.1",
|
|
67
|
-
"webpack-dev-server": "^4.
|
|
65
|
+
"webpack-dev-server": "^4.8.1"
|
|
68
66
|
},
|
|
69
67
|
"dependencies": {
|
|
70
68
|
"uuid": "^8.3.2"
|
package/src/PopupMenu.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { DragDrop } from "./DragDrop";
|
|
3
3
|
import { TabNode } from "./model/TabNode";
|
|
4
4
|
import { CLASSES } from "./Types";
|
|
5
|
-
import { ILayoutCallbacks } from "./view/Layout";
|
|
5
|
+
import { IconFactory, ILayoutCallbacks, TitleFactory } from "./view/Layout";
|
|
6
6
|
import { TabButtonStamp } from "./view/TabButtonStamp";
|
|
7
7
|
|
|
8
8
|
/** @internal */
|
|
@@ -11,8 +11,8 @@ export function showPopup(
|
|
|
11
11
|
items: { index: number; node: TabNode }[],
|
|
12
12
|
onSelect: (item: { index: number; node: TabNode }) => void,
|
|
13
13
|
layout: ILayoutCallbacks,
|
|
14
|
-
iconFactory?:
|
|
15
|
-
titleFactory?:
|
|
14
|
+
iconFactory?: IconFactory,
|
|
15
|
+
titleFactory?: TitleFactory,
|
|
16
16
|
) {
|
|
17
17
|
const layoutDiv = layout.getRootDiv();
|
|
18
18
|
const classNameMapper = layout.getClassName;
|
|
@@ -77,8 +77,8 @@ interface IPopupMenuProps {
|
|
|
77
77
|
onSelect: (item: { index: number; node: TabNode }) => void;
|
|
78
78
|
classNameMapper: (defaultClassName: string) => string;
|
|
79
79
|
layout: ILayoutCallbacks;
|
|
80
|
-
iconFactory?:
|
|
81
|
-
titleFactory?:
|
|
80
|
+
iconFactory?: IconFactory;
|
|
81
|
+
titleFactory?: TitleFactory;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/** @internal */
|
|
@@ -3,7 +3,7 @@ import { I18nLabel } from "../I18nLabel";
|
|
|
3
3
|
import { Actions } from "../model/Actions";
|
|
4
4
|
import { TabNode } from "../model/TabNode";
|
|
5
5
|
import { Rect } from "../Rect";
|
|
6
|
-
import { IIcons, ILayoutCallbacks } from "./Layout";
|
|
6
|
+
import { IconFactory, IIcons, ILayoutCallbacks, TitleFactory } from "./Layout";
|
|
7
7
|
import { ICloseType } from "../model/ICloseType";
|
|
8
8
|
import { CLASSES } from "../Types";
|
|
9
9
|
import { getRenderStateEx, isAuxMouseEvent } from "./Utils";
|
|
@@ -14,8 +14,8 @@ export interface IBorderButtonProps {
|
|
|
14
14
|
node: TabNode;
|
|
15
15
|
selected: boolean;
|
|
16
16
|
border: string;
|
|
17
|
-
iconFactory?:
|
|
18
|
-
titleFactory?:
|
|
17
|
+
iconFactory?: IconFactory;
|
|
18
|
+
titleFactory?: TitleFactory;
|
|
19
19
|
icons: IIcons;
|
|
20
20
|
path: string;
|
|
21
21
|
}
|
|
@@ -3,7 +3,7 @@ import { DockLocation } from "../DockLocation";
|
|
|
3
3
|
import { BorderNode } from "../model/BorderNode";
|
|
4
4
|
import { TabNode } from "../model/TabNode";
|
|
5
5
|
import { BorderButton } from "./BorderButton";
|
|
6
|
-
import { IIcons, ILayoutCallbacks } from "./Layout";
|
|
6
|
+
import { IIcons, ILayoutCallbacks, ITitleObject } from "./Layout";
|
|
7
7
|
import { showPopup } from "../PopupMenu";
|
|
8
8
|
import { Actions } from "../model/Actions";
|
|
9
9
|
import { I18nLabel } from "../I18nLabel";
|
|
@@ -16,8 +16,8 @@ import { isAuxMouseEvent } from "./Utils";
|
|
|
16
16
|
export interface IBorderTabSetProps {
|
|
17
17
|
border: BorderNode;
|
|
18
18
|
layout: ILayoutCallbacks;
|
|
19
|
-
iconFactory?: (node: TabNode) => React.ReactNode | undefined;
|
|
20
|
-
titleFactory?: (node: TabNode) => React.ReactNode | undefined;
|
|
19
|
+
iconFactory?: (node: TabNode) => (React.ReactNode | undefined);
|
|
20
|
+
titleFactory?: (node: TabNode) => (ITitleObject | React.ReactNode | undefined);
|
|
21
21
|
icons: IIcons;
|
|
22
22
|
path: string;
|
|
23
23
|
}
|
|
@@ -97,9 +97,11 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
97
97
|
icons={icons}
|
|
98
98
|
/>
|
|
99
99
|
);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (i < border.getChildren().length-1) {
|
|
101
|
+
tabs.push(
|
|
102
|
+
<div key={"divider" + i} className={cm(CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)}></div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
103
105
|
|
|
104
106
|
};
|
|
105
107
|
|
|
@@ -114,7 +116,7 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
114
116
|
|
|
115
117
|
// allow customization of tabset right/bottom buttons
|
|
116
118
|
let buttons: any[] = [];
|
|
117
|
-
const renderState = { headerContent:
|
|
119
|
+
const renderState = { headerContent: undefined, buttons, stickyButtons: [], headerButtons: [] };
|
|
118
120
|
layout.customizeTabSet(border, renderState);
|
|
119
121
|
buttons = renderState.buttons;
|
|
120
122
|
|
package/src/view/Icons.tsx
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
const style = {width:"1em", height:"1em", display: "flex", alignItems:"center"};
|
|
3
|
+
const style = { width: "1em", height: "1em", display: "flex", alignItems: "center" };
|
|
4
4
|
|
|
5
5
|
export const CloseIcon = () => {
|
|
6
6
|
return (
|
|
7
7
|
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" >
|
|
8
|
-
<path fill="none" d="M0 0h24v24H0z"/>
|
|
9
|
-
<path
|
|
8
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
9
|
+
<path stroke="gray" fill="gray" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
10
10
|
</svg>
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const MaximizeIcon = () => {
|
|
15
15
|
return (
|
|
16
|
-
<svg xmlns="http://www.w3.org/2000/svg" style={style}
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="gray"><path d="M0 0h24v24H0z" fill="none" /><path stroke="gray" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" /></svg>
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const OverflowIcon = () => {
|
|
21
21
|
return (
|
|
22
|
-
<svg xmlns="http://www.w3.org/2000/svg" style={style}
|
|
22
|
+
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="gray"><path d="M0 0h24v24H0z" fill="none" /><path stroke="gray" d="M7 10l5 5 5-5z" /></svg>
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const PopoutIcon = () => {
|
|
27
27
|
return (
|
|
28
|
-
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="gray"><path d="M0 0h24v24H0z" fill="none"/><path stroke="gray" d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"/></svg>
|
|
28
|
+
// <svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="gray"><path d="M0 0h24v24H0z" fill="none"/><path stroke="gray" d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"/></svg>
|
|
29
|
+
|
|
30
|
+
// <svg xmlns="http://www.w3.org/2000/svg" style={style} fill="none" viewBox="0 0 24 24" stroke="gray" stroke-width="2">
|
|
31
|
+
// <path stroke-linecap="round" stroke-linejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
|
32
|
+
// </svg>
|
|
33
|
+
|
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 20 20" fill="gray">
|
|
35
|
+
<path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z" />
|
|
36
|
+
<path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z" />
|
|
37
|
+
</svg>
|
|
38
|
+
|
|
29
39
|
);
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
export const RestoreIcon = () => {
|
|
33
43
|
return (
|
|
34
|
-
<svg xmlns="http://www.w3.org/2000/svg" style={style}
|
|
44
|
+
<svg xmlns="http://www.w3.org/2000/svg" style={style} viewBox="0 0 24 24" fill="gray"><path d="M0 0h24v24H0z" fill="none" /><path stroke="gray" d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" /></svg>
|
|
35
45
|
);
|
|
36
46
|
}
|
package/src/view/Layout.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
3
|
import { DockLocation } from "../DockLocation";
|
|
4
4
|
import { DragDrop } from "../DragDrop";
|
|
5
5
|
import { DropInfo } from "../DropInfo";
|
|
@@ -40,14 +40,16 @@ export type ShowOverflowMenuCallback = (
|
|
|
40
40
|
onSelect: (item: { index: number; node: TabNode }) => void,
|
|
41
41
|
) => void;
|
|
42
42
|
export type TabSetPlaceHolderCallback = (node: TabSetNode) => React.ReactNode;
|
|
43
|
+
export type IconFactory = (node: TabNode) => React.ReactNode;
|
|
44
|
+
export type TitleFactory = (node: TabNode) => ITitleObject | React.ReactNode;
|
|
43
45
|
|
|
44
46
|
export interface ILayoutProps {
|
|
45
47
|
model: Model;
|
|
46
48
|
factory: (node: TabNode) => React.ReactNode;
|
|
47
49
|
font?: IFontValues;
|
|
48
50
|
fontFamily?: string;
|
|
49
|
-
iconFactory?:
|
|
50
|
-
titleFactory?:
|
|
51
|
+
iconFactory?: IconFactory;
|
|
52
|
+
titleFactory?: TitleFactory;
|
|
51
53
|
icons?: IIcons;
|
|
52
54
|
onAction?: (action: Action) => Action | undefined;
|
|
53
55
|
onRenderTab?: (
|
|
@@ -120,7 +122,7 @@ export interface ILayoutState {
|
|
|
120
122
|
calculatedBorderBarSize: number;
|
|
121
123
|
editingTab?: TabNode;
|
|
122
124
|
showHiddenBorder: DockLocation;
|
|
123
|
-
portal?: React.
|
|
125
|
+
portal?: React.ReactPortal;
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
export interface IIcons {
|
|
@@ -724,6 +726,15 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
|
|
|
724
726
|
this.dragStart(undefined, dragText, TabNode._fromJson(json, this.props.model, false), true, undefined, undefined);
|
|
725
727
|
}
|
|
726
728
|
|
|
729
|
+
/**
|
|
730
|
+
* Move a tab/tabset using drag and drop
|
|
731
|
+
* @param node the tab or tabset to drag
|
|
732
|
+
* @param dragText the text to show on the drag panel
|
|
733
|
+
*/
|
|
734
|
+
moveTabWithDragAndDrop( node: (TabNode | TabSetNode), dragText?: string) {
|
|
735
|
+
this.dragStart(undefined, dragText, node, true, undefined, undefined);
|
|
736
|
+
}
|
|
737
|
+
|
|
727
738
|
/**
|
|
728
739
|
* Adds a new tab by dragging a labeled panel to the drop location, dragging starts when you
|
|
729
740
|
* mouse down on the panel
|
|
@@ -742,7 +753,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
|
|
|
742
753
|
this.dragDiv = this.currentDocument!.createElement("div");
|
|
743
754
|
this.dragDiv.className = this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT);
|
|
744
755
|
this.dragDiv.addEventListener("mousedown", this.onDragDivMouseDown);
|
|
745
|
-
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown);
|
|
756
|
+
this.dragDiv.addEventListener("touchstart", this.onDragDivMouseDown, { passive: false });
|
|
746
757
|
|
|
747
758
|
this.dragRectRender(this.dragDivText, undefined, this.newTabJson, () => {
|
|
748
759
|
if (this.dragDiv) {
|
|
@@ -883,7 +894,7 @@ export class Layout extends React.Component<ILayoutProps, ILayoutState> {
|
|
|
883
894
|
|
|
884
895
|
/** @internal */
|
|
885
896
|
showPortal = (control: React.ReactNode, element: HTMLElement) => {
|
|
886
|
-
const portal =
|
|
897
|
+
const portal = createPortal(control, element) as React.ReactPortal;
|
|
887
898
|
this.setState({ portal });
|
|
888
899
|
};
|
|
889
900
|
|
package/src/view/TabButton.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Actions } from "../model/Actions";
|
|
|
4
4
|
import { TabNode } from "../model/TabNode";
|
|
5
5
|
import { TabSetNode } from "../model/TabSetNode";
|
|
6
6
|
import { Rect } from "../Rect";
|
|
7
|
-
import { IIcons, ILayoutCallbacks } from "./Layout";
|
|
7
|
+
import { IconFactory, IIcons, ILayoutCallbacks, TitleFactory } from "./Layout";
|
|
8
8
|
import { ICloseType } from "../model/ICloseType";
|
|
9
9
|
import { CLASSES } from "../Types";
|
|
10
10
|
import { getRenderStateEx, isAuxMouseEvent } from "./Utils";
|
|
@@ -14,8 +14,8 @@ export interface ITabButtonProps {
|
|
|
14
14
|
layout: ILayoutCallbacks;
|
|
15
15
|
node: TabNode;
|
|
16
16
|
selected: boolean;
|
|
17
|
-
iconFactory?:
|
|
18
|
-
titleFactory?:
|
|
17
|
+
iconFactory?: IconFactory;
|
|
18
|
+
titleFactory?: TitleFactory;
|
|
19
19
|
icons: IIcons;
|
|
20
20
|
path: string;
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TabNode } from "../model/TabNode";
|
|
3
|
-
import { ILayoutCallbacks } from "./Layout";
|
|
3
|
+
import { IconFactory, ILayoutCallbacks, TitleFactory } from "./Layout";
|
|
4
4
|
import { CLASSES } from "../Types";
|
|
5
5
|
import { getRenderStateEx } from "./Utils";
|
|
6
6
|
|
|
@@ -8,8 +8,8 @@ import { getRenderStateEx } from "./Utils";
|
|
|
8
8
|
export interface ITabButtonStampProps {
|
|
9
9
|
node: TabNode;
|
|
10
10
|
layout: ILayoutCallbacks;
|
|
11
|
-
iconFactory?:
|
|
12
|
-
titleFactory?:
|
|
11
|
+
iconFactory?: IconFactory;
|
|
12
|
+
titleFactory?: TitleFactory;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/** @internal */
|
|
@@ -33,7 +33,7 @@ export const useTabOverflow = (
|
|
|
33
33
|
|
|
34
34
|
React.useEffect(() => {
|
|
35
35
|
const instance = selfRef.current!;
|
|
36
|
-
instance.addEventListener('wheel', onWheel);
|
|
36
|
+
instance.addEventListener('wheel', onWheel, { passive: false });
|
|
37
37
|
return () => {
|
|
38
38
|
instance.removeEventListener('wheel', onWheel);
|
|
39
39
|
}
|
package/src/view/TabSet.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Actions } from "../model/Actions";
|
|
|
4
4
|
import { TabNode } from "../model/TabNode";
|
|
5
5
|
import { TabSetNode } from "../model/TabSetNode";
|
|
6
6
|
import { showPopup } from "../PopupMenu";
|
|
7
|
-
import { IIcons, ILayoutCallbacks } from "./Layout";
|
|
7
|
+
import { IIcons, ILayoutCallbacks, ITitleObject } from "./Layout";
|
|
8
8
|
import { TabButton } from "./TabButton";
|
|
9
9
|
import { useTabOverflow } from "./TabOverflowHook";
|
|
10
10
|
import { Orientation } from "../Orientation";
|
|
@@ -15,8 +15,8 @@ import { hideElement, isAuxMouseEvent } from "./Utils";
|
|
|
15
15
|
export interface ITabSetProps {
|
|
16
16
|
layout: ILayoutCallbacks;
|
|
17
17
|
node: TabSetNode;
|
|
18
|
-
iconFactory?: (node: TabNode) => React.ReactNode | undefined;
|
|
19
|
-
titleFactory?: (node: TabNode) => React.ReactNode | undefined;
|
|
18
|
+
iconFactory?: (node: TabNode) => (React.ReactNode | undefined);
|
|
19
|
+
titleFactory?: (node: TabNode) => (ITitleObject | React.ReactNode | undefined);
|
|
20
20
|
icons: IIcons;
|
|
21
21
|
editingTab?: TabNode;
|
|
22
22
|
path?: string;
|
|
@@ -146,9 +146,11 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
146
146
|
titleFactory={titleFactory}
|
|
147
147
|
icons={icons}
|
|
148
148
|
/>);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
if (i < node.getChildren().length-1) {
|
|
150
|
+
tabs.push(
|
|
151
|
+
<div key={"divider" + i} className={cm(CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)}></div>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
|
package/src/view/Utils.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TabNode } from "../model/TabNode";
|
|
3
|
-
import { ILayoutCallbacks, ITitleObject } from "./Layout";
|
|
3
|
+
import { IconFactory, ILayoutCallbacks, ITitleObject, TitleFactory } from "./Layout";
|
|
4
4
|
|
|
5
5
|
/** @internal */
|
|
6
6
|
export function getRenderStateEx(
|
|
7
7
|
layout: ILayoutCallbacks,
|
|
8
8
|
node: TabNode,
|
|
9
|
-
iconFactory?:
|
|
10
|
-
titleFactory?:
|
|
9
|
+
iconFactory?: IconFactory,
|
|
10
|
+
titleFactory?: TitleFactory
|
|
11
11
|
) {
|
|
12
12
|
let leadingContent = iconFactory ? iconFactory(node) : undefined;
|
|
13
13
|
let titleContent: React.ReactNode = node.getName();
|
package/style/_base.scss
CHANGED
package/style/dark.css
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
--color-4: #333333;
|
|
9
9
|
--color-5: #404040;
|
|
10
10
|
--color-6: #4d4d4d;
|
|
11
|
-
--color-drag1:
|
|
12
|
-
--color-drag2:
|
|
11
|
+
--color-drag1: rgb(207, 232, 255);
|
|
12
|
+
--color-drag2: rgb(183, 209, 181);
|
|
13
13
|
--color-drag1-background: rgba(128, 128, 128, 0.15);
|
|
14
14
|
--color-drag2-background: rgba(128, 128, 128, 0.15);
|
|
15
15
|
--font-size: medium;
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
.flexlayout__tab_toolbar_sticky_buttons_container {
|
|
308
308
|
display: flex;
|
|
309
309
|
gap: 0.3em;
|
|
310
|
-
padding-left:
|
|
310
|
+
padding-left: 5px;
|
|
311
311
|
align-items: center;
|
|
312
312
|
}
|
|
313
313
|
.flexlayout__tab_floating {
|
package/style/gray.css
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
--color-4: #cccccc;
|
|
9
9
|
--color-5: #bfbfbf;
|
|
10
10
|
--color-6: #b3b3b3;
|
|
11
|
-
--color-drag1:
|
|
12
|
-
--color-drag2:
|
|
11
|
+
--color-drag1: rgb(95, 134, 196);
|
|
12
|
+
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
|
14
14
|
--color-drag2-background: rgba(119, 166, 119, 0.075);
|
|
15
15
|
--font-size: medium;
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
.flexlayout__tab_toolbar_sticky_buttons_container {
|
|
300
300
|
display: flex;
|
|
301
301
|
gap: 0.3em;
|
|
302
|
-
padding-left:
|
|
302
|
+
padding-left: 5px;
|
|
303
303
|
align-items: center;
|
|
304
304
|
}
|
|
305
305
|
.flexlayout__tab_floating {
|
package/style/light.css
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
--color-4: #e2e2e2;
|
|
9
9
|
--color-5: #dbdbdb;
|
|
10
10
|
--color-6: #d4d4d4;
|
|
11
|
-
--color-drag1:
|
|
12
|
-
--color-drag2:
|
|
11
|
+
--color-drag1: rgb(95, 134, 196);
|
|
12
|
+
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
|
14
14
|
--color-drag2-background: rgba(119, 166, 119, 0.075);
|
|
15
15
|
--font-size: medium;
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
.flexlayout__tab_toolbar_sticky_buttons_container {
|
|
295
295
|
display: flex;
|
|
296
296
|
gap: 0.3em;
|
|
297
|
-
padding-left:
|
|
297
|
+
padding-left: 5px;
|
|
298
298
|
align-items: center;
|
|
299
299
|
}
|
|
300
300
|
.flexlayout__tab_floating {
|
package/style/underline.css
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
--color-4: #e6e6e6;
|
|
9
9
|
--color-5: #e0e0e0;
|
|
10
10
|
--color-6: #d9d9d9;
|
|
11
|
-
--color-drag1:
|
|
12
|
-
--color-drag2:
|
|
11
|
+
--color-drag1: rgb(95, 134, 196);
|
|
12
|
+
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
|
14
14
|
--color-drag2-background: rgba(119, 166, 119, 0.075);
|
|
15
15
|
--font-size: medium;
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
--color-edge-marker: gray;
|
|
48
48
|
--color-underline: rgb(65, 105, 225);
|
|
49
49
|
--color-underline-hover: #aaa;
|
|
50
|
+
--underline_height: 3px;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
.flexlayout__layout {
|
|
@@ -216,23 +217,25 @@
|
|
|
216
217
|
box-sizing: border-box;
|
|
217
218
|
padding: 3px 0.5em;
|
|
218
219
|
cursor: pointer;
|
|
220
|
+
padding: 2px 0.5em calc(4px - var(--underline_height)) 0.5em;
|
|
219
221
|
}
|
|
220
222
|
.flexlayout__tab_button--selected {
|
|
221
223
|
background-color: var(--color-tab-selected-background);
|
|
222
224
|
color: var(--color-tab-selected);
|
|
223
|
-
border-bottom:
|
|
225
|
+
border-bottom: var(--underline_height) solid var(--color-underline);
|
|
224
226
|
}
|
|
225
227
|
@media (hover: hover) {
|
|
226
228
|
.flexlayout__tab_button:hover {
|
|
227
229
|
background-color: var(--color-tab-selected-background);
|
|
228
230
|
color: var(--color-tab-selected);
|
|
229
|
-
border-bottom:
|
|
231
|
+
border-bottom: var(--underline_height) solid var(--color-underline-hover);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
.flexlayout__tab_button--unselected {
|
|
233
235
|
background-color: var(--color-tab-unselected-background);
|
|
234
236
|
color: var(--color-tab-unselected);
|
|
235
237
|
color: gray;
|
|
238
|
+
border-bottom: var(--underline_height) solid transparent;
|
|
236
239
|
}
|
|
237
240
|
.flexlayout__tab_button_leading {
|
|
238
241
|
display: flex;
|
|
@@ -301,7 +304,7 @@
|
|
|
301
304
|
.flexlayout__tab_toolbar_sticky_buttons_container {
|
|
302
305
|
display: flex;
|
|
303
306
|
gap: 0.3em;
|
|
304
|
-
padding-left:
|
|
307
|
+
padding-left: 5px;
|
|
305
308
|
align-items: center;
|
|
306
309
|
}
|
|
307
310
|
.flexlayout__tab_floating {
|
|
@@ -397,22 +400,24 @@
|
|
|
397
400
|
margin: 2px 0px;
|
|
398
401
|
box-sizing: border-box;
|
|
399
402
|
white-space: nowrap;
|
|
403
|
+
padding: 2px 0.5em calc(4px - var(--underline_height)) 0.5em;
|
|
400
404
|
}
|
|
401
405
|
.flexlayout__border_button--selected {
|
|
402
406
|
background-color: var(--color-border-tab-selected-background);
|
|
403
407
|
color: var(--color-border-tab-selected);
|
|
404
|
-
border-bottom:
|
|
408
|
+
border-bottom: var(--underline_height) solid var(--color-underline);
|
|
405
409
|
}
|
|
406
410
|
@media (hover: hover) {
|
|
407
411
|
.flexlayout__border_button:hover {
|
|
408
412
|
background-color: var(--color-border-tab-selected-background);
|
|
409
413
|
color: var(--color-border-tab-selected);
|
|
410
|
-
border-bottom:
|
|
414
|
+
border-bottom: var(--underline_height) solid var(--color-underline-hover);
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
417
|
.flexlayout__border_button--unselected {
|
|
414
418
|
background-color: var(--color-border-tab-unselected-background);
|
|
415
419
|
color: var(--color-border-tab-unselected);
|
|
420
|
+
border-bottom: var(--underline_height) solid transparent;
|
|
416
421
|
}
|
|
417
422
|
.flexlayout__border_button_leading {
|
|
418
423
|
display: flex;
|
package/style/underline.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["underline.scss","_base.scss"],"names":[],"mappings":"AAkBI;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;;;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["underline.scss","_base.scss"],"names":[],"mappings":"AAkBI;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;;;ACtEJ;EARA;EACA;EACA;EACA;EACA;EAMI;;AAGJ;EACI;;AAGA;EACI;IACI;IACA;IACA;;;AAIR;EACI;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACI;ED4DR;EACA;EACA;;AC1DI;EACI;EACA;EACA;EACA;;AAGJ;EAEI;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACI;;AAKJ;EAEI;EACA;EACA;EACA;;AAIJ;EACI;;AAGJ;EACI;;AAGJ;EAEI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;;AAEJ;EACI;;AAMhB;EACI;;AAIJ;EACI;;AAKR;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EAEA;EDtGR;;ACyGQ;EACI;EACA;EDvGZ;;AC0GQ;EACI;IACI;IACA;IDpGhB;;;ACyGQ;EACI;EACA;EDhHZ;EACA;;AC2HQ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;;AACA;ED9IZ;;ACsJQ;EACI;IACI;;;AAIR;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAIR;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;IDtLhB;;;ACwMQ;EACI;EACA;EACA;EACA;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;;AAKZ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACI;EACA;;AAGJ;EACI;EACA;;AAGJ;EACI;EACA;EACA;;AAGJ;EACI;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;;AAEJ;EACI;EACA;EACA;;AAKZ;EACI;EDnQR;EACA;EACA;;ACqQI;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EDjTR;;ACoTQ;EACI;EACA;EDlTZ;;ACqTQ;EACI;IACI;IACA;IDhThB;;;ACqTQ;EACI;EACA;ED3TZ;;AC+TQ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;;AACA;ED9VZ;;ACsWQ;EACI;IACI;;;AAIR;EACI;;AAIR;EACI;EACA;EACA;;AAEA;EAEI;EACA;EACA;;AAGJ;EAEI;EACA;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;IDvYhB;;;AC+YY;EACI;EACA;EACA;EACA;EACA;EACA;;AAchB;EACI;EACA;;AAEA;EACI;EACA;EACA;EACA;;AAGJ;EACI;IACI;;;AAIR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKJ;EACI;;AAGJ;EArkBJ;EACA;EACA;EACA;EACA;;AAqkBI;EACI;EA1kBR;EACA;EACA;EACA;EACA;EAykBQ;EACA;EACA;;AAIR;EAnlBA;EACA;EACA;EACA;EACA;EAilBI;EACA;;AAEJ;EACI;EACA;;AAOJ;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EACA;EACA;;;ADtcR;EACI","file":"underline.css"}
|
package/style/underline.scss
CHANGED
|
@@ -77,6 +77,7 @@ $font-family: Roboto, Arial, sans-serif !default;
|
|
|
77
77
|
|
|
78
78
|
--color-underline: rgb(65, 105, 225);
|
|
79
79
|
--color-underline-hover: #aaa;
|
|
80
|
+
--underline_height: 3px;
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -102,18 +103,20 @@ $font-family: Roboto, Arial, sans-serif !default;
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
@mixin tab_button_mixin {
|
|
106
|
+
padding: 2px 0.5em calc(4px - var(--underline_height)) 0.5em;
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
@mixin tab_button_selected_mixin {
|
|
108
|
-
border-bottom:
|
|
110
|
+
border-bottom: var(--underline_height) solid var(--color-underline);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
@mixin tab_button_unselected_mixin {
|
|
112
114
|
color: gray;
|
|
115
|
+
border-bottom: var(--underline_height) solid transparent;
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
@mixin tab_button_hovered_mixin {
|
|
116
|
-
border-bottom:
|
|
119
|
+
border-bottom: var(--underline_height) solid var(--color-underline-hover);
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
@mixin close_button_hovered_mixin {
|
|
@@ -128,17 +131,19 @@ $font-family: Roboto, Arial, sans-serif !default;
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
@mixin border_button_mixin {
|
|
134
|
+
padding: 2px 0.5em calc(4px - var(--underline_height)) 0.5em;
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
@mixin border_button_selected_mixin {
|
|
134
|
-
border-bottom:
|
|
138
|
+
border-bottom: var(--underline_height) solid var(--color-underline);
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
@mixin border_button_unselected_mixin {
|
|
138
|
-
|
|
142
|
+
border-bottom: var(--underline_height) solid transparent;
|
|
143
|
+
}
|
|
139
144
|
|
|
140
145
|
@mixin border_button_hovered_mixin {
|
|
141
|
-
border-bottom:
|
|
146
|
+
border-bottom: var(--underline_height) solid var(--color-underline-hover);
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
@mixin splitter_mixin {
|