1 | import { Message } from '@lumino/messaging';
|
2 | import { ISignal } from '@lumino/signaling';
|
3 | import { Panel } from './panel';
|
4 | import { SplitLayout } from './splitlayout';
|
5 | import { Widget } from './widget';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export declare class SplitPanel extends Panel {
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | constructor(options?: SplitPanel.IOptions);
|
19 | /**
|
20 | * Dispose of the resources held by the panel.
|
21 | */
|
22 | dispose(): void;
|
23 | /**
|
24 | * Get the layout orientation for the split panel.
|
25 | */
|
26 | /**
|
27 | * Set the layout orientation for the split panel.
|
28 | */
|
29 | orientation: SplitPanel.Orientation;
|
30 | /**
|
31 | * Get the content alignment for the split panel.
|
32 | *
|
33 | * #### Notes
|
34 | * This is the alignment of the widgets in the layout direction.
|
35 | *
|
36 | * The alignment has no effect if the widgets can expand to fill the
|
37 | * entire split panel.
|
38 | */
|
39 | /**
|
40 | * Set the content alignment for the split panel.
|
41 | *
|
42 | * #### Notes
|
43 | * This is the alignment of the widgets in the layout direction.
|
44 | *
|
45 | * The alignment has no effect if the widgets can expand to fill the
|
46 | * entire split panel.
|
47 | */
|
48 | alignment: SplitPanel.Alignment;
|
49 | /**
|
50 | * Get the inter-element spacing for the split panel.
|
51 | */
|
52 | /**
|
53 | * Set the inter-element spacing for the split panel.
|
54 | */
|
55 | spacing: number;
|
56 | /**
|
57 | * The renderer used by the split panel.
|
58 | */
|
59 | readonly renderer: SplitPanel.IRenderer;
|
60 | /**
|
61 | * A signal emitted when a split handle has moved.
|
62 | */
|
63 | readonly handleMoved: ISignal<this, void>;
|
64 | /**
|
65 | * A read-only array of the split handles in the panel.
|
66 | */
|
67 | readonly handles: ReadonlyArray<HTMLDivElement>;
|
68 | /**
|
69 | * Get the relative sizes of the widgets in the panel.
|
70 | *
|
71 | * @returns A new array of the relative sizes of the widgets.
|
72 | *
|
73 | * #### Notes
|
74 | * The returned sizes reflect the sizes of the widgets normalized
|
75 | * relative to their siblings.
|
76 | *
|
77 | * This method **does not** measure the DOM nodes.
|
78 | */
|
79 | relativeSizes(): number[];
|
80 | /**
|
81 | * Set the relative sizes for the widgets in the panel.
|
82 | *
|
83 | * @param sizes - The relative sizes for the widgets in the panel.
|
84 | * @param update - Update the layout after setting relative sizes.
|
85 | * Default is True.
|
86 | *
|
87 | * #### Notes
|
88 | * Extra values are ignored, too few will yield an undefined layout.
|
89 | *
|
90 | * The actual geometry of the DOM nodes is updated asynchronously.
|
91 | */
|
92 | setRelativeSizes(sizes: number[], update?: boolean): void;
|
93 | /**
|
94 | * Handle the DOM events for the split panel.
|
95 | *
|
96 | * @param event - The DOM event sent to the panel.
|
97 | *
|
98 | * #### Notes
|
99 | * This method implements the DOM `EventListener` interface and is
|
100 | * called in response to events on the panel's DOM node. It should
|
101 | * not be called directly by user code.
|
102 | */
|
103 | handleEvent(event: Event): void;
|
104 | /**
|
105 | * A message handler invoked on a `'before-attach'` message.
|
106 | */
|
107 | protected onBeforeAttach(msg: Message): void;
|
108 | /**
|
109 | * A message handler invoked on an `'after-detach'` message.
|
110 | */
|
111 | protected onAfterDetach(msg: Message): void;
|
112 | /**
|
113 | * A message handler invoked on a `'child-added'` message.
|
114 | */
|
115 | protected onChildAdded(msg: Widget.ChildMessage): void;
|
116 | /**
|
117 | * A message handler invoked on a `'child-removed'` message.
|
118 | */
|
119 | protected onChildRemoved(msg: Widget.ChildMessage): void;
|
120 | /**
|
121 | * Handle the `'keydown'` event for the split panel.
|
122 | */
|
123 | private _evtKeyDown;
|
124 | /**
|
125 | * Handle the `'mousedown'` event for the split panel.
|
126 | */
|
127 | private _evtMouseDown;
|
128 | /**
|
129 | * Handle the `'mousemove'` event for the split panel.
|
130 | */
|
131 | private _evtMouseMove;
|
132 | /**
|
133 | * Handle the `'mouseup'` event for the split panel.
|
134 | */
|
135 | private _evtMouseUp;
|
136 | /**
|
137 | * Release the mouse grab for the split panel.
|
138 | */
|
139 | private _releaseMouse;
|
140 | private _handleMoved;
|
141 | private _pressData;
|
142 | }
|
143 | /**
|
144 | * The namespace for the `SplitPanel` class statics.
|
145 | */
|
146 | export declare namespace SplitPanel {
|
147 | |
148 |
|
149 |
|
150 | type Orientation = SplitLayout.Orientation;
|
151 | |
152 |
|
153 |
|
154 | type Alignment = SplitLayout.Alignment;
|
155 | |
156 |
|
157 |
|
158 | type IRenderer = SplitLayout.IRenderer;
|
159 | |
160 |
|
161 |
|
162 | interface IOptions {
|
163 | |
164 |
|
165 |
|
166 |
|
167 |
|
168 | renderer?: IRenderer;
|
169 | |
170 |
|
171 |
|
172 |
|
173 |
|
174 | orientation?: Orientation;
|
175 | |
176 |
|
177 |
|
178 |
|
179 |
|
180 | alignment?: Alignment;
|
181 | |
182 |
|
183 |
|
184 |
|
185 |
|
186 | spacing?: number;
|
187 | |
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 | layout?: SplitLayout;
|
195 | }
|
196 | |
197 |
|
198 |
|
199 | class Renderer implements IRenderer {
|
200 | |
201 |
|
202 |
|
203 |
|
204 |
|
205 | createHandle(): HTMLDivElement;
|
206 | }
|
207 | |
208 |
|
209 |
|
210 | const defaultRenderer: Renderer;
|
211 | |
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 | function getStretch(widget: Widget): number;
|
219 | |
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 | function setStretch(widget: Widget, value: number): void;
|
227 | }
|
228 |
|
\ | No newline at end of file |