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 | *
|
85 | * #### Notes
|
86 | * Extra values are ignored, too few will yield an undefined layout.
|
87 | *
|
88 | * The actual geometry of the DOM nodes is updated asynchronously.
|
89 | */
|
90 | setRelativeSizes(sizes: number[]): void;
|
91 | /**
|
92 | * Handle the DOM events for the split panel.
|
93 | *
|
94 | * @param event - The DOM event sent to the panel.
|
95 | *
|
96 | * #### Notes
|
97 | * This method implements the DOM `EventListener` interface and is
|
98 | * called in response to events on the panel's DOM node. It should
|
99 | * not be called directly by user code.
|
100 | */
|
101 | handleEvent(event: Event): void;
|
102 | /**
|
103 | * A message handler invoked on a `'before-attach'` message.
|
104 | */
|
105 | protected onBeforeAttach(msg: Message): void;
|
106 | /**
|
107 | * A message handler invoked on an `'after-detach'` message.
|
108 | */
|
109 | protected onAfterDetach(msg: Message): void;
|
110 | /**
|
111 | * A message handler invoked on a `'child-added'` message.
|
112 | */
|
113 | protected onChildAdded(msg: Widget.ChildMessage): void;
|
114 | /**
|
115 | * A message handler invoked on a `'child-removed'` message.
|
116 | */
|
117 | protected onChildRemoved(msg: Widget.ChildMessage): void;
|
118 | /**
|
119 | * Handle the `'keydown'` event for the split panel.
|
120 | */
|
121 | private _evtKeyDown;
|
122 | /**
|
123 | * Handle the `'mousedown'` event for the split panel.
|
124 | */
|
125 | private _evtMouseDown;
|
126 | /**
|
127 | * Handle the `'mousemove'` event for the split panel.
|
128 | */
|
129 | private _evtMouseMove;
|
130 | /**
|
131 | * Handle the `'mouseup'` event for the split panel.
|
132 | */
|
133 | private _evtMouseUp;
|
134 | /**
|
135 | * Release the mouse grab for the split panel.
|
136 | */
|
137 | private _releaseMouse;
|
138 | private _handleMoved;
|
139 | private _pressData;
|
140 | }
|
141 | /**
|
142 | * The namespace for the `SplitPanel` class statics.
|
143 | */
|
144 | export declare namespace SplitPanel {
|
145 | |
146 |
|
147 |
|
148 | type Orientation = SplitLayout.Orientation;
|
149 | |
150 |
|
151 |
|
152 | type Alignment = SplitLayout.Alignment;
|
153 | |
154 |
|
155 |
|
156 | type IRenderer = SplitLayout.IRenderer;
|
157 | |
158 |
|
159 |
|
160 | interface IOptions {
|
161 | |
162 |
|
163 |
|
164 |
|
165 |
|
166 | renderer?: IRenderer;
|
167 | |
168 |
|
169 |
|
170 |
|
171 |
|
172 | orientation?: Orientation;
|
173 | |
174 |
|
175 |
|
176 |
|
177 |
|
178 | alignment?: Alignment;
|
179 | |
180 |
|
181 |
|
182 |
|
183 |
|
184 | spacing?: number;
|
185 | |
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 | layout?: SplitLayout;
|
193 | }
|
194 | |
195 |
|
196 |
|
197 | class Renderer implements IRenderer {
|
198 | |
199 |
|
200 |
|
201 |
|
202 |
|
203 | createHandle(): HTMLDivElement;
|
204 | }
|
205 | |
206 |
|
207 |
|
208 | const defaultRenderer: Renderer;
|
209 | |
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | function getStretch(widget: Widget): number;
|
217 | |
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | function setStretch(widget: Widget, value: number): void;
|
225 | }
|
226 |
|
\ | No newline at end of file |