# HG changeset patch
# User cin
# Date 2021-08-31 12:37:49
# Node ID 1e22cac2aaf4dd7736aa90fd55cb3b06b77038d6
# Parent d55cc09feba186557f1575fc65ccfab13714a698
Added events map support to _WidgetBase, corrected attributes map support in _WidgetBase
diff --git a/dojo-typings/src/main/typings/dijit/dijit.d.ts b/dojo-typings/src/main/typings/dijit/dijit.d.ts
--- a/dojo-typings/src/main/typings/dijit/dijit.d.ts
+++ b/dojo-typings/src/main/typings/dijit/dijit.d.ts
@@ -3,2301 +3,2378 @@
///
declare namespace dijit {
- /* Global Dijit Interface */
- interface Dijit { }
-
- /* dijit/_AttachMixin */
-
- /* tslint:disable:class-name */
-
- interface _WidgetBase {
- dojoAttachEvent: string;
- dojoAttachPoint: string;
- }
-
- interface _AttachMixin {
- /**
- * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
- */
- _attachPoints: string[];
-
- /**
- * List of connections associated with data-dojo-attach-event=... in the template
- */
- _attachEvents: dojo.Handle[];
-
- /**
- * Object to which attach points and events will be scoped. Defaults to 'this'.
- */
- attachScope: any;
-
- /**
- * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
- *
- * 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.
- */
- searchContainerNode: boolean;
-
- /**
- * Attach to DOM nodes marked with special attributes.
- */
- buildRendering(): void;
-
- /**
- * hook for _WidgetsInTemplateMixin
- */
- _beforeFillContent(): void;
-
- /**
- * Iterate through the dom nodes and attach functions and nodes accordingly.
- *
- * 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:
- * - dojoAttachPoint/data-dojo-attach-point
- * - dojoAttachEvent/data-dojo-attach-event
- */
- _attachTemplateNodes(rootNode: Element | Node): void;
-
- /**
- * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
- *
- * Returns true if caller should process baseNode's children too.
- */
- _processTemplateNode(
- baseNode: T,
- getAttrFunc: (baseNode: T, attr: string) => string,
- attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
- ): boolean;
-
- /**
- * 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.
- */
- _attach(node: Element | Node, type: string, func?: Function): dojo.Handle;
-
- /**
- * Detach and clean up the attachments made in _attachtempalteNodes.
- */
- _detachTemplateNodes(): void;
-
- destroyRendering(preserveDom?: boolean): void;
- }
-
- interface _AttachMixinConstructor extends dojo._base.DeclareConstructor<_AttachMixin> { }
-
- /* dijit/_BidiMixin */
-
- interface _WidgetBase {
-
- /**
- * Gets the right direction of text.
- */
- getTextDir(text: string): string;
-
- /**
- * Set element.dir according to this.textDir, assuming this.textDir has a value.
- */
- applyTextDir(element: HTMLElement, text?: string): void;
-
- /**
- * Wraps by UCC (Unicode control characters) option's text according to this.textDir
- */
- enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
-
- /**
- * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
- */
- restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
- }
-
- /* dijit/_ConfirmDialogMixin */
-
- interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
- /**
- * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
- */
- actionBarTemplate: string;
-
- /**
- * Label of OK button.
- */
- buttonOk: string;
-
- /**
- * Label of cancel button.
- */
- buttonCancel: string;
- }
-
- /* dijit/_Contained */
-
- interface _Contained {
- /**
- * Returns the previous child of the parent or null if this is the
- * first child of the parent.
- */
- getPreviousSibling(): T;
-
- /**
- * Returns the next child of the parent or null if this is the last
- * child of the parent.
- */
- getNextSibling(): T;
-
- /**
- * Returns the index of this widget within its container parent.
- * It returns -1 if the parent does not exist or if the parent is
- * not a dijit/_Container.
- */
- getIndexInParent(): number;
- }
-
- interface _ContainedConstructor extends dojo._base.DeclareConstructor<_Contained> { }
-
- /* dijit/_Container */
-
- interface _Container {
- buildRendering(): void;
-
- /**
- * Makes the given widget a child of this widget.
- */
- addChild(widget: T, insertIndex?: number): void;
-
- /**
- * Removes the passed widget instance from this widget but does
- * not destroy it. You can also pass in an integer indicating
- * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
- */
- removeChild(widget: T): void;
- removeChild(widget: number): void;
-
- /**
- * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
- */
- hasChildren(): boolean;
-
- /**
- * Gets the index of the child in this container or -1 if not found
- */
- getIndexOfChild(widget: T): number;
- }
-
- interface _ContainerConstructor extends dojo._base.DeclareConstructor<_Container> { }
-
- /* dijit/_CssStateMixin */
-
- interface CSSStateNodes {
- [node: string]: string;
- }
-
- interface _CssStateMixin {
- /**
- * True if cursor is over this widget
- */
- hovering: boolean;
-
- /**
- * True if mouse was pressed while over this widget, and hasn't been released yet
- */
- active: boolean;
- }
-
- interface _CssStateMixinConstructor extends dojo._base.DeclareConstructor<_CssStateMixin> { }
-
- /* dijit/_DialogMixin */
-
- interface _DialogMixin {
- /**
- * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
- * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
- */
- actionBarTemplate: string;
-
- /**
- * Callback when the user hits the submit button.
- * Override this method to handle Dialog execution.
- */
- execute(formContents?: any): void;
-
- /**
- * Called when user has pressed the Dialog's cancel button, to notify container.
- */
- onCancel(): void;
-
- /**
- * Called when user has pressed the dialog's OK button, to notify container.
- */
- onExecute(): void;
- }
-
- /* dijit/_FocusMixin */
- interface _FocusMixin { }
-
- interface _WidgetBase {
- /**
- * Called when the widget becomes "active" because
- * it or a widget inside of it either has focus, or has recently
- * been clicked.
- */
- onFocus(): void;
-
- /**
- * Called when the widget stops being "active" because
- * focus moved to something outside of it, or the user
- * clicked somewhere outside of it, or the widget was
- * hidden.
- */
- onBlur(): void;
- }
-
- /* dijit/_HasDropDown */
-
- interface _HasDropDown extends _FocusMixin {
- /**
- * The button/icon/node to click to display the drop down.
- * Can be set via a data-dojo-attach-point assignment.
- * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
- */
- _buttonNode: HTMLElement;
-
- /**
- * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
- * on where the drop down is set to be positioned.
- * Can be set via a data-dojo-attach-point assignment.
- * If missing, then _buttonNode will be used.
- */
- _arrowWrapperNode: HTMLElement;
-
- /**
- * The node to set the aria-expanded class on.
- * Also sets popupActive class but that will be removed in 2.0.
- * Can be set via a data-dojo-attach-point assignment.
- * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
- */
- _popupStateNode: HTMLElement;
-
- /**
- * The node to display the popup around.
- * Can be set via a data-dojo-attach-point assignment.
- * If missing, then domNode will be used.
- */
- _aroundNode: HTMLElement;
-
- /**
- * The widget to display as a popup. This widget *must* be
- * defined before the startup function is called.
- */
- dropDown: T;
-
- /**
- * Set to true to make the drop down at least as wide as this
- * widget. Set to false if the drop down should just be its
- * default width.
- */
- autoWidth: boolean;
-
- /**
- * Set to true to make the drop down exactly as wide as this
- * widget. Overrides autoWidth.
- */
- forceWidth: boolean;
-
- /**
- * The max height for our dropdown.
- * Any dropdown taller than this will have scrollbars.
- * Set to 0 for no max height, or -1 to limit height to available space in viewport
- */
- maxHeight: number;
-
- /**
- * This variable controls the position of the drop down.
- * It's an array of strings
- */
- dropDownPosition: string[];
- /* TODO remove for TS 1.8 */
- /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
-
- /**
- * When set to false, the click events will not be stopped, in
- * case you want to use them in your subclass
- */
- _stopClickEvents: boolean;
-
- /**
- * Callback when the user mousedown/touchstart on the arrow icon.
- */
- _onDropDownMouseDown(e: MouseEvent): void;
-
- /**
- * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
- * Note that this function is called regardless of what node the event occurred on (but only after
- * a mousedown/touchstart on the arrow).
- */
- _onDropDownMouseUp(e?: MouseEvent): void;
-
- /**
- * The drop down was already opened on mousedown/keydown; just need to stop the event
- */
- _onDropDownClick(e: MouseEvent): void;
-
- buildRendering(): void;
- postCreate(): void;
- destroy(preserveDom?: boolean): void;
-
- /**
- * Returns true if the dropdown exists and it's data is loaded. This can
- * be overridden in order to force a call to loadDropDown().
- */
- isLoaded(): boolean;
-
- /**
- * Creates the drop down if it doesn't exist, loads the data
- * if there's an href and it hasn't been loaded yet, and then calls
- * the given callback.
- */
- loadDropDown(loadCallback: () => void): void;
-
- /**
- * Creates the drop down if it doesn't exist, loads the data
- * if there's an href and it hasn't been loaded yet, and
- * then opens the drop down. This is basically a callback when the
- * user presses the down arrow button to open the drop down.
- */
- loadAndOpenDropDown(): dojo.Deferred;
-
- /**
- * Callback when the user presses the down arrow button or presses
- * the down arrow key to open/close the drop down.
- * Toggle the drop-down widget; if it is up, close it, if not, open it
- */
- toggleDropDown(): void;
-
- /**
- * Opens the dropdown for this widget. To be called only when this.dropDown
- * has been created and is ready to display (ie, it's data is loaded).
- */
- openDropDown(): PlaceLocation;
-
- /**
- * Closes the drop down on this widget
- */
- closeDropDown(focus?: boolean): void;
- }
-
- /* dijit/_OnDijitClickMixin */
-
- interface _OnDijitClickMixin {
- /**
- * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
- */
- connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
- }
-
- interface _OnDijitClickMixinConstructor {
- /**
- * Deprecated. New code should access the dijit/a11yclick event directly, ex:
- * | this.own(on(node, a11yclick, function(){ ... }));
- *
- * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
- * It also used to be necessary to make templates with ondijitclick work, but now you can just require
- * dijit/a11yclick.
- */
- new (): _OnDijitClickMixin;
- a11yclick: A11yClick;
- }
-
- /* dijit/_TemplatedMixin */
-
- interface _TemplatedMixin extends _AttachMixin {
-
- /**
- * A string that represents the widget template.
- * Use in conjunction with dojo.cache() to load from a file.
- */
- templateString: string;
-
- /**
- * Path to template (HTML file) for this widget relative to dojo.baseUrl.
- * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
- */
- templatePath: string;
-
- /**
- * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
- * and events inside this.containerNode. Remove for 2.0.
- */
- searchContainerNode: boolean;
-
- /**
- * Construct the UI for this widget from a template, setting this.domNode.
- */
- buildRendering(): void;
- }
-
- interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
- /**
- * Static method to get a template based on the templatePath or
- * templateString key
- */
- getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
- }
-
- /* dijit/_Widget */
- interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
- /**
- * Connect to this function to receive notifications of mouse click events.
- */
- onClick(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of mouse double click events.
- */
- onDblClick(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of keys being pressed down.
- */
- onKeyDown(event: KeyboardEvent): void;
-
- /**
- * Connect to this function to receive notifications of printable keys being typed.
- */
- onKeyPress(event: KeyboardEvent): void;
-
- /**
- * Connect to this function to receive notifications of keys being released.
- */
- onKeyUp(event: KeyboardEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse button is pressed down.
- */
- onMouseDown(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
- */
- onMouseMove(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
- */
- onMouseOut(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
- */
- onMouseOver(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse moves off of this widget.
- */
- onMouseLeave(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse moves onto this widget.
- */
- onMouseEnter(event: MouseEvent): void;
-
- /**
- * Connect to this function to receive notifications of when the mouse button is released.
- */
- onMouseUp(event: MouseEvent): void;
-
- postCreate(): void;
-
- /**
- * Deprecated. Use set() instead.
- */
- setAttribute(attr: string, value: any): void;
-
- /**
- * This method is deprecated, use get() or set() directly.
- */
- attr(name: string | { [attr: string]: any }, value?: any): any;
-
- /**
- * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
- */
- getDescendants(): _Widget[];
-
- /**
- * Called when this widget becomes the selected pane in a
- * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
- * `dijit/layout/AccordionContainer`, etc.
- *
- * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
- */
- onShow(): void;
-
- /**
- * Called when another widget becomes the selected pane in a
- * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
- * `dijit/layout/AccordionContainer`, etc.
- *
- * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
- */
- onHide(): void;
-
- /**
- * Called when this widget is being displayed as a popup (ex: a Calendar popped
- * up from a DateTextBox), and it is hidden.
- * This is called from the dijit.popup code, and should not be called directly.
- *
- * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
- * Callback if a user tries to close the child. Child will be closed if this function returns true.
- */
- onClose(): boolean;
- }
-
- /* dijit/_WidgetBase */
- interface _WidgetBase extends dojo.Stateful, Destroyable {
-
- /**
- * A unique, opaque ID string that can be assigned by users or by the
- * system. If the developer passes an ID which is known not to be
- * unique, the specified ID is ignored and the system-generated ID is
- * used instead.
- */
- id: string;
-
- /**
- * Rarely used. Overrides the default Dojo locale used to render this widget,
- * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
- * Value must be among the list of locales specified during by the Dojo bootstrap,
- * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
- */
- lang: string;
-
- /**
- * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
- * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
- * default direction.
- */
- dir: string;
-
- /**
- * HTML class attribute
- */
- class: string;
-
- /**
- * HTML style attributes as cssText string or name/value hash
- */
- style: string;
-
- /**
- * HTML title attribute.
- *
- * For form widgets this specifies a tooltip to display when hovering over
- * the widget (just like the native HTML title attribute).
- *
- * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
- * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
- * interpreted as HTML.
- */
- title: string;
-
- /**
- * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
- * this specifies the tooltip to appear when the mouse is hovered over that text.
- */
- tooltip: string;
-
- /**
- * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
- * widget state.
- */
- baseClass: string;
-
- /**
- * pointer to original DOM node
- */
- srcNodeRef: HTMLElement;
-
- /**
- * This is our visible representation of the widget! Other DOM
- * Nodes may by assigned to other properties, usually through the
- * template system's data-dojo-attach-point syntax, but the domNode
- * property is the canonical "top level" node in widget UI.
- */
- domNode: HTMLElement;
-
- /**
- * Designates where children of the source DOM node will be placed.
- * "Children" in this case refers to both DOM nodes and widgets.
- */
- containerNode: HTMLElement;
-
- /**
- * The document this widget belongs to. If not specified to constructor, will default to
- * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
- */
- ownerDocument: HTMLElement;
-
- /**
- * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
- * for each XXX attribute to be mapped to the DOM.
- */
- attributeMap: { [attribute: string]: any };
-
- /**
- * Bi-directional support, the main variable which is responsible for the direction of the text.
- * The text direction can be different than the GUI direction by using this parameter in creation
- * of a widget.
- */
- textDir: string;
-
- /**
- * Kicks off widget instantiation. See create() for details.
- */
- postscript(params?: any, srcNodeRef?: HTMLElement): void;
-
- /**
- * Kick off the life-cycle of a widget
- */
- create(params?: any, srcNodeRef?: HTMLElement): void;
-
- /**
- * Called after the parameters to the widget have been read-in,
- * but before the widget template is instantiated. Especially
- * useful to set properties that are referenced in the widget
- * template.
- */
- postMixInProperties(): void;
-
- /**
- * Construct the UI for this widget, setting this.domNode.
- * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
- */
- buildRendering(): void;
-
- /**
- * Processing after the DOM fragment is created
- */
- postCreate(): void;
-
- /**
- * Processing after the DOM fragment is added to the document
- */
- startup(): void;
-
- /**
- * Destroy this widget and its descendants
- */
- destroyRecursive(preserveDom?: boolean): void;
-
- /**
- * Destroys the DOM nodes associated with this widget.
- */
- destroyRendering(preserveDom?: boolean): void;
-
- /**
- * Recursively destroy the children of this widget and their
- * descendants.
- */
- destroyDescendants(preserveDom?: boolean): void;
-
- /**
- * Deprecated. Override destroy() instead to implement custom widget tear-down
- * behavior.
- */
- uninitialize(): boolean;
-
- /**
- * Used by widgets to signal that a synthetic event occurred, ex:
- * | myWidget.emit("attrmodified-selectedChildWidget", {}).
- */
- emit(type: string, eventObj?: any, callbackArgs?: any[]): any;
-
- /**
- * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
- */
- on(type: string | dojo.ExtensionEvent, func: dojo.EventListener | Function): dojo.WatchHandle;
-
- /**
- * Returns a string that represents the widget.
- */
- toString(): string;
-
- /**
- * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
- * is this widget. Note that it does not return all descendants, but rather just direct children.
- */
- getChildren(): T[];
-
- /**
- * Returns the parent widget of this widget.
- */
- getParent(): T;
-
- /**
- * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
- */
- connect(obj: any, event: string | dojo.ExtensionEvent, method: string | dojo.EventListener): dojo.WatchHandle;
-
- /**
- * Deprecated, will be removed in 2.0, use handle.remove() instead.
- */
- disconnect(handle: dojo.WatchHandle): void;
-
- /**
- * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
- */
- subscribe(t: string, method: dojo.EventListener): dojo.WatchHandle;
-
- /**
- * Deprecated, will be removed in 2.0, use handle.remove() instead.
- */
- unsubscribe(handle: dojo.WatchHandle): void;
-
- /**
- * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
- */
- isLeftToRight(): boolean;
-
- /**
- * Return true if this widget can currently be focused
- * and false if not
- */
- isFocusable(): boolean;
-
- /**
- * Place this widget somewhere in the DOM based
- * on standard domConstruct.place() conventions.
- */
- placeAt(reference: dojo.NodeFragmentOrString | T, position?: string | number): this;
-
- /**
- * Wrapper to setTimeout to avoid deferred functions executing
- * after the originating widget has been destroyed.
- * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
- */
- defer(fcn: Function, delay?: number): dojo.Handle;
- }
-
- interface _WidgetBaseConstructor extends Pick, Exclude, 'new'>> {
- new (params?: Partial & ThisType, srcNodeRef?: dojo.NodeOrString): W & dojo._base.DeclareCreatedObject;
- }
-
- /* dijit/_WidgetsInTemplateMixin */
-
- interface _WidgetsInTemplateMixin {
- /**
- * Used to provide a context require to dojo/parser in order to be
- * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
- */
- contextRequire: Function;
-
- startup(): void;
- }
-
- interface _WidgetsInTemplateMixinConstructor extends dojo._base.DeclareConstructor<_WidgetsInTemplateMixin> {
- new (params: Object, srcNodeRef: dojo.NodeOrString): _WidgetsInTemplateMixin;
- }
-
- /* dijit/a11yclick */
-
- interface A11yClick {
-
- /**
- * Custom press, release, and click synthetic events
- * which trigger on a left mouse click, touch, or space/enter keyup.
- */
- (node: HTMLElement, listener: Function): dojo.Handle;
-
- /**
- * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
- */
- press: dojo.ExtensionEvent;
-
- /**
- * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
- */
- release: dojo.ExtensionEvent;
-
- /**
- * Mouse cursor or a finger is dragged over the given node.
- */
- move: dojo.ExtensionEvent;
- }
-
- /* dijit/Calendar */
-
- interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> {
- onMonthSelect(): void;
- postCreate(): void;
-
- set(name: 'month', value: number): this;
- set(name: string, value: any): this;
- set(values: Object): this;
- }
-
- interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { }
-
- interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
- months: string[];
- baseClass: string;
- templateString: string;
-
- /**
- * Callback when month is selected from drop down
- */
- onChange(month: number): void;
-
- set(name: 'months', value: string[]): this;
- set(name: string, value: any): this;
- set(values: Object): this;
- }
-
- interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { }
-
- interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
-
- baseClass: string;
-
- /**
- * Set node classes for various mouse events, see dijit._CssStateMixin for more details
- */
- cssStateNodes: CSSStateNodes;
-
- /**
- * Creates the drop down button that displays the current month and lets user pick a new one
- */
- _createMonthWidget(): _MonthDropDownButton;
-
- postCreate(): void;
-
- /**
- * Handler for when user selects a month from the drop down list
- */
- _onMonthSelect(newMonth: number): void;
-
- /**
- * Handler for mouse over events on days, sets hovered style
- */
- _onDayMouseOver(evt: MouseEvent): void;
-
- /**
- * Handler for mouse out events on days, clears hovered style
- */
- _onDayMouseOut(evt: MouseEvent): void;
- _onDayMouseDown(evt: MouseEvent): void;
- _onDayMouseUp(evt: MouseEvent): void;
-
- /**
- * Provides keyboard navigation of calendar.
- */
- handleKey(evt: KeyboardEvent): void;
-
- /**
- * For handling keydown events on a stand alone calendar
- */
- _onKeyDown(evt: KeyboardEvent): void;
-
- /**
- * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
- */
- onValueSelected(date: Date): void;
-
- onChange(date: Date): void;
-
- /**
- * May be overridden to return CSS classes to associate with the date entry for the given dateObject
- * for example to indicate a holiday in specified locale.
- */
- getClassForDate(dateObject: Date, locale?: string): string;
-
- get(name: 'value'): Date;
- get(name: string): any;
-
- set(name: 'value', value: number | Date): this;
- set(name: string, value: any): this;
- set(values: Object): this;
- }
-
- interface CalendarConstructor extends _WidgetBaseConstructor {
- _MonthWidget: _MonthWidgetConstructor;
- _MonthDropDown: _MonthDropDownButtonConstructor;
- _MonthDropDownButton: _MonthDropDownButtonConstructor;
- }
-
- /* dijit/CalendarLite */
-
- interface _MonthWidget extends _WidgetBase {
- set(name: 'month', value: Date): this;
- set(name: string, value: any): this;
- set(values: Object): this;
- }
-
- interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { }
-
- interface CalendarLite extends _WidgetBase, _TemplatedMixin {
- /**
- * Template for main calendar
- */
- templateString: string;
-
- /**
- * Template for cell for a day of the week (ex: M)
- */
- dowTemplateString: string;
-
- dateTemplateString: string;
- weekTemplateString: string;
-
- /**
- * The currently selected Date, initially set to invalid date to indicate no selection.
- */
- value: Date;
-
- /**
- * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
- * at dojo/date and dojo/date/locale.
- */
- datePackage: string;
-
- /**
- * How to represent the days of the week in the calendar header. See locale
- */
- dayWidth: string;
-
- /**
- * Order fields are traversed when user hits the tab key
- */
- tabIndex: string;
-
- /**
- * (Optional) The first day of week override. By default the first day of week is determined
- * for the current locale (extracted from the CLDR).
- * Special value -1 (default value), means use locale dependent value.
- */
- dayOffset: number;
-
- /**
- * Date object containing the currently focused date, or the date which would be focused
- * if the calendar itself was focused. Also indicates which year and month to display,
- * i.e. the current "page" the calendar is on.
- */
- currentFocus: Date;
-
- /**
- * Put the summary to the node with role=grid
- */
- _setSummaryAttr: string;
-
- baseClass: string;
-
- /**
- * Runs various tests on the value, checking that it's a valid date, rather
- * than blank or NaN.
- */
- _isValidDate(value: Date): boolean;
-
- /**
- * Convert Number into Date, or copy Date object. Then, round to nearest day,
- * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
- */
- _patchDate(value: number | Date): Date;
-
- /**
- * This just sets the content of node to the specified text.
- * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
- */
- _setText(node: HTMLElement, text?: string): void;
-
- /**
- * Fills in the calendar grid with each day (1-31).
- * Call this on creation, when moving to a new month.
- */
- _populateGrid(): void;
-
- /**
- * Fill in localized month, and prev/current/next years
- */
- _populateControls(): void;
-
- /**
- * Sets calendar's value to today's date
- */
- goToToday(): void;
-
- /**
- * Creates the drop down button that displays the current month and lets user pick a new one
- */
- _createMonthWidget(): void;
-
- buildRendering(): void;
- postCreate(): void;
-
- /**
- * Set up connects for increment/decrement of months/years
- */
- _connectControls(): void;
-
- /**
- * If the calendar currently has focus, then focuses specified date,
- * changing the currently displayed month/year if necessary.
- * If the calendar doesn't have focus, updates currently
- * displayed month/year, and sets the cell that will get focus
- * when Calendar is focused.
- */
- _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
-
- /**
- * Focus the calendar by focusing one of the calendar cells
- */
- focus(): void;
-
- /**
- * Handler for day clicks, selects the date if appropriate
- */
- _onDayClick(evt: MouseEvent): void;
-
- /**
- * Returns the cell corresponding to the date, or null if the date is not within the currently
- * displayed month.
- */
- _getNodeByDate(value: Date): HTMLElement;
-
- /**
- * Marks the specified cells as selected, and clears cells previously marked as selected.
- * For CalendarLite at most one cell is selected at any point, but this allows an array
- * for easy subclassing.
- */
- _markSelectedDates(dates: Date[]): void;
-
- /**
- * Called only when the selected date has changed
- */
- onChange(date: Date): void;
-
- /**
- * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
- */
- isDisabledDate(dateObject: Date, locale?: string): boolean;
-
- /**
- * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
- * for example to indicate a holiday in specified locale.
- */
- getClassForDate(dateObject: Date, locale?: string): string;
-
- get(name: 'value'): Date;
- get(name: string): any;
-
- set(name: 'value', value: number | Date): this;
- set(name: string, value: any): this;
- set(values: Object): this;
- }
-
- interface CalendarLiteConstructor extends _WidgetBaseConstructor {
- _MonthWidget: _MonthWidgetConstructor;
- }
-
- /* dijit/Destroyable */
-
- interface Destroyable {
- _destroyed?: true;
-
- /**
- * Destroy this class, releasing any resources registered via own().
- */
- destroy(preserveDom?: boolean): void;
-
- /**
- * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
- * already removed/destroyed manually.
- */
- own(...args: any[]): any[];
- }
-
- /**
- * Mixin to track handles and release them when instance is destroyed.
- */
- interface DestroyableConstructor extends dojo._base.DeclareConstructor { }
-
- /** dijit/_KeyNavMixin */
-
- /**
- * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
- * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
- *
- * To use this mixin, the subclass must:
- *
- * - 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.
- * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
- * - Define childSelector to a function or string that identifies focusable descendant widgets
- *
- * Also, child widgets must implement a focus() method.
- */
- interface _KeyNavMixin extends _FocusMixin {
- /**
- * Tab index of the container; same as HTML tabIndex attribute.
- * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
- */
- tabIndex: string;
-
- /**
- * 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.
- */
- childSelector: string | Function | null;
-
- /**
- * Called on left arrow key, or right arrow key if widget is in RTL mode.
- * Should go back to the previous child in horizontal container widgets like Toolbar.
- */
- _onLeftArrow(evt?: KeyboardEvent): void;
-
- /**
- * Called on right arrow key, or left arrow key if widget is in RTL mode.
- * Should go to the next child in horizontal container widgets like Toolbar.
- */
- _onRightArrow(evt?: KeyboardEvent): void;
-
- /**
- * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
- */
- _onUpArrow(evt?: KeyboardEvent): void;
-
- /**
- * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
- */
- _onDownArrow(evt?: KeyboardEvent): void;
-
- /**
- * Default focus() implementation: focus the first child.
- */
- focus(): void;
-
- /**
- * Returns first child that can be focused.
- */
- _getFirstFocusableChild(): _WidgetBase;
-
- /**
- * Returns last child that can be focused.
- */
- _getLastFocusableChild(): _WidgetBase;
-
- /**
- * Focus the first focusable child in the container.
- */
- focusFirstChild(): void;
-
- /**
- * Focus the last focusable child in the container.
- */
- focusLastChild(): void;
-
- /**
- * Focus specified child widget.
- *
- * @param widget Reference to container's child widget
- * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
- */
- focusChild(widget: _WidgetBase, last?: boolean): void;
-
- /**
- * Handler for when the container itself gets focus.
- *
- * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
- */
- _onContainerFocus(evt: Event): void;
-
- /**
- * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
- *
- * It marks that the current node is the selected one, and the previously selected node no longer is.
- */
- _onChildFocus(child?: _WidgetBase): void;
-
- _searchString: string;
-
- multiCharSearchDuration: number;
-
- /**
- * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
- */
- onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
-
- /**
- * Compares the searchString to the widget's text label, returning:
- *
- * * -1: a high priority match and stop searching
- * * 0: not a match
- * * 1: a match but keep looking for a higher priority match
- */
- _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
-
- /**
- * When a key is pressed, if it's an arrow key etc. then it's handled here.
- */
- _onContainerKeydown(evt: Event): void;
-
- /**
- * When a printable key is pressed, it's handled here, searching by letter.
- */
- _onContainerKeypress(evt: Event): void;
-
- /**
- * Perform a search of the widget's options based on the user's keyboard activity
- *
- * 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.
- */
- _keyboardSearch(evt: Event, keyChar: string): void;
-
- /**
- * Called when focus leaves a child widget to go to a sibling widget.
- */
- _onChildBlur(widget: _WidgetBase): void;
-
- /**
- * Returns the next or previous focusable descendant, compared to "child".
- * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
- */
- _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
-
- /**
- * Returns the first child.
- */
- _getFirst(): _WidgetBase | null;
-
- /**
- * Returns the last descendant.
- */
- _getLast(): _WidgetBase | null;
-
- /**
- * Returns the next descendant, compared to "child".
- */
- _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
- }
-
- interface _KeyNavMixinConstructor extends dojo._base.DeclareConstructor<_KeyNavMixin> { }
-
- /* dijit/_KeyNavContainer */
-
- /**
- * 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;
-
- /**
- * Returns the first child.
- */
- _getFirst(): _Widget | null;
-
- /**
- * Returns the last descendant.
- */
- _getLast(): _Widget | null;
-
- /**
- * 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;
- }
-
- interface _KeyNavContainerConstructor extends dojo._base.DeclareConstructor<_KeyNavContainer> { }
-
- /* dijit/_MenuBase */
-
- /**
- * Abstract base class for Menu and MenuBar.
- * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
- */
- interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
- selected: MenuItem | null;
-
- _setSelectedAttr(item?: MenuItem | null): void;
-
- /**
- * 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.
- *
- * 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.
- */
- activated: boolean;
-
- _setActivatedAttr(val: boolean): void;
-
- /**
- * pointer to menu that displayed me
- */
- parentMenu: _Widget | null;
-
- /**
- * 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.
- */
- popupDelay: number;
-
- /**
- * 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.
- */
- passivePopupDelay: number;
-
- /**
- * 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.
- */
- autoFocus: boolean;
-
- /**
- * 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.
- */
- childSelector(node: Element | Node): boolean | void | Function;
-
- /**
- * 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.
- */
- onExecute(): void;
-
- /**
- * Attach point for notification about when the user cancels the current menu
- * 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.
- */
- onCancel(): void;
-
- /**
- * 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
- */
- _moveToPopup(evt: Event): void;
-
- /**
- * This handler is called when the mouse moves over the popup.
- */
- _onPopupHover(evt?: MouseEvent): void;
-
- /**
- * Called when cursor is over a MenuItem.
- */
- onItemHover(item: MenuItem): void;
-
- /**
- * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
- */
- _onChildDeselect(item: MenuItem): void;
-
- /**
- * Callback fires when mouse exits a MenuItem
- */
- onItemUnhover(item: MenuItem): void;
-
- /**
- * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
- */
- _stopPopupTimer(): void;
-
- /**
- * Cancels the pending-close timer because the close has been preempted
- */
- _stopPendingCloseTimer(): void;
-
- /**
- * Returns the top menu in this chain of Menus
- */
- _getTopMenu(): void;
-
- /**
- * Handle clicks on an item.
- */
- onItemClick(item: _WidgetBase, evt: Event): void;
-
- /**
- * Open the popup to the side of/underneath the current menu item, and optionally focus first item
- */
- _openItemPopup(fromItem: MenuItem, focus: boolean): void;
-
- /**
- * Callback when this menu is opened.
- * This is called by the popup manager as notification that the menu was opened.
- */
- onOpen(evt?: Event): void;
-
- /**
- * Callback when this menu is closed.
- * This is called by the popup manager as notification that the menu was closed.
- */
- onClose(): boolean;
-
- /**
- * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
- */
- _closeChild(): void;
- /**
- * Called when child of this Menu gets focus from:
- *
- * 1. clicking it
- * 2. tabbing into it
- * 3. being opened by a parent menu.
- *
- * This is not called just from mouse hover.
- */
- _onItemFocus(item: MenuItem): void;
-
- /**
- * Called when focus is moved away from this Menu and it's submenus.
- */
- _onBlur(): void;
-
- /**
- * Called when the user is done with this menu. Closes hierarchy of menus.
- */
- _cleanUp(clearSelectedItem?: boolean): void;
- }
-
- interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { }
-
- /* dijit/Dialog */
-
- interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin {
- templateString: string;
- baseClass: string;
- cssStateNodes: CSSStateNodes;
-
- /**
- * True if Dialog is currently displayed on screen.
- */
- open: boolean;
-
- /**
- * The time in milliseconds it takes the dialog to fade in and out
- */
- duration: number;
-
- /**
- * A Toggle to modify the default focus behavior of a Dialog, which
- * is to re-focus the element which had focus before being opened.
- * False will disable refocusing. Default: true
- */
- refocus: boolean;
-
- /**
- * A Toggle to modify the default focus behavior of a Dialog, which
- * is to focus on the first dialog element after opening the dialog.
- * False will disable autofocusing. Default: true
- */
- autofocus: boolean;
-
- /**
- * Toggles the movable aspect of the Dialog. If true, Dialog
- * can be dragged by it's title. If false it will remain centered
- * in the viewport.
- */
- draggable: boolean;
-
- /**
- * Maximum size to allow the dialog to expand to, relative to viewport size
- */
- maxRatio: number;
-
- /**
- * Dialog show [x] icon to close itself, and ESC key will close the dialog.
- */
- closable: boolean;
- postMixInProperties(): void;
- postCreate(): void;
-
- /**
- * Called when data has been loaded from an href.
- * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
- * but should *not* be overridden.
- */
- onLoad(data?: any): void;
-
- focus(): void;
-
- /* Not entirely sure of the resolution type of these promises */
-
- /**
- * Display the dialog
- */
- show(): dojo.promise.Promise;
-
- /**
- * Hide the dialog
- */
- hide(): dojo.promise.Promise;
-
- /**
- * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
- * necessary to keep it visible.
- *
- * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
- * size of the dialog.
- */
- resize(dim?: dojo.DomGeometryWidthHeight): void;
-
- destroy(preserveDom?: boolean): void;
- }
-
- interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { }
-
- interface Dialog extends layout.ContentPane, _DialogBase {
- /* overrides conflicting methods */
- resize(dim?: dojo.DomGeometryWidthHeight): void;
- }
-
- interface DialogLevelManager {
- _beginZIndex: number;
-
- /**
- * Call right before fade-in animation for new dialog.
- *
- * Saves current focus, displays/adjusts underlay for new dialog,
- * and sets the z-index of the dialog itself.
- *
- * New dialog will be displayed on top of all currently displayed dialogs.
- * Caller is responsible for setting focus in new dialog after the fade-in
- * animation completes.
- */
- show(dialog: _WidgetBase, underlayAttrs: Object): void;
-
- /**
- * Called when the specified dialog is hidden/destroyed, after the fade-out
- * animation ends, in order to reset page focus, fix the underlay, etc.
- * If the specified dialog isn't open then does nothing.
- *
- * Caller is responsible for either setting display:none on the dialog domNode,
- * or calling dijit/popup.hide(), or removing it from the page DOM.
- */
- hide(dialog: _WidgetBase): void;
-
- /**
- * Returns true if specified Dialog is the top in the task
- */
- isTop(dialog: _WidgetBase): boolean;
- }
-
- interface DialogConstructor extends _WidgetBaseConstructor