flexlayout-react 0.8.0 → 0.8.2
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 +12 -0
- package/README.md +6 -6
- package/declarations/view/Layout.d.ts +1 -0
- package/dist/flexlayout.js +40 -10
- package/dist/flexlayout_min.js +2 -1
- package/dist/flexlayout_min.js.LICENSE.txt +19 -0
- package/lib/model/TabSetNode.js +2 -0
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderButton.js +7 -2
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/Layout.js +1 -0
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/TabButton.js +7 -2
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabSet.js +7 -2
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +29 -31
- package/src/model/TabSetNode.ts +3 -0
- package/src/view/BorderButton.tsx +6 -2
- package/src/view/Layout.tsx +8 -6
- package/src/view/TabButton.tsx +6 -2
- package/src/view/TabSet.tsx +6 -2
- package/style/dark.css +5 -5
- package/style/gray.css +5 -5
- package/style/light.css +6 -6
- package/style/rounded.css +6 -6
- package/style/underline.css +6 -6
package/src/view/Layout.tsx
CHANGED
|
@@ -85,7 +85,7 @@ export interface ILayoutProps {
|
|
|
85
85
|
*/
|
|
86
86
|
export class Layout extends React.Component<ILayoutProps> {
|
|
87
87
|
/** @internal */
|
|
88
|
-
private selfRef: React.RefObject<LayoutInternal>;
|
|
88
|
+
private selfRef: React.RefObject<LayoutInternal | null>;
|
|
89
89
|
/** @internal */
|
|
90
90
|
private revision: number; // so LayoutInternal knows this is a parent render (used for optimization)
|
|
91
91
|
|
|
@@ -190,10 +190,10 @@ interface ILayoutInternalState {
|
|
|
190
190
|
export class LayoutInternal extends React.Component<ILayoutInternalProps, ILayoutInternalState> {
|
|
191
191
|
public static dragState: DragState | undefined = undefined;
|
|
192
192
|
|
|
193
|
-
private selfRef: React.RefObject<HTMLDivElement>;
|
|
194
|
-
private moveablesRef: React.RefObject<HTMLDivElement>;
|
|
195
|
-
private findBorderBarSizeRef: React.RefObject<HTMLDivElement>;
|
|
196
|
-
private mainRef: React.RefObject<HTMLDivElement>;
|
|
193
|
+
private selfRef: React.RefObject<HTMLDivElement | null>;
|
|
194
|
+
private moveablesRef: React.RefObject<HTMLDivElement | null>;
|
|
195
|
+
private findBorderBarSizeRef: React.RefObject<HTMLDivElement | null>;
|
|
196
|
+
private mainRef: React.RefObject<HTMLDivElement | null>;
|
|
197
197
|
private previousModel?: Model;
|
|
198
198
|
private orderedIds: string[];
|
|
199
199
|
private moveableElementMap = new Map<string, HTMLElement>();
|
|
@@ -1033,7 +1033,7 @@ export class LayoutInternal extends React.Component<ILayoutInternalProps, ILayou
|
|
|
1033
1033
|
|
|
1034
1034
|
|
|
1035
1035
|
public setDragComponent(event: DragEvent, component: React.ReactNode, x: number, y: number) {
|
|
1036
|
-
let dragElement
|
|
1036
|
+
let dragElement = (
|
|
1037
1037
|
<div style={{ position: "unset" }}
|
|
1038
1038
|
className={this.getClassName(CLASSES.FLEXLAYOUT__LAYOUT) + " " + this.getClassName(CLASSES.FLEXLAYOUT__DRAG_RECT)}>
|
|
1039
1039
|
{component}
|
|
@@ -1224,6 +1224,8 @@ export class LayoutInternal extends React.Component<ILayoutInternalProps, ILayou
|
|
|
1224
1224
|
// *************************** End Drag Drop *************************************
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
|
+
export const FlexLayoutVersion = "0.8.1";
|
|
1228
|
+
|
|
1227
1229
|
export type DragRectRenderCallback = (
|
|
1228
1230
|
content: React.ReactNode | undefined,
|
|
1229
1231
|
node?: Node,
|
package/src/view/TabButton.tsx
CHANGED
|
@@ -31,8 +31,12 @@ export const TabButton = (props: ITabButtonProps) => {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const onDragStart = (event: React.DragEvent<HTMLElement>) => {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (node.isEnableDrag()) {
|
|
35
|
+
event.stopPropagation(); // prevent starting a tabset drag as well
|
|
36
|
+
layout.setDragNode(event.nativeEvent, node as TabNode);
|
|
37
|
+
} else {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
}
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
const onDragEnd = (event: React.DragEvent<HTMLElement>) => {
|
package/src/view/TabSet.tsx
CHANGED
|
@@ -73,8 +73,12 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
73
73
|
|
|
74
74
|
const onDragStart = (event: React.DragEvent<HTMLElement>) => {
|
|
75
75
|
if (!layout.getEditingTab()) {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
if (node.isEnableDrag()) {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
layout.setDragNode(event.nativeEvent, node as TabSetNode);
|
|
79
|
+
} else {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
}
|
|
78
82
|
} else {
|
|
79
83
|
event.preventDefault();
|
|
80
84
|
}
|
package/style/dark.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--color-text: #eeeeee;
|
|
3
3
|
--color-background: black;
|
|
4
4
|
--color-base: black;
|
|
5
|
-
--color-1:
|
|
6
|
-
--color-2:
|
|
7
|
-
--color-3:
|
|
5
|
+
--color-1: rgb(17.85, 17.85, 17.85);
|
|
6
|
+
--color-2: rgb(25.5, 25.5, 25.5);
|
|
7
|
+
--color-3: rgb(38.25, 38.25, 38.25);
|
|
8
8
|
--color-4: #333333;
|
|
9
|
-
--color-5:
|
|
10
|
-
--color-6:
|
|
9
|
+
--color-5: rgb(63.75, 63.75, 63.75);
|
|
10
|
+
--color-6: rgb(76.5, 76.5, 76.5);
|
|
11
11
|
--color-drag1: rgb(207, 232, 255);
|
|
12
12
|
--color-drag2: rgb(183, 209, 181);
|
|
13
13
|
--color-drag1-background: rgba(128, 128, 128, 0.15);
|
package/style/gray.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--color-text: black;
|
|
3
3
|
--color-background: white;
|
|
4
4
|
--color-base: white;
|
|
5
|
-
--color-1:
|
|
6
|
-
--color-2:
|
|
7
|
-
--color-3:
|
|
5
|
+
--color-1: rgb(247.35, 247.35, 247.35);
|
|
6
|
+
--color-2: rgb(229.5, 229.5, 229.5);
|
|
7
|
+
--color-3: rgb(216.75, 216.75, 216.75);
|
|
8
8
|
--color-4: #cccccc;
|
|
9
|
-
--color-5:
|
|
10
|
-
--color-6:
|
|
9
|
+
--color-5: rgb(191.25, 191.25, 191.25);
|
|
10
|
+
--color-6: rgb(178.5, 178.5, 178.5);
|
|
11
11
|
--color-drag1: rgb(95, 134, 196);
|
|
12
12
|
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
package/style/light.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--color-text: black;
|
|
3
3
|
--color-background: white;
|
|
4
4
|
--color-base: white;
|
|
5
|
-
--color-1:
|
|
6
|
-
--color-2:
|
|
7
|
-
--color-3:
|
|
8
|
-
--color-4:
|
|
9
|
-
--color-5:
|
|
10
|
-
--color-6:
|
|
5
|
+
--color-1: rgb(247.35, 247.35, 247.35);
|
|
6
|
+
--color-2: rgb(239.9295, 239.9295, 239.9295);
|
|
7
|
+
--color-3: rgb(232.731615, 232.731615, 232.731615);
|
|
8
|
+
--color-4: rgb(225.74966655, 225.74966655, 225.74966655);
|
|
9
|
+
--color-5: rgb(218.9771765535, 218.9771765535, 218.9771765535);
|
|
10
|
+
--color-6: rgb(212.4078612569, 212.4078612569, 212.4078612569);
|
|
11
11
|
--color-drag1: rgb(95, 134, 196);
|
|
12
12
|
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
package/style/rounded.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--color-text: black;
|
|
3
3
|
--color-background: transparent;
|
|
4
4
|
--color-base: #f2f6fb;
|
|
5
|
-
--color-1:
|
|
6
|
-
--color-2:
|
|
7
|
-
--color-3:
|
|
8
|
-
--color-4:
|
|
9
|
-
--color-5:
|
|
10
|
-
--color-6:
|
|
5
|
+
--color-1: rgb(230.69, 238.17, 247.52);
|
|
6
|
+
--color-2: rgb(219.7193, 230.5749, 244.1444);
|
|
7
|
+
--color-3: rgb(209.077721, 223.207653, 240.870068);
|
|
8
|
+
--color-4: rgb(198.75538937, 216.06142341, 237.69396596);
|
|
9
|
+
--color-5: rgb(188.7427276889, 209.1295807077, 234.6131469812);
|
|
10
|
+
--color-6: rgb(179.0304458582, 202.4056932865, 231.6247525718);
|
|
11
11
|
--color-drag1: rgb(95, 134, 196);
|
|
12
12
|
--color-drag2: rgb(95, 134, 196);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|
package/style/underline.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
--color-text: black;
|
|
3
3
|
--color-background: white;
|
|
4
4
|
--color-base: white;
|
|
5
|
-
--color-1:
|
|
6
|
-
--color-2:
|
|
7
|
-
--color-3:
|
|
8
|
-
--color-4:
|
|
9
|
-
--color-5:
|
|
10
|
-
--color-6:
|
|
5
|
+
--color-1: rgb(249.9, 249.9, 249.9);
|
|
6
|
+
--color-2: rgb(244.902, 244.902, 244.902);
|
|
7
|
+
--color-3: rgb(237.55494, 237.55494, 237.55494);
|
|
8
|
+
--color-4: rgb(230.4282918, 230.4282918, 230.4282918);
|
|
9
|
+
--color-5: rgb(223.515443046, 223.515443046, 223.515443046);
|
|
10
|
+
--color-6: rgb(216.8099797546, 216.8099797546, 216.8099797546);
|
|
11
11
|
--color-drag1: rgb(95, 134, 196);
|
|
12
12
|
--color-drag2: rgb(119, 166, 119);
|
|
13
13
|
--color-drag1-background: rgba(95, 134, 196, 0.1);
|