flexlayout-react 0.8.6 → 0.8.8

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.8
2
+ Enable esc to close overflow menu
3
+ Prevent initial reposition flash when there are hidden tabs
4
+ Removed Roboto font from demo
5
+
6
+ 0.8.7
7
+ Improved tab scrolling into visible area
8
+ Added sections about tab and tabset customization to readme
9
+
1
10
  0.8.6
2
11
  Restructured scss files to remove use of deprecated @import rule
3
12
  Added combined.css containing all themes.
package/README.md CHANGED
@@ -223,6 +223,55 @@ For example:
223
223
  containerRef.current!.className = "flexlayout__theme_dark"
224
224
  ```
225
225
 
226
+ ## Customizing Tabs
227
+
228
+ You can use the `<Layout>` prop onRenderTab to customize the tab rendering:
229
+
230
+
231
+ ![FlexLayout Tab structure](Screenshot_customize_tab.png?raw=true "Tab structure")
232
+
233
+ Update the renderValues parameter as needed:
234
+
235
+ renderValues.leading : the red block
236
+
237
+ renderValues.content : the green block
238
+
239
+ renderValues.buttons : the yellow block
240
+
241
+ For example:
242
+
243
+ ```
244
+ onRenderTab = (node: TabNode, renderValues: ITabRenderValues) => {
245
+ // renderValues.leading = <img style={{width:"1em", height:"1em"}}src="images/folder.svg"/>;
246
+ // renderValues.content += " *";
247
+ renderValues.buttons.push(<img key="menu" style={{width:"1em", height:"1em"}} src="images/menu.svg"/>);
248
+ }
249
+ ```
250
+
251
+ ## Customizing Tab sets
252
+
253
+ You can use the `<Layout>` prop onRenderTabSet to customize the tab set rendering:
254
+
255
+
256
+ ![FlexLayout Tab structure](Screenshot_customize_tabset.png?raw=true "Tab set structure")
257
+
258
+ Update the renderValues parameter as needed:
259
+
260
+ renderValues.stickyButtons : the red block
261
+
262
+ renderValues.buttons : the green block
263
+
264
+
265
+ For example:
266
+
267
+ ```
268
+ onRenderTabSet = (node: (TabSetNode | BorderNode), renderValues: ITabSetRenderValues) => {
269
+ renderValues.stickyButtons.push(<img key="add" style={{width:"1em", height:"1em"}} src="images/add.svg"/>);
270
+
271
+ renderValues.buttons.push(<img key="menu" style={{width:"1em", height:"1em"}} src="images/menu.svg"/>);
272
+ }
273
+ ```
274
+
226
275
  ## Model Actions
227
276
 
228
277
  Once the model json has been loaded all changes to the model are applied through actions.
@@ -23,6 +23,8 @@ export declare class Rect {
23
23
  equalSize(rect: Rect | null | undefined): boolean;
24
24
  getBottom(): number;
25
25
  getRight(): number;
26
+ get bottom(): number;
27
+ get right(): number;
26
28
  getCenter(): {
27
29
  x: number;
28
30
  y: number;
@@ -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.6";
101
+ export declare const FlexLayoutVersion = "0.8.8";
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: {