- Add dragging whole tabsets within a
Workspace. A tabset is dragged by the empty space in its header, or by aTabsetDragHandle(or any element with adata-tabset-drag-handleattribute) when it has one. Dropping a tabset onto the edge of another tabset moves it there; dropping it onto another tabset's center or tab list moves its tabs into that tabset. Tabsets with thekeepWhenEmptyflag can only be moved, not merged. Tabsets can't be dragged when they have the newdisableDragflag or contain a tab that does. - #785- The new
moveTabsetimperative method,renderTabsetDragPreviewprop, andisDragDisabledvalue (returned byuseParentTabsetState) support tabset dragging. A tabset being dragged has adata-tabset-draggingattribute, and the drag preview has adata-drag-typeattribute ("tab"or"tabset"). disableDropis called for each tab in a dragged tabset, with the target each tab would be dropped at, so existing restrictions apply to tabset drags too. The newtabsetargument is set while a whole tabset is dragged.
- The new
- Add collapsible tabsets to
Workspace. A tabset with the newcollapsibleflag can be collapsed to just its header (e.g. a bottom panel, or a sidebar that collapses to a vertical strip of tabs), by dragging a separator past its minimum size (like a collapsiblePanel) or with the newcollapseTabsetandexpandTabsetmethods; clicking a tab in a collapsed tabset expands it. Whether a tabset is collapsed is saved in the model (collapsed), and itssizeis the size it expands to. - #787useParentTabsetreturnscollapse,expand, andisCollapsedfunctions, anduseParentTabsetStatereturnsisCollapsedandisCollapsiblevalues (e.g. for a collapse button in a tabset's toolbar). Elements within a collapsed tabset have adata-tabset-collapsedattribute.onModelChangedreports the new"collapse"and"expand"reasons.
- Add the
WorkspacetabRemovalSelectionBehaviorprop, which chooses the tab that's selected when the selected tab is closed (or dragged to another tabset): the tab after it ("adjacent", the default), or the tabset's most recently selected tab ("recent", like an IDE's editor groups). In"recent"mode, each tabset's recently selected tabs are saved in the model (TabsetNode.recentTabIds). - #786
Warning
The tab argument passed to disableDrop may now be undefined, when a tabset without tabs (one with the keepWhenEmpty flag) is dragged. Functions that read tab (e.g. tab.data) should check for this first.