flexlayout-react 0.8.8 → 0.8.10
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 +21 -14
- package/declarations/model/TabNode.d.ts +1 -0
- package/declarations/view/Layout.d.ts +1 -1
- package/dist/flexlayout.js +7 -7
- package/dist/flexlayout_min.js +1 -1
- package/eslint.config.mjs +19 -0
- package/lib/AttributeDefinitions.js +2 -2
- package/lib/AttributeDefinitions.js.map +1 -1
- package/lib/Rect.js +1 -1
- package/lib/Rect.js.map +1 -1
- package/lib/model/TabNode.js +4 -1
- package/lib/model/TabNode.js.map +1 -1
- package/lib/view/BorderButton.js +2 -4
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/Layout.js +11 -8
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/TabButton.js +2 -4
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabOverflowHook.js +2 -2
- package/lib/view/TabOverflowHook.js.map +1 -1
- package/package.json +7 -2
- package/src/AttributeDefinitions.ts +2 -2
- package/src/Rect.ts +1 -1
- package/src/model/TabNode.ts +5 -1
- package/src/view/BorderButton.tsx +2 -3
- package/src/view/Layout.tsx +13 -9
- package/src/view/TabButton.tsx +2 -3
- package/src/view/TabOverflowHook.tsx +2 -2
- package/style/combined.css +1053 -1053
- package/style/rounded.css +721 -721
- package/declarations/examples/demo/Utils.d.ts +0 -4
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
0.8.10
|
|
2
|
+
Fix for #481 Numpad Enter doesn't confirm rename
|
|
3
|
+
Work around <StrictMode> issue in React 19 (https://github.com/facebook/react/issues/29585) causing
|
|
4
|
+
tabs to re-mount when moved
|
|
5
|
+
|
|
6
|
+
0.8.9
|
|
7
|
+
Fix for #480 Actions.selectTab is called when closing Tab
|
|
8
|
+
Added isVisible() method to TabNode
|
|
9
|
+
|
|
1
10
|
0.8.8
|
|
2
11
|
Enable esc to close overflow menu
|
|
3
12
|
Prevent initial reposition flash when there are hidden tabs
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
FlexLayout is a layout manager that arranges React components in multiple tab sets, tabs can be resized and moved.
|
|
8
8
|
|
|
9
|
-

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
[Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/demo/index.html)
|
|
12
12
|
|
|
@@ -152,6 +152,9 @@ function App() {
|
|
|
152
152
|
|
|
153
153
|
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.
|
|
154
154
|
|
|
155
|
+
<img src="screenshots/Screenshot_two_tabs.png?raw=true" alt="Simple layout" title="Generated Layout"/>
|
|
156
|
+
|
|
157
|
+
|
|
155
158
|
Try it now using [CodeSandbox](https://codesandbox.io/p/sandbox/yvjzqf)
|
|
156
159
|
|
|
157
160
|
A simple Typescript example can be found here:
|
|
@@ -178,7 +181,7 @@ The layout structure is defined with rows within rows that contain tabsets that
|
|
|
178
181
|
|
|
179
182
|
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
183
|
|
|
181
|
-

|
|
184
|
+

|
|
182
185
|
|
|
183
186
|
The optional borders element is made up of border nodes
|
|
184
187
|
|
|
@@ -228,7 +231,9 @@ For example:
|
|
|
228
231
|
You can use the `<Layout>` prop onRenderTab to customize the tab rendering:
|
|
229
232
|
|
|
230
233
|
|
|
231
|
-
|
|
234
|
+
<img src="screenshots/Screenshot_customize_tab.png?raw=true"
|
|
235
|
+
alt="FlexLayout Tab structure"
|
|
236
|
+
title="Tab structure"/>
|
|
232
237
|
|
|
233
238
|
Update the renderValues parameter as needed:
|
|
234
239
|
|
|
@@ -253,7 +258,9 @@ onRenderTab = (node: TabNode, renderValues: ITabRenderValues) => {
|
|
|
253
258
|
You can use the `<Layout>` prop onRenderTabSet to customize the tab set rendering:
|
|
254
259
|
|
|
255
260
|
|
|
256
|
-
|
|
261
|
+
<img src="screenshots/Screenshot_customize_tabset.png?raw=true"
|
|
262
|
+
alt="FlexLayout Tab structure"
|
|
263
|
+
title="Tab set structure" />
|
|
257
264
|
|
|
258
265
|
Update the renderValues parameter as needed:
|
|
259
266
|
|
|
@@ -276,16 +283,24 @@ onRenderTabSet = (node: (TabSetNode | BorderNode), renderValues: ITabSetRenderVa
|
|
|
276
283
|
|
|
277
284
|
Once the model json has been loaded all changes to the model are applied through actions.
|
|
278
285
|
|
|
279
|
-
|
|
280
286
|
You apply actions using the `Model.doAction()` method.
|
|
281
287
|
|
|
282
288
|
This method takes a single argument, created by one of the action
|
|
283
|
-
generators (
|
|
289
|
+
generators (accessed as `FlexLayout.Actions.<actionName>`):
|
|
284
290
|
|
|
285
291
|
[Actions doc](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.8/typedoc/classes/Actions.html)
|
|
286
292
|
|
|
287
293
|
### Examples
|
|
288
294
|
|
|
295
|
+
```js
|
|
296
|
+
model.doAction(FlexLayout.Actions.addNode(
|
|
297
|
+
{type:"tab", component:"grid", name:"a grid", id:"5"},
|
|
298
|
+
"1", FlexLayout.DockLocation.CENTER, 0));
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
This example adds a new grid component to the center of tabset with id "1" and at the 0'th tab position (use value -1 to add to the end of the tabs).
|
|
302
|
+
|
|
303
|
+
|
|
289
304
|
```js
|
|
290
305
|
model.doAction(FlexLayout.Actions.updateModelAttributes({
|
|
291
306
|
splitterSize:40
|
|
@@ -295,14 +310,6 @@ model.doAction(FlexLayout.Actions.updateModelAttributes({
|
|
|
295
310
|
The above example would increase the size of the splitters, this could be used to make
|
|
296
311
|
adjusting the layout easier on a small device.
|
|
297
312
|
|
|
298
|
-
```js
|
|
299
|
-
model.doAction(FlexLayout.Actions.addNode(
|
|
300
|
-
{type:"tab", component:"grid", name:"a grid", id:"5"},
|
|
301
|
-
"1", FlexLayout.DockLocation.CENTER, 0));
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
This example adds a new grid component to the center of tabset with id "1" and at the 0'th tab position (use value -1 to add to the end of the tabs).
|
|
305
|
-
|
|
306
313
|
Note: you can get the id of a node (e.g., the node returned by the `addNode`
|
|
307
314
|
action) using the method `node.getId()`.
|
|
308
315
|
If an id wasn't assigned when the node was created, then one will be created for you of the form `#<uuid>` (e.g. `#0c459064-8dee-444e-8636-eb9ab910fb27`).
|
|
@@ -98,7 +98,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
|
|
|
98
98
|
/** Get the root div element of the layout */
|
|
99
99
|
getRootDiv(): HTMLDivElement | null;
|
|
100
100
|
}
|
|
101
|
-
export declare const FlexLayoutVersion = "0.8.
|
|
101
|
+
export declare const FlexLayoutVersion = "0.8.10";
|
|
102
102
|
export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
|
|
103
103
|
export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
104
104
|
export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {
|