UNPKG

3.83 kBTypeScriptView Raw
1import { Message } from '@lumino/messaging';
2import { Layout } from './layout';
3import { PanelLayout } from './panellayout';
4import { Widget } from './widget';
5/**
6 * A layout where visible widgets are stacked atop one another.
7 *
8 * #### Notes
9 * The Z-order of the visible widgets follows their layout order.
10 */
11export declare class StackedLayout extends PanelLayout {
12 constructor(options?: StackedLayout.IOptions);
13 /**
14 * The method for hiding widgets.
15 *
16 * #### Notes
17 * If there is only one child widget, `Display` hiding mode will be used
18 * regardless of this setting.
19 */
20 /**
21 * Set the method for hiding widgets.
22 *
23 * #### Notes
24 * If there is only one child widget, `Display` hiding mode will be used
25 * regardless of this setting.
26 */
27 hiddenMode: Widget.HiddenMode;
28 /**
29 * Dispose of the resources held by the layout.
30 */
31 dispose(): void;
32 /**
33 * Attach a widget to the parent's DOM node.
34 *
35 * @param index - The current index of the widget in the layout.
36 *
37 * @param widget - The widget to attach to the parent.
38 *
39 * #### Notes
40 * This is a reimplementation of the superclass method.
41 */
42 protected attachWidget(index: number, widget: Widget): void;
43 /**
44 * Move a widget in the parent's DOM node.
45 *
46 * @param fromIndex - The previous index of the widget in the layout.
47 *
48 * @param toIndex - The current index of the widget in the layout.
49 *
50 * @param widget - The widget to move in the parent.
51 *
52 * #### Notes
53 * This is a reimplementation of the superclass method.
54 */
55 protected moveWidget(fromIndex: number, toIndex: number, widget: Widget): void;
56 /**
57 * Detach a widget from the parent's DOM node.
58 *
59 * @param index - The previous index of the widget in the layout.
60 *
61 * @param widget - The widget to detach from the parent.
62 *
63 * #### Notes
64 * This is a reimplementation of the superclass method.
65 */
66 protected detachWidget(index: number, widget: Widget): void;
67 /**
68 * A message handler invoked on a `'before-show'` message.
69 */
70 protected onBeforeShow(msg: Message): void;
71 /**
72 * A message handler invoked on a `'before-attach'` message.
73 */
74 protected onBeforeAttach(msg: Message): void;
75 /**
76 * A message handler invoked on a `'child-shown'` message.
77 */
78 protected onChildShown(msg: Widget.ChildMessage): void;
79 /**
80 * A message handler invoked on a `'child-hidden'` message.
81 */
82 protected onChildHidden(msg: Widget.ChildMessage): void;
83 /**
84 * A message handler invoked on a `'resize'` message.
85 */
86 protected onResize(msg: Widget.ResizeMessage): void;
87 /**
88 * A message handler invoked on an `'update-request'` message.
89 */
90 protected onUpdateRequest(msg: Message): void;
91 /**
92 * A message handler invoked on a `'fit-request'` message.
93 */
94 protected onFitRequest(msg: Message): void;
95 /**
96 * Fit the layout to the total size required by the widgets.
97 */
98 private _fit;
99 /**
100 * Update the layout position and size of the widgets.
101 *
102 * The parent offset dimensions should be `-1` if unknown.
103 */
104 private _update;
105 private _dirty;
106 private _items;
107 private _box;
108 private _hiddenMode;
109}
110/**
111 * The namespace for the `StackedLayout` class statics.
112 */
113export declare namespace StackedLayout {
114 /**
115 * An options object for initializing a stacked layout.
116 */
117 interface IOptions extends Layout.IOptions {
118 /**
119 * The method for hiding widgets.
120 *
121 * The default is `Widget.HiddenMode.Display`.
122 */
123 hiddenMode?: Widget.HiddenMode;
124 }
125}
126//# sourceMappingURL=stackedlayout.d.ts.map
\No newline at end of file