Debian Codegraph @

jupyter-widgets-controls/lib/lumino/tabpanel.d.ts

raw
1 import { ISignal } from '@lumino/signaling';
2 import { Panel, TabBar, Widget } from '@lumino/widgets';
3 /**
4 * A panel where visible widgets are stacked atop one another.
5 *
6 * #### Notes
7 * This class provides a convenience wrapper around a [[PanelLayout]].
8 */
9 export declare class EventedPanel extends Panel {
10 /**
11 * A signal emitted when a widget is removed from the panel.
12 */
13 get widgetRemoved(): ISignal<EventedPanel, Widget>;
14 /**
15 * A message handler invoked on a `'child-removed'` message.
16 */
17 protected onChildRemoved(msg: Widget.ChildMessage): void;
18 private _widgetRemoved;
19 }
20 /**
21 * A widget which combines a `TabBar` and a `EventedPanel`.
22 *
23 * #### Notes
24 * This is a simple panel which handles the common case of a tab bar
25 * placed next to a content area. The selected tab controls the widget
26 * which is shown in the content area.
27 *
28 * For use cases which require more control than is provided by this
29 * panel, the `TabBar` widget may be used independently.
30 *
31 * TODO: Support setting the direction??
32 */
33 export declare class TabPanel extends Widget {
34 /**
35 * Construct a new tab panel.
36 *
37 * @param options - The options for initializing the tab panel.
38 */
39 constructor(options?: TabPanel.IOptions);
40 /**
41 * A signal emitted when the current tab is changed.
42 *
43 * #### Notes
44 * This signal is emitted when the currently selected tab is changed
45 * either through user or programmatic interaction.
46 *
47 * Notably, this signal is not emitted when the index of the current
48 * tab changes due to tabs being inserted, removed, or moved. It is
49 * only emitted when the actual current tab node is changed.
50 */
51 get currentChanged(): ISignal<this, TabPanel.ICurrentChangedArgs>;
52 /**
53 * Get the index of the currently selected tab.
54 *
55 * #### Notes
56 * This will be `null` if no tab is selected.
57 */
58 get currentIndex(): number | null;
59 /**
60 * Set the index of the currently selected tab.
61 *
62 * #### Notes
63 * If the index is out of range, it will be set to `null`.
64 */
65 set currentIndex(value: number | null);
66 /**
67 * Get the currently selected widget.
68 *
69 * #### Notes
70 * This will be `null` if there is no selected tab.
71 */
72 get currentWidget(): Widget | null;
73 /**
74 * Set the currently selected widget.
75 *
76 * #### Notes
77 * If the widget is not in the panel, it will be set to `null`.
78 */
79 set currentWidget(value: Widget | null);
80 /**
81 * Get the whether the tabs are movable by the user.
82 *
83 * #### Notes
84 * Tabs can always be moved programmatically.
85 */
86 get tabsMovable(): boolean;
87 /**
88 * Set the whether the tabs are movable by the user.
89 *
90 * #### Notes
91 * Tabs can always be moved programmatically.
92 */
93 set tabsMovable(value: boolean);
94 /**
95 * The tab bar used by the tab panel.
96 *
97 * #### Notes
98 * Modifying the tab bar directly can lead to undefined behavior.
99 */
100 readonly tabBar: TabBar<Widget>;
101 /**
102 * The panel used by the tab panel.
103 *
104 * #### Notes
105 * Modifying the panel directly can lead to undefined behavior.
106 */
107 readonly tabContents: EventedPanel;
108 /**
109 * A read-only array of the widgets in the panel.
110 */
111 get widgets(): ReadonlyArray<Widget>;
112 /**
113 * Add a widget to the end of the tab panel.
114 *
115 * @param widget - The widget to add to the tab panel.
116 *
117 * #### Notes
118 * If the widget is already contained in the panel, it will be moved.
119 *
120 * The widget's `title` is used to populate the tab.
121 */
122 addWidget(widget: Widget): void;
123 /**
124 * Insert a widget into the tab panel at a specified index.
125 *
126 * @param index - The index at which to insert the widget.
127 *
128 * @param widget - The widget to insert into to the tab panel.
129 *
130 * #### Notes
131 * If the widget is already contained in the panel, it will be moved.
132 *
133 * The widget's `title` is used to populate the tab.
134 */
135 insertWidget(index: number, widget: Widget): void;
136 /**
137 * Handle the `currentChanged` signal from the tab bar.
138 */
139 private _onCurrentChanged;
140 /**
141 * Handle the `tabActivateRequested` signal from the tab bar.
142 */
143 private _onTabActivateRequested;
144 /**
145 * Handle the `tabCloseRequested` signal from the tab bar.
146 */
147 private _onTabCloseRequested;
148 /**
149 * Handle the `tabMoved` signal from the tab bar.
150 */
151 private _onTabMoved;
152 /**
153 * Handle the `widgetRemoved` signal from the stacked panel.
154 */
155 private _onWidgetRemoved;
156 private _currentChanged;
157 }
158 /**
159 * The namespace for the `TabPanel` class statics.
160 */
161 export declare namespace TabPanel {
162 /**
163 * An options object for initializing a tab panel.
164 */
165 interface IOptions {
166 /**
167 * Whether the tabs are movable by the user.
168 *
169 * The default is `false`.
170 */
171 tabsMovable?: boolean;
172 /**
173 * The renderer for the panel's tab bar.
174 *
175 * The default is a shared renderer instance.
176 */
177 renderer?: TabBar.IRenderer<Widget>;
178 }
179 /**
180 * The arguments object for the `currentChanged` signal.
181 */
182 interface ICurrentChangedArgs {
183 /**
184 * The previously selected index.
185 */
186 previousIndex: number;
187 /**
188 * The previously selected widget.
189 */
190 previousWidget: Widget | null;
191 /**
192 * The currently selected index.
193 */
194 currentIndex: number;
195 /**
196 * The currently selected widget.
197 */
198 currentWidget: Widget | null;
199 }
200 }
201 //# sourceMappingURL=tabpanel.d.ts.map