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