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 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
- ![FlexLayout Demo Screenshot](Screenshot_light.png?raw=true "FlexLayout Demo Screenshot")
9
+ ![FlexLayout Demo Screenshot](screenshots/Screenshot_light.png?raw=true "FlexLayout Demo Screenshot")
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
- ![FlexLayout Demo Showing Layout](Screenshot_layout.png?raw=true "Demo showing layout")
184
+ ![FlexLayout Demo Showing Layout](screenshots/Screenshot_layout.png?raw=true "Demo showing layout")
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
- ![FlexLayout Tab structure](Screenshot_customize_tab.png?raw=true "Tab structure")
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
- ![FlexLayout Tab structure](Screenshot_customize_tabset.png?raw=true "Tab set structure")
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 (typically accessed as `FlexLayout.Actions.<actionName>`):
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`).
@@ -40,5 +40,6 @@ export declare class TabNode extends Node implements IDraggable {
40
40
  getMinHeight(): number;
41
41
  getMaxWidth(): number;
42
42
  getMaxHeight(): number;
43
+ isVisible(): boolean;
43
44
  toJson(): IJsonTabNode;
44
45
  }
@@ -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.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: {