www-thermferm/jqwidgets/jqxdropdownbutton.js

changeset 617
b216f9d4b917
parent 511
2d1d43c3a2c2
--- a/www-thermferm/jqwidgets/jqxdropdownbutton.js	Sun Jul 10 16:58:40 2022 +0200
+++ b/www-thermferm/jqwidgets/jqxdropdownbutton.js	Mon Aug 08 10:54:27 2022 +0200
@@ -1,7 +1,9 @@
 /*
-jQWidgets v4.5.2 (2017-May)
-Copyright (c) 2011-2017 jQWidgets.
-License: http://jqwidgets.com/license/
-*/
-!function(a){a.jqx.jqxWidget("jqxDropDownButton","",{}),a.extend(a.jqx._jqxDropDownButton.prototype,{defineInstance:function(){var b={disabled:!1,width:null,height:null,arrowSize:19,enableHover:!0,openDelay:250,closeDelay:300,animationType:"default",enableBrowserBoundsDetection:!1,dropDownHorizontalAlignment:"left",dropDownVerticalAlignment:"bottom",popupZIndex:2e4,dropDownContainer:"default",autoOpen:!1,rtl:!1,initContent:null,dropDownWidth:null,dropDownHeight:null,focusable:!0,template:"default",touchMode:!1,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","opening","closing"]};return this===a.jqx._jqxDropDownButton.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(b){var c=this;c.width||(c.width=200),c.height||(c.height=25),c.isanimating=!1,c.setupInstance();var d=a("<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropDownButtonWrapper' style='outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropDownButtonContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'/><div id='dropDownButtonArrow' unselectable='on'  style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>");c.host.attr("tabindex")?(d.attr("tabindex",c.host.attr("tabindex")),c.host.removeAttr("tabindex")):d.attr("tabindex",0),c.focusable||d.removeAttr("tabIndex"),a.jqx.aria(this),c.popupContent=c.host.children(),c.host.attr("role","button"),0==c.popupContent.length?(c.popupContent=a("<div>"+c.host.text()+"</div>"),c.popupContent.css("display","block"),c.element.innerHTML=""):c.popupContent.detach();var e=this;c.addHandler(c.host,"loadContent",function(a){e._arrange()});try{var f="dropDownButtonPopup"+c.element.id,g=a(a.find("#"+f));g.length>0&&g.remove(),a.jqx.aria(this,"aria-haspopup",!0),a.jqx.aria(this,"aria-owns",f);var h=a("<div class='dropDownButton' style='overflow: hidden; left: -1000px; top: -1000px; position: absolute;' id='dropDownButtonPopup"+c.element.id+"'></div>");h.addClass(c.toThemeProperty("jqx-widget-content")),h.addClass(c.toThemeProperty("jqx-dropdownbutton-popup")),h.addClass(c.toThemeProperty("jqx-popup")),h.addClass(c.toThemeProperty("jqx-rc-all")),"element"!=c.dropDownContainer&&h.css("z-index",c.popupZIndex),a.jqx.browser.msie&&h.addClass(c.toThemeProperty("jqx-noshadow")),c.popupContent.appendTo(h),"element"==c.dropDownContainer?h.appendTo(c.host):h.appendTo(document.body),c.container=h,c.container.css("visibility","hidden")}catch(a){}c.touch=a.jqx.mobile.isTouchDevice(),c.dropDownButtonStructure=d,c.host.append(d),c.dropDownButtonWrapper=c.host.find("#dropDownButtonWrapper"),c.firstDiv=c.dropDownButtonWrapper.parent(),c.dropDownButtonArrow=c.host.find("#dropDownButtonArrow"),c.arrow=a(c.dropDownButtonArrow.children()[0]),c.dropDownButtonContent=c.host.find("#dropDownButtonContent"),c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-dropdownlist-content")),c.dropDownButtonWrapper.addClass(c.toThemeProperty("jqx-disableselect")),c.rtl&&c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-rtl"));var i=this;c.host.parents()&&c.addHandler(c.host.parents(),"scroll.dropdownbutton"+c.element.id,function(a){var b=i.isOpened();b&&i.close()}),c.addHandler(c.dropDownButtonWrapper,"selectstart",function(){return!1}),c.dropDownButtonWrapper[0].id="dropDownButtonWrapper"+c.element.id,c.dropDownButtonArrow[0].id="dropDownButtonArrow"+c.element.id,c.dropDownButtonContent[0].id="dropDownButtonContent"+c.element.id;var i=this;c.propertyChangeMap.disabled=function(b,c,d,e){e?(b.host.addClass(i.toThemeProperty("jqx-dropdownlist-state-disabled")),b.host.addClass(i.toThemeProperty("jqx-fill-state-disabled")),b.dropDownButtonContent.addClass(i.toThemeProperty("jqx-dropdownlist-content-disabled"))):(b.host.removeClass(i.toThemeProperty("jqx-dropdownlist-state-disabled")),b.host.removeClass(i.toThemeProperty("jqx-fill-state-disabled")),b.dropDownButtonContent.removeClass(i.toThemeProperty("jqx-dropdownlist-content-disabled"))),a.jqx.aria(b,"aria-disabled",b.disabled)},c.disabled&&(c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-disabled")),c.host.addClass(c.toThemeProperty("jqx-fill-state-disabled")),c.dropDownButtonContent.addClass(c.toThemeProperty("jqx-dropdownlist-content-disabled")));var j=c.toThemeProperty("jqx-rc-all")+" "+c.toThemeProperty("jqx-fill-state-normal")+" "+c.toThemeProperty("jqx-widget")+" "+c.toThemeProperty("jqx-widget-content")+" "+c.toThemeProperty("jqx-dropdownlist-state-normal");if(c.host.addClass(j),c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down")),c.arrow.addClass(c.toThemeProperty("jqx-icon")),c.template&&c.host.addClass(c.toThemeProperty("jqx-"+c.template)),c._setSize(),c.render(),a.jqx.browser.msie&&a.jqx.browser.version<8&&(c.container.css("display","none"),c.host.parents(".jqx-window").length>0)){var k=c.host.parents(".jqx-window").css("z-index");h.css("z-index",k+10),c.container.css("z-index",k+10)}},setupInstance:function(){var b=this,c={setContent:function(a){b.dropDownButtonContent.children().remove(),b.dropDownButtonContent[0].innerHTML="",b.dropDownButtonContent.append(a)},val:function(a){return 0==arguments.length||"object"==typeof a?b.dropDownButtonContent.text():void b.dropDownButtonContent.html(a)},getContent:function(){return b.dropDownButtonContent.children().length>0?b.dropDownButtonContent.children():b.dropDownButtonContent.text()},_setSize:function(){null!=b.width&&b.width.toString().indexOf("px")!=-1?b.host[0].style.width=b.width:void 0==b.width||isNaN(b.width)||(b.host[0].style.width=parseInt(b.width)+"px"),null!=b.height&&b.height.toString().indexOf("px")!=-1?b.host[0].style.height=b.height:void 0==b.height||isNaN(b.height)||(b.host[0].style.height=parseInt(b.height)+"px");var c=!1;null!=b.width&&b.width.toString().indexOf("%")!=-1&&(c=!0,b.host.width(b.width)),null!=b.height&&b.height.toString().indexOf("%")!=-1&&(c=!0,b.host.height(b.height));var d=this;c&&b.refresh(!1),a.jqx.utilities.resize(b.host,function(){d._arrange()})},isOpened:function(){var b=this,c=a.data(document.body,"openedJQXButton"+b.element.id);return null!=c&&c==b.popupContent},focus:function(){try{b.host.focus()}catch(a){}},render:function(){b.removeHandlers();var c=this,d=!1;b.touch||(b.addHandler(b.host,"mouseenter",function(){!c.disabled&&c.enableHover&&(d=!0,c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-hover")),c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down-hover")),c.host.addClass(c.toThemeProperty("jqx-fill-state-hover")))}),b.addHandler(b.host,"mouseleave",function(){!c.disabled&&c.enableHover&&(c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-hover")),c.host.removeClass(c.toThemeProperty("jqx-fill-state-hover")),c.arrow.removeClass(c.toThemeProperty("jqx-icon-arrow-down-hover")),d=!1)})),c.autoOpen&&(b.addHandler(b.host,"mouseenter",function(){var a=c.isOpened();!a&&c.autoOpen&&(c.open(),c.host.focus())}),b.addHandler(a(document),"mousemove."+c.element.id,function(a){var b=c.isOpened();if(b&&c.autoOpen){var d=c.host.coord(),e=d.top,f=d.left,g=c.container.coord(),h=g.left,i=g.top;canClose=!0,a.pageY>=e&&a.pageY<=e+c.host.height()&&a.pageX>=f&&a.pageX<f+c.host.width()&&(canClose=!1),a.pageY>=i&&a.pageY<=i+c.container.height()&&a.pageX>=h&&a.pageX<h+c.container.width()&&(canClose=!1),canClose&&c.close()}})),b.addHandler(b.dropDownButtonWrapper,"mousedown",function(a){if(!c.disabled){var b="visible"==c.container.css("visibility");if(!c.isanimating){if(b)return c.close(),!1;c.open(),c.focusable||a.preventDefault&&a.preventDefault()}}}),b.touch&&b.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+b.element.id,c.closeOpenedDropDown,{me:this,popup:b.container,id:b.element.id}),b.addHandler(a(document),"mousedown."+b.element.id,c.closeOpenedDropDown,{me:this,popup:b.container,id:b.element.id}),b.addHandler(b.host,"keydown",function(a){var b="visible"==c.container.css("visibility");return"none"==c.host.css("display")||("13"==a.keyCode&&(c.isanimating||b&&c.close()),115==a.keyCode?(c.isanimating||(c.isOpened()?c.isOpened()&&c.close():c.open()),!1):(a.altKey&&"block"==c.host.css("display")&&(38==a.keyCode?c.isOpened()&&c.close():40==a.keyCode&&(c.isOpened()||c.open())),void("27"==a.keyCode&&(c.ishiding||(c.close(),void 0!=c.tempSelectedIndex&&c.selectIndex(c.tempSelectedIndex))))))}),b.addHandler(b.firstDiv,"focus",function(){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}),b.addHandler(b.firstDiv,"blur",function(){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))})},removeHandlers:function(){var c=this;b.removeHandler(b.dropDownButtonWrapper,"mousedown"),b.removeHandler(b.host,"keydown"),b.removeHandler(b.firstDiv,"focus"),b.removeHandler(b.firstDiv,"blur"),b.removeHandler(b.host,"mouseenter"),b.removeHandler(b.host,"mouseleave"),b.autoOpen&&(b.removeHandler(b.host,"mouseenter"),b.removeHandler(b.host,"mouseleave")),b.removeHandler(a(document),"mousemove."+c.element.id)},_findPos:function(b){for(;b&&("hidden"==b.type||1!=b.nodeType||a.expr.filters.hidden(b));)b=b.nextSibling;var c=a(b).coord(!0);return[c.left,c.top]},testOffset:function(c,d,e){var f=c.outerWidth(),g=c.outerHeight(),h=a(window).width()+a(window).scrollLeft(),i=a(window).height()+a(window).scrollTop();if(d.left+f>h&&f>b.host.width()){var j=b.host.coord().left,k=f-b.host.width();d.left=j-k+2}return d.left<0&&(d.left=parseInt(b.host.coord().left)+"px"),d.top-=Math.min(d.top,d.top+g>i&&i>g?Math.abs(g+e+22):0),d},_getBodyOffset:function(){var b=0,c=0;return"0px"!=a("body").css("border-top-width")&&(b=parseInt(a("body").css("border-top-width")),isNaN(b)&&(b=0)),"0px"!=a("body").css("border-left-width")&&(c=parseInt(a("body").css("border-left-width")),isNaN(c)&&(c=0)),{left:c,top:b}},open:function(){a.jqx.aria(this,"aria-expanded",!0);var b=this,c=this;if((null==b.dropDownWidth||"auto"==b.dropDownWidth)&&null!=b.width&&b.width.indexOf&&b.width.indexOf("%")!=-1){var d=b.host.width();b.container.width(parseInt(d))}c._raiseEvent("2");var e,f=b.popupContent,g=(a(window).scrollTop(),a(window).scrollLeft(),parseInt(b._findPos(b.host[0])[1])+parseInt(b.host.outerHeight())-1+"px"),h=parseInt(Math.round(b.host.coord(!0).left));e=h+"px";var i=a.jqx.mobile.isSafariMobileBrowser()||a.jqx.mobile.isWindowsPhone();b.ishiding=!1,b.tempSelectedIndex=b.selectedIndex,null!=i&&i&&(e=a.jqx.mobile.getLeftPos(b.element),g=a.jqx.mobile.getTopPos(b.element)+parseInt(b.host.outerHeight()),"0px"!=a("body").css("border-top-width")&&(g=parseInt(g)-b._getBodyOffset().top+"px"),"0px"!=a("body").css("border-left-width")&&(e=parseInt(e)-b._getBodyOffset().left+"px")),f.stop(),b.host.addClass(b.toThemeProperty("jqx-dropdownlist-state-selected")),b.host.addClass(b.toThemeProperty("jqx-fill-state-pressed")),b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down-selected"));var j=!1;a.jqx.browser.msie&&a.jqx.browser.version<8&&(j=!0),j&&b.container.css("display","block"),b.container.css("left",e),b.container.css("top",g);var k=!1,l=function(){if("right"==b.dropDownHorizontalAlignment||b.rtl){var a=b.container.width(),c=Math.abs(a-b.host.width());a>b.host.width()?b.container.css("left",parseInt(Math.round(h))-c+"px"):b.container.css("left",parseInt(Math.round(h))+c+"px")}};if(l.call(this),"top"==b.dropDownVerticalAlignment){var m=f.height();k=!0,b.container.height(f.outerHeight()),f.addClass(this.toThemeProperty("jqx-popup-up"));var n=parseInt(b.host.outerHeight()),o=parseInt(g)-Math.abs(m+n);b.interval&&clearInterval(b.interval),b.interval=setInterval(function(){if(f.outerHeight()!=b.container.height()){b.container.height(f.outerHeight());var a=parseInt(g)-Math.abs(f.height()+n);b.container.css("top",a)}},50),f.css("top",23),b.container.css("top",o)}if(b.enableBrowserBoundsDetection){var p=b.testOffset(f,{left:parseInt(b.container.css("left")),top:parseInt(g)},parseInt(b.host.outerHeight()));parseInt(b.container.css("top"))!=p.top?(k=!0,b.container.height(f.outerHeight()),f.css("top",23),b.interval&&clearInterval(b.interval),b.interval=setInterval(function(){if(f.outerHeight()!=c.container.height()){var a=c.testOffset(f,{left:parseInt(b.container.css("left")),top:parseInt(g)},parseInt(b.host.outerHeight()));b.container.css("top",a.top),b.container.height(f.outerHeight())}},50)):f.css("top",0),b.container.css("top",p.top),parseInt(b.container.css("left"))!=p.left&&b.container.css("left",p.left)}if("none"==b.animationType)b.container.css("visibility","visible"),a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+b.element.id,f),f.css("margin-top",0),f.css("opacity",1),b._raiseEvent("0"),l.call(c);else{b.container.css("visibility","visible");var q=f.outerHeight();c.isanimating=!0,"fade"==b.animationType?(f.css("margin-top",0),f.css("opacity",0),f.animate({opacity:1},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}),l.call(c)):(f.css("opacity",1),k?f.css("margin-top",q):f.css("margin-top",-q),l.call(c),k?f.animate({"margin-top":0},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}):f.animate({"margin-top":0},b.openDelay,function(){a.data(document.body,"openedJQXButtonParent",c),a.data(document.body,"openedJQXButton"+c.element.id,f),c.ishiding=!1,c.isanimating=!1,c._raiseEvent("0")}))}k?(b.host.addClass(b.toThemeProperty("jqx-rc-t-expanded")),b.container.addClass(b.toThemeProperty("jqx-rc-b-expanded"))):(b.host.addClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.addClass(b.toThemeProperty("jqx-rc-t-expanded"))),b.focusable&&(b.firstDiv.focus(),setTimeout(function(){c.firstDiv.focus()},10)),b.container.addClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus")),b.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))},close:function(){a.jqx.aria(this,"aria-expanded",!1);var b=this,c=b.popupContent,d=b.container,e=this;e._raiseEvent("3");var f=!1;if(a.jqx.browser.msie&&a.jqx.browser.version<8&&(f=!0),b.isOpened()){if(a.data(document.body,"openedJQXButton"+b.element.id,null),"none"==b.animationType)b.container.css("visibility","hidden"),f&&b.container.css("display","none");else if(!e.ishiding){e.isanimating=!0,c.stop();var g=c.outerHeight();c.css("margin-top",0);var h=-g;parseInt(b.container.coord().top)<parseInt(b.host.coord().top)&&(h=g),"fade"==b.animationType?(c.css({opacity:1}),c.animate({opacity:0},b.closeDelay,function(){d.css("visibility","hidden"),e.isanimating=!1,e.ishiding=!1,f&&d.css("display","none")})):c.animate({"margin-top":h},b.closeDelay,function(){d.css("visibility","hidden"),e.isanimating=!1,e.ishiding=!1,f&&d.css("display","none")})}b.ishiding=!0,b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-selected")),b.host.removeClass(b.toThemeProperty("jqx-fill-state-pressed")),b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down-selected")),b.host.removeClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.removeClass(b.toThemeProperty("jqx-rc-t-expanded")),b.host.removeClass(b.toThemeProperty("jqx-rc-t-expanded")),b.container.removeClass(b.toThemeProperty("jqx-rc-b-expanded")),b.container.removeClass(b.toThemeProperty("jqx-fill-state-focus")),b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-focus")),b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus")),b._raiseEvent("1")}},closeOpenedDropDown:function(b){var c=b.data.me,d=a(b.target);if(a(b.target).ischildof(b.data.me.host))return!0;if(a(b.target).ischildof(b.data.me.popupContent))return!0;var e=!1;return a.each(d.parents(),function(){if("undefined"!=this.className){if(this.className.indexOf&&this.className.indexOf("dropDownButton")!=-1)return e=!0,!1;if(this.className.indexOf&&this.className.indexOf("jqx-popup")!=-1)return e=!0,!1}}),e||c.close(),!0},refresh:function(){b._arrange()},_arrange:function(){var a=this,b=parseInt(a.host.width()),c=parseInt(a.host.height()),d=(a.arrowSize,a.arrowSize),e=3,f=b-d-2*e;if(f>0&&(a.dropDownButtonContent[0].style.width=f+"px"),a.dropDownButtonContent[0].style.height=parseInt(c)+"px",a.dropDownButtonContent[0].style.left="0px",a.dropDownButtonContent[0].style.top="0px",a.dropDownButtonArrow[0].style.width=parseInt(d)+"px",a.dropDownButtonArrow[0].style.height=parseInt(c)+"px",a.rtl&&(a.dropDownButtonArrow.css("float","left"),a.dropDownButtonContent.css("float","right"),a.dropDownButtonContent.css("left",-e)),null!=a.dropDownWidth)if(a.dropDownWidth.toString().indexOf("%")>=0){var b=parseInt(a.dropDownWidth)*a.host.width()/100;a.container.width(b)}else a.container.width(a.dropDownWidth);null!=a.dropDownHeight&&a.container.height(a.dropDownHeight)},destroy:function(){a.jqx.utilities.resize(this.host,null,!0);var b=this;b.interval&&clearInterval(b.interval),b.removeHandler(b.dropDownButtonWrapper,"selectstart"),b.removeHandler(b.dropDownButtonWrapper,"mousedown"),b.removeHandler(b.host,"keydown"),b.host.removeClass(),b.removeHandler(a(document),"mousedown."+b.element.id,self.closeOpenedDropDown),b.host.remove(),b.container.remove()},_raiseEvent:function(c,d){void 0==d&&(d={owner:null}),2!=c||b.contentInitialized||b.initContent&&(b.initContent(),b.contentInitialized=!0);var e=b.events[c];args=d,args.owner=this;var f=new a.Event(e);f.owner=this,2!=c&&3!=c&&4!=c||(f.args=d);var g=b.host.trigger(f);return g},resize:function(a,c){b.width=a,b.height=c,b._setSize(),b._arrange()},propertiesChangedHandler:function(a,b,c){c.width&&c.height&&2==Object.keys(c).length&&(a._setSize(),a._arrange(),a.close())},propertyChangedHandler:function(c,d,e,f){void 0!=b.isInitialized&&0!=b.isInitialized&&(c.batchUpdate&&c.batchUpdate.width&&c.batchUpdate.height&&2==Object.keys(c.batchUpdate).length||("template"==d&&(c.host.removeClass(c.toThemeProperty("jqx-"+e)),c.host.addClass(c.toThemeProperty("jqx-"+c.template))),"rtl"==d&&(f?(c.dropDownButtonArrow.css("float","left"),c.dropDownButtonContent.css("float","right")):(c.dropDownButtonArrow.css("float","right"),c.dropDownButtonContent.css("float","left"))),"autoOpen"==d&&c.render(),"theme"==d&&null!=f&&a.jqx.utilities.setTheme(e,f,c.host),"width"!=d&&"height"!=d||(c._setSize(),c._arrange())))}};a.extend(!0,this,c)}})}(jqxBaseFramework);
-
+jQWidgets v12.0.1 (2021-Mar)
+Copyright (c) 2011-2021 jQWidgets.
+License: https://jqwidgets.com/license/
+*/
+/* eslint-disable */
+
+(function(a){a.jqx.jqxWidget("jqxDropDownButton","",{});a.extend(a.jqx._jqxDropDownButton.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,arrowSize:17,enableHover:true,openDelay:250,closeDelay:300,animationType:"default",placeHolder:"",enableBrowserBoundsDetection:false,dropDownHorizontalAlignment:"left",dropDownVerticalAlignment:"bottom",popupZIndex:1500,dropDownContainer:"default",autoOpen:false,rtl:false,initContent:null,dropDownWidth:null,dropDownHeight:null,focusable:true,template:"default",touchMode:false,hint:true,aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","opening","closing"]};if(this===a.jqx._jqxDropDownButton.prototype){return b}a.extend(true,this,b);return b},createInstance:function(k){var h=this;if(!h.width){h.width=200}if(!h.height){h.height=25}h.isanimating=false;var c=a("<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropDownButtonWrapper' style='outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropDownButtonContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'></div><div id='dropDownButtonArrow' unselectable='on'  style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>");if(h.isMaterialized()){var n=window.getComputedStyle(this.element);var f=n.getPropertyValue("--jqx-dropdown-animation");if(f&&this.animationType=="default"){this.animationType=f.trim()}}if(h.host.attr("tabindex")){c.attr("tabindex",h.host.attr("tabindex"));h.host.removeAttr("tabindex")}else{c.attr("tabindex",0)}if(!h.focusable){c.removeAttr("tabIndex")}a.jqx.aria(this);h.popupContent=h.host.children();h.host.attr("role","button");if(h.popupContent.length==0){h.popupContent=a("<div>"+h.host.text()+"</div>");h.popupContent.css("display","block");h.element.innerHTML=""}else{h.popupContent.detach()}var l=this;h.addHandler(h.host,"loadContent",function(e){l._arrange()});try{var g="dropDownButtonPopup"+h.element.id;var d=a(a.find("#"+g));if(d.length>0){d.remove()}a.jqx.aria(this,"aria-haspopup",true);a.jqx.aria(this,"aria-owns",g);var b=a("<div class='dropDownButton' style='overflow: hidden; left: -1000px; top: -1000px; position: absolute;' id='dropDownButtonPopup"+h.element.id+"'></div>");b.addClass(h.toThemeProperty("jqx-widget-content"));b.addClass(h.toThemeProperty("jqx-dropdownbutton-popup"));b.addClass(h.toThemeProperty("jqx-popup"));b.addClass(h.toThemeProperty("jqx-rc-all"));if(h.dropDownContainer!="element"){b.css("z-index",h.popupZIndex)}b.addClass(h.toThemeProperty("jqx-listbox-container"));if(a.jqx.browser.msie){b.addClass(h.toThemeProperty("jqx-noshadow"))}h.popupContent.appendTo(b);if(h.dropDownContainer=="element"){b.appendTo(h.host)}else{b.appendTo(document.body)}h.container=b;h.container.css("visibility","hidden")}catch(i){}h.touch=a.jqx.mobile.isTouchDevice();h.dropDownButtonStructure=c;h.host.append(c);h.dropDownButtonWrapper=h.host.find("#dropDownButtonWrapper");h.firstDiv=h.dropDownButtonWrapper.parent();h.dropDownButtonArrow=h.host.find("#dropDownButtonArrow");h.arrow=a(h.dropDownButtonArrow.children()[0]);h.dropDownButtonContent=h.host.find("#dropDownButtonContent");h.dropDownButtonContent.addClass(h.toThemeProperty("jqx-dropdownlist-content"));h.dropDownButtonWrapper.addClass(h.toThemeProperty("jqx-disableselect"));if(h.rtl){h.dropDownButtonContent.addClass(h.toThemeProperty("jqx-rtl"))}var o=this;if(h.host.parents()){h.addHandler(h.host.parents(),"scroll.dropdownbutton"+h.element.id,function(e){var p=o.isOpened();if(p){o.close()}})}h.addHandler(h.dropDownButtonWrapper,"selectstart",function(){return false});h.dropDownButtonWrapper[0].id="dropDownButtonWrapper"+h.element.id;h.dropDownButtonArrow[0].id="dropDownButtonArrow"+h.element.id;h.dropDownButtonContent[0].id="dropDownButtonContent"+h.element.id;var o=this;h.propertyChangeMap.disabled=function(e,q,p,r){if(r){e.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(o.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.addClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}else{e.host.removeClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.removeClass(o.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.removeClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(h.disabled){h.host.addClass(h.toThemeProperty("jqx-dropdownlist-state-disabled"));h.host.addClass(h.toThemeProperty("jqx-fill-state-disabled"));h.dropDownButtonContent.addClass(h.toThemeProperty("jqx-dropdownlist-content-disabled"))}var j=h.toThemeProperty("jqx-rc-all")+" "+h.toThemeProperty("jqx-fill-state-normal")+" "+h.toThemeProperty("jqx-widget")+" "+h.toThemeProperty("jqx-widget-content")+" "+h.toThemeProperty("jqx-dropdownlist-state-normal");h.host.addClass(j);h.arrow.addClass(h.toThemeProperty("jqx-icon-arrow-down"));h.arrow.addClass(h.toThemeProperty("jqx-icon"));if(h.template){h.host.addClass(h.toThemeProperty("jqx-"+h.template))}h._setSize();h.render();if(a.jqx.browser.msie&&a.jqx.browser.version<8){h.container.css("display","none");if(h.host.parents(".jqx-window").length>0){var m=h.host.parents(".jqx-window").css("z-index");b.css("z-index",m+10);h.container.css("z-index",m+10)}}},setContent:function(b){var c=this;c.dropDownButtonContent.children().remove();c.dropDownButtonContent[0].innerHTML="";c.dropDownButtonContent.append(b)},val:function(c){var b=this;if(arguments.length==0||typeof(c)=="object"){return b.dropDownButtonContent.text()}else{b.dropDownButtonContent.html(c)}},getContent:function(){var b=this;if(b.dropDownButtonContent.children().length>0){return b.dropDownButtonContent.children()}return b.dropDownButtonContent.text()},_setSize:function(){var e=this;var b=window.getComputedStyle(this.element);var c=parseInt(b.borderLeftWidth)*2;var g=b.boxSizing;if(g==="border-box"||isNaN(c)){c=0}if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.element.style.width=parseInt(this.width)-c+"px"}else{if(this.width!=undefined&&!isNaN(this.width)){this.element.style.width=parseInt(this.width)-c+"px"}}if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.element.style.height=parseInt(this.height)-c+"px"}else{if(this.height!=undefined&&!isNaN(this.height)){this.element.style.height=parseInt(this.height)-c+"px"}}var f=false;if(e.width!=null&&e.width.toString().indexOf("%")!=-1){f=true;e.host.width(e.width);if(c>0){this.host.css("box-sizing","border-box")}}if(e.height!=null&&e.height.toString().indexOf("%")!=-1){f=true;e.host.height(e.height)}var d=this;if(f){e.refresh(false)}a.jqx.utilities.resize(e.host,function(){d._arrange()})},isOpened:function(){var c=this;var b=a.data(document.body,"openedJQXButton"+c.element.id);if(b!=null&&b==c.popupContent){return true}return false},focus:function(){var c=this;try{c.host.focus()}catch(b){}},render:function(){var f=this;f.removeHandlers();var b=this;var d=false;if(!f.touch){f.addHandler(f.host,"mouseenter",function(){if(!b.disabled&&b.enableHover){d=true;b.host.addClass(b.toThemeProperty("jqx-dropdownlist-state-hover"));b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down-hover"));b.host.addClass(b.toThemeProperty("jqx-fill-state-hover"))}});f.addHandler(f.host,"mouseleave",function(){if(!b.disabled&&b.enableHover){b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-hover"));b.host.removeClass(b.toThemeProperty("jqx-fill-state-hover"));b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down-hover"));d=false}})}if(b.autoOpen){f.addHandler(f.host,"mouseenter",function(){var g=b.isOpened();if(!g&&b.autoOpen){b.open();b.host.focus()}});f.addHandler(a(document),"mousemove."+b.element.id,function(g){var n=b.isOpened();if(n&&b.autoOpen){var k=b.host.coord();var l=k.top;var j=k.left;var h=b.container.coord();var o=h.left;var m=h.top;var i=true;if(g.pageY>=l&&g.pageY<=l+b.host.height()){if(g.pageX>=j&&g.pageX<j+b.host.width()){i=false}}if(g.pageY>=m&&g.pageY<=m+b.container.height()){if(g.pageX>=o&&g.pageX<o+b.container.width()){i=false}}if(i){b.close()}}})}f.addHandler(f.dropDownButtonWrapper,"mousedown",function(h){if(!b.disabled){var g=b.container.css("visibility")=="visible";if(!b.isanimating){if(g){b.close();return false}else{b.open();if(!b.focusable){if(h.preventDefault){h.preventDefault()}}}}}});if(f.touch){f.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+f.element.id,b.closeOpenedDropDown,{me:this,popup:f.container,id:f.element.id})}f.addHandler(a(document),"mousedown."+f.element.id,b.closeOpenedDropDown,{me:this,popup:f.container,id:f.element.id});f.addHandler(f.host,"keydown",function(h){var g=b.container.css("visibility")=="visible";if(b.host.css("display")=="none"){return true}if(h.keyCode=="13"){if(!b.isanimating){if(g){b.close()}}}if(h.keyCode==115){if(!b.isanimating){if(!b.isOpened()){b.open()}else{if(b.isOpened()){b.close()}}}return false}if(h.altKey){if(b.host.css("display")=="block"){if(h.keyCode==38){if(b.isOpened()){b.close()}}else{if(h.keyCode==40){if(!b.isOpened()){b.open()}}}}}if(h.keyCode=="27"){if(!b.ishiding){b.close();if(b.tempSelectedIndex!=undefined){b.selectIndex(b.tempSelectedIndex)}}}});f.addHandler(f.firstDiv,"focus",function(){b.host.addClass(b.toThemeProperty("jqx-dropdownlist-state-focus"));b.host.addClass(b.toThemeProperty("jqx-fill-state-focus"))});f.addHandler(f.firstDiv,"blur",function(){b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-focus"));b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus"))});var c=a("<label></label");if(this.hint){c[0].innerHTML=this.placeHolder}c.addClass(b.toThemeProperty("jqx-input-label"));b.dropDownButtonWrapper.append(c);b.label=c;var e=a("<span></span>");b.dropDownButtonWrapper.append(e);e.addClass(b.toThemeProperty("jqx-input-bar"));b.bar=e;b.bar.css("top",this.host.height());var f=this;if(f.template){f.bar.addClass(f.toThemeProperty("jqx-"+f.template));f.label.addClass(f.toThemeProperty("jqx-"+f.template))}},removeHandlers:function(){var c=this;var b=this;c.removeHandler(c.dropDownButtonWrapper,"mousedown");c.removeHandler(c.host,"keydown");c.removeHandler(c.firstDiv,"focus");c.removeHandler(c.firstDiv,"blur");c.removeHandler(c.host,"mouseenter");c.removeHandler(c.host,"mouseleave");if(c.autoOpen){c.removeHandler(c.host,"mouseenter");c.removeHandler(c.host,"mouseleave")}c.removeHandler(a(document),"mousemove."+b.element.id)},_findPos:function(c){while(c&&(c.type=="hidden"||c.nodeType!=1||a.expr.filters.hidden(c))){c=c.nextSibling}var b=a(c).coord(true);return[b.left,b.top]},testOffset:function(h,f,c){var j=this;var g=h.outerWidth();var k=h.outerHeight();var i=a(window).width()+a(window).scrollLeft();var e=a(window).height()+a(window).scrollTop();if(f.left+g>i){if(g>j.host.width()){var d=j.host.coord().left;var b=g-j.host.width();f.left=d-b+2}}if(f.left<0){f.left=parseInt(j.host.coord().left)+"px"}f.top-=Math.min(f.top,(f.top+k>e&&e>k)?Math.abs(k+c+22):0);return f},_getBodyOffset:function(){var c=0;var b=0;if(a("body").css("border-top-width")!="0px"){c=parseInt(a("body").css("border-top-width"));if(isNaN(c)){c=0}}if(a("body").css("border-left-width")!="0px"){b=parseInt(a("body").css("border-left-width"));if(isNaN(b)){b=0}}return{left:b,top:c}},open:function(){a.jqx.aria(this,"aria-expanded",true);var i=this;var o=this;if((i.dropDownWidth==null||i.dropDownWidth=="auto")&&i.width!=null&&i.width.indexOf&&i.width.indexOf("%")!=-1){var q=i.host.width();i.container.width(parseInt(q))}o._raiseEvent("2");var c=i.popupContent;var f=a(window).scrollTop();var g=a(window).scrollLeft();var m=parseInt(i._findPos(i.host[0])[1])+parseInt(i.host.outerHeight())-1+"px";var e,p=parseInt(Math.round(i.host.coord(true).left));e=p+"px";var u=false;i.ishiding=false;i.tempSelectedIndex=i.selectedIndex;if((u!=null&&u)){e=a.jqx.mobile.getLeftPos(i.element);m=a.jqx.mobile.getTopPos(i.element)+parseInt(i.host.outerHeight());if(a("body").css("border-top-width")!="0px"){m=parseInt(m)-i._getBodyOffset().top+"px"}if(a("body").css("border-left-width")!="0px"){e=parseInt(e)-i._getBodyOffset().left+"px"}}c.stop();i.host.addClass(i.toThemeProperty("jqx-dropdownlist-state-selected"));i.host.addClass(i.toThemeProperty("jqx-fill-state-pressed"));i.arrow.addClass(i.toThemeProperty("jqx-icon-arrow-down-selected"));var h=false;if(a.jqx.browser.msie&&a.jqx.browser.version<8){h=true}if(h){i.container.css("display","block")}i.container.css("left",e);i.container.css("top",m);var d=true;var b=false;var s=function(){if(i.dropDownHorizontalAlignment=="right"||i.rtl){var v=i.container.width();var t=Math.abs(v-i.host.width());if(v>i.host.width()){i.container.css("left",parseInt(Math.round(p))-t+"px")}else{i.container.css("left",parseInt(Math.round(p))+t+"px")}}};s.call(this);if(i.dropDownVerticalAlignment=="top"){var r=c.height();b=true;i.container.height(c.outerHeight());c.addClass(this.toThemeProperty("jqx-popup-up"));var l=parseInt(i.host.outerHeight());var k=parseInt(m)-Math.abs(r+l);if(i.interval){clearInterval(i.interval)}i.interval=setInterval(function(){if(c.outerHeight()!=i.container.height()){i.container.height(c.outerHeight());var v=parseInt(m)-Math.abs(c.height()+l);i.container.css("top",v)}},50);c.css("top",23);i.container.css("top",k)}if(i.enableBrowserBoundsDetection){var j=i.testOffset(c,{left:parseInt(i.container.css("left")),top:parseInt(m)},parseInt(i.host.outerHeight()));if(parseInt(i.container.css("top"))!=j.top){b=true;i.container.height(c.outerHeight());c.css("top",23);if(i.interval){clearInterval(i.interval)}i.interval=setInterval(function(){if(c.outerHeight()!=o.container.height()){var t=o.testOffset(c,{left:parseInt(i.container.css("left")),top:parseInt(m)},parseInt(i.host.outerHeight()));i.container.css("top",t.top);i.container.height(c.outerHeight())}},50)}else{c.css("top",0)}i.container.css("top",j.top);if(parseInt(i.container.css("left"))!=j.left){i.container.css("left",j.left)}}if(i.animationType=="none"){i.container.css("visibility","visible");a.data(document.body,"openedJQXButtonParent",o);a.data(document.body,"openedJQXButton"+i.element.id,c);c.css("margin-top",0);c.css("opacity",1);i._raiseEvent("0");s.call(o)}else{if(i.animationType==="transform"){i.container.css("visibility","visible");i.container.css("display","block");a.data(document.body,"openedJQXButtonParent",o);a.data(document.body,"openedJQXButton"+i.element.id,c);c.css("margin-top",0);c.css("opacity",1);i._raiseEvent("0");s.call(o)}else{i.container.css("visibility","visible");var n=c.outerHeight();o.isanimating=true;if(i.animationType=="fade"){c.css("margin-top",0);c.css("opacity",0);c.animate({opacity:1},i.openDelay,function(){a.data(document.body,"openedJQXButtonParent",o);a.data(document.body,"openedJQXButton"+o.element.id,c);o.ishiding=false;o.isanimating=false;o._raiseEvent("0")});s.call(o)}else{c.css("opacity",1);if(b){c.css("margin-top",n)}else{c.css("margin-top",-n)}s.call(o);if(b){c.animate({"margin-top":0},i.openDelay,function(){a.data(document.body,"openedJQXButtonParent",o);a.data(document.body,"openedJQXButton"+o.element.id,c);o.ishiding=false;o.isanimating=false;o._raiseEvent("0")})}else{c.animate({"margin-top":0},i.openDelay,function(){a.data(document.body,"openedJQXButtonParent",o);a.data(document.body,"openedJQXButton"+o.element.id,c);o.ishiding=false;o.isanimating=false;o._raiseEvent("0")})}}}}if(!b){i.host.addClass(i.toThemeProperty("jqx-rc-b-expanded"));i.container.addClass(i.toThemeProperty("jqx-rc-t-expanded"))}else{i.host.addClass(i.toThemeProperty("jqx-rc-t-expanded"));i.container.addClass(i.toThemeProperty("jqx-rc-b-expanded"))}if(i.focusable){i.firstDiv.focus();setTimeout(function(){o.firstDiv.focus()},10)}i.container.addClass(i.toThemeProperty("jqx-fill-state-focus"));i.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-focus"));i.host.addClass(o.toThemeProperty("jqx-fill-state-focus"));i.container.addClass("jqx-popup-show")},close:function(){a.jqx.aria(this,"aria-expanded",false);var g=this;var e=g.popupContent;var d=g.container;var f=this;f._raiseEvent("3");var c=false;if(a.jqx.browser.msie&&a.jqx.browser.version<8){c=true}if(!g.isOpened()){return}d.removeClass("jqx-popup-show");a.data(document.body,"openedJQXButton"+g.element.id,null);if(g.animationType=="none"){g.container.css("visibility","hidden");if(c){g.container.css("display","none")}e.css({opacity:0})}else{if(g.animationType==="transform"){setTimeout(function(){f.isanimating=false;g.container.css("visibility","hidden");g.container.css("display","none")},this.closeDelay)}else{if(!f.ishiding){f.isanimating=true;e.stop();var b=e.outerHeight();e.css("margin-top",0);var h=-b;if(parseInt(g.container.coord().top)<parseInt(g.host.coord().top)){h=b}if(g.animationType=="fade"){e.css({opacity:1});e.animate({opacity:0},g.closeDelay,function(){d.css("visibility","hidden");f.isanimating=false;f.ishiding=false;if(c){d.css("display","none")}})}else{e.animate({"margin-top":h},g.closeDelay,function(){d.css("visibility","hidden");f.isanimating=false;f.ishiding=false;if(c){d.css("display","none")}})}}}}g.ishiding=true;g.host.removeClass(g.toThemeProperty("jqx-dropdownlist-state-selected"));g.host.removeClass(g.toThemeProperty("jqx-fill-state-pressed"));g.arrow.removeClass(g.toThemeProperty("jqx-icon-arrow-down-selected"));g.host.removeClass(g.toThemeProperty("jqx-rc-b-expanded"));g.container.removeClass(g.toThemeProperty("jqx-rc-t-expanded"));g.host.removeClass(g.toThemeProperty("jqx-rc-t-expanded"));g.container.removeClass(g.toThemeProperty("jqx-rc-b-expanded"));g.container.removeClass(g.toThemeProperty("jqx-fill-state-focus"));g.host.removeClass(g.toThemeProperty("jqx-dropdownlist-state-focus"));g.host.removeClass(g.toThemeProperty("jqx-fill-state-focus"));g._raiseEvent("1")},closeOpenedDropDown:function(e){var c=e.data.me;var b=a(e.target);if(a(e.target).ischildof(e.data.me.host)){return true}if(a(e.target).ischildof(e.data.me.popupContent)){return true}var f=c;var d=false;a.each(b.parents(),function(){if(this.className!="undefined"){if(this.className.indexOf&&this.className.indexOf("dropDownButton")!=-1){d=true;return false}if(this.className.indexOf&&this.className.indexOf("jqx-popup")!=-1){d=true;return false}}});if(!d){c.close()}return true},refresh:function(){var b=this;b._arrange()},_arrange:function(){var g=this;var f=parseInt(g.host.width());var b=parseInt(g.host.height());var e=g.arrowSize;var d=g.arrowSize;var h=3;var c=f-d-2*h;if(c>0){g.dropDownButtonContent[0].style.width=c+"px"}g.dropDownButtonContent[0].style.height=parseInt(b)+"px";g.dropDownButtonContent[0].style.left="0px";g.dropDownButtonContent[0].style.top="0px";g.dropDownButtonArrow[0].style.width=parseInt(d)+"px";g.dropDownButtonArrow[0].style.height=parseInt(b)+"px";if(g.rtl){g.dropDownButtonArrow.css("float","left");g.dropDownButtonContent.css("float","right");g.dropDownButtonContent.css("left",-h)}if(g.dropDownWidth!=null){if(g.dropDownWidth.toString().indexOf("%")>=0){var f=(parseInt(g.dropDownWidth)*g.host.width())/100;g.container.width(f)}else{g.container.width(g.dropDownWidth)}}if(g.dropDownHeight!=null){g.container.height(g.dropDownHeight)}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);var b=this;if(b.interval){clearInterval(b.interval)}b.removeHandler(b.dropDownButtonWrapper,"selectstart");b.removeHandler(b.dropDownButtonWrapper,"mousedown");b.removeHandler(b.host,"keydown");b.host.removeClass();b.removeHandler(a(document),"mousedown."+b.element.id,b.closeOpenedDropDown);b.host.remove();b.container.remove()},_raiseEvent:function(h,c){var g=this;if(c==undefined){c={owner:null}}if(h==2&&!g.contentInitialized){if(g.initContent){g.initContent();g.contentInitialized=true}}var d=g.events[h];var e=c;e.owner=this;var f=new a.Event(d);f.owner=this;if(h==2||h==3||h==4){f.args=c}var b=g.host.trigger(f);return b},resize:function(c,b){var d=this;d.width=c;d.height=b;d._setSize();d._arrange()},propertiesChangedHandler:function(b,c,d){if(d.width&&d.height&&Object.keys(d).length==2){b._setSize();b._arrange();b.close()}},propertyChangedHandler:function(b,c,f,e){var d=this;if(d.isInitialized==undefined||d.isInitialized==false){return}if(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&Object.keys(b.batchUpdate).length==2){return}if(c==="dropDownVerticalAlignment"){b.close()}if(c=="template"){b.host.removeClass(b.toThemeProperty("jqx-"+f+""));b.host.addClass(b.toThemeProperty("jqx-"+b.template+""))}if(c=="rtl"){if(e){b.dropDownButtonArrow.css("float","left");b.dropDownButtonContent.css("float","right")}else{b.dropDownButtonArrow.css("float","right");b.dropDownButtonContent.css("float","left")}}if(c=="autoOpen"){b.render()}if(c=="theme"&&e!=null){a.jqx.utilities.setTheme(f,e,b.host)}if(c=="width"||c=="height"){b._setSize();b._arrange()}}})})(jqxBaseFramework);
+

mercurial