/* * * 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 u=function(i){function r(n,t,u){i.call(this,n,t,u!==!0),r._validators[this._getId()]=this,this._altShiftCheck=!1,this._ignoreNextMouseDownIme=!1}return __extends(r,i),r.CheckDisposeableValidators=function(){var t,n;for(t in r._validators){n=r._validators[t];if(n&&n._controlToValidate&&!document.body.contains(n._controlToValidate))try{n._doDispose()}catch(i){}}},r.prototype._dispose=function(){i.prototype._dispose.call(this);try{r._validators[this._getId()]=null,delete r._validators[this._getId()]}catch(n){}},r.prototype._initContainerAndID=function(n,t,u){i.prototype._initContainerAndID.call(this,n,t,u),this._isFromAsp=!u,this._isFromAsp===!0?this._spanElement=n:this._createSpanElement(),this._spanElement.style.display!=="none"&&(this._spanElement.style.display=r.DefaultDisplay)},r.prototype._beginInit=function(){i.prototype._beginInit.call(this),this._initEvent(),this._validationFailedSuspender=new n.SuspendCounter,this._controlToValidate=null,this._display=t.Static,this._setFocusOnError=!1,this._text="",this._toolTip="",this._validateOnInput=!1,this._isValid=!0,this._flatStyle=n.FlatStyle.Standard,this._callBackList=new n.BaseKeyCollection(null),this._restoreValue="",this._keyPressedOnInput=!1,this._isCachedResult=!1},r.prototype._endInit=function(){i.prototype._endInit.call(this),this._isFromAsp||this._updateShowText()},r.prototype._getComponentType=function(){return n.IMControlType.Validator},r.prototype._getDefaultSize=function(){return n.Utility.MeasureText(this._getShowText(),this._spanElement)},r.prototype._initEvent=function(){var t=this;this._onChange=function(n){if(t._imeInputting)return;t.GetValidateOnInput()||t._validate(n),t.GetSetFocusOnError()&&!t.GetIsValid()&&setTimeout(function(){return t._controlToValidate.focus()},100)},this._onKeyDown=function(i){n.Utility.IsIE8&&t._onIE8KeyDown(i);if(t._imeInputting)return;(i.keyCode===n.Key.V&&i.ctrlKey||i.keyCode===n.Key.Insert&&i.shiftKey)&&t.GetValidateOnInput()&&(t._shouldValidateOnInput=!0)},this._onKeyPress=function(n){if(t._imeInputting)return;t.GetValidateOnInput()&&(t._isFromAsp?ValidatorValidate(t._spanElement,null,n):t._validate(n),t._keyPressedOnInput=!0)},this._onKeyUp=function(i){var e,f,r,o,u;if(n.Utility.IsIE8){e=t._onIE8KeyUp(i);if(e==!1)return}if(t._imeInputting)return;t.GetValidateOnInput()&&(f=i.keyCode,r=!t._keyPressedOnInput&&(f===n.Key.Delete||f===n.Key.BackSpace),r=t._shouldValidateOnInput||r,t._shouldValidateOnInput=!1,t._isFromAsp?(ValidatorValidate(t._spanElement,null,i,r),setTimeout(function(){!t.IsValidatorOnInputForSpread(i)},0)):t._validate(i,r),t._keyPressedOnInput=!1,t.GetValidateOnInput()&&(t._restoreValue=t._controlToValidate.value,n.Utility.IsIMControl(t._controlToValidate)&&(o=n.Utility.GetIMControlId(t._controlToValidate),u=n.Utility.FindIMControl(o),n.BaseControl&&u instanceof n.BaseControl&&(t._restoreValue=u.GetText()))))},this._onIE8Click=function(n){t._imeInputting&&(t._imeInputting=!1),t.GetValidateOnInput()&&(t._isFromAsp?ValidatorValidate(t._spanElement,null,n):t._validate(n))},this._onIE8KeyDown=function(n){var i=n.keyCode,r;i=="229"?(t._ignoreNextMouseDownIme||(t._imeInputting=!0,t._altShiftCheck=!1),t._ignoreNextMouseDownIme=!1):t._imeInputting&&(r=n.altKey||n.ctrlKey||n.shiftKey||i==20||i>=112&&i<=123,r?(n.altKey&&i==25&&(t._imeInputting=!1),n.altKey&&n.shiftKey&&(t._altShiftCheck=!0),n.altKey&&n.shiftKey&&(i!=16&&i!=18||n.ctrlKey)&&(t._altShiftCheck=!1)):t._imeInputting=!1)},this._onIE8KeyUp=function(n){var i,r,u;return n.keyCode===244&&(t._imeInputting=!1,t._ignoreNextMouseDownIme=!0),i=!1,t._imeInputting?n.keyCode==13||n.ctrlKey&&n.keyCode==90||t._altShiftCheck?(i=!0,t._imeInputting=!1):n.keyCode==32&&(r=t._getValueToValidate().ValidatedValue,u=r.Substring(r.GetLength()-1,r.GetLength()),(u=="\u3000"||u==" ")&&(i=!0,t._imeInputting=!1)):i=!0,i},this._onFocus=function(i){if(t._imeInputting)return;t._restoreValue=t._controlToValidate.value;if(n.Utility.IsIMControl(t._controlToValidate)){var f=n.Utility.GetIMControlId(t._controlToValidate),u=n.Utility.FindIMControl(f);n.BaseControl&&u instanceof n.BaseControl&&(t._restoreValue=u.GetText())}t.GetValidateOnInput()&&(t._isFromAsp?t._focusFromErrorOnFocus||r.IsSpreadValidator(t._spanElement)||(ValidatorValidate(t._spanElement,null,i),!t.GetIsValid()&&t.GetSetFocusOnError()&&(t._focusFromErrorOnFocus=1)):t._validate(i))},this._onBlur=function(i){if(t._focusFromErrorOnFocus>0){t._focusFromErrorOnFocus=t._focusFromErrorOnFocus===1?2:0;return}n.Utility.IsIE8&&t._imeInputting&&(t._imeInputting=!1);if(t._imeInputting)return;t.GetValidateOnInput()&&(t._isFromAsp?r.IsSpreadValidator(t._spanElement)||(ValidatorValidate(t._spanElement,null,i),t._focusFromErrorOnFocus=0,!t.GetIsValid()&&t.GetSetFocusOnError()&&(t._focusFromErrorOnFocus=1)):t._validate(i))},this._onDropDownClose=function(n){t._isFromAsp?ValidatorValidate(t._spanElement,null,n):t._validate(n)},this._onCompositionStart=function(n){t._imeInputting=!0},this._onCompositionEnd=function(n){t._imeInputting=!1}},r.prototype._initWithServerData=function(t){var r,u;i.prototype._initWithServerData.call(this,t),r="undefined",t.EnablejQueryTheme!==r&&this.SetEnablejQueryTheme(t.EnablejQueryTheme),typeof t.BackColor!==r&&this.SetBackColor(t.BackColor),typeof t.BorderColor!==r&&this.SetBorderColor(t.BorderColor),typeof t.BackgroundImage!==r&&this.SetBorderStyle(t.BorderStyle),typeof t.BorderWidth!==r&&this.SetBorderWidth(t.BorderWidth),typeof this._spanElement.controltovalidate!==r&&this.SetControlToValidate(this._spanElement.controltovalidate),typeof this._spanElement.display!==r&&(this._display=this._spanElement.display),typeof t.Enabled!==r&&this.SetEnabled(t.Enabled),typeof this._spanElement.errormessage!==r&&(this._errorMessage=this._spanElement.errormessage),typeof t.Font!==r&&(typeof t.Font.FontFamily!==r&&this.SetFontFamily(t.Font.FontFamily),typeof t.Font.FontSize!==r&&this.SetFontSize(t.Font.FontSize),typeof t.Font.FontWeight!==r&&this.SetFontWeight(t.Font.FontWeight),typeof t.Font.FontStyle!==r&&this.SetFontStyle(t.Font.FontStyle),typeof t.Font.TextDecoration!==r&&(u=n.Utility.Trim(t.Font.TextDecoration).split(" "),this.SetTextDecoration(u.join(",")))),typeof t.ForeColor!==r&&this.SetForeColor(t.ForeColor),typeof t.Height!==r&&this.SetHeight(t.Height),typeof this._spanElement.focusOnError!==r&&(this._setFocusOnError=this._spanElement.focusOnError),typeof t.Text!==r&&this.SetText(t.Text),typeof t.ToolTip!==r&&this.SetToolTip(t.ToolTip),typeof t.ValidateOnInput!==r&&this.SetValidateOnInput(t.ValidateOnInput),typeof t.Visible!==r&&this.SetVisible(t.Visible),typeof t.Width!==r&&this.SetWidth(t.Width),typeof t.ClientEvents!==r&&typeof t.ClientEvents.ValidationFailed!==r&&this.OnValidationFailed(t.ClientEvents.ValidationFailed)},r.prototype._createSpanElement=function(){this._spanElement=n.Utility.CreateElement("span"),this._spanElement.setAttribute(n.Utility.IMControlIDAttribute,this._getId()),this._spanElement.style.display="",this._spanElement.style.visibility="hidden",this._getContainer().appendChild(this._spanElement)},r.prototype._updateShowText=function(){var t=this._getShowText();n.Utility.SetElementTextContent(this._spanElement,t)},r.prototype._getShowText=function(){return this.GetText()===""?this.GetErrorMessage():this.GetText()},r.prototype._onBackColorChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.backgroundColor=t},r.prototype._onForeColorChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.color=t},r.prototype._onBorderColorChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.borderColor=t},r.prototype._onBorderStyleChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.borderStyle=t},r.prototype._onBorderWidthChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.borderWidth=t},r.prototype._onFontFamilyChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.fontFamily=t},r.prototype._onFontSizeChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.fontSize=t},r.prototype._onFontStyleChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.fontStyle=t},r.prototype._onFontWeightChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.fontWeight=t},r.prototype._onTextDecorationChanged=function(n,t,i){if(!this._isInited)return;this._spanElement.style.textDecoration=t},r.prototype._onHeightChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.height=t},r.prototype._onWidthChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.width=t},r.prototype.GetEnablejQueryTheme=function(){return this._flatStyle==n.InternalFlatStyle.JQueryUI},r.prototype.SetEnablejQueryTheme=function(t){t?this._setFlatStyle(n.InternalFlatStyle.JQueryUI):this._setFlatStyle(n.FlatStyle.Standard)},r.prototype._getFlatStyle=function(){return this._flatStyle},r.prototype._setFlatStyle=function(t){if(t===this._flatStyle)return;t!==n.InternalFlatStyle.JQueryUI?this._flatStyle=n.Utility.CheckEnum(n.FlatStyle,t):t==n.InternalFlatStyle.JQueryUI&&(this._flatStyle=n.InternalFlatStyle.JQueryUI),this._flatStyle===n.InternalFlatStyle.JQueryUI?n.Utility.AddClass(this._spanElement,"ui-state-error"):n.Utility.RemoveClass(this._spanElement,"ui-state-error")},r.prototype._onEnabledChanged=function(n,t){if(!this._isInited)return;this._isFromAsp&&(this._spanElement.enabled=t)},r.prototype._onVisibleChanged=function(n,t){if(!this._isInited)return;this._spanElement.style.display=t?"":"none"},r.prototype.GetControlToValidate=function(){return this._userControlToValidate},r.prototype._getControlToValidate=function(){return this._controlToValidate},r.prototype.GetIMInputControl=function(t){if(t){typeof t=="string"&&(t=n.Utility.FindIMControl(t));if(t&&n.BaseControl&&t instanceof n.BaseControl)return t}return null},r.prototype.SetControlToValidate=function(t){var f=t,u,e,r,i;t=n.Utility.GetNakedDomElement(t);if(t===this._controlToValidate)return;u=this.GetIMInputControl(this._userControlToValidate),this._userControlToValidate=f,e=this.GetIMInputControl(f);if(this._isFromAsp){if(typeof Page_Validators=="undefined")return;r=!1;if(t.Validators)for(i=0;io*this.GetDifference()?new n.ValidateResult(!1,e):new n.ValidateResult(!0,e)},i.prototype._bindControlToCompareEventHandlers=function(){this._isFromAsp||n.Utility.AttachEvent(this._controlToCompare,"change",this._onChangeOnControlToCompare)},i.prototype._removeControlToCompareEventHandlers=function(){this._isFromAsp||n.Utility.DetachEvent(this._controlToCompare,"change",this._onChangeOnControlToCompare)},i}(n.BaseIMValidatorControl);n.GcDateDifferenceValidator=t})(GCIM||(GCIM={}));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 t=function(t){function i(n,i){t.call(this,n,i,arguments[2])}return __extends(i,t),i.prototype._beginInit=function(){t.prototype._beginInit.call(this),this._errorMessage="GcDateRangeValidator",this._maximumDate=new Date(9999,11,31,23,59,59),this._minimumDate=new Date(100,0,1,0,0,0)},i.prototype._initWithServerData=function(n){t.prototype._initWithServerData.call(this,n);var i="undefined";typeof n.MaximumDate!==i&&this.SetMaximumDate(n.MaximumDate),typeof n.MinimumDate!==i&&this.SetMinimumDate(n.MinimumDate)},i.prototype.GetMaximumDate=function(){return new Date(this._maximumDate.valueOf())},i.prototype.SetMaximumDate=function(t){typeof t=="string"&&(t=new Date(t));if(t===this._maximumDate)return;this._maximumDate=n.Utility.CheckDate(t)},i.prototype.GetMinimumDate=function(){return new Date(this._minimumDate.valueOf())},i.prototype.SetMinimumDate=function(t){typeof t=="string"&&(t=new Date(t));if(t===this._minimumDate)return;this._minimumDate=n.Utility.CheckDate(t)},i.prototype._evaluateIsValid=function(t){var e=this._getValueToValidate(t),r=e.ValidatedValue,o=e.ValidatedControl,i,u,f;if(r==="")return new n.ValidateResult(!0,r);return i=new Date(r),n.Utility.IsIMControl(o)&&(u=n.Utility.FindIMControl(n.Utility.GetIMControlId(o)),typeof n.GcDateTime!="undefined"&&u instanceof n.GcDateTime&&(i=u.GetValue())),i===null||isNaN(i.valueOf())?new n.ValidateResult(!1,r):(f=i>=this.GetMinimumDate()&&i<=this.GetMaximumDate(),new n.ValidateResult(f,r))},i}(n.BaseIMValidatorControl);n.GcDateRangeValidator=t})(GCIM||(GCIM={}));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 t=function(t){function i(n,i){t.call(this,n,i,arguments[2])}return __extends(i,t),i.prototype._beginInit=function(){t.prototype._beginInit.call(this),this._errorMessage="GcForbiddenTextValidator",this._forbiddenList=[]},i.prototype._initWithServerData=function(n){t.prototype._initWithServerData.call(this,n);var i="undefined";typeof n.ForbiddenList!==i&&this.SetForbiddenList(n.ForbiddenList)},i.prototype.GetForbiddenList=function(){return this._forbiddenList.slice(0)},i.prototype.SetForbiddenList=function(t){(t===null||typeof t=="undefined")&&(t=[]),t instanceof Array||(t=Array.prototype.slice.call(arguments));if(typeof t.sort=="function"&&t.sort().toString()===this._forbiddenList.sort().toString())return;this._forbiddenList=[];for(var i=0;i=this.GetMinimumLength()&&r<=this.GetMaximumLength(),new n.ValidateResult(e,i)},i}(n.BaseIMValidatorControl);n.GcTextLengthValidator=t})(GCIM||(GCIM={}));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(){function n(){this.regexTrim=/^\s+|\s+$/g,this.toUpperArray=function(n){for(var r=[],t=0,i=n.length;ti},n.prototype.toUpper=function(n){return n.split("\u00a0").join(" ").toUpperCase()},n.prototype.arrayIndexOf=function(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i=r)return i}return 0},n.prototype.getEraYear=function(n,t,i,r){var u=n.getFullYear();return!r&&t.eras&&(u-=t.eras[i].offset),u},n.prototype.expandYear=function(n,t){if(t<100){var r=new Date,f=this.getEra(r),u=this.getEraYear(r,n,f),i=n.twoDigitYearMax;i=typeof i=="string"?(new Date).getFullYear()%100+parseInt(i,10):i,t+=u-u%100,t>i&&(t-=100)}return t},n.prototype.getDayIndex=function(n,t,i){var u,f=n.days,r=n._upperDays;return r||(n._upperDays=r=[this.toUpperArray(f.names),this.toUpperArray(f.namesAbbr),this.toUpperArray(f.namesShort)]),t=this.toUpper(t),i?(u=this.arrayIndexOf(r[1],t),u===-1&&(u=this.arrayIndexOf(r[2],t))):u=this.arrayIndexOf(r[0],t),u},n.prototype.startsWith=function(n,t){return n.indexOf(t)===0},n.prototype.parseExact=function(n,t,i){var a,ct,f,d,k,y,v,at,u,et,p,nt;n=this.trim(n);var r=i.calendar,ot=this.getParseRegExp(r,t),st=new RegExp(ot.regExp).exec(n);if(st===null)return null;var ht=ot.groups,rt=null,c=null,s=null,h=null,b=null,o=0,l,ut=0,it=0,tt=0,g=null,ft=!1;for(a=0,ct=ht.length;a