/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.list.min"],function(){!function(e,t){var n=window.kendo,a=n.ui,s=a.List,o=a.Select,i=n.support,r=i.placeholder,l=n._activeElement,c=n.keys,u=".kendoComboBox",d="click"+u,p="mousedown"+u,_="disabled",h="readonly",f="change",g="k-state-default",v="k-state-focused",m="k-state-disabled",x="aria-disabled",C="aria-readonly",y="k-state-selected",w="filter",b="accept",k="rebind",L="mouseenter"+u+" mouseleave"+u,S=null,T=e.proxy,B=o.extend({init:function(t,a){var s,i=this;i.ns=u,a=e.isArray(a)?{dataSource:a}:a,o.fn.init.call(i,t,a),i._focusHandler=function(){i.input.focus()},a=i.options,t=i.element.on("focus"+u,i._focusHandler),a.placeholder=a.placeholder||t.attr("placeholder"),i._reset(),i._wrapper(),i._input(),i._tabindex(i.input),i._popup(),i._dataSource(),i._ignoreCase(),i._enable(),i._cascade(),i._aria(),i._oldIndex=i.selectedIndex=-1,a.autoBind?i._filterSource():(s=a.text,!s&&i._isSelect&&(s=t.children(":selected").text()),s&&(i.input.val(s),i._prev=s)),s||i._placeholder(),n.notify(i)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,template:"",filter:"none",placeholder:"",suggest:!1,ignoreCase:!0,animation:{}},events:["open","close",f,"select","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},current:function(e){var n=this,a=n._current;return e===t?a:(a&&a.removeClass(y),o.fn.current.call(n,e),t)},destroy:function(){var e=this;e.input.off(u),e.element.off(u),e._inputWrapper.off(u),o.fn.destroy.call(e)},_editable:function(e){var t=this,n=e.disable,a=e.readonly,s=t._inputWrapper.off(u),o=t.element.add(t.input.off(u)),i=t._arrow.parent().off(d+" "+p);a||n?(s.addClass(n?m:g).removeClass(n?g:m),o.attr(_,n).attr(h,a).attr(x,n).attr(C,a)):(s.addClass(g).removeClass(m).on(L,t._toggleHover),o.removeAttr(_).removeAttr(h).attr(x,!1).attr(C,!1),i.on(d,function(){t.toggle()}).on(p,function(e){e.preventDefault()}),t.input.on("keydown"+u,T(t._keydown,t)).on("focus"+u,function(){s.addClass(v),t._placeholder(!1)}).on("blur"+u,function(){s.removeClass(v),clearTimeout(t._typing),t.options.text!==t.input.val()&&t.text(t.text()),t._placeholder(),t._blur(),t.element.blur()}))},open:function(){var e=this,t=e.dataSource.options.serverFiltering;e.popup.visible()||(!e.ul[0].firstChild||e._state===b&&!t?(e._open=!0,e._state=k,e._filterSource()):(e.popup.open(),e._scroll(e._current)))},refresh:function(){var a,s,o,i=this,r=i.ul[0],c=i.options,u=i._state,d=i._data(),p=d.length;i.trigger("dataBinding"),r.innerHTML=n.render(i.template,d),i._height(p),i.popup.visible()&&i.popup._position(),i._isSelect&&(u===k&&(i._state="",a=i.value()),o=i._option,i._option=t,i._options(d),o&&o[0].selected&&i._custom(o.val())),p&&(c.highlightFirst&&i.current(e(r.firstChild)),c.suggest&&i.input.val()&&i._request!==t&&i.suggest(e(r.firstChild))),u===w||i._fetch||i._selectItem(),i._open&&(i._open=!1,s=!!p,i._typing&&i.input[0]!==l()&&(s=!1),i.toggle(s),i._typing=t),i._touchScroller&&i._touchScroller.reset(),i._makeUnselectable(),i._hideBusy(),i._bound=!0,i.trigger("dataBound")},search:function(e){e="string"==typeof e?e:this.text();var t=this,n=e.length,a=t.options,s=a.ignoreCase,o=a.filter,i=a.dataTextField;clearTimeout(t._typing),n>=a.minLength&&(t._state=w,"none"===o?t._filter(e):(t._open=!0,t._filterSource({value:s?e.toLowerCase():e,field:i,operator:o,ignoreCase:s})))},suggest:function(e){var n,a=this,o=a.input[0],i=a.text(),r=s.caret(o),l=a._last;return l==c.BACKSPACE||l==c.DELETE?(a._last=t,t):(e=e||"","string"!=typeof e&&(n=s.inArray(e[0],a.ul[0]),e=n>-1?a._text(a.dataSource.view()[n]):""),0>=r&&(r=i.toLowerCase().indexOf(e.toLowerCase())+1),e?(n=e.toLowerCase().indexOf(i.toLowerCase()),n>-1&&(i+=e.substring(n+i.length))):i=i.substring(0,r),i.length===r&&e||(o.value=i,s.selectText(o,r,i.length)),t)},text:function(e){e=null===e?"":e;var n,a=this,s=a._text,o=a.input[0],i=a.options.ignoreCase,r=e;return e===t?o.value:(n=a.dataItem(),n&&s(n)===e?(a._triggerCascade(),t):(i&&(r=r.toLowerCase()),a._select(function(e){return e=s(e),i&&(e=(e+"").toLowerCase()),e===r}),a.selectedIndex<0&&(a._custom(e),o.value=e),a._prev=o.value,a._triggerCascade(),t))},toggle:function(e){var t=this;t._toggle(e)},value:function(e){var n,a=this;return e===t?a._accessor():(null!==e&&(e=""+e),a._selectedValue=e,!a._open&&e&&a._fetchItems(e)||(n=a._index(e),n>-1?a.select(n):(a.current(S),a._custom(e),a.text(e),a._placeholder()),a._old=a._accessor(),a._oldIndex=a.selectedIndex),t)},_accept:function(e){var t=this;e?t._focus(e):(t.text(t.text()),t._change())},_custom:function(t){var n=this,a=n.element,s=n._option;n._state===w&&(n._state=b),n._isSelect?(s||(s=n._option=e("