jqwidgets-ng 15.1.0 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/jqxsplitlayout/angular_jqxsplitlayout.mjs +8 -13
- package/fesm2015/jqwidgets-ng-jqxsplitlayout.mjs +8 -13
- package/fesm2020/jqwidgets-ng-jqxsplitlayout.mjs +8 -13
- package/jqwidgets/jqx-all.js +38 -38
- package/jqwidgets/jqxangular.js +2 -2
- package/jqwidgets/jqxbarcode.js +16 -16
- package/jqwidgets/jqxbargauge.js +2 -2
- package/jqwidgets/jqxbulletchart.js +2 -2
- package/jqwidgets/jqxbuttongroup.js +2 -2
- package/jqwidgets/jqxbuttons.js +2 -2
- package/jqwidgets/jqxcalendar.js +3 -3
- package/jqwidgets/jqxchart.annotations.js +2 -2
- package/jqwidgets/jqxchart.api.js +2 -2
- package/jqwidgets/jqxchart.core.js +2 -2
- package/jqwidgets/jqxchart.js +2 -2
- package/jqwidgets/jqxchart.rangeselector.js +2 -2
- package/jqwidgets/jqxchart.waterfall.js +2 -2
- package/jqwidgets/jqxcheckbox.js +2 -2
- package/jqwidgets/jqxcheckboxgroup.js +11 -0
- package/jqwidgets/jqxcolorpicker.js +2 -2
- package/jqwidgets/jqxcombobox.js +3 -3
- package/jqwidgets/jqxcomplexinput.js +3 -3
- package/jqwidgets/jqxcore.js +3 -3
- package/jqwidgets/jqxdata.export.js +2 -2
- package/jqwidgets/jqxdata.js +2 -2
- package/jqwidgets/jqxdatatable.js +2 -2
- package/jqwidgets/jqxdate.js +2 -2
- package/jqwidgets/jqxdatetimeinput.js +2 -2
- package/jqwidgets/jqxdocking.js +2 -2
- package/jqwidgets/jqxdockinglayout.js +2 -2
- package/jqwidgets/jqxdockpanel.js +2 -2
- package/jqwidgets/jqxdragdrop.js +2 -2
- package/jqwidgets/jqxdraw.js +2 -2
- package/jqwidgets/jqxdropdownbutton.js +3 -3
- package/jqwidgets/jqxdropdownlist.js +3 -3
- package/jqwidgets/jqxeditor.js +2 -2
- package/jqwidgets/jqxexpander.js +2 -2
- package/jqwidgets/jqxfileupload.js +2 -2
- package/jqwidgets/jqxform.js +3 -3
- package/jqwidgets/jqxformattedinput.js +2 -2
- package/jqwidgets/jqxgauge.js +2 -2
- package/jqwidgets/jqxgrid.aggregates.js +2 -2
- package/jqwidgets/jqxgrid.columnsreorder.js +2 -2
- package/jqwidgets/jqxgrid.columnsresize.js +3 -3
- package/jqwidgets/jqxgrid.edit.js +3 -3
- package/jqwidgets/jqxgrid.export.js +2 -2
- package/jqwidgets/jqxgrid.filter.js +3 -3
- package/jqwidgets/jqxgrid.grouping.js +2 -2
- package/jqwidgets/jqxgrid.js +3 -3
- package/jqwidgets/jqxgrid.pager.js +2 -2
- package/jqwidgets/jqxgrid.selection.js +3 -3
- package/jqwidgets/jqxgrid.sort.js +2 -2
- package/jqwidgets/jqxgrid.storage.js +2 -2
- package/jqwidgets/jqxheatmap.js +2 -2
- package/jqwidgets/jqxinput.js +3 -3
- package/jqwidgets/jqxkanban.js +3 -3
- package/jqwidgets/jqxknob.js +2 -2
- package/jqwidgets/jqxknockout.js +2 -2
- package/jqwidgets/jqxlayout.js +2 -2
- package/jqwidgets/jqxlistbox.js +3 -3
- package/jqwidgets/jqxlistmenu.js +2 -2
- package/jqwidgets/jqxloader.js +2 -2
- package/jqwidgets/jqxmaskedinput.js +3 -3
- package/jqwidgets/jqxmenu.js +2 -2
- package/jqwidgets/jqxnavbar.js +2 -2
- package/jqwidgets/jqxnavigationbar.js +2 -2
- package/jqwidgets/jqxnotification.js +2 -2
- package/jqwidgets/jqxnumberinput.js +2 -2
- package/jqwidgets/jqxpanel.js +2 -2
- package/jqwidgets/jqxpasswordinput.js +3 -3
- package/jqwidgets/jqxpivot.js +2 -2
- package/jqwidgets/jqxpivotdesigner.js +2 -2
- package/jqwidgets/jqxpivotgrid.js +2 -2
- package/jqwidgets/jqxpopover.js +2 -2
- package/jqwidgets/jqxprogressbar.js +2 -2
- package/jqwidgets/jqxqrcode.js +2 -2
- package/jqwidgets/jqxradiobutton.js +2 -2
- package/jqwidgets/jqxradiobuttongroup.js +11 -0
- package/jqwidgets/jqxrangeselector.js +2 -2
- package/jqwidgets/jqxrating.js +2 -2
- package/jqwidgets/jqxresponsivepanel.js +2 -2
- package/jqwidgets/jqxribbon.js +2 -2
- package/jqwidgets/jqxscheduler.api.js +2 -2
- package/jqwidgets/jqxscheduler.js +2 -2
- package/jqwidgets/jqxscrollbar.js +3 -3
- package/jqwidgets/jqxscrollview.js +2 -2
- package/jqwidgets/jqxslider.js +2 -2
- package/jqwidgets/jqxsortable.js +2 -2
- package/jqwidgets/jqxsplitlayout.js +2 -2
- package/jqwidgets/jqxsplitter.js +3 -3
- package/jqwidgets/jqxswitchbutton.js +2 -2
- package/jqwidgets/jqxtabs.js +2 -2
- package/jqwidgets/jqxtagcloud.js +2 -2
- package/jqwidgets/jqxtextarea.js +2 -2
- package/jqwidgets/jqxtimepicker.js +2 -2
- package/jqwidgets/jqxtoolbar.js +2 -2
- package/jqwidgets/jqxtooltip.js +3 -3
- package/jqwidgets/jqxtouch.js +2 -2
- package/jqwidgets/jqxtree.js +2 -2
- package/jqwidgets/jqxtreegrid.js +2 -2
- package/jqwidgets/jqxtreemap.js +2 -2
- package/jqwidgets/jqxvalidator.js +2 -2
- package/jqwidgets/jqxwindow.js +2 -2
- package/jqwidgets/styles/font/jqx-icons.eot +0 -0
- package/jqwidgets/styles/font/jqx-icons.svg +96 -52
- package/jqwidgets/styles/font/jqx-icons.ttf +0 -0
- package/jqwidgets/styles/font/jqx-icons.woff +0 -0
- package/jqwidgets/styles/font/jqx-icons.woff2 +0 -0
- package/jqwidgets/styles/jqx.base.css +27 -3
- package/jqwidgets/styles/jqx.dark.css +27 -1
- package/jqwidgets/styles/jqx.fluent.css +3373 -0
- package/jqwidgets/styles/jqx.fluent.css.map +1 -0
- package/jqwidgets/styles/jqx.fluent.scss +3433 -0
- package/jqwidgets/styles/jqx.fluent_old.css +1263 -0
- package/jqwidgets/styles/jqx.fluent_old.css.map +1 -0
- package/jqwidgets/styles/jqx.fluent_old.scss +1477 -0
- package/jqwidgets/styles/jqx.light.css +29 -2
- package/jqwidgets/styles/jqx.material-green.css +19 -1
- package/jqwidgets/styles/jqx.material-purple.css +20 -1
- package/jqwidgets/styles/jqx.material.css +21 -1
- package/jqwidgets.d.ts +2 -3
- package/jqxsplitlayout/angular_jqxsplitlayout.d.ts +3 -3
- package/package.json +15 -15
package/jqwidgets/jqxdate.js
CHANGED
package/jqwidgets/jqxdocking.js
CHANGED
package/jqwidgets/jqxdragdrop.js
CHANGED
package/jqwidgets/jqxdraw.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
jQWidgets
|
|
3
|
-
Copyright (c) 2011-
|
|
2
|
+
jQWidgets v16.0.1 (2023-May)
|
|
3
|
+
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://jqwidgets.com/license/
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
8
|
-
(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");h.host.addClass(h.toThemeProperty("jqx-dropdownbutton"));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"));if(b.bar){b.bar.addClass("focused");b.label.addClass("focused")}});f.addHandler(f.firstDiv,"blur",function(){b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-focus"));b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus"));if(b.bar){b.bar.removeClass("focused");b.label.removeClass("focused")}});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);
|
|
8
|
+
(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(l){var i=this;if(!i.width){i.width=200}if(!i.height){i.height=25}i.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(i.isMaterialized()){var o=window.getComputedStyle(this.element);var f=o.getPropertyValue("--jqx-dropdown-animation");var g=o.getPropertyValue("--jqx-action-button-size");if(g){this.arrowSize=parseInt(g)}else{this.arrowSize=25}if(f&&this.animationType=="default"){this.animationType=f.trim()}}if(i.host.attr("tabindex")){c.attr("tabindex",i.host.attr("tabindex"));i.host.removeAttr("tabindex")}else{c.attr("tabindex",0)}if(!i.focusable){c.removeAttr("tabIndex")}a.jqx.aria(this);i.popupContent=i.host.children();i.host.attr("role","button");i.host.addClass(i.toThemeProperty("jqx-dropdownbutton"));if(i.popupContent.length==0){i.popupContent=a("<div>"+i.host.text()+"</div>");i.popupContent.css("display","block");i.element.innerHTML=""}else{i.popupContent.detach()}var m=this;i.addHandler(i.host,"loadContent",function(e){m._arrange()});try{var h="dropDownButtonPopup"+i.element.id;var d=a(a.find("#"+h));if(d.length>0){d.remove()}a.jqx.aria(this,"aria-haspopup",true);a.jqx.aria(this,"aria-owns",h);var b=a("<div class='dropDownButton' style='overflow: hidden; left: -1000px; top: -1000px; position: absolute;' id='dropDownButtonPopup"+i.element.id+"'></div>");b.addClass(i.toThemeProperty("jqx-widget-content"));b.addClass(i.toThemeProperty("jqx-dropdownbutton-popup"));b.addClass(i.toThemeProperty("jqx-popup"));b.addClass(i.toThemeProperty("jqx-rc-all"));if(i.dropDownContainer!="element"){b.css("z-index",i.popupZIndex)}b.addClass(i.toThemeProperty("jqx-listbox-container"));if(a.jqx.browser.msie){b.addClass(i.toThemeProperty("jqx-noshadow"))}i.popupContent.appendTo(b);if(i.dropDownContainer=="element"){b.appendTo(i.host)}else{b.appendTo(document.body)}i.container=b;i.container.css("visibility","hidden")}catch(j){}i.touch=a.jqx.mobile.isTouchDevice();i.dropDownButtonStructure=c;i.host.append(c);i.dropDownButtonWrapper=i.host.find("#dropDownButtonWrapper");i.firstDiv=i.dropDownButtonWrapper.parent();i.dropDownButtonArrow=i.host.find("#dropDownButtonArrow");i.arrow=a(i.dropDownButtonArrow.children()[0]);i.dropDownButtonContent=i.host.find("#dropDownButtonContent");i.dropDownButtonContent.addClass(i.toThemeProperty("jqx-dropdownlist-content"));i.dropDownButtonWrapper.addClass(i.toThemeProperty("jqx-disableselect"));if(i.rtl){i.dropDownButtonContent.addClass(i.toThemeProperty("jqx-rtl"))}var p=this;if(i.host.parents()){i.addHandler(i.host.parents(),"scroll.dropdownbutton"+i.element.id,function(e){var q=p.isOpened();if(q){p.close()}})}i.addHandler(i.dropDownButtonWrapper,"selectstart",function(){return false});i.dropDownButtonWrapper[0].id="dropDownButtonWrapper"+i.element.id;i.dropDownButtonArrow[0].id="dropDownButtonArrow"+i.element.id;i.dropDownButtonContent[0].id="dropDownButtonContent"+i.element.id;var p=this;i.propertyChangeMap.disabled=function(e,r,q,s){if(s){e.host.addClass(p.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(p.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.addClass(p.toThemeProperty("jqx-dropdownlist-content-disabled"))}else{e.host.removeClass(p.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.removeClass(p.toThemeProperty("jqx-fill-state-disabled"));e.dropDownButtonContent.removeClass(p.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(i.disabled){i.host.addClass(i.toThemeProperty("jqx-dropdownlist-state-disabled"));i.host.addClass(i.toThemeProperty("jqx-fill-state-disabled"));i.dropDownButtonContent.addClass(i.toThemeProperty("jqx-dropdownlist-content-disabled"))}var k=i.toThemeProperty("jqx-rc-all")+" "+i.toThemeProperty("jqx-fill-state-normal")+" "+i.toThemeProperty("jqx-widget")+" "+i.toThemeProperty("jqx-widget-content")+" "+i.toThemeProperty("jqx-dropdownlist-state-normal");i.host.addClass(k);i.arrow.addClass(i.toThemeProperty("jqx-icon-arrow-down"));i.arrow.addClass(i.toThemeProperty("jqx-icon"));if(i.template){i.host.addClass(i.toThemeProperty("jqx-"+i.template))}i._setSize();i.render();if(a.jqx.browser.msie&&a.jqx.browser.version<8){i.container.css("display","none");if(i.host.parents(".jqx-window").length>0){var n=i.host.parents(".jqx-window").css("z-index");b.css("z-index",n+10);i.container.css("z-index",n+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"));if(b.bar){b.bar.addClass("focused");b.label.addClass("focused")}});f.addHandler(f.firstDiv,"blur",function(){b.host.removeClass(b.toThemeProperty("jqx-dropdownlist-state-focus"));b.host.removeClass(b.toThemeProperty("jqx-fill-state-focus"));if(b.bar){b.bar.removeClass("focused");b.label.removeClass("focused")}});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);
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
jQWidgets
|
|
3
|
-
Copyright (c) 2011-
|
|
2
|
+
jQWidgets v16.0.1 (2023-May)
|
|
3
|
+
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://jqwidgets.com/license/
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
8
|
-
(function(a){a.jqx.jqxWidget("jqxDropDownList","",{});a.extend(a.jqx._jqxDropDownList.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,items:new Array(),selectedIndex:-1,source:null,scrollBarSize:15,arrowSize:17,enableHover:true,enableSelection:true,autoItemsHeight:false,visualItems:new Array(),groups:new Array(),equalItemsWidth:true,itemHeight:-1,visibleItems:new Array(),emptyGroupText:"Group",checkboxes:false,openDelay:250,closeDelay:300,dropDownContainer:"default",animationType:"default",autoOpen:false,dropDownWidth:"auto",dropDownHeight:"200px",autoDropDownHeight:false,keyboardSelection:true,enableBrowserBoundsDetection:false,dropDownHorizontalAlignment:"left",dropDownVerticalAlignment:"bottom",displayMember:"",valueMember:"",groupMember:"",searchMember:"",searchMode:"startswithignorecase",incrementalSearch:true,incrementalSearchDelay:700,renderer:null,placeHolder:"",promptText:"Please Choose:",emptyString:"",rtl:false,selectionRenderer:null,listBox:null,popupZIndex:3001,renderMode:"default",touchMode:"auto",_checkForHiddenParent:true,autoBind:true,ready:null,focusable:true,filterable:false,filterHeight:27,filterPlaceHolder:"Looking for",filterDelay:100,hint:true,template:"default",aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","select","unselect","change","checkChange","bindingComplete","itemAdd","itemRemove","itemUpdate"]};if(this===a.jqx._jqxDropDownList.prototype){return b}a.extend(true,this,b);return b},createInstance:function(b){var d=this;if(d.isMaterialized()){var f=window.getComputedStyle(this.element);var e=f.getPropertyValue("--jqx-dropdown-animation");var c=f.getPropertyValue("--jqx-list-item-height");if(e&&this.animationType=="default"){this.animationType=e.trim()}if(c&&this.itemHeight===-1){this.itemHeight=parseInt(c)}}this.render()},render:function(){var o=this;if(!o.width){o.width=200}if(!o.height){o.height=25}o.host.addClass(o.toThemeProperty("jqx-dropdownlist"));var b=o.element.nodeName.toLowerCase();if(b=="select"||b=="ul"||b=="ol"){o.field=o.element;if(o.field.className){o._className=o.field.className}var h={title:o.field.title};if(o.field.id.length){h.id=o.field.id.replace(/[^\w]/g,"_")+"_jqxDropDownList"}else{h.id=a.jqx.utilities.createId()+"_jqxDropDownList"}var f=a("<div></div>",h);if(!o.width){o.width=a(o.field).width()}if(!o.height){o.height=a(o.field).outerHeight()}f[0].style.cssText=o.field.style.cssText;a(o.field).hide().after(f);var u=o.host.data();o.host=f;o.host.data(u);o.element=f[0];o.element.id=o.field.id;o.field.id=h.id;if(o._className){o.host.addClass(o._className);a(o.field).removeClass(o._className)}if(o.field.tabIndex){var d=o.field.tabIndex;o.field.tabIndex=-1;o.element.tabIndex=d}var k=a.jqx.parseSourceTag(o.field);o.source=k.items;if(o.selectedIndex==-1){o.selectedIndex=k.index}}else{if(o.host.find("li").length>0||o.host.find("option").length>0){var k=a.jqx.parseSourceTag(o.element);o.source=k.items}}o.element.innerHTML="";o.isanimating=false;o.id=o.element.id||a.jqx.utilities.createId();o.host.attr("role","combobox");a.jqx.aria(o,"aria-autocomplete","both");a.jqx.aria(o,"aria-readonly",false);var m="<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropdownlistWrapper' style='overflow: hidden; outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropdownlistContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'></div><div id='dropdownlistArrow' unselectable='on' style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>";if(a.jqx._jqxListBox==null||a.jqx._jqxListBox==undefined){throw new Error("jqxDropDownList: Missing reference to jqxlistbox.js.")}if(o.host.attr("tabindex")){}else{o.host.attr("tabindex",0)}var t=o;o.touch=a.jqx.mobile.isTouchDevice();o.comboStructure=m;o.element.innerHTML=m;o.dropdownlistWrapper=a(o.element.firstChild.firstChild);o.dropdownlistArrow=a(o.dropdownlistWrapper[0].firstChild.nextSibling);o.arrow=a(o.dropdownlistArrow[0].firstChild);o.dropdownlistContent=a(o.dropdownlistWrapper[0].firstChild);o.dropdownlistContent.addClass(o.toThemeProperty("jqx-dropdownlist-content jqx-disableselect"));if(o.rtl){o.dropdownlistContent.addClass(o.toThemeProperty("jqx-rtl jqx-dropdownlist-content-rtl"))}o.addHandler(o.dropdownlistWrapper,"selectstart",function(){return false});o.dropdownlistWrapper[0].id="dropdownlistWrapper"+o.element.id;o.dropdownlistArrow[0].id="dropdownlistArrow"+o.element.id;o.dropdownlistContent[0].id="dropdownlistContent"+o.element.id;o._addInput();var j=a("<label></label");if(this.hint){j[0].innerHTML=this.placeHolder}j.addClass(o.toThemeProperty("jqx-input-label"));o.dropdownlistWrapper.append(j);o.label=j;var r=a("<span></span>");o.dropdownlistWrapper.append(r);r.addClass(o.toThemeProperty("jqx-input-bar"));o.bar=r;o.bar.css("top",this.host.height());var i=this;if(i.template){i.bar.addClass(i.toThemeProperty("jqx-"+i.template));i.label.addClass(i.toThemeProperty("jqx-"+i.template))}if(o.promptText!="Please Choose:"){o.placeHolder=o.promptText}var c=o.toThemeProperty("jqx-widget")+" "+o.toThemeProperty("jqx-dropdownlist-state-normal")+" "+o.toThemeProperty("jqx-rc-all")+" "+o.toThemeProperty("jqx-fill-state-normal");o.element.className+=" "+c;o._firstDiv=a(o.element.firstChild);try{var q="listBox"+o.id;var g=a(a.find("#"+q));if(g.length>0){g.remove()}a.jqx.aria(o,"aria-owns",q);a.jqx.aria(o,"aria-haspopup",true);var l=a("<div style='overflow: hidden; background-color: transparent; border: none; position: absolute;' id='listBox"+o.id+"'><div id='innerListBox"+o.id+"'></div></div>");l.hide();l.addClass(o.toThemeProperty("jqx-listbox-container"));if(o.dropDownContainer=="element"){l.appendTo(o.host)}else{l.appendTo(document.body)}o.container=l;o.listBoxContainer=a(a.find("#innerListBox"+o.id));var p=o.width;if(o.dropDownWidth!="auto"){p=o.dropDownWidth}if(p==null){p=o.host.width();if(p==0){p=o.dropDownWidth}}if(o.dropDownHeight==null){o.dropDownHeight=200}var t=o;o.container.width(parseInt(p)+25);o.container.height(parseInt(o.dropDownHeight)+25);o._ready=false;o.addHandler(o.listBoxContainer,"bindingComplete",function(e){if(!o.listBox){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance}if(o.selectedIndex!=o.listBoxContainer.jqxListBox("selectedIndex")){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBoxContainer.jqxListBox({selectedIndex:o.selectedIndex});o.renderSelection("mouse")}else{o.renderSelection("mouse")}if(!o._ready){if(o.ready){o.ready()}o._ready=true}o._raiseEvent("6")});o.addHandler(o.listBoxContainer,"itemAdd",function(e){o._raiseEvent("7",e.args)});o.addHandler(o.listBoxContainer,"itemRemove",function(e){o._raiseEvent("8",e.args)});o.addHandler(o.listBoxContainer,"itemUpdate",function(e){o._raiseEvent("9",e.args)});o.listBoxContainer.jqxListBox({filterHeight:o.filterHeight,filterPlaceHolder:o.filterPlaceHolder,filterDelay:o.filterDelay,autoItemsHeight:o.autoItemsHeight,filterable:o.filterable,allowDrop:false,allowDrag:false,autoBind:o.autoBind,_checkForHiddenParent:false,focusable:o.focusable,touchMode:o.touchMode,checkboxes:o.checkboxes,rtl:o.rtl,_renderOnDemand:true,emptyString:o.emptyString,itemHeight:o.itemHeight,width:p,searchMode:o.searchMode,incrementalSearch:o.incrementalSearch,incrementalSearchDelay:o.incrementalSearchDelay,groupMember:o.groupMember,searchMember:o.searchMember,displayMember:o.displayMember,valueMember:o.valueMember,height:o.dropDownHeight,autoHeight:o.autoDropDownHeight,scrollBarSize:o.scrollBarSize,selectedIndex:o.selectedIndex,source:o.source,theme:o.theme,rendered:function(){if(o.selectedIndex!=o.listBoxContainer.jqxListBox("selectedIndex")){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBoxContainer.jqxListBox({selectedIndex:o.selectedIndex});o.renderSelection("mouse")}else{o.renderSelection("mouse")}},renderer:o.renderer,filterChange:function(e){if(o.autoDropDownHeight){o.container.height(o.listBoxContainer.height()+25)}}});if(o.dropDownContainer==="element"){o.listBoxContainer.css({position:"absolute",top:0,left:0})}else{o.listBoxContainer.css({position:"absolute",zIndex:o.popupZIndex,top:0,left:0})}if(o.template){o.listBoxContainer.addClass(o.toThemeProperty("jqx-"+o.template+"-item"))}o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBox.enableSelection=o.enableSelection;o.listBox.enableHover=o.enableHover;o.listBox.equalItemsWidth=o.equalItemsWidth;o.listBox.selectIndex(o.selectedIndex);o.listBox._arrange();o.listBoxContainer.addClass(o.toThemeProperty("jqx-popup"));if(a.jqx.browser.msie){o.listBoxContainer.addClass(o.toThemeProperty("jqx-noshadow"))}o.addHandler(o.listBoxContainer,"unselect",function(e){o._raiseEvent("3",{index:e.args.index,type:e.args.type,item:e.args.item})});o.addHandler(o.listBoxContainer,"change",function(e){if(e.args){if(e.args.type!="keyboard"){o._raiseEvent("4",{index:e.args.index,type:e.args.type,item:e.args.item})}else{if(e.args.type=="keyboard"){if(!o.isOpened()){o._raiseEvent("4",{index:o.selectedIndex,type:"keyboard",item:o.getItem(o.selectedIndex)})}}}}});if(o.animationType=="none"){o.container.css("display","none")}else{o.container.hide()}}catch(s){if(console){console.log(s)}}var o=o;o.propertyChangeMap.disabled=function(e,w,v,x){if(x){e.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(o.toThemeProperty("jqx-fill-state-disabled"));e.dropdownlistContent.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.dropdownlistContent.removeClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(o.disabled){o.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));o.host.addClass(o.toThemeProperty("jqx-fill-state-disabled"));o.dropdownlistContent.addClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}if(o.dropDownVerticalAlignment=="top"){o.arrow.addClass(o.toThemeProperty("jqx-icon-arrow-up"))}else{o.arrow.addClass(o.toThemeProperty("jqx-icon-arrow-down"))}o.arrow.addClass(o.toThemeProperty("jqx-icon"));if(o.renderMode==="simple"){o.arrow.remove();o.host.removeClass(o.toThemeProperty("jqx-fill-state-normal"));o.host.removeClass(o.toThemeProperty("jqx-rc-all"))}if(o.template){o.host.addClass(o.toThemeProperty("jqx-"+o.template))}o._updateHandlers();o._setSize();o._arrange();if(o.listBox){o.renderSelection()}if(a.jqx.browser.msie&&a.jqx.browser.version<8){if(o.host.parents(".jqx-window").length>0){var n=o.host.parents(".jqx-window").css("z-index");l.css("z-index",n+10);o.listBoxContainer.css("z-index",n+10)}}},resize:function(c,b){this.width=c;this.height=b;this._setSize();this._arrange()},val:function(c){if(!this.dropdownlistContent){return""}var d=function(f){for(var e in f){if(f.hasOwnProperty(e)){return false}}if(typeof c=="number"){return false}if(typeof c=="date"){return false}if(typeof c=="boolean"){return false}if(typeof c=="string"){return false}return true};if(this.input&&(d(c)||arguments.length==0)){return this.input.val()}var b=this.getItemByValue(c);if(b!=null){this.selectItem(b)}if(this.input){return this.input.val()}},focus:function(){try{var d=this;var c=function(){if(d.host){d.host.focus();if(d._firstDiv){d._firstDiv.focus()}}};c();setTimeout(function(){c()},10)}catch(b){}},_addInput:function(){var b=this.host.attr("name");this.input=a("<input type='hidden'/>");this.host.append(this.input);if(b){this.input.attr("name",b)}},getItems:function(){if(!this.listBox){return new Array()}return this.listBox.items},getVisibleItems:function(){return this.listBox.getVisibleItems()},_setSize:function(){var b=window.getComputedStyle(this.element);var c=parseInt(b.borderLeftWidth)*2;var h=b.boxSizing;if(this.element.offsetWidth===0){c=2}if(h==="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 g=false;if(this.width!=null&&this.width.toString().indexOf("%")!=-1){g=true;this.element.style.width=this.width;if(c>0){this.host.css("box-sizing","border-box");this.listBoxContainer.css("box-sizing","border-box")}}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){g=true;this.element.style.height=this.height}var e=this;var f=function(){e._arrange();if(e.dropDownWidth=="auto"){var i=e.host.width()+2;e.listBoxContainer.jqxListBox({width:i});e.container.width(parseInt(i)+25)}};if(g){var d=this.host.width()+2;if(this.dropDownWidth!="auto"){d=this.dropDownWidth}this.listBoxContainer.jqxListBox({width:d});this.container.width(parseInt(d)+25)}a.jqx.utilities.resize(this.host,function(){f()},false,this._checkForHiddenParent)},isOpened:function(){var c=this;var b=a.data(document.body,"openedJQXListBox"+this.id);if(b!=null&&b==c.listBoxContainer){return true}return false},_updateHandlers:function(){var c=this;var d=false;this.removeHandlers();if(!this.touch){this.addHandler(this.host,"mouseenter",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){d=true;c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-hover"));if(c.dropDownVerticalAlignment=="top"){c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-up-hover"))}else{c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down-hover"))}c.host.addClass(c.toThemeProperty("jqx-fill-state-hover"))}});this.addHandler(this.host,"mouseleave",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){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"));c.arrow.removeClass(c.toThemeProperty("jqx-icon-arrow-up-hover"));d=false}})}if(this.host.parents()){this.addHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id,function(e){var f=c.isOpened();if(f){c.close()}})}var b="mousedown";if(this.touch){b=a.jqx.mobile.getTouchEventName("touchstart")}this.addHandler(this.dropdownlistWrapper,b,function(f){if(!c.disabled){var e=c.container.css("display")=="block";if(!c.isanimating){if(e){c.hideListBox();return false}else{c.showListBox();if(!c.focusable){if(f.preventDefault){f.preventDefault()}}else{c.focus()}}}}});if(c.autoOpen){this.addHandler(this.host,"mouseenter",function(){var e=c.isOpened();if(!e&&c.autoOpen){c.open();c.host.focus()}});a(document).on("mousemove."+c.id,function(e){var l=c.isOpened();if(l&&c.autoOpen){var i=c.host.coord();var j=i.top;var h=i.left;var f=c.container.coord();var m=f.left;var k=f.top;var g=true;if(e.pageY>=j&&e.pageY<=j+c.host.height()){if(e.pageX>=h&&e.pageX<h+c.host.width()){g=false}}if(e.pageY>=k&&e.pageY<=k+c.container.height()){if(e.pageX>=m&&e.pageX<m+c.container.width()){g=false}}if(g){c.close()}}})}if(this.touch){this.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+this.id,c.closeOpenedListBox,{me:this,listbox:this.listBox,id:this.id})}else{this.addHandler(a(document),"mousedown."+this.id,c.closeOpenedListBox,{me:this,listbox:this.listBox,id:this.id})}this.addHandler(this.host,"keydown",function(f){var e=c.container.css("display")=="block";if(c.host.css("display")=="none"){return true}if(f.keyCode=="13"||f.keyCode=="9"){if(!c.isanimating){if(e){c.renderSelection();if(f.keyCode=="13"&&c.focusable){c._firstDiv.focus()}c.hideListBox();if(!c.keyboardSelection){c._raiseEvent("2",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)})}if(f.keyCode=="13"){c._raiseEvent("4",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)})}}if(e&&f.keyCode!="9"){return false}return true}}if(f.keyCode==115){if(!c.isanimating){if(!c.isOpened()){c.showListBox()}else{if(c.isOpened()){c.hideListBox()}}}return false}if(f.altKey){if(c.host.css("display")=="block"){if(f.keyCode==38){if(c.isOpened()){c.hideListBox();return true}}else{if(f.keyCode==40){if(!c.isOpened()){c.showListBox();return true}}}}}if(f.keyCode=="27"){if(!c.ishiding){if(c.isOpened()){c.hideListBox();if(c.tempSelectedIndex!=undefined){c.selectIndex(c.tempSelectedIndex)}}return true}}if(!c.disabled){c._kbnavigated=c.listBox._handleKeyDown(f);return c._kbnavigated}});this.addHandler(this.listBoxContainer,"checkChange",function(e){c.renderSelection();c._updateInputSelection();c._raiseEvent(5,{label:e.args.label,value:e.args.value,checked:e.args.checked,item:e.args.item})});this.addHandler(this.listBoxContainer,"select",function(e){if(!c.disabled){if(!e.args){return}if(e.args.type=="keyboard"&&!c.isOpened()){c.renderSelection()}if(e.args.type!="keyboard"||c.keyboardSelection){c.renderSelection();c._raiseEvent("2",{index:e.args.index,type:e.args.type,item:e.args.item,originalEvent:e.args.originalEvent});if(e.args.type=="mouse"){if(!c.checkboxes){c.hideListBox();if(c._firstDiv&&c.focusable){c._firstDiv.focus()}}}}}});if(this.listBox){if(this.listBox.content){this.addHandler(this.listBox.content,"click",function(e){if(!c.disabled){if(c.listBox.itemswrapper&&e.target===c.listBox.itemswrapper[0]){return true}c.renderSelection("mouse");if(!c.touch){if(!c.ishiding){if(!c.checkboxes){c.hideListBox();if(c._firstDiv&&c.focusable){c._firstDiv.focus()}}}}if(!c.keyboardSelection){if(c._kbnavigated===false){if(c.tempSelectedIndex!=c.selectedIndex){c._raiseEvent("4",{index:c.selectedIndex,type:"mouse",item:c.getItem(c.selectedIndex)})}c._kbnavigated=true}if(c._oldSelectedInd==undefined){c._oldSelectedIndx=c.selectedIndex}if(c.selectedIndex!=c._oldSelectedIndx){c._raiseEvent("2",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)});c._oldSelectedIndx=c.selectedIndex}}}})}}this.addHandler(this.host,"focus",function(e){if(c.renderMode!=="simple"){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.addClass("focused");c.label.addClass("focused")});this.addHandler(this.host,"blur",function(){if(c.renderMode!=="simple"){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.removeClass("focused");c.label.removeClass("focused")});this.addHandler(this._firstDiv,"focus",function(e){if(c.renderMode!=="simple"){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.addClass("focused");c.label.addClass("focused")});this.addHandler(this._firstDiv,"blur",function(){if(c.renderMode!=="simple"){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.removeClass("focused");c.label.removeClass("focused")})},removeHandlers:function(){var c=this;var b="mousedown";if(this.touch){b=a.jqx.mobile.getTouchEventName("touchstart")}this.removeHandler(this.dropdownlistWrapper,b);if(this.listBox){if(this.listBox.content){this.removeHandler(this.listBox.content,"click")}}this.removeHandler(this.host,"loadContent");this.removeHandler(this.listBoxContainer,"checkChange");this.removeHandler(this.host,"keydown");this.removeHandler(this.host,"focus");this.removeHandler(this.host,"blur");this.removeHandler(this._firstDiv,"focus");this.removeHandler(this._firstDiv,"blur");this.removeHandler(this.host,"mouseenter");this.removeHandler(this.host,"mouseleave");this.removeHandler(a(document),"mousemove."+c.id)},getItem:function(b){var c=this.listBox.getItem(b);return c},getItemByValue:function(c){var b=this.listBox.getItemByValue(c);return b},selectItem:function(b){if(this.listBox!=undefined){this.listBox.selectItem(b);this.selectedIndex=this.listBox.selectedIndex;this.renderSelection("mouse")}},unselectItem:function(b){if(this.listBox!=undefined){this.listBox.unselectItem(b);this.renderSelection("mouse")}},checkItem:function(b){if(this.listBox!=undefined){this.listBox.checkItem(b)}},uncheckItem:function(b){if(this.listBox!=undefined){this.listBox.uncheckItem(b)}},indeterminateItem:function(b){if(this.listBox!=undefined){this.listBox.indeterminateItem(b)}},renderSelection:function(){if(this.listBox==null){return}if(this.height&&this.height.toString().indexOf("%")!=-1){this._arrange()}var r=this.listBox.visibleItems[this.listBox.selectedIndex];if(this.filterable){if(this.listBox.selectedIndex==-1){for(var e in this.listBox.selectedValues){var l=this.listBox.selectedValues[e];var b=this.listBox.getItemByValue(l);if(b){r=b}}}}var u=this;if(this.checkboxes){var v=this.getCheckedItems();if(v!=null&&v.length>0){r=v[0]}else{r=null}}if(this.hint){if(this.label){this.label[0].innerHTML=this.placeHolder}if(r!=null){this.element.setAttribute("hint",true)}else{this.element.removeAttribute("hint")}}this.bar.css("top",this.host.height());if(r==null){var j=a('<span unselectable="on" style="color: inherit; border: none; background-color: transparent;"></span>');j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget"));j.addClass(this.toThemeProperty("jqx-listitem-state-normal"));j.addClass(this.toThemeProperty("jqx-item"));a.jqx.utilities.html(j,this.placeHolder);if(this.isMaterialized()&&!this.element.getAttribute("default-placeholder")&&this.hint){j[0].innerHTML="";if(this.label){this.label[0].innerHTML=this.placeHolder}}var s=this.dropdownlistContent.css("padding-top");var x=this.dropdownlistContent.css("padding-bottom");j.css("padding-top",s);j.css("padding-bottom",x);var q=j.outerHeight();j.remove();j.removeClass();a.jqx.utilities.html(this.dropdownlistContent,j);var h=this.host.height();if(this.height!=null&&this.height!=undefined){if(this.height.toString().indexOf("%")===-1){h=parseInt(this.height)}}var f=parseInt((parseInt(h)-parseInt(q))/2);if(this.host.css("box-sizing")==="border-box"){f=parseInt((parseInt(h-2)-parseInt(q))/2)}if(f>0){this.dropdownlistContent.css("margin-top",f+"px");this.dropdownlistContent.css("margin-bottom",f+"px")}if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,-1,"",""));this.dropdownlistContent.css("margin-top","0px");this.dropdownlistContent.css("margin-bottom","0px");this._updateInputSelection()}else{this._updateInputSelection()}this.selectedIndex=this.listBox.selectedIndex;if(this.width==="auto"){this._arrange()}if(this.focusable&&this.isOpened()){this.focus()}return}this.selectedIndex=this.listBox.selectedIndex;var j=a(document.createElement("span"));j[0].setAttribute("unselectable","on");try{j[0].style.color="inherit"}catch(t){}j[0].style.borderWidth="0px";j[0].style.backgroundColor="transparent";j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget jqx-listitem-state-normal jqx-item"));var p=false;try{if(r.html!=undefined&&r.html!=null&&r.html.toString().length>0){a.jqx.utilities.html(j,r.html)}else{if(r.label!=undefined&&r.label!=null&&r.label.toString().length>0){a.jqx.utilities.html(j,r.label)}else{if(r.label===null||r.label===""){p=true;a.jqx.utilities.html(j,"")}else{if(r.value!=undefined&&r.value!=null&&r.value.toString().length>0){a.jqx.utilities.html(j,r.value)}else{if(r.title!=undefined&&r.title!=null&&r.title.toString().length>0){a.jqx.utilities.html(j,r.title)}else{if(r.label==""||r.label==null){p=true;a.jqx.utilities.html(j,"")}}}}}}}catch(n){var m=n}var s=this.dropdownlistContent[0].style.paddingTop;var x=this.dropdownlistContent[0].style.paddingBottom;if(s===""){s="0px"}if(x===""){x="0px"}j[0].style.paddingTop=s;j[0].style.paddingBottom=x;var q=j.outerHeight();if(q===0){q=16}if((r.label==""||r.label==null)&&p){a.jqx.utilities.html(j,"")}var c=this.width&&this.width.toString().indexOf("%")<=0;j.remove();j.removeClass();if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,r.index,r.label,r.value));if(this.focusable&&this.isOpened()){this.focus()}}else{if(this.checkboxes){var g=this.getCheckedItems();var k="";for(var o=0;o<g.length;o++){if(o==g.length-1){k+=g[o].label}else{k+=g[o].label+","}}j.text(k);if(c){j.css("max-width",this.host.width()-30)}j.css("overflow","hidden");j.css("display","block");if(!this.rtl){if(c){j.css("width",this.host.width()-30)}}j.css("text-overflow","ellipsis");j.css("padding-bottom",1+parseInt(x));this.dropdownlistContent.html(j);if(this.focusable&&this.isOpened()){this.focus()}}else{var d=this.host.width()-this.arrowSize-1;if(this.width&&this.width!=="auto"){if(c){if(!this.rtl){j.css("max-width",d+"px")}}j[0].style.overflow="hidden";j[0].style.display="block";j[0].style.paddingTop=(1+parseInt(x))+"px";if(!this.rtl){if(c){if(d<0){d=0}j[0].style.width=d+"px"}}j[0].style.textOverflow="ellipsis"}this.dropdownlistContent[0].innerHTML=j[0].innerHTML;if(this.focusable&&this.isOpened()){this.focus()}}}var h=this.host.height();if(this.height!=null&&this.height!=undefined){if(this.height.toString().indexOf("%")===-1){h=parseInt(this.height)}}var f=parseInt((parseInt(h)-parseInt(q))/2);if(this.host.css("box-sizing")==="border-box"){f=parseInt((parseInt(h-2)-parseInt(q))/2)}if(f>=0){this.dropdownlistContent[0].style.marginTop=f+"px";this.dropdownlistContent[0].style.marginBottom=f+"px"}if(this.selectionRenderer){this.dropdownlistContent[0].style.marginTop="0px";this.dropdownlistContent[0].style.marginBottom="0px"}if(this.dropdownlistContent&&this.input){this._updateInputSelection()}if(this.listBox&&this.listBox._activeElement){a.jqx.aria(this,"aria-activedescendant",this.listBox._activeElement.id)}if(this.width==="auto"){this._arrange()}},_updateInputSelection:function(){if(this.input){var c=new Array();if(this.selectedIndex==-1){this.input.val("")}else{var f=this.getSelectedItem();if(f!=null){this.input.val(f.value);c.push(f.value)}else{this.input.val(this.dropdownlistContent.text())}}if(this.checkboxes){var b=this.getCheckedItems();var g="";if(b!=null){for(var d=0;d<b.length;d++){var e=b[d].value;if(e==undefined){continue}if(d==b.length-1){g+=e}else{g+=e+","}c.push(e)}}this.input.val(g)}}if(this.field&&this.input){if(this.field.nodeName.toLowerCase()=="select"){a.each(this.field,function(h,i){a(this).removeAttr("selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this).attr("selected",true)}})}else{a.each(this.items,function(h,i){a(this.originalItem.originalItem).removeAttr("data-selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this.originalItem.originalItem).attr("data-selected",true)}})}}},setContent:function(b){a.jqx.utilities.html(this.dropdownlistContent,b);this._updateInputSelection()},dataBind:function(){this.listBoxContainer.jqxListBox({source:this.source});this.renderSelection("mouse");if(this.source==null){this.clearSelection()}},clear:function(){this.listBoxContainer.jqxListBox({source:null});this.clearSelection()},clearSelection:function(b){this.selectedIndex=-1;this._updateInputSelection();this.listBox.clearSelection();this.renderSelection();if(!this.selectionRenderer&&!this.hint&&!this.isMaterialized()){a.jqx.utilities.html(this.dropdownlistContent,this.placeHolder)}},unselectIndex:function(b,c){if(isNaN(b)){return}this.listBox.unselectIndex(b,c);this.renderSelection()},selectIndex:function(b,d,e,c){this.listBox.selectIndex(b,d,e,c,"api")},getSelectedIndex:function(){return this.selectedIndex},getSelectedItem:function(){return this.listBox.getVisibleItem(this.selectedIndex)},getCheckedItems:function(){return this.listBox.getCheckedItems()},checkIndex:function(b){this.listBox.checkIndex(b)},uncheckIndex:function(b){this.listBox.uncheckIndex(b)},indeterminateIndex:function(b){this.listBox.indeterminateIndex(b)},checkAll:function(){this.listBox.checkAll();this.renderSelection("mouse")},uncheckAll:function(){this.listBox.uncheckAll();this.renderSelection("mouse")},addItem:function(b){return this.listBox.addItem(b)},insertAt:function(c,b){if(c==null){return false}return this.listBox.insertAt(c,b)},removeAt:function(c){var b=this.listBox.removeAt(c);this.renderSelection("mouse");return b},removeItem:function(c){var b=this.listBox.removeItem(c);this.renderSelection("mouse");return b},updateItem:function(c,d){var b=this.listBox.updateItem(c,d);this.renderSelection("mouse");return b},updateAt:function(d,c){var b=this.listBox.updateAt(d,c);this.renderSelection("mouse");return b},ensureVisible:function(b){return this.listBox.ensureVisible(b)},disableAt:function(b){return this.listBox.disableAt(b)},enableAt:function(b){return this.listBox.enableAt(b)},disableItem:function(b){return this.listBox.disableItem(b)},enableItem:function(b){return this.listBox.enableItem(b)},_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 g=h.outerWidth();var j=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>this.host.width()){var d=this.host.coord().left;var b=g-this.host.width();f.left=d-b+2}}if(f.left<0){f.left=parseInt(this.host.coord().left)+"px"}f.top-=Math.min(f.top,(f.top+j>e&&e>j)?Math.abs(j+c+22):0);return f},open:function(){this.showListBox()},close:function(){this.hideListBox()},_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}},showListBox:function(){a.jqx.aria(this,"aria-expanded",true);if(this.listBox._renderOnDemand){this.listBoxContainer.jqxListBox({_renderOnDemand:false})}if(this.dropDownWidth=="auto"&&this.width!=null&&this.width.indexOf&&(this.width.indexOf("%")!=-1||this.width.indexOf("auto")!=-1)){if(this.listBox.host.width()!=this.host.width()){var p=this.element.offsetWidth;this.listBoxContainer.jqxListBox({width:p});this.container.width(parseInt(p)+25)}}if(this.dropDownWidth=="auto"&&this.host.css("border-left-width")==="0px"){var p=this.element.offsetWidth;this.listBoxContainer.jqxListBox({width:p+1});this.container.width(parseInt(p)+25)}var n=this;var g=this.listBoxContainer;var u=this.listBox;var e=a(window).scrollTop();var f=a(window).scrollLeft();var l=parseInt(this._findPos(this.host[0])[1])+parseInt(this.host.outerHeight())-1+"px";var d,o=parseInt(Math.round(this.host.coord(true).left));d=o+"px";if(this.dropDownContainer==="element"){l=parseInt(this.host.outerHeight())-1+"px";d=0}var s=false;if(this.listBox==null){return}this.ishiding=false;if(!this.keyboardSelection){this.listBox.selectIndex(this.selectedIndex);this.listBox.ensureVisible(this.selectedIndex)}this.tempSelectedIndex=this.selectedIndex;if(this.autoDropDownHeight){this.container.height(this.listBoxContainer.height()+25)}if((s!=null&&s)){d=a.jqx.mobile.getLeftPos(this.element);l=a.jqx.mobile.getTopPos(this.element)+parseInt(this.host.outerHeight());if(a("body").css("border-top-width")!="0px"){l=parseInt(l)-this._getBodyOffset().top+"px"}if(a("body").css("border-left-width")!="0px"){d=parseInt(d)-this._getBodyOffset().left+"px"}}g.stop();if(this.renderMode!=="simple"){this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-selected"));this.host.addClass(this.toThemeProperty("jqx-fill-state-pressed"));if(this.dropDownVerticalAlignment=="top"){this.arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-selected"))}else{this.arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-selected"))}}this.container.css("left",d);this.container.css("top",l);u._arrange();var c=true;var b=false;if(this.dropDownHorizontalAlignment=="right"||this.rtl){var i=this.container.outerWidth();var q=-2+Math.abs(i-this.host.width());if(i>this.host.width()){this.container.css("left",25+parseInt(Math.round(o))-q+"px")}else{this.container.css("left",25+parseInt(Math.round(o))+q+"px")}}if(this.dropDownVerticalAlignment=="top"){var r=g.height();b=true;g.css("top",23);g.addClass(this.toThemeProperty("jqx-popup-up"));var k=parseInt(this.host.outerHeight());var j=parseInt(l)-Math.abs(r+k+23);this.container.css("top",j)}if(this.enableBrowserBoundsDetection){var h=this.testOffset(g,{left:parseInt(this.container.css("left")),top:parseInt(l)},parseInt(this.host.outerHeight()));if(parseInt(this.container.css("top"))!=h.top){b=true;g.css("top",23);g.addClass(this.toThemeProperty("jqx-popup-up"))}else{g.css("top",0)}this.container.css("top",h.top);if(parseInt(this.container.css("left"))!=h.left){this.container.css("left",h.left)}}if(this.animationType=="none"||this.animationType==="transform"){this.container.css("display","block");a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+this.id,g);g.css("margin-top",0);g.css("opacity",1);u._renderItems();n._raiseEvent("0",u)}else{this.container.css("display","block");n.isanimating=true;if(this.animationType=="fade"){g.css("margin-top",0);g.css("opacity",0);g.animate({opacity:1},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+n.id,g);n.ishiding=false;n.isanimating=false;u._renderItems();n._raiseEvent("0",u)})}else{g.css("opacity",1);var m=g.outerHeight();if(b){g.css("margin-top",m)}else{g.css("margin-top",-m)}g.animate({"margin-top":0},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+n.id,g);n.ishiding=false;n.isanimating=false;u._renderItems();n._raiseEvent("0",u)})}}if(!b){this.host.addClass(this.toThemeProperty("jqx-rc-b-expanded"));g.addClass(this.toThemeProperty("jqx-rc-t-expanded"))}else{this.host.addClass(this.toThemeProperty("jqx-rc-t-expanded"));g.addClass(this.toThemeProperty("jqx-rc-b-expanded"))}if(this.renderMode!=="simple"){g.addClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-focus"));this.host.addClass(this.toThemeProperty("jqx-fill-state-focus"))}this.element.setAttribute("opened",true);g.addClass(this.toThemeProperty("jqx-popup-show"))},hideListBox:function(){a.jqx.aria(this,"aria-expanded",false);var f=this.listBoxContainer;var g=this.listBox;var c=this.container;var d=this;this.element.removeAttribute("opened");f.removeClass("jqx-popup-show");a.data(document.body,"openedJQXListBox"+this.id,null);if(this.animationType=="none"){this.container.css("display","none")}else{if(this.animationType==="transform"){setTimeout(function(){c.css("display","none")},this.closeDelay)}else{if(!d.ishiding){f.stop();var b=f.outerHeight();f.css("margin-top",0);d.isanimating=true;var e=-b;if(parseInt(this.container.coord().top)<parseInt(this.host.coord().top)){e=b}if(this.animationType=="fade"){f.css({opacity:1});f.animate({opacity:0},this.closeDelay,function(){c.css("display","none");d.isanimating=false;d.ishiding=false})}else{f.animate({"margin-top":e},this.closeDelay,function(){c.css("display","none");d.isanimating=false;d.ishiding=false})}}}}this.ishiding=true;this.host.removeClass(this.toThemeProperty("jqx-dropdownlist-state-selected"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-pressed"));this.arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this.arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this.host.removeClass(this.toThemeProperty("jqx-rc-b-expanded"));f.removeClass(this.toThemeProperty("jqx-rc-t-expanded"));this.host.removeClass(this.toThemeProperty("jqx-rc-t-expanded"));f.removeClass(this.toThemeProperty("jqx-rc-b-expanded"));f.removeClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.removeClass(this.toThemeProperty("jqx-dropdownlist-state-focus"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-focus"));this._raiseEvent("1",g)},closeOpenedListBox:function(e){var d=e.data.me;var b=a(e.target);var c=e.data.listbox;if(c==null){return true}if(a(e.target).ischildof(e.data.me.host)){return true}if(!d.isOpened()){return true}if(a(e.target).ischildof(d.listBoxContainer)){return true}var f=d;var g=false;a.each(b.parents(),function(){if(this.className!="undefined"){if(this.className.indexOf){if(this.className.indexOf("jqx-listbox")!=-1){g=true;return false}if(this.className.indexOf("jqx-dropdownlist")!=-1){if(d.element.id==this.id){g=true}return false}}}});if(c!=null&&!g&&d.isOpened()){d.hideListBox()}return true},clearFilter:function(){this.listBox.clearFilter()},loadFromSelect:function(b){this.listBox.loadFromSelect(b)},refresh:function(b){if(b!==true){this._setSize();this._arrange();if(this.listBox){this.renderSelection()}}},_arrange:function(){var h=this;var d=parseInt(h.host.width());var j=parseInt(h.host.height());var f=h.arrowSize;var g=h.arrowSize;var i=3;var b=d-g-2*i;if(b>0&&h.width!=="auto"){h.dropdownlistContent[0].style.width=b+"px"}else{if(b<=0){h.dropdownlistContent[0].style.width="0px"}}if(h.width==="auto"){h.dropdownlistContent.css("width","auto");d=2+h.dropdownlistContent.width()+g+2*i;if(d<47){d=47}h.host.width(d)}h.dropdownlistContent[0].style.height=j+"px";h.dropdownlistContent[0].style.left="0px";h.dropdownlistContent[0].style.top="0px";h.dropdownlistArrow[0].style.width=g+"px";if(h.width&&h.width.toString().indexOf("%")>=0){var e=(g*100)/d;var c=(b*100)/d;h.dropdownlistArrow[0].style.width=e+"%";h.dropdownlistContent[0].style.width=c+"%"}h.dropdownlistArrow[0].style.height=j+"px";if(h.rtl){h.dropdownlistArrow.css("float","left");h.dropdownlistContent.css("float","right")}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBoxContainer,"unselect");this.removeHandler(this.listBoxContainer,"change");this.removeHandler(this.dropdownlistWrapper,"selectstart");this.removeHandler(this.dropdownlistWrapper,"mousedown");this.removeHandler(this.host,"keydown");this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBox.content,"click");this.removeHandler(this.listBoxContainer,"bindingComplete");if(this.host.parents()){this.removeHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id)}this.removeHandlers();this.listBoxContainer.jqxListBox("destroy");this.listBoxContainer.remove();this.host.removeClass();this.removeHandler(a(document),"mousedown."+this.id,this.closeOpenedListBox);if(this.touch){this.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+this.id)}this.dropdownlistArrow.remove();delete this.dropdownlistArrow;delete this.dropdownlistWrapper;delete this.listBoxContainer;delete this.input;delete this.arrow;delete this.dropdownlistContent;delete this.listBox;delete this._firstDiv;this.container.remove();delete this.container;var b=a.data(this.element,"jqxDropDownList");if(b){delete b.instance}this.host.removeData();this.host.remove();delete this.comboStructure;delete this.host;delete this.element},_raiseEvent:function(g,c){if(c==undefined){c={owner:null}}var d=this.events[g];var e=c;e.owner=this;var f=new a.Event(d);f.owner=this;if(g==2||g==3||g==4||g==5||g==6||g==7||g==8||g==9){f.args=c}var b=this.host.trigger(f);return b},propertiesChangedHandler:function(b,c,e){if(e.width&&e.height&&Object.keys(e).length==2){b._setSize();if(c=="width"){if(b.dropDownWidth=="auto"){var d=b.host.width();b.listBoxContainer.jqxListBox({width:d});b.container.width(parseInt(d)+25)}}b._arrange();b.close()}},propertyChangedHandler:function(b,c,f,e){if(b.isInitialized==undefined||b.isInitialized==false){return}if(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&Object.keys(b.batchUpdate).length==2){return}if(c=="template"){b.listBoxContainer.removeClass(b.toThemeProperty("jqx-"+f+"-item"));b.listBoxContainer.addClass(b.toThemeProperty("jqx-"+b.template+"-item"));b.host.removeClass(b.toThemeProperty("jqx-"+f+""));b.host.addClass(b.toThemeProperty("jqx-"+b.template+""))}if(c=="dropDownVerticalAlignment"){b.close();b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-up"));b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down"));if(b.dropDownVerticalAlignment=="top"){b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-up"))}else{b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down"))}b.listBoxContainer.css("top",0);b.listBoxContainer.removeClass(this.toThemeProperty("jqx-popup-up"))}if(c=="autoItemsHeight"){b.listBoxContainer.jqxListBox({autoItemsHeight:e})}if(c=="filterable"){b.listBoxContainer.jqxListBox({filterable:e})}if(c=="filterHeight"){b.listBoxContainer.jqxListBox({filterHeight:e})}if(c=="filterPlaceHolder"){b.listBoxContainer.jqxListBox({filterPlaceHolder:e})}if(c=="filterDelay"){b.listBoxContainer.jqxListBox({filterDelay:e})}if(c=="enableSelection"){b.listBoxContainer.jqxListBox({enableSelection:e})}if(c=="enableHover"){b.listBoxContainer.jqxListBox({enableHover:e})}if(c=="autoOpen"){b._updateHandlers()}if(c=="emptyString"){b.listBox.emptyString=b.emptyString}if(c=="itemHeight"){b.listBoxContainer.jqxListBox({itemHeight:e})}if(c=="renderer"){b.listBoxContainer.jqxListBox({renderer:e})}if(c=="rtl"){if(e){b.dropdownlistArrow.css("float","left");b.dropdownlistContent.css("float","right")}else{b.dropdownlistArrow.css("float","right");b.dropdownlistContent.css("float","left")}b.listBoxContainer.jqxListBox({rtl:b.rtl})}if(c=="source"){b.listBoxContainer.jqxListBox({source:b.source});b.listBox.selectedIndex=-1;b.listBox.selectIndex(this.selectedIndex);b.renderSelection();if(e==null){b.clear()}}if(c=="displayMember"||c=="valueMember"){b.listBoxContainer.jqxListBox({displayMember:b.displayMember,valueMember:b.valueMember});b.renderSelection()}if(c=="placeHolder"){b.renderSelection()}if(c=="theme"&&e!=null){b.listBoxContainer.jqxListBox({theme:e});b.listBoxContainer.addClass(b.toThemeProperty("jqx-popup"));a.jqx.utilities.setTheme(f,e,b.host)}if(c=="autoDropDownHeight"){b.listBoxContainer.jqxListBox({autoHeight:b.autoDropDownHeight});if(b.autoDropDownHeight){b.container.height(b.listBoxContainer.height()+25)}else{b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}b.listBox._arrange();b.listBox._updatescrollbars()}if(c=="searchMode"){b.listBoxContainer.jqxListBox({searchMode:b.searchMode})}if(c=="incrementalSearch"){b.listBoxContainer.jqxListBox({incrementalSearch:b.incrementalSearch})}if(c=="incrementalSearchDelay"){b.listBoxContainer.jqxListBox({incrementalSearchDelay:b.incrementalSearchDelay})}if(c=="dropDownHeight"){if(!b.autoDropDownHeight){b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}}if(c=="dropDownWidth"||c=="scrollBarSize"){var d=b.width;if(b.dropDownWidth!="auto"){d=b.dropDownWidth}b.listBoxContainer.jqxListBox({width:d,scrollBarSize:b.scrollBarSize});b.container.width(parseInt(d)+25)}if(c=="width"||c=="height"){if(e!=f){this.refresh();if(c=="width"){if(b.dropDownWidth=="auto"){var d=2+b.host.width();b.listBoxContainer.jqxListBox({width:d});b.container.width(parseInt(d)+25)}}b.close()}}if(c=="checkboxes"){b.listBoxContainer.jqxListBox({checkboxes:b.checkboxes})}if(c=="selectedIndex"){if(b.listBox!=null){b.listBox.selectIndex(parseInt(e));b.renderSelection()}}}})})(jqxBaseFramework);
|
|
8
|
+
(function(a){a.jqx.jqxWidget("jqxDropDownList","",{});a.extend(a.jqx._jqxDropDownList.prototype,{defineInstance:function(){var b={disabled:false,width:null,height:null,items:new Array(),selectedIndex:-1,source:null,scrollBarSize:15,arrowSize:17,enableHover:true,enableSelection:true,autoItemsHeight:false,visualItems:new Array(),groups:new Array(),equalItemsWidth:true,itemHeight:-1,visibleItems:new Array(),emptyGroupText:"Group",checkboxes:false,openDelay:250,closeDelay:300,dropDownContainer:"default",animationType:"default",autoOpen:false,dropDownWidth:"auto",dropDownHeight:"200px",autoDropDownHeight:false,keyboardSelection:true,enableBrowserBoundsDetection:false,dropDownHorizontalAlignment:"left",dropDownVerticalAlignment:"bottom",displayMember:"",valueMember:"",groupMember:"",searchMember:"",searchMode:"startswithignorecase",incrementalSearch:true,incrementalSearchDelay:700,renderer:null,placeHolder:"",promptText:"Please Choose:",emptyString:"",rtl:false,selectionRenderer:null,listBox:null,popupZIndex:3001,renderMode:"default",touchMode:"auto",_checkForHiddenParent:true,autoBind:true,ready:null,focusable:true,filterable:false,filterHeight:27,filterPlaceHolder:"Looking for",filterDelay:100,hint:true,template:"default",aria:{"aria-disabled":{name:"disabled",type:"boolean"}},events:["open","close","select","unselect","change","checkChange","bindingComplete","itemAdd","itemRemove","itemUpdate"]};if(this===a.jqx._jqxDropDownList.prototype){return b}a.extend(true,this,b);return b},createInstance:function(b){var e=this;if(e.isMaterialized()){var g=window.getComputedStyle(this.element);var f=g.getPropertyValue("--jqx-dropdown-animation");var d=g.getPropertyValue("--jqx-list-item-height");var c=g.getPropertyValue("--jqx-action-button-size");if(c){this.arrowSize=parseInt(c)}else{this.arrowSize=25}if(f&&this.animationType=="default"){this.animationType=f.trim()}if(d&&this.itemHeight===-1){this.itemHeight=parseInt(d)}}this.render()},render:function(){var o=this;if(!o.width){o.width=200}if(!o.height){o.height=25}o.host.addClass(o.toThemeProperty("jqx-dropdownlist"));var b=o.element.nodeName.toLowerCase();if(b=="select"||b=="ul"||b=="ol"){o.field=o.element;if(o.field.className){o._className=o.field.className}var h={title:o.field.title};if(o.field.id.length){h.id=o.field.id.replace(/[^\w]/g,"_")+"_jqxDropDownList"}else{h.id=a.jqx.utilities.createId()+"_jqxDropDownList"}var f=a("<div></div>",h);if(!o.width){o.width=a(o.field).width()}if(!o.height){o.height=a(o.field).outerHeight()}f[0].style.cssText=o.field.style.cssText;a(o.field).hide().after(f);var u=o.host.data();o.host=f;o.host.data(u);o.element=f[0];o.element.id=o.field.id;o.field.id=h.id;if(o._className){o.host.addClass(o._className);a(o.field).removeClass(o._className)}if(o.field.tabIndex){var d=o.field.tabIndex;o.field.tabIndex=-1;o.element.tabIndex=d}var k=a.jqx.parseSourceTag(o.field);o.source=k.items;if(o.selectedIndex==-1){o.selectedIndex=k.index}}else{if(o.host.find("li").length>0||o.host.find("option").length>0){var k=a.jqx.parseSourceTag(o.element);o.source=k.items}}o.element.innerHTML="";o.isanimating=false;o.id=o.element.id||a.jqx.utilities.createId();o.host.attr("role","combobox");a.jqx.aria(o,"aria-autocomplete","both");a.jqx.aria(o,"aria-readonly",false);var m="<div style='background-color: transparent; -webkit-appearance: none; outline: none; width:100%; height: 100%; padding: 0px; margin: 0px; border: 0px; position: relative;'><div id='dropdownlistWrapper' style='overflow: hidden; outline: none; background-color: transparent; border: none; float: left; width:100%; height: 100%; position: relative;'><div id='dropdownlistContent' unselectable='on' style='outline: none; background-color: transparent; border: none; float: left; position: relative;'></div><div id='dropdownlistArrow' unselectable='on' style='background-color: transparent; border: none; float: right; position: relative;'><div unselectable='on'></div></div></div></div>";if(a.jqx._jqxListBox==null||a.jqx._jqxListBox==undefined){throw new Error("jqxDropDownList: Missing reference to jqxlistbox.js.")}if(o.host.attr("tabindex")){}else{o.host.attr("tabindex",0)}var t=o;o.touch=a.jqx.mobile.isTouchDevice();o.comboStructure=m;o.element.innerHTML=m;o.dropdownlistWrapper=a(o.element.firstChild.firstChild);o.dropdownlistArrow=a(o.dropdownlistWrapper[0].firstChild.nextSibling);o.arrow=a(o.dropdownlistArrow[0].firstChild);o.dropdownlistContent=a(o.dropdownlistWrapper[0].firstChild);o.dropdownlistContent.addClass(o.toThemeProperty("jqx-dropdownlist-content jqx-disableselect"));if(o.rtl){o.dropdownlistContent.addClass(o.toThemeProperty("jqx-rtl jqx-dropdownlist-content-rtl"))}o.addHandler(o.dropdownlistWrapper,"selectstart",function(){return false});o.dropdownlistWrapper[0].id="dropdownlistWrapper"+o.element.id;o.dropdownlistArrow[0].id="dropdownlistArrow"+o.element.id;o.dropdownlistContent[0].id="dropdownlistContent"+o.element.id;o._addInput();var j=a("<label></label");if(this.hint){j[0].innerHTML=this.placeHolder}j.addClass(o.toThemeProperty("jqx-input-label"));o.dropdownlistWrapper.append(j);o.label=j;var r=a("<span></span>");o.dropdownlistWrapper.append(r);r.addClass(o.toThemeProperty("jqx-input-bar"));o.bar=r;o.bar.css("top",this.host.height());var i=this;if(i.template){i.bar.addClass(i.toThemeProperty("jqx-"+i.template));i.label.addClass(i.toThemeProperty("jqx-"+i.template))}if(o.promptText!="Please Choose:"){o.placeHolder=o.promptText}var c=o.toThemeProperty("jqx-widget")+" "+o.toThemeProperty("jqx-dropdownlist-state-normal")+" "+o.toThemeProperty("jqx-rc-all")+" "+o.toThemeProperty("jqx-fill-state-normal");o.element.className+=" "+c;o._firstDiv=a(o.element.firstChild);try{var q="listBox"+o.id;var g=a(a.find("#"+q));if(g.length>0){g.remove()}a.jqx.aria(o,"aria-owns",q);a.jqx.aria(o,"aria-haspopup",true);var l=a("<div style='overflow: hidden; background-color: transparent; border: none; position: absolute;' id='listBox"+o.id+"'><div id='innerListBox"+o.id+"'></div></div>");l.hide();l.addClass(o.toThemeProperty("jqx-listbox-container"));if(o.dropDownContainer=="element"){l.appendTo(o.host)}else{l.appendTo(document.body)}o.container=l;o.listBoxContainer=a(a.find("#innerListBox"+o.id));var p=o.width;if(o.dropDownWidth!="auto"){p=o.dropDownWidth}if(p==null){p=o.host.width();if(p==0){p=o.dropDownWidth}}if(o.dropDownHeight==null){o.dropDownHeight=200}var t=o;o.container.width(parseInt(p)+25);o.container.height(parseInt(o.dropDownHeight)+25);o._ready=false;o.addHandler(o.listBoxContainer,"bindingComplete",function(e){if(!o.listBox){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance}if(o.selectedIndex!=o.listBoxContainer.jqxListBox("selectedIndex")){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBoxContainer.jqxListBox({selectedIndex:o.selectedIndex});o.renderSelection("mouse")}else{o.renderSelection("mouse")}if(!o._ready){if(o.ready){o.ready()}o._ready=true}o._raiseEvent("6")});o.addHandler(o.listBoxContainer,"itemAdd",function(e){o._raiseEvent("7",e.args)});o.addHandler(o.listBoxContainer,"itemRemove",function(e){o._raiseEvent("8",e.args)});o.addHandler(o.listBoxContainer,"itemUpdate",function(e){o._raiseEvent("9",e.args)});o.listBoxContainer.jqxListBox({filterHeight:o.filterHeight,filterPlaceHolder:o.filterPlaceHolder,filterDelay:o.filterDelay,autoItemsHeight:o.autoItemsHeight,filterable:o.filterable,allowDrop:false,allowDrag:false,autoBind:o.autoBind,_checkForHiddenParent:false,focusable:o.focusable,touchMode:o.touchMode,checkboxes:o.checkboxes,rtl:o.rtl,_renderOnDemand:true,emptyString:o.emptyString,itemHeight:o.itemHeight,width:p,searchMode:o.searchMode,incrementalSearch:o.incrementalSearch,incrementalSearchDelay:o.incrementalSearchDelay,groupMember:o.groupMember,searchMember:o.searchMember,displayMember:o.displayMember,valueMember:o.valueMember,height:o.dropDownHeight,autoHeight:o.autoDropDownHeight,scrollBarSize:o.scrollBarSize,selectedIndex:o.selectedIndex,source:o.source,theme:o.theme,rendered:function(){if(o.selectedIndex!=o.listBoxContainer.jqxListBox("selectedIndex")){o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBoxContainer.jqxListBox({selectedIndex:o.selectedIndex});o.renderSelection("mouse")}else{o.renderSelection("mouse")}},renderer:o.renderer,filterChange:function(e){if(o.autoDropDownHeight){o.container.height(o.listBoxContainer.height()+25)}}});if(o.dropDownContainer==="element"){o.listBoxContainer.css({position:"absolute",top:0,left:0})}else{o.listBoxContainer.css({position:"absolute",zIndex:o.popupZIndex,top:0,left:0})}if(o.template){o.listBoxContainer.addClass(o.toThemeProperty("jqx-"+o.template+"-item"))}o.listBox=a.data(o.listBoxContainer[0],"jqxListBox").instance;o.listBox.enableSelection=o.enableSelection;o.listBox.enableHover=o.enableHover;o.listBox.equalItemsWidth=o.equalItemsWidth;o.listBox.selectIndex(o.selectedIndex);o.listBox._arrange();o.listBoxContainer.addClass(o.toThemeProperty("jqx-popup"));if(a.jqx.browser.msie){o.listBoxContainer.addClass(o.toThemeProperty("jqx-noshadow"))}o.addHandler(o.listBoxContainer,"unselect",function(e){o._raiseEvent("3",{index:e.args.index,type:e.args.type,item:e.args.item})});o.addHandler(o.listBoxContainer,"change",function(e){if(e.args){if(e.args.type!="keyboard"){o._raiseEvent("4",{index:e.args.index,type:e.args.type,item:e.args.item})}else{if(e.args.type=="keyboard"){if(!o.isOpened()){o._raiseEvent("4",{index:o.selectedIndex,type:"keyboard",item:o.getItem(o.selectedIndex)})}}}}});if(o.animationType=="none"){o.container.css("display","none")}else{o.container.hide()}}catch(s){if(console){console.log(s)}}var o=o;o.propertyChangeMap.disabled=function(e,w,v,x){if(x){e.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));e.host.addClass(o.toThemeProperty("jqx-fill-state-disabled"));e.dropdownlistContent.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.dropdownlistContent.removeClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}a.jqx.aria(e,"aria-disabled",e.disabled)};if(o.disabled){o.host.addClass(o.toThemeProperty("jqx-dropdownlist-state-disabled"));o.host.addClass(o.toThemeProperty("jqx-fill-state-disabled"));o.dropdownlistContent.addClass(o.toThemeProperty("jqx-dropdownlist-content-disabled"))}if(o.dropDownVerticalAlignment=="top"){o.arrow.addClass(o.toThemeProperty("jqx-icon-arrow-up"))}else{o.arrow.addClass(o.toThemeProperty("jqx-icon-arrow-down"))}o.arrow.addClass(o.toThemeProperty("jqx-icon"));if(o.renderMode==="simple"){o.arrow.remove();o.host.removeClass(o.toThemeProperty("jqx-fill-state-normal"));o.host.removeClass(o.toThemeProperty("jqx-rc-all"))}if(o.template){o.host.addClass(o.toThemeProperty("jqx-"+o.template))}o._updateHandlers();o._setSize();o._arrange();if(o.listBox){o.renderSelection()}if(a.jqx.browser.msie&&a.jqx.browser.version<8){if(o.host.parents(".jqx-window").length>0){var n=o.host.parents(".jqx-window").css("z-index");l.css("z-index",n+10);o.listBoxContainer.css("z-index",n+10)}}},resize:function(c,b){this.width=c;this.height=b;this._setSize();this._arrange()},val:function(c){if(!this.dropdownlistContent){return""}var d=function(f){for(var e in f){if(f.hasOwnProperty(e)){return false}}if(typeof c=="number"){return false}if(typeof c=="date"){return false}if(typeof c=="boolean"){return false}if(typeof c=="string"){return false}return true};if(this.input&&(d(c)||arguments.length==0)){return this.input.val()}var b=this.getItemByValue(c);if(b!=null){this.selectItem(b)}if(this.input){return this.input.val()}},focus:function(){try{var d=this;var c=function(){if(d.host){d.host.focus();if(d._firstDiv){d._firstDiv.focus()}}};c();setTimeout(function(){c()},10)}catch(b){}},_addInput:function(){var b=this.host.attr("name");this.input=a("<input type='hidden'/>");this.host.append(this.input);if(b){this.input.attr("name",b)}},getItems:function(){if(!this.listBox){return new Array()}return this.listBox.items},getVisibleItems:function(){return this.listBox.getVisibleItems()},_setSize:function(){var b=window.getComputedStyle(this.element);var c=parseInt(b.borderLeftWidth)*2;var h=b.boxSizing;if(this.element.offsetWidth===0){c=2}if(h==="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 g=false;if(this.width!=null&&this.width.toString().indexOf("%")!=-1){g=true;this.element.style.width=this.width;if(c>0){this.host.css("box-sizing","border-box");this.listBoxContainer.css("box-sizing","border-box")}}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){g=true;this.element.style.height=this.height}var e=this;var f=function(){e._arrange();if(e.dropDownWidth=="auto"){var i=e.host.width()+2;e.listBoxContainer.jqxListBox({width:i});e.container.width(parseInt(i)+25)}};if(g){var d=this.host.width()+2;if(this.dropDownWidth!="auto"){d=this.dropDownWidth}this.listBoxContainer.jqxListBox({width:d});this.container.width(parseInt(d)+25)}a.jqx.utilities.resize(this.host,function(){f()},false,this._checkForHiddenParent)},isOpened:function(){var c=this;var b=a.data(document.body,"openedJQXListBox"+this.id);if(b!=null&&b==c.listBoxContainer){return true}return false},_updateHandlers:function(){var c=this;var d=false;this.removeHandlers();if(!this.touch){this.addHandler(this.host,"mouseenter",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){d=true;c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-hover"));if(c.dropDownVerticalAlignment=="top"){c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-up-hover"))}else{c.arrow.addClass(c.toThemeProperty("jqx-icon-arrow-down-hover"))}c.host.addClass(c.toThemeProperty("jqx-fill-state-hover"))}});this.addHandler(this.host,"mouseleave",function(){if(!c.disabled&&c.enableHover&&c.renderMode!=="simple"){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"));c.arrow.removeClass(c.toThemeProperty("jqx-icon-arrow-up-hover"));d=false}})}if(this.host.parents()){this.addHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id,function(e){var f=c.isOpened();if(f){c.close()}})}var b="mousedown";if(this.touch){b=a.jqx.mobile.getTouchEventName("touchstart")}this.addHandler(this.dropdownlistWrapper,b,function(f){if(!c.disabled){var e=c.container.css("display")=="block";if(!c.isanimating){if(e){c.hideListBox();return false}else{c.showListBox();if(!c.focusable){if(f.preventDefault){f.preventDefault()}}else{c.focus()}f.stopPropagation()}}}});if(c.autoOpen){this.addHandler(this.host,"mouseenter",function(){var e=c.isOpened();if(!e&&c.autoOpen){c.open();c.host.focus()}});a(document).on("mousemove."+c.id,function(e){var l=c.isOpened();if(l&&c.autoOpen){var i=c.host.coord();var j=i.top;var h=i.left;var f=c.container.coord();var m=f.left;var k=f.top;var g=true;if(e.pageY>=j&&e.pageY<=j+c.host.height()){if(e.pageX>=h&&e.pageX<h+c.host.width()){g=false}}if(e.pageY>=k&&e.pageY<=k+c.container.height()){if(e.pageX>=m&&e.pageX<m+c.container.width()){g=false}}if(g){c.close()}}})}if(this.touch){this.addHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+this.id,c.closeOpenedListBox,{me:this,listbox:this.listBox,id:this.id})}else{this.addHandler(a(document),"mousedown."+this.id,c.closeOpenedListBox,{me:this,listbox:this.listBox,id:this.id})}this.addHandler(this.host,"keydown",function(f){var e=c.container.css("display")=="block";if(c.host.css("display")=="none"){return true}if(f.keyCode=="13"||f.keyCode=="9"){if(!c.isanimating){if(e){c.renderSelection();if(f.keyCode=="13"&&c.focusable){c._firstDiv.focus()}c.hideListBox();if(!c.keyboardSelection){c._raiseEvent("2",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)})}if(f.keyCode=="13"){c._raiseEvent("4",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)})}}if(e&&f.keyCode!="9"){return false}return true}}if(f.keyCode==115){if(!c.isanimating){if(!c.isOpened()){c.showListBox()}else{if(c.isOpened()){c.hideListBox()}}}return false}if(f.altKey){if(c.host.css("display")=="block"){if(f.keyCode==38){if(c.isOpened()){c.hideListBox();return true}}else{if(f.keyCode==40){if(!c.isOpened()){c.showListBox();return true}}}}}if(f.keyCode=="27"){if(!c.ishiding){if(c.isOpened()){c.hideListBox();if(c.tempSelectedIndex!=undefined){c.selectIndex(c.tempSelectedIndex)}}return true}}if(!c.disabled){c._kbnavigated=c.listBox._handleKeyDown(f);return c._kbnavigated}});this.addHandler(this.listBoxContainer,"checkChange",function(e){c.renderSelection();c._updateInputSelection();c._raiseEvent(5,{label:e.args.label,value:e.args.value,checked:e.args.checked,item:e.args.item})});this.addHandler(this.listBoxContainer,"select",function(e){if(!c.disabled){if(!e.args){return}if(e.args.type=="keyboard"&&!c.isOpened()){c.renderSelection()}if(e.args.type!="keyboard"||c.keyboardSelection){c.renderSelection();c._raiseEvent("2",{index:e.args.index,type:e.args.type,item:e.args.item,originalEvent:e.args.originalEvent});if(e.args.type=="mouse"){if(!c.checkboxes){c.hideListBox();if(c._firstDiv&&c.focusable){c._firstDiv.focus()}}}}}});if(this.listBox){if(this.listBox.content){this.addHandler(this.listBox.content,"click",function(e){if(!c.disabled){if(c.listBox.itemswrapper&&e.target===c.listBox.itemswrapper[0]){return true}c.renderSelection("mouse");if(!c.touch){if(!c.ishiding){if(!c.checkboxes){c.hideListBox();if(c._firstDiv&&c.focusable){c._firstDiv.focus()}}}}if(!c.keyboardSelection){if(c._kbnavigated===false){if(c.tempSelectedIndex!=c.selectedIndex){c._raiseEvent("4",{index:c.selectedIndex,type:"mouse",item:c.getItem(c.selectedIndex)})}c._kbnavigated=true}if(c._oldSelectedInd==undefined){c._oldSelectedIndx=c.selectedIndex}if(c.selectedIndex!=c._oldSelectedIndx){c._raiseEvent("2",{index:c.selectedIndex,type:"keyboard",item:c.getItem(c.selectedIndex)});c._oldSelectedIndx=c.selectedIndex}}}})}}this.addHandler(this.host,"focus",function(e){if(c.renderMode!=="simple"){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.addClass("focused");c.label.addClass("focused")});this.addHandler(this.host,"blur",function(){if(c.renderMode!=="simple"){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.removeClass("focused");c.label.removeClass("focused")});this.addHandler(this._firstDiv,"focus",function(e){if(c.renderMode!=="simple"){c.host.addClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.addClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.addClass("focused");c.label.addClass("focused")});this.addHandler(this._firstDiv,"blur",function(){if(c.renderMode!=="simple"){c.host.removeClass(c.toThemeProperty("jqx-dropdownlist-state-focus"));c.host.removeClass(c.toThemeProperty("jqx-fill-state-focus"))}c.bar.removeClass("focused");c.label.removeClass("focused")})},removeHandlers:function(){var c=this;var b="mousedown";if(this.touch){b=a.jqx.mobile.getTouchEventName("touchstart")}this.removeHandler(this.dropdownlistWrapper,b);if(this.listBox){if(this.listBox.content){this.removeHandler(this.listBox.content,"click")}}this.removeHandler(this.host,"loadContent");this.removeHandler(this.listBoxContainer,"checkChange");this.removeHandler(this.host,"keydown");this.removeHandler(this.host,"focus");this.removeHandler(this.host,"blur");this.removeHandler(this._firstDiv,"focus");this.removeHandler(this._firstDiv,"blur");this.removeHandler(this.host,"mouseenter");this.removeHandler(this.host,"mouseleave");this.removeHandler(a(document),"mousemove."+c.id)},getItem:function(b){var c=this.listBox.getItem(b);return c},getItemByValue:function(c){var b=this.listBox.getItemByValue(c);return b},selectItem:function(b){if(this.listBox!=undefined){this.listBox.selectItem(b);this.selectedIndex=this.listBox.selectedIndex;this.renderSelection("mouse")}},unselectItem:function(b){if(this.listBox!=undefined){this.listBox.unselectItem(b);this.renderSelection("mouse")}},checkItem:function(b){if(this.listBox!=undefined){this.listBox.checkItem(b)}},uncheckItem:function(b){if(this.listBox!=undefined){this.listBox.uncheckItem(b)}},indeterminateItem:function(b){if(this.listBox!=undefined){this.listBox.indeterminateItem(b)}},renderSelection:function(){if(this.listBox==null){return}if(this.height&&this.height.toString().indexOf("%")!=-1){this._arrange()}var r=this.listBox.visibleItems[this.listBox.selectedIndex];if(this.filterable){if(this.listBox.selectedIndex==-1){for(var e in this.listBox.selectedValues){var l=this.listBox.selectedValues[e];var b=this.listBox.getItemByValue(l);if(b){r=b}}}}var u=this;if(this.checkboxes){var v=this.getCheckedItems();if(v!=null&&v.length>0){r=v[0]}else{r=null}}if(this.hint){if(this.label){this.label[0].innerHTML=this.placeHolder}if(r!=null){this.element.setAttribute("hint",true)}else{this.element.removeAttribute("hint")}}this.bar.css("top",this.host.height());if(r==null){var j=a('<span unselectable="on" style="color: inherit; border: none; background-color: transparent;"></span>');j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget"));j.addClass(this.toThemeProperty("jqx-listitem-state-normal"));j.addClass(this.toThemeProperty("jqx-item"));a.jqx.utilities.html(j,this.placeHolder);if(this.isMaterialized()&&!this.element.getAttribute("default-placeholder")&&this.hint){j[0].innerHTML="";if(this.label){this.label[0].innerHTML=this.placeHolder}}var s=this.dropdownlistContent.css("padding-top");var x=this.dropdownlistContent.css("padding-bottom");j.css("padding-top",s);j.css("padding-bottom",x);var q=j.outerHeight();j.remove();j.removeClass();a.jqx.utilities.html(this.dropdownlistContent,j);var h=this.host.height();if(this.height!=null&&this.height!=undefined){if(this.height.toString().indexOf("%")===-1){h=parseInt(this.height)}}var f=parseInt((parseInt(h)-parseInt(q))/2);if(this.host.css("box-sizing")==="border-box"){f=parseInt((parseInt(h-2)-parseInt(q))/2)}if(f>0){this.dropdownlistContent.css("margin-top",f+"px");this.dropdownlistContent.css("margin-bottom",f+"px")}if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,-1,"",""));this.dropdownlistContent.css("margin-top","0px");this.dropdownlistContent.css("margin-bottom","0px");this._updateInputSelection()}else{this._updateInputSelection()}this.selectedIndex=this.listBox.selectedIndex;if(this.width==="auto"){this._arrange()}if(this.focusable&&this.isOpened()){this.focus()}return}this.selectedIndex=this.listBox.selectedIndex;var j=a(document.createElement("span"));j[0].setAttribute("unselectable","on");try{j[0].style.color="inherit"}catch(t){}j[0].style.borderWidth="0px";j[0].style.backgroundColor="transparent";j.appendTo(a(document.body));j.addClass(this.toThemeProperty("jqx-widget jqx-listitem-state-normal jqx-item"));var p=false;try{if(r.html!=undefined&&r.html!=null&&r.html.toString().length>0){a.jqx.utilities.html(j,r.html)}else{if(r.label!=undefined&&r.label!=null&&r.label.toString().length>0){a.jqx.utilities.html(j,r.label)}else{if(r.label===null||r.label===""){p=true;a.jqx.utilities.html(j,"")}else{if(r.value!=undefined&&r.value!=null&&r.value.toString().length>0){a.jqx.utilities.html(j,r.value)}else{if(r.title!=undefined&&r.title!=null&&r.title.toString().length>0){a.jqx.utilities.html(j,r.title)}else{if(r.label==""||r.label==null){p=true;a.jqx.utilities.html(j,"")}}}}}}}catch(n){var m=n}var s=this.dropdownlistContent[0].style.paddingTop;var x=this.dropdownlistContent[0].style.paddingBottom;if(s===""){s="0px"}if(x===""){x="0px"}j[0].style.paddingTop=s;j[0].style.paddingBottom=x;var q=j.outerHeight();if(q===0){q=16}if((r.label==""||r.label==null)&&p){a.jqx.utilities.html(j,"")}var c=this.width&&this.width.toString().indexOf("%")<=0;j.remove();j.removeClass();if(this.selectionRenderer){a.jqx.utilities.html(this.dropdownlistContent,this.selectionRenderer(j,r.index,r.label,r.value));if(this.focusable&&this.isOpened()){this.focus()}}else{if(this.checkboxes){var g=this.getCheckedItems();var k="";for(var o=0;o<g.length;o++){if(o==g.length-1){k+=g[o].label}else{k+=g[o].label+","}}j.text(k);if(c){j.css("max-width",this.host.width()-30)}j.css("overflow","hidden");j.css("display","block");if(!this.rtl){if(c){j.css("width",this.host.width()-30)}}j.css("text-overflow","ellipsis");j.css("padding-bottom",1+parseInt(x));this.dropdownlistContent.html(j);if(this.focusable&&this.isOpened()){this.focus()}}else{var d=this.host.width()-this.arrowSize-1;if(this.width&&this.width!=="auto"){if(c){if(!this.rtl){j.css("max-width",d+"px")}}j[0].style.overflow="hidden";j[0].style.display="block";j[0].style.paddingTop=(1+parseInt(x))+"px";if(!this.rtl){if(c){if(d<0){d=0}j[0].style.width=d+"px"}}j[0].style.textOverflow="ellipsis"}this.dropdownlistContent[0].innerHTML=j[0].innerHTML;if(this.focusable&&this.isOpened()){this.focus()}}}var h=this.host.height();if(this.height!=null&&this.height!=undefined){if(this.height.toString().indexOf("%")===-1){h=parseInt(this.height)}}var f=parseInt((parseInt(h)-parseInt(q))/2);if(this.host.css("box-sizing")==="border-box"){f=parseInt((parseInt(h-2)-parseInt(q))/2)}if(f>=0){this.dropdownlistContent[0].style.marginTop=f+"px";this.dropdownlistContent[0].style.marginBottom=f+"px"}if(this.selectionRenderer){this.dropdownlistContent[0].style.marginTop="0px";this.dropdownlistContent[0].style.marginBottom="0px"}if(this.dropdownlistContent&&this.input){this._updateInputSelection()}if(this.listBox&&this.listBox._activeElement){a.jqx.aria(this,"aria-activedescendant",this.listBox._activeElement.id)}if(this.width==="auto"){this._arrange()}},_updateInputSelection:function(){if(this.input){var c=new Array();if(this.selectedIndex==-1){this.input.val("")}else{var f=this.getSelectedItem();if(f!=null){this.input.val(f.value);c.push(f.value)}else{this.input.val(this.dropdownlistContent.text())}}if(this.checkboxes){var b=this.getCheckedItems();var g="";if(b!=null){for(var d=0;d<b.length;d++){var e=b[d].value;if(e==undefined){continue}if(d==b.length-1){g+=e}else{g+=e+","}c.push(e)}}this.input.val(g)}}if(this.field&&this.input){if(this.field.nodeName.toLowerCase()=="select"){a.each(this.field,function(h,i){a(this).removeAttr("selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this).attr("selected",true)}})}else{a.each(this.items,function(h,i){a(this.originalItem.originalItem).removeAttr("data-selected");this.selected=c.indexOf(this.value)>=0;if(this.selected){a(this.originalItem.originalItem).attr("data-selected",true)}})}}},setContent:function(b){a.jqx.utilities.html(this.dropdownlistContent,b);this._updateInputSelection()},dataBind:function(){this.listBoxContainer.jqxListBox({source:this.source});this.renderSelection("mouse");if(this.source==null){this.clearSelection()}},clear:function(){this.listBoxContainer.jqxListBox({source:null});this.clearSelection()},clearSelection:function(b){this.selectedIndex=-1;this._updateInputSelection();this.listBox.clearSelection();this.renderSelection();if(!this.selectionRenderer&&!this.hint&&!this.isMaterialized()){a.jqx.utilities.html(this.dropdownlistContent,this.placeHolder)}},unselectIndex:function(b,c){if(isNaN(b)){return}this.listBox.unselectIndex(b,c);this.renderSelection()},selectIndex:function(b,d,e,c){this.listBox.selectIndex(b,d,e,c,"api")},getSelectedIndex:function(){return this.selectedIndex},getSelectedItem:function(){return this.listBox.getVisibleItem(this.selectedIndex)},getCheckedItems:function(){return this.listBox.getCheckedItems()},checkIndex:function(b){this.listBox.checkIndex(b)},uncheckIndex:function(b){this.listBox.uncheckIndex(b)},indeterminateIndex:function(b){this.listBox.indeterminateIndex(b)},checkAll:function(){this.listBox.checkAll();this.renderSelection("mouse")},uncheckAll:function(){this.listBox.uncheckAll();this.renderSelection("mouse")},addItem:function(b){return this.listBox.addItem(b)},insertAt:function(c,b){if(c==null){return false}return this.listBox.insertAt(c,b)},removeAt:function(c){var b=this.listBox.removeAt(c);this.renderSelection("mouse");return b},removeItem:function(c){var b=this.listBox.removeItem(c);this.renderSelection("mouse");return b},updateItem:function(c,d){var b=this.listBox.updateItem(c,d);this.renderSelection("mouse");return b},updateAt:function(d,c){var b=this.listBox.updateAt(d,c);this.renderSelection("mouse");return b},ensureVisible:function(b){return this.listBox.ensureVisible(b)},disableAt:function(b){return this.listBox.disableAt(b)},enableAt:function(b){return this.listBox.enableAt(b)},disableItem:function(b){return this.listBox.disableItem(b)},enableItem:function(b){return this.listBox.enableItem(b)},_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 g=h.outerWidth();var j=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>this.host.width()){var d=this.host.coord().left;var b=g-this.host.width();f.left=d-b+2}}if(f.left<0){f.left=parseInt(this.host.coord().left)+"px"}f.top-=Math.min(f.top,(f.top+j>e&&e>j)?Math.abs(j+c+22):0);return f},open:function(){this.showListBox()},close:function(){this.hideListBox()},_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}},showListBox:function(){a.jqx.aria(this,"aria-expanded",true);if(this.listBox._renderOnDemand){this.listBoxContainer.jqxListBox({_renderOnDemand:false})}if(this.dropDownWidth=="auto"&&this.width!=null&&this.width.indexOf&&(this.width.indexOf("%")!=-1||this.width.indexOf("auto")!=-1)){if(this.listBox.host.width()!=this.host.width()){var p=this.element.offsetWidth;this.listBoxContainer.jqxListBox({width:p});this.container.width(parseInt(p)+25)}}if(this.dropDownWidth=="auto"&&this.host.css("border-left-width")==="0px"){var p=this.element.offsetWidth;this.listBoxContainer.jqxListBox({width:p+1});this.container.width(parseInt(p)+25)}var n=this;var g=this.listBoxContainer;var u=this.listBox;var e=a(window).scrollTop();var f=a(window).scrollLeft();var l=parseInt(this._findPos(this.host[0])[1])+parseInt(this.host.outerHeight())-1+"px";var d,o=parseInt(Math.round(this.host.coord(true).left));d=o+"px";if(this.dropDownContainer==="element"){l=parseInt(this.host.outerHeight())-1+"px";d=0}var s=false;if(this.listBox==null){return}this.ishiding=false;if(!this.keyboardSelection){this.listBox.selectIndex(this.selectedIndex);this.listBox.ensureVisible(this.selectedIndex)}this.tempSelectedIndex=this.selectedIndex;if(this.autoDropDownHeight){this.container.height(this.listBoxContainer.height()+25)}if((s!=null&&s)){d=a.jqx.mobile.getLeftPos(this.element);l=a.jqx.mobile.getTopPos(this.element)+parseInt(this.host.outerHeight());if(a("body").css("border-top-width")!="0px"){l=parseInt(l)-this._getBodyOffset().top+"px"}if(a("body").css("border-left-width")!="0px"){d=parseInt(d)-this._getBodyOffset().left+"px"}}g.stop();if(this.renderMode!=="simple"){this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-selected"));this.host.addClass(this.toThemeProperty("jqx-fill-state-pressed"));if(this.dropDownVerticalAlignment=="top"){this.arrow.addClass(this.toThemeProperty("jqx-icon-arrow-up-selected"))}else{this.arrow.addClass(this.toThemeProperty("jqx-icon-arrow-down-selected"))}}this.container.css("left",d);this.container.css("top",l);u._arrange();var c=true;var b=false;if(this.dropDownHorizontalAlignment=="right"||this.rtl){var i=this.container.outerWidth();var q=-2+Math.abs(i-this.host.width());if(i>this.host.width()){this.container.css("left",25+parseInt(Math.round(o))-q+"px")}else{this.container.css("left",25+parseInt(Math.round(o))+q+"px")}}if(this.dropDownVerticalAlignment=="top"){var r=g.height();b=true;g.css("top",23);g.addClass(this.toThemeProperty("jqx-popup-up"));var k=parseInt(this.host.outerHeight());var j=parseInt(l)-Math.abs(r+k+23);this.container.css("top",j)}if(this.enableBrowserBoundsDetection){var h=this.testOffset(g,{left:parseInt(this.container.css("left")),top:parseInt(l)},parseInt(this.host.outerHeight()));if(parseInt(this.container.css("top"))!=h.top){b=true;g.css("top",23);g.addClass(this.toThemeProperty("jqx-popup-up"))}else{g.css("top",0)}this.container.css("top",h.top);if(parseInt(this.container.css("left"))!=h.left){this.container.css("left",h.left)}}if(this.animationType=="none"||this.animationType==="transform"){this.container.css("display","block");a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+this.id,g);g.css("margin-top",0);g.css("opacity",1);u._renderItems();n._raiseEvent("0",u)}else{this.container.css("display","block");n.isanimating=true;if(this.animationType=="fade"){g.css("margin-top",0);g.css("opacity",0);g.animate({opacity:1},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+n.id,g);n.ishiding=false;n.isanimating=false;u._renderItems();n._raiseEvent("0",u)})}else{g.css("opacity",1);var m=g.outerHeight();if(b){g.css("margin-top",m)}else{g.css("margin-top",-m)}g.animate({"margin-top":0},this.openDelay,function(){a.data(document.body,"openedJQXListBoxParent",n);a.data(document.body,"openedJQXListBox"+n.id,g);n.ishiding=false;n.isanimating=false;u._renderItems();n._raiseEvent("0",u)})}}if(!b){this.host.addClass(this.toThemeProperty("jqx-rc-b-expanded"));g.addClass(this.toThemeProperty("jqx-rc-t-expanded"))}else{this.host.addClass(this.toThemeProperty("jqx-rc-t-expanded"));g.addClass(this.toThemeProperty("jqx-rc-b-expanded"))}if(this.renderMode!=="simple"){g.addClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.addClass(this.toThemeProperty("jqx-dropdownlist-state-focus"));this.host.addClass(this.toThemeProperty("jqx-fill-state-focus"))}this.element.setAttribute("opened",true);g.addClass(this.toThemeProperty("jqx-popup-show"))},hideListBox:function(){a.jqx.aria(this,"aria-expanded",false);var f=this.listBoxContainer;var g=this.listBox;var c=this.container;var d=this;this.element.removeAttribute("opened");f.removeClass("jqx-popup-show");a.data(document.body,"openedJQXListBox"+this.id,null);if(this.animationType=="none"){this.container.css("display","none")}else{if(this.animationType==="transform"){setTimeout(function(){c.css("display","none")},this.closeDelay)}else{if(!d.ishiding){f.stop();var b=f.outerHeight();f.css("margin-top",0);d.isanimating=true;var e=-b;if(parseInt(this.container.coord().top)<parseInt(this.host.coord().top)){e=b}if(this.animationType=="fade"){f.css({opacity:1});f.animate({opacity:0},this.closeDelay,function(){c.css("display","none");d.isanimating=false;d.ishiding=false})}else{f.animate({"margin-top":e},this.closeDelay,function(){c.css("display","none");d.isanimating=false;d.ishiding=false})}}}}this.ishiding=true;this.host.removeClass(this.toThemeProperty("jqx-dropdownlist-state-selected"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-pressed"));this.arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-down-selected"));this.arrow.removeClass(this.toThemeProperty("jqx-icon-arrow-up-selected"));this.host.removeClass(this.toThemeProperty("jqx-rc-b-expanded"));f.removeClass(this.toThemeProperty("jqx-rc-t-expanded"));this.host.removeClass(this.toThemeProperty("jqx-rc-t-expanded"));f.removeClass(this.toThemeProperty("jqx-rc-b-expanded"));f.removeClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.removeClass(this.toThemeProperty("jqx-dropdownlist-state-focus"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-focus"));this._raiseEvent("1",g)},closeOpenedListBox:function(e){var d=e.data.me;var b=a(e.target);var c=e.data.listbox;if(c==null){return true}if(a(e.target).ischildof(e.data.me.host)){return true}if(!d.isOpened()){return true}if(a(e.target).ischildof(d.listBoxContainer)){return true}var f=d;var g=false;a.each(b.parents(),function(){if(this.className!="undefined"){if(this.className.indexOf){if(this.className.indexOf("jqx-listbox")!=-1){g=true;return false}if(this.className.indexOf("jqx-dropdownlist")!=-1){if(d.element.id==this.id){g=true}return false}}}});if(c!=null&&!g&&d.isOpened()){d.hideListBox()}return true},clearFilter:function(){this.listBox.clearFilter()},loadFromSelect:function(b){this.listBox.loadFromSelect(b)},refresh:function(b){if(b!==true){this._setSize();this._arrange();if(this.listBox){this.renderSelection()}}},_arrange:function(){var h=this;var d=parseInt(h.host.width());var j=parseInt(h.host.height());var f=h.arrowSize;var g=h.arrowSize;var i=3;var b=d-g-2*i;if(b>0&&h.width!=="auto"){h.dropdownlistContent[0].style.width=b+"px"}else{if(b<=0){h.dropdownlistContent[0].style.width="0px"}}if(h.width==="auto"){h.dropdownlistContent.css("width","auto");d=2+h.dropdownlistContent.width()+g+2*i;if(d<47){d=47}h.host.width(d)}h.dropdownlistContent[0].style.height=j+"px";h.dropdownlistContent[0].style.left="0px";h.dropdownlistContent[0].style.top="0px";h.dropdownlistArrow[0].style.width=g+"px";if(h.width&&h.width.toString().indexOf("%")>=0){var e=(g*100)/d;var c=(b*100)/d;h.dropdownlistArrow[0].style.width=e+"%";h.dropdownlistContent[0].style.width=c+"%"}h.dropdownlistArrow[0].style.height=j+"px";if(h.rtl){h.dropdownlistArrow.css("float","left");h.dropdownlistContent.css("float","right")}},destroy:function(){a.jqx.utilities.resize(this.host,null,true);this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBoxContainer,"unselect");this.removeHandler(this.listBoxContainer,"change");this.removeHandler(this.dropdownlistWrapper,"selectstart");this.removeHandler(this.dropdownlistWrapper,"mousedown");this.removeHandler(this.host,"keydown");this.removeHandler(this.listBoxContainer,"select");this.removeHandler(this.listBox.content,"click");this.removeHandler(this.listBoxContainer,"bindingComplete");if(this.host.parents()){this.removeHandler(this.host.parents(),"scroll.dropdownlist"+this.element.id)}this.removeHandlers();this.listBoxContainer.jqxListBox("destroy");this.listBoxContainer.remove();this.host.removeClass();this.removeHandler(a(document),"mousedown."+this.id,this.closeOpenedListBox);if(this.touch){this.removeHandler(a(document),a.jqx.mobile.getTouchEventName("touchstart")+"."+this.id)}this.dropdownlistArrow.remove();delete this.dropdownlistArrow;delete this.dropdownlistWrapper;delete this.listBoxContainer;delete this.input;delete this.arrow;delete this.dropdownlistContent;delete this.listBox;delete this._firstDiv;this.container.remove();delete this.container;var b=a.data(this.element,"jqxDropDownList");if(b){delete b.instance}this.host.removeData();this.host.remove();delete this.comboStructure;delete this.host;delete this.element},_raiseEvent:function(g,c){if(c==undefined){c={owner:null}}var d=this.events[g];var e=c;e.owner=this;var f=new a.Event(d);f.owner=this;if(g==2||g==3||g==4||g==5||g==6||g==7||g==8||g==9){f.args=c}var b=this.host.trigger(f);return b},propertiesChangedHandler:function(b,c,e){if(e.width&&e.height&&Object.keys(e).length==2){b._setSize();if(c=="width"){if(b.dropDownWidth=="auto"){var d=b.host.width();b.listBoxContainer.jqxListBox({width:d});b.container.width(parseInt(d)+25)}}b._arrange();b.close()}},propertyChangedHandler:function(b,c,f,e){if(b.isInitialized==undefined||b.isInitialized==false){return}if(b.batchUpdate&&b.batchUpdate.width&&b.batchUpdate.height&&Object.keys(b.batchUpdate).length==2){return}if(c=="template"){b.listBoxContainer.removeClass(b.toThemeProperty("jqx-"+f+"-item"));b.listBoxContainer.addClass(b.toThemeProperty("jqx-"+b.template+"-item"));b.host.removeClass(b.toThemeProperty("jqx-"+f+""));b.host.addClass(b.toThemeProperty("jqx-"+b.template+""))}if(c=="dropDownVerticalAlignment"){b.close();b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-up"));b.arrow.removeClass(b.toThemeProperty("jqx-icon-arrow-down"));if(b.dropDownVerticalAlignment=="top"){b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-up"))}else{b.arrow.addClass(b.toThemeProperty("jqx-icon-arrow-down"))}b.listBoxContainer.css("top",0);b.listBoxContainer.removeClass(this.toThemeProperty("jqx-popup-up"))}if(c=="autoItemsHeight"){b.listBoxContainer.jqxListBox({autoItemsHeight:e})}if(c=="filterable"){b.listBoxContainer.jqxListBox({filterable:e})}if(c=="filterHeight"){b.listBoxContainer.jqxListBox({filterHeight:e})}if(c=="filterPlaceHolder"){b.listBoxContainer.jqxListBox({filterPlaceHolder:e})}if(c=="filterDelay"){b.listBoxContainer.jqxListBox({filterDelay:e})}if(c=="enableSelection"){b.listBoxContainer.jqxListBox({enableSelection:e})}if(c=="enableHover"){b.listBoxContainer.jqxListBox({enableHover:e})}if(c=="autoOpen"){b._updateHandlers()}if(c=="emptyString"){b.listBox.emptyString=b.emptyString}if(c=="itemHeight"){b.listBoxContainer.jqxListBox({itemHeight:e})}if(c=="renderer"){b.listBoxContainer.jqxListBox({renderer:e})}if(c=="rtl"){if(e){b.dropdownlistArrow.css("float","left");b.dropdownlistContent.css("float","right")}else{b.dropdownlistArrow.css("float","right");b.dropdownlistContent.css("float","left")}b.listBoxContainer.jqxListBox({rtl:b.rtl})}if(c=="source"){b.listBoxContainer.jqxListBox({source:b.source});b.listBox.selectedIndex=-1;b.listBox.selectIndex(this.selectedIndex);b.renderSelection();if(e==null){b.clear()}}if(c=="displayMember"||c=="valueMember"){b.listBoxContainer.jqxListBox({displayMember:b.displayMember,valueMember:b.valueMember});b.renderSelection()}if(c=="placeHolder"){b.renderSelection()}if(c=="theme"&&e!=null){b.listBoxContainer.jqxListBox({theme:e});b.listBoxContainer.addClass(b.toThemeProperty("jqx-popup"));a.jqx.utilities.setTheme(f,e,b.host)}if(c=="autoDropDownHeight"){b.listBoxContainer.jqxListBox({autoHeight:b.autoDropDownHeight});if(b.autoDropDownHeight){b.container.height(b.listBoxContainer.height()+25)}else{b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}b.listBox._arrange();b.listBox._updatescrollbars()}if(c=="searchMode"){b.listBoxContainer.jqxListBox({searchMode:b.searchMode})}if(c=="incrementalSearch"){b.listBoxContainer.jqxListBox({incrementalSearch:b.incrementalSearch})}if(c=="incrementalSearchDelay"){b.listBoxContainer.jqxListBox({incrementalSearchDelay:b.incrementalSearchDelay})}if(c=="dropDownHeight"){if(!b.autoDropDownHeight){b.listBoxContainer.jqxListBox({height:b.dropDownHeight});b.container.height(parseInt(b.dropDownHeight)+25)}}if(c=="dropDownWidth"||c=="scrollBarSize"){var d=b.width;if(b.dropDownWidth!="auto"){d=b.dropDownWidth}b.listBoxContainer.jqxListBox({width:d,scrollBarSize:b.scrollBarSize});b.container.width(parseInt(d)+25)}if(c=="width"||c=="height"){if(e!=f){this.refresh();if(c=="width"){if(b.dropDownWidth=="auto"){var d=2+b.host.width();b.listBoxContainer.jqxListBox({width:d});b.container.width(parseInt(d)+25)}}b.close()}}if(c=="checkboxes"){b.listBoxContainer.jqxListBox({checkboxes:b.checkboxes})}if(c=="selectedIndex"){if(b.listBox!=null){b.listBox.selectIndex(parseInt(e));b.renderSelection()}}}})})(jqxBaseFramework);
|
|
9
9
|
|
package/jqwidgets/jqxeditor.js
CHANGED
package/jqwidgets/jqxexpander.js
CHANGED
package/jqwidgets/jqxform.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
jQWidgets
|
|
3
|
-
Copyright (c) 2011-
|
|
2
|
+
jQWidgets v16.0.1 (2023-May)
|
|
3
|
+
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://jqwidgets.com/license/
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
8
|
-
(function(a){a.jqx.jqxWidget("jqxForm","",{});a.extend(a.jqx._jqxForm.prototype,{defineInstance:function(){var b={padding:{left:5,top:5,right:5,bottom:5},backgroundColor:"#F5F5F5",borderColor:"#E5E5E5",value:{},template:[{type:"text",label:"TextBox 1"},{type:"text",label:"TextBox 2"},]};a.extend(true,this,b)},createInstance:function(c){var b=this;b._isInitialized=false;var d=b.host;d.addClass(b.toThemeProperty("jqx-widget"));b._renderAndInit();this._setValue(this.value);this._prevValue=this._getValue();b._isInitialized=true},destroy:function(){this._destroyElements();this.host.removeData();this.host.remove();delete this.host;delete this.set;delete this.get;delete this.call;delete this.element},_destroyElements:function(){for(var c=0;c<this.template.length;c++){if(a.isArray(this.template[c].columns)){for(var b=0;b<this.template[c].columns.length;b++){var d=c+"_"+b;this._getComponentById(d).off();this.host.find("#rowWrap_el_"+d).remove()}}this._getComponentById(c).off();this._getComponentLabelById(c).off();this._getComponentLabelById(c).removeData();this.host.find("#rowWrap_el_"+c).remove()}this.host.find("#formWrap").remove()},val:function(b){if(undefined==b){return this._getValue()}else{this._setValue(b)}},_onChangeHandler:function(f){if(!this.isInitialized||this._suppressEvents){return}var c=this._getValue();if(this._prevValue&&JSON.stringify(c)==JSON.stringify(this._prevValue)){return}var d=new a.Event("formDataChange");d.args={value:c,previousValue:this._prevValue};d.owner=this;var b=this.host.trigger(d);if(d.cancel){this._setValue(this._prevValue)}else{this._prevValue=c}return b},_onButtonClick:function(c,d){if(!this.isInitialized){return}var e=new a.Event("buttonClick");e.args={name:d.name,text:c.val()};e.owner=this;var b=this.host.trigger(e);return b},submit:function(f,k,b){var l=this;var d=l._getValue(true);var h="<form id='jqx_fromToSubmit'";if(f){h+=' action="'+f+'"'}if(k){h+=' target="'+k+'"'}if(b&&b.toString().toLowerCase()==="get"){h+=' method="GET"'}else{h+=' method="POST"'}h+=">";for(var g=0;g<d.length;g++){var e=d[g].value;var j=d[g].tool;var c=j.name;if(c==undefined){c=j.id}if(c==undefined){c=j.bind}if(j.type=="button"||j.type=="label"){if(!j.submit||j.submit==false){continue}}if(j.submit==false){continue}if(c!==undefined){h+='<input type="hidden" ';h+=' name="'+c+'"';h+=' value="'+e+'"';h+=">"}}h+="</form>";l.host.find("#formSubmit").html(h);l.host.find("#jqx_fromToSubmit").submit()},_getValue:function(c){var e={};var d=[];for(var h=0;h<this.template.length;h++){var k=this.template[h];var l="el_"+this.element.id+h;if(a.isArray(k.columns)){for(var g=0;g<k.columns.length;g++){var f=k.columns[g];var p=l+"."+g;if(f.type=="option"&&f.component!="jqxDropDownList"){var o=this._radioGroupGetValue(f,p);if(f.bind==undefined){}else{this._setObjectProperty(e,f.bind,o)}if(c){d.push({tool:f,value:o})}continue}var b=this._getComponentById(h+"_"+g);var n=b.val();if(n===undefined){n=null}if(f.bind==undefined){}else{this._setObjectProperty(e,f.bind,n)}if(c){d.push({tool:f,value:n})}}continue}if(k.type=="option"&&k.component!="jqxDropDownList"){var o=this._radioGroupGetValue(k,l);if(k.bind==undefined){}else{this._setObjectProperty(e,k.bind,o)}if(c){d.push({tool:k,value:o})}continue}var m=this._getComponentById(h);var n=m.val();if(n===undefined){n=null}if(k.bind==undefined){}else{this._setObjectProperty(e,k.bind,n)}if(c){d.push({tool:k,value:n})}}if(c){return d}return a.extend({},this._prevValue,e)},_getObjectProperty:function(f,d){if(typeof(f)!=="object"||f===undefined||d===undefined||d==""){return f}var e=d.split(".");var g=f;for(var c=0;c<e.length;c++){g=g[e[c]]}return g},_setObjectProperty:function(g,d,e){if(undefined===g){return}if(undefined==d||d==""){g=e;return}var f=d.split(".");var c=0;while(c<f.length-1){if(undefined==g[f[c]]){g[f[c]]={}}c++}g[f[c]]=e},_setValue:function(c){this._suppressEvents=true;for(var g=0;g<this.template.length;g++){var h=this.template[g];var k="el_"+this.element.id+g;var d=undefined;if(a.isArray(h.columns)){for(var f=0;f<h.columns.length;f++){var e=h.columns[f];var m=k+"."+f;if(!e.bind){continue}d=this._getObjectProperty(c,e.bind);if(e.type=="option"&&e.component!="jqxDropDownList"){this._radioGroupSetValue(e,m,d);continue}var b=this._getComponentById(g+"_"+f);if(c!==undefined){b.val(d)}}continue}if(!h.bind){continue}d=this._getObjectProperty(c,h.bind);if(h.type=="option"&&h.component!="jqxDropDownList"){this._radioGroupSetValue(h,k,d);continue}var l=this._getComponentById(g);if(h.type=="label"){l.html(d);continue}if(c!==undefined){l.val(d)}}this._prevValue=c;this._suppressEvents=false},_radioGroupGetValue:function(b,f){for(var c=0;c<b.options.length;c++){var e=f+"_option_"+c;var d=this.host.find("#"+e);if(d.length>0){var g=d.jqxRadioButton("val");if(g==true){if(b.options[c].value!==undefined){return b.options[c].value}return b.options[c].label}}}return undefined},_radioGroupSetValue:function(b,f,g){for(var c=0;c<b.options.length;c++){if(b.options[c].value!==undefined){if(g!==b.options[c].value){continue}}else{if(g!==b.options[c].label){continue}}var e=f+"_option_"+c;var d=this.host.find("#"+e);if(d.length>0){d.jqxRadioButton("val",true)}}},_getToolStyle:function(b){var c="display: block;";var d=["left","right","top","bottom"];if(b.height){c+="height: "+b.height+";"}if(b.valign!==undefined){c+="vertical-align: "+b.valign+";"}else{c+="vertical-align: middle;"}return c},_getAlignMargin:function(b,f){if(!b||!b[f]){return""}var g=["left","right","top","bottom"];var e={};var d="";if(b[f]){e={};if(b[f]=="left"){e.left="0px";e.right="auto"}else{if(b[f]=="right"){e.left="auto";e.right="0px"}else{e.left="auto";e.right="auto"}}}if(e){for(var c in g){if(e[g[c]]){d+="margin-"+g[c]+": "+e[g[c]]+";"}}}return d},_getPaddingAndMarginStyle:function(f,g){var b="";var h=["left","right","top","bottom"];var k=g?"labelpadding":"padding";var e=g?"labelmargin":"margin";var j=a.extend({left:5,top:5,right:5,bottom:5},f[k]);for(var d in j){j[d]=!isNaN(j[d])?j[d]:parseFloat(j[d].toString())}var c=f[e];if(j){for(var d in h){if(j[h[d]]){b+="padding-"+h[d]+": "+j[h[d]]+"px;"}}}if(c){for(var d in h){if(c[h[d]]){b+="margin-"+h[d]+": "+c[h[d]]+";"}}}return b},_getToolLabelStyle:function(b){var c="display:block;";var d=["left","right","top","bottom"];if(b.labelheight!==undefined){c+="height: "+b.labelheight+";"}else{c+="height: 100%;"}if(b.labelvalign!==undefined){c+="vertical-align: "+b.labelvalign+";"}else{if(b.valign!==undefined){c+="vertical-align: "+b.valign+";"}else{c+="vertical-align: middle;"}}return c},_renderAndInit:function(){var b=this._createTemplateHtml();this.host.append(b);this._initTools()},refresh:function(c){var b=this;if(!b._isInitialized||c===true){return}var d=b.val();b._destroyElements();b._renderAndInit();b._prevValue=d;b.val(d)},_createTemplateHtml:function(){var c=this.groups;var b="padding-left: "+parseFloat(this.padding.left)+"px;padding-right: "+parseFloat(this.padding.right)+"px;padding-top: "+parseFloat(this.padding.top)+"px;padding-bottom: "+parseFloat(this.padding.bottom)+"px;";var f="<table id='formWrap' style='background-color: "+this.backgroundColor+"; width: 100%; white-space: nowrap; border: 1px solid "+this.borderColor+";"+b+"' cellpadding='0' cellspacing='0'><div id='formSubmit' style='display:hidden;'><div>";var j=this.template;for(var e=0;e<j.length;e++){var h="el_"+this.element.id+e;var d=this.template[e];var g=this._getToolTemplate(d,h);f+=g}f+="</table>";return f},_beginRow:function(e,b,c){if(undefined===b){b="auto"}if(c){c="valign='"+c+"'"}else{c=""}var d="<tr style='width: 100%; height: "+b+";' id='rowWrap_"+e+"' "+c+">";d+="<td style='width: 100%;'><table style='width: 100%; white-space: nowrap; border: 0px;' cellspacing='0' cellpadding='0'><tr style='width: 100%'>";return d},_endRow:function(){return"<td style='width: auto; background: transparent;'> </tr></table></td></tr>"},_beginColumn:function(d,c){if(!c){c=""}if(undefined===d){d="auto"}var b="<td style='width:"+d+"; background: transparent;'>";b+="<div style='display:block; overflow: visible; width: 100%; background: transparent;'>";return b},_endColumn:function(){return"</div></td>"},_splitLabelToolWidth:function(e,c){var h=c?"auto":e.columnwidth;var b=e.labelwidth;var d=a.extend({left:5,top:5,right:5,bottom:5},e.padding);var g=a.extend({left:5,top:5,right:5,bottom:5},e.labelpadding);for(var f in d){d[f]=!isNaN(d[f])?d[f]:parseFloat(d[f].toString())}for(var f in g){g[f]=!isNaN(g[f])?g[f]:parseFloat(g[f].toString())}if(e.label==""||e.label==undefined){b=0;g={left:0,right:0,top:0,bottom:0}}if(e.labelposition=="top"||e.labelposition=="bottom"){if(undefined===b){b=h}if(undefined===h){h=b}if(h&&h.toString().indexOf("%")!=-1&&b&&b.toString().indexOf("%")!=-1){h=b=Math.max(parseFloat(h),parseFloat(b))+"%"}if(h&&h.toString().indexOf("%")==-1&&b&&b.toString().indexOf("%")==-1){h=b=Math.max(parseFloat(h),parseFloat(b))+"px"}return[b,h]}if(b===undefined){if(h!==undefined&&h!=="auto"){return["auto",h]}else{if(e.labelposition=="right"){if(e.align=="right"||e.align=="center"||e.align=="middle"){return["auto","100%"]}return["100%","auto"]}return["auto","100%"]}}else{if(b.toString().indexOf("%")!==-1){b=parseFloat(b);if(h!==undefined){if(h.toString().indexOf("%")!==-1){h=parseFloat(h);return[Math.min(100,b)+"%",Math.min(h,100-b)+"%"]}else{h=parseFloat(h);return[Math.min(100,b)+"%",h]}}return[Math.min(100,b)+"%",Math.max(0,100-b)+"%"]}else{b=parseFloat(b)+g.left+g.right;if(h==undefined){return[b+"px","calc(100% - "+b+"px)"]}return[b+"px",h]}}},_getToolTemplate:function(h,t,j,q){var g={};for(var s in h){g[s.toLowerCase()]=h[s]}if(a.isArray(g.columns)&&isNaN(j)){var w=this._beginRow(t,g.rowheight||"auto");for(var B=0;B<g.columns.length;B++){var z=this._getToolTemplate(g.columns[B],(t+"_"+B),undefined,true);var u="auto";if(g.columns[B].columnWidth!==undefined){u=g.columns[B].columnWidth}else{if(g.columns[B].width!==undefined){u=g.columns[B].width}}w+=this._beginColumn(u);w+="<table cellspacing='0' cellpadding='0' style='width: 100%; white-space: nowrap; border: 0px;'>"+z+"</table>";w+=this._endColumn()}w+=this._endRow();return w}if(g.type=="option"&&g.component!="jqxDropDownList"){if(isNaN(j)){var C=this._beginRow(t,g.rowheight||"auto",g.valign);for(var B=0;B<g.options.length;B++){var z=this._getToolTemplate(g,(t+"_option_"+B),B,true);if(g.optionslayout=="horizontal"){var u=100/Math.max(1,g.options.length)+"%";if(g.columnwidth){u=g.columnwidth}C+=this._beginColumn(u);C+="<table cellspacing='0' cellpadding='0' style='width: 100%; white-space: nowrap; border: 0px;'>"+z+"</table>";C+=this._endColumn()}else{C+=z}}C+=this._endRow();return C}}var d=g.labelposition;var m=g.label;var k="";if(g.type=="option"&&g.component!="jqxDropDownList"&&!isNaN(j)){var k=g.options[j].label;m=k}if(m===undefined){m=""}var C="";var b=this._getToolLabelStyle(g)+this._getPaddingAndMarginStyle(g,true);var r=this._getToolStyle(g)+this._getPaddingAndMarginStyle(g,false);var e="";var y=this._getAlignMargin(g,"align");var D="text-align: left;";if(g.labelalign=="center"||g.labelalign=="middle"){D="text-align: center"}else{if(g.labelalign=="right"){D="text-align: right"}}var E="text-align: left;";if(g.align=="center"||g.align=="middle"){E="text-align: center"}else{if(g.align=="right"){E="text-align: right"}}var o=this._splitLabelToolWidth(g,q);var f=m;if(g.required){var n="<span class='"+e+"' style='color:red;'>*</span>";if(g.requiredposition){if(g.requiredposition.toLowerCase()=="left"){f=n+" "+m}else{f=m+" "+n}}else{f=m+" "+n}}var x="";if(g.type=="boolean"||(g.type=="option"&&!isNaN(j))){x+="; cursor: pointer;"}var l="<div class='"+e+"' style='"+b+"'><div style='"+D+x+";' id='label_"+t+"'>"+f+"</div></div>";var A=(g.info!==undefined&&g.infoposition!="left")?"margin-left: -3px;":"margin-right: -3px;";var c="<div style='"+A+"' class='"+this.toThemeProperty("jqx-info-icon")+"' title='"+g.info+"'></div>";var v="<div style='background: transparent;"+r+"'><div style='width: auto; height: auto; "+y+"' id='"+t+"'></div></div>";if(g.type=="text"||g.type=="button"){v="<div style='background: transparent;"+r+E+"'><input style='width: auto; height: auto; "+y+"' id='"+t+"' type='"+g.type+"'/></div>"}else{if(g.type=="password"){v="<div style='background: transparent;"+r+E+"'><input type='password' style='width: auto; height: auto; "+y+"' id='"+t+"'/></div>"}}if(g.type=="option"&&g.component!="jqxDropDownList"&&!isNaN(j)){var u=g.width;if(u===undefined){u="15px"}o=[g.labelwidth||"auto",u];if(g.labelposition&&(g.labelposition=="top"||g.labelposition=="bottom")){o=["100%","100%"]}v="<div style='background: transparent;"+r+y+E+"'><div style='width: "+u+"; height: 100%; "+y+E+";' id='"+t+"'></div></div>"}if(g.info!==undefined&&g.info!==""){if(g.infoposition=="left"){v="<table cellspacing='0' cellpadding='0' style='border: 0px; white-space: nowrap;"+y+"'><tr><td>"+c+"</td><td>"+v+"</td></tr></table>"}else{v="<table cellspacing='0' cellpadding='0' style='border: 0px; white-space: nowrap;"+y+"'><tr><td>"+v+"</td><td>"+c+"</td></tr></table>"}}if(d=="right"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(o[1]);C+=v;if(m!=""){C+=this._endColumn();C+=this._beginColumn(o[0]);C+=l}C+=this._endColumn();C+=this._endRow()}else{if(d=="top"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(g.columnwidth);if(m!=""){C+=l}C+=v;C+=this._endColumn();C+=this._endRow()}else{if(d=="bottom"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(g.columnwidth);C+=v;if(m!=""){C+=l}C+=this._endColumn();C+=this._endRow()}else{C+=this._beginRow(t,g.rowheight||"auto",g.valign);if(m!=""){C+=this._beginColumn(o[0]);C+=l;C+=this._endColumn()}C+=this._beginColumn(o[1]);C+=v;C+=this._endColumn();C+=this._endRow()}}}return C},_initTools:function(f,e){var d=f||this.template;if(undefined==e){e=""}for(var c=0;c<d.length;c++){var b=d[c];if(a.isArray(b.columns)){this._initTools(b.columns,c+"_");continue}var g=e+c;switch(b.type){case"color":this._initColorTool(g);break;case"option":if(b.component=="jqxDropDownList"){this._initOptionToolDropDownList(g)}else{this._initOptionTool(g)}break;case"dropdownlist":this._initOptionToolDropDownList(g);break;case"number":this._initNumberTool(g);break;case"boolean":case"checkbox":this._initBooleanTool(g);break;case"text":this._initTextTool(g);break;case"password":this._initPasswordTool(g);break;case"label":this._initLabelTool(g);break;case"date":case"time":case"datetime":this._initDateTimeTool(g);break;case"button":this._initButtonTool(g);break;case"custom":this._initCustomTool(g);break}if(b.visible===false){this._showhideComponent(undefined,g,false)}if(b.theme){this._setToolTheme(b,g)}}},_setToolTheme:function(c,e){var b=this._getComponentById(e);var d=c.theme||this.theme;switch(c.type){case"option":if(c.component=="jqxDropDownList"){b.jqxDropDownList("theme",d)}break;case"number":b.jqxNumberInput("theme",d);break;case"text":b.jqxInput("theme",d);break;case"password":b.jqxPasswordInput("theme",d);break}},_initOptionTool:function(h){var b=this;var j="el_"+this.element.id+h;var c=b._getTool(h);for(var d=0;d<c.options.length;d++){var g=j+"_option_"+d;var e=b.host.find("#"+g);if(e.length>0){e.jqxRadioButton({width:25,theme:b.theme,groupName:"group_"+h}).on("change",function(i){b._onChangeHandler(i)})}var f=b.host.find("#label_"+g);f.data("el",e);f.on("mousedown",function(k){var i=a(this).data("el");i.jqxRadioButton("toggle")})}},_initOptionToolDropDownList:function(j){var l=this;var d="el_"+this.element.id+j;var f=l._getTool(j);var g=this.host.find("#"+d);var h='<div style="height: 20px;"></div>';var b=[];if(f.options&&a.isArray(f.options)){for(var e=0;e<f.options.length;e++){b.push(f.options[e])}}if(f.init){f.init(g)}else{var c=isNaN(parseFloat(f.width))?"auto":f.width;if(f.width&&f.width.toString().indexOf("%")!=-1&&f.columnwidth===undefined){c="100%"}var k=isNaN(parseFloat(f.height))?"30px":f.height;g.jqxDropDownList({theme:l.theme,width:c||"auto",autoDropDownHeight:true,height:k,enableBrowserBoundsDetection:true,source:b,selectedIndex:0})}g.on("change",function(i){l._onChangeHandler(i)})},_initNumberTool:function(g){var c=this;var h="el_"+this.element.id+g;var d=c._getTool(g);var e=this.host.find("#"+h);if(d.init){d.init(e)}else{var f=isNaN(parseFloat(d.width))?"auto":d.width;var b=isNaN(parseFloat(d.height))?"30px":d.height;e.jqxNumberInput({theme:c.theme,width:f,height:b,inputMode:"simple"})}e.on("change",function(i){c._onChangeHandler(i)})},_initBooleanTool:function(f){var j=this;var b="el_"+this.element.id+f;var e=j._getTool(f);var g=this.host.find("#"+b);if(e.init){e.init(g)}else{var c=isNaN(parseFloat(e.width))?"auto":e.width;var i=isNaN(parseFloat(e.height))?"30px":e.height;var d=e.isThreeState==true;if(e.component===undefined||e.component=="jqxCheckBox"){g.jqxCheckBox({theme:j.theme,width:c,height:i,hasThreeStates:d})}else{return}}g.on("change",function(k){j._onChangeHandler(k)});var h=j.host.find("#label_"+b);h.on("mousedown",function(k){var l=j.host.find("#"+b).val();j.host.find("#"+b).val(!l)})},_initTextTool:function(g){var d=this;var h="el_"+this.element.id+g;var e=d._getTool(g);var c=this.host.find("#"+h);if(e.init){e.init(c)}else{var f=isNaN(parseFloat(e.width))?"auto":e.width;var b=isNaN(parseFloat(e.height))?"30px":e.height;c.jqxInput({theme:d.theme,width:f,height:b})}c.on("change",function(i){d._onChangeHandler(i)})},_initLabelTool:function(f){var b=this;var g="el_"+this.element.id+f;var c=b._getTool(f);var e=this.host.find("#"+g);if(c.render&&a.isFunction(c.render)){var d=c.render();e.html(d||"")}},_getTool:function(e){var b=this;var d=e.split("_");var c=b.template[d[0]];if(d[1]){if(a.isArray(c.columns)&&c.columns.length>d[1]){return c.columns[d[1]]}return undefined}return c},_initCustomTool:function(d){var b=this;var f="el_"+this.element.id+d;var c=b._getTool(d);var e=this.host.find("#"+f);if(c.init){c.init(e)}},_initButtonTool:function(g){var c=this;var h="el_"+this.element.id+g;var d=c._getTool(g);var e=this.host.find("#"+h);if(d.init){d.init(e)}else{var f=isNaN(parseFloat(d.width))?"auto":d.width;var b=isNaN(parseFloat(d.height))?"30px":d.height;e.jqxButton({theme:c.theme,width:f,height:b});e.val(d.text===undefined?"Button":d.text)}this.host.find("#"+h).on("click",function(i){c._onButtonClick(e,d)})},_initPasswordTool:function(g){var d=this;var h="el_"+this.element.id+g;var e=d._getTool(g);var c=this.host.find("#"+h);if(e.init){e.init(c)}else{var f=isNaN(parseFloat(e.width))?"auto":e.width;var b=isNaN(parseFloat(e.height))?"25px":e.height;c.jqxPasswordInput({theme:d.theme,width:f,height:b})}c.on("change",function(i){d._onChangeHandler(i)})},_initDateTimeTool:function(h){var e=this;var i="el_"+this.element.id+h;var f=e._getTool(h);var d=this.host.find("#"+i);if(f.init){f.init(d)}else{var g=isNaN(parseFloat(f.width))?"auto":f.width;var c=isNaN(parseFloat(f.height))?"30px":f.height;var b=f.formatString;if(!b){if(f.type=="time"){b="hh mm ss tt"}else{if(f.type=="date"){b="MM/dd/yyyy"}else{b="MM/dd/yyyy hh:mm:ss tt"}}}d.jqxDateTimeInput({theme:e.theme,width:g,height:c,formatString:b,showTimeButton:f.type!="date",showCalendarButton:f.type!="time"})}d.on("valueChanged",function(j){e._onChangeHandler(j)})},getComponentByName:function(c){if(!a.isArray(this.template)){return undefined}for(var d=0;d<this.template.length;d++){if(this.template[d].name==c){return this._getComponentById(d)}if(a.isArray(this.template[d].columns)){for(var b=0;b<this.template[d].columns.length;b++){if(this.template[d].columns[b].name==c){return this._getComponentById(d+"_"+b)}}}}return undefined},_getComponentById:function(c){var b=this.host.find("#el_"+this.element.id+c);return b},_getComponentLabelById:function(c){var b=this.host.find("#label_el_"+c);return b},hideComponent:function(b){this._showhideComponent(b,undefined,false)},showComponent:function(b){this._showhideComponent(b,undefined,true)},_showhideComponent:function(e,h,b){if(!a.isArray(this.template)){return}var d="";if(h===undefined){for(var f=0;f<this.template.length;f++){if(this.template[f].name==e){d=f;break}if(this.template[f].bind==e){d=f;break}if(a.isArray(this.template[f].columns)){for(var c=0;c<this.template[f].length;c++){if(this.template[f].columns[c].name==e){d=f+"_"+c;break}if(this.template[f].columns[c].bind==e){d=f+"_"+c;break}}}}}else{d=h}if(d!=""){var g=this.host.find("#rowWrap_el_"+this.element.id+d);if(g&&g.length!=0){if(b){g.show()}else{g.hide()}}}}})})(jqxBaseFramework);
|
|
8
|
+
(function(a){a.jqx.jqxWidget("jqxForm","",{});a.extend(a.jqx._jqxForm.prototype,{defineInstance:function(){var b={padding:{left:5,top:5,right:5,bottom:5},backgroundColor:"#F5F5F5",borderColor:"#E5E5E5",value:{},template:[{type:"text",label:"TextBox 1"},{type:"text",label:"TextBox 2"},]};a.extend(true,this,b)},createInstance:function(c){var b=this;b._isInitialized=false;var d=b.host;d.addClass(b.toThemeProperty("jqx-widget"));d.addClass(b.toThemeProperty("jqx-form"));b._renderAndInit();this._setValue(this.value);this._prevValue=this._getValue();b._isInitialized=true},destroy:function(){this._destroyElements();this.host.removeData();this.host.remove();delete this.host;delete this.set;delete this.get;delete this.call;delete this.element},_destroyElements:function(){for(var c=0;c<this.template.length;c++){if(a.isArray(this.template[c].columns)){for(var b=0;b<this.template[c].columns.length;b++){var d=c+"_"+b;this._getComponentById(d).off();this.host.find("#rowWrap_el_"+d).remove()}}this._getComponentById(c).off();this._getComponentLabelById(c).off();this._getComponentLabelById(c).removeData();this.host.find("#rowWrap_el_"+c).remove()}this.host.find("#formWrap").remove()},val:function(b){if(undefined==b){return this._getValue()}else{this._setValue(b)}},_onChangeHandler:function(f){if(!this.isInitialized||this._suppressEvents){return}var c=this._getValue();if(this._prevValue&&JSON.stringify(c)==JSON.stringify(this._prevValue)){return}var d=new a.Event("formDataChange");d.args={value:c,previousValue:this._prevValue};d.owner=this;var b=this.host.trigger(d);if(d.cancel){this._setValue(this._prevValue)}else{this._prevValue=c}return b},_onButtonClick:function(c,d){if(!this.isInitialized){return}var e=new a.Event("buttonClick");e.args={name:d.name,text:c.val()};e.owner=this;var b=this.host.trigger(e);return b},submit:function(f,k,b){var l=this;var d=l._getValue(true);var h="<form id='jqx_fromToSubmit'";if(f){h+=' action="'+f+'"'}if(k){h+=' target="'+k+'"'}if(b&&b.toString().toLowerCase()==="get"){h+=' method="GET"'}else{h+=' method="POST"'}h+=">";for(var g=0;g<d.length;g++){var e=d[g].value;var j=d[g].tool;var c=j.name;if(c==undefined){c=j.id}if(c==undefined){c=j.bind}if(j.type=="button"||j.type=="label"){if(!j.submit||j.submit==false){continue}}if(j.submit==false){continue}if(c!==undefined){h+='<input type="hidden" ';h+=' name="'+c+'"';h+=' value="'+e+'"';h+=">"}}h+="</form>";l.host.find("#formSubmit").html(h);l.host.find("#jqx_fromToSubmit").submit()},_getValue:function(c){var e={};var d=[];for(var h=0;h<this.template.length;h++){var k=this.template[h];var l="el_"+this.element.id+h;if(a.isArray(k.columns)){for(var g=0;g<k.columns.length;g++){var f=k.columns[g];var p=l+"."+g;if(f.type=="option"&&f.component!="jqxDropDownList"){var o=this._radioGroupGetValue(f,p);if(f.bind==undefined){}else{this._setObjectProperty(e,f.bind,o)}if(c){d.push({tool:f,value:o})}continue}var b=this._getComponentById(h+"_"+g);var n=b.val();if(n===undefined){n=null}if(f.bind==undefined){}else{this._setObjectProperty(e,f.bind,n)}if(c){d.push({tool:f,value:n})}}continue}if(k.type=="option"&&k.component!="jqxDropDownList"){var o=this._radioGroupGetValue(k,l);if(k.bind==undefined){}else{this._setObjectProperty(e,k.bind,o)}if(c){d.push({tool:k,value:o})}continue}var m=this._getComponentById(h);var n=m.val();if(n===undefined){n=null}if(k.bind==undefined){}else{this._setObjectProperty(e,k.bind,n)}if(c){d.push({tool:k,value:n})}}if(c){return d}return a.extend({},this._prevValue,e)},_getObjectProperty:function(f,d){if(typeof(f)!=="object"||f===undefined||d===undefined||d==""){return f}var e=d.split(".");var g=f;for(var c=0;c<e.length;c++){g=g[e[c]]}return g},_setObjectProperty:function(g,d,e){if(undefined===g){return}if(undefined==d||d==""){g=e;return}var f=d.split(".");var c=0;while(c<f.length-1){if(undefined==g[f[c]]){g[f[c]]={}}c++}g[f[c]]=e},_setValue:function(c){this._suppressEvents=true;for(var g=0;g<this.template.length;g++){var h=this.template[g];var k="el_"+this.element.id+g;var d=undefined;if(a.isArray(h.columns)){for(var f=0;f<h.columns.length;f++){var e=h.columns[f];var m=k+"."+f;if(!e.bind){continue}d=this._getObjectProperty(c,e.bind);if(e.type=="option"&&e.component!="jqxDropDownList"){this._radioGroupSetValue(e,m,d);continue}var b=this._getComponentById(g+"_"+f);if(c!==undefined){b.val(d)}}continue}if(!h.bind){continue}d=this._getObjectProperty(c,h.bind);if(h.type=="option"&&h.component!="jqxDropDownList"){this._radioGroupSetValue(h,k,d);continue}var l=this._getComponentById(g);if(h.type=="label"){l.html(d);continue}if(c!==undefined){l.val(d)}}this._prevValue=c;this._suppressEvents=false},_radioGroupGetValue:function(b,f){for(var c=0;c<b.options.length;c++){var e=f+"_option_"+c;var d=this.host.find("#"+e);if(d.length>0){var g=d.jqxRadioButton("val");if(g==true){if(b.options[c].value!==undefined){return b.options[c].value}return b.options[c].label}}}return undefined},_radioGroupSetValue:function(b,f,g){for(var c=0;c<b.options.length;c++){if(b.options[c].value!==undefined){if(g!==b.options[c].value){continue}}else{if(g!==b.options[c].label){continue}}var e=f+"_option_"+c;var d=this.host.find("#"+e);if(d.length>0){d.jqxRadioButton("val",true)}}},_getToolStyle:function(b){var c="display: block;";var d=["left","right","top","bottom"];if(b.height){c+="height: "+b.height+";"}if(b.valign!==undefined){c+="vertical-align: "+b.valign+";"}else{c+="vertical-align: middle;"}return c},_getAlignMargin:function(b,f){if(!b||!b[f]){return""}var g=["left","right","top","bottom"];var e={};var d="";if(b[f]){e={};if(b[f]=="left"){e.left="0px";e.right="auto"}else{if(b[f]=="right"){e.left="auto";e.right="0px"}else{e.left="auto";e.right="auto"}}}if(e){for(var c in g){if(e[g[c]]){d+="margin-"+g[c]+": "+e[g[c]]+";"}}}return d},_getPaddingAndMarginStyle:function(f,g){var b="";var h=["left","right","top","bottom"];var k=g?"labelpadding":"padding";var e=g?"labelmargin":"margin";var j=a.extend({left:5,top:5,right:5,bottom:5},f[k]);for(var d in j){j[d]=!isNaN(j[d])?j[d]:parseFloat(j[d].toString())}var c=f[e];if(j){for(var d in h){if(j[h[d]]){b+="padding-"+h[d]+": "+j[h[d]]+"px;"}}}if(c){for(var d in h){if(c[h[d]]){b+="margin-"+h[d]+": "+c[h[d]]+";"}}}return b},_getToolLabelStyle:function(b){var c="display:block;";var d=["left","right","top","bottom"];if(b.labelheight!==undefined){c+="height: "+b.labelheight+";"}else{c+="height: 100%;"}if(b.labelvalign!==undefined){c+="vertical-align: "+b.labelvalign+";"}else{if(b.valign!==undefined){c+="vertical-align: "+b.valign+";"}else{c+="vertical-align: middle;"}}return c},_renderAndInit:function(){var b=this._createTemplateHtml();this.host.append(b);this._initTools()},refresh:function(c){var b=this;if(!b._isInitialized||c===true){return}var d=b.val();b._destroyElements();b._renderAndInit();b._prevValue=d;b.val(d)},_createTemplateHtml:function(){var c=this.groups;var b="padding-left: "+parseFloat(this.padding.left)+"px;padding-right: "+parseFloat(this.padding.right)+"px;padding-top: "+parseFloat(this.padding.top)+"px;padding-bottom: "+parseFloat(this.padding.bottom)+"px;";var f="<table id='formWrap' style='background-color: "+this.backgroundColor+"; width: 100%; white-space: nowrap; border: 1px solid "+this.borderColor+";"+b+"' cellpadding='0' cellspacing='0'><div id='formSubmit' style='display:hidden;'><div>";var j=this.template;for(var e=0;e<j.length;e++){var h="el_"+this.element.id+e;var d=this.template[e];var g=this._getToolTemplate(d,h);f+=g}f+="</table>";return f},_beginRow:function(e,b,c){if(undefined===b){b="auto"}if(c){c="valign='"+c+"'"}else{c=""}var d="<tr style='width: 100%; height: "+b+";' id='rowWrap_"+e+"' "+c+">";d+="<td style='width: 100%;'><table style='width: 100%; white-space: nowrap; border: 0px;' cellspacing='0' cellpadding='0'><tr style='width: 100%'>";return d},_endRow:function(){return"<td style='width: auto; background: transparent;'> </tr></table></td></tr>"},_beginColumn:function(d,c){if(!c){c=""}if(undefined===d){d="auto"}var b="<td style='width:"+d+"; background: transparent;'>";b+="<div style='display:block; overflow: visible; width: 100%; background: transparent;'>";return b},_endColumn:function(){return"</div></td>"},_splitLabelToolWidth:function(e,c){var h=c?"auto":e.columnwidth;var b=e.labelwidth;var d=a.extend({left:5,top:5,right:5,bottom:5},e.padding);var g=a.extend({left:5,top:5,right:5,bottom:5},e.labelpadding);for(var f in d){d[f]=!isNaN(d[f])?d[f]:parseFloat(d[f].toString())}for(var f in g){g[f]=!isNaN(g[f])?g[f]:parseFloat(g[f].toString())}if(e.label==""||e.label==undefined){b=0;g={left:0,right:0,top:0,bottom:0}}if(e.labelposition=="top"||e.labelposition=="bottom"){if(undefined===b){b=h}if(undefined===h){h=b}if(h&&h.toString().indexOf("%")!=-1&&b&&b.toString().indexOf("%")!=-1){h=b=Math.max(parseFloat(h),parseFloat(b))+"%"}if(h&&h.toString().indexOf("%")==-1&&b&&b.toString().indexOf("%")==-1){h=b=Math.max(parseFloat(h),parseFloat(b))+"px"}return[b,h]}if(b===undefined){if(h!==undefined&&h!=="auto"){return["auto",h]}else{if(e.labelposition=="right"){if(e.align=="right"||e.align=="center"||e.align=="middle"){return["auto","100%"]}return["100%","auto"]}return["auto","100%"]}}else{if(b.toString().indexOf("%")!==-1){b=parseFloat(b);if(h!==undefined){if(h.toString().indexOf("%")!==-1){h=parseFloat(h);return[Math.min(100,b)+"%",Math.min(h,100-b)+"%"]}else{h=parseFloat(h);return[Math.min(100,b)+"%",h]}}return[Math.min(100,b)+"%",Math.max(0,100-b)+"%"]}else{b=parseFloat(b)+g.left+g.right;if(h==undefined){return[b+"px","calc(100% - "+b+"px)"]}return[b+"px",h]}}},_getToolTemplate:function(h,t,j,q){var g={};for(var s in h){g[s.toLowerCase()]=h[s]}if(a.isArray(g.columns)&&isNaN(j)){var w=this._beginRow(t,g.rowheight||"auto");for(var B=0;B<g.columns.length;B++){var z=this._getToolTemplate(g.columns[B],(t+"_"+B),undefined,true);var u="auto";if(g.columns[B].columnWidth!==undefined){u=g.columns[B].columnWidth}else{if(g.columns[B].width!==undefined){u=g.columns[B].width}}w+=this._beginColumn(u);w+="<table cellspacing='0' cellpadding='0' style='width: 100%; white-space: nowrap; border: 0px;'>"+z+"</table>";w+=this._endColumn()}w+=this._endRow();return w}if(g.type=="option"&&g.component!="jqxDropDownList"){if(isNaN(j)){var C=this._beginRow(t,g.rowheight||"auto",g.valign);for(var B=0;B<g.options.length;B++){var z=this._getToolTemplate(g,(t+"_option_"+B),B,true);if(g.optionslayout=="horizontal"){var u=100/Math.max(1,g.options.length)+"%";if(g.columnwidth){u=g.columnwidth}C+=this._beginColumn(u);C+="<table cellspacing='0' cellpadding='0' style='width: 100%; white-space: nowrap; border: 0px;'>"+z+"</table>";C+=this._endColumn()}else{C+=z}}C+=this._endRow();return C}}var d=g.labelposition;var m=g.label;var k="";if(g.type=="option"&&g.component!="jqxDropDownList"&&!isNaN(j)){var k=g.options[j].label;m=k}if(m===undefined){m=""}var C="";var b=this._getToolLabelStyle(g)+this._getPaddingAndMarginStyle(g,true);var r=this._getToolStyle(g)+this._getPaddingAndMarginStyle(g,false);var e="";var y=this._getAlignMargin(g,"align");var D="text-align: left;";if(g.labelalign=="center"||g.labelalign=="middle"){D="text-align: center"}else{if(g.labelalign=="right"){D="text-align: right"}}var E="text-align: left;";if(g.align=="center"||g.align=="middle"){E="text-align: center"}else{if(g.align=="right"){E="text-align: right"}}var o=this._splitLabelToolWidth(g,q);var f=m;if(g.required){var n="<span class='"+e+"' style='color:red;'>*</span>";if(g.requiredposition){if(g.requiredposition.toLowerCase()=="left"){f=n+" "+m}else{f=m+" "+n}}else{f=m+" "+n}}var x="";if(g.type=="boolean"||(g.type=="option"&&!isNaN(j))){x+="; cursor: pointer;"}var l="<div class='"+e+"' style='"+b+"'><div style='"+D+x+";' id='label_"+t+"'>"+f+"</div></div>";var A=(g.info!==undefined&&g.infoposition!="left")?"margin-left: -3px;":"margin-right: -3px;";var c="<div style='"+A+"' class='"+this.toThemeProperty("jqx-info-icon")+"' title='"+g.info+"'></div>";var v="<div style='background: transparent;"+r+"'><div style='width: auto; height: auto; "+y+"' id='"+t+"'></div></div>";if(g.type=="text"||g.type=="button"){v="<div style='background: transparent;"+r+E+"'><input style='width: auto; height: auto; "+y+"' id='"+t+"' type='"+g.type+"'/></div>"}else{if(g.type=="password"){v="<div style='background: transparent;"+r+E+"'><input type='password' style='width: auto; height: auto; "+y+"' id='"+t+"'/></div>"}}if(g.type=="option"&&g.component!="jqxDropDownList"&&!isNaN(j)){var u=g.width;if(u===undefined){u="15px"}o=[g.labelwidth||"auto",u];if(g.labelposition&&(g.labelposition=="top"||g.labelposition=="bottom")){o=["100%","100%"]}v="<div style='background: transparent;"+r+y+E+"'><div style='width: "+u+"; height: 100%; "+y+E+";' id='"+t+"'></div></div>"}if(g.info!==undefined&&g.info!==""){if(g.infoposition=="left"){v="<table cellspacing='0' cellpadding='0' style='border: 0px; white-space: nowrap;"+y+"'><tr><td>"+c+"</td><td>"+v+"</td></tr></table>"}else{v="<table cellspacing='0' cellpadding='0' style='border: 0px; white-space: nowrap;"+y+"'><tr><td>"+v+"</td><td>"+c+"</td></tr></table>"}}if(d=="right"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(o[1]);C+=v;if(m!=""){C+=this._endColumn();C+=this._beginColumn(o[0]);C+=l}C+=this._endColumn();C+=this._endRow()}else{if(d=="top"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(g.columnwidth);if(m!=""){C+=l}C+=v;C+=this._endColumn();C+=this._endRow()}else{if(d=="bottom"){C+=this._beginRow(t,g.rowheight||"auto",g.valign);C+=this._beginColumn(g.columnwidth);C+=v;if(m!=""){C+=l}C+=this._endColumn();C+=this._endRow()}else{C+=this._beginRow(t,g.rowheight||"auto",g.valign);if(m!=""){C+=this._beginColumn(o[0]);C+=l;C+=this._endColumn()}C+=this._beginColumn(o[1]);C+=v;C+=this._endColumn();C+=this._endRow()}}}return C},_initTools:function(f,e){var d=f||this.template;if(undefined==e){e=""}for(var c=0;c<d.length;c++){var b=d[c];if(a.isArray(b.columns)){this._initTools(b.columns,c+"_");continue}var g=e+c;switch(b.type){case"color":this._initColorTool(g);break;case"option":if(b.component=="jqxDropDownList"){this._initOptionToolDropDownList(g)}else{this._initOptionTool(g)}break;case"dropdownlist":this._initOptionToolDropDownList(g);break;case"number":this._initNumberTool(g);break;case"boolean":case"checkbox":this._initBooleanTool(g);break;case"text":this._initTextTool(g);break;case"password":this._initPasswordTool(g);break;case"label":this._initLabelTool(g);break;case"date":case"time":case"datetime":this._initDateTimeTool(g);break;case"button":this._initButtonTool(g);break;case"custom":this._initCustomTool(g);break}if(b.visible===false){this._showhideComponent(undefined,g,false)}if(b.theme){this._setToolTheme(b,g)}}},_setToolTheme:function(c,e){var b=this._getComponentById(e);var d=c.theme||this.theme;switch(c.type){case"option":if(c.component=="jqxDropDownList"){b.jqxDropDownList("theme",d)}break;case"number":b.jqxNumberInput("theme",d);break;case"text":b.jqxInput("theme",d);break;case"password":b.jqxPasswordInput("theme",d);break}},_initOptionTool:function(h){var b=this;var j="el_"+this.element.id+h;var c=b._getTool(h);for(var d=0;d<c.options.length;d++){var g=j+"_option_"+d;var e=b.host.find("#"+g);if(e.length>0){e.jqxRadioButton({width:25,theme:b.theme,groupName:"group_"+h}).on("change",function(i){b._onChangeHandler(i)})}var f=b.host.find("#label_"+g);f.data("el",e);f.on("mousedown",function(k){var i=a(this).data("el");i.jqxRadioButton("toggle")})}},_initOptionToolDropDownList:function(j){var l=this;var d="el_"+this.element.id+j;var f=l._getTool(j);var g=this.host.find("#"+d);var h='<div style="height: 20px;"></div>';var b=[];if(f.options&&a.isArray(f.options)){for(var e=0;e<f.options.length;e++){b.push(f.options[e])}}if(f.init){f.init(g)}else{var c=isNaN(parseFloat(f.width))?"auto":f.width;if(f.width&&f.width.toString().indexOf("%")!=-1&&f.columnwidth===undefined){c="100%"}var k=isNaN(parseFloat(f.height))?"30px":f.height;g.jqxDropDownList({theme:l.theme,width:c||"auto",autoDropDownHeight:true,height:k,enableBrowserBoundsDetection:true,source:b,selectedIndex:0})}g.on("change",function(i){l._onChangeHandler(i)})},_initNumberTool:function(g){var c=this;var h="el_"+this.element.id+g;var d=c._getTool(g);var e=this.host.find("#"+h);if(d.init){d.init(e)}else{var f=isNaN(parseFloat(d.width))?"auto":d.width;var b=isNaN(parseFloat(d.height))?"30px":d.height;e.jqxNumberInput({theme:c.theme,width:f,height:b,inputMode:"simple"})}e.on("change",function(i){c._onChangeHandler(i)})},_initBooleanTool:function(f){var j=this;var b="el_"+this.element.id+f;var e=j._getTool(f);var g=this.host.find("#"+b);if(e.init){e.init(g)}else{var c=isNaN(parseFloat(e.width))?"auto":e.width;var i=isNaN(parseFloat(e.height))?"30px":e.height;var d=e.isThreeState==true;if(e.component===undefined||e.component=="jqxCheckBox"){g.jqxCheckBox({theme:j.theme,width:c,height:i,hasThreeStates:d})}else{return}}g.on("change",function(k){j._onChangeHandler(k)});var h=j.host.find("#label_"+b);h.on("mousedown",function(k){var l=j.host.find("#"+b).val();j.host.find("#"+b).val(!l)})},_initTextTool:function(g){var d=this;var h="el_"+this.element.id+g;var e=d._getTool(g);var c=this.host.find("#"+h);if(e.init){e.init(c)}else{var f=isNaN(parseFloat(e.width))?"auto":e.width;var b=isNaN(parseFloat(e.height))?"30px":e.height;c.jqxInput({theme:d.theme,width:f,height:b})}c.on("change",function(i){d._onChangeHandler(i)})},_initLabelTool:function(f){var b=this;var g="el_"+this.element.id+f;var c=b._getTool(f);var e=this.host.find("#"+g);if(c.render&&a.isFunction(c.render)){var d=c.render();e.html(d||"")}},_getTool:function(e){var b=this;var d=e.split("_");var c=b.template[d[0]];if(d[1]){if(a.isArray(c.columns)&&c.columns.length>d[1]){return c.columns[d[1]]}return undefined}return c},_initCustomTool:function(d){var b=this;var f="el_"+this.element.id+d;var c=b._getTool(d);var e=this.host.find("#"+f);if(c.init){c.init(e)}},_initButtonTool:function(g){var c=this;var h="el_"+this.element.id+g;var d=c._getTool(g);var e=this.host.find("#"+h);if(d.init){d.init(e)}else{var f=isNaN(parseFloat(d.width))?"auto":d.width;var b=isNaN(parseFloat(d.height))?"30px":d.height;e.jqxButton({theme:c.theme,width:f,height:b});e.val(d.text===undefined?"Button":d.text)}this.host.find("#"+h).on("click",function(i){c._onButtonClick(e,d)})},_initPasswordTool:function(g){var d=this;var h="el_"+this.element.id+g;var e=d._getTool(g);var c=this.host.find("#"+h);if(e.init){e.init(c)}else{var f=isNaN(parseFloat(e.width))?"auto":e.width;var b=isNaN(parseFloat(e.height))?"25px":e.height;c.jqxPasswordInput({theme:d.theme,width:f,height:b})}c.on("change",function(i){d._onChangeHandler(i)})},_initDateTimeTool:function(h){var e=this;var i="el_"+this.element.id+h;var f=e._getTool(h);var d=this.host.find("#"+i);if(f.init){f.init(d)}else{var g=isNaN(parseFloat(f.width))?"auto":f.width;var c=isNaN(parseFloat(f.height))?"30px":f.height;var b=f.formatString;if(!b){if(f.type=="time"){b="hh mm ss tt"}else{if(f.type=="date"){b="MM/dd/yyyy"}else{b="MM/dd/yyyy hh:mm:ss tt"}}}d.jqxDateTimeInput({theme:e.theme,width:g,height:c,formatString:b,showTimeButton:f.type!="date",showCalendarButton:f.type!="time"})}d.on("valueChanged",function(j){e._onChangeHandler(j)})},getComponentByName:function(c){if(!a.isArray(this.template)){return undefined}for(var d=0;d<this.template.length;d++){if(this.template[d].name==c){return this._getComponentById(d)}if(a.isArray(this.template[d].columns)){for(var b=0;b<this.template[d].columns.length;b++){if(this.template[d].columns[b].name==c){return this._getComponentById(d+"_"+b)}}}}return undefined},_getComponentById:function(c){var b=this.host.find("#el_"+this.element.id+c);return b},_getComponentLabelById:function(c){var b=this.host.find("#label_el_"+c);return b},hideComponent:function(b){this._showhideComponent(b,undefined,false)},showComponent:function(b){this._showhideComponent(b,undefined,true)},_showhideComponent:function(e,h,b){if(!a.isArray(this.template)){return}var d="";if(h===undefined){for(var f=0;f<this.template.length;f++){if(this.template[f].name==e){d=f;break}if(this.template[f].bind==e){d=f;break}if(a.isArray(this.template[f].columns)){for(var c=0;c<this.template[f].length;c++){if(this.template[f].columns[c].name==e){d=f+"_"+c;break}if(this.template[f].columns[c].bind==e){d=f+"_"+c;break}}}}}else{d=h}if(d!=""){var g=this.host.find("#rowWrap_el_"+this.element.id+d);if(g&&g.length!=0){if(b){g.show()}else{g.hide()}}}}})})(jqxBaseFramework);
|
|
9
9
|
|