autocomplete-widget.js revision 059ecaff4e7294d64dcd37debb3005ccf6b2b20a
/*global YUI*/
/*jslint browser: true, onevar: true, undef: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true */
/**
* Basic AutoComplete widget.
*
* @module autocomplete
* @submodule autocomplete-widget
*/
var AutoCompleteBase = Y.AutoCompleteBase,
YArray = Y.Array,
EMPTY_STRING = '',
INPUT = 'input',
INPUT_NODE = 'inputNode',
NAME = 'autocomplete',
TRAY = 'tray',
TRAY_NODE = 'trayNode',
/**
* Basic AutoComplete widget.
*
* @class AutoComplete
* @extends Widget
* @constructor
* @param {Object} config Configuration object.
* @since 3.3.0
*/
// -- Lifecycle Prototype Methods ------------------------------------------
initializer: function () {
this._events = [];
},
destructor: function () {
}
},
bindUI: function () {
]);
},
renderUI: function () {
this._renderInput();
this._renderTray();
},
syncUI: function () {
},
// -- Public Prototype Methods ---------------------------------------------
clearTray: function () {
},
// -- Protected Prototype Methods ------------------------------------------
_renderInput: function () {
if (!input) {
}
// See http://www.w3.org/WAI/PF/aria/roles#combobox
'aria-autocomplete': 'list',
role: 'combobox'
});
},
// TODO: tray should probably be a separate child widget.
_renderTray: function () {
if (!tray) {
}
// See http://www.w3.org/WAI/PF/aria/roles#combobox
},
// -- Protected Event Handlers ---------------------------------------------
_addResult: function (result) {
},
_afterClear: function () {
this.clearTray();
},
_afterResults: function (e) {
this.clearTray();
}
}, {
ATTRS: {
trayNode: {
}
},
HTML_PARSER: {
// Finds the first input element with class "yui3-autocomplete-input",
// and falls back to the first input element period if one with that
// class name isn't found.
}
});
Y.AutoComplete = AutoComplete;
}, '@VERSION@', {
});