##// END OF EJS Templates
sync
sync

File last commit:

r2:8ec37bf1b4d1 default
r8:6d80d7901b4c v1.0.0-rc3 default
Show More
_KeyNavContainer.d.ts
67 lines | 2.4 KiB | video/mp2t | TypeScriptLexer
/ src / typings / dijit / _KeyNavContainer.d.ts
import _FocusMixin = require("./_FocusMixin");
import _Container = require("./_Container");
import _WidgetBase = require("./_WidgetBase");
import { DeclareConstructor } from "dojo/_base/declare";
import _KeyNavMixin = require("./_KeyNavMixin");
/**
* A _Container with keyboard navigation of its children.
*
* Provides normalized keyboard and focusing code for Container widgets.
* To use this mixin, call connectKeyNavHandlers() in postCreate().
* Also, child widgets must implement a focus() method.
*/
interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
/**
* 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().
*
* @param prevKeyCodes Key codes for navigating to the previous child.
* @param nextKeyCodes Key codes for navigating to the next child.
*/
connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
/**
* @deprecated
*/
startupKeyNavChildren(): void;
/**
* Setup for each child widget.
*
* Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
*
* 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.
*
* Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
*/
_startupChild(widget: _WidgetBase): void;
/**
* Focus the next widget
*/
focusNext(): void;
/**
* Focus the last focusable node in the previous widget
*
* (ex: go to the ComboButton icon section rather than button section)
*/
focusPrev(): void;
/**
* Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
*
* If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
*/
childSelector(node: Element | Node): boolean | void | any;
}
declare module "dojo/_base/kernel" {
interface Dijit {
_KeyNavContainer: _KeyNavContainerConstructor
}
}
type _KeyNavContainerConstructor = DeclareConstructor<_KeyNavContainer>;
declare const _KeyNavContainer: _KeyNavContainerConstructor;
export = _KeyNavContainer;