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