react-resizable-panels 4.16.0 → 4.17.0
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.
|
@@ -111,9 +111,24 @@ export declare type CellProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
111
111
|
style?: CSSProperties | undefined;
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Arguments passed to the Workspace's `disableDrop` prop.
|
|
116
|
+
*
|
|
117
|
+
* While a tabset is dragged, `disableDrop` is called once for each of its tabs (with the target that tab would be dropped at),
|
|
118
|
+
* and the target is rejected if any call returns `true`.
|
|
119
|
+
*/
|
|
114
120
|
export declare type DisableDropArgs<TabData = unknown, TabsetData = unknown> = {
|
|
115
121
|
model: WorkspaceModel<TabData, TabsetData>;
|
|
116
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The tab being dropped.
|
|
124
|
+
*
|
|
125
|
+
* ⚠️ This is `undefined` when a tabset without tabs (one with the `keepWhenEmpty` flag) is dragged.
|
|
126
|
+
*/
|
|
127
|
+
tab: TabNode<TabData> | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The tabset being dragged, when a whole tabset is dragged (rather than a single tab).
|
|
130
|
+
*/
|
|
131
|
+
tabset: TabsetNode<TabData, TabsetData> | undefined;
|
|
117
132
|
target: TabDropTarget;
|
|
118
133
|
};
|
|
119
134
|
|
|
@@ -1026,10 +1041,25 @@ export declare type ParentTabset<TabData = unknown> = {
|
|
|
1026
1041
|
* Close the tabset, along with any tabs it contains (see `WorkspaceImperativeHandle.closeTabset`).
|
|
1027
1042
|
*/
|
|
1028
1043
|
close: () => void;
|
|
1044
|
+
/**
|
|
1045
|
+
* Collapse the tabset to just its header (see `WorkspaceImperativeHandle.collapseTabset`).
|
|
1046
|
+
*/
|
|
1047
|
+
collapse: () => void;
|
|
1048
|
+
/**
|
|
1049
|
+
* Expand the tabset if it is collapsed.
|
|
1050
|
+
*/
|
|
1051
|
+
expand: () => void;
|
|
1029
1052
|
/**
|
|
1030
1053
|
* Id of the tabset.
|
|
1031
1054
|
*/
|
|
1032
1055
|
id: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* The tabset is currently collapsed (in the model).
|
|
1058
|
+
*
|
|
1059
|
+
* ℹ️ While a separator is being dragged, a tabset may be shown collapsed (or expanded) before the model changes;
|
|
1060
|
+
* `useParentTabsetState().isCollapsed` reflects how it's shown.
|
|
1061
|
+
*/
|
|
1062
|
+
isCollapsed: () => boolean;
|
|
1033
1063
|
/**
|
|
1034
1064
|
* The tabset is currently maximized.
|
|
1035
1065
|
*/
|
|
@@ -1058,6 +1088,28 @@ export declare type ParentTabsetState = {
|
|
|
1058
1088
|
* The user most recently interacted with this tabset (by pointer or focus).
|
|
1059
1089
|
*/
|
|
1060
1090
|
isActive: boolean;
|
|
1091
|
+
/**
|
|
1092
|
+
* The tabset is collapsed to just its header.
|
|
1093
|
+
*
|
|
1094
|
+
* ℹ️ While a separator is being dragged, this reflects how the tabset is shown (e.g. collapsed as soon as it reaches its collapsed size),
|
|
1095
|
+
* which the model (and `useParentTabset().isCollapsed()`) only reflects once the drag ends.
|
|
1096
|
+
*
|
|
1097
|
+
* ℹ️ A maximized tabset is shown expanded, but it's still collapsed when it is restored.
|
|
1098
|
+
*/
|
|
1099
|
+
isCollapsed: boolean;
|
|
1100
|
+
/**
|
|
1101
|
+
* The tabset can be collapsed (or is collapsed, and can be expanded), e.g. to show or hide a toolbar button:
|
|
1102
|
+
* it has the `collapsible` flag, isn't the only tabset in the workspace, and has a sibling that isn't collapsed.
|
|
1103
|
+
*/
|
|
1104
|
+
isCollapsible: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* The user cannot drag the tabset as a whole, because:
|
|
1107
|
+
* - It has the `disableDrag` flag, or one of its tabs does
|
|
1108
|
+
* - The Workspace has the `disabled` prop
|
|
1109
|
+
* - It's the only tabset in the workspace (see `isRoot`)
|
|
1110
|
+
* - A tabset is maximized
|
|
1111
|
+
*/
|
|
1112
|
+
isDragDisabled: boolean;
|
|
1061
1113
|
/**
|
|
1062
1114
|
* The tabset is maximized.
|
|
1063
1115
|
*/
|
|
@@ -1093,7 +1145,10 @@ export declare type ParentTabState = {
|
|
|
1093
1145
|
*/
|
|
1094
1146
|
isSelected: boolean;
|
|
1095
1147
|
/**
|
|
1096
|
-
* The tab is selected, and its tabset is
|
|
1148
|
+
* The tab is selected, and its tabset is neither collapsed nor covered by another, maximized tabset.
|
|
1149
|
+
*
|
|
1150
|
+
* ℹ️ While a separator is being dragged, this reflects how the tab's tabset is shown (e.g. collapsed as soon as it reaches its collapsed size),
|
|
1151
|
+
* which the model only reflects once the drag ends.
|
|
1097
1152
|
*
|
|
1098
1153
|
* ⚠️ This value does not account for the Workspace itself being hidden.
|
|
1099
1154
|
*/
|
|
@@ -1249,13 +1304,14 @@ export declare type SplitNodeInput<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1249
1304
|
* renderTab={(tab, props) => (
|
|
1250
1305
|
* <div {...props}>
|
|
1251
1306
|
* {tab.title}
|
|
1252
|
-
* <TabCloseButton
|
|
1307
|
+
* <TabCloseButton>×</TabCloseButton>
|
|
1253
1308
|
* </div>
|
|
1254
1309
|
* )}
|
|
1255
1310
|
* ```
|
|
1256
1311
|
*
|
|
1257
1312
|
* The button renders nothing if closing is disabled (by the tab's `disableClose` flag or the Workspace's `disabled` prop).
|
|
1258
|
-
* Its
|
|
1313
|
+
* Its content defaults to "×" (e.g. it can be replaced with an icon),
|
|
1314
|
+
* and its default `aria-label` is "Close" followed by the tab's title (or id).
|
|
1259
1315
|
*
|
|
1260
1316
|
* To keep the tab open (e.g. to confirm unsaved changes first), call `event.preventDefault()` in an `onClick` handler:
|
|
1261
1317
|
*
|
|
@@ -1334,6 +1390,13 @@ export declare type TabNode<TabData = unknown> = {
|
|
|
1334
1390
|
disableDrag?: boolean | undefined;
|
|
1335
1391
|
};
|
|
1336
1392
|
|
|
1393
|
+
/**
|
|
1394
|
+
* Which tab is selected when a tabset's selected tab is removed (closed, or dragged to another tabset):
|
|
1395
|
+
* - `"adjacent"`: the tab after it (or before it, if it was the last tab)
|
|
1396
|
+
* - `"recent"`: the tabset's most recently selected tab (falling back to `"adjacent"` if none of its other tabs has been selected)
|
|
1397
|
+
*/
|
|
1398
|
+
export declare type TabRemovalSelectionBehavior = "adjacent" | "recent";
|
|
1399
|
+
|
|
1337
1400
|
/**
|
|
1338
1401
|
* Props passed to the Workspace's `renderTab` prop, to be spread onto the element it returns.
|
|
1339
1402
|
*/
|
|
@@ -1342,6 +1405,30 @@ export declare type TabRenderProps = Pick<HTMLAttributes<HTMLElement>, "aria-con
|
|
|
1342
1405
|
[dataAttribute: `data-${string}`]: string | boolean | undefined;
|
|
1343
1406
|
};
|
|
1344
1407
|
|
|
1408
|
+
/**
|
|
1409
|
+
* Drags the tabset it is rendered within; render it within the content returned by the Workspace's `renderTabsetToolbar` prop:
|
|
1410
|
+
*
|
|
1411
|
+
* ```tsx
|
|
1412
|
+
* renderTabsetToolbar={() => (
|
|
1413
|
+
* <TabsetDragHandle>⠿</TabsetDragHandle>
|
|
1414
|
+
* )}
|
|
1415
|
+
* ```
|
|
1416
|
+
*
|
|
1417
|
+
* By default, a tabset is dragged by the empty space in its header;
|
|
1418
|
+
* once its header contains a drag handle, only the handle drags it.
|
|
1419
|
+
* Any element with a `data-tabset-drag-handle` attribute is a drag handle;
|
|
1420
|
+
* this component also sets `touch-action: none`, so that it can be dragged by touch.
|
|
1421
|
+
*
|
|
1422
|
+
* The handle has a `data-disabled` attribute when the tabset can't be dragged (see `useParentTabsetState`), e.g. to hide it.
|
|
1423
|
+
*/
|
|
1424
|
+
export declare const TabsetDragHandle: typeof TabsetDragHandleComponent & {
|
|
1425
|
+
displayName: string;
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
declare function TabsetDragHandleComponent({ style, ...rest }: TabsetDragHandleProps): JSX.Element;
|
|
1429
|
+
|
|
1430
|
+
export declare type TabsetDragHandleProps = HTMLAttributes<HTMLDivElement>;
|
|
1431
|
+
|
|
1345
1432
|
/**
|
|
1346
1433
|
* A set of tabs, only one of which is shown at a time.
|
|
1347
1434
|
*/
|
|
@@ -1405,10 +1492,45 @@ export declare type TabsetNode<TabData = unknown, TabsetData = unknown> = {
|
|
|
1405
1492
|
* ℹ️ Tabsets created by the workspace (e.g. by dropping a tab onto the edge of another tabset) don't keep this flag.
|
|
1406
1493
|
*/
|
|
1407
1494
|
keepWhenEmpty?: boolean | undefined;
|
|
1495
|
+
/**
|
|
1496
|
+
* The tabset can be collapsed to just its header (its tab list and toolbar), e.g. a bottom panel or a sidebar.
|
|
1497
|
+
*
|
|
1498
|
+
* ℹ️ Tabsets are collapsed by dragging a separator past their minimum size (like collapsible Panels),
|
|
1499
|
+
* or with the imperative API (e.g. a button rendered by `renderTabsetToolbar`, see `useParentTabset`);
|
|
1500
|
+
* clicking a tab (or the empty space in the header) of a collapsed tabset expands it, as does dropping tabs into it from another tabset.
|
|
1501
|
+
*
|
|
1502
|
+
* ℹ️ The only tabset in a workspace (the root) can't be collapsed, and neither can a tabset whose siblings are all collapsed.
|
|
1503
|
+
*
|
|
1504
|
+
* ℹ️ Tabsets created by the workspace (e.g. by dropping a tab onto the edge of another tabset) don't keep this flag.
|
|
1505
|
+
*/
|
|
1506
|
+
collapsible?: boolean | undefined;
|
|
1507
|
+
/**
|
|
1508
|
+
* The tabset is collapsed to just its header.
|
|
1509
|
+
*
|
|
1510
|
+
* ℹ️ A collapsed tabset's `size` is the size it expands to; its siblings share the rest of the split.
|
|
1511
|
+
*
|
|
1512
|
+
* ℹ️ A collapsed tabset's header runs along its split (e.g. tabs placed on top are shown on the left while a tabset in a horizontal split is collapsed);
|
|
1513
|
+
* this doesn't change its `tabPlacement`.
|
|
1514
|
+
*/
|
|
1515
|
+
collapsed?: boolean | undefined;
|
|
1516
|
+
/**
|
|
1517
|
+
* The user cannot drag the tabset as a whole (by the empty space in its header, or by a `TabsetDragHandle`).
|
|
1518
|
+
*
|
|
1519
|
+
* ℹ️ Its tabs can still be dragged individually (unless they have their own `disableDrag` flags),
|
|
1520
|
+
* and the tabset can still be moved using the imperative API.
|
|
1521
|
+
*/
|
|
1522
|
+
disableDrag?: boolean | undefined;
|
|
1408
1523
|
/**
|
|
1409
1524
|
* Id of the selected tab.
|
|
1410
1525
|
*/
|
|
1411
1526
|
selectedId?: string | undefined;
|
|
1527
|
+
/**
|
|
1528
|
+
* Ids of the tabset's tabs that have been selected, most recently selected first;
|
|
1529
|
+
* used to choose which tab to select when the selected tab is removed (see the Workspace's `tabRemovalSelectionBehavior` prop).
|
|
1530
|
+
*
|
|
1531
|
+
* ℹ️ This field is maintained by the workspace, and only when `tabRemovalSelectionBehavior` is `"recent"`.
|
|
1532
|
+
*/
|
|
1533
|
+
recentTabIds?: string[] | undefined;
|
|
1412
1534
|
/**
|
|
1413
1535
|
* Application data for the tabset.
|
|
1414
1536
|
*
|
|
@@ -1655,6 +1777,9 @@ export declare type WorkspaceChangedMeta = {
|
|
|
1655
1777
|
/**
|
|
1656
1778
|
* Which change was made.
|
|
1657
1779
|
*
|
|
1780
|
+
* ℹ️ A resize that collapses or expands tabsets is reported as `"collapse"` or `"expand"` (as `"expand"` if it does both);
|
|
1781
|
+
* dropping tabs into a collapsed tabset expands it, but is reported as `"move"`.
|
|
1782
|
+
*
|
|
1658
1783
|
* ⚠️ New reasons may be added in later versions, so code that switches on this value should handle unrecognized values.
|
|
1659
1784
|
*/
|
|
1660
1785
|
reason: WorkspaceChangeReason;
|
|
@@ -1665,7 +1790,7 @@ export declare type WorkspaceChangedMeta = {
|
|
|
1665
1790
|
*
|
|
1666
1791
|
* ⚠️ New reasons may be added in later versions.
|
|
1667
1792
|
*/
|
|
1668
|
-
export declare type WorkspaceChangeReason = "add" | "close" | "maximize" | "move" | "resize" | "restore" | "select" | "set-model" | "update";
|
|
1793
|
+
export declare type WorkspaceChangeReason = "add" | "close" | "collapse" | "expand" | "maximize" | "move" | "resize" | "restore" | "select" | "set-model" | "update";
|
|
1669
1794
|
|
|
1670
1795
|
/**
|
|
1671
1796
|
* CSS class names for the elements a Workspace renders (see the Workspace's `classNames` prop).
|
|
@@ -1674,6 +1799,12 @@ export declare type WorkspaceClassNames = {
|
|
|
1674
1799
|
dragPreview?: string | undefined;
|
|
1675
1800
|
dropIndicator?: string | undefined;
|
|
1676
1801
|
header?: string | undefined;
|
|
1802
|
+
/**
|
|
1803
|
+
* Each split (a Group with `data-split` and `data-split-id` attributes); for example, its `gap` adds space between tabsets.
|
|
1804
|
+
*
|
|
1805
|
+
* ℹ️ Gaps count toward the split's minimum size, like its separators.
|
|
1806
|
+
*/
|
|
1807
|
+
split?: string | undefined;
|
|
1677
1808
|
tab?: string | undefined;
|
|
1678
1809
|
tabContent?: string | undefined;
|
|
1679
1810
|
tabList?: string | undefined;
|
|
@@ -1682,7 +1813,7 @@ export declare type WorkspaceClassNames = {
|
|
|
1682
1813
|
toolbar?: string | undefined;
|
|
1683
1814
|
};
|
|
1684
1815
|
|
|
1685
|
-
declare function WorkspaceComponent<TabData = unknown, TabsetData = unknown>({ className, classNames, defaultModel, disabled, disableDrop, elementRef: elementRefProp, hiddenTabBehavior, id: idProp, onModelChanged, renderDragPreview, renderEmptyTabset, renderSeparator, renderTab, renderTabContent, renderTabsetToolbar, resizePreviewMode, serverRenderTabContent, style, styles, tabPlacement, tabsetMinHeight, tabsetMinWidth, workspaceRef, ...rest }: WorkspaceProps<TabData, TabsetData>): JSX.Element;
|
|
1816
|
+
declare function WorkspaceComponent<TabData = unknown, TabsetData = unknown>({ className, classNames, defaultModel, disabled, disableDrop, elementRef: elementRefProp, hiddenTabBehavior, id: idProp, onModelChanged, renderDragPreview, renderEmptyTabset, renderSeparator, renderTab, renderTabContent, renderTabsetDragPreview, renderTabsetToolbar, resizePreviewMode, serverRenderTabContent, style, styles, tabPlacement, tabRemovalSelectionBehavior, tabsetMinHeight, tabsetMinWidth, workspaceRef, ...rest }: WorkspaceProps<TabData, TabsetData>): JSX.Element;
|
|
1686
1817
|
|
|
1687
1818
|
/**
|
|
1688
1819
|
* Imperative Workspace API.
|
|
@@ -1719,6 +1850,17 @@ export declare interface WorkspaceImperativeHandle<TabData = unknown, TabsetData
|
|
|
1719
1850
|
* If the root tabset is closed, the workspace is left with an empty root tabset.
|
|
1720
1851
|
*/
|
|
1721
1852
|
closeTabset: (tabsetId: string) => void;
|
|
1853
|
+
/**
|
|
1854
|
+
* Collapse a tabset to just its header.
|
|
1855
|
+
*
|
|
1856
|
+
* ℹ️ This has no effect unless the tabset has the `collapsible` flag;
|
|
1857
|
+
* the only tabset in a workspace, and tabsets whose siblings are all collapsed, can't be collapsed.
|
|
1858
|
+
*/
|
|
1859
|
+
collapseTabset: (tabsetId: string) => void;
|
|
1860
|
+
/**
|
|
1861
|
+
* Expand a collapsed tabset to its previous size.
|
|
1862
|
+
*/
|
|
1863
|
+
expandTabset: (tabsetId: string) => void;
|
|
1722
1864
|
/**
|
|
1723
1865
|
* Id of the tabset the user most recently interacted with (by pointer or focus).
|
|
1724
1866
|
*/
|
|
@@ -1738,6 +1880,13 @@ export declare interface WorkspaceImperativeHandle<TabData = unknown, TabsetData
|
|
|
1738
1880
|
* Move a tab to a position within a tabset's tab list, or to a region of a tabset's content area.
|
|
1739
1881
|
*/
|
|
1740
1882
|
moveTab: (tabId: string, target: TabDropTarget) => void;
|
|
1883
|
+
/**
|
|
1884
|
+
* Move a tabset beside another tabset (by dropping it onto a region at the edge of that tabset's content area),
|
|
1885
|
+
* or move its tabs into another tabset (at an `index` within its tab list, or onto the `"center"` of its content area).
|
|
1886
|
+
*
|
|
1887
|
+
* ℹ️ When its tabs are moved, the emptied tabset is removed (unless it has the `keepWhenEmpty` flag).
|
|
1888
|
+
*/
|
|
1889
|
+
moveTabset: (tabsetId: string, target: TabDropTarget) => void;
|
|
1741
1890
|
/**
|
|
1742
1891
|
* Restore the maximized tabset (if there is one).
|
|
1743
1892
|
*/
|
|
@@ -1772,7 +1921,9 @@ export declare interface WorkspaceImperativeHandle<TabData = unknown, TabsetData
|
|
|
1772
1921
|
* so the corresponding Workspace prop is used.
|
|
1773
1922
|
*/
|
|
1774
1923
|
updateTabset: (tabsetId: string, changes: {
|
|
1924
|
+
collapsible?: boolean | undefined;
|
|
1775
1925
|
data?: TabsetData;
|
|
1926
|
+
disableDrag?: boolean | undefined;
|
|
1776
1927
|
keepWhenEmpty?: boolean | undefined;
|
|
1777
1928
|
minHeight?: string | undefined;
|
|
1778
1929
|
minWidth?: string | undefined;
|
|
@@ -1829,9 +1980,10 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1829
1980
|
* - `tabPanels`: contains a tabset's tab content (`data-tab-panels`)
|
|
1830
1981
|
* - `tabContent`: the element each tab's content is rendered into (`data-tab-content`)
|
|
1831
1982
|
* - `dropIndicator`: shows where a dragged tab will be dropped within a tabset's panels (`data-drop-indicator`)
|
|
1832
|
-
* - `dragPreview`: follows the pointer while a tab is dragged (`data-drag-preview`)
|
|
1983
|
+
* - `dragPreview`: follows the pointer while a tab or tabset is dragged (`data-drag-preview`)
|
|
1833
1984
|
*
|
|
1834
|
-
* ℹ️ Elements expose their state as data attributes (e.g. `data-tab-selected`), which can be used for styling.
|
|
1985
|
+
* ℹ️ Elements expose their state as data attributes (e.g. `data-tab-selected`, or `data-tabset-dragging` while a tabset is dragged), which can be used for styling.
|
|
1986
|
+
* Elements within a collapsed tabset have a `data-tabset-collapsed` attribute.
|
|
1835
1987
|
* Elements within a tabset also have a `data-tab-placement` attribute (see `tabPlacement`).
|
|
1836
1988
|
*
|
|
1837
1989
|
* ℹ️ Like the render props, this object is part of what tabsets re-render for;
|
|
@@ -1854,10 +2006,13 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1854
2006
|
*/
|
|
1855
2007
|
disabled?: boolean | undefined;
|
|
1856
2008
|
/**
|
|
1857
|
-
* Prevents tabs from being dropped onto some (or all) targets.
|
|
2009
|
+
* Prevents tabs (and tabsets) from being dropped onto some (or all) targets.
|
|
1858
2010
|
*
|
|
1859
2011
|
* Functions are called when the target under the pointer changes;
|
|
1860
2012
|
* returning `true` rejects the target.
|
|
2013
|
+
*
|
|
2014
|
+
* ℹ️ While a tabset is dragged, this function is called for each of its tabs (see `DisableDropArgs`),
|
|
2015
|
+
* so restrictions on where tabs can be dropped apply to dragged tabsets too.
|
|
1861
2016
|
*/
|
|
1862
2017
|
disableDrop?: boolean | ((args: DisableDropArgs<TabData, TabsetData>) => boolean) | undefined;
|
|
1863
2018
|
/**
|
|
@@ -1900,6 +2055,13 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1900
2055
|
* Defaults to the tab's title (or id).
|
|
1901
2056
|
*/
|
|
1902
2057
|
renderDragPreview?: ((tab: TabNode<TabData>) => ReactNode) | undefined;
|
|
2058
|
+
/**
|
|
2059
|
+
* Content of the element that follows the pointer while a whole tabset is being dragged.
|
|
2060
|
+
* Defaults to the preview of its selected tab (see `renderDragPreview`), or the tabset's id if it has no tabs.
|
|
2061
|
+
*
|
|
2062
|
+
* ℹ️ The element has a `data-drag-type` attribute: `"tabset"` while a tabset is dragged, and `"tab"` while a tab is.
|
|
2063
|
+
*/
|
|
2064
|
+
renderTabsetDragPreview?: ((tabset: TabsetNode<TabData, TabsetData>) => ReactNode) | undefined;
|
|
1903
2065
|
/**
|
|
1904
2066
|
* Content shown in the panels of a tabset that has no tabs (e.g. "Drag a tab here"):
|
|
1905
2067
|
* the root tabset of an empty workspace, or a tabset with the `keepWhenEmpty` flag.
|
|
@@ -1908,6 +2070,10 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1908
2070
|
/**
|
|
1909
2071
|
* Separator rendered between the children of a split.
|
|
1910
2072
|
* Should return a `Separator` (or `null` for no separator); defaults to an unstyled `Separator`.
|
|
2073
|
+
*
|
|
2074
|
+
* ℹ️ Without separators, tabsets can still be resized by dragging their edges (like Panels in a Group without separators),
|
|
2075
|
+
* but separators are recommended: they can be resized with the keyboard,
|
|
2076
|
+
* and an edge's hit area can overlap the tabs beside it (pressing there resizes the tabset rather than dragging the tab).
|
|
1911
2077
|
*/
|
|
1912
2078
|
renderSeparator?: ((orientation: Orientation) => ReactNode) | undefined;
|
|
1913
2079
|
/**
|
|
@@ -1994,6 +2160,18 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
|
|
|
1994
2160
|
* @default "top"
|
|
1995
2161
|
*/
|
|
1996
2162
|
tabPlacement?: "bottom" | "left" | "right" | "top" | undefined;
|
|
2163
|
+
/**
|
|
2164
|
+
* Which tab is selected when a tabset's selected tab is removed (closed, or dragged to another tabset):
|
|
2165
|
+
* - `"adjacent"`: the tab after it (or before it, if it was the last tab)
|
|
2166
|
+
* - `"recent"`: the tabset's most recently selected tab (like an IDE's editor groups),
|
|
2167
|
+
* falling back to `"adjacent"` if none of its other tabs has been selected
|
|
2168
|
+
*
|
|
2169
|
+
* ℹ️ In `"recent"` mode, each tabset's recently selected tabs are saved in the model (see `TabsetNode.recentTabIds`),
|
|
2170
|
+
* so they're restored with the rest of the layout.
|
|
2171
|
+
*
|
|
2172
|
+
* @default "adjacent"
|
|
2173
|
+
*/
|
|
2174
|
+
tabRemovalSelectionBehavior?: TabRemovalSelectionBehavior | undefined;
|
|
1997
2175
|
/**
|
|
1998
2176
|
* Minimum height of each tabset's content area (not including its header).
|
|
1999
2177
|
*
|