flexlayout-react 0.5.16 → 0.5.20

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.
Files changed (81) hide show
  1. package/ChangeLog.txt +24 -0
  2. package/README.md +128 -97
  3. package/declarations/DragDrop.d.ts +1 -0
  4. package/declarations/Rect.d.ts +4 -0
  5. package/declarations/Types.d.ts +8 -1
  6. package/declarations/model/BorderNode.d.ts +2 -1
  7. package/declarations/model/IJsonModel.d.ts +8 -0
  8. package/declarations/model/Model.d.ts +1 -0
  9. package/declarations/view/Layout.d.ts +19 -6
  10. package/dist/flexlayout.js +19 -19
  11. package/dist/flexlayout_min.js +1 -1
  12. package/lib/DockLocation.js +25 -11
  13. package/lib/DockLocation.js.map +1 -1
  14. package/lib/DragDrop.js +19 -3
  15. package/lib/DragDrop.js.map +1 -1
  16. package/lib/PopupMenu.js +14 -9
  17. package/lib/PopupMenu.js.map +1 -1
  18. package/lib/Rect.js +3 -0
  19. package/lib/Rect.js.map +1 -1
  20. package/lib/Types.js +7 -0
  21. package/lib/Types.js.map +1 -1
  22. package/lib/model/BorderNode.js +61 -14
  23. package/lib/model/BorderNode.js.map +1 -1
  24. package/lib/model/BorderSet.js +33 -19
  25. package/lib/model/BorderSet.js.map +1 -1
  26. package/lib/model/Model.js +23 -3
  27. package/lib/model/Model.js.map +1 -1
  28. package/lib/model/RowNode.js +19 -5
  29. package/lib/model/RowNode.js.map +1 -1
  30. package/lib/model/TabNode.js +10 -0
  31. package/lib/model/TabNode.js.map +1 -1
  32. package/lib/model/TabSetNode.js +34 -19
  33. package/lib/model/TabSetNode.js.map +1 -1
  34. package/lib/view/BorderButton.js +17 -6
  35. package/lib/view/BorderButton.js.map +1 -1
  36. package/lib/view/BorderTabSet.js +17 -6
  37. package/lib/view/BorderTabSet.js.map +1 -1
  38. package/lib/view/Layout.js +232 -57
  39. package/lib/view/Layout.js.map +1 -1
  40. package/lib/view/Splitter.js +35 -4
  41. package/lib/view/Splitter.js.map +1 -1
  42. package/lib/view/Tab.js +2 -2
  43. package/lib/view/Tab.js.map +1 -1
  44. package/lib/view/TabButton.js +16 -7
  45. package/lib/view/TabButton.js.map +1 -1
  46. package/lib/view/TabFloating.js +24 -12
  47. package/lib/view/TabFloating.js.map +1 -1
  48. package/lib/view/TabSet.js +49 -24
  49. package/lib/view/TabSet.js.map +1 -1
  50. package/package.json +11 -6
  51. package/src/DockLocation.ts +30 -9
  52. package/src/DragDrop.ts +26 -3
  53. package/src/PopupMenu.tsx +32 -11
  54. package/src/Rect.ts +6 -2
  55. package/src/Types.ts +7 -0
  56. package/src/model/BorderNode.ts +57 -15
  57. package/src/model/BorderSet.ts +32 -19
  58. package/src/model/IJsonModel.ts +8 -0
  59. package/src/model/Model.ts +30 -3
  60. package/src/model/RowNode.ts +8 -5
  61. package/src/model/TabNode.ts +11 -0
  62. package/src/model/TabSetNode.ts +33 -19
  63. package/src/view/BorderButton.tsx +34 -6
  64. package/src/view/BorderTabSet.tsx +25 -5
  65. package/src/view/Layout.tsx +299 -82
  66. package/src/view/Splitter.tsx +53 -4
  67. package/src/view/Tab.tsx +8 -2
  68. package/src/view/TabButton.tsx +31 -7
  69. package/src/view/TabFloating.tsx +42 -20
  70. package/src/view/TabSet.tsx +70 -18
  71. package/style/_base.scss +78 -51
  72. package/style/dark.css +94 -68
  73. package/style/dark.css.map +1 -1
  74. package/style/dark.scss +20 -20
  75. package/style/gray.css +94 -68
  76. package/style/gray.css.map +1 -1
  77. package/style/gray.scss +20 -20
  78. package/style/light.css +94 -68
  79. package/style/light.css.map +1 -1
  80. package/style/light.scss +18 -18
  81. package/yarn-error.log +0 -11828
package/ChangeLog.txt CHANGED
@@ -1,3 +1,27 @@
1
+ 0.5.20
2
+ Added Cypress Tests
3
+ Fixed bug with tab icon not showing
4
+
5
+ 0.5.19
6
+ Added onRenderFloatingTabPlaceholder callback prop for rendering the floating tab placeholder.
7
+ Changed style sheets to use CSS custom properties (variables) for several values.
8
+ Fix selected index in single empty tabset.
9
+ Added onContextMenu callback prop for handling context menus on tabs and tabsets.
10
+ Added onAuxMouseClick callback prop for handling mouse clicks on tabs and tabsets
11
+ with alt, meta, shift keys, also handles center mouse clicks
12
+
13
+ 0.5.18
14
+ Added onRenderDragRect callback prop for rendering the drag rectangles
15
+ New border attribute: enableAutoHide, to hide border if it has zero tabs
16
+
17
+ 0.5.17
18
+ New global option, splitterExtra, to allow splitters to have an extended hit test areas.
19
+ This makes it easier to use narrow splitters.
20
+ Added new TabNode attributes: borderWidth and borderHeight, these allow for individual border sizes for certain tabs.
21
+ Fix for #263 - borders splitters not taking minimum size of center into account
22
+ Improved algorithm for finding drop location
23
+ Additional parameter: cursor, for onTabDrag
24
+
1
25
  0.5.16
2
26
  Added 'New Features' layout to demo.
3
27
  New tab attribute, helpText, to show tooltip over tabs.
package/README.md CHANGED
@@ -6,7 +6,7 @@ FlexLayout is a layout manager that arranges React components in multiple tab se
6
6
 
7
7
  [Run the Demo](https://rawgit.com/caplin/FlexLayout/demos/demos/v0.5/demo/index.html)
8
8
 
9
- Try it now using [JSFiddle](https://jsfiddle.net/9x6hecdw/)
9
+ Try it now using [JSFiddle](https://jsfiddle.net/7oe4q2pc/)
10
10
 
11
11
  <!-- [API Doc](./typedoc/index.html) -->
12
12
 
@@ -66,25 +66,39 @@ Include the light, gray or dark style in your html:
66
66
  The `<Layout>` component renders the tabsets and splitters, it takes the following props:
67
67
 
68
68
 
69
- | Prop | Required/Optional | Description |
70
- | --------------- |:-----------------:| ----------------- |
71
- | model | required | the layout model |
72
- | factory | required | a factory function for creating React components |
73
- | font | optional | the tab font (overrides value in css). Example: font={{size:"12px", style:"italic"}}|
74
- | iconFactory | optional | a factory function for creating icon components for tab bar buttons |
75
- | titleFactory | optional | a factory function for creating title components for tab bar buttons |
76
- | icons | optional | object mapping keys among `close`, `maximize`, `restore`, `more`, `popout` to React nodes to use in place of the default icons |
77
- | onAction | optional | 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 |
78
- | onRenderTab | optional | function called when rendering a tab, allows leading (icon), content section, buttons and name used in overflow menu to be customized |
79
- | onRenderTabSet | optional | function called when rendering a tabset, allows header and buttons to be customized |
80
- | onModelChange | optional | function called when model has changed |
81
- | onExternalDrag | optional | function called when an external object (not a tab) gets dragged onto the layout, with a single `dragenter` argument. Should return either `undefined` to reject the drag/drop or an object with keys `dragText`, `json`, and optionally `onDrop`, to create a tab via drag (similar to a call to `addTabToTabSet`). Function `onDrop` is passed the added tab `Node` and the `drop` `DragEvent`, unless the drag was canceled. |
82
- | classNameMapper | optional | function called with default css class name, return value is class name that will be used. Mainly for use with css modules.|
83
- | i18nMapper | optional | function called for each I18nLabel to allow user translation, currently used for tab and tabset move messages, return undefined to use default values |
84
- | supportsPopout | optional | if left undefined will do simple check based on userAgent |
85
- | popoutURL | optional | URL of popout window relative to origin, defaults to popout.html |
86
- | realtimeResize | optional | boolean value, defaults to false, resize tabs as splitters are dragged. Warning: this can cause resizing to become choppy when tabs are slow to draw |
87
- | onTabDrag | optional | function called while dragging a tab, whether from the layout or using `addTabWithDragAndDrop`. Called with the `TabNode` being dragged / the tab json from `addTabWithDragAndDrop`, the `TabNode` being dragged over, the x and y coordinates relative to the dragged-over tab, and the `DockLocation` that would be used. Should return undefined for default behavior, or an object containing `x`, `y`, `width`, `height`, `callback` fields. Coordinates are in pixels relative to the dragged-over tab, and `callback` will be called with the same arguments if the tab is dropped. If `callback` is called, the layout does not do anything else on drop. |
69
+ #### Required props:
70
+
71
+
72
+ | Prop | Description |
73
+ | --------------- | ----------------- |
74
+ | model | the layout model |
75
+ | factory | a factory function for creating React components |
76
+
77
+ #### Optional props:
78
+
79
+
80
+ | Prop | Description |
81
+ | --------------- | ----------------- |
82
+ | font | the tab font (overrides value in css). Example: font={{size:"12px", style:"italic"}}|
83
+ | icons | object mapping keys among `close`, `maximize`, `restore`, `more`, `popout` to React nodes to use in place of the default icons |
84
+ | onAction | 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 |
85
+ | onRenderTab | function called when rendering a tab, allows leading (icon), content section, buttons and name used in overflow menu to be customized |
86
+ | onRenderTabSet | function called when rendering a tabset, allows header and buttons to be customized |
87
+ | onModelChange | function called when model has changed |
88
+ | onExternalDrag | function called when an external object (not a tab) gets dragged onto the layout, with a single `dragenter` argument. Should return either `undefined` to reject the drag/drop or an object with keys `dragText`, `json`Drop`, to create a tab via drag (similar to a call to `addTabToTabSet`). Function `onDrop` is passed the added tab `Node` and the `drop` `DragEvent`, unless the drag was canceled. |
89
+ | classNameMapper | function called with default css class name, return value is class name that will be used. Mainly for use with css modules.|
90
+ | i18nMapper | function called for each I18nLabel to allow user translation, currently used for tab and tabset move messages, return undefined to use default values |
91
+ | supportsPopout | if left undefined will do simple check based on userAgent |
92
+ | popoutURL | URL of popout window relative to origin, defaults to popout.html |
93
+ | realtimeResize | boolean value, defaults to false, resize tabs as splitters are dragged. Warning: this can cause resizing to become choppy when tabs are slow to draw |
94
+ | onTabDrag | function called while dragging a tab, whether from the layout or using `addTabWithDragAndDrop`. Called with the `TabNode` being dragged / the tab json from `addTabWithDragAndDrop`, the `TabNode` being dragged over, the x and y coordinates relative to the dragged-over tab, and the `DockLocation` that would be used. Should return undefined for default behavior, or an object containing `x`, `y`, `width`, `height`, `callback`, `cursor` fields. Coordinates are in pixels relative to the dragged-over tab, and `callback` will be called with the same arguments if the tab is dropped. `cursor` is an optional string field that should contain a CSS cursor value, such as `copy` or `row-resize`. If `callback` is called, the layout does not perform its default behavior on drop. |
95
+ | onRenderDragRect | callback for rendering the drag rectangles |
96
+ | onRenderFloatingTabPlaceholder | callback for rendering the floating tab placeholder |
97
+ | onContextMenu | callback for handling context actions on tabs and tabsets |
98
+ | onAuxMouseClick | callback for handling mouse clicks on tabs and tabsets with alt, meta, shift keys, also handles center mouse clicks |
99
+ | iconFactory | a factory function for creating icon components for tab bar buttons. <br/><br/> NOTE: for greater customization of the tab use onRenderTab instead of this callback |
100
+ | titleFactory | a factory function for creating title components for tab bar buttons. <br /><br /> NOTE: for greater customization of the tab use onRenderTab instead of this callback |
101
+
88
102
 
89
103
  The model is tree of Node objects that define the structure of the layout.
90
104
 
@@ -104,38 +118,36 @@ render() {
104
118
 
105
119
  ```javascript
106
120
  var json = {
107
- global: {},
108
- borders: [],
109
- layout:{
110
- "type": "row",
111
- "weight": 100,
112
- "children": [
113
- {
114
- "type": "tabset",
115
- "weight": 50,
116
- "selected": 0,
117
- "children": [
118
- {
119
- "type": "tab",
120
- "name": "FX",
121
- "component":"grid",
122
- }
123
- ]
124
- },
125
- {
126
- "type": "tabset",
127
- "weight": 50,
128
- "selected": 0,
129
- "children": [
130
- {
131
- "type": "tab",
132
- "name": "FI",
133
- "component":"grid",
134
- }
135
- ]
136
- }
137
- ]
138
- }
121
+ global: {},
122
+ borders: [],
123
+ layout: {
124
+ type: "row",
125
+ weight: 100,
126
+ children: [
127
+ {
128
+ type: "tabset",
129
+ weight: 50,
130
+ children: [
131
+ {
132
+ type: "tab",
133
+ name: "One",
134
+ component: "button",
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ type: "tabset",
140
+ weight: 50,
141
+ children: [
142
+ {
143
+ type: "tab",
144
+ name: "Two",
145
+ component: "button",
146
+ }
147
+ ]
148
+ }
149
+ ]
150
+ }
139
151
  };
140
152
  ```
141
153
 
@@ -173,7 +185,7 @@ ReactDOM.render(<Main/>, document.getElementById("container"));
173
185
 
174
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.
175
187
 
176
- Try it now using [JSFiddle](https://jsfiddle.net/9x6hecdw/)
188
+ Try it now using [JSFiddle](https://jsfiddle.net/7oe4q2pc/)
177
189
 
178
190
  A simple Create React App (CRA) example (using typescript) can be found here:
179
191
 
@@ -207,50 +219,50 @@ existing layouts by dragging/dropping and adding nodes then press the 'Show Layo
207
219
 
208
220
  example borders section:
209
221
  ```
210
- "borders": [
211
- {
212
- "type":"border",
213
- "location": "left",
214
- "children": [
215
- {
216
- "type": "tab",
217
- "enableClose":false,
218
- "name": "Navigation",
219
- "component": "grid",
220
- }
221
- ]
222
- },
223
- {
224
- "type":"border",
225
- "location": "right",
226
- "children": [
227
- {
228
- "type": "tab",
229
- "enableClose":false,
230
- "name": "Options",
231
- "component": "grid",
232
- }
233
- ]
234
- },
235
- {
236
- "type":"border",
237
- "location": "bottom",
238
- "children": [
239
- {
240
- "type": "tab",
241
- "enableClose":false,
242
- "name": "Activity Blotter",
243
- "component": "grid",
244
- },
245
- {
246
- "type": "tab",
247
- "enableClose":false,
248
- "name": "Execution Blotter",
249
- "component": "grid",
250
- }
251
- ]
252
- }
253
- ]
222
+ borders: [
223
+ {
224
+ type: "border",
225
+ location: "left",
226
+ children: [
227
+ {
228
+ type: "tab",
229
+ enableClose: false,
230
+ name: "Navigation",
231
+ component: "grid",
232
+ }
233
+ ]
234
+ },
235
+ {
236
+ type: "border",
237
+ location: "right",
238
+ children: [
239
+ {
240
+ type: "tab",
241
+ enableClose: false,
242
+ name: "Options",
243
+ component: "grid",
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ type: "border",
249
+ location: "bottom",
250
+ children: [
251
+ {
252
+ type: "tab",
253
+ enableClose: false,
254
+ name: "Activity Blotter",
255
+ component: "grid",
256
+ },
257
+ {
258
+ type: "tab",
259
+ enableClose: false,
260
+ name: "Execution Blotter",
261
+ component: "grid",
262
+ }
263
+ ]
264
+ }
265
+ ]
254
266
  ```
255
267
 
256
268
  To control where nodes can be dropped you can add a callback function to the model:
@@ -322,6 +334,7 @@ Attributes allowed in the 'global' element
322
334
  | Attribute | Default | Description |
323
335
  | ------------- |:-------------:| -----|
324
336
  | splitterSize | 8 | width in pixels of all splitters between tabsets/borders |
337
+ | splitterExtra | 0 | additional width in pixels of the splitter hit test area |
325
338
  | enableEdgeDock | true | |
326
339
  | tabEnableClose | true | allow user to close all tabs via close button |
327
340
  | tabCloseType | 1 | see values in ICloseType |
@@ -332,6 +345,8 @@ Attributes allowed in the 'global' element
332
345
  | tabIcon | null | |
333
346
  | tabEnableRenderOnDemand | true | whether to avoid rendering component until tab is visible |
334
347
  | tabDragSpeed | 0.3 | CSS transition speed of drag outlines (in seconds) |
348
+ | tabBorderWidth | -1 | width when added to border, -1 will use border size |
349
+ | tabBorderHeight | -1 | height when added to border, -1 will use border size |
335
350
  | tabSetEnableDeleteWhenEmpty | true | |
336
351
  | tabSetEnableDrop | true | allow user to drag tabs into all tabsets |
337
352
  | tabSetEnableDrag | true | allow user to drag tabs out of all tabsets |
@@ -345,6 +360,7 @@ Attributes allowed in the 'global' element
345
360
  | tabSetHeaderHeight | 0 | height of tabset header in pixels; if left as 0 then the value will be calculated from the current fontSize |
346
361
  | tabSetTabStripHeight | 0 | height of tabset tab bar in pixels; if left as 0 then the value will be calculated from the current fontSize |
347
362
  | borderBarSize | 0 | size of the border bars in pixels; if left as 0 then the value will be calculated from the current fontSize |
363
+ | borderEnableAutoHide | false | hide border if it has zero tabs |
348
364
  | borderEnableDrop | true | allow user to drag tabs into this border |
349
365
  | borderAutoSelectTabWhenOpen | true | whether to select new/moved tabs in border when the border is already open |
350
366
  | borderAutoSelectTabWhenClosed | false | whether to select new/moved tabs in border when the border is curently closed |
@@ -393,6 +409,8 @@ Inherited defaults will take their value from the associated global attributes (
393
409
  | className | *inherited* | |
394
410
  | icon | *inherited* | |
395
411
  | enableRenderOnDemand | *inherited* | whether to avoid rendering component until tab is visible |
412
+ | borderWidth | *inherited* | width when added to border, -1 will use border size |
413
+ | borderHeight | *inherited* | height when added to border, -1 will use border size |
396
414
 
397
415
  Tab nodes have a getExtraData() method that initially returns an empty object, this is the place to
398
416
  add extra data to a tab node that will not be saved.
@@ -450,6 +468,7 @@ Inherited defaults will take their value from the associated global attributes (
450
468
  | id | auto generated | border_ + border name e.g. border_left |
451
469
  | config | null | a place to hold json config used in your own code |
452
470
  | show | true | show/hide this border |
471
+ | enableAutoHide | false | hide border if it has zero tabs |
453
472
  | children | *required* | a list of tab nodes |
454
473
  | barSize | *inherited* | size of this border's bar in pixels; if left as 0 then the value will be calculated from the current fontSize |
455
474
  | enableDrop | *inherited* | |
@@ -580,4 +599,16 @@ Open your browser at http://localhost:8080/examples/ to show the examples direct
580
599
  The 'yarn start' command will watch for changes to flexlayout and example source, so you can make changes to the code
581
600
  and then refresh the browser to see the result.
582
601
 
602
+ To run the tests in the Cypress interactive runner use:
603
+
604
+ ```
605
+ yarn cypress
606
+ ```
607
+
608
+ ![FlexLayout Cypress tests](/../screenshots/github_images/CypressTests.png?raw=true "Cypress interactive runner Screenshot")
609
+
610
+
583
611
  To build the npm distribution run 'yarn build', this will create the artifacts in the dist dir.
612
+
613
+
614
+
@@ -4,6 +4,7 @@ declare class DragDrop {
4
4
  addGlass(fCancel: ((wasDragging: boolean) => void) | undefined): void;
5
5
  resizeGlass(): void;
6
6
  hideGlass(): void;
7
+ setGlassCursorOverride(cursor: string | undefined): void;
7
8
  startDrag(event: Event | React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement> | React.DragEvent<Element> | undefined, fDragStart: ((pos: {
8
9
  clientX: number;
9
10
  clientY: number;
@@ -10,6 +10,10 @@ declare class Rect {
10
10
  equals(rect: Rect): boolean;
11
11
  getBottom(): number;
12
12
  getRight(): number;
13
+ getCenter(): {
14
+ x: number;
15
+ y: number;
16
+ };
13
17
  positionElement(element: HTMLElement, position?: string): void;
14
18
  styleWithPosition(style: Record<string, any>, position?: string): Record<string, any>;
15
19
  contains(x: number, y: number): boolean;
@@ -8,6 +8,8 @@ export declare enum CLASSES {
8
8
  FLEXLAYOUT__BORDER_BUTTON_TRAILING = "flexlayout__border_button_trailing",
9
9
  FLEXLAYOUT__BORDER_BUTTON__SELECTED = "flexlayout__border_button--selected",
10
10
  FLEXLAYOUT__BORDER_BUTTON__UNSELECTED = "flexlayout__border_button--unselected",
11
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW = "flexlayout__border_toolbar_button_overflow",
12
+ FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ = "flexlayout__border_toolbar_button_overflow_",
11
13
  FLEXLAYOUT__BORDER_INNER = "flexlayout__border_inner",
12
14
  FLEXLAYOUT__BORDER_INNER_ = "flexlayout__border_inner_",
13
15
  FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER = "flexlayout__border_inner_tab_container",
@@ -25,7 +27,9 @@ export declare enum CLASSES {
25
27
  FLEXLAYOUT__FLOATING_WINDOW_TAB = "flexlayout__floating_window_tab",
26
28
  FLEXLAYOUT__LAYOUT = "flexlayout__layout",
27
29
  FLEXLAYOUT__OUTLINE_RECT = "flexlayout__outline_rect",
30
+ FLEXLAYOUT__OUTLINE_RECT_EDGE = "flexlayout__outline_rect_edge",
28
31
  FLEXLAYOUT__SPLITTER = "flexlayout__splitter",
32
+ FLEXLAYOUT__SPLITTER_EXTRA = "flexlayout__splitter_extra",
29
33
  FLEXLAYOUT__SPLITTER_ = "flexlayout__splitter_",
30
34
  FLEXLAYOUT__SPLITTER_BORDER = "flexlayout__splitter_border",
31
35
  FLEXLAYOUT__SPLITTER_DRAG = "flexlayout__splitter_drag",
@@ -58,5 +62,8 @@ export declare enum CLASSES {
58
62
  FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ = "flexlayout__tab_toolbar_button-",
59
63
  FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT = "flexlayout__tab_toolbar_button-float",
60
64
  FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER = "flexlayout__tab_toolbar_sticky_buttons_container",
61
- FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close"
65
+ FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close",
66
+ FLEXLAYOUT__POPUP_MENU_CONTAINER = "flexlayout__popup_menu_container",
67
+ FLEXLAYOUT__POPUP_MENU_ITEM = "flexlayout__popup_menu_item",
68
+ FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu"
62
69
  }
@@ -14,7 +14,7 @@ declare class BorderNode extends Node implements IDropTarget {
14
14
  isAutoSelectTab(whenOpen?: boolean): boolean;
15
15
  getClassName(): string | undefined;
16
16
  getBorderBarSize(): number;
17
- getSize(): number;
17
+ getSize(): any;
18
18
  getMinSize(): number;
19
19
  getSelected(): number;
20
20
  getSelectedNode(): Node | undefined;
@@ -29,6 +29,7 @@ declare class BorderNode extends Node implements IDropTarget {
29
29
  getConfig(): any;
30
30
  isMaximized(): boolean;
31
31
  isShowing(): boolean;
32
+ isAutoHide(): boolean;
32
33
  toJson(): IJsonBorderNode;
33
34
  }
34
35
  export default BorderNode;
@@ -31,13 +31,17 @@ export interface IGlobalAttributes {
31
31
  borderAutoSelectTabWhenOpen?: boolean;
32
32
  borderBarSize?: number;
33
33
  borderClassName?: string;
34
+ borderEnableAutoHide?: boolean;
34
35
  borderEnableDrop?: boolean;
35
36
  borderMinSize?: number;
36
37
  borderSize?: number;
37
38
  enableEdgeDock?: boolean;
38
39
  marginInsets?: IInsets;
39
40
  rootOrientationVertical?: boolean;
41
+ splitterExtra?: number;
40
42
  splitterSize?: number;
43
+ tabBorderHeight?: number;
44
+ tabBorderWidth?: number;
41
45
  tabClassName?: string;
42
46
  tabCloseType?: ICloseType;
43
47
  tabDragSpeed?: number;
@@ -100,6 +104,8 @@ export interface ITabSetAttributes {
100
104
  width?: number;
101
105
  }
102
106
  export interface ITabAttributes {
107
+ borderHeight?: number;
108
+ borderWidth?: number;
103
109
  className?: string;
104
110
  closeType?: ICloseType;
105
111
  component?: string;
@@ -110,6 +116,7 @@ export interface ITabAttributes {
110
116
  enableRename?: boolean;
111
117
  enableRenderOnDemand?: boolean;
112
118
  floating?: boolean;
119
+ helpText?: string;
113
120
  icon?: string;
114
121
  id?: string;
115
122
  name?: string;
@@ -121,6 +128,7 @@ export interface IBorderAttributes {
121
128
  barSize?: number;
122
129
  className?: string;
123
130
  config?: any;
131
+ enableAutoHide?: boolean;
124
132
  enableDrop?: boolean;
125
133
  minSize?: number;
126
134
  selected?: number;
@@ -59,6 +59,7 @@ declare class Model {
59
59
  */
60
60
  toJson(): IJsonModel;
61
61
  getSplitterSize(): number;
62
+ getSplitterExtra(): number;
62
63
  isEnableEdgeDock(): boolean;
63
64
  /**
64
65
  * Sets a function to allow/deny dropping a node
@@ -9,6 +9,10 @@ import TabNode from "../model/TabNode";
9
9
  import TabSetNode from "../model/TabSetNode";
10
10
  import Rect from "../Rect";
11
11
  import { IJsonTabNode } from "../model/IJsonModel";
12
+ export declare type CustomDragCallback = (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation) => void;
13
+ export declare type DragRectRenderCallback = (text: String, node?: Node, json?: IJsonTabNode) => React.ReactElement | undefined;
14
+ export declare type FloatingTabPlaceholderRenderCallback = (dockPopout: () => void, showPopout: () => void) => React.ReactElement | undefined;
15
+ export declare type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
12
16
  export interface ILayoutProps {
13
17
  model: Model;
14
18
  factory: (node: TabNode) => React.ReactNode;
@@ -32,13 +36,19 @@ export interface ILayoutProps {
32
36
  supportsPopout?: boolean | undefined;
33
37
  popoutURL?: string | undefined;
34
38
  realtimeResize?: boolean | undefined;
35
- onTabDrag?: (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation) => undefined | {
39
+ onTabDrag?: (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation, refresh: () => void) => undefined | {
36
40
  x: number;
37
41
  y: number;
38
42
  width: number;
39
43
  height: number;
40
- callback: (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation) => void;
44
+ callback: CustomDragCallback;
45
+ invalidated?: () => void;
46
+ cursor?: string | undefined;
41
47
  };
48
+ onRenderDragRect?: DragRectRenderCallback;
49
+ onRenderFloatingTabPlaceholder?: FloatingTabPlaceholderRenderCallback;
50
+ onContextMenu?: NodeMouseEvent;
51
+ onAuxMouseClick?: NodeMouseEvent;
42
52
  }
43
53
  export interface IFontValues {
44
54
  size?: string;
@@ -68,6 +78,7 @@ export interface ILayoutState {
68
78
  calculatedTabBarSize: number;
69
79
  calculatedBorderBarSize: number;
70
80
  editingTab?: TabNode;
81
+ showHiddenBorder: DockLocation;
71
82
  }
72
83
  export interface IIcons {
73
84
  close?: React.ReactNode;
@@ -79,12 +90,14 @@ export interface IIcons {
79
90
  }
80
91
  export interface ICustomDropDestination {
81
92
  rect: Rect;
82
- callback: (dragging: TabNode | IJsonTabNode, over: TabNode, x: number, y: number, location: DockLocation) => void;
93
+ callback: CustomDragCallback;
94
+ invalidated: (() => void) | undefined;
83
95
  dragging: TabNode | IJsonTabNode;
84
96
  over: TabNode;
85
97
  x: number;
86
98
  y: number;
87
99
  location: DockLocation;
100
+ cursor: string | undefined;
88
101
  }
89
102
  /**
90
103
  * A React component that hosts a multi-tabbed layout
@@ -106,7 +119,7 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
106
119
  * Adds a new tab by dragging a labeled panel to the drop location, dragging starts immediatelly
107
120
  * @param dragText the text to show on the drag panel
108
121
  * @param json the json for the new tab node
109
- * @param onDrop a callback to call when the drag is complete
122
+ * @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
110
123
  */
111
124
  addTabWithDragAndDrop(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
112
125
  /**
@@ -115,8 +128,8 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
115
128
  *
116
129
  * @param dragText the text to show on the drag panel
117
130
  * @param json the json for the new tab node
118
- * @param onDrop a callback to call when the drag is complete
131
+ * @param onDrop a callback to call when the drag is complete (node and event will be undefined if the drag was cancelled)
119
132
  */
120
- addTabWithDragAndDropIndirect(dragText: string, json: IJsonTabNode, onDrop?: () => void): void;
133
+ addTabWithDragAndDropIndirect(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
121
134
  }
122
135
  export default Layout;