1 | import { Message } from '@lumino/messaging';
|
2 | import { AccordionLayout } from './accordionlayout';
|
3 | import { SplitLayout } from './splitlayout';
|
4 | import { SplitPanel } from './splitpanel';
|
5 | import { Title } from './title';
|
6 | import { Widget } from './widget';
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class AccordionPanel extends SplitPanel {
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | constructor(options?: AccordionPanel.IOptions);
|
20 | /**
|
21 | * The renderer used by the accordion panel.
|
22 | */
|
23 | readonly renderer: AccordionPanel.IRenderer;
|
24 | /**
|
25 | * The section title space.
|
26 | *
|
27 | * This is the height if the panel is vertical and the width if it is
|
28 | * horizontal.
|
29 | */
|
30 | titleSpace: number;
|
31 | /**
|
32 | * A read-only array of the section titles in the panel.
|
33 | */
|
34 | readonly titles: ReadonlyArray<HTMLElement>;
|
35 | /**
|
36 | * Add a widget to the end of the panel.
|
37 | *
|
38 | * @param widget - The widget to add to the panel.
|
39 | *
|
40 | * #### Notes
|
41 | * If the widget is already contained in the panel, it will be moved.
|
42 | */
|
43 | addWidget(widget: Widget): void;
|
44 | /**
|
45 | * Insert a widget at the specified index.
|
46 | *
|
47 | * @param index - The index at which to insert the widget.
|
48 | *
|
49 | * @param widget - The widget to insert into to the panel.
|
50 | *
|
51 | * #### Notes
|
52 | * If the widget is already contained in the panel, it will be moved.
|
53 | */
|
54 | insertWidget(index: number, widget: Widget): void;
|
55 | /**
|
56 | * Handle the DOM events for the accordion panel.
|
57 | *
|
58 | * @param event - The DOM event sent to the panel.
|
59 | *
|
60 | * #### Notes
|
61 | * This method implements the DOM `EventListener` interface and is
|
62 | * called in response to events on the panel's DOM node. It should
|
63 | * not be called directly by user code.
|
64 | */
|
65 | handleEvent(event: Event): void;
|
66 | /**
|
67 | * A message handler invoked on a `'before-attach'` message.
|
68 | */
|
69 | protected onBeforeAttach(msg: Message): void;
|
70 | /**
|
71 | * A message handler invoked on an `'after-detach'` message.
|
72 | */
|
73 | protected onAfterDetach(msg: Message): void;
|
74 | /**
|
75 | * Handle the `changed` signal of a title object.
|
76 | */
|
77 | private _onTitleChanged;
|
78 | /**
|
79 | * Compute the size of widgets in this panel on the title click event.
|
80 | * On closing, the size of the widget is cached and we will try to expand
|
81 | * the last opened widget.
|
82 | * On opening, we will use the cached size if it is available to restore the
|
83 | * widget.
|
84 | * In both cases, if we can not compute the size of widgets, we will let
|
85 | * `SplitLayout` decide.
|
86 | *
|
87 | * @param index - The index of widget to be opened of closed
|
88 | *
|
89 | * @returns Relative size of widgets in this panel, if this size can
|
90 | * not be computed, return `undefined`
|
91 | */
|
92 | private _computeWidgetSize;
|
93 | /**
|
94 | * Handle the `'click'` event for the accordion panel
|
95 | */
|
96 | private _evtClick;
|
97 | /**
|
98 | * Handle the `'keydown'` event for the accordion panel.
|
99 | */
|
100 | private _eventKeyDown;
|
101 | private _widgetSizesCache;
|
102 | }
|
103 | /**
|
104 | * The namespace for the `AccordionPanel` class statics.
|
105 | */
|
106 | export declare namespace AccordionPanel {
|
107 | |
108 |
|
109 |
|
110 | type Orientation = SplitLayout.Orientation;
|
111 | |
112 |
|
113 |
|
114 | type Alignment = SplitLayout.Alignment;
|
115 | |
116 |
|
117 |
|
118 | type IRenderer = AccordionLayout.IRenderer;
|
119 | |
120 |
|
121 |
|
122 | interface IOptions extends Partial<AccordionLayout.IOptions> {
|
123 | |
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | layout?: AccordionLayout;
|
131 | }
|
132 | |
133 |
|
134 |
|
135 | class Renderer extends SplitPanel.Renderer implements IRenderer {
|
136 | |
137 |
|
138 |
|
139 | readonly titleClassName = "lm-AccordionPanel-title";
|
140 | |
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | createCollapseIcon(data: Title<Widget>): HTMLElement;
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | createSectionTitle(data: Title<Widget>): HTMLElement;
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 | createTitleKey(data: Title<Widget>): string;
|
168 | private _titleID;
|
169 | private _titleKeys;
|
170 | }
|
171 | |
172 |
|
173 |
|
174 | const defaultRenderer: Renderer;
|
175 | }
|
176 |
|
\ | No newline at end of file |