flexlayout-react 0.8.2 → 0.8.4
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 +10 -0
- package/README.md +3 -3
- package/declarations/Types.d.ts +3 -1
- package/declarations/model/BorderNode.d.ts +1 -0
- package/declarations/model/IJsonModel.d.ts +30 -2
- package/declarations/model/TabSetNode.d.ts +1 -0
- package/declarations/view/Layout.d.ts +1 -1
- package/declarations/view/Utils.d.ts +0 -3
- package/dist/flexlayout.js +12 -12
- package/dist/flexlayout_min.js +1 -1
- package/lib/Types.js +2 -0
- package/lib/Types.js.map +1 -1
- package/lib/model/BorderNode.js +4 -0
- package/lib/model/BorderNode.js.map +1 -1
- package/lib/model/LayoutWindow.js +1 -3
- package/lib/model/LayoutWindow.js.map +1 -1
- package/lib/model/Model.js +2 -9
- package/lib/model/Model.js.map +1 -1
- package/lib/model/TabSetNode.js +5 -1
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderTabSet.js +17 -13
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/Layout.js +2 -2
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/Splitter.js +2 -2
- package/lib/view/Tab.js +5 -0
- package/lib/view/Tab.js.map +1 -1
- package/lib/view/TabOverflowHook.js +141 -112
- package/lib/view/TabOverflowHook.js.map +1 -1
- package/lib/view/TabSet.js +14 -20
- package/lib/view/TabSet.js.map +1 -1
- package/lib/view/Utils.js +0 -17
- package/lib/view/Utils.js.map +1 -1
- package/package.json +1 -1
- package/src/Types.ts +3 -0
- package/src/model/BorderNode.ts +7 -0
- package/src/model/IJsonModel.ts +34 -2
- package/src/model/LayoutWindow.ts +1 -3
- package/src/model/Model.ts +2 -9
- package/src/model/TabSetNode.ts +10 -1
- package/src/view/BorderTabSet.tsx +26 -15
- package/src/view/Layout.tsx +2 -2
- package/src/view/Splitter.tsx +2 -2
- package/src/view/Tab.tsx +6 -0
- package/src/view/TabOverflowHook.tsx +165 -127
- package/src/view/TabSet.tsx +19 -21
- package/src/view/Utils.tsx +0 -24
- package/style/_base.scss +26 -3
- package/style/dark.css +701 -685
- package/style/dark.css.map +1 -1
- package/style/gray.css +684 -668
- package/style/gray.css.map +1 -1
- package/style/light.css +685 -669
- package/style/light.css.map +1 -1
- package/style/rounded.css +730 -697
- package/style/rounded.css.map +1 -1
- package/style/rounded.scss +22 -5
- package/style/underline.css +705 -690
- package/style/underline.css.map +1 -1
- package/style/underline.scss +1 -1
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
0.8.4
|
|
2
|
+
Added attribute 'enableTabScrollbar' to TabSet and Border nodes
|
|
3
|
+
Enabling this attribute will show a mini 'scrollbar' for the tabs to indicate the scroll position
|
|
4
|
+
See the Demo apps default layout for an example.
|
|
5
|
+
|
|
6
|
+
0.8.3
|
|
7
|
+
Prevent sticky buttons scrolling when there are no tabs
|
|
8
|
+
Fix border 'show' attribute
|
|
9
|
+
Removed code to adjust popout positions when loading
|
|
10
|
+
|
|
1
11
|
0.8.2
|
|
2
12
|
Updated dependencies
|
|
3
13
|
Enabled use with React 19
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ FlexLayout's only dependency is React.
|
|
|
20
20
|
|
|
21
21
|
Features:
|
|
22
22
|
* splitters
|
|
23
|
-
* tabs
|
|
23
|
+
* tabs (scrolling or wrapped)
|
|
24
24
|
* tab dragging and ordering
|
|
25
25
|
* tab set dragging (move all the tabs in a tab set in one operation)
|
|
26
26
|
* dock to tab set or edge of frame
|
|
@@ -147,13 +147,13 @@ function App() {
|
|
|
147
147
|
}
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
The above code would render two tab sets horizontally each containing a single tab that hosts a
|
|
150
|
+
The above code would render two tab sets horizontally each containing a single tab that hosts a div component (returned from the factory). The tabs could be moved and resized by dragging and dropping. Additional tabs could be added to the layout by sending actions to the model.
|
|
151
151
|
|
|
152
152
|
Try it now using [CodeSandbox](https://codesandbox.io/p/sandbox/yvjzqf)
|
|
153
153
|
|
|
154
154
|
A simple Typescript example can be found here:
|
|
155
155
|
|
|
156
|
-
https://github.com/nealus/
|
|
156
|
+
https://github.com/nealus/flexlayout-vite-example
|
|
157
157
|
|
|
158
158
|
The model json contains 4 top level elements:
|
|
159
159
|
|
package/declarations/Types.d.ts
CHANGED
|
@@ -91,5 +91,7 @@ export declare enum CLASSES {
|
|
|
91
91
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close",
|
|
92
92
|
FLEXLAYOUT__POPUP_MENU_CONTAINER = "flexlayout__popup_menu_container",
|
|
93
93
|
FLEXLAYOUT__POPUP_MENU_ITEM = "flexlayout__popup_menu_item",
|
|
94
|
-
FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu"
|
|
94
|
+
FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu",
|
|
95
|
+
FLEXLAYOUT__MINI_SCROLLBAR = "flexlayout__mini_scrollbar",
|
|
96
|
+
FLEXLAYOUT__MINI_SCROLLBAR_HIDDEN = "flexlayout__mini_scrollbar_hidden"
|
|
95
97
|
}
|
|
@@ -76,6 +76,14 @@ export interface IGlobalAttributes {
|
|
|
76
76
|
Default: true
|
|
77
77
|
*/
|
|
78
78
|
borderEnableDrop?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
Value for BorderNode attribute enableTabScrollbar if not overridden
|
|
81
|
+
|
|
82
|
+
whether to show a mini scrollbar for the tabs
|
|
83
|
+
|
|
84
|
+
Default: false
|
|
85
|
+
*/
|
|
86
|
+
borderEnableTabScrollbar?: boolean;
|
|
79
87
|
/**
|
|
80
88
|
Value for BorderNode attribute maxSize if not overridden
|
|
81
89
|
|
|
@@ -359,6 +367,14 @@ export interface IGlobalAttributes {
|
|
|
359
367
|
Default: false
|
|
360
368
|
*/
|
|
361
369
|
tabSetEnableSingleTabStretch?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
Value for TabSetNode attribute enableTabScrollbar if not overridden
|
|
372
|
+
|
|
373
|
+
whether to show a mini scrollbar for the tabs
|
|
374
|
+
|
|
375
|
+
Default: false
|
|
376
|
+
*/
|
|
377
|
+
tabSetEnableTabScrollbar?: boolean;
|
|
362
378
|
/**
|
|
363
379
|
Value for TabSetNode attribute enableTabStrip if not overridden
|
|
364
380
|
|
|
@@ -370,7 +386,7 @@ export interface IGlobalAttributes {
|
|
|
370
386
|
/**
|
|
371
387
|
Value for TabSetNode attribute enableTabWrap if not overridden
|
|
372
388
|
|
|
373
|
-
|
|
389
|
+
wrap tabs onto multiple lines
|
|
374
390
|
|
|
375
391
|
Default: false
|
|
376
392
|
*/
|
|
@@ -503,6 +519,12 @@ export interface ITabSetAttributes {
|
|
|
503
519
|
Default: inherited from Global attribute tabSetEnableSingleTabStretch (default false)
|
|
504
520
|
*/
|
|
505
521
|
enableSingleTabStretch?: boolean;
|
|
522
|
+
/**
|
|
523
|
+
whether to show a mini scrollbar for the tabs
|
|
524
|
+
|
|
525
|
+
Default: inherited from Global attribute tabSetEnableTabScrollbar (default false)
|
|
526
|
+
*/
|
|
527
|
+
enableTabScrollbar?: boolean;
|
|
506
528
|
/**
|
|
507
529
|
enable tab strip and allow multiple tabs in this tabset
|
|
508
530
|
|
|
@@ -510,7 +532,7 @@ export interface ITabSetAttributes {
|
|
|
510
532
|
*/
|
|
511
533
|
enableTabStrip?: boolean;
|
|
512
534
|
/**
|
|
513
|
-
|
|
535
|
+
wrap tabs onto multiple lines
|
|
514
536
|
|
|
515
537
|
Default: inherited from Global attribute tabSetEnableTabWrap (default false)
|
|
516
538
|
*/
|
|
@@ -772,6 +794,12 @@ export interface IBorderAttributes {
|
|
|
772
794
|
Default: inherited from Global attribute borderEnableDrop (default true)
|
|
773
795
|
*/
|
|
774
796
|
enableDrop?: boolean;
|
|
797
|
+
/**
|
|
798
|
+
whether to show a mini scrollbar for the tabs
|
|
799
|
+
|
|
800
|
+
Default: inherited from Global attribute borderEnableTabScrollbar (default false)
|
|
801
|
+
*/
|
|
802
|
+
enableTabScrollbar?: boolean;
|
|
775
803
|
/**
|
|
776
804
|
the maximum size of the tab area
|
|
777
805
|
|
|
@@ -37,6 +37,7 @@ export declare class TabSetNode extends Node implements IDraggable, IDropTarget
|
|
|
37
37
|
isEnableSingleTabStretch(): boolean;
|
|
38
38
|
isEnableTabStrip(): boolean;
|
|
39
39
|
isAutoSelectTab(): boolean;
|
|
40
|
+
isEnableTabScrollbar(): boolean;
|
|
40
41
|
getClassNameTabStrip(): string | undefined;
|
|
41
42
|
getTabLocation(): string;
|
|
42
43
|
toJson(): IJsonTabSetNode;
|
|
@@ -96,7 +96,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
96
96
|
/** Get the root div element of the layout */
|
|
97
97
|
getRootDiv(): HTMLDivElement | null;
|
|
98
98
|
}
|
|
99
|
-
export declare const FlexLayoutVersion = "0.8.
|
|
99
|
+
export declare const FlexLayoutVersion = "0.8.4";
|
|
100
100
|
export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
|
|
101
101
|
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
102
102
|
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Node } from "../model/Node";
|
|
3
|
-
import { Rect } from "../Rect";
|
|
4
3
|
export declare function enablePointerOnIFrames(enable: boolean, currentDocument: Document): void;
|
|
5
4
|
export declare function getElementsByTagName(tag: string, currentDocument: Document): Element[];
|
|
6
5
|
export declare function startDrag(doc: Document, event: React.PointerEvent<HTMLElement>, drag: (x: number, y: number) => void, dragEnd: () => void, dragCancel: () => void): void;
|
|
7
6
|
export declare function canDockToWindow(node: Node): boolean;
|
|
8
|
-
export declare function keepOnScreen(rect: Rect): Rect;
|
|
9
|
-
export declare function isOnScreen(rect: Rect): boolean;
|
|
10
7
|
export declare function copyInlineStyles(source: HTMLElement, target: HTMLElement): boolean;
|
|
11
8
|
export declare function isSafari(): boolean;
|