flexlayout-react 0.5.21 → 0.6.0
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 +7 -5
- package/declarations/Types.d.ts +1 -0
- package/declarations/model/IJsonModel.d.ts +2 -0
- package/declarations/model/Model.d.ts +1 -0
- package/declarations/view/Icons.d.ts +6 -0
- package/declarations/view/Layout.d.ts +3 -4
- package/declarations/view/MenuTabButton.d.ts +1 -0
- package/declarations/view/Tab.d.ts +1 -1
- package/declarations/view/TabButtonStamp.d.ts +1 -0
- package/declarations/view/Utils.d.ts +1 -0
- package/dist/flexlayout.js +48 -12
- package/dist/flexlayout_min.js +1 -1
- package/lib/PopupMenu.js +9 -4
- package/lib/PopupMenu.js.map +1 -1
- package/lib/Types.js +1 -0
- package/lib/Types.js.map +1 -1
- package/lib/model/Model.js +4 -0
- package/lib/model/Model.js.map +1 -1
- package/lib/model/TabNode.js +6 -1
- package/lib/model/TabNode.js.map +1 -1
- package/lib/view/BorderButton.js +9 -39
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/BorderTabSet.js +4 -4
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/Icons.js +36 -0
- package/lib/view/Icons.js.map +1 -0
- package/lib/view/Layout.js +41 -11
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/MenuTabButton.js +22 -0
- package/lib/view/MenuTabButton.js.map +1 -0
- package/lib/view/Tab.js +4 -12
- package/lib/view/Tab.js.map +1 -1
- package/lib/view/TabButton.js +11 -42
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabButtonStamp.js +22 -0
- package/lib/view/TabButtonStamp.js.map +1 -0
- package/lib/view/TabFloating.js +2 -2
- package/lib/view/TabFloating.js.map +1 -1
- package/lib/view/TabOverflowHook.js +1 -1
- package/lib/view/TabSet.js +7 -18
- package/lib/view/TabSet.js.map +1 -1
- package/lib/view/Utils.js +61 -0
- package/lib/view/Utils.js.map +1 -0
- package/package.json +1 -1
- package/src/I18nLabel.ts +1 -1
- package/src/PopupMenu.tsx +23 -5
- package/src/Types.ts +1 -0
- package/src/model/IJsonModel.ts +2 -0
- package/src/model/Model.ts +7 -0
- package/src/model/TabNode.ts +6 -1
- package/src/view/BorderButton.tsx +8 -41
- package/src/view/BorderTabSet.tsx +10 -3
- package/src/view/Icons.tsx +36 -0
- package/src/view/Layout.tsx +42 -18
- package/src/view/Tab.tsx +2 -7
- package/src/view/TabButton.tsx +15 -48
- package/src/view/TabButtonStamp.tsx +47 -0
- package/src/view/TabFloating.tsx +1 -1
- package/src/view/TabOverflowHook.tsx +1 -1
- package/src/view/TabSet.tsx +10 -13
- package/src/view/Utils.tsx +71 -0
- package/style/_base.scss +75 -45
- package/style/dark.css +75 -69
- package/style/dark.css.map +1 -1
- package/style/dark.scss +15 -5
- package/style/gray.css +72 -66
- package/style/gray.css.map +1 -1
- package/style/gray.scss +10 -3
- package/style/light.css +76 -70
- package/style/light.css.map +1 -1
- package/style/light.scss +16 -6
- package/images/close.png +0 -0
- package/images/maximize.png +0 -0
- package/images/more.png +0 -0
- package/images/more2.png +0 -0
- package/images/popout.png +0 -0
- package/images/restore.png +0 -0
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
0.6.0
|
|
2
|
+
Changed icons to use svg images, these will now scale with the font size.
|
|
3
|
+
Improved element spacing, removed most margin/padding spacers.
|
|
4
|
+
The overflow menu and drag rectangle will now show the tab icon and content as rendered in the tab.
|
|
5
|
+
Added altName attribute to TabNode, this will be used as the name in the overflow menu if there is no
|
|
6
|
+
name attribute (e.g the tab has just an icon).
|
|
7
|
+
Changed the drag outline colors from red/green to light blue/green.
|
|
8
|
+
Removed closeIcon prop from Layout, use the icons property instead.
|
|
9
|
+
Changed onRenderDragRect callback to take a ReactElement rather than a string, the content now
|
|
10
|
+
contains the tabbutton as rendered.
|
|
11
|
+
|
|
1
12
|
0.5.21
|
|
2
13
|
Fixed copying stylesheet links for popout windows when cssRules throw exception.
|
|
3
14
|
Added option, enableUseVisibility, to allow use of visibility: hidden rather than display:none for hiding elements.
|
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@ FlexLayout is a layout manager that arranges React components in multiple tab se
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
[Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.
|
|
7
|
+
[Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.6/demo/index.html)
|
|
8
8
|
|
|
9
|
-
Try it now using [JSFiddle](https://jsfiddle.net/
|
|
9
|
+
Try it now using [JSFiddle](https://jsfiddle.net/18zfp0qm/)
|
|
10
10
|
|
|
11
11
|
<!-- [API Doc](./typedoc/index.html) -->
|
|
12
12
|
|
|
@@ -185,7 +185,7 @@ ReactDOM.render(<Main/>, document.getElementById("container"));
|
|
|
185
185
|
|
|
186
186
|
The above code would render two tabsets horizontally each containing a single tab that hosts a button component. The tabs could be moved and resized by dragging and dropping. Additional grids could be added to the layout by sending actions to the model.
|
|
187
187
|
|
|
188
|
-
Try it now using [JSFiddle](https://jsfiddle.net/
|
|
188
|
+
Try it now using [JSFiddle](https://jsfiddle.net/18zfp0qm/)
|
|
189
189
|
|
|
190
190
|
A simple Create React App (CRA) example (using typescript) can be found here:
|
|
191
191
|
|
|
@@ -213,7 +213,7 @@ The model json contains 3 top level elements:
|
|
|
213
213
|
|
|
214
214
|
Weights on rows and tabsets specify the relative weight of these nodes within the parent row, the actual values do not matter just their relative values (ie two tabsets of weights 30,70 would render the same if they had weights of 3,7).
|
|
215
215
|
|
|
216
|
-
NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.
|
|
216
|
+
NOTE: the easiest way to create your initial layout JSON is to use the [demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.6/demo/index.html) app, modify one of the
|
|
217
217
|
existing layouts by dragging/dropping and adding nodes then press the 'Show Layout JSON in console' button to print the JSON to the browser developer console.
|
|
218
218
|
|
|
219
219
|
|
|
@@ -335,6 +335,7 @@ Attributes allowed in the 'global' element
|
|
|
335
335
|
| ------------- |:-------------:| -----|
|
|
336
336
|
| splitterSize | 8 | width in pixels of all splitters between tabsets/borders |
|
|
337
337
|
| splitterExtra | 0 | additional width in pixels of the splitter hit test area |
|
|
338
|
+
| legacyOverflowMenu | false | use the legacy text only overflow menu |
|
|
338
339
|
| enableEdgeDock | true | |
|
|
339
340
|
| tabEnableClose | true | allow user to close all tabs via close button |
|
|
340
341
|
| tabCloseType | 1 | see values in ICloseType |
|
|
@@ -395,7 +396,8 @@ Inherited defaults will take their value from the associated global attributes (
|
|
|
395
396
|
| Attribute | Default | Description |
|
|
396
397
|
| ------------- |:-------------:| -----|
|
|
397
398
|
| type | tab | |
|
|
398
|
-
| name | *required* |
|
|
399
|
+
| name | *required* | name of tab to be displayed in the tab button |
|
|
400
|
+
| altName | *optional* | if there is no name specifed then this value will be used in the overflow menu |
|
|
399
401
|
| component | *required* | string identifying which component to run (for factory) |
|
|
400
402
|
| config | null | a place to hold json config for the hosted component |
|
|
401
403
|
| id | auto generated | |
|
package/declarations/Types.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export declare enum CLASSES {
|
|
|
55
55
|
FLEXLAYOUT__TAB_BUTTON_OVERFLOW = "flexlayout__tab_button_overflow",
|
|
56
56
|
FLEXLAYOUT__TAB_BUTTON_TEXTBOX = "flexlayout__tab_button_textbox",
|
|
57
57
|
FLEXLAYOUT__TAB_BUTTON_TRAILING = "flexlayout__tab_button_trailing",
|
|
58
|
+
FLEXLAYOUT__TAB_BUTTON_STAMP = "flexlayout__tab_button_stamp",
|
|
58
59
|
FLEXLAYOUT__TAB_FLOATING = "flexlayout__tab_floating",
|
|
59
60
|
FLEXLAYOUT__TAB_FLOATING_INNER = "flexlayout__tab_floating_inner",
|
|
60
61
|
FLEXLAYOUT__TAB_TOOLBAR = "flexlayout__tab_toolbar",
|
|
@@ -37,6 +37,7 @@ export interface IGlobalAttributes {
|
|
|
37
37
|
borderSize?: number;
|
|
38
38
|
enableEdgeDock?: boolean;
|
|
39
39
|
enableUseVisibility?: boolean;
|
|
40
|
+
legacyOverflowMenu?: boolean;
|
|
40
41
|
marginInsets?: IInsets;
|
|
41
42
|
rootOrientationVertical?: boolean;
|
|
42
43
|
splitterExtra?: number;
|
|
@@ -105,6 +106,7 @@ export interface ITabSetAttributes {
|
|
|
105
106
|
width?: number;
|
|
106
107
|
}
|
|
107
108
|
export interface ITabAttributes {
|
|
109
|
+
altName?: string;
|
|
108
110
|
borderHeight?: number;
|
|
109
111
|
borderWidth?: number;
|
|
110
112
|
className?: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CloseIcon: () => JSX.Element;
|
|
3
|
+
export declare const MaximizeIcon: () => JSX.Element;
|
|
4
|
+
export declare const OverflowIcon: () => JSX.Element;
|
|
5
|
+
export declare const PopoutIcon: () => JSX.Element;
|
|
6
|
+
export declare const RestoreIcon: () => JSX.Element;
|
|
@@ -10,7 +10,7 @@ import TabSetNode from "../model/TabSetNode";
|
|
|
10
10
|
import Rect from "../Rect";
|
|
11
11
|
import { IJsonTabNode } from "../model/IJsonModel";
|
|
12
12
|
export declare type CustomDragCallback = (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation) => void;
|
|
13
|
-
export declare type DragRectRenderCallback = (
|
|
13
|
+
export declare type DragRectRenderCallback = (content: React.ReactElement | undefined, node?: Node, json?: IJsonTabNode) => React.ReactElement | undefined;
|
|
14
14
|
export declare type FloatingTabPlaceholderRenderCallback = (dockPopout: () => void, showPopout: () => void) => React.ReactElement | undefined;
|
|
15
15
|
export declare type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
16
16
|
export interface ILayoutProps {
|
|
@@ -20,7 +20,6 @@ export interface ILayoutProps {
|
|
|
20
20
|
fontFamily?: string;
|
|
21
21
|
iconFactory?: (node: TabNode) => React.ReactNode | undefined;
|
|
22
22
|
titleFactory?: (node: TabNode) => ITitleObject | React.ReactNode | undefined;
|
|
23
|
-
closeIcon?: React.ReactNode;
|
|
24
23
|
icons?: IIcons;
|
|
25
24
|
onAction?: (action: Action) => Action | undefined;
|
|
26
25
|
onRenderTab?: (node: TabNode, renderValues: ITabRenderValues) => void;
|
|
@@ -121,7 +120,7 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
|
|
|
121
120
|
* @param json the json for the new tab node
|
|
122
121
|
* @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
|
|
123
122
|
*/
|
|
124
|
-
addTabWithDragAndDrop(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
123
|
+
addTabWithDragAndDrop(dragText: string | undefined, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
125
124
|
/**
|
|
126
125
|
* Adds a new tab by dragging a labeled panel to the drop location, dragging starts when you
|
|
127
126
|
* mouse down on the panel
|
|
@@ -130,6 +129,6 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
|
|
|
130
129
|
* @param json the json for the new tab node
|
|
131
130
|
* @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
|
|
132
131
|
*/
|
|
133
|
-
addTabWithDragAndDropIndirect(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
132
|
+
addTabWithDragAndDropIndirect(dragText: string | undefined, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
134
133
|
}
|
|
135
134
|
export default Layout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|