UNPKG

3.79 kBTypeScriptView Raw
1import { BoxLayout } from './boxlayout';
2import { Panel } from './panel';
3import { Widget } from './widget';
4/**
5 * A panel which arranges its widgets in a single row or column.
6 *
7 * #### Notes
8 * This class provides a convenience wrapper around a [[BoxLayout]].
9 */
10export declare class BoxPanel extends Panel {
11 /**
12 * Construct a new box panel.
13 *
14 * @param options - The options for initializing the box panel.
15 */
16 constructor(options?: BoxPanel.IOptions);
17 /**
18 * Get the layout direction for the box panel.
19 */
20 /**
21 * Set the layout direction for the box panel.
22 */
23 direction: BoxPanel.Direction;
24 /**
25 * Get the content alignment for the box panel.
26 *
27 * #### Notes
28 * This is the alignment of the widgets in the layout direction.
29 *
30 * The alignment has no effect if the widgets can expand to fill the
31 * entire box layout.
32 */
33 /**
34 * Set the content alignment for the box panel.
35 *
36 * #### Notes
37 * This is the alignment of the widgets in the layout direction.
38 *
39 * The alignment has no effect if the widgets can expand to fill the
40 * entire box layout.
41 */
42 alignment: BoxPanel.Alignment;
43 /**
44 * Get the inter-element spacing for the box panel.
45 */
46 /**
47 * Set the inter-element spacing for the box panel.
48 */
49 spacing: number;
50 /**
51 * A message handler invoked on a `'child-added'` message.
52 */
53 protected onChildAdded(msg: Widget.ChildMessage): void;
54 /**
55 * A message handler invoked on a `'child-removed'` message.
56 */
57 protected onChildRemoved(msg: Widget.ChildMessage): void;
58}
59/**
60 * The namespace for the `BoxPanel` class statics.
61 */
62export declare namespace BoxPanel {
63 /**
64 * A type alias for a box panel direction.
65 */
66 type Direction = BoxLayout.Direction;
67 /**
68 * A type alias for a box panel alignment.
69 */
70 type Alignment = BoxLayout.Alignment;
71 /**
72 * An options object for initializing a box panel.
73 */
74 interface IOptions {
75 /**
76 * The layout direction of the panel.
77 *
78 * The default is `'top-to-bottom'`.
79 */
80 direction?: Direction;
81 /**
82 * The content alignment of the panel.
83 *
84 * The default is `'start'`.
85 */
86 alignment?: Alignment;
87 /**
88 * The spacing between items in the panel.
89 *
90 * The default is `4`.
91 */
92 spacing?: number;
93 /**
94 * The box layout to use for the box panel.
95 *
96 * If this is provided, the other options are ignored.
97 *
98 * The default is a new `BoxLayout`.
99 */
100 layout?: BoxLayout;
101 }
102 /**
103 * Get the box panel stretch factor for the given widget.
104 *
105 * @param widget - The widget of interest.
106 *
107 * @returns The box panel stretch factor for the widget.
108 */
109 function getStretch(widget: Widget): number;
110 /**
111 * Set the box panel stretch factor for the given widget.
112 *
113 * @param widget - The widget of interest.
114 *
115 * @param value - The value for the stretch factor.
116 */
117 function setStretch(widget: Widget, value: number): void;
118 /**
119 * Get the box panel size basis for the given widget.
120 *
121 * @param widget - The widget of interest.
122 *
123 * @returns The box panel size basis for the widget.
124 */
125 function getSizeBasis(widget: Widget): number;
126 /**
127 * Set the box panel size basis for the given widget.
128 *
129 * @param widget - The widget of interest.
130 *
131 * @param value - The value for the size basis.
132 */
133 function setSizeBasis(widget: Widget, value: number): void;
134}
135//# sourceMappingURL=boxpanel.d.ts.map
\No newline at end of file