1 | import { SplitLayout } from './splitlayout';
|
2 | import { Title } from './title';
|
3 | import { Widget } from './widget';
|
4 |
|
5 |
|
6 |
|
7 | export declare class AccordionLayout extends SplitLayout {
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | constructor(options: AccordionLayout.IOptions);
|
19 | /**
|
20 | * The section title height or width depending on the orientation.
|
21 | */
|
22 | get titleSpace(): number;
|
23 | set titleSpace(value: number);
|
24 | /**
|
25 | * A read-only array of the section titles in the panel.
|
26 | */
|
27 | get titles(): ReadonlyArray<HTMLElement>;
|
28 | /**
|
29 | * Dispose of the resources held by the layout.
|
30 | */
|
31 | dispose(): void;
|
32 | /**
|
33 | * The renderer used by the accordion layout.
|
34 | */
|
35 | readonly renderer: AccordionLayout.IRenderer;
|
36 | updateTitle(index: number, widget: Widget): void;
|
37 | /**
|
38 | * Insert a widget into the layout at the specified index.
|
39 | *
|
40 | * @param index - The index at which to insert the widget.
|
41 | *
|
42 | * @param widget - The widget to insert into the layout.
|
43 | *
|
44 | * #### Notes
|
45 | * The index will be clamped to the bounds of the widgets.
|
46 | *
|
47 | * If the widget is already added to the layout, it will be moved.
|
48 | *
|
49 | * #### Undefined Behavior
|
50 | * An `index` which is non-integral.
|
51 | */
|
52 | insertWidget(index: number, widget: Widget): void;
|
53 | /**
|
54 | * Attach a widget to the parent's DOM node.
|
55 | *
|
56 | * @param index - The current index of the widget in the layout.
|
57 | *
|
58 | * @param widget - The widget to attach to the parent.
|
59 | */
|
60 | protected attachWidget(index: number, widget: Widget): void;
|
61 | /**
|
62 | * Move a widget in the parent's DOM node.
|
63 | *
|
64 | * @param fromIndex - The previous index of the widget in the layout.
|
65 | *
|
66 | * @param toIndex - The current index of the widget in the layout.
|
67 | *
|
68 | * @param widget - The widget to move in the parent.
|
69 | */
|
70 | protected moveWidget(fromIndex: number, toIndex: number, widget: Widget): void;
|
71 | /**
|
72 | * Detach a widget from the parent's DOM node.
|
73 | *
|
74 | * @param index - The previous index of the widget in the layout.
|
75 | *
|
76 | * @param widget - The widget to detach from the parent.
|
77 | *
|
78 | * #### Notes
|
79 | * This is a reimplementation of the superclass method.
|
80 | */
|
81 | protected detachWidget(index: number, widget: Widget): void;
|
82 | /**
|
83 | * Update the item position.
|
84 | *
|
85 | * @param i Item index
|
86 | * @param isHorizontal Whether the layout is horizontal or not
|
87 | * @param left Left position in pixels
|
88 | * @param top Top position in pixels
|
89 | * @param height Item height
|
90 | * @param width Item width
|
91 | * @param size Item size
|
92 | */
|
93 | protected updateItemPosition(i: number, isHorizontal: boolean, left: number, top: number, height: number, width: number, size: number): void;
|
94 | private _titles;
|
95 | }
|
96 | export declare namespace AccordionLayout {
|
97 | |
98 |
|
99 |
|
100 | type Orientation = SplitLayout.Orientation;
|
101 | |
102 |
|
103 |
|
104 | type Alignment = SplitLayout.Alignment;
|
105 | |
106 |
|
107 |
|
108 | interface IOptions extends SplitLayout.IOptions {
|
109 | |
110 |
|
111 |
|
112 | renderer: IRenderer;
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 | titleSpace?: number;
|
119 | }
|
120 | |
121 |
|
122 |
|
123 | interface IRenderer extends SplitLayout.IRenderer {
|
124 | |
125 |
|
126 |
|
127 | readonly titleClassName: string;
|
128 | |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 | createSectionTitle(title: Title<Widget>): HTMLElement;
|
136 | }
|
137 | }
|