flexlayout-react 0.8.4 → 0.8.6
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 +9 -0
- package/README.md +29 -2
- package/declarations/Types.d.ts +2 -6
- package/declarations/view/Layout.d.ts +3 -1
- package/dist/flexlayout.js +7 -7
- package/dist/flexlayout_min.js +1 -1
- package/lib/Types.js +2 -6
- package/lib/Types.js.map +1 -1
- package/lib/model/TabSetNode.js +9 -4
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderTabSet.js +11 -5
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/Layout.js +3 -2
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/PopupMenu.js +11 -5
- package/lib/view/PopupMenu.js.map +1 -1
- package/lib/view/TabOverflowHook.js +104 -21
- package/lib/view/TabOverflowHook.js.map +1 -1
- package/lib/view/TabSet.js +11 -5
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +2 -2
- package/src/Types.ts +3 -8
- package/src/model/TabSetNode.ts +8 -4
- package/src/view/BorderTabSet.tsx +38 -24
- package/src/view/Layout.tsx +9 -5
- package/src/view/PopupMenu.tsx +31 -19
- package/src/view/TabOverflowHook.tsx +112 -21
- package/src/view/TabSet.tsx +36 -22
- package/style/_base.scss +569 -595
- package/style/_themes.scss +649 -0
- package/style/combined.css +1055 -0
- package/style/combined.css.map +1 -0
- package/style/combined.scss +46 -0
- package/style/dark.css +704 -701
- package/style/dark.css.map +1 -1
- package/style/dark.scss +5 -181
- package/style/gray.css +707 -684
- package/style/gray.css.map +1 -1
- package/style/gray.scss +5 -180
- package/style/light.css +681 -685
- package/style/light.css.map +1 -1
- package/style/light.scss +5 -163
- package/style/rounded.css +723 -730
- package/style/rounded.css.map +1 -1
- package/style/rounded.scss +5 -210
- package/style/underline.css +710 -705
- package/style/underline.css.map +1 -1
- package/style/underline.scss +5 -186
- package/.editorconfig +0 -8
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -104
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.prettierrc.json +0 -3
- package/Screenshot_light.png +0 -0
- package/Screenshot_rounded.png +0 -0
- package/dist/bundles/demo.js +0 -232052
- package/dist/bundles/demo.js.map +0 -1
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
0.8.6
|
|
2
|
+
Restructured scss files to remove use of deprecated @import rule
|
|
3
|
+
Added combined.css containing all themes.
|
|
4
|
+
Updated demo to use combined.css for simple theme switching using class names
|
|
5
|
+
Added option in demo to show the layout structure
|
|
6
|
+
|
|
7
|
+
0.8.5
|
|
8
|
+
Changed the mini scrollbar to only show when tabs are hovered over
|
|
9
|
+
|
|
1
10
|
0.8.4
|
|
2
11
|
Added attribute 'enableTabScrollbar' to TabSet and Border nodes
|
|
3
12
|
Enabling this attribute will show a mini 'scrollbar' for the tabs to indicate the scroll position
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Features:
|
|
|
30
30
|
* popout tabs into new browser windows
|
|
31
31
|
* submodels, allow layouts inside layouts
|
|
32
32
|
* tab renaming (double click tab text to rename)
|
|
33
|
-
* theming - light, underline, gray,
|
|
33
|
+
* theming - light, dark, underline, gray, rounded and combined
|
|
34
34
|
* works on mobile devices (iPad, Android)
|
|
35
35
|
* add tabs using drag, add to active tab set, add to tab set by id
|
|
36
36
|
* tab and tab set attributes: enableTabStrip, enableDock, enableDrop...
|
|
@@ -52,7 +52,7 @@ Import FlexLayout in your modules:
|
|
|
52
52
|
import {Layout, Model} from 'flexlayout-react';
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Include the light, underline, gray or
|
|
55
|
+
Include the light, dark, underline, gray, rounded or combined theme by either:
|
|
56
56
|
|
|
57
57
|
Adding an additional import:
|
|
58
58
|
|
|
@@ -66,6 +66,9 @@ or by adding the css to your html:
|
|
|
66
66
|
<link rel="stylesheet" href="node_modules/flexlayout-react/style/light.css" />
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
[How to change the theme dynamically in code](#dynamically-changing-the-theme)
|
|
70
|
+
|
|
71
|
+
|
|
69
72
|
## Usage
|
|
70
73
|
|
|
71
74
|
The `<Layout>` component renders the tab sets and splitters, it takes the following props:
|
|
@@ -173,6 +176,10 @@ The layout element is built up using 3 types of 'node':
|
|
|
173
176
|
|
|
174
177
|
The layout structure is defined with rows within rows that contain tabsets that themselves contain tabs.
|
|
175
178
|
|
|
179
|
+
Within the demo app you can show the layout structure by ticking the 'Show layout' checkbox, rows are shown in blue, tabsets in orange.
|
|
180
|
+
|
|
181
|
+

|
|
182
|
+
|
|
176
183
|
The optional borders element is made up of border nodes
|
|
177
184
|
|
|
178
185
|
* border - borders contain a list of tabs and the index of the selected tab, they can only be used in the borders
|
|
@@ -196,6 +203,26 @@ tabs or drag and drop).
|
|
|
196
203
|
global: {tabSetEnableTabStrip:false},
|
|
197
204
|
```
|
|
198
205
|
|
|
206
|
+
## Dynamically Changing the Theme
|
|
207
|
+
|
|
208
|
+
The 'combined.css' theme contains all the other themes and can be used for theme switching.
|
|
209
|
+
|
|
210
|
+
When using combined.css, add a className (of the form "flexlayout__theme_[theme name]") to the div containing the `<Layout>` to select the applied theme.
|
|
211
|
+
|
|
212
|
+
For example:
|
|
213
|
+
```
|
|
214
|
+
<div ref={containerRef} className="flexlayout__theme_light">
|
|
215
|
+
<Layout model={model} factory={factory} />
|
|
216
|
+
</div>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Change the theme in code by changing the className on the containing div.
|
|
220
|
+
|
|
221
|
+
For example:
|
|
222
|
+
```
|
|
223
|
+
containerRef.current!.className = "flexlayout__theme_dark"
|
|
224
|
+
```
|
|
225
|
+
|
|
199
226
|
## Model Actions
|
|
200
227
|
|
|
201
228
|
Once the model json has been loaded all changes to the model are applied through actions.
|
package/declarations/Types.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export declare enum CLASSES {
|
|
|
30
30
|
FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER = "flexlayout__error_boundary_container",
|
|
31
31
|
FLEXLAYOUT__ERROR_BOUNDARY_CONTENT = "flexlayout__error_boundary_content",
|
|
32
32
|
FLEXLAYOUT__FLOATING_WINDOW_CONTENT = "flexlayout__floating_window_content",
|
|
33
|
-
FLEXLAYOUT__FLOATING_WINDOW_TAB = "flexlayout__floating_window_tab",
|
|
34
33
|
FLEXLAYOUT__LAYOUT = "flexlayout__layout",
|
|
35
34
|
FLEXLAYOUT__LAYOUT_MOVEABLES = "flexlayout__layout_moveables",
|
|
36
35
|
FLEXLAYOUT__LAYOUT_OVERLAY = "flexlayout__layout_overlay",
|
|
@@ -56,11 +55,9 @@ export declare enum CLASSES {
|
|
|
56
55
|
FLEXLAYOUT__TABSET = "flexlayout__tabset",
|
|
57
56
|
FLEXLAYOUT__TABSET_CONTAINER = "flexlayout__tabset_container",
|
|
58
57
|
FLEXLAYOUT__TABSET_HEADER = "flexlayout__tabset_header",
|
|
59
|
-
FLEXLAYOUT__TABSET_HEADER_SIZER = "flexlayout__tabset_header_sizer",
|
|
60
58
|
FLEXLAYOUT__TABSET_HEADER_CONTENT = "flexlayout__tabset_header_content",
|
|
61
59
|
FLEXLAYOUT__TABSET_MAXIMIZED = "flexlayout__tabset-maximized",
|
|
62
60
|
FLEXLAYOUT__TABSET_SELECTED = "flexlayout__tabset-selected",
|
|
63
|
-
FLEXLAYOUT__TABSET_SIZER = "flexlayout__tabset_sizer",
|
|
64
61
|
FLEXLAYOUT__TABSET_TAB_DIVIDER = "flexlayout__tabset_tab_divider",
|
|
65
62
|
FLEXLAYOUT__TABSET_CONTENT = "flexlayout__tabset_content",
|
|
66
63
|
FLEXLAYOUT__TABSET_TABBAR_INNER = "flexlayout__tabset_tabbar_inner",
|
|
@@ -80,8 +77,6 @@ export declare enum CLASSES {
|
|
|
80
77
|
FLEXLAYOUT__TAB_BUTTON_TEXTBOX = "flexlayout__tab_button_textbox",
|
|
81
78
|
FLEXLAYOUT__TAB_BUTTON_TRAILING = "flexlayout__tab_button_trailing",
|
|
82
79
|
FLEXLAYOUT__TAB_BUTTON_STAMP = "flexlayout__tab_button_stamp",
|
|
83
|
-
FLEXLAYOUT__TAB_FLOATING = "flexlayout__tab_floating",
|
|
84
|
-
FLEXLAYOUT__TAB_FLOATING_INNER = "flexlayout__tab_floating_inner",
|
|
85
80
|
FLEXLAYOUT__TAB_TOOLBAR = "flexlayout__tab_toolbar",
|
|
86
81
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON = "flexlayout__tab_toolbar_button",
|
|
87
82
|
FLEXLAYOUT__TAB_TOOLBAR_ICON = "flexlayout__tab_toolbar_icon",
|
|
@@ -91,7 +86,8 @@ export declare enum CLASSES {
|
|
|
91
86
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close",
|
|
92
87
|
FLEXLAYOUT__POPUP_MENU_CONTAINER = "flexlayout__popup_menu_container",
|
|
93
88
|
FLEXLAYOUT__POPUP_MENU_ITEM = "flexlayout__popup_menu_item",
|
|
89
|
+
FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED = "flexlayout__popup_menu_item--selected",
|
|
94
90
|
FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu",
|
|
95
91
|
FLEXLAYOUT__MINI_SCROLLBAR = "flexlayout__mini_scrollbar",
|
|
96
|
-
|
|
92
|
+
FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER = "flexlayout__mini_scrollbar_container"
|
|
97
93
|
}
|
|
@@ -12,6 +12,8 @@ export interface ILayoutProps {
|
|
|
12
12
|
model: Model;
|
|
13
13
|
/** factory function for creating the tab components */
|
|
14
14
|
factory: (node: TabNode) => React.ReactNode;
|
|
15
|
+
/** sets a top level class name on popout windows */
|
|
16
|
+
popoutClassName?: string;
|
|
15
17
|
/** object mapping keys among close, maximize, restore, more, popout to React nodes to use in place of the default icons, can alternatively return functions for creating the React nodes */
|
|
16
18
|
icons?: IIcons;
|
|
17
19
|
/** 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 */
|
|
@@ -96,7 +98,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
96
98
|
/** Get the root div element of the layout */
|
|
97
99
|
getRootDiv(): HTMLDivElement | null;
|
|
98
100
|
}
|
|
99
|
-
export declare const FlexLayoutVersion = "0.8.
|
|
101
|
+
export declare const FlexLayoutVersion = "0.8.6";
|
|
100
102
|
export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
|
|
101
103
|
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
102
104
|
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {
|