##// END OF EJS Templates
corrected _Widget::set() signature
cin -
r14:03f3149f6507 v1.0.4 default
parent child
Show More
@@ -1,2369 +1,2368
1 /// <reference path="../dojo/index.d.ts" />
1 /// <reference path="../dojo/index.d.ts" />
2 /// <reference path="form.d.ts" />
2 /// <reference path="form.d.ts" />
3 /// <reference path="layout.d.ts" />
3 /// <reference path="layout.d.ts" />
4
4
5 declare namespace dijit {
5 declare namespace dijit {
6 /* Global Dijit Interface */
6 /* Global Dijit Interface */
7 interface Dijit { }
7 interface Dijit { }
8
8
9 /* dijit/_AttachMixin */
9 /* dijit/_AttachMixin */
10
10
11 /* tslint:disable:class-name */
11 /* tslint:disable:class-name */
12
12
13 interface _WidgetBase {
13 interface _WidgetBase {
14 dojoAttachEvent: string;
14 dojoAttachEvent: string;
15 dojoAttachPoint: string;
15 dojoAttachPoint: string;
16 }
16 }
17
17
18 interface _AttachMixin {
18 interface _AttachMixin {
19 /**
19 /**
20 * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
20 * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
21 */
21 */
22 _attachPoints: string[];
22 _attachPoints: string[];
23
23
24 /**
24 /**
25 * List of connections associated with data-dojo-attach-event=... in the template
25 * List of connections associated with data-dojo-attach-event=... in the template
26 */
26 */
27 _attachEvents: dojo.Handle[];
27 _attachEvents: dojo.Handle[];
28
28
29 /**
29 /**
30 * Object to which attach points and events will be scoped. Defaults to 'this'.
30 * Object to which attach points and events will be scoped. Defaults to 'this'.
31 */
31 */
32 attachScope: any;
32 attachScope: any;
33
33
34 /**
34 /**
35 * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
35 * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
36 *
36 *
37 * Should generally be left false (the default value) both for performance and to avoid failures when this.containerNode holds other _AttachMixin instances with their own attach points and events.
37 * Should generally be left false (the default value) both for performance and to avoid failures when this.containerNode holds other _AttachMixin instances with their own attach points and events.
38 */
38 */
39 searchContainerNode: boolean;
39 searchContainerNode: boolean;
40
40
41 /**
41 /**
42 * Attach to DOM nodes marked with special attributes.
42 * Attach to DOM nodes marked with special attributes.
43 */
43 */
44 buildRendering(): void;
44 buildRendering(): void;
45
45
46 /**
46 /**
47 * hook for _WidgetsInTemplateMixin
47 * hook for _WidgetsInTemplateMixin
48 */
48 */
49 _beforeFillContent(): void;
49 _beforeFillContent(): void;
50
50
51 /**
51 /**
52 * Iterate through the dom nodes and attach functions and nodes accordingly.
52 * Iterate through the dom nodes and attach functions and nodes accordingly.
53 *
53 *
54 * Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
54 * Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
55 * - dojoAttachPoint/data-dojo-attach-point
55 * - dojoAttachPoint/data-dojo-attach-point
56 * - dojoAttachEvent/data-dojo-attach-event
56 * - dojoAttachEvent/data-dojo-attach-event
57 */
57 */
58 _attachTemplateNodes(rootNode: Element | Node): void;
58 _attachTemplateNodes(rootNode: Element | Node): void;
59
59
60 /**
60 /**
61 * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
61 * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
62 *
62 *
63 * Returns true if caller should process baseNode's children too.
63 * Returns true if caller should process baseNode's children too.
64 */
64 */
65 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
65 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
66 baseNode: T,
66 baseNode: T,
67 getAttrFunc: (baseNode: T, attr: string) => string,
67 getAttrFunc: (baseNode: T, attr: string) => string,
68 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
68 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
69 ): boolean;
69 ): boolean;
70
70
71 /**
71 /**
72 * Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
72 * Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
73 */
73 */
74 _attach(node: Element | Node, type: string, func?: Function): dojo.Handle;
74 _attach(node: Element | Node, type: string, func?: Function): dojo.Handle;
75
75
76 /**
76 /**
77 * Detach and clean up the attachments made in _attachtempalteNodes.
77 * Detach and clean up the attachments made in _attachtempalteNodes.
78 */
78 */
79 _detachTemplateNodes(): void;
79 _detachTemplateNodes(): void;
80
80
81 destroyRendering(preserveDom?: boolean): void;
81 destroyRendering(preserveDom?: boolean): void;
82 }
82 }
83
83
84 interface _AttachMixinConstructor extends dojo._base.DeclareConstructor<_AttachMixin> { }
84 interface _AttachMixinConstructor extends dojo._base.DeclareConstructor<_AttachMixin> { }
85
85
86 /* dijit/_BidiMixin */
86 /* dijit/_BidiMixin */
87
87
88 interface _WidgetBase {
88 interface _WidgetBase {
89
89
90 /**
90 /**
91 * Gets the right direction of text.
91 * Gets the right direction of text.
92 */
92 */
93 getTextDir(text: string): string;
93 getTextDir(text: string): string;
94
94
95 /**
95 /**
96 * Set element.dir according to this.textDir, assuming this.textDir has a value.
96 * Set element.dir according to this.textDir, assuming this.textDir has a value.
97 */
97 */
98 applyTextDir(element: HTMLElement, text?: string): void;
98 applyTextDir(element: HTMLElement, text?: string): void;
99
99
100 /**
100 /**
101 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
101 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
102 */
102 */
103 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
103 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
104
104
105 /**
105 /**
106 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
106 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
107 */
107 */
108 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
108 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
109 }
109 }
110
110
111 /* dijit/_ConfirmDialogMixin */
111 /* dijit/_ConfirmDialogMixin */
112
112
113 interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
113 interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
114 /**
114 /**
115 * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
115 * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
116 */
116 */
117 actionBarTemplate: string;
117 actionBarTemplate: string;
118
118
119 /**
119 /**
120 * Label of OK button.
120 * Label of OK button.
121 */
121 */
122 buttonOk: string;
122 buttonOk: string;
123
123
124 /**
124 /**
125 * Label of cancel button.
125 * Label of cancel button.
126 */
126 */
127 buttonCancel: string;
127 buttonCancel: string;
128 }
128 }
129
129
130 /* dijit/_Contained */
130 /* dijit/_Contained */
131
131
132 interface _Contained {
132 interface _Contained {
133 /**
133 /**
134 * Returns the previous child of the parent or null if this is the
134 * Returns the previous child of the parent or null if this is the
135 * first child of the parent.
135 * first child of the parent.
136 */
136 */
137 getPreviousSibling<T extends _WidgetBase>(): T;
137 getPreviousSibling<T extends _WidgetBase>(): T;
138
138
139 /**
139 /**
140 * Returns the next child of the parent or null if this is the last
140 * Returns the next child of the parent or null if this is the last
141 * child of the parent.
141 * child of the parent.
142 */
142 */
143 getNextSibling<T extends _WidgetBase>(): T;
143 getNextSibling<T extends _WidgetBase>(): T;
144
144
145 /**
145 /**
146 * Returns the index of this widget within its container parent.
146 * Returns the index of this widget within its container parent.
147 * It returns -1 if the parent does not exist or if the parent is
147 * It returns -1 if the parent does not exist or if the parent is
148 * not a dijit/_Container.
148 * not a dijit/_Container.
149 */
149 */
150 getIndexInParent(): number;
150 getIndexInParent(): number;
151 }
151 }
152
152
153 interface _ContainedConstructor extends dojo._base.DeclareConstructor<_Contained> { }
153 interface _ContainedConstructor extends dojo._base.DeclareConstructor<_Contained> { }
154
154
155 /* dijit/_Container */
155 /* dijit/_Container */
156
156
157 interface _Container {
157 interface _Container {
158 buildRendering(): void;
158 buildRendering(): void;
159
159
160 /**
160 /**
161 * Makes the given widget a child of this widget.
161 * Makes the given widget a child of this widget.
162 */
162 */
163 addChild<T extends _WidgetBase>(widget: T, insertIndex?: number): void;
163 addChild<T extends _WidgetBase>(widget: T, insertIndex?: number): void;
164
164
165 /**
165 /**
166 * Removes the passed widget instance from this widget but does
166 * Removes the passed widget instance from this widget but does
167 * not destroy it. You can also pass in an integer indicating
167 * not destroy it. You can also pass in an integer indicating
168 * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
168 * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
169 */
169 */
170 removeChild<T extends _WidgetBase>(widget: T): void;
170 removeChild<T extends _WidgetBase>(widget: T): void;
171 removeChild<T extends number>(widget: number): void;
171 removeChild<T extends number>(widget: number): void;
172
172
173 /**
173 /**
174 * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
174 * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
175 */
175 */
176 hasChildren(): boolean;
176 hasChildren(): boolean;
177
177
178 /**
178 /**
179 * Gets the index of the child in this container or -1 if not found
179 * Gets the index of the child in this container or -1 if not found
180 */
180 */
181 getIndexOfChild<T extends _WidgetBase>(widget: T): number;
181 getIndexOfChild<T extends _WidgetBase>(widget: T): number;
182 }
182 }
183
183
184 interface _ContainerConstructor extends dojo._base.DeclareConstructor<_Container> { }
184 interface _ContainerConstructor extends dojo._base.DeclareConstructor<_Container> { }
185
185
186 /* dijit/_CssStateMixin */
186 /* dijit/_CssStateMixin */
187
187
188 interface CSSStateNodes {
188 interface CSSStateNodes {
189 [node: string]: string;
189 [node: string]: string;
190 }
190 }
191
191
192 interface _CssStateMixin {
192 interface _CssStateMixin {
193 /**
193 /**
194 * True if cursor is over this widget
194 * True if cursor is over this widget
195 */
195 */
196 hovering: boolean;
196 hovering: boolean;
197
197
198 /**
198 /**
199 * True if mouse was pressed while over this widget, and hasn't been released yet
199 * True if mouse was pressed while over this widget, and hasn't been released yet
200 */
200 */
201 active: boolean;
201 active: boolean;
202 }
202 }
203
203
204 interface _CssStateMixinConstructor extends dojo._base.DeclareConstructor<_CssStateMixin> { }
204 interface _CssStateMixinConstructor extends dojo._base.DeclareConstructor<_CssStateMixin> { }
205
205
206 /* dijit/_DialogMixin */
206 /* dijit/_DialogMixin */
207
207
208 interface _DialogMixin {
208 interface _DialogMixin {
209 /**
209 /**
210 * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
210 * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
211 * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
211 * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
212 */
212 */
213 actionBarTemplate: string;
213 actionBarTemplate: string;
214
214
215 /**
215 /**
216 * Callback when the user hits the submit button.
216 * Callback when the user hits the submit button.
217 * Override this method to handle Dialog execution.
217 * Override this method to handle Dialog execution.
218 */
218 */
219 execute(formContents?: any): void;
219 execute(formContents?: any): void;
220
220
221 /**
221 /**
222 * Called when user has pressed the Dialog's cancel button, to notify container.
222 * Called when user has pressed the Dialog's cancel button, to notify container.
223 */
223 */
224 onCancel(): void;
224 onCancel(): void;
225
225
226 /**
226 /**
227 * Called when user has pressed the dialog's OK button, to notify container.
227 * Called when user has pressed the dialog's OK button, to notify container.
228 */
228 */
229 onExecute(): void;
229 onExecute(): void;
230 }
230 }
231
231
232 /* dijit/_FocusMixin */
232 /* dijit/_FocusMixin */
233 interface _FocusMixin { }
233 interface _FocusMixin { }
234
234
235 interface _WidgetBase {
235 interface _WidgetBase {
236 /**
236 /**
237 * Called when the widget becomes "active" because
237 * Called when the widget becomes "active" because
238 * it or a widget inside of it either has focus, or has recently
238 * it or a widget inside of it either has focus, or has recently
239 * been clicked.
239 * been clicked.
240 */
240 */
241 onFocus(): void;
241 onFocus(): void;
242
242
243 /**
243 /**
244 * Called when the widget stops being "active" because
244 * Called when the widget stops being "active" because
245 * focus moved to something outside of it, or the user
245 * focus moved to something outside of it, or the user
246 * clicked somewhere outside of it, or the widget was
246 * clicked somewhere outside of it, or the widget was
247 * hidden.
247 * hidden.
248 */
248 */
249 onBlur(): void;
249 onBlur(): void;
250 }
250 }
251
251
252 /* dijit/_HasDropDown */
252 /* dijit/_HasDropDown */
253
253
254 interface _HasDropDown<T extends _WidgetBase> extends _FocusMixin {
254 interface _HasDropDown<T extends _WidgetBase> extends _FocusMixin {
255 /**
255 /**
256 * The button/icon/node to click to display the drop down.
256 * The button/icon/node to click to display the drop down.
257 * Can be set via a data-dojo-attach-point assignment.
257 * Can be set via a data-dojo-attach-point assignment.
258 * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
258 * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
259 */
259 */
260 _buttonNode: HTMLElement;
260 _buttonNode: HTMLElement;
261
261
262 /**
262 /**
263 * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
263 * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
264 * on where the drop down is set to be positioned.
264 * on where the drop down is set to be positioned.
265 * Can be set via a data-dojo-attach-point assignment.
265 * Can be set via a data-dojo-attach-point assignment.
266 * If missing, then _buttonNode will be used.
266 * If missing, then _buttonNode will be used.
267 */
267 */
268 _arrowWrapperNode: HTMLElement;
268 _arrowWrapperNode: HTMLElement;
269
269
270 /**
270 /**
271 * The node to set the aria-expanded class on.
271 * The node to set the aria-expanded class on.
272 * Also sets popupActive class but that will be removed in 2.0.
272 * Also sets popupActive class but that will be removed in 2.0.
273 * Can be set via a data-dojo-attach-point assignment.
273 * Can be set via a data-dojo-attach-point assignment.
274 * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
274 * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
275 */
275 */
276 _popupStateNode: HTMLElement;
276 _popupStateNode: HTMLElement;
277
277
278 /**
278 /**
279 * The node to display the popup around.
279 * The node to display the popup around.
280 * Can be set via a data-dojo-attach-point assignment.
280 * Can be set via a data-dojo-attach-point assignment.
281 * If missing, then domNode will be used.
281 * If missing, then domNode will be used.
282 */
282 */
283 _aroundNode: HTMLElement;
283 _aroundNode: HTMLElement;
284
284
285 /**
285 /**
286 * The widget to display as a popup. This widget *must* be
286 * The widget to display as a popup. This widget *must* be
287 * defined before the startup function is called.
287 * defined before the startup function is called.
288 */
288 */
289 dropDown: T;
289 dropDown: T;
290
290
291 /**
291 /**
292 * Set to true to make the drop down at least as wide as this
292 * Set to true to make the drop down at least as wide as this
293 * widget. Set to false if the drop down should just be its
293 * widget. Set to false if the drop down should just be its
294 * default width.
294 * default width.
295 */
295 */
296 autoWidth: boolean;
296 autoWidth: boolean;
297
297
298 /**
298 /**
299 * Set to true to make the drop down exactly as wide as this
299 * Set to true to make the drop down exactly as wide as this
300 * widget. Overrides autoWidth.
300 * widget. Overrides autoWidth.
301 */
301 */
302 forceWidth: boolean;
302 forceWidth: boolean;
303
303
304 /**
304 /**
305 * The max height for our dropdown.
305 * The max height for our dropdown.
306 * Any dropdown taller than this will have scrollbars.
306 * Any dropdown taller than this will have scrollbars.
307 * Set to 0 for no max height, or -1 to limit height to available space in viewport
307 * Set to 0 for no max height, or -1 to limit height to available space in viewport
308 */
308 */
309 maxHeight: number;
309 maxHeight: number;
310
310
311 /**
311 /**
312 * This variable controls the position of the drop down.
312 * This variable controls the position of the drop down.
313 * It's an array of strings
313 * It's an array of strings
314 */
314 */
315 dropDownPosition: string[];
315 dropDownPosition: string[];
316 /* TODO remove for TS 1.8 */
316 /* TODO remove for TS 1.8 */
317 /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
317 /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
318
318
319 /**
319 /**
320 * When set to false, the click events will not be stopped, in
320 * When set to false, the click events will not be stopped, in
321 * case you want to use them in your subclass
321 * case you want to use them in your subclass
322 */
322 */
323 _stopClickEvents: boolean;
323 _stopClickEvents: boolean;
324
324
325 /**
325 /**
326 * Callback when the user mousedown/touchstart on the arrow icon.
326 * Callback when the user mousedown/touchstart on the arrow icon.
327 */
327 */
328 _onDropDownMouseDown(e: MouseEvent): void;
328 _onDropDownMouseDown(e: MouseEvent): void;
329
329
330 /**
330 /**
331 * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
331 * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
332 * Note that this function is called regardless of what node the event occurred on (but only after
332 * Note that this function is called regardless of what node the event occurred on (but only after
333 * a mousedown/touchstart on the arrow).
333 * a mousedown/touchstart on the arrow).
334 */
334 */
335 _onDropDownMouseUp(e?: MouseEvent): void;
335 _onDropDownMouseUp(e?: MouseEvent): void;
336
336
337 /**
337 /**
338 * The drop down was already opened on mousedown/keydown; just need to stop the event
338 * The drop down was already opened on mousedown/keydown; just need to stop the event
339 */
339 */
340 _onDropDownClick(e: MouseEvent): void;
340 _onDropDownClick(e: MouseEvent): void;
341
341
342 buildRendering(): void;
342 buildRendering(): void;
343 postCreate(): void;
343 postCreate(): void;
344 destroy(preserveDom?: boolean): void;
344 destroy(preserveDom?: boolean): void;
345
345
346 /**
346 /**
347 * Returns true if the dropdown exists and it's data is loaded. This can
347 * Returns true if the dropdown exists and it's data is loaded. This can
348 * be overridden in order to force a call to loadDropDown().
348 * be overridden in order to force a call to loadDropDown().
349 */
349 */
350 isLoaded(): boolean;
350 isLoaded(): boolean;
351
351
352 /**
352 /**
353 * Creates the drop down if it doesn't exist, loads the data
353 * Creates the drop down if it doesn't exist, loads the data
354 * if there's an href and it hasn't been loaded yet, and then calls
354 * if there's an href and it hasn't been loaded yet, and then calls
355 * the given callback.
355 * the given callback.
356 */
356 */
357 loadDropDown(loadCallback: () => void): void;
357 loadDropDown(loadCallback: () => void): void;
358
358
359 /**
359 /**
360 * Creates the drop down if it doesn't exist, loads the data
360 * Creates the drop down if it doesn't exist, loads the data
361 * if there's an href and it hasn't been loaded yet, and
361 * if there's an href and it hasn't been loaded yet, and
362 * then opens the drop down. This is basically a callback when the
362 * then opens the drop down. This is basically a callback when the
363 * user presses the down arrow button to open the drop down.
363 * user presses the down arrow button to open the drop down.
364 */
364 */
365 loadAndOpenDropDown(): dojo.Deferred<T>;
365 loadAndOpenDropDown(): dojo.Deferred<T>;
366
366
367 /**
367 /**
368 * Callback when the user presses the down arrow button or presses
368 * Callback when the user presses the down arrow button or presses
369 * the down arrow key to open/close the drop down.
369 * the down arrow key to open/close the drop down.
370 * Toggle the drop-down widget; if it is up, close it, if not, open it
370 * Toggle the drop-down widget; if it is up, close it, if not, open it
371 */
371 */
372 toggleDropDown(): void;
372 toggleDropDown(): void;
373
373
374 /**
374 /**
375 * Opens the dropdown for this widget. To be called only when this.dropDown
375 * Opens the dropdown for this widget. To be called only when this.dropDown
376 * has been created and is ready to display (ie, it's data is loaded).
376 * has been created and is ready to display (ie, it's data is loaded).
377 */
377 */
378 openDropDown(): PlaceLocation;
378 openDropDown(): PlaceLocation;
379
379
380 /**
380 /**
381 * Closes the drop down on this widget
381 * Closes the drop down on this widget
382 */
382 */
383 closeDropDown(focus?: boolean): void;
383 closeDropDown(focus?: boolean): void;
384 }
384 }
385
385
386 /* dijit/_OnDijitClickMixin */
386 /* dijit/_OnDijitClickMixin */
387
387
388 interface _OnDijitClickMixin {
388 interface _OnDijitClickMixin {
389 /**
389 /**
390 * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
390 * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
391 */
391 */
392 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
392 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
393 }
393 }
394
394
395 interface _OnDijitClickMixinConstructor {
395 interface _OnDijitClickMixinConstructor {
396 /**
396 /**
397 * Deprecated. New code should access the dijit/a11yclick event directly, ex:
397 * Deprecated. New code should access the dijit/a11yclick event directly, ex:
398 * | this.own(on(node, a11yclick, function(){ ... }));
398 * | this.own(on(node, a11yclick, function(){ ... }));
399 *
399 *
400 * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
400 * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
401 * It also used to be necessary to make templates with ondijitclick work, but now you can just require
401 * It also used to be necessary to make templates with ondijitclick work, but now you can just require
402 * dijit/a11yclick.
402 * dijit/a11yclick.
403 */
403 */
404 new(): _OnDijitClickMixin;
404 new(): _OnDijitClickMixin;
405 a11yclick: A11yClick;
405 a11yclick: A11yClick;
406 }
406 }
407
407
408 /* dijit/_TemplatedMixin */
408 /* dijit/_TemplatedMixin */
409
409
410 interface _TemplatedMixin extends _AttachMixin {
410 interface _TemplatedMixin extends _AttachMixin {
411
411
412 /**
412 /**
413 * A string that represents the widget template.
413 * A string that represents the widget template.
414 * Use in conjunction with dojo.cache() to load from a file.
414 * Use in conjunction with dojo.cache() to load from a file.
415 */
415 */
416 templateString: string;
416 templateString: string;
417
417
418 /**
418 /**
419 * Path to template (HTML file) for this widget relative to dojo.baseUrl.
419 * Path to template (HTML file) for this widget relative to dojo.baseUrl.
420 * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
420 * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
421 */
421 */
422 templatePath: string;
422 templatePath: string;
423
423
424 /**
424 /**
425 * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
425 * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
426 * and events inside this.containerNode. Remove for 2.0.
426 * and events inside this.containerNode. Remove for 2.0.
427 */
427 */
428 searchContainerNode: boolean;
428 searchContainerNode: boolean;
429
429
430 /**
430 /**
431 * Construct the UI for this widget from a template, setting this.domNode.
431 * Construct the UI for this widget from a template, setting this.domNode.
432 */
432 */
433 buildRendering(): void;
433 buildRendering(): void;
434 }
434 }
435
435
436 interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
436 interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
437 /**
437 /**
438 * Static method to get a template based on the templatePath or
438 * Static method to get a template based on the templatePath or
439 * templateString key
439 * templateString key
440 */
440 */
441 getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
441 getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
442 }
442 }
443
443
444 /* dijit/_Widget */
444 /* dijit/_Widget */
445 interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
445 interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
446 /**
446 /**
447 * Connect to this function to receive notifications of mouse click events.
447 * Connect to this function to receive notifications of mouse click events.
448 */
448 */
449 onClick(event: MouseEvent): void;
449 onClick(event: MouseEvent): void;
450
450
451 /**
451 /**
452 * Connect to this function to receive notifications of mouse double click events.
452 * Connect to this function to receive notifications of mouse double click events.
453 */
453 */
454 onDblClick(event: MouseEvent): void;
454 onDblClick(event: MouseEvent): void;
455
455
456 /**
456 /**
457 * Connect to this function to receive notifications of keys being pressed down.
457 * Connect to this function to receive notifications of keys being pressed down.
458 */
458 */
459 onKeyDown(event: KeyboardEvent): void;
459 onKeyDown(event: KeyboardEvent): void;
460
460
461 /**
461 /**
462 * Connect to this function to receive notifications of printable keys being typed.
462 * Connect to this function to receive notifications of printable keys being typed.
463 */
463 */
464 onKeyPress(event: KeyboardEvent): void;
464 onKeyPress(event: KeyboardEvent): void;
465
465
466 /**
466 /**
467 * Connect to this function to receive notifications of keys being released.
467 * Connect to this function to receive notifications of keys being released.
468 */
468 */
469 onKeyUp(event: KeyboardEvent): void;
469 onKeyUp(event: KeyboardEvent): void;
470
470
471 /**
471 /**
472 * Connect to this function to receive notifications of when the mouse button is pressed down.
472 * Connect to this function to receive notifications of when the mouse button is pressed down.
473 */
473 */
474 onMouseDown(event: MouseEvent): void;
474 onMouseDown(event: MouseEvent): void;
475
475
476 /**
476 /**
477 * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
477 * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
478 */
478 */
479 onMouseMove(event: MouseEvent): void;
479 onMouseMove(event: MouseEvent): void;
480
480
481 /**
481 /**
482 * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
482 * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
483 */
483 */
484 onMouseOut(event: MouseEvent): void;
484 onMouseOut(event: MouseEvent): void;
485
485
486 /**
486 /**
487 * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
487 * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
488 */
488 */
489 onMouseOver(event: MouseEvent): void;
489 onMouseOver(event: MouseEvent): void;
490
490
491 /**
491 /**
492 * Connect to this function to receive notifications of when the mouse moves off of this widget.
492 * Connect to this function to receive notifications of when the mouse moves off of this widget.
493 */
493 */
494 onMouseLeave(event: MouseEvent): void;
494 onMouseLeave(event: MouseEvent): void;
495
495
496 /**
496 /**
497 * Connect to this function to receive notifications of when the mouse moves onto this widget.
497 * Connect to this function to receive notifications of when the mouse moves onto this widget.
498 */
498 */
499 onMouseEnter(event: MouseEvent): void;
499 onMouseEnter(event: MouseEvent): void;
500
500
501 /**
501 /**
502 * Connect to this function to receive notifications of when the mouse button is released.
502 * Connect to this function to receive notifications of when the mouse button is released.
503 */
503 */
504 onMouseUp(event: MouseEvent): void;
504 onMouseUp(event: MouseEvent): void;
505
505
506 postCreate(): void;
506 postCreate(): void;
507
507
508 /**
508 /**
509 * Deprecated. Use set() instead.
509 * Deprecated. Use set() instead.
510 */
510 */
511 setAttribute(attr: string, value: any): void;
511 setAttribute(attr: string, value: any): void;
512
512
513 /**
513 /**
514 * This method is deprecated, use get() or set() directly.
514 * This method is deprecated, use get() or set() directly.
515 */
515 */
516 attr(name: string | { [attr: string]: any }, value?: any): any;
516 attr(name: string | { [attr: string]: any }, value?: any): any;
517
517
518 /**
518 /**
519 * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
519 * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
520 */
520 */
521 getDescendants(): _Widget[];
521 getDescendants(): _Widget[];
522
522
523 /**
523 /**
524 * Called when this widget becomes the selected pane in a
524 * Called when this widget becomes the selected pane in a
525 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
525 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
526 * `dijit/layout/AccordionContainer`, etc.
526 * `dijit/layout/AccordionContainer`, etc.
527 *
527 *
528 * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
528 * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
529 */
529 */
530 onShow(): void;
530 onShow(): void;
531
531
532 /**
532 /**
533 * Called when another widget becomes the selected pane in a
533 * Called when another widget becomes the selected pane in a
534 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
534 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
535 * `dijit/layout/AccordionContainer`, etc.
535 * `dijit/layout/AccordionContainer`, etc.
536 *
536 *
537 * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
537 * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
538 */
538 */
539 onHide(): void;
539 onHide(): void;
540
540
541 /**
541 /**
542 * Called when this widget is being displayed as a popup (ex: a Calendar popped
542 * Called when this widget is being displayed as a popup (ex: a Calendar popped
543 * up from a DateTextBox), and it is hidden.
543 * up from a DateTextBox), and it is hidden.
544 * This is called from the dijit.popup code, and should not be called directly.
544 * This is called from the dijit.popup code, and should not be called directly.
545 *
545 *
546 * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
546 * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
547 * Callback if a user tries to close the child. Child will be closed if this function returns true.
547 * Callback if a user tries to close the child. Child will be closed if this function returns true.
548 */
548 */
549 onClose(): boolean;
549 onClose(): boolean;
550 }
550 }
551
551
552 interface _WidgetBase {
552 interface _WidgetBase {
553 /**
553 /**
554 * Used across all instances a hash to cache attribute names and their getter
554 * Used across all instances a hash to cache attribute names and their getter
555 * and setter names.
555 * and setter names.
556 */
556 */
557 _attrPairNames: { [attr: string]: string };
557 _attrPairNames: { [attr: string]: string };
558
558
559 /**
559 /**
560 * Helper function for get() and set().
560 * Helper function for get() and set().
561 * Caches attribute name values so we don't do the string ops every time.
561 * Caches attribute name values so we don't do the string ops every time.
562 */
562 */
563 _getAttrNames(name: string): string;
563 _getAttrNames(name: string): string;
564
564
565 /**
565 /**
566 * Internal helper for directly changing an attribute value.
566 * Internal helper for directly changing an attribute value.
567 * This method id derived from Stateful and must not be used!
567 * This method id derived from Stateful and must not be used!
568 * @deprecated use `_set(name, value)` instead.
568 * @deprecated use `_set(name, value)` instead.
569 */
569 */
570 _changeAttrValue(name: string, value: any): this;
570 _changeAttrValue(name: string, value: any): this;
571
571
572 get<K extends keyof this>(name: K): this[K];
572 get<K extends keyof this>(name: K): this[K];
573
573
574 /**
574 /**
575 * Helper function to set new value for specified property, and call handlers
575 * Helper function to set new value for specified property, and call handlers
576 * registered with watch() if the value has changed.
576 * registered with watch() if the value has changed.
577 * @param name
577 * @param name
578 * @param value
578 * @param value
579 */
579 */
580 _set<K extends keyof this>(name: K, value: this[K]): void;
580 _set<K extends keyof this>(name: K, value: this[K]): void;
581
581
582 /**
582 /**
583 * Helper function to get value for specified property stored by this._set(),
583 * Helper function to get value for specified property stored by this._set(),
584 * i.e. for properties with custom setters. Used mainly by custom getters.
584 * i.e. for properties with custom setters. Used mainly by custom getters.
585 *
585 *
586 * For example, CheckBox._getValueAttr() calls this._get("value").
586 * For example, CheckBox._getValueAttr() calls this._get("value").
587 * @param name
587 * @param name
588 */
588 */
589 _get<K extends keyof this>(name: K): this[K];
589 _get<K extends keyof this>(name: K): this[K];
590
590
591 /**
591 /**
592 * Set a property on a Stateful instance
592 * Set a property on a Stateful instance
593 */
593 */
594 set<K extends keyof this>(name: K, value: this[K]): this;
594 set<K extends keyof this>(name: K, value: this[K], ...opts: unknown[]): this;
595 set<K extends keyof this, V extends this[K] & any[]>(name: K, ...values: V): this;
595 set(values: Partial<this>): this;
596 set<K extends keyof this>(values: {[p in K]: this[p]}): this;
597
596
598 /**
597 /**
599 * Watches a property for changes
598 * Watches a property for changes
600 */
599 */
601 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
600 watch(callback: <K extends keyof any>(prop: K, oldValue: any, newValue: any) => void): dojo.WatchHandle;
602 watch<K extends keyof this>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
601 watch<K extends keyof this>(name: K, callback: (prop: K, oldValue: this[K], newValue: this[K]) => void): dojo.WatchHandle;
603 }
602 }
604
603
605 type EventInitArgs<T extends Event> = {
604 type EventInitArgs<T extends Event> = {
606 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
605 [p in keyof T]?: T[p] extends (...args: any) => any ? never : T[p];
607 };
606 };
608
607
609 /* dijit/_WidgetBase */
608 /* dijit/_WidgetBase */
610 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
609 interface _WidgetBase<Events extends { [name in keyof Events]: Event } = GlobalEventHandlersEventMap> extends Destroyable {
611
610
612 /**
611 /**
613 * A unique, opaque ID string that can be assigned by users or by the
612 * A unique, opaque ID string that can be assigned by users or by the
614 * system. If the developer passes an ID which is known not to be
613 * system. If the developer passes an ID which is known not to be
615 * unique, the specified ID is ignored and the system-generated ID is
614 * unique, the specified ID is ignored and the system-generated ID is
616 * used instead.
615 * used instead.
617 */
616 */
618 id: string;
617 id: string;
619
618
620 /**
619 /**
621 * Rarely used. Overrides the default Dojo locale used to render this widget,
620 * Rarely used. Overrides the default Dojo locale used to render this widget,
622 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
621 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
623 * Value must be among the list of locales specified during by the Dojo bootstrap,
622 * Value must be among the list of locales specified during by the Dojo bootstrap,
624 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
623 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
625 */
624 */
626 lang: string;
625 lang: string;
627
626
628 /**
627 /**
629 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
628 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
630 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
629 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
631 * default direction.
630 * default direction.
632 */
631 */
633 dir: string;
632 dir: string;
634
633
635 /**
634 /**
636 * HTML class attribute
635 * HTML class attribute
637 */
636 */
638 class: string;
637 class: string;
639
638
640 /**
639 /**
641 * HTML style attributes as cssText string or name/value hash
640 * HTML style attributes as cssText string or name/value hash
642 */
641 */
643 style: string;
642 style: string;
644
643
645 /**
644 /**
646 * HTML title attribute.
645 * HTML title attribute.
647 *
646 *
648 * For form widgets this specifies a tooltip to display when hovering over
647 * For form widgets this specifies a tooltip to display when hovering over
649 * the widget (just like the native HTML title attribute).
648 * the widget (just like the native HTML title attribute).
650 *
649 *
651 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
650 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
652 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
651 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
653 * interpreted as HTML.
652 * interpreted as HTML.
654 */
653 */
655 title: string;
654 title: string;
656
655
657 /**
656 /**
658 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
657 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
659 * this specifies the tooltip to appear when the mouse is hovered over that text.
658 * this specifies the tooltip to appear when the mouse is hovered over that text.
660 */
659 */
661 tooltip: string;
660 tooltip: string;
662
661
663 /**
662 /**
664 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
663 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
665 * widget state.
664 * widget state.
666 */
665 */
667 baseClass: string;
666 baseClass: string;
668
667
669 /**
668 /**
670 * pointer to original DOM node
669 * pointer to original DOM node
671 */
670 */
672 srcNodeRef: HTMLElement;
671 srcNodeRef: HTMLElement;
673
672
674 /**
673 /**
675 * This is our visible representation of the widget! Other DOM
674 * This is our visible representation of the widget! Other DOM
676 * Nodes may by assigned to other properties, usually through the
675 * Nodes may by assigned to other properties, usually through the
677 * template system's data-dojo-attach-point syntax, but the domNode
676 * template system's data-dojo-attach-point syntax, but the domNode
678 * property is the canonical "top level" node in widget UI.
677 * property is the canonical "top level" node in widget UI.
679 */
678 */
680 domNode: HTMLElement;
679 domNode: HTMLElement;
681
680
682 /**
681 /**
683 * Designates where children of the source DOM node will be placed.
682 * Designates where children of the source DOM node will be placed.
684 * "Children" in this case refers to both DOM nodes and widgets.
683 * "Children" in this case refers to both DOM nodes and widgets.
685 */
684 */
686 containerNode: HTMLElement;
685 containerNode: HTMLElement;
687
686
688 /**
687 /**
689 * The document this widget belongs to. If not specified to constructor, will default to
688 * The document this widget belongs to. If not specified to constructor, will default to
690 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
689 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
691 */
690 */
692 ownerDocument: HTMLElement;
691 ownerDocument: HTMLElement;
693
692
694 /**
693 /**
695 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
694 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
696 * for each XXX attribute to be mapped to the DOM.
695 * for each XXX attribute to be mapped to the DOM.
697 */
696 */
698 attributeMap: { [attribute: string]: any };
697 attributeMap: { [attribute: string]: any };
699
698
700 /**
699 /**
701 * Bi-directional support, the main variable which is responsible for the direction of the text.
700 * Bi-directional support, the main variable which is responsible for the direction of the text.
702 * The text direction can be different than the GUI direction by using this parameter in creation
701 * The text direction can be different than the GUI direction by using this parameter in creation
703 * of a widget.
702 * of a widget.
704 */
703 */
705 textDir: string;
704 textDir: string;
706
705
707 _started?: boolean;
706 _started?: boolean;
708
707
709 /**
708 /**
710 * Kicks off widget instantiation. See create() for details.
709 * Kicks off widget instantiation. See create() for details.
711 */
710 */
712 postscript(params?: any, srcNodeRef?: HTMLElement): void;
711 postscript(params?: any, srcNodeRef?: HTMLElement): void;
713
712
714 /**
713 /**
715 * Kick off the life-cycle of a widget
714 * Kick off the life-cycle of a widget
716 */
715 */
717 create(params?: any, srcNodeRef?: HTMLElement): void;
716 create(params?: any, srcNodeRef?: HTMLElement): void;
718
717
719 /**
718 /**
720 * Called after the parameters to the widget have been read-in,
719 * Called after the parameters to the widget have been read-in,
721 * but before the widget template is instantiated. Especially
720 * but before the widget template is instantiated. Especially
722 * useful to set properties that are referenced in the widget
721 * useful to set properties that are referenced in the widget
723 * template.
722 * template.
724 */
723 */
725 postMixInProperties(): void;
724 postMixInProperties(): void;
726
725
727 /**
726 /**
728 * Construct the UI for this widget, setting this.domNode.
727 * Construct the UI for this widget, setting this.domNode.
729 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
728 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
730 */
729 */
731 buildRendering(): void;
730 buildRendering(): void;
732
731
733 /**
732 /**
734 * Processing after the DOM fragment is created
733 * Processing after the DOM fragment is created
735 */
734 */
736 postCreate(): void;
735 postCreate(): void;
737
736
738 /**
737 /**
739 * Processing after the DOM fragment is added to the document
738 * Processing after the DOM fragment is added to the document
740 */
739 */
741 startup(): void;
740 startup(): void;
742
741
743 /**
742 /**
744 * Destroy this widget and its descendants
743 * Destroy this widget and its descendants
745 */
744 */
746 destroyRecursive(preserveDom?: boolean): void;
745 destroyRecursive(preserveDom?: boolean): void;
747
746
748 /**
747 /**
749 * Destroys the DOM nodes associated with this widget.
748 * Destroys the DOM nodes associated with this widget.
750 */
749 */
751 destroyRendering(preserveDom?: boolean): void;
750 destroyRendering(preserveDom?: boolean): void;
752
751
753 /**
752 /**
754 * Recursively destroy the children of this widget and their
753 * Recursively destroy the children of this widget and their
755 * descendants.
754 * descendants.
756 */
755 */
757 destroyDescendants(preserveDom?: boolean): void;
756 destroyDescendants(preserveDom?: boolean): void;
758
757
759 /**
758 /**
760 * Deprecated. Override destroy() instead to implement custom widget tear-down
759 * Deprecated. Override destroy() instead to implement custom widget tear-down
761 * behavior.
760 * behavior.
762 * @deprecated
761 * @deprecated
763 */
762 */
764 uninitialize(): boolean;
763 uninitialize(): boolean;
765
764
766 /**
765 /**
767 * Used by widgets to signal that a synthetic event occurred, ex:
766 * Used by widgets to signal that a synthetic event occurred, ex:
768 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
767 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
769 */
768 */
770 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>, callbackArgs?: any[]): any;
769 emit<K extends keyof Events>(eventName: K, evt: EventInitArgs<Events[K]>, callbackArgs?: any[]): any;
771
770
772 /**
771 /**
773 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
772 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
774 */
773 */
775 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
774 on<K extends keyof Events>(eventName: K, cb: (evt: Events[K]) => void): dojo.WatchHandle;
776
775
777 on(type: dojo.ExtensionEvent, func: dojo.EventListener): dojo.WatchHandle;
776 on(type: dojo.ExtensionEvent, func: dojo.EventListener): dojo.WatchHandle;
778
777
779 /**
778 /**
780 * Returns a string that represents the widget.
779 * Returns a string that represents the widget.
781 */
780 */
782 toString(): string;
781 toString(): string;
783
782
784 /**
783 /**
785 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
784 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
786 * is this widget. Note that it does not return all descendants, but rather just direct children.
785 * is this widget. Note that it does not return all descendants, but rather just direct children.
787 */
786 */
788 getChildren<T extends _WidgetBase>(): T[];
787 getChildren<T extends _WidgetBase>(): T[];
789
788
790 /**
789 /**
791 * Returns the parent widget of this widget.
790 * Returns the parent widget of this widget.
792 */
791 */
793 getParent<T extends _WidgetBase>(): T;
792 getParent<T extends _WidgetBase>(): T;
794
793
795 /**
794 /**
796 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
795 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
797 * @deprecated
796 * @deprecated
798 */
797 */
799 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
798 connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
800
799
801 /**
800 /**
802 * Deprecated, will be removed in 2.0, use handle.remove() instead.
801 * Deprecated, will be removed in 2.0, use handle.remove() instead.
803 * @deprecated
802 * @deprecated
804 */
803 */
805 disconnect(handle: dojo.WatchHandle): void;
804 disconnect(handle: dojo.WatchHandle): void;
806
805
807 /**
806 /**
808 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
807 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
809 * @deprecated
808 * @deprecated
810 */
809 */
811 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
810 subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
812
811
813 /**
812 /**
814 * Deprecated, will be removed in 2.0, use handle.remove() instead.
813 * Deprecated, will be removed in 2.0, use handle.remove() instead.
815 * @deprecated
814 * @deprecated
816 */
815 */
817 unsubscribe(handle: dojo.WatchHandle): void;
816 unsubscribe(handle: dojo.WatchHandle): void;
818
817
819 /**
818 /**
820 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
819 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
821 */
820 */
822 isLeftToRight(): boolean;
821 isLeftToRight(): boolean;
823
822
824 /**
823 /**
825 * Return true if this widget can currently be focused
824 * Return true if this widget can currently be focused
826 * and false if not
825 * and false if not
827 */
826 */
828 isFocusable(): boolean;
827 isFocusable(): boolean;
829
828
830 /**
829 /**
831 * Place this widget somewhere in the DOM based
830 * Place this widget somewhere in the DOM based
832 * on standard domConstruct.place() conventions.
831 * on standard domConstruct.place() conventions.
833 */
832 */
834 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
833 placeAt<T extends _WidgetBase>(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
835
834
836 /**
835 /**
837 * Wrapper to setTimeout to avoid deferred functions executing
836 * Wrapper to setTimeout to avoid deferred functions executing
838 * after the originating widget has been destroyed.
837 * after the originating widget has been destroyed.
839 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
838 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
840 */
839 */
841 defer(fcn: Function, delay?: number): dojo.Handle;
840 defer(fcn: Function, delay?: number): dojo.Handle;
842 }
841 }
843
842
844 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
843 interface _WidgetBaseConstructor<W> extends Pick<dojo._base.DeclareConstructor<W>, Exclude<keyof dojo._base.DeclareConstructor<W>, 'new'>> {
845 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
844 new(params?: Partial<W> & ThisType<W>, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
846 }
845 }
847
846
848 /* dijit/_WidgetsInTemplateMixin */
847 /* dijit/_WidgetsInTemplateMixin */
849
848
850 interface _WidgetsInTemplateMixin {
849 interface _WidgetsInTemplateMixin {
851 /**
850 /**
852 * Used to provide a context require to dojo/parser in order to be
851 * Used to provide a context require to dojo/parser in order to be
853 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
852 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
854 */
853 */
855 contextRequire: Function;
854 contextRequire: Function;
856
855
857 startup(): void;
856 startup(): void;
858 }
857 }
859
858
860 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
859 interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
861 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
860 new(params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
862 }
861 }
863
862
864 /* dijit/a11yclick */
863 /* dijit/a11yclick */
865
864
866 interface A11yClick {
865 interface A11yClick {
867
866
868 /**
867 /**
869 * Custom press, release, and click synthetic events
868 * Custom press, release, and click synthetic events
870 * which trigger on a left mouse click, touch, or space/enter keyup.
869 * which trigger on a left mouse click, touch, or space/enter keyup.
871 */
870 */
872 (node: HTMLElement, listener: Function): dojo.Handle;
871 (node: HTMLElement, listener: Function): dojo.Handle;
873
872
874 /**
873 /**
875 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
874 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
876 */
875 */
877 press: dojo.ExtensionEvent;
876 press: dojo.ExtensionEvent;
878
877
879 /**
878 /**
880 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
879 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
881 */
880 */
882 release: dojo.ExtensionEvent;
881 release: dojo.ExtensionEvent;
883
882
884 /**
883 /**
885 * Mouse cursor or a finger is dragged over the given node.
884 * Mouse cursor or a finger is dragged over the given node.
886 */
885 */
887 move: dojo.ExtensionEvent;
886 move: dojo.ExtensionEvent;
888 }
887 }
889
888
890 /* dijit/Calendar */
889 /* dijit/Calendar */
891
890
892 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
891 interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
893 onMonthSelect(): void;
892 onMonthSelect(): void;
894 postCreate(): void;
893 postCreate(): void;
895
894
896 //set(name: 'month', value: number): this;
895 //set(name: 'month', value: number): this;
897 //set(name: string, value: any): this;
896 //set(name: string, value: any): this;
898 //set(values: Object): this;
897 //set(values: Object): this;
899 }
898 }
900
899
901 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
900 interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
902
901
903 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
902 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
904 months: string[];
903 months: string[];
905 baseClass: string;
904 baseClass: string;
906 templateString: string;
905 templateString: string;
907
906
908 /**
907 /**
909 * Callback when month is selected from drop down
908 * Callback when month is selected from drop down
910 */
909 */
911 onChange(month: number): void;
910 onChange(month: number): void;
912
911
913 //set(name: 'months', value: string[]): this;
912 //set(name: 'months', value: string[]): this;
914 //set(name: string, value: any): this;
913 //set(name: string, value: any): this;
915 //set(values: Object): this;
914 //set(values: Object): this;
916 }
915 }
917
916
918 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
917 interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
919
918
920 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
919 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
921
920
922 baseClass: string;
921 baseClass: string;
923
922
924 /**
923 /**
925 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
924 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
926 */
925 */
927 cssStateNodes: CSSStateNodes;
926 cssStateNodes: CSSStateNodes;
928
927
929 /**
928 /**
930 * Creates the drop down button that displays the current month and lets user pick a new one
929 * Creates the drop down button that displays the current month and lets user pick a new one
931 */
930 */
932 _createMonthWidget(): _MonthDropDownButton;
931 _createMonthWidget(): _MonthDropDownButton;
933
932
934 postCreate(): void;
933 postCreate(): void;
935
934
936 /**
935 /**
937 * Handler for when user selects a month from the drop down list
936 * Handler for when user selects a month from the drop down list
938 */
937 */
939 _onMonthSelect(newMonth: number): void;
938 _onMonthSelect(newMonth: number): void;
940
939
941 /**
940 /**
942 * Handler for mouse over events on days, sets hovered style
941 * Handler for mouse over events on days, sets hovered style
943 */
942 */
944 _onDayMouseOver(evt: MouseEvent): void;
943 _onDayMouseOver(evt: MouseEvent): void;
945
944
946 /**
945 /**
947 * Handler for mouse out events on days, clears hovered style
946 * Handler for mouse out events on days, clears hovered style
948 */
947 */
949 _onDayMouseOut(evt: MouseEvent): void;
948 _onDayMouseOut(evt: MouseEvent): void;
950 _onDayMouseDown(evt: MouseEvent): void;
949 _onDayMouseDown(evt: MouseEvent): void;
951 _onDayMouseUp(evt: MouseEvent): void;
950 _onDayMouseUp(evt: MouseEvent): void;
952
951
953 /**
952 /**
954 * Provides keyboard navigation of calendar.
953 * Provides keyboard navigation of calendar.
955 */
954 */
956 handleKey(evt: KeyboardEvent): void;
955 handleKey(evt: KeyboardEvent): void;
957
956
958 /**
957 /**
959 * For handling keydown events on a stand alone calendar
958 * For handling keydown events on a stand alone calendar
960 */
959 */
961 _onKeyDown(evt: KeyboardEvent): void;
960 _onKeyDown(evt: KeyboardEvent): void;
962
961
963 /**
962 /**
964 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
963 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
965 */
964 */
966 onValueSelected(date: Date): void;
965 onValueSelected(date: Date): void;
967
966
968 onChange(date: Date): void;
967 onChange(date: Date): void;
969
968
970 /**
969 /**
971 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
970 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
972 * for example to indicate a holiday in specified locale.
971 * for example to indicate a holiday in specified locale.
973 */
972 */
974 getClassForDate(dateObject: Date, locale?: string): string;
973 getClassForDate(dateObject: Date, locale?: string): string;
975
974
976 // get(name: 'value'): Date;
975 // get(name: 'value'): Date;
977 // get(name: string): any;
976 // get(name: string): any;
978
977
979 // set(name: 'value', value: number | Date): this;
978 // set(name: 'value', value: number | Date): this;
980 // set(name: string, value: any): this;
979 // set(name: string, value: any): this;
981 // set(values: Object): this;
980 // set(values: Object): this;
982 }
981 }
983
982
984 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
983 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
985 _MonthWidget: _MonthWidgetConstructor;
984 _MonthWidget: _MonthWidgetConstructor;
986 _MonthDropDown: _MonthDropDownButtonConstructor;
985 _MonthDropDown: _MonthDropDownButtonConstructor;
987 _MonthDropDownButton: _MonthDropDownButtonConstructor;
986 _MonthDropDownButton: _MonthDropDownButtonConstructor;
988 }
987 }
989
988
990 /* dijit/CalendarLite */
989 /* dijit/CalendarLite */
991
990
992 interface _MonthWidget extends _WidgetBase {
991 interface _MonthWidget extends _WidgetBase {
993 // set(name: 'month', value: Date): this;
992 // set(name: 'month', value: Date): this;
994 // set(name: string, value: any): this;
993 // set(name: string, value: any): this;
995 // set(values: Object): this;
994 // set(values: Object): this;
996 }
995 }
997
996
998 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
997 interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
999
998
1000 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
999 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
1001 /**
1000 /**
1002 * Template for main calendar
1001 * Template for main calendar
1003 */
1002 */
1004 templateString: string;
1003 templateString: string;
1005
1004
1006 /**
1005 /**
1007 * Template for cell for a day of the week (ex: M)
1006 * Template for cell for a day of the week (ex: M)
1008 */
1007 */
1009 dowTemplateString: string;
1008 dowTemplateString: string;
1010
1009
1011 dateTemplateString: string;
1010 dateTemplateString: string;
1012 weekTemplateString: string;
1011 weekTemplateString: string;
1013
1012
1014 /**
1013 /**
1015 * The currently selected Date, initially set to invalid date to indicate no selection.
1014 * The currently selected Date, initially set to invalid date to indicate no selection.
1016 */
1015 */
1017 value: Date;
1016 value: Date;
1018
1017
1019 /**
1018 /**
1020 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1019 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
1021 * at dojo/date and dojo/date/locale.
1020 * at dojo/date and dojo/date/locale.
1022 */
1021 */
1023 datePackage: string;
1022 datePackage: string;
1024
1023
1025 /**
1024 /**
1026 * How to represent the days of the week in the calendar header. See locale
1025 * How to represent the days of the week in the calendar header. See locale
1027 */
1026 */
1028 dayWidth: string;
1027 dayWidth: string;
1029
1028
1030 /**
1029 /**
1031 * Order fields are traversed when user hits the tab key
1030 * Order fields are traversed when user hits the tab key
1032 */
1031 */
1033 tabIndex: string;
1032 tabIndex: string;
1034
1033
1035 /**
1034 /**
1036 * (Optional) The first day of week override. By default the first day of week is determined
1035 * (Optional) The first day of week override. By default the first day of week is determined
1037 * for the current locale (extracted from the CLDR).
1036 * for the current locale (extracted from the CLDR).
1038 * Special value -1 (default value), means use locale dependent value.
1037 * Special value -1 (default value), means use locale dependent value.
1039 */
1038 */
1040 dayOffset: number;
1039 dayOffset: number;
1041
1040
1042 /**
1041 /**
1043 * Date object containing the currently focused date, or the date which would be focused
1042 * Date object containing the currently focused date, or the date which would be focused
1044 * if the calendar itself was focused. Also indicates which year and month to display,
1043 * if the calendar itself was focused. Also indicates which year and month to display,
1045 * i.e. the current "page" the calendar is on.
1044 * i.e. the current "page" the calendar is on.
1046 */
1045 */
1047 currentFocus: Date;
1046 currentFocus: Date;
1048
1047
1049 /**
1048 /**
1050 * Put the summary to the node with role=grid
1049 * Put the summary to the node with role=grid
1051 */
1050 */
1052 _setSummaryAttr: string;
1051 _setSummaryAttr: string;
1053
1052
1054 baseClass: string;
1053 baseClass: string;
1055
1054
1056 /**
1055 /**
1057 * Runs various tests on the value, checking that it's a valid date, rather
1056 * Runs various tests on the value, checking that it's a valid date, rather
1058 * than blank or NaN.
1057 * than blank or NaN.
1059 */
1058 */
1060 _isValidDate(value: Date): boolean;
1059 _isValidDate(value: Date): boolean;
1061
1060
1062 /**
1061 /**
1063 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1062 * Convert Number into Date, or copy Date object. Then, round to nearest day,
1064 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1063 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
1065 */
1064 */
1066 _patchDate(value: number | Date): Date;
1065 _patchDate(value: number | Date): Date;
1067
1066
1068 /**
1067 /**
1069 * This just sets the content of node to the specified text.
1068 * This just sets the content of node to the specified text.
1070 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1069 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
1071 */
1070 */
1072 _setText(node: HTMLElement, text?: string): void;
1071 _setText(node: HTMLElement, text?: string): void;
1073
1072
1074 /**
1073 /**
1075 * Fills in the calendar grid with each day (1-31).
1074 * Fills in the calendar grid with each day (1-31).
1076 * Call this on creation, when moving to a new month.
1075 * Call this on creation, when moving to a new month.
1077 */
1076 */
1078 _populateGrid(): void;
1077 _populateGrid(): void;
1079
1078
1080 /**
1079 /**
1081 * Fill in localized month, and prev/current/next years
1080 * Fill in localized month, and prev/current/next years
1082 */
1081 */
1083 _populateControls(): void;
1082 _populateControls(): void;
1084
1083
1085 /**
1084 /**
1086 * Sets calendar's value to today's date
1085 * Sets calendar's value to today's date
1087 */
1086 */
1088 goToToday(): void;
1087 goToToday(): void;
1089
1088
1090 /**
1089 /**
1091 * Creates the drop down button that displays the current month and lets user pick a new one
1090 * Creates the drop down button that displays the current month and lets user pick a new one
1092 */
1091 */
1093 _createMonthWidget(): void;
1092 _createMonthWidget(): void;
1094
1093
1095 buildRendering(): void;
1094 buildRendering(): void;
1096 postCreate(): void;
1095 postCreate(): void;
1097
1096
1098 /**
1097 /**
1099 * Set up connects for increment/decrement of months/years
1098 * Set up connects for increment/decrement of months/years
1100 */
1099 */
1101 _connectControls(): void;
1100 _connectControls(): void;
1102
1101
1103 /**
1102 /**
1104 * If the calendar currently has focus, then focuses specified date,
1103 * If the calendar currently has focus, then focuses specified date,
1105 * changing the currently displayed month/year if necessary.
1104 * changing the currently displayed month/year if necessary.
1106 * If the calendar doesn't have focus, updates currently
1105 * If the calendar doesn't have focus, updates currently
1107 * displayed month/year, and sets the cell that will get focus
1106 * displayed month/year, and sets the cell that will get focus
1108 * when Calendar is focused.
1107 * when Calendar is focused.
1109 */
1108 */
1110 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1109 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
1111
1110
1112 /**
1111 /**
1113 * Focus the calendar by focusing one of the calendar cells
1112 * Focus the calendar by focusing one of the calendar cells
1114 */
1113 */
1115 focus(): void;
1114 focus(): void;
1116
1115
1117 /**
1116 /**
1118 * Handler for day clicks, selects the date if appropriate
1117 * Handler for day clicks, selects the date if appropriate
1119 */
1118 */
1120 _onDayClick(evt: MouseEvent): void;
1119 _onDayClick(evt: MouseEvent): void;
1121
1120
1122 /**
1121 /**
1123 * Returns the cell corresponding to the date, or null if the date is not within the currently
1122 * Returns the cell corresponding to the date, or null if the date is not within the currently
1124 * displayed month.
1123 * displayed month.
1125 */
1124 */
1126 _getNodeByDate(value: Date): HTMLElement;
1125 _getNodeByDate(value: Date): HTMLElement;
1127
1126
1128 /**
1127 /**
1129 * Marks the specified cells as selected, and clears cells previously marked as selected.
1128 * Marks the specified cells as selected, and clears cells previously marked as selected.
1130 * For CalendarLite at most one cell is selected at any point, but this allows an array
1129 * For CalendarLite at most one cell is selected at any point, but this allows an array
1131 * for easy subclassing.
1130 * for easy subclassing.
1132 */
1131 */
1133 _markSelectedDates(dates: Date[]): void;
1132 _markSelectedDates(dates: Date[]): void;
1134
1133
1135 /**
1134 /**
1136 * Called only when the selected date has changed
1135 * Called only when the selected date has changed
1137 */
1136 */
1138 onChange(date: Date): void;
1137 onChange(date: Date): void;
1139
1138
1140 /**
1139 /**
1141 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1140 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
1142 */
1141 */
1143 isDisabledDate(dateObject: Date, locale?: string): boolean;
1142 isDisabledDate(dateObject: Date, locale?: string): boolean;
1144
1143
1145 /**
1144 /**
1146 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1145 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
1147 * for example to indicate a holiday in specified locale.
1146 * for example to indicate a holiday in specified locale.
1148 */
1147 */
1149 getClassForDate(dateObject: Date, locale?: string): string;
1148 getClassForDate(dateObject: Date, locale?: string): string;
1150
1149
1151 // get(name: 'value'): Date;
1150 // get(name: 'value'): Date;
1152 // get(name: string): any;
1151 // get(name: string): any;
1153
1152
1154 // set(name: 'value', value: number | Date): this;
1153 // set(name: 'value', value: number | Date): this;
1155 // set(name: string, value: any): this;
1154 // set(name: string, value: any): this;
1156 // set(values: Object): this;
1155 // set(values: Object): this;
1157 }
1156 }
1158
1157
1159 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1158 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
1160 _MonthWidget: _MonthWidgetConstructor;
1159 _MonthWidget: _MonthWidgetConstructor;
1161 }
1160 }
1162
1161
1163 /* dijit/Destroyable */
1162 /* dijit/Destroyable */
1164
1163
1165 interface Destroyable {
1164 interface Destroyable {
1166 _destroyed?: true;
1165 _destroyed?: true;
1167
1166
1168 /**
1167 /**
1169 * Destroy this class, releasing any resources registered via own().
1168 * Destroy this class, releasing any resources registered via own().
1170 */
1169 */
1171 destroy(preserveDom?: boolean): void;
1170 destroy(preserveDom?: boolean): void;
1172
1171
1173 /**
1172 /**
1174 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1173 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
1175 * already removed/destroyed manually.
1174 * already removed/destroyed manually.
1176 */
1175 */
1177 own(...args: any[]): any[];
1176 own(...args: any[]): any[];
1178 }
1177 }
1179
1178
1180 /**
1179 /**
1181 * Mixin to track handles and release them when instance is destroyed.
1180 * Mixin to track handles and release them when instance is destroyed.
1182 */
1181 */
1183 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1182 interface DestroyableConstructor extends dojo._base.DeclareConstructor<Destroyable> { }
1184
1183
1185 /** dijit/_KeyNavMixin */
1184 /** dijit/_KeyNavMixin */
1186
1185
1187 /**
1186 /**
1188 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1187 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
1189 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1188 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
1190 *
1189 *
1191 * To use this mixin, the subclass must:
1190 * To use this mixin, the subclass must:
1192 *
1191 *
1193 * - Implement _getNext(), _getFirst(), _getLast(), _onLeftArrow(), _onRightArrow() _onDownArrow(), _onUpArrow() methods to handle home/end/left/right/up/down keystrokes. Next and previous in this context refer to a linear ordering of the descendants used by letter key search.
1192 * - Implement _getNext(), _getFirst(), _getLast(), _onLeftArrow(), _onRightArrow() _onDownArrow(), _onUpArrow() methods to handle home/end/left/right/up/down keystrokes. Next and previous in this context refer to a linear ordering of the descendants used by letter key search.
1194 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1193 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
1195 * - Define childSelector to a function or string that identifies focusable descendant widgets
1194 * - Define childSelector to a function or string that identifies focusable descendant widgets
1196 *
1195 *
1197 * Also, child widgets must implement a focus() method.
1196 * Also, child widgets must implement a focus() method.
1198 */
1197 */
1199 interface _KeyNavMixin extends _FocusMixin {
1198 interface _KeyNavMixin extends _FocusMixin {
1200 /**
1199 /**
1201 * Tab index of the container; same as HTML tabIndex attribute.
1200 * Tab index of the container; same as HTML tabIndex attribute.
1202 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1201 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
1203 */
1202 */
1204 tabIndex: string;
1203 tabIndex: string;
1205
1204
1206 /**
1205 /**
1207 * Selector (passed to on.selector()) used to identify what to treat as a child widget. Used to monitor focus events and set this.focusedChild. Must be set by implementing class. If this is a string (ex: "> *") then the implementing class must require dojo/query.
1206 * Selector (passed to on.selector()) used to identify what to treat as a child widget. Used to monitor focus events and set this.focusedChild. Must be set by implementing class. If this is a string (ex: "> *") then the implementing class must require dojo/query.
1208 */
1207 */
1209 childSelector: string | Function | null;
1208 childSelector: string | Function | null;
1210
1209
1211 /**
1210 /**
1212 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1211 * Called on left arrow key, or right arrow key if widget is in RTL mode.
1213 * Should go back to the previous child in horizontal container widgets like Toolbar.
1212 * Should go back to the previous child in horizontal container widgets like Toolbar.
1214 */
1213 */
1215 _onLeftArrow(evt?: KeyboardEvent): void;
1214 _onLeftArrow(evt?: KeyboardEvent): void;
1216
1215
1217 /**
1216 /**
1218 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1217 * Called on right arrow key, or left arrow key if widget is in RTL mode.
1219 * Should go to the next child in horizontal container widgets like Toolbar.
1218 * Should go to the next child in horizontal container widgets like Toolbar.
1220 */
1219 */
1221 _onRightArrow(evt?: KeyboardEvent): void;
1220 _onRightArrow(evt?: KeyboardEvent): void;
1222
1221
1223 /**
1222 /**
1224 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1223 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
1225 */
1224 */
1226 _onUpArrow(evt?: KeyboardEvent): void;
1225 _onUpArrow(evt?: KeyboardEvent): void;
1227
1226
1228 /**
1227 /**
1229 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1228 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
1230 */
1229 */
1231 _onDownArrow(evt?: KeyboardEvent): void;
1230 _onDownArrow(evt?: KeyboardEvent): void;
1232
1231
1233 /**
1232 /**
1234 * Default focus() implementation: focus the first child.
1233 * Default focus() implementation: focus the first child.
1235 */
1234 */
1236 focus(): void;
1235 focus(): void;
1237
1236
1238 /**
1237 /**
1239 * Returns first child that can be focused.
1238 * Returns first child that can be focused.
1240 */
1239 */
1241 _getFirstFocusableChild(): _WidgetBase;
1240 _getFirstFocusableChild(): _WidgetBase;
1242
1241
1243 /**
1242 /**
1244 * Returns last child that can be focused.
1243 * Returns last child that can be focused.
1245 */
1244 */
1246 _getLastFocusableChild(): _WidgetBase;
1245 _getLastFocusableChild(): _WidgetBase;
1247
1246
1248 /**
1247 /**
1249 * Focus the first focusable child in the container.
1248 * Focus the first focusable child in the container.
1250 */
1249 */
1251 focusFirstChild(): void;
1250 focusFirstChild(): void;
1252
1251
1253 /**
1252 /**
1254 * Focus the last focusable child in the container.
1253 * Focus the last focusable child in the container.
1255 */
1254 */
1256 focusLastChild(): void;
1255 focusLastChild(): void;
1257
1256
1258 /**
1257 /**
1259 * Focus specified child widget.
1258 * Focus specified child widget.
1260 *
1259 *
1261 * @param widget Reference to container's child widget
1260 * @param widget Reference to container's child widget
1262 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1261 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
1263 */
1262 */
1264 focusChild(widget: _WidgetBase, last?: boolean): void;
1263 focusChild(widget: _WidgetBase, last?: boolean): void;
1265
1264
1266 /**
1265 /**
1267 * Handler for when the container itself gets focus.
1266 * Handler for when the container itself gets focus.
1268 *
1267 *
1269 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1268 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
1270 */
1269 */
1271 _onContainerFocus(evt: Event): void;
1270 _onContainerFocus(evt: Event): void;
1272
1271
1273 /**
1272 /**
1274 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1273 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
1275 *
1274 *
1276 * It marks that the current node is the selected one, and the previously selected node no longer is.
1275 * It marks that the current node is the selected one, and the previously selected node no longer is.
1277 */
1276 */
1278 _onChildFocus(child?: _WidgetBase): void;
1277 _onChildFocus(child?: _WidgetBase): void;
1279
1278
1280 _searchString: string;
1279 _searchString: string;
1281
1280
1282 multiCharSearchDuration: number;
1281 multiCharSearchDuration: number;
1283
1282
1284 /**
1283 /**
1285 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
1284 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
1286 */
1285 */
1287 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1286 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
1288
1287
1289 /**
1288 /**
1290 * Compares the searchString to the widget's text label, returning:
1289 * Compares the searchString to the widget's text label, returning:
1291 *
1290 *
1292 * * -1: a high priority match and stop searching
1291 * * -1: a high priority match and stop searching
1293 * * 0: not a match
1292 * * 0: not a match
1294 * * 1: a match but keep looking for a higher priority match
1293 * * 1: a match but keep looking for a higher priority match
1295 */
1294 */
1296 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1295 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
1297
1296
1298 /**
1297 /**
1299 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1298 * When a key is pressed, if it's an arrow key etc. then it's handled here.
1300 */
1299 */
1301 _onContainerKeydown(evt: Event): void;
1300 _onContainerKeydown(evt: Event): void;
1302
1301
1303 /**
1302 /**
1304 * When a printable key is pressed, it's handled here, searching by letter.
1303 * When a printable key is pressed, it's handled here, searching by letter.
1305 */
1304 */
1306 _onContainerKeypress(evt: Event): void;
1305 _onContainerKeypress(evt: Event): void;
1307
1306
1308 /**
1307 /**
1309 * Perform a search of the widget's options based on the user's keyboard activity
1308 * Perform a search of the widget's options based on the user's keyboard activity
1310 *
1309 *
1311 * Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.
1310 * Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.
1312 */
1311 */
1313 _keyboardSearch(evt: Event, keyChar: string): void;
1312 _keyboardSearch(evt: Event, keyChar: string): void;
1314
1313
1315 /**
1314 /**
1316 * Called when focus leaves a child widget to go to a sibling widget.
1315 * Called when focus leaves a child widget to go to a sibling widget.
1317 */
1316 */
1318 _onChildBlur(widget: _WidgetBase): void;
1317 _onChildBlur(widget: _WidgetBase): void;
1319
1318
1320 /**
1319 /**
1321 * Returns the next or previous focusable descendant, compared to "child".
1320 * Returns the next or previous focusable descendant, compared to "child".
1322 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1321 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
1323 */
1322 */
1324 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1323 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1325
1324
1326 /**
1325 /**
1327 * Returns the first child.
1326 * Returns the first child.
1328 */
1327 */
1329 _getFirst(): _WidgetBase | null;
1328 _getFirst(): _WidgetBase | null;
1330
1329
1331 /**
1330 /**
1332 * Returns the last descendant.
1331 * Returns the last descendant.
1333 */
1332 */
1334 _getLast(): _WidgetBase | null;
1333 _getLast(): _WidgetBase | null;
1335
1334
1336 /**
1335 /**
1337 * Returns the next descendant, compared to "child".
1336 * Returns the next descendant, compared to "child".
1338 */
1337 */
1339 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1338 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
1340 }
1339 }
1341
1340
1342 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1341 interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
1343
1342
1344 /* dijit/_KeyNavContainer */
1343 /* dijit/_KeyNavContainer */
1345
1344
1346 /**
1345 /**
1347 * A _Container with keyboard navigation of its children.
1346 * A _Container with keyboard navigation of its children.
1348 *
1347 *
1349 * Provides normalized keyboard and focusing code for Container widgets.
1348 * Provides normalized keyboard and focusing code for Container widgets.
1350 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1349 * To use this mixin, call connectKeyNavHandlers() in postCreate().
1351 * Also, child widgets must implement a focus() method.
1350 * Also, child widgets must implement a focus() method.
1352 */
1351 */
1353 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1352 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
1354 /**
1353 /**
1355 * Deprecated. You can call this in postCreate() to attach the keyboard handlers to the container, but the preferred method is to override _onLeftArrow() and _onRightArrow(), or _onUpArrow() and _onDownArrow(), to call focusPrev() and focusNext().
1354 * Deprecated. You can call this in postCreate() to attach the keyboard handlers to the container, but the preferred method is to override _onLeftArrow() and _onRightArrow(), or _onUpArrow() and _onDownArrow(), to call focusPrev() and focusNext().
1356 *
1355 *
1357 * @param prevKeyCodes Key codes for navigating to the previous child.
1356 * @param prevKeyCodes Key codes for navigating to the previous child.
1358 * @param nextKeyCodes Key codes for navigating to the next child.
1357 * @param nextKeyCodes Key codes for navigating to the next child.
1359 */
1358 */
1360 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1359 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
1361
1360
1362 /**
1361 /**
1363 * @deprecated
1362 * @deprecated
1364 */
1363 */
1365 startupKeyNavChildren(): void;
1364 startupKeyNavChildren(): void;
1366
1365
1367 /**
1366 /**
1368 * Setup for each child widget.
1367 * Setup for each child widget.
1369 *
1368 *
1370 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1369 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
1371 *
1370 *
1372 * Note: if you add children by a different method than addChild(), then need to call this manually or at least make sure the child's tabIndex is -1.
1371 * Note: if you add children by a different method than addChild(), then need to call this manually or at least make sure the child's tabIndex is -1.
1373 *
1372 *
1374 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1373 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
1375 */
1374 */
1376 _startupChild(widget: _WidgetBase): void;
1375 _startupChild(widget: _WidgetBase): void;
1377
1376
1378 /**
1377 /**
1379 * Returns the first child.
1378 * Returns the first child.
1380 */
1379 */
1381 _getFirst(): _Widget | null;
1380 _getFirst(): _Widget | null;
1382
1381
1383 /**
1382 /**
1384 * Returns the last descendant.
1383 * Returns the last descendant.
1385 */
1384 */
1386 _getLast(): _Widget | null;
1385 _getLast(): _Widget | null;
1387
1386
1388 /**
1387 /**
1389 * Focus the next widget
1388 * Focus the next widget
1390 */
1389 */
1391 focusNext(): void;
1390 focusNext(): void;
1392
1391
1393 /**
1392 /**
1394 * Focus the last focusable node in the previous widget
1393 * Focus the last focusable node in the previous widget
1395 *
1394 *
1396 * (ex: go to the ComboButton icon section rather than button section)
1395 * (ex: go to the ComboButton icon section rather than button section)
1397 */
1396 */
1398 focusPrev(): void;
1397 focusPrev(): void;
1399
1398
1400 /**
1399 /**
1401 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1400 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
1402 *
1401 *
1403 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1402 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
1404 */
1403 */
1405 childSelector(node: Element | Node): boolean | void | any;
1404 childSelector(node: Element | Node): boolean | void | any;
1406 }
1405 }
1407
1406
1408 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1407 interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
1409
1408
1410 /* dijit/_MenuBase */
1409 /* dijit/_MenuBase */
1411
1410
1412 /**
1411 /**
1413 * Abstract base class for Menu and MenuBar.
1412 * Abstract base class for Menu and MenuBar.
1414 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1413 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
1415 */
1414 */
1416 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1415 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
1417 selected: MenuItem | null;
1416 selected: MenuItem | null;
1418
1417
1419 _setSelectedAttr(item?: MenuItem | null): void;
1418 _setSelectedAttr(item?: MenuItem | null): void;
1420
1419
1421 /**
1420 /**
1422 * This Menu has been clicked (mouse or via space/arrow key) or opened as a submenu, so mere mouseover will open submenus. Focusing a menu via TAB does NOT automatically make it active since TAB is a navigation operation and not a selection one.
1421 * This Menu has been clicked (mouse or via space/arrow key) or opened as a submenu, so mere mouseover will open submenus. Focusing a menu via TAB does NOT automatically make it active since TAB is a navigation operation and not a selection one.
1423 *
1422 *
1424 * For Windows apps, pressing the ALT key focuses the menubar menus (similar to TAB navigation) but the menu is not active (ie no dropdown) until an item is clicked.
1423 * For Windows apps, pressing the ALT key focuses the menubar menus (similar to TAB navigation) but the menu is not active (ie no dropdown) until an item is clicked.
1425 */
1424 */
1426 activated: boolean;
1425 activated: boolean;
1427
1426
1428 _setActivatedAttr(val: boolean): void;
1427 _setActivatedAttr(val: boolean): void;
1429
1428
1430 /**
1429 /**
1431 * pointer to menu that displayed me
1430 * pointer to menu that displayed me
1432 */
1431 */
1433 parentMenu: _Widget | null;
1432 parentMenu: _Widget | null;
1434
1433
1435 /**
1434 /**
1436 * After a menu has been activated (by clicking on it etc.), number of milliseconds before hovering (without clicking) another MenuItem causes that MenuItem's popup to automatically open.
1435 * After a menu has been activated (by clicking on it etc.), number of milliseconds before hovering (without clicking) another MenuItem causes that MenuItem's popup to automatically open.
1437 */
1436 */
1438 popupDelay: number;
1437 popupDelay: number;
1439
1438
1440 /**
1439 /**
1441 * For a passive (unclicked) Menu, number of milliseconds before hovering (without clicking) will cause the popup to open. Default is Infinity, meaning you need to click the menu to open it.
1440 * For a passive (unclicked) Menu, number of milliseconds before hovering (without clicking) will cause the popup to open. Default is Infinity, meaning you need to click the menu to open it.
1442 */
1441 */
1443 passivePopupDelay: number;
1442 passivePopupDelay: number;
1444
1443
1445 /**
1444 /**
1446 * A toggle to control whether or not a Menu gets focused when opened as a drop down from a MenuBar or DropDownButton/ComboButton. Note though that it always get focused when opened via the keyboard.
1445 * A toggle to control whether or not a Menu gets focused when opened as a drop down from a MenuBar or DropDownButton/ComboButton. Note though that it always get focused when opened via the keyboard.
1447 */
1446 */
1448 autoFocus: boolean;
1447 autoFocus: boolean;
1449
1448
1450 /**
1449 /**
1451 * Selector (passed to on.selector()) used to identify MenuItem child widgets, but exclude inert children like MenuSeparator. If subclass overrides to a string (ex: "> *"), the subclass must require dojo/query.
1450 * Selector (passed to on.selector()) used to identify MenuItem child widgets, but exclude inert children like MenuSeparator. If subclass overrides to a string (ex: "> *"), the subclass must require dojo/query.
1452 */
1451 */
1453 childSelector(node: Element | Node): boolean | void | Function;
1452 childSelector(node: Element | Node): boolean | void | Function;
1454
1453
1455 /**
1454 /**
1456 * Attach point for notification about when a menu item has been executed. This is an internal mechanism used for Menus to signal to their parent to close them, because they are about to execute the onClick handler. In general developers should not attach to or override this method.
1455 * Attach point for notification about when a menu item has been executed. This is an internal mechanism used for Menus to signal to their parent to close them, because they are about to execute the onClick handler. In general developers should not attach to or override this method.
1457 */
1456 */
1458 onExecute(): void;
1457 onExecute(): void;
1459
1458
1460 /**
1459 /**
1461 * Attach point for notification about when the user cancels the current menu
1460 * Attach point for notification about when the user cancels the current menu
1462 * This is an internal mechanism used for Menus to signal to their parent to close them. In general developers should not attach to or override this method.
1461 * This is an internal mechanism used for Menus to signal to their parent to close them. In general developers should not attach to or override this method.
1463 */
1462 */
1464 onCancel(): void;
1463 onCancel(): void;
1465
1464
1466 /**
1465 /**
1467 * This handles the right arrow key (left arrow key on RTL systems), which will either open a submenu, or move to the next item in the ancestor MenuBar
1466 * This handles the right arrow key (left arrow key on RTL systems), which will either open a submenu, or move to the next item in the ancestor MenuBar
1468 */
1467 */
1469 _moveToPopup(evt: Event): void;
1468 _moveToPopup(evt: Event): void;
1470
1469
1471 /**
1470 /**
1472 * This handler is called when the mouse moves over the popup.
1471 * This handler is called when the mouse moves over the popup.
1473 */
1472 */
1474 _onPopupHover(evt?: MouseEvent): void;
1473 _onPopupHover(evt?: MouseEvent): void;
1475
1474
1476 /**
1475 /**
1477 * Called when cursor is over a MenuItem.
1476 * Called when cursor is over a MenuItem.
1478 */
1477 */
1479 onItemHover(item: MenuItem): void;
1478 onItemHover(item: MenuItem): void;
1480
1479
1481 /**
1480 /**
1482 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1481 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
1483 */
1482 */
1484 _onChildDeselect(item: MenuItem): void;
1483 _onChildDeselect(item: MenuItem): void;
1485
1484
1486 /**
1485 /**
1487 * Callback fires when mouse exits a MenuItem
1486 * Callback fires when mouse exits a MenuItem
1488 */
1487 */
1489 onItemUnhover(item: MenuItem): void;
1488 onItemUnhover(item: MenuItem): void;
1490
1489
1491 /**
1490 /**
1492 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1491 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
1493 */
1492 */
1494 _stopPopupTimer(): void;
1493 _stopPopupTimer(): void;
1495
1494
1496 /**
1495 /**
1497 * Cancels the pending-close timer because the close has been preempted
1496 * Cancels the pending-close timer because the close has been preempted
1498 */
1497 */
1499 _stopPendingCloseTimer(): void;
1498 _stopPendingCloseTimer(): void;
1500
1499
1501 /**
1500 /**
1502 * Returns the top menu in this chain of Menus
1501 * Returns the top menu in this chain of Menus
1503 */
1502 */
1504 _getTopMenu(): void;
1503 _getTopMenu(): void;
1505
1504
1506 /**
1505 /**
1507 * Handle clicks on an item.
1506 * Handle clicks on an item.
1508 */
1507 */
1509 onItemClick(item: _WidgetBase, evt: Event): void;
1508 onItemClick(item: _WidgetBase, evt: Event): void;
1510
1509
1511 /**
1510 /**
1512 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1511 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
1513 */
1512 */
1514 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1513 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
1515
1514
1516 /**
1515 /**
1517 * Callback when this menu is opened.
1516 * Callback when this menu is opened.
1518 * This is called by the popup manager as notification that the menu was opened.
1517 * This is called by the popup manager as notification that the menu was opened.
1519 */
1518 */
1520 onOpen(evt?: Event): void;
1519 onOpen(evt?: Event): void;
1521
1520
1522 /**
1521 /**
1523 * Callback when this menu is closed.
1522 * Callback when this menu is closed.
1524 * This is called by the popup manager as notification that the menu was closed.
1523 * This is called by the popup manager as notification that the menu was closed.
1525 */
1524 */
1526 onClose(): boolean;
1525 onClose(): boolean;
1527
1526
1528 /**
1527 /**
1529 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1528 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
1530 */
1529 */
1531 _closeChild(): void;
1530 _closeChild(): void;
1532 /**
1531 /**
1533 * Called when child of this Menu gets focus from:
1532 * Called when child of this Menu gets focus from:
1534 *
1533 *
1535 * 1. clicking it
1534 * 1. clicking it
1536 * 2. tabbing into it
1535 * 2. tabbing into it
1537 * 3. being opened by a parent menu.
1536 * 3. being opened by a parent menu.
1538 *
1537 *
1539 * This is not called just from mouse hover.
1538 * This is not called just from mouse hover.
1540 */
1539 */
1541 _onItemFocus(item: MenuItem): void;
1540 _onItemFocus(item: MenuItem): void;
1542
1541
1543 /**
1542 /**
1544 * Called when focus is moved away from this Menu and it's submenus.
1543 * Called when focus is moved away from this Menu and it's submenus.
1545 */
1544 */
1546 _onBlur(): void;
1545 _onBlur(): void;
1547
1546
1548 /**
1547 /**
1549 * Called when the user is done with this menu. Closes hierarchy of menus.
1548 * Called when the user is done with this menu. Closes hierarchy of menus.
1550 */
1549 */
1551 _cleanUp(clearSelectedItem?: boolean): void;
1550 _cleanUp(clearSelectedItem?: boolean): void;
1552 }
1551 }
1553
1552
1554 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1553 interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
1555
1554
1556 /* dijit/Dialog */
1555 /* dijit/Dialog */
1557
1556
1558 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1557 interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
1559 templateString: string;
1558 templateString: string;
1560 baseClass: string;
1559 baseClass: string;
1561 cssStateNodes: CSSStateNodes;
1560 cssStateNodes: CSSStateNodes;
1562
1561
1563 /**
1562 /**
1564 * True if Dialog is currently displayed on screen.
1563 * True if Dialog is currently displayed on screen.
1565 */
1564 */
1566 open: boolean;
1565 open: boolean;
1567
1566
1568 /**
1567 /**
1569 * The time in milliseconds it takes the dialog to fade in and out
1568 * The time in milliseconds it takes the dialog to fade in and out
1570 */
1569 */
1571 duration: number;
1570 duration: number;
1572
1571
1573 /**
1572 /**
1574 * A Toggle to modify the default focus behavior of a Dialog, which
1573 * A Toggle to modify the default focus behavior of a Dialog, which
1575 * is to re-focus the element which had focus before being opened.
1574 * is to re-focus the element which had focus before being opened.
1576 * False will disable refocusing. Default: true
1575 * False will disable refocusing. Default: true
1577 */
1576 */
1578 refocus: boolean;
1577 refocus: boolean;
1579
1578
1580 /**
1579 /**
1581 * A Toggle to modify the default focus behavior of a Dialog, which
1580 * A Toggle to modify the default focus behavior of a Dialog, which
1582 * is to focus on the first dialog element after opening the dialog.
1581 * is to focus on the first dialog element after opening the dialog.
1583 * False will disable autofocusing. Default: true
1582 * False will disable autofocusing. Default: true
1584 */
1583 */
1585 autofocus: boolean;
1584 autofocus: boolean;
1586
1585
1587 /**
1586 /**
1588 * Toggles the movable aspect of the Dialog. If true, Dialog
1587 * Toggles the movable aspect of the Dialog. If true, Dialog
1589 * can be dragged by it's title. If false it will remain centered
1588 * can be dragged by it's title. If false it will remain centered
1590 * in the viewport.
1589 * in the viewport.
1591 */
1590 */
1592 draggable: boolean;
1591 draggable: boolean;
1593
1592
1594 /**
1593 /**
1595 * Maximum size to allow the dialog to expand to, relative to viewport size
1594 * Maximum size to allow the dialog to expand to, relative to viewport size
1596 */
1595 */
1597 maxRatio: number;
1596 maxRatio: number;
1598
1597
1599 /**
1598 /**
1600 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1599 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
1601 */
1600 */
1602 closable: boolean;
1601 closable: boolean;
1603 postMixInProperties(): void;
1602 postMixInProperties(): void;
1604 postCreate(): void;
1603 postCreate(): void;
1605
1604
1606 /**
1605 /**
1607 * Called when data has been loaded from an href.
1606 * Called when data has been loaded from an href.
1608 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1607 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
1609 * but should *not* be overridden.
1608 * but should *not* be overridden.
1610 */
1609 */
1611 onLoad(data?: any): void;
1610 onLoad(data?: any): void;
1612
1611
1613 focus(): void;
1612 focus(): void;
1614
1613
1615 /* Not entirely sure of the resolution type of these promises */
1614 /* Not entirely sure of the resolution type of these promises */
1616
1615
1617 /**
1616 /**
1618 * Display the dialog
1617 * Display the dialog
1619 */
1618 */
1620 show(): dojo.promise.Promise<any>;
1619 show(): dojo.promise.Promise<any>;
1621
1620
1622 /**
1621 /**
1623 * Hide the dialog
1622 * Hide the dialog
1624 */
1623 */
1625 hide(): dojo.promise.Promise<any>;
1624 hide(): dojo.promise.Promise<any>;
1626
1625
1627 /**
1626 /**
1628 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1627 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
1629 * necessary to keep it visible.
1628 * necessary to keep it visible.
1630 *
1629 *
1631 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1630 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
1632 * size of the dialog.
1631 * size of the dialog.
1633 */
1632 */
1634 resize(dim?: dojo.DomGeometryWidthHeight): void;
1633 resize(dim?: dojo.DomGeometryWidthHeight): void;
1635
1634
1636 destroy(preserveDom?: boolean): void;
1635 destroy(preserveDom?: boolean): void;
1637 }
1636 }
1638
1637
1639 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1638 interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
1640
1639
1641 interface Dialog extends layout.ContentPane, _DialogBase {
1640 interface Dialog extends layout.ContentPane, _DialogBase {
1642 /* overrides conflicting methods */
1641 /* overrides conflicting methods */
1643 resize(dim?: dojo.DomGeometryWidthHeight): void;
1642 resize(dim?: dojo.DomGeometryWidthHeight): void;
1644 }
1643 }
1645
1644
1646 interface DialogLevelManager {
1645 interface DialogLevelManager {
1647 _beginZIndex: number;
1646 _beginZIndex: number;
1648
1647
1649 /**
1648 /**
1650 * Call right before fade-in animation for new dialog.
1649 * Call right before fade-in animation for new dialog.
1651 *
1650 *
1652 * Saves current focus, displays/adjusts underlay for new dialog,
1651 * Saves current focus, displays/adjusts underlay for new dialog,
1653 * and sets the z-index of the dialog itself.
1652 * and sets the z-index of the dialog itself.
1654 *
1653 *
1655 * New dialog will be displayed on top of all currently displayed dialogs.
1654 * New dialog will be displayed on top of all currently displayed dialogs.
1656 * Caller is responsible for setting focus in new dialog after the fade-in
1655 * Caller is responsible for setting focus in new dialog after the fade-in
1657 * animation completes.
1656 * animation completes.
1658 */
1657 */
1659 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1658 show(dialog: _WidgetBase, underlayAttrs: Object): void;
1660
1659
1661 /**
1660 /**
1662 * Called when the specified dialog is hidden/destroyed, after the fade-out
1661 * Called when the specified dialog is hidden/destroyed, after the fade-out
1663 * animation ends, in order to reset page focus, fix the underlay, etc.
1662 * animation ends, in order to reset page focus, fix the underlay, etc.
1664 * If the specified dialog isn't open then does nothing.
1663 * If the specified dialog isn't open then does nothing.
1665 *
1664 *
1666 * Caller is responsible for either setting display:none on the dialog domNode,
1665 * Caller is responsible for either setting display:none on the dialog domNode,
1667 * or calling dijit/popup.hide(), or removing it from the page DOM.
1666 * or calling dijit/popup.hide(), or removing it from the page DOM.
1668 */
1667 */
1669 hide(dialog: _WidgetBase): void;
1668 hide(dialog: _WidgetBase): void;
1670
1669
1671 /**
1670 /**
1672 * Returns true if specified Dialog is the top in the task
1671 * Returns true if specified Dialog is the top in the task
1673 */
1672 */
1674 isTop(dialog: _WidgetBase): boolean;
1673 isTop(dialog: _WidgetBase): boolean;
1675 }
1674 }
1676
1675
1677 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1676 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
1678 /**
1677 /**
1679 * for monkey patching and dojox/widget/DialogSimple
1678 * for monkey patching and dojox/widget/DialogSimple
1680 */
1679 */
1681 _DialogBase: _DialogBaseConstructor;
1680 _DialogBase: _DialogBaseConstructor;
1682 _DialogLevelManager: DialogLevelManager;
1681 _DialogLevelManager: DialogLevelManager;
1683 _dialogStack: {
1682 _dialogStack: {
1684 dialog: _WidgetBase,
1683 dialog: _WidgetBase,
1685 focus: any,
1684 focus: any,
1686 underlayAttrs: any
1685 underlayAttrs: any
1687 }[];
1686 }[];
1688 }
1687 }
1689
1688
1690 /* dijit/ConfirmDialog */
1689 /* dijit/ConfirmDialog */
1691
1690
1692 interface ConfirmDialog extends _ConfirmDialogMixin { }
1691 interface ConfirmDialog extends _ConfirmDialogMixin { }
1693
1692
1694 interface ConfirmDialogConstructor extends DialogConstructor { }
1693 interface ConfirmDialogConstructor extends DialogConstructor { }
1695
1694
1696 /* dijit/DropDownMenu */
1695 /* dijit/DropDownMenu */
1697
1696
1698 /**
1697 /**
1699 * A menu, without features for context menu (Meaning, drop down menu)
1698 * A menu, without features for context menu (Meaning, drop down menu)
1700 */
1699 */
1701 interface DropDownMenu extends _MenuBase { }
1700 interface DropDownMenu extends _MenuBase { }
1702
1701
1703 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1702 interface DropDownMenuConstructor extends _WidgetBaseConstructor<DropDownMenu> { }
1704
1703
1705 /* dijit/Fieldset */
1704 /* dijit/Fieldset */
1706
1705
1707 /**
1706 /**
1708 * An accessible fieldset that can be expanded or collapsed via
1707 * An accessible fieldset that can be expanded or collapsed via
1709 * its legend. Fieldset extends `dijit.TitlePane`.
1708 * its legend. Fieldset extends `dijit.TitlePane`.
1710 */
1709 */
1711 interface Fieldset extends TitlePane {
1710 interface Fieldset extends TitlePane {
1712 open: boolean;
1711 open: boolean;
1713 }
1712 }
1714
1713
1715 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1714 interface FieldsetConstructor extends _WidgetBaseConstructor<Fieldset> { }
1716
1715
1717 /* dijit/Menu */
1716 /* dijit/Menu */
1718
1717
1719 /**
1718 /**
1720 * A context menu you can assign to multiple elements
1719 * A context menu you can assign to multiple elements
1721 */
1720 */
1722 interface Menu extends dijit.DropDownMenu {
1721 interface Menu extends dijit.DropDownMenu {
1723 /**
1722 /**
1724 * Array of dom node ids of nodes to attach to.
1723 * Array of dom node ids of nodes to attach to.
1725 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1724 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
1726 */
1725 */
1727 targetNodeIds: string[];
1726 targetNodeIds: string[];
1728
1727
1729 /**
1728 /**
1730 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1729 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
1731 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1730 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
1732 * a range of rows in a table, tree, etc.
1731 * a range of rows in a table, tree, etc.
1733 *
1732 *
1734 * The application must require() an appropriate level of dojo/query to handle the selector.
1733 * The application must require() an appropriate level of dojo/query to handle the selector.
1735 */
1734 */
1736 selector: string;
1735 selector: string;
1737
1736
1738 /**
1737 /**
1739 * If true, right clicking anywhere on the window will cause this context menu to open.
1738 * If true, right clicking anywhere on the window will cause this context menu to open.
1740 * If false, must specify targetNodeIds.
1739 * If false, must specify targetNodeIds.
1741 */
1740 */
1742 contextMenuForWindow: boolean;
1741 contextMenuForWindow: boolean;
1743
1742
1744 /**
1743 /**
1745 * If true, menu will open on left click instead of right click, similar to a file menu.
1744 * If true, menu will open on left click instead of right click, similar to a file menu.
1746 */
1745 */
1747 leftClickToOpen: boolean;
1746 leftClickToOpen: boolean;
1748
1747
1749 /**
1748 /**
1750 * When this menu closes, re-focus the element which had focus before it was opened.
1749 * When this menu closes, re-focus the element which had focus before it was opened.
1751 */
1750 */
1752 refocus: boolean;
1751 refocus: boolean;
1753
1752
1754 /**
1753 /**
1755 * Attach menu to given node
1754 * Attach menu to given node
1756 */
1755 */
1757 bindDomNode(node: string | Node): void;
1756 bindDomNode(node: string | Node): void;
1758
1757
1759 /**
1758 /**
1760 * Detach menu from given node
1759 * Detach menu from given node
1761 */
1760 */
1762 unBindDomNode(nodeName: string | Node): void;
1761 unBindDomNode(nodeName: string | Node): void;
1763 }
1762 }
1764
1763
1765 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1764 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
1766
1765
1767 /* dijit/MenuBar */
1766 /* dijit/MenuBar */
1768 interface MenuBar extends _MenuBase {
1767 interface MenuBar extends _MenuBase {
1769 baseClass: 'dijitMenuBar';
1768 baseClass: 'dijitMenuBar';
1770 popupDelay: number;
1769 popupDelay: number;
1771 _isMenuBar: true;
1770 _isMenuBar: true;
1772 _orient: string[];
1771 _orient: string[];
1773 _moveToPopup(evt: Event): void;
1772 _moveToPopup(evt: Event): void;
1774 focusChild(item: _WidgetBase): void;
1773 focusChild(item: _WidgetBase): void;
1775 _onChildDeselect(item: _WidgetBase): void;
1774 _onChildDeselect(item: _WidgetBase): void;
1776 _onLeftArrow(): void;
1775 _onLeftArrow(): void;
1777 _onRightArrow(): void;
1776 _onRightArrow(): void;
1778 _onDownArrow(): void;
1777 _onDownArrow(): void;
1779 _onUpArrow(): void;
1778 _onUpArrow(): void;
1780 onItemClick(item: _WidgetBase, evt: Event): void;
1779 onItemClick(item: _WidgetBase, evt: Event): void;
1781 }
1780 }
1782
1781
1783 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1782 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
1784
1783
1785 /* dijit/MenuBarItem */
1784 /* dijit/MenuBarItem */
1786 interface MenuBarItem extends MenuItem { }
1785 interface MenuBarItem extends MenuItem { }
1787
1786
1788 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1787 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
1789
1788
1790 /* dijit/MenuItem */
1789 /* dijit/MenuItem */
1791 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1790 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
1792 /**
1791 /**
1793 * Text for the accelerator (shortcut) key combination, a control, alt, etc. modified keystroke meant to execute the menu item regardless of where the focus is on the page.
1792 * Text for the accelerator (shortcut) key combination, a control, alt, etc. modified keystroke meant to execute the menu item regardless of where the focus is on the page.
1794 *
1793 *
1795 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1794 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
1796 */
1795 */
1797 accelKey: string;
1796 accelKey: string;
1798
1797
1799 /**
1798 /**
1800 * If true, the menu item is disabled.
1799 * If true, the menu item is disabled.
1801 * If false, the menu item is enabled.
1800 * If false, the menu item is enabled.
1802 */
1801 */
1803 disabled: boolean;
1802 disabled: boolean;
1804
1803
1805 /** Menu text as HTML */
1804 /** Menu text as HTML */
1806 label: string;
1805 label: string;
1807
1806
1808 /**
1807 /**
1809 * Class to apply to DOMNode to make it display an icon.
1808 * Class to apply to DOMNode to make it display an icon.
1810 */
1809 */
1811 iconClass: string;
1810 iconClass: string;
1812
1811
1813 /**
1812 /**
1814 * Hook for attr('accelKey', ...) to work.
1813 * Hook for attr('accelKey', ...) to work.
1815 * Set accelKey on this menu item.
1814 * Set accelKey on this menu item.
1816 */
1815 */
1817 _setAccelKeyAttr(value: string): void;
1816 _setAccelKeyAttr(value: string): void;
1818
1817
1819 /**
1818 /**
1820 * Hook for attr('disabled', ...) to work.
1819 * Hook for attr('disabled', ...) to work.
1821 * Enable or disable this menu item.
1820 * Enable or disable this menu item.
1822 */
1821 */
1823 _setDisabledAttr(value: boolean): void;
1822 _setDisabledAttr(value: boolean): void;
1824
1823
1825 _setLabelAttr(val: string): void;
1824 _setLabelAttr(val: string): void;
1826 _setIconClassAttr(val: string): void;
1825 _setIconClassAttr(val: string): void;
1827
1826
1828 _fillContent(source: Element): void;
1827 _fillContent(source: Element): void;
1829
1828
1830 /**
1829 /**
1831 * Indicate that this node is the currently selected one
1830 * Indicate that this node is the currently selected one
1832 */
1831 */
1833 _setSelected(selected: boolean): void;
1832 _setSelected(selected: boolean): void;
1834
1833
1835 focus(): void;
1834 focus(): void;
1836
1835
1837 /**
1836 /**
1838 * Deprecated.
1837 * Deprecated.
1839 * Use set('disabled', bool) instead.
1838 * Use set('disabled', bool) instead.
1840 */
1839 */
1841 setDisabled(disabled: boolean): void;
1840 setDisabled(disabled: boolean): void;
1842
1841
1843 /**
1842 /**
1844 * Deprecated.
1843 * Deprecated.
1845 * Use set('label', ...) instead.
1844 * Use set('label', ...) instead.
1846 */
1845 */
1847 setLabel(content: string): void;
1846 setLabel(content: string): void;
1848 }
1847 }
1849
1848
1850 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1849 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
1851
1850
1852 /* dijit/MenuSeparator */
1851 /* dijit/MenuSeparator */
1853 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1852 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
1854
1853
1855 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1854 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
1856
1855
1857 /* dijit/place */
1856 /* dijit/place */
1858
1857
1859 interface PlacePosition {
1858 interface PlacePosition {
1860 x: number;
1859 x: number;
1861 y: number;
1860 y: number;
1862 }
1861 }
1863
1862
1864 interface PlaceWidthHeight {
1863 interface PlaceWidthHeight {
1865 w: number;
1864 w: number;
1866 h: number;
1865 h: number;
1867 }
1866 }
1868
1867
1869 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1868 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
1870
1869
1871 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1870 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
1872
1871
1873 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1872 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
1874
1873
1875 interface PlaceChoice {
1874 interface PlaceChoice {
1876 corner: PlaceCorner;
1875 corner: PlaceCorner;
1877 pos: PlacePosition;
1876 pos: PlacePosition;
1878 aroundCorner?: PlaceCorner;
1877 aroundCorner?: PlaceCorner;
1879 }
1878 }
1880
1879
1881 interface PlaceLocation extends PlaceRectangle {
1880 interface PlaceLocation extends PlaceRectangle {
1882 corner: PlaceCorner;
1881 corner: PlaceCorner;
1883 aroundCorner: PlaceCorner;
1882 aroundCorner: PlaceCorner;
1884 overflow: number;
1883 overflow: number;
1885 spaceAvailable: PlaceWidthHeight;
1884 spaceAvailable: PlaceWidthHeight;
1886 }
1885 }
1887
1886
1888 interface LayoutNodeFunction {
1887 interface LayoutNodeFunction {
1889 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1888 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
1890 }
1889 }
1891
1890
1892 interface Place {
1891 interface Place {
1893 /**
1892 /**
1894 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1893 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
1895 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1894 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
1896 * where node is fully visible, or the corner where it's most visible.
1895 * where node is fully visible, or the corner where it's most visible.
1897 *
1896 *
1898 * Node is assumed to be absolutely or relatively positioned.
1897 * Node is assumed to be absolutely or relatively positioned.
1899 */
1898 */
1900 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1899 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
1901
1900
1902 /**
1901 /**
1903 * Position node adjacent or kitty-corner to anchor
1902 * Position node adjacent or kitty-corner to anchor
1904 * such that it's fully visible in viewport.
1903 * such that it's fully visible in viewport.
1905 */
1904 */
1906 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1905 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
1907 }
1906 }
1908
1907
1909 /* dijit/popup */
1908 /* dijit/popup */
1910
1909
1911 interface PopupOpenArgs {
1910 interface PopupOpenArgs {
1912 /**
1911 /**
1913 * widget to display
1912 * widget to display
1914 */
1913 */
1915 popup?: _WidgetBase;
1914 popup?: _WidgetBase;
1916
1915
1917 /**
1916 /**
1918 * the button etc. that is displaying this popup
1917 * the button etc. that is displaying this popup
1919 */
1918 */
1920 parent?: _WidgetBase;
1919 parent?: _WidgetBase;
1921
1920
1922 /**
1921 /**
1923 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1922 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
1924 */
1923 */
1925 around?: HTMLElement;
1924 around?: HTMLElement;
1926
1925
1927 /**
1926 /**
1928 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1927 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1929 */
1928 */
1930 x?: number;
1929 x?: number;
1931
1930
1932 /**
1931 /**
1933 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1932 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
1934 */
1933 */
1935 y?: number;
1934 y?: number;
1936
1935
1937 /**
1936 /**
1938 * When the around parameter is specified, orient should be a list of positions to try
1937 * When the around parameter is specified, orient should be a list of positions to try
1939 */
1938 */
1940 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1939 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
1941
1940
1942 /**
1941 /**
1943 * callback when user has canceled the popup by:
1942 * callback when user has canceled the popup by:
1944 *
1943 *
1945 * 1. hitting ESC or
1944 * 1. hitting ESC or
1946 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1945 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
1947 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1946 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
1948 */
1947 */
1949 onCancel?: () => void;
1948 onCancel?: () => void;
1950
1949
1951 /**
1950 /**
1952 * callback whenever this popup is closed
1951 * callback whenever this popup is closed
1953 */
1952 */
1954 onClose?: () => void;
1953 onClose?: () => void;
1955
1954
1956 /**
1955 /**
1957 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1956 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
1958 */
1957 */
1959 onExecute?: () => void;
1958 onExecute?: () => void;
1960
1959
1961 /**
1960 /**
1962 * adding a buffer around the opening position. This is only useful when around is not set.
1961 * adding a buffer around the opening position. This is only useful when around is not set.
1963 */
1962 */
1964 padding?: PlacePosition;
1963 padding?: PlacePosition;
1965
1964
1966 /**
1965 /**
1967 * The max height for the popup. Any popup taller than this will have scrollbars.
1966 * The max height for the popup. Any popup taller than this will have scrollbars.
1968 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1967 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
1969 * above or below the aroundNode or specified x/y position.
1968 * above or below the aroundNode or specified x/y position.
1970 */
1969 */
1971 maxHeight?: number;
1970 maxHeight?: number;
1972 }
1971 }
1973
1972
1974 interface PopupManager {
1973 interface PopupManager {
1975 /**
1974 /**
1976 * Stack of currently popped up widgets.
1975 * Stack of currently popped up widgets.
1977 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1976 * (someone opened _stack[0], and then it opened _stack[1], etc.)
1978 */
1977 */
1979 _stack: _WidgetBase[];
1978 _stack: _WidgetBase[];
1980
1979
1981 /**
1980 /**
1982 * Z-index of the first popup. (If first popup opens other
1981 * Z-index of the first popup. (If first popup opens other
1983 * popups they get a higher z-index.)
1982 * popups they get a higher z-index.)
1984 */
1983 */
1985 _beginZIndex: number;
1984 _beginZIndex: number;
1986
1985
1987 _idGen: number;
1986 _idGen: number;
1988
1987
1989 /**
1988 /**
1990 * If screen has been scrolled, reposition all the popups in the stack.
1989 * If screen has been scrolled, reposition all the popups in the stack.
1991 * Then set timer to check again later.
1990 * Then set timer to check again later.
1992 */
1991 */
1993 _repositionAll(): void;
1992 _repositionAll(): void;
1994
1993
1995 /**
1994 /**
1996 * Initialization for widgets that will be used as popups.
1995 * Initialization for widgets that will be used as popups.
1997 * Puts widget inside a wrapper DIV (if not already in one),
1996 * Puts widget inside a wrapper DIV (if not already in one),
1998 * and returns pointer to that wrapper DIV.
1997 * and returns pointer to that wrapper DIV.
1999 */
1998 */
2000 _createWrapper(widget: _WidgetBase): HTMLDivElement;
1999 _createWrapper(widget: _WidgetBase): HTMLDivElement;
2001
2000
2002 /**
2001 /**
2003 * Moves the popup widget off-screen.
2002 * Moves the popup widget off-screen.
2004 * Do not use this method to hide popups when not in use, because
2003 * Do not use this method to hide popups when not in use, because
2005 * that will create an accessibility issue: the offscreen popup is
2004 * that will create an accessibility issue: the offscreen popup is
2006 * still in the tabbing order.
2005 * still in the tabbing order.
2007 */
2006 */
2008 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2007 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
2009
2008
2010 /**
2009 /**
2011 * Hide this popup widget (until it is ready to be shown).
2010 * Hide this popup widget (until it is ready to be shown).
2012 * Initialization for widgets that will be used as popups
2011 * Initialization for widgets that will be used as popups
2013 *
2012 *
2014 * Also puts widget inside a wrapper DIV (if not already in one)
2013 * Also puts widget inside a wrapper DIV (if not already in one)
2015 *
2014 *
2016 * If popup widget needs to layout it should
2015 * If popup widget needs to layout it should
2017 * do so when it is made visible, and popup._onShow() is called.
2016 * do so when it is made visible, and popup._onShow() is called.
2018 */
2017 */
2019 hide(widget: _WidgetBase): void;
2018 hide(widget: _WidgetBase): void;
2020
2019
2021 /**
2020 /**
2022 * Compute the closest ancestor popup that's *not* a child of another popup.
2021 * Compute the closest ancestor popup that's *not* a child of another popup.
2023 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2022 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
2024 */
2023 */
2025 getTopPopup(): _WidgetBase;
2024 getTopPopup(): _WidgetBase;
2026
2025
2027 /**
2026 /**
2028 * Popup the widget at the specified position
2027 * Popup the widget at the specified position
2029 */
2028 */
2030 open(args: PopupOpenArgs): PlaceLocation;
2029 open(args: PopupOpenArgs): PlaceLocation;
2031
2030
2032 /**
2031 /**
2033 * Close specified popup and any popups that it parented.
2032 * Close specified popup and any popups that it parented.
2034 * If no popup is specified, closes all popups.
2033 * If no popup is specified, closes all popups.
2035 */
2034 */
2036 close(popup?: _WidgetBase): void;
2035 close(popup?: _WidgetBase): void;
2037 }
2036 }
2038
2037
2039 /* dijit/PopupMenuBarItem */
2038 /* dijit/PopupMenuBarItem */
2040
2039
2041 interface PopupMenuBarItem extends PopupMenuItem { }
2040 interface PopupMenuBarItem extends PopupMenuItem { }
2042
2041
2043 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2042 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
2044
2043
2045 /** dijit/PopupMenuItem */
2044 /** dijit/PopupMenuItem */
2046
2045
2047 /**
2046 /**
2048 * An item in a Menu that spawn a drop down (usually a drop down menu)
2047 * An item in a Menu that spawn a drop down (usually a drop down menu)
2049 */
2048 */
2050 interface PopupMenuItem extends MenuItem {
2049 interface PopupMenuItem extends MenuItem {
2051 /**
2050 /**
2052 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2051 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
2053 *
2052 *
2054 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2053 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
2055 * The first part holds the menu item text and the second part is the popup
2054 * The first part holds the menu item text and the second part is the popup
2056 */
2055 */
2057 _fillContent(source: Element): void;
2056 _fillContent(source: Element): void;
2058
2057
2059 /**
2058 /**
2060 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2059 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
2061 */
2060 */
2062 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2061 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
2063
2062
2064 _closePopup(): void;
2063 _closePopup(): void;
2065 }
2064 }
2066
2065
2067 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2066 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
2068
2067
2069 /* dijit/registry */
2068 /* dijit/registry */
2070
2069
2071 interface Registry {
2070 interface Registry {
2072 /**
2071 /**
2073 * Number of registered widgets
2072 * Number of registered widgets
2074 */
2073 */
2075 length: number;
2074 length: number;
2076
2075
2077 /**
2076 /**
2078 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2077 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
2079 */
2078 */
2080 add(widget: _WidgetBase): void;
2079 add(widget: _WidgetBase): void;
2081
2080
2082 /**
2081 /**
2083 * Remove a widget from the registry. Does not destroy the widget; simply
2082 * Remove a widget from the registry. Does not destroy the widget; simply
2084 * removes the reference.
2083 * removes the reference.
2085 */
2084 */
2086 remove(id: string): void;
2085 remove(id: string): void;
2087
2086
2088 /**
2087 /**
2089 * Find a widget by it's id.
2088 * Find a widget by it's id.
2090 * If passed a widget then just returns the widget.
2089 * If passed a widget then just returns the widget.
2091 */
2090 */
2092 byId(id: string | _WidgetBase): _WidgetBase;
2091 byId(id: string | _WidgetBase): _WidgetBase;
2093
2092
2094 /**
2093 /**
2095 * Returns the widget corresponding to the given DOMNode
2094 * Returns the widget corresponding to the given DOMNode
2096 */
2095 */
2097 byNode(node: Element | Node): _WidgetBase;
2096 byNode(node: Element | Node): _WidgetBase;
2098
2097
2099 /**
2098 /**
2100 * Convert registry into a true Array
2099 * Convert registry into a true Array
2101 */
2100 */
2102 toArray(): _WidgetBase[];
2101 toArray(): _WidgetBase[];
2103
2102
2104 /**
2103 /**
2105 * Generates a unique id for a given widgetType
2104 * Generates a unique id for a given widgetType
2106 */
2105 */
2107 getUniqueId(widgetType: string): string;
2106 getUniqueId(widgetType: string): string;
2108
2107
2109 /**
2108 /**
2110 * Search subtree under root returning widgets found.
2109 * Search subtree under root returning widgets found.
2111 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2110 * Doesn't search for nested widgets (ie, widgets inside other widgets).
2112 */
2111 */
2113 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2112 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
2114
2113
2115 /**
2114 /**
2116 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2115 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
2117 * the node is not contained within the DOM tree of any widget
2116 * the node is not contained within the DOM tree of any widget
2118 */
2117 */
2119 getEnclosingWidget(node: Element | Node): _WidgetBase;
2118 getEnclosingWidget(node: Element | Node): _WidgetBase;
2120 }
2119 }
2121
2120
2122 /* dijit/TitlePane */
2121 /* dijit/TitlePane */
2123
2122
2124 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2123 interface TitlePane extends dijit.layout.ContentPane, _TemplatedMixin, _CssStateMixin {
2125 /**
2124 /**
2126 * Whether pane can be opened or closed by clicking the title bar.
2125 * Whether pane can be opened or closed by clicking the title bar.
2127 */
2126 */
2128 toggleable: boolean;
2127 toggleable: boolean;
2129
2128
2130 /**
2129 /**
2131 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2130 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
2132 */
2131 */
2133 tabIndex: string;
2132 tabIndex: string;
2134
2133
2135 /**
2134 /**
2136 * Time in milliseconds to fade in/fade out
2135 * Time in milliseconds to fade in/fade out
2137 */
2136 */
2138 duration: number;
2137 duration: number;
2139
2138
2140 /**
2139 /**
2141 * Don't change this parameter from the default value.
2140 * Don't change this parameter from the default value.
2142 *
2141 *
2143 * This ContentPane parameter doesn't make sense for TitlePane, since TitlePane is never a child of a layout container, nor should TitlePane try to control the size of an inner widget.
2142 * This ContentPane parameter doesn't make sense for TitlePane, since TitlePane is never a child of a layout container, nor should TitlePane try to control the size of an inner widget.
2144 */
2143 */
2145 doLayout: boolean;
2144 doLayout: boolean;
2146
2145
2147 /**
2146 /**
2148 * Switches between opened and closed state
2147 * Switches between opened and closed state
2149 */
2148 */
2150 toggle(): void;
2149 toggle(): void;
2151
2150
2152 /**
2151 /**
2153 * Set the open/close css state for the TitlePane
2152 * Set the open/close css state for the TitlePane
2154 */
2153 */
2155 _setCss(): void;
2154 _setCss(): void;
2156
2155
2157 /**
2156 /**
2158 * Handler for when user hits a key
2157 * Handler for when user hits a key
2159 */
2158 */
2160 _onTitleKey(e: Event): void;
2159 _onTitleKey(e: Event): void;
2161
2160
2162 /**
2161 /**
2163 * Handler when user clicks the title bar
2162 * Handler when user clicks the title bar
2164 */
2163 */
2165 _onTitleClick(): void;
2164 _onTitleClick(): void;
2166
2165
2167 /**
2166 /**
2168 * Deprecated. Use set('title', ...) instead.
2167 * Deprecated. Use set('title', ...) instead.
2169 */
2168 */
2170 setTitle(): void;
2169 setTitle(): void;
2171 }
2170 }
2172
2171
2173 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2172 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
2174
2173
2175 /* dijit/Toolbar */
2174 /* dijit/Toolbar */
2176
2175
2177 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2176 interface Toolbar extends dijit._Widget, dijit._TemplatedMixin, dijit._KeyNavContainer { }
2178
2177
2179 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2178 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
2180
2179
2181 /* dijit/ToolbarSeparator */
2180 /* dijit/ToolbarSeparator */
2182
2181
2183 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2182 interface ToolbarSeparator extends dijit._Widget, dijit._TemplatedMixin { }
2184
2183
2185 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2184 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
2186
2185
2187 /* dijit/Tooltip */
2186 /* dijit/Tooltip */
2188
2187
2189 interface Tooltip extends _Widget {
2188 interface Tooltip extends _Widget {
2190 /**
2189 /**
2191 * HTML to display in the tooltip.
2190 * HTML to display in the tooltip.
2192 * Specified as innerHTML when creating the widget from markup.
2191 * Specified as innerHTML when creating the widget from markup.
2193 */
2192 */
2194 label: string;
2193 label: string;
2195
2194
2196 /**
2195 /**
2197 * Number of milliseconds to wait after hovering over/focusing on the object, before
2196 * Number of milliseconds to wait after hovering over/focusing on the object, before
2198 * the tooltip is displayed.
2197 * the tooltip is displayed.
2199 */
2198 */
2200 showDelay: number;
2199 showDelay: number;
2201
2200
2202 /**
2201 /**
2203 * Number of milliseconds to wait after unhovering the object, before
2202 * Number of milliseconds to wait after unhovering the object, before
2204 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2203 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
2205 */
2204 */
2206 hideDelay: number;
2205 hideDelay: number;
2207
2206
2208 /**
2207 /**
2209 * Id of domNode(s) to attach the tooltip to.
2208 * Id of domNode(s) to attach the tooltip to.
2210 * When user hovers over specified dom node(s), the tooltip will appear.
2209 * When user hovers over specified dom node(s), the tooltip will appear.
2211 */
2210 */
2212 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2211 connectId: dojo.NodeOrString | dojo.NodeOrString[];
2213
2212
2214 /**
2213 /**
2215 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2214 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
2216 */
2215 */
2217 position: string;
2216 position: string;
2218
2217
2219 /**
2218 /**
2220 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2219 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
2221 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2220 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
2222 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2221 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
2223 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2222 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
2224 *
2223 *
2225 * The application must require() an appropriate level of dojo/query to handle the selector.
2224 * The application must require() an appropriate level of dojo/query to handle the selector.
2226 */
2225 */
2227 selector: string;
2226 selector: string;
2228
2227
2229 /**
2228 /**
2230 * Attach tooltip to specified node if it's not already connected
2229 * Attach tooltip to specified node if it's not already connected
2231 */
2230 */
2232 addTarget(node: dojo.NodeOrString): void;
2231 addTarget(node: dojo.NodeOrString): void;
2233
2232
2234 /**
2233 /**
2235 * Detach tooltip from specified node
2234 * Detach tooltip from specified node
2236 */
2235 */
2237 removeTarget(node: dojo.NodeOrString): void;
2236 removeTarget(node: dojo.NodeOrString): void;
2238
2237
2239 /**
2238 /**
2240 * User overridable function that return the text to display in the tooltip.
2239 * User overridable function that return the text to display in the tooltip.
2241 */
2240 */
2242 getContent(node: Node): Node;
2241 getContent(node: Node): Node;
2243
2242
2244 /**
2243 /**
2245 * Display the tooltip; usually not called directly.
2244 * Display the tooltip; usually not called directly.
2246 */
2245 */
2247 open(target: Node): void;
2246 open(target: Node): void;
2248
2247
2249 /**
2248 /**
2250 * Hide the tooltip or cancel timer for show of tooltip
2249 * Hide the tooltip or cancel timer for show of tooltip
2251 */
2250 */
2252 close(): void;
2251 close(): void;
2253
2252
2254 /**
2253 /**
2255 * Called when the tooltip is shown
2254 * Called when the tooltip is shown
2256 */
2255 */
2257 onShow(): void;
2256 onShow(): void;
2258
2257
2259 /**
2258 /**
2260 * Called when the tooltip is hidden
2259 * Called when the tooltip is hidden
2261 */
2260 */
2262 onHide(): void;
2261 onHide(): void;
2263 }
2262 }
2264
2263
2265 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2264 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
2266 /**
2265 /**
2267 * This variable controls the position of tooltips, if the position is not specified to
2266 * This variable controls the position of tooltips, if the position is not specified to
2268 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2267 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
2269 * possible for `dijit/place.around()`. The recommended values are:
2268 * possible for `dijit/place.around()`. The recommended values are:
2270 *
2269 *
2271 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2270 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
2272 * in the case of RTL scripts like Hebrew and Arabic
2271 * in the case of RTL scripts like Hebrew and Arabic
2273 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2272 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
2274 * in the case of RTL scripts like Hebrew and Arabic
2273 * in the case of RTL scripts like Hebrew and Arabic
2275 * - above-centered: tooltip is centered above anchor node
2274 * - above-centered: tooltip is centered above anchor node
2276 * - below-centered: tooltip is centered above anchor node
2275 * - below-centered: tooltip is centered above anchor node
2277 *
2276 *
2278 * The list is positions is tried, in order, until a position is found where the tooltip fits
2277 * The list is positions is tried, in order, until a position is found where the tooltip fits
2279 * within the viewport.
2278 * within the viewport.
2280 *
2279 *
2281 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2280 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
2282 * the screen so that there's no room above the target node. Nodes with drop downs, like
2281 * the screen so that there's no room above the target node. Nodes with drop downs, like
2283 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2282 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
2284 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2283 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
2285 * is only room below (or above) the target node, but not both.
2284 * is only room below (or above) the target node, but not both.
2286 */
2285 */
2287 defaultPosition: [string];
2286 defaultPosition: [string];
2288
2287
2289 /**
2288 /**
2290 * Static method to display tooltip w/specified contents in specified position.
2289 * Static method to display tooltip w/specified contents in specified position.
2291 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2290 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
2292 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2291 * If position is not specified then dijit/Tooltip.defaultPosition is used.
2293 */
2292 */
2294 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2293 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
2295
2294
2296 /**
2295 /**
2297 * Hide the tooltip
2296 * Hide the tooltip
2298 */
2297 */
2299 hide(aroundNode: PlaceRectangle): void;
2298 hide(aroundNode: PlaceRectangle): void;
2300 }
2299 }
2301
2300
2302 /* dijit/TooltipDialog */
2301 /* dijit/TooltipDialog */
2303
2302
2304 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2303 interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin {
2305 /**
2304 /**
2306 * Description of tooltip dialog (required for a11y)
2305 * Description of tooltip dialog (required for a11y)
2307 */
2306 */
2308 title: string;
2307 title: string;
2309
2308
2310 /**
2309 /**
2311 * Don't change this parameter from the default value.
2310 * Don't change this parameter from the default value.
2312 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2311 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
2313 * is never a child of a layout container, nor can you specify the size of
2312 * is never a child of a layout container, nor can you specify the size of
2314 * TooltipDialog in order to control the size of an inner widget.
2313 * TooltipDialog in order to control the size of an inner widget.
2315 */
2314 */
2316 doLayout: boolean;
2315 doLayout: boolean;
2317
2316
2318 /**
2317 /**
2319 * A Toggle to modify the default focus behavior of a Dialog, which
2318 * A Toggle to modify the default focus behavior of a Dialog, which
2320 * is to focus on the first dialog element after opening the dialog.
2319 * is to focus on the first dialog element after opening the dialog.
2321 * False will disable autofocusing. Default: true.
2320 * False will disable autofocusing. Default: true.
2322 */
2321 */
2323 autofocus: boolean;
2322 autofocus: boolean;
2324
2323
2325 /**
2324 /**
2326 * The pointer to the first focusable node in the dialog.
2325 * The pointer to the first focusable node in the dialog.
2327 */
2326 */
2328 _firstFocusItem: any;
2327 _firstFocusItem: any;
2329
2328
2330 /**
2329 /**
2331 * The pointer to which node has focus prior to our dialog.
2330 * The pointer to which node has focus prior to our dialog.
2332 */
2331 */
2333 _lastFocusItem: any;
2332 _lastFocusItem: any;
2334
2333
2335 /**
2334 /**
2336 * Configure widget to be displayed in given position relative to the button.
2335 * Configure widget to be displayed in given position relative to the button.
2337 *
2336 *
2338 * This is called from the dijit.popup code, and should not be called directly.
2337 * This is called from the dijit.popup code, and should not be called directly.
2339 */
2338 */
2340 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2339 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
2341
2340
2342 /**
2341 /**
2343 * Focus on first field
2342 * Focus on first field
2344 */
2343 */
2345 focus(): void;
2344 focus(): void;
2346
2345
2347 /**
2346 /**
2348 * Called when dialog is displayed.
2347 * Called when dialog is displayed.
2349 *
2348 *
2350 * This is called from the dijit.popup code, and should not be called directly.
2349 * This is called from the dijit.popup code, and should not be called directly.
2351 */
2350 */
2352 onOpen(pos: {
2351 onOpen(pos: {
2353 aroundCorner: PlaceCorner
2352 aroundCorner: PlaceCorner
2354 aroundNodePos: PlacePosition
2353 aroundNodePos: PlacePosition
2355 corner: PlaceCorner
2354 corner: PlaceCorner
2356 x: number
2355 x: number
2357 y: number
2356 y: number
2358 }): void;
2357 }): void;
2359
2358
2360 /**
2359 /**
2361 * Handler for keydown events
2360 * Handler for keydown events
2362 *
2361 *
2363 * Keep keyboard focus in dialog; close dialog on escape key
2362 * Keep keyboard focus in dialog; close dialog on escape key
2364 */
2363 */
2365 _onKey(evt: KeyboardEvent): void;
2364 _onKey(evt: KeyboardEvent): void;
2366 }
2365 }
2367
2366
2368 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2367 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
2369 }
2368 }
General Comments 0
You need to be logged in to leave comments. Login now