/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var i=function(i){function r(t,r){var f,u;this._owner=r,this._containerID=t+"_NumericPad_OutContainer",f=n.Utility.CreateElement("div"),f.id=this._containerID,u=t+"_NumericPad",this._numericPadID=u,this._onNumbericPadKeyDown=null,i.call(this,f,u,!0)}return __extends(r,i),r.prototype._beginInit=function(){i.prototype._beginInit.call(this),this._autoSize=!0},r.prototype._endInit=function(){i.prototype._endInit.call(this),this.Align=n.RelativePosition.Left,this.SetEnablejQueryTheme(this._owner.GetEnablejQueryTheme())},r.prototype._getDefaultSize=function(){var r=138,i=171,t=this.GetMargins(),u;return this.GetAutoSize()?(u=this._render._outterContainer.parentNode.clientWidth,u===0?n.Utility.IsIE8?(r=155+t.Left+t.Right,i=184+t.Top+t.Bottom):n.Utility.IsIE9?(r=144+t.Left+t.Right,i=161+t.Top+t.Bottom):n.Utility.IsIE10OrLater?(r=132+t.Left+t.Right,i=161+t.Top+t.Bottom):n.Utility.chrome?(r=136+t.Left+t.Right,i=174+t.Top+t.Bottom):n.Utility.IPad&&(r=157+t.Left+t.Right,i=144+t.Top+t.Bottom):(r=u-this._getCSSBorderWidth()*2,i=this._render._outterContainer.parentNode.clientHeight-this._getCSSBorderWidth()*2)):(r=142+t.Left+t.Right,i=175+t.Top+t.Bottom),{Width:r,Height:i}},r.prototype._createUIRender=function(){this._render=new t(this)},r.prototype._createUIProcess=function(){},r.prototype._renderHtmlElement=function(){var n=this._render._createFrame();this._getContainer().appendChild(n),this._initDefaultValue()},r.prototype._initDefaultValue=function(){this.SetMargins(5),this.SetFlatStyle(n.FlatStyle.Standard.toString()),this.SetCursor(n.Cursor.NotSet),this.SetVisible(!0);var t=this._render._outterContainer;this.GetRealControlEffect()===n.ControlEffect.Chrome?t.style.border="rgb(169,169,169) 1px solid":this.GetRealControlEffect()===n.ControlEffect.Ipad&&(t.style.border="rgb(76,76,76) 1px solid",t.style.borderRadius="5px"),this.SetAutoSize(!0)},r.prototype._getRealCSSWidth=function(){if(this.GetAutoSize())return this._getDefaultSize().Width+this._getCSSBorderWidth()*2;else{var n=this._render._outterContainer;return parseInt(n.style.width)+this._getCSSBorderWidth()*2}},r.prototype._getRealCSSHeight=function(){return this.GetAutoSize()?this._getDefaultSize().Height+this._getCSSBorderWidth()*2:this._getCSSHeight()+this._getCSSBorderWidth()*2},r.prototype._refreshBSBtn=function(){var t=this._render._btns[2],r,i,o,f,u,c,h,l,s,e;this._render._image?(r=n.Utility.GetElementPosition(this._render._outterContainer),i=n.Utility.GetElementPosition(t),n.Utility.IsIE8OrBelow&&(o=t.currentStyle),this.GetAutoSize()?(f=i.Left-r.Left+parseInt(o.borderLeftWidth)+parseInt(t.clientWidth.toString())/2-parseInt(this._render._image.width.toString())/2+"px",u=i.Top-r.Top+parseInt(o.borderTopWidth)+parseInt(t.clientHeight.toString())/2-parseInt(this._render._image.height.toString())/2+"px"):(f=i.Left-r.Left+parseInt(t.style.width)/2-parseInt(this._render._image.width.toString())/2+"px",u=i.Top-r.Top+parseInt(t.style.height)/2-parseInt(this._render._image.height.toString())/2+"px"),parseInt(f)","\uf0d5","1","2","3","4","5","6","7","8","9","0",".","+/-"],this._btnIDs=["<",">","BS","1","2","3","4","5","6","7","8","9","0",".","+/-"],this._control=n;var t=n._getId();this._flatEditBtnStyleBorderName=t+"_flat_editbtn_border",this._flatNumBtnStyleBorderName=t+"_flat_numbtn_border",this._hideContentByWidth=!1,this._hideContentByHeight=!1}return t.prototype._createFrame=function(){for(var t=document.createElement("table"),u,e,i,s,h,o,r,f=0;f<5;f++)for(u=document.createElement("tr"),u.style.textDecoration="inherit",u.style.margin="0px",t.appendChild(u),e=0;e<3;e++)i=document.createElement("td"),u.appendChild(i),s=this._createNode(this._btnTexts[f*3+e]),s.id=this._control._numericPadID+"_Btn_"+this._btnIDs[f*3+e],this._btns.push(s),i.appendChild(s),i.style.textDecoration="inherit",i.style.width="33.3%",i.style.margin="0px",i.style.padding="0px";return h=t.childNodes[0].childNodes[2],o=h.childNodes[0],n.Utility.IPad&&(o.value="\u232b"),n.Utility.IsIE8&&(o.style.color="transparent",o.value=" ",r=n.Utility.CreateElement("img"),r.src=n.Utility.BaseImageUrl+"BS_IE8_Normal.png",r.style.position="absolute",h.appendChild(r),r.style.zIndex="10000",this._image=r),t.cellPadding="0px",t.cellSpacing="4px",t.style.padding="0px",t.style.margin="0px",this._outterContainer=t,t},t.prototype._createNode=function(n){var i,t;return this._btnTemplate?(i=this._btnTemplate.cloneNode(!0),i.value=n,i):(t=this._btnTemplate,t=document.createElement("input"),t.type="button",t.value=n,t.style.display="block",t.style.cursor="inherit",t.style.font="inherit",t.style.textDecoration="inherit",t.style.margin="0px",t.style.overflow="hidden",t)},t.prototype._setButtonBackColor=function(n,t){n<0||n>14||(this._btns[n].style.backgroundColor=t)},t.prototype._getButtonBackColor=function(n){if(n>=0&&n<=14)return this._btns[n].style.backgroundColor},t.prototype._setBackColor=function(n){this._control.GetEnablejQueryTheme()?this._outterContainer.style.background=n:this._outterContainer.style.backgroundColor=n},t.prototype._setFlatStyle=function(n){if(this._control._getEnablejQueryTheme()){var t=this._control.GetBackColor();t!=""&&this._setBackColor(t)}this._updateFlatStyle(n)},t.prototype._updateButtonTextDecoration=function(n){for(var t=0;tu*2)if(i>u*2+o)if(i>u*2+o+s)if(i>u*2+o+s+h*6+10){this._hideContentByHeight=!1,this._hideOrDisplayNode("");var c=i-o-s-h*6,l=Math.floor(c/5),a=c-l*4,f;for(e=0;e<15;e++)f=e>11?a:l,r=this._btns[e],f-=this._getButtonMaxBorderWidth()*2,f>5?f>10?(r.style.paddingTop="5px",r.style.paddingBottom="5px",r.style.height=f+this._getButtonMaxBorderWidth()*2+"px"):(r.style.paddingTop="5px",r.style.height="0px",r.style.paddingBottom=f-5+"px"):(r.style.paddingTop=f+"px",r.style.height="0px",r.style.paddingBottom="0px")}else this._hideContentByHeight=!0,this._hideOrDisplayNode("none");else this._hideContentByHeight=!0,t.style.paddingBottom=i-u*2-o+"px",this._hideOrDisplayNode("none");else this._hideContentByHeight=!0,t.style.paddingTop=i-u*2+"px",t.style.paddingBottom="0px",this._hideOrDisplayNode("none");else this._hideContentByHeight=!0,t.style.borderTop=i/2+"px",t.style.borderBottom=i/2+"px",t.style.paddingTop="0px",t.style.paddingBottom="0px",this._hideOrDisplayNode("none")}},t.prototype._adjustWidth=function(){var e,r;if(!this._control.GetAutoSize()){var t=this._outterContainer,i=parseInt(this._control._oldWidth||this._control.GetWidth()),u=parseInt(t.style.borderWidth);u=isNaN(u)?1:u;var o=parseInt(t.style.paddingLeft),s=parseInt(t.style.paddingRight),h=4;t.style.width=i+"px",n.Utility.IPad&&(t.style.maxWidth=i+u*2+"px",t.style.overflow="hidden");if(i>u*2)if(i>u*2+o)if(i>u*2+o+s)if(i>u*2+o+s+h*4+6){this._hideContentByWidth=!1,this._hideOrDisplayNode("");var c=i-o-s-h*4,l=Math.floor(c/3),a=c-l*2,f;for(e=0;e<15;e++)f=(e+1)%3==0?a:l,r=this._btns[e],f-=this._getButtonMaxBorderWidth()*2,f>10?f>20?(r.style.paddingLeft="10px",r.style.paddingRight="10px",r.style.width=f+this._getButtonMaxBorderWidth()*2+"px"):(r.style.paddingLeft="10px",r.style.width="0px",r.style.paddingRight=f-10+"px"):(r.style.paddingLeft=f+"px",r.style.width="0px",r.style.paddingRight="0px")}else this._hideContentByWidth=!0,this._hideOrDisplayNode("none");else this._hideContentByWidth=!0,t.style.paddingBottom=i-u*2-o+"px",this._hideOrDisplayNode("none");else this._hideContentByWidth=!0,t.style.paddingLeft=i-u*2+"px",t.style.paddingRight="0px",this._hideOrDisplayNode("none");else this._hideContentByWidth=!0,t.style.borderLeft=i/2+"px",t.style.borderRight=i/2+"px",t.style.paddingLeft="0px",t.style.paddingRight="0px",this._hideOrDisplayNode("none")}},t.prototype._adjustWhenAutoSize=function(){var f=parseInt(this._control.GetBorderWidth()),u,r;f=isNaN(f)?1:f;var i=this._control.GetMargins(),o=isNaN(i.Left)?5:i.Left,s=isNaN(i.Right)?5:i.Right,e=isNaN(i.Top)?5:i.Top,h=isNaN(i.Bottom)?5:i.Bottom,t=this._outterContainer;for(t.style.borderWidth=f+"px",t.style.paddingLeft=o+"px",t.style.paddingRight=s+"px",t.style.paddingTop=e+"px",t.style.paddingBottom=h+"px",t.style.width="",t.style.height="",n.Utility.IsPad()&&(t.style.maxWidth=""),u=0;u<15;u++)r=this._btns[u],r.style.width="100%",r.style.height="",r.style.padding="5px 10px"},t.prototype._hideOrDisplayNode=function(n){if(n=="")if(this._hideContentByWidth||this._hideContentByHeight)return;for(var t=0;t