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.
@@ -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: JSX.Element = (
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,
@@ -31,8 +31,12 @@ export const TabButton = (props: ITabButtonProps) => {
31
31
  });
32
32
 
33
33
  const onDragStart = (event: React.DragEvent<HTMLElement>) => {
34
- event.stopPropagation(); // prevent starting a tabset drag as well
35
- layout.setDragNode(event.nativeEvent, node as TabNode);
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>) => {
@@ -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
- event.stopPropagation();
77
- layout.setDragNode(event.nativeEvent, node as TabSetNode);
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: #121212;
6
- --color-2: #1a1a1a;
7
- --color-3: #262626;
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: #404040;
10
- --color-6: #4d4d4d;
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: #f7f7f7;
6
- --color-2: #e6e6e6;
7
- --color-3: #d9d9d9;
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: #bfbfbf;
10
- --color-6: #b3b3b3;
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: #f7f7f7;
6
- --color-2: #f0f0f0;
7
- --color-3: #e9e9e9;
8
- --color-4: #e2e2e2;
9
- --color-5: #dbdbdb;
10
- --color-6: #d4d4d4;
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: #e7eef8;
6
- --color-2: #dce7f4;
7
- --color-3: #d1dff1;
8
- --color-4: #c7d8ee;
9
- --color-5: #bdd1eb;
10
- --color-6: #b3cae8;
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);
@@ -2,12 +2,12 @@
2
2
  --color-text: black;
3
3
  --color-background: white;
4
4
  --color-base: white;
5
- --color-1: #fafafa;
6
- --color-2: whitesmoke;
7
- --color-3: #eeeeee;
8
- --color-4: #e6e6e6;
9
- --color-5: #e0e0e0;
10
- --color-6: #d9d9d9;
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);