flexlayout-react 0.5.17 → 0.5.21
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 +20 -0
- package/README.md +123 -104
- package/declarations/Rect.d.ts +4 -0
- package/declarations/Types.d.ts +7 -1
- package/declarations/model/BorderNode.d.ts +1 -0
- package/declarations/model/IJsonModel.d.ts +3 -0
- package/declarations/model/Model.d.ts +1 -0
- package/declarations/view/Layout.d.ts +11 -3
- package/declarations/view/Tab.d.ts +1 -1
- package/dist/flexlayout.js +17 -17
- package/dist/flexlayout_min.js +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 +6 -0
- package/lib/Types.js.map +1 -1
- package/lib/model/BorderNode.js +22 -8
- package/lib/model/BorderNode.js.map +1 -1
- package/lib/model/BorderSet.js +15 -17
- package/lib/model/BorderSet.js.map +1 -1
- package/lib/model/Model.js +21 -3
- 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/TabSetNode.js +8 -4
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderButton.js +17 -6
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/BorderTabSet.js +17 -6
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/FloatingWindow.js +13 -5
- package/lib/view/FloatingWindow.js.map +1 -1
- package/lib/view/Layout.js +205 -70
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/Splitter.js +3 -3
- package/lib/view/Splitter.js.map +1 -1
- package/lib/view/Tab.js +18 -7
- package/lib/view/Tab.js.map +1 -1
- package/lib/view/TabButton.js +15 -8
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabFloating.js +29 -15
- package/lib/view/TabFloating.js.map +1 -1
- package/lib/view/TabSet.js +51 -25
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +11 -6
- package/src/PopupMenu.tsx +32 -11
- package/src/Rect.ts +6 -2
- package/src/Types.ts +6 -0
- package/src/model/BorderNode.ts +22 -8
- package/src/model/BorderSet.ts +15 -17
- package/src/model/IJsonModel.ts +3 -0
- package/src/model/Model.ts +28 -3
- package/src/model/RowNode.ts +8 -5
- package/src/model/TabSetNode.ts +8 -4
- package/src/view/BorderButton.tsx +34 -6
- package/src/view/BorderTabSet.tsx +25 -5
- package/src/view/FloatingWindow.tsx +14 -6
- package/src/view/Layout.tsx +271 -92
- package/src/view/Splitter.tsx +4 -1
- package/src/view/Tab.tsx +22 -6
- package/src/view/TabButton.tsx +31 -11
- package/src/view/TabFloating.tsx +47 -23
- package/src/view/TabSet.tsx +72 -20
- package/style/_base.scss +72 -48
- package/style/dark.css +88 -66
- package/style/dark.css.map +1 -1
- package/style/dark.scss +20 -20
- package/style/gray.css +88 -66
- package/style/gray.css.map +1 -1
- package/style/gray.scss +20 -20
- package/style/light.css +88 -66
- package/style/light.css.map +1 -1
- package/style/light.scss +18 -18
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
0.5.21
|
|
2
|
+
Fixed copying stylesheet links for popout windows when cssRules throw exception.
|
|
3
|
+
Added option, enableUseVisibility, to allow use of visibility: hidden rather than display:none for hiding elements.
|
|
4
|
+
|
|
5
|
+
0.5.20
|
|
6
|
+
Added Cypress Tests
|
|
7
|
+
Fixed bug with tab icon not showing
|
|
8
|
+
|
|
9
|
+
0.5.19
|
|
10
|
+
Added onRenderFloatingTabPlaceholder callback prop for rendering the floating tab placeholder.
|
|
11
|
+
Changed style sheets to use CSS custom properties (variables) for several values.
|
|
12
|
+
Fix selected index in single empty tabset.
|
|
13
|
+
Added onContextMenu callback prop for handling context menus on tabs and tabsets.
|
|
14
|
+
Added onAuxMouseClick callback prop for handling mouse clicks on tabs and tabsets
|
|
15
|
+
with alt, meta, shift keys, also handles center mouse clicks
|
|
16
|
+
|
|
17
|
+
0.5.18
|
|
18
|
+
Added onRenderDragRect callback prop for rendering the drag rectangles
|
|
19
|
+
New border attribute: enableAutoHide, to hide border if it has zero tabs
|
|
20
|
+
|
|
1
21
|
0.5.17
|
|
2
22
|
New global option, splitterExtra, to allow splitters to have an extended hit test areas.
|
|
3
23
|
This makes it easier to use narrow splitters.
|
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,36 @@ 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
|
+
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/
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
@@ -348,6 +360,7 @@ Attributes allowed in the 'global' element
|
|
|
348
360
|
| tabSetHeaderHeight | 0 | height of tabset header in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
349
361
|
| tabSetTabStripHeight | 0 | height of tabset tab bar in pixels; if left as 0 then the value will be calculated from the current fontSize |
|
|
350
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 |
|
|
351
364
|
| borderEnableDrop | true | allow user to drag tabs into this border |
|
|
352
365
|
| borderAutoSelectTabWhenOpen | true | whether to select new/moved tabs in border when the border is already open |
|
|
353
366
|
| borderAutoSelectTabWhenClosed | false | whether to select new/moved tabs in border when the border is curently closed |
|
|
@@ -455,6 +468,7 @@ Inherited defaults will take their value from the associated global attributes (
|
|
|
455
468
|
| id | auto generated | border_ + border name e.g. border_left |
|
|
456
469
|
| config | null | a place to hold json config used in your own code |
|
|
457
470
|
| show | true | show/hide this border |
|
|
471
|
+
| enableAutoHide | false | hide border if it has zero tabs |
|
|
458
472
|
| children | *required* | a list of tab nodes |
|
|
459
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 |
|
|
460
474
|
| enableDrop | *inherited* | |
|
|
@@ -567,13 +581,6 @@ First install dependencies:
|
|
|
567
581
|
yarn install
|
|
568
582
|
```
|
|
569
583
|
|
|
570
|
-
Install the peer dependencies:
|
|
571
|
-
|
|
572
|
-
```
|
|
573
|
-
yarn add react
|
|
574
|
-
yarn add react-dom
|
|
575
|
-
```
|
|
576
|
-
|
|
577
584
|
Compile the project and run the examples:
|
|
578
585
|
|
|
579
586
|
```
|
|
@@ -585,4 +592,16 @@ Open your browser at http://localhost:8080/examples/ to show the examples direct
|
|
|
585
592
|
The 'yarn start' command will watch for changes to flexlayout and example source, so you can make changes to the code
|
|
586
593
|
and then refresh the browser to see the result.
|
|
587
594
|
|
|
595
|
+
To run the tests in the Cypress interactive runner use:
|
|
596
|
+
|
|
597
|
+
```
|
|
598
|
+
yarn cypress
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+

|
|
602
|
+
|
|
603
|
+
|
|
588
604
|
To build the npm distribution run 'yarn build', this will create the artifacts in the dist dir.
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
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,6 +27,7 @@ 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",
|
|
29
32
|
FLEXLAYOUT__SPLITTER_EXTRA = "flexlayout__splitter_extra",
|
|
30
33
|
FLEXLAYOUT__SPLITTER_ = "flexlayout__splitter_",
|
|
@@ -59,5 +62,8 @@ export declare enum CLASSES {
|
|
|
59
62
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ = "flexlayout__tab_toolbar_button-",
|
|
60
63
|
FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT = "flexlayout__tab_toolbar_button-float",
|
|
61
64
|
FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER = "flexlayout__tab_toolbar_sticky_buttons_container",
|
|
62
|
-
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"
|
|
63
69
|
}
|
|
@@ -31,10 +31,12 @@ 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;
|
|
39
|
+
enableUseVisibility?: boolean;
|
|
38
40
|
marginInsets?: IInsets;
|
|
39
41
|
rootOrientationVertical?: boolean;
|
|
40
42
|
splitterExtra?: number;
|
|
@@ -127,6 +129,7 @@ export interface IBorderAttributes {
|
|
|
127
129
|
barSize?: number;
|
|
128
130
|
className?: string;
|
|
129
131
|
config?: any;
|
|
132
|
+
enableAutoHide?: boolean;
|
|
130
133
|
enableDrop?: boolean;
|
|
131
134
|
minSize?: number;
|
|
132
135
|
selected?: number;
|
|
@@ -10,6 +10,9 @@ import TabSetNode from "../model/TabSetNode";
|
|
|
10
10
|
import Rect from "../Rect";
|
|
11
11
|
import { IJsonTabNode } from "../model/IJsonModel";
|
|
12
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;
|
|
13
16
|
export interface ILayoutProps {
|
|
14
17
|
model: Model;
|
|
15
18
|
factory: (node: TabNode) => React.ReactNode;
|
|
@@ -42,6 +45,10 @@ export interface ILayoutProps {
|
|
|
42
45
|
invalidated?: () => void;
|
|
43
46
|
cursor?: string | undefined;
|
|
44
47
|
};
|
|
48
|
+
onRenderDragRect?: DragRectRenderCallback;
|
|
49
|
+
onRenderFloatingTabPlaceholder?: FloatingTabPlaceholderRenderCallback;
|
|
50
|
+
onContextMenu?: NodeMouseEvent;
|
|
51
|
+
onAuxMouseClick?: NodeMouseEvent;
|
|
45
52
|
}
|
|
46
53
|
export interface IFontValues {
|
|
47
54
|
size?: string;
|
|
@@ -71,6 +78,7 @@ export interface ILayoutState {
|
|
|
71
78
|
calculatedTabBarSize: number;
|
|
72
79
|
calculatedBorderBarSize: number;
|
|
73
80
|
editingTab?: TabNode;
|
|
81
|
+
showHiddenBorder: DockLocation;
|
|
74
82
|
}
|
|
75
83
|
export interface IIcons {
|
|
76
84
|
close?: React.ReactNode;
|
|
@@ -111,7 +119,7 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
|
|
|
111
119
|
* Adds a new tab by dragging a labeled panel to the drop location, dragging starts immediatelly
|
|
112
120
|
* @param dragText the text to show on the drag panel
|
|
113
121
|
* @param json the json for the new tab node
|
|
114
|
-
* @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)
|
|
115
123
|
*/
|
|
116
124
|
addTabWithDragAndDrop(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
117
125
|
/**
|
|
@@ -120,8 +128,8 @@ export declare class Layout extends React.Component<ILayoutProps, ILayoutState>
|
|
|
120
128
|
*
|
|
121
129
|
* @param dragText the text to show on the drag panel
|
|
122
130
|
* @param json the json for the new tab node
|
|
123
|
-
* @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)
|
|
124
132
|
*/
|
|
125
|
-
addTabWithDragAndDropIndirect(dragText: string, json: IJsonTabNode, onDrop?: () => void): void;
|
|
133
|
+
addTabWithDragAndDropIndirect(dragText: string, json: IJsonTabNode, onDrop?: (node?: Node, event?: Event) => void): void;
|
|
126
134
|
}
|
|
127
135
|
export default Layout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function hideElement(style: Record<string, any>, useVisibility: ConstrainBoolean): void;
|