flexlayout-react 0.5.15 → 0.5.19
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 +26 -0
- package/README.md +121 -97
- package/declarations/DragDrop.d.ts +1 -0
- package/declarations/I18nLabel.d.ts +1 -0
- package/declarations/Rect.d.ts +4 -0
- package/declarations/Types.d.ts +9 -1
- package/declarations/model/Actions.d.ts +18 -11
- package/declarations/model/BorderNode.d.ts +2 -1
- package/declarations/model/IJsonModel.d.ts +10 -0
- package/declarations/model/Model.d.ts +1 -0
- package/declarations/model/TabNode.d.ts +1 -0
- package/declarations/model/TabSetNode.d.ts +1 -0
- package/declarations/view/Layout.d.ts +20 -6
- package/dist/flexlayout.js +20 -20
- package/dist/flexlayout_min.js +1 -1
- package/lib/DockLocation.js +25 -11
- package/lib/DockLocation.js.map +1 -1
- package/lib/DragDrop.js +19 -3
- package/lib/DragDrop.js.map +1 -1
- package/lib/I18nLabel.js +1 -0
- package/lib/I18nLabel.js.map +1 -1
- package/lib/PopupMenu.js +14 -9
- package/lib/PopupMenu.js.map +1 -1
- package/lib/Rect.js +3 -0
- package/lib/Rect.js.map +1 -1
- package/lib/Types.js +8 -0
- package/lib/Types.js.map +1 -1
- package/lib/model/Actions.js +20 -11
- package/lib/model/Actions.js.map +1 -1
- package/lib/model/BorderNode.js +61 -14
- package/lib/model/BorderNode.js.map +1 -1
- package/lib/model/BorderSet.js +33 -19
- package/lib/model/BorderSet.js.map +1 -1
- package/lib/model/Model.js +39 -1
- package/lib/model/Model.js.map +1 -1
- package/lib/model/RowNode.js +19 -5
- package/lib/model/RowNode.js.map +1 -1
- package/lib/model/TabNode.js +14 -0
- package/lib/model/TabNode.js.map +1 -1
- package/lib/model/TabSetNode.js +42 -19
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderButton.js +14 -3
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/BorderTabSet.js +15 -4
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/Layout.js +206 -45
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/Splitter.js +34 -3
- package/lib/view/Splitter.js.map +1 -1
- package/lib/view/TabButton.js +11 -2
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabFloating.js +23 -11
- package/lib/view/TabFloating.js.map +1 -1
- package/lib/view/TabSet.js +50 -17
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +1 -1
- package/src/DockLocation.ts +30 -9
- package/src/DragDrop.ts +26 -3
- package/src/I18nLabel.ts +1 -0
- package/src/PopupMenu.tsx +28 -10
- package/src/Rect.ts +6 -2
- package/src/Types.ts +9 -0
- package/src/model/Actions.ts +21 -11
- package/src/model/BorderNode.ts +57 -15
- package/src/model/BorderSet.ts +32 -19
- package/src/model/IJsonModel.ts +10 -0
- package/src/model/Model.ts +43 -1
- package/src/model/RowNode.ts +8 -5
- package/src/model/TabNode.ts +16 -0
- package/src/model/TabSetNode.ts +43 -19
- package/src/view/BorderButton.tsx +22 -3
- package/src/view/BorderTabSet.tsx +21 -4
- package/src/view/Layout.tsx +263 -70
- package/src/view/Splitter.tsx +49 -3
- package/src/view/TabButton.tsx +17 -1
- package/src/view/TabFloating.tsx +36 -19
- package/src/view/TabSet.tsx +76 -16
- package/style/_base.scss +75 -44
- package/style/dark.css +90 -61
- package/style/dark.css.map +1 -1
- package/style/dark.scss +20 -20
- package/style/gray.css +90 -61
- package/style/gray.css.map +1 -1
- package/style/gray.scss +20 -20
- package/style/light.css +90 -61
- package/style/light.css.map +1 -1
- package/style/light.scss +18 -18
- package/yarn-error.log +0 -11828
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
0.5.19
|
|
2
|
+
Added onRenderFloatingTabPlaceholder callback prop for rendering the floating tab placeholder.
|
|
3
|
+
Changed style sheets to use CSS custom properties (variables) for several values.
|
|
4
|
+
Fix selected index in single empty tabset.
|
|
5
|
+
Added onContextMenu callback prop for handling context menus on tabs and tabsets.
|
|
6
|
+
Added onAuxMouseClick callback prop for handling mouse clicks on tabs and tabsets
|
|
7
|
+
with alt, meta, shift keys, also handles center mouse clicks
|
|
8
|
+
|
|
9
|
+
0.5.18
|
|
10
|
+
Added onRenderDragRect callback prop for rendering the drag rectangles
|
|
11
|
+
New border attribute: enableAutoHide, to hide border if it has zero tabs
|
|
12
|
+
|
|
13
|
+
0.5.17
|
|
14
|
+
New global option, splitterExtra, to allow splitters to have an extended hit test areas.
|
|
15
|
+
This makes it easier to use narrow splitters.
|
|
16
|
+
Added new TabNode attributes: borderWidth and borderHeight, these allow for individual border sizes for certain tabs.
|
|
17
|
+
Fix for #263 - borders splitters not taking minimum size of center into account
|
|
18
|
+
Improved algorithm for finding drop location
|
|
19
|
+
Additional parameter: cursor, for onTabDrag
|
|
20
|
+
|
|
21
|
+
0.5.16
|
|
22
|
+
Added 'New Features' layout to demo.
|
|
23
|
+
New tab attribute, helpText, to show tooltip over tabs.
|
|
24
|
+
New model action, deleteTabset, to delete a tabset and all it's child tabs.
|
|
25
|
+
New tabset attribute, enableClose, to close the tabset
|
|
26
|
+
|
|
1
27
|
0.5.15
|
|
2
28
|
Added new Layout prop: onTabDrag that allows tab dragging to be intercepted.
|
|
3
29
|
Added example of onTabDrag in demo app, example shows a list where tabs can be dragged into,
|
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/
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
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,38 @@ render() {
|
|
|
104
118
|
|
|
105
119
|
```javascript
|
|
106
120
|
var json = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
"selected": 0,
|
|
131
|
+
"children": [
|
|
132
|
+
{
|
|
133
|
+
"type": "tab",
|
|
134
|
+
"name": "FX",
|
|
135
|
+
"component":"grid",
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "tabset",
|
|
141
|
+
"weight": 50,
|
|
142
|
+
"selected": 0,
|
|
143
|
+
"children": [
|
|
144
|
+
{
|
|
145
|
+
"type": "tab",
|
|
146
|
+
"name": "FI",
|
|
147
|
+
"component":"grid",
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
139
153
|
};
|
|
140
154
|
```
|
|
141
155
|
|
|
@@ -173,7 +187,7 @@ ReactDOM.render(<Main/>, document.getElementById("container"));
|
|
|
173
187
|
|
|
174
188
|
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
189
|
|
|
176
|
-
Try it now using [JSFiddle](https://jsfiddle.net/
|
|
190
|
+
Try it now using [JSFiddle](https://jsfiddle.net/7oe4q2pc/)
|
|
177
191
|
|
|
178
192
|
A simple Create React App (CRA) example (using typescript) can be found here:
|
|
179
193
|
|
|
@@ -207,50 +221,50 @@ existing layouts by dragging/dropping and adding nodes then press the 'Show Layo
|
|
|
207
221
|
|
|
208
222
|
example borders section:
|
|
209
223
|
```
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
224
|
+
"borders": [
|
|
225
|
+
{
|
|
226
|
+
"type":"border",
|
|
227
|
+
"location": "left",
|
|
228
|
+
"children": [
|
|
229
|
+
{
|
|
230
|
+
"type": "tab",
|
|
231
|
+
"enableClose":false,
|
|
232
|
+
"name": "Navigation",
|
|
233
|
+
"component": "grid",
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type":"border",
|
|
239
|
+
"location": "right",
|
|
240
|
+
"children": [
|
|
241
|
+
{
|
|
242
|
+
"type": "tab",
|
|
243
|
+
"enableClose":false,
|
|
244
|
+
"name": "Options",
|
|
245
|
+
"component": "grid",
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"type":"border",
|
|
251
|
+
"location": "bottom",
|
|
252
|
+
"children": [
|
|
253
|
+
{
|
|
254
|
+
"type": "tab",
|
|
255
|
+
"enableClose":false,
|
|
256
|
+
"name": "Activity Blotter",
|
|
257
|
+
"component": "grid",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"type": "tab",
|
|
261
|
+
"enableClose":false,
|
|
262
|
+
"name": "Execution Blotter",
|
|
263
|
+
"component": "grid",
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
]
|
|
254
268
|
```
|
|
255
269
|
|
|
256
270
|
To control where nodes can be dropped you can add a callback function to the model:
|
|
@@ -322,6 +336,7 @@ Attributes allowed in the 'global' element
|
|
|
322
336
|
| Attribute | Default | Description |
|
|
323
337
|
| ------------- |:-------------:| -----|
|
|
324
338
|
| splitterSize | 8 | width in pixels of all splitters between tabsets/borders |
|
|
339
|
+
| splitterExtra | 0 | additional width in pixels of the splitter hit test area |
|
|
325
340
|
| enableEdgeDock | true | |
|
|
326
341
|
| tabEnableClose | true | allow user to close all tabs via close button |
|
|
327
342
|
| tabCloseType | 1 | see values in ICloseType |
|
|
@@ -332,11 +347,14 @@ Attributes allowed in the 'global' element
|
|
|
332
347
|
| tabIcon | null | |
|
|
333
348
|
| tabEnableRenderOnDemand | true | whether to avoid rendering component until tab is visible |
|
|
334
349
|
| tabDragSpeed | 0.3 | CSS transition speed of drag outlines (in seconds) |
|
|
350
|
+
| tabBorderWidth | -1 | width when added to border, -1 will use border size |
|
|
351
|
+
| tabBorderHeight | -1 | height when added to border, -1 will use border size |
|
|
335
352
|
| tabSetEnableDeleteWhenEmpty | true | |
|
|
336
353
|
| tabSetEnableDrop | true | allow user to drag tabs into all tabsets |
|
|
337
354
|
| tabSetEnableDrag | true | allow user to drag tabs out of all tabsets |
|
|
338
355
|
| tabSetEnableDivide | true | allow user to drag tabs to region of all tabsets, splitting into new tabset |
|
|
339
356
|
| tabSetEnableMaximize | true | allow user to maximize all tabsets to fill view via maximize button |
|
|
357
|
+
| tabSetEnableClose | false | allow user to close all tabsets via close button |
|
|
340
358
|
| tabSetAutoSelectTab | true | whether to select new/moved tabs in all tabsets |
|
|
341
359
|
| tabSetClassNameTabStrip | null | height in pixels of tab strips in all tabsets |
|
|
342
360
|
| tabSetClassNameHeader | null | |
|
|
@@ -344,6 +362,7 @@ Attributes allowed in the 'global' element
|
|
|
344
362
|
| tabSetHeaderHeight | 0 | height of tabset header in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
345
363
|
| tabSetTabStripHeight | 0 | height of tabset tab bar in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
346
364
|
| borderBarSize | 0 | size of the border bars in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
365
|
+
| borderEnableAutoHide | false | hide border if it has zero tabs |
|
|
347
366
|
| borderEnableDrop | true | allow user to drag tabs into this border |
|
|
348
367
|
| borderAutoSelectTabWhenOpen | true | whether to select new/moved tabs in border when the border is already open |
|
|
349
368
|
| borderAutoSelectTabWhenClosed | false | whether to select new/moved tabs in border when the border is curently closed |
|
|
@@ -382,6 +401,7 @@ Inherited defaults will take their value from the associated global attributes (
|
|
|
382
401
|
| component | *required* | string identifying which component to run (for factory) |
|
|
383
402
|
| config | null | a place to hold json config for the hosted component |
|
|
384
403
|
| id | auto generated | |
|
|
404
|
+
| helpText | *optional* | An optional help text for the tab to be displayed upon tab hover. |
|
|
385
405
|
| enableClose | *inherited* | allow user to close tab via close button |
|
|
386
406
|
| closeType | *inherited* | see values in ICloseType |
|
|
387
407
|
| enableDrag | *inherited* | allow user to drag tab to new location |
|
|
@@ -391,6 +411,8 @@ Inherited defaults will take their value from the associated global attributes (
|
|
|
391
411
|
| className | *inherited* | |
|
|
392
412
|
| icon | *inherited* | |
|
|
393
413
|
| enableRenderOnDemand | *inherited* | whether to avoid rendering component until tab is visible |
|
|
414
|
+
| borderWidth | *inherited* | width when added to border, -1 will use border size |
|
|
415
|
+
| borderHeight | *inherited* | height when added to border, -1 will use border size |
|
|
394
416
|
|
|
395
417
|
Tab nodes have a getExtraData() method that initially returns an empty object, this is the place to
|
|
396
418
|
add extra data to a tab node that will not be saved.
|
|
@@ -414,6 +436,7 @@ Note: tabsets can be dynamically created as tabs are moved and deleted when all
|
|
|
414
436
|
| config | null | a place to hold json config used in your own code |
|
|
415
437
|
| selected | 0 | index of selected/visible tab in tabset |
|
|
416
438
|
| maximized | false | whether tabset is currently maximized to fill view |
|
|
439
|
+
| enableClose | false | allow user to close tabset via a close button |
|
|
417
440
|
| id | auto generated | |
|
|
418
441
|
| children | *required* | a list of tab nodes |
|
|
419
442
|
| enableDeleteWhenEmpty | *inherited* | |
|
|
@@ -447,6 +470,7 @@ Inherited defaults will take their value from the associated global attributes (
|
|
|
447
470
|
| id | auto generated | border_ + border name e.g. border_left |
|
|
448
471
|
| config | null | a place to hold json config used in your own code |
|
|
449
472
|
| show | true | show/hide this border |
|
|
473
|
+
| enableAutoHide | false | hide border if it has zero tabs |
|
|
450
474
|
| children | *required* | a list of tab nodes |
|
|
451
475
|
| barSize | *inherited* | size of this border's bar in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
452
476
|
| enableDrop | *inherited* | |
|
|
@@ -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;
|
package/declarations/Rect.d.ts
CHANGED
|
@@ -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;
|
package/declarations/Types.d.ts
CHANGED
|
@@ -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",
|
|
@@ -57,5 +61,9 @@ export declare enum CLASSES {
|
|
|
57
61
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON = "flexlayout__tab_toolbar_button",
|
|
58
62
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ = "flexlayout__tab_toolbar_button-",
|
|
59
63
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT = "flexlayout__tab_toolbar_button-float",
|
|
60
|
-
FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER = "flexlayout__tab_toolbar_sticky_buttons_container"
|
|
64
|
+
FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER = "flexlayout__tab_toolbar_sticky_buttons_container",
|
|
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"
|
|
61
69
|
}
|
|
@@ -7,6 +7,7 @@ declare class Actions {
|
|
|
7
7
|
static ADD_NODE: string;
|
|
8
8
|
static MOVE_NODE: string;
|
|
9
9
|
static DELETE_TAB: string;
|
|
10
|
+
static DELETE_TABSET: string;
|
|
10
11
|
static RENAME_TAB: string;
|
|
11
12
|
static SELECT_TAB: string;
|
|
12
13
|
static SET_ACTIVE_TABSET: string;
|
|
@@ -24,7 +25,7 @@ declare class Actions {
|
|
|
24
25
|
* @param location the location where the new tab will be added, one of the DockLocation enum values.
|
|
25
26
|
* @param index for docking to the center this value is the index of the tab, use -1 to add to the end.
|
|
26
27
|
* @param select (optional) whether to select the new tab, overriding autoSelectTab
|
|
27
|
-
* @returns {
|
|
28
|
+
* @returns {Action} the action
|
|
28
29
|
*/
|
|
29
30
|
static addNode(json: any, toNodeId: string, location: DockLocation, index: number, select?: boolean): Action;
|
|
30
31
|
/**
|
|
@@ -34,32 +35,38 @@ declare class Actions {
|
|
|
34
35
|
* @param location the location where the moved node will be added, one of the DockLocation enum values.
|
|
35
36
|
* @param index for docking to the center this value is the index of the tab, use -1 to add to the end.
|
|
36
37
|
* @param select (optional) whether to select the moved tab(s) in new tabset, overriding autoSelectTab
|
|
37
|
-
* @returns {
|
|
38
|
+
* @returns {Action} the action
|
|
38
39
|
*/
|
|
39
40
|
static moveNode(fromNodeId: string, toNodeId: string, location: DockLocation, index: number, select?: boolean): Action;
|
|
40
41
|
/**
|
|
41
42
|
* Deletes a tab node from the layout
|
|
42
|
-
* @param
|
|
43
|
-
* @returns {
|
|
43
|
+
* @param tabsetNodeId the id of the tab node to delete
|
|
44
|
+
* @returns {Action} the action
|
|
44
45
|
*/
|
|
45
46
|
static deleteTab(tabNodeId: string): Action;
|
|
47
|
+
/**
|
|
48
|
+
* Deletes a tabset node and all it's child tab nodes from the layout
|
|
49
|
+
* @param tabsetNodeId the id of the tabset node to delete
|
|
50
|
+
* @returns {Action} the action
|
|
51
|
+
*/
|
|
52
|
+
static deleteTabset(tabsetNodeId: string): Action;
|
|
46
53
|
/**
|
|
47
54
|
* Change the given nodes tab text
|
|
48
55
|
* @param tabNodeId the id of the node to rename
|
|
49
56
|
* @param text the test of the tab
|
|
50
|
-
* @returns {
|
|
57
|
+
* @returns {Action} the action
|
|
51
58
|
*/
|
|
52
59
|
static renameTab(tabNodeId: string, text: string): Action;
|
|
53
60
|
/**
|
|
54
61
|
* Selects the given tab in its parent tabset
|
|
55
62
|
* @param tabNodeId the id of the node to set selected
|
|
56
|
-
* @returns {
|
|
63
|
+
* @returns {Action} the action
|
|
57
64
|
*/
|
|
58
65
|
static selectTab(tabNodeId: string): Action;
|
|
59
66
|
/**
|
|
60
67
|
* Set the given tabset node as the active tabset
|
|
61
68
|
* @param tabsetNodeId the id of the tabset node to set as active
|
|
62
|
-
* @returns {
|
|
69
|
+
* @returns {Action} the action
|
|
63
70
|
*/
|
|
64
71
|
static setActiveTabset(tabsetNodeId: string): Action;
|
|
65
72
|
/**
|
|
@@ -68,7 +75,7 @@ declare class Actions {
|
|
|
68
75
|
* Actions.adjustSplit({node1: "1", weight1:30, pixelWidth1:300, node2: "2", weight2:70, pixelWidth2:700});
|
|
69
76
|
*
|
|
70
77
|
* @param splitSpec an object the defines the new split between two tabsets, see example below.
|
|
71
|
-
* @returns {
|
|
78
|
+
* @returns {Action} the action
|
|
72
79
|
*/
|
|
73
80
|
static adjustSplit(splitSpec: {
|
|
74
81
|
node1Id: string;
|
|
@@ -82,20 +89,20 @@ declare class Actions {
|
|
|
82
89
|
/**
|
|
83
90
|
* Maximizes the given tabset
|
|
84
91
|
* @param tabsetNodeId the id of the tabset to maximize
|
|
85
|
-
* @returns {
|
|
92
|
+
* @returns {Action} the action
|
|
86
93
|
*/
|
|
87
94
|
static maximizeToggle(tabsetNodeId: string): Action;
|
|
88
95
|
/**
|
|
89
96
|
* Updates the global model jsone attributes
|
|
90
97
|
* @param attributes the json for the model attributes to update (merge into the existing attributes)
|
|
91
|
-
* @returns {
|
|
98
|
+
* @returns {Action} the action
|
|
92
99
|
*/
|
|
93
100
|
static updateModelAttributes(attributes: any): Action;
|
|
94
101
|
/**
|
|
95
102
|
* Updates the given nodes json attributes
|
|
96
103
|
* @param nodeId the id of the node to update
|
|
97
104
|
* @param attributes the json attributes to update (merge with the existing attributes)
|
|
98
|
-
* @returns {
|
|
105
|
+
* @returns {Action} the action
|
|
99
106
|
*/
|
|
100
107
|
static updateNodeAttributes(nodeId: string, attributes: any): Action;
|
|
101
108
|
static floatTab(nodeId: string): Action;
|
|
@@ -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():
|
|
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;
|
|
@@ -51,6 +55,7 @@ export interface IGlobalAttributes {
|
|
|
51
55
|
tabSetBorderInsets?: IInsets;
|
|
52
56
|
tabSetClassNameHeader?: string;
|
|
53
57
|
tabSetClassNameTabStrip?: string;
|
|
58
|
+
tabSetEnableClose?: boolean;
|
|
54
59
|
tabSetEnableDeleteWhenEmpty?: boolean;
|
|
55
60
|
tabSetEnableDivide?: boolean;
|
|
56
61
|
tabSetEnableDrag?: boolean;
|
|
@@ -77,6 +82,7 @@ export interface ITabSetAttributes {
|
|
|
77
82
|
classNameHeader?: string;
|
|
78
83
|
classNameTabStrip?: string;
|
|
79
84
|
config?: any;
|
|
85
|
+
enableClose?: boolean;
|
|
80
86
|
enableDeleteWhenEmpty?: boolean;
|
|
81
87
|
enableDivide?: boolean;
|
|
82
88
|
enableDrag?: boolean;
|
|
@@ -98,6 +104,8 @@ export interface ITabSetAttributes {
|
|
|
98
104
|
width?: number;
|
|
99
105
|
}
|
|
100
106
|
export interface ITabAttributes {
|
|
107
|
+
borderHeight?: number;
|
|
108
|
+
borderWidth?: number;
|
|
101
109
|
className?: string;
|
|
102
110
|
closeType?: ICloseType;
|
|
103
111
|
component?: string;
|
|
@@ -108,6 +116,7 @@ export interface ITabAttributes {
|
|
|
108
116
|
enableRename?: boolean;
|
|
109
117
|
enableRenderOnDemand?: boolean;
|
|
110
118
|
floating?: boolean;
|
|
119
|
+
helpText?: string;
|
|
111
120
|
icon?: string;
|
|
112
121
|
id?: string;
|
|
113
122
|
name?: string;
|
|
@@ -119,6 +128,7 @@ export interface IBorderAttributes {
|
|
|
119
128
|
barSize?: number;
|
|
120
129
|
className?: string;
|
|
121
130
|
config?: any;
|
|
131
|
+
enableAutoHide?: boolean;
|
|
122
132
|
enableDrop?: boolean;
|
|
123
133
|
minSize?: number;
|
|
124
134
|
selected?: number;
|
|
@@ -7,6 +7,7 @@ declare class TabNode extends Node implements IDraggable {
|
|
|
7
7
|
getWindow(): Window | undefined;
|
|
8
8
|
getTabRect(): Rect | undefined;
|
|
9
9
|
getName(): string;
|
|
10
|
+
getHelpText(): string | undefined;
|
|
10
11
|
getComponent(): string | undefined;
|
|
11
12
|
/**
|
|
12
13
|
* Returns the config attribute that can be used to store node specific data that
|
|
@@ -27,6 +27,7 @@ declare class TabSetNode extends Node implements IDraggable, IDropTarget {
|
|
|
27
27
|
isEnableDrag(): boolean;
|
|
28
28
|
isEnableDivide(): boolean;
|
|
29
29
|
isEnableMaximize(): boolean;
|
|
30
|
+
isEnableClose(): boolean;
|
|
30
31
|
canMaximize(): boolean;
|
|
31
32
|
isEnableTabStrip(): boolean;
|
|
32
33
|
isAutoSelectTab(): boolean;
|