ignite-ui
Version:
Ignite UI for jQuery by Infragistics
1 lines • 220 kB
JavaScript
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{return factory(jQuery)}})(function($){$.ig=$.ig||{};$.ig.Editor=$.ig.Editor||{};$.ig.locale=$.ig.locale||{};$.ig.locale.en=$.ig.locale.en||{};$.ig.locale.en.Editor={spinUpperTitle:"Increment",spinLowerTitle:"Decrement",buttonTitle:"Show list",clearTitle:"Clear value",ariaTextEditorFieldLabel:"Text Editor",ariaNumericEditorFieldLabel:"Numeric Editor",ariaCurrencyEditorFieldLabel:"Currency Editor",ariaPercentEditorFieldLabel:"Percent Editor",ariaMaskEditorFieldLabel:"Mask Editor",ariaDateEditorFieldLabel:"Date Editor",ariaDatePickerFieldLabel:"Date Picker",ariaTimePickerFieldLabel:"Time Picker",ariaSpinUpButton:"Spin up",ariaSpinDownButton:"Spin down",ariaDropDownButton:"Drop down",ariaClearButton:"Clear",ariaCalendarButton:"Calendar",datePickerButtonTitle:"Show calendar",updateModeUnsupportedValue:'updateMode requires a different configuration. Choose a value between "onChange" and "immediate".',updateModeNotSupported:'updateMode property supports only "onchange" mode for igMaskEditor, igDateEditor and igDatePicker extensions',renderErrMsg:"A base editor cannot be instantiated directly. Try with a text, numeric, date, or other editor.",multilineErrMsg:'textArea requires a different configuration. The textMode should be set to "multiline".',targetNotSupported:"This target element is not supported.",placeHolderNotSupported:"The placeholder attribute is not supported by your browser.",allowedValuesMsg:"Pick a value from the drop-down list",maxLengthErrMsg:"Entry is too long and was trimmed to {0} symbols",maxLengthWarningMsg:"Entry reached the maximum length of {0} for this field",minLengthErrMsg:"At least {0} characters should be entered",maxValErrMsg:"Entry reached the maximum value of {0} for this field",minValErrMsg:"Entry reached the minimum value of {0} for this field",maxValExceedRevertErrMsg:"Entry exceeded the maximum value of {0} and was reverted to previous one",minValExceedRevertErrMsg:"Entry was less than the minimum value of {0} and was reverted to previous one",maxValExceedSetErrMsg:"Entry exceeded the maximum value of {0} and was set to the maximum value",minValExceedSetErrMsg:"Entry was less than the minimum value of {0} and was set to the minimum value",maxValExceededWrappedAroundErrMsg:"Entry exceeded the maximum value of {0} and was set to the minimum allowed one",minValExceededWrappedAroundErrMsg:"Entry was less than the minimum value of {0} and was set to the maximum allowed one",btnValueNotSupported:'A different button value is required. Choose a value between "dropdown", "clear" and "spin".',scientificFormatErrMsg:'A different scientificFormat is required. Choose a value between "E", "e", "E+" and "e+".',spinDeltaIsOfTypeNumber:"A different type of spinDelta is required. A positive number should be entered.",spinDeltaIsOfTypeNumberForPeriod:"A different type of spinDelta is required for the {0}. A positive number between {1} and {2} should be entered.",spinDeltaIsOfTypeNumberOrObject:"A different type of spinDelta is required. A positive number or an object, defining different time period deltas, should be entered.",spinDeltaShouldBeInRange:"The spinDelta option for {0} should be between {1} and {2}",spinDeltaCouldntBeNegative:"The spinDelta option cannot be negative. A positive number should be entered.",spinDeltaContainsExceedsMaxDecimals:"Maximum allowed fractions for spinDelta are set to {0}. Either change MaxDecimals or try to shrink your value.",spinDeltaIncorrectFloatingPoint:'A floating point spinDelta requires a different configuration. Set the dataMode of the editor to either "double" or "float" or set spinDelta to integer.',numericEditorNoSuchMethod:"The numeric editor does not support this method.",numericEditorNoSuchOption:"The numeric editor does not support this option.",displayFactorIsOfTypeNumber:"displayFactor requires a different value. Its value should be set to 1 or 100 as a number.",displayFactorAllowedValue:"displayFactor requires a different value. Its value should be set to 1 or 100 as a number.",instantiateCheckBoxErrMsg:"igCheckboxEditor requires a different element. Use INPUT, SPAN or DIV element.",cannotParseNonBoolValue:"igCheckboxEditor requires a different value. A boolean value should be provided.",cannotSetNonBoolValue:"igCheckboxEditor requires a different value. A boolean value should be provided.",maskEditorNoSuchMethod:"The mask editor does not support this method.",datePickerEditorNoSuchMethod:"The date editor does not support this method.",datePickerNoSuchMethodDropDownContainer:"The date editor does not support this method. Use 'getCalendar' one instead.",buttonTypeIsDropDownOnly:"Datepicker allows only dropdown and clear values for the buttonType option.",dateEditorOffsetRange:"The displayTimeOffset option should be between -720 and 840, which represents the offset in minutes, according to the UTC, of all the timezones from the westernmost (−12:00) to the easternmost (+14:00).",setOptionError:"Runtime changes are not allowed for the following option: ",invalidDate:"Invalid date",maskMessage:"All required positions should be filled",maskRevertMessage:"All required positions should be filled, that is why the value was reverted to the last valid one.",dateMessage:"A valid date should be entered",centuryThresholdValidValues:"centuryThreshold property shoud be between 0 and 99.",noListItemsNoButton:"No spin or dropdown button is rendered because there are no listitems.",decimalNumber:"When dataMode is '{0}', the {1} option can accept numeric values between 0 and {2}.",decimalSeparatorErrorMsg:"The decimalSeparator option requires a different value. Its value should be a single character.",decimalSeparatorEqualsGroupSeparatorErrorMsg:"The groupSeparator and the decimalSeparator options can not have equal values.",timePickerNoSuchMethod:"The time picker does not support this method."};$.ig.Editor.locale=$.ig.Editor.locale||$.ig.locale.en.Editor;return $.ig.locale.en.Editor});"use strict";(function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.ui.widget","./infragistics.ui.validator"],factory)}else{return factory(jQuery)}})(function($){$.widget("ui.igBaseEditor",$.ui.igWidget,{localeWidgetName:"Editor",options:{width:null,height:null,value:null,tabIndex:null,allowNullValue:false,nullValue:null,inputName:null,readOnly:false,disabled:false,validatorOptions:null},css:{editor:"ui-igedit-input",container:"ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default",hover:"ui-state-hover",active:"ui-state-active",focus:"ui-state-focus",disabled:"ui-state-disabled"},events:{rendering:"rendering",rendered:"rendered",mousedown:"mousedown",mouseup:"mouseup",mousemove:"mousemove",mouseover:"mouseover",mouseout:"mouseout",blur:"blur",focus:"focus",keydown:"keydown",keypress:"keypress",keyup:"keyup",valueChanging:"valueChanging",valueChanged:"valueChanged"},_createWidget:function(options){this._definedOptions=options;this._superApply(arguments)},_create:function(){this._initialize();this._readAttributes();this._saveDOMContent();this._render();this.localeContainer=this._editorContainer},_initialize:function(){this._timeouts=[]},_readAttributes:function(){this._saveAttributes();this._removeAttributesAndSetThemAsOptions()},_saveAttributes:function(){var i;var element=this.element[0],attr;this._initialAttributes=[];attr=element.attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,attrValue:attr[i].value})}}},_removeAttributesAndSetThemAsOptions:function(){var element=this.element,name=element.attr("name"),value=element.attr("value"),disabled=element.attr("disabled"),readOnly=element.attr("readOnly");if(name){element.removeAttr("name");if(this.options.inputName===null){this.options.inputName=name}}if(value){element.removeAttr("value");if(this.options.value===null){this.options.value=value}}if(disabled){element.removeAttr("disabled");if(this._definedOptions===undefined||this._definedOptions.disabled===undefined){this.options.disabled=true}}if(readOnly){element.removeAttr("readonly");if(this._definedOptions===undefined||this._definedOptions.readOnly===undefined){this.options.readOnly=true}}delete this._definedOptions},_saveDOMContent:function(){if(this.element.children().length>0){this._initialDOMContent=this.element.children().clone(true);this.element.empty()}},_render:function(){throw new Error(this._getLocaleValue("renderErrMsg"))},_applyOptions:function(){if(this.options.tabIndex!==null){this._setTabIndex(this.options.tabIndex)}if(this.options.readOnly){this._setReadOnly(true)}if(this.options.disabled){this._setDisabled(true)}if(this.options.inputName){this.inputName(this.options.inputName)}if(this.options.validatorOptions){this._setupValidator()}},_attachEvents:function(){var self=this;this._editorContainer.on({"mousedown.editor":function(event){self._triggerMouseDown(event)},"mouseup.editor":function(event){self._triggerMouseUp(event)},"mousemove.editor":function(event){self._triggerMouseMove(event)},"mouseover.editor":function(event){self._triggerMouseOver(event)},"mouseout.editor":function(event){self._triggerMouseOut(event)}})},_setupValidator:function(){if(this.element.igValidator){var validatorOptions=$.extend({},{language:this.options.language,locale:this.options.locale},this.options.validatorOptions);this._validator=this.element.igValidator(validatorOptions).data("igValidator");this._validator.owner=this}},_destroyValidator:function(){if(this._validator&&this._validator.owner===this){this._validator.destroy();this._validator=null}},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorInput.attr("aria-labelledby",ariaLabeledBy)}if(this._dropDownButton){this._editorInput.attr("role","combobox")}else{this._editorInput.attr("role","textbox")}},_triggerRendering:function(){var args={element:this.element,owner:this};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={element:this.element,owner:this};this._trigger(this.events.rendered,null,args)},_triggerMouseMove:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mousemove,event,args)},_triggerMouseDown:function(event){this._editorContainer.addClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};return this._trigger(this.events.mousedown,event,args)},_triggerMouseUp:function(event){this._editorContainer.removeClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseup,event,args)},_triggerMouseOver:function(event){this._editorContainer.addClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseover,event,args)},_triggerMouseOut:function(event){this._editorContainer.removeClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseout,event,args)},_triggerFocus:function(event){this._editorContainer.addClass(this.css.focus);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._editorContainer.removeClass(this.css.active);this._clearEditorNotifier();var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"readOnly":this._setReadOnly(value);break;case"disabled":this._setDisabled(value);break;case"width":this._setWidth(value);break;case"height":this._setHeight(value);break;case"validatorOptions":this._setupValidator();break;case"tabIndex":this._setTabIndex(value);break;case"inputName":this._valueInput.attr("name",value);break;default:this.options[option]=prevValue;this._super(option,value);break}},_validateValue:function(val){return val?true:false},_updateValue:function(value){this._valueInput.val(value);this.options.value=value},_clearValue:function(textOnly){var newValue="";if(this.options.allowNullValue){newValue=this.options.nullValue}if(!this._validateValue(newValue)){newValue=""}if(textOnly){this._editorInput.val(newValue)}else{this._updateValue(newValue)}},_detachEvents:function(){if(this._detachButtonsEvents){this._detachButtonsEvents()}if(this._detachListEvents){this._detachListEvents()}if(this._editorContainer){this._editorContainer.off("mousedown.editor mouseup.editor mouseover.editor mouseout.editor")}},_detachButtonsEvents:function(){if(this._dropDownList){this._detachListEvents()}if(this._dropDownButton){this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._detachButtonsEvents(this._spinDownButton)}},_restoreDOMStructure:function(){this._removeDOM();this._removeAttributes();this._setPropsDefaults();this._recoverInitialAttributes();this._recoverInitialDOMContent()},_removeDOM:function(){this._removeList();this._removeClearButton();this._removeSpinButtons();this._removeContainer()},_removeContainer:function(){if(this._valueInput){this._valueInput.remove()}if(this.element.is("input")){this.element.unwrap().unwrap()}else if(this.element.is("div")){this.element.empty()}else if(this.element.is("span")){this.element.empty();this.element.unwrap().unwrap()}},_removeList:function(){if(this._dropDownList){this._deleteList();this._deleteDropDownButton()}},_removeClearButton:function(){if(this._clearButton){this._clearButton.remove();delete this._clearButton}},_removeSpinButtons:function(){if(this._spinUpButton){this._spinUpButton.remove();delete this._spinUpButton}if(this._spinDownButton){this._spinDownButton.remove();delete this._spinDownButton}},_removeAttributes:function(){var element=this.element,attr=element[0].attributes,concatenatedAttr="",i;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){concatenatedAttr+=attr[i].name+" "}}element.removeAttr(concatenatedAttr.trim())},_setPropsDefaults:function(){var element=this.element[0];element.disabled=false;element.readOnly=false;element.checked=false;element.value=null},_recoverInitialAttributes:function(){var i;if(this._initialAttributes){for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].attrValue);if(this._initialAttributes[i].name==="value"&&this.element.is("input")){$(this.element).val(this._initialAttributes[i].attrValue)}}}delete this._initialAttributes}},_recoverInitialDOMContent:function(){if(this._initialDOMContent){this._initialDOMContent.appendTo(this.element);delete this._initialDOMContent}},_clearStyling:function(){if(this._editorContainer){this._editorContainer.removeClass(this.css.container).removeClass(this.css.hover).removeClass(this.css.active)}if(this._editorInput){this._editorInput.removeClass(this.css.editor)}},_deleteInternalProperties:function(){delete this._editorInput;delete this._editorContainer;delete this._valueInput;if(this._timeouts){delete this._timeouts}},_clearTimeouts:function(){var i,timeouts=this._timeouts;if(timeouts&&timeouts instanceof Array){for(i=0;i<timeouts.length;i++){clearTimeout(timeouts[i])}this._timeouts=[]}},_disableEditor:function(applyDisabledClass){if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()},_setEditableMode:function(){this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);this._editorContainer.removeClass(this.css.disabled);this._attachEvents()},_setDisabled:function(activate){if(activate){this._editorInput.prop("disabled",true);this._valueInput.prop("disabled",true);this._disableEditor(true)}else{this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);if(!this.options.readOnly){this._setEditableMode()}}},_setReadOnly:function(activate){if(activate){this._editorInput.prop("readonly",true);this._valueInput.prop("readonly",true);this._disableEditor()}else{this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);if(!this.options.disabled){this._setEditableMode()}this._editorInput.off(".readonly")}},_setWidth:function(width){if(width){this._editorContainer.css("width",this.options.width)}},_setHeight:function(height){if(height){this._editorContainer.css("height",this.options.height)}},_setTabIndex:function(index){this._editorInput.attr("tabIndex",index)},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self.field().focus()},delay))}else{this.field().trigger("focus")}},_setFocus:function(event){if(this._focused){return}this._focused=true;this._enterEditMode();if(event){this._triggerFocus(event)}},_setBlur:function(event){var newValue;if(this._cancelBlurOnInput){this._editorInput.trigger("focus");delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();this._currentInputTextValue=this._editorInput.val();this._processValueChanging(newValue);this._processTextChanged();this._exitEditMode();if(this._dropDownList&&this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}if(this._inComposition===true){delete this._inComposition}}},inputName:function(newValue){if(newValue){this.options.inputName=newValue;this._valueInput.attr("name",newValue)}else{return this.options.inputName}},value:function(newValue){var listIndex;if(newValue!==undefined){this._clearEditorNotifier();if(this.options.maxLength){if(newValue&&newValue.toString().length>this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(newValue)){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(newValue))!==-1){newValue=this.options.listItems[listIndex]}this._updateValue(newValue);this._editorInput.val(this._getDisplayValue())}else{this._clearValue();if(this._focused!==true){this._exitEditMode()}}}else{return this.options.value}this._checkClearButtonState()},field:function(){return this._editorInput},editorContainer:function(){return this._editorContainer},hasFocus:function(){return this._focused},setFocus:function(delay){this._setFocusDelay(delay)},hide:function(){this._editorContainer.hide()},show:function(){this._editorContainer.show()},validator:function(){return this._validator},isValid:function(){this._skipMessages=true;var valid=this._validateValue(this._editMode?this.field().val():this.value());this._skipMessages=false;return valid},validate:function(){if(this.options.validatorOptions){return this.validator().validate()}else{return this._validateValue(this.value())}},destroy:function(){this._destroyValidator();this._detachEvents();this._clearTimeouts();this._clearStyling();this._restoreDOMStructure();this._deleteInternalProperties();delete this.options;this._superApply(arguments);return this}});$.extend($.ui.igBaseEditor,{version:"0.0.1"});$.widget("ui.igTextEditor",$.ui.igBaseEditor,{options:{buttonType:"none",listItems:null,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,visibleItemsCount:5,includeKeys:null,excludeKeys:null,textAlign:"left",placeHolder:null,selectionOnFocus:"selectAll",textMode:"text",spinWrapAround:false,isLimitedToListValues:false,revertIfNotValid:true,preventSubmitOnEnter:false,dropDownOrientation:"auto",maxLength:null,dropDownOnReadOnly:false,toUpper:false,toLower:false,suppressNotifications:false,suppressKeyboard:false},css:{editorInputContainer:"ui-igeditor-input-container ui-corner-all",spinButtonUpImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",spinButtonDownImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",dropDownImage:"ui-icon ui-icon-triangle-1-s ui-igedit-buttonimage",dropDownButton:"ui-igedit-dropdown-button ",clearButtonImage:"ui-igedit-buttonimage ui-icon-circle-close "+"ui-icon ui-igedit-buttondefault",clearButton:"ui-igedit-cleararea ui-state-default",buttonCommon:"ui-igedit-button-common ui-unselectable "+"ui-igedit-button-ltr ui-state-default",dropDownList:"ui-igedit-dropdown ui-widget",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemActive:"ui-state-active ui-igedit-listitemactive",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",placeHolder:"ui-igedit-placeholder",textArea:"ui-igedit-textarea"},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected",textChanged:"textChanged"},_create:function(){$.ui.igBaseEditor.prototype._create.call(this)},_changeLocaleForNotifier:function(){var notifier=this._editorContainer.data("igNotifier"),message;if(notifier&¬ifier.isVisible()){message=this._getMessageForNotifier(this._notifierMessage);notifier.notify(notifier.options.state,message)}},_changeLocaleForValidator:function(){if(this._validator){this._validator.options.locale=this.options.locale;this._validator.options.language=this.options.language}},changeLocale:function(){this._superApply(arguments);this._changeLocaleForNotifier();this._changeLocaleForValidator()},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"value":this.value(value);break;case"placeHolder":this._applyPlaceHolder();break;case"suppressNotifications":if(value){this._clearEditorNotifier()}break;case"listItems":if(prevValue!==null){this._deleteList()}this._createList();this._clearValue();break;case"listWidth":this._setDropDownListWidth();break;case"spinWrapAround":if(value){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._setSpinButtonsState(this.value())}break;case"excludeKeys":if(value===""){this._excludeKeysArray=[]}else{this._excludeKeysArray=value.toString().split("")}break;case"includeKeys":if(value===""){this._includeKeysArray=[]}else{this._includeKeysArray=value.toString().split("")}break;case"textAlign":this._editorInput.css("text-align",value);break;case"dropDownOnReadOnly":case"visibleItemsCount":case"buttonType":case"dropDownAttachedToBody":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},_updateValue:function(value){if(value!==null&&value!==undefined){value=value.toString()}this._super(value);if(this._dropDownList){this._updateDropdownSelection(value)}},_applyOptions:function(){var initialValue;this._editMode=false;this._focused=false;this._super();if(this.options.includeKeys){this._includeKeysArray=this.options.includeKeys.toString().split("")}if(this.options.excludeKeys){this._excludeKeysArray=this.options.excludeKeys.toString().split("")}initialValue=this.options.value;if(this.options.allowNullValue&&initialValue===null){initialValue=this.options.nullValue}if(this.options.maxLength){if(initialValue&&initialValue.toString().length>this.options.maxLength){initialValue=initialValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(initialValue)){this._setInitialValue(initialValue);this._editorInput.val(this._getDisplayValue())}else{this._setInitialValue("");this._editorInput.val(this._getDisplayValue())}this._applyPlaceHolder()},_render:function(){var editorElementWrapper,editorElement,tempTimeStamp;this._triggerRendering();if(this.element.attr("id")!==undefined){this.id=this.element.attr("id")}else{tempTimeStamp=new Date;this.id=tempTimeStamp.getTime()}if(this.element.is("div")||this.element.is("span")){if(this.options.textMode==="multiline"){editorElement=$("<textarea rows='4' cols='50'></textarea>");editorElement.addClass(this.css.textArea)}else if(this.options.textMode==="password"){editorElement=$("<input type='password' autocomplete='off'/>")}else{editorElement=$("<input type='text' />")}if(this.element.is("span")){editorElement=this.element.html(editorElement)}editorElementWrapper=editorElement.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper;if(this.element.is("span")){this._editorInput=editorElement.children(0);this._editorContainer=editorElementWrapper.wrap($("<div></div>")).parent()}else{this._editorInput=editorElement;this._editorContainer=this.element}this._editorContainer.prepend(editorElementWrapper)}else if(this.element.is("input")){this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}else if(this.element.is("textarea")){if(this.options.textMode!=="multiline"){throw new Error(this._getLocaleValue("multilineErrMsg"))}else{this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;this._editorInput.addClass(this.css.textArea);editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}}else{throw new Error(this._getLocaleValue("targetNotSupported"))}this._editorContainer.addClass(this.css.container);this._editorInput.addClass(this.css.editor);this._editorInput.css("height","100%");if((this.element.is("input")||this.element.is("textarea"))&&this._editorInput.attr("id")!==undefined){this._editorInputId=this._editorInput.attr("id")}else{this._editorInput.attr("id",this.id+"EditingInput");this._editorInputId=this.id+"EditingInput"}if(!$.ig.util.isIE8){if(this.options.textMode!=="multiline"){if(this.options.textMode==="password"){this._editorInput.attr("type","password");this._editorInput.attr("autocomplete","off")}else{this._editorInput.attr("type","text")}}}if(this.options.buttonType&&this.options.buttonType!=="none"&&this.options.textMode!=="multiline"&&this.options.textMode!=="password"){this._renderButtons()}if(this.options.width){this._editorContainer.css("width",this.options.width)}if(this.options.height){this._editorContainer.css("height",this.options.height)}if(this.options.textMode==="multiline"){this._valueInput=$("<textarea style='display:none'></textarea>")}else{this._valueInput=$("<input type='hidden'></input>")}this._editorInput.after(this._valueInput);this._editorInput.css("text-align",this.options.textAlign);this._createList();this._attachEvents();this._applyOptions();this._applyAria();this._checkClearButtonState();this._triggerRendered()},_applyAria:function(){this._super();this._applyInputAriaLabel()},_applyInputAriaLabel:function(){var ariaLabelText,localeid;switch(this.widgetName){case"igTextEditor":localeid="ariaTextEditorFieldLabel";break;case"igNumericEditor":localeid="ariaNumericEditorFieldLabel";break;case"igCurrencyEditor":localeid="ariaCurrencyEditorFieldLabel";break;case"igPercentEditor":localeid="ariaPercentEditorFieldLabel";break;case"igMaskEditor":localeid="ariaMaskEditorFieldLabel";break;case"igDateEditor":localeid="ariaDateEditorFieldLabel";break;case"igDatePicker":localeid="ariaDatePickerFieldLabel";break;case"igTimePicker":localeid="ariaTimePickerFieldLabel";break;default:{localeid="ariaTextEditorFieldLabel";break}}ariaLabelText=this._getLocaleValue(localeid);this._editorInput.attr({"aria-label":ariaLabelText,"data-localeid":localeid,"data-localeattr":"aria-label"})},_getMessageForNotifier:function(messageObj){var optName=messageObj.optName,message=this._getLocaleValue(optName),arg=messageObj.arg;return arg!==undefined?$.ig.util.stringFormat(message,arg):message},_sendNotification:function(state,messageObj){var message=this._getMessageForNotifier(messageObj);if(this.options.suppressNotifications||this._skipMessages){this._currentMessage=message;return}if(!this._editorContainer.data("igNotifier")){this._editorContainer.igNotifier()}this._notifierMessage=messageObj;this._editorContainer.igNotifier("notify",state,message)},_applyPlaceHolder:function(){if(this.options.placeHolder&&this.options.placeHolder!==""){this._editorInput.attr("placeholder",this.options.placeHolder);this._editorInput.addClass(this.css.placeHolder);if(this._placeHolderNotSupported()){throw new Error(this._getLocaleValue("placeHolderNotSupported"))}}else if(this._editorInput.attr("placeholder")){this._editorInput.removeAttr("placeholder")}},_placeHolderNotSupported:function(){return document.createElement("input").placeholder===undefined},_setInitialValue:function(value){this._updateValue(value)},_disableEditor:function(applyDisabledClass){if(this.options.dropDownOnReadOnly){if(applyDisabledClass){this._editorInput.addClass(this.css.disabled)}}else{if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()}if(this._dropDownList&&!this.options.dropDownOnReadOnly){if(applyDisabledClass){this._dropDownList.addClass(this.css.disabled)}this._detachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_disableSpinButton:function(target){if(target&&!target.attr("disabled")&&!this.options.spinWrapAround){target.addClass(this.css.disabled);target.attr("disabled","disabled");target.prop("disabled",true);target.removeClass(this.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(this.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete this._spinUpButton._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}this._detachButtonsEvents(target)}},_enableSpinButton:function(target,type){if(target&&target.attr("disabled")){target.removeClass(this.css.disabled);target.removeAttr("disabled");target.prop("disabled",false);this._attachButtonsEvents(type,target)}},_exceedsMaxValue:function(){return this._dropDownList&&!this._getSpinItem("up").length},_lessThanMinValue:function(){return this._dropDownList&&!this._getSpinItem("down").length},_setSpinButtonsState:function(val){if(typeof val==="string"||val instanceof String){val=val.trim()}if(val===null){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp");return}if(val!==""&&!this.options.spinWrapAround){if(this._exceedsMaxValue(val)){this._disableSpinButton(this._spinUpButton);this._enableSpinButton(this._spinDownButton,"spinDown")}else if(this._lessThanMinValue(val)){this._disableSpinButton(this._spinDownButton);this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}}},_replaceCharAt:function(stringValue,index,ch){if(stringValue!==undefined){return stringValue.substring(0,index)+ch+stringValue.substring(index+1)}},_getStringRange:function(stringValue,start,end){if(stringValue!==undefined){return stringValue.substring(start,end)}},_replaceStringRange:function(stringValue,replacementValue,indexStart,indexEnd){var i=0;while(indexStart<=indexEnd){stringValue=this._replaceCharAt(stringValue,indexStart,replacementValue.charAt(i));i++;indexStart++}return stringValue},_valueIndexInList:function(val){if(!val&&val!==0){return-1}var loweredItems=$.map(this.options.listItems,function(item){return item.toString().toLowerCase()});return $.inArray(val.toString().toLowerCase(),loweredItems)},_validateValue:function(val){var result;if(val===undefined){result=false}else if(val===null){if(this.options.allowNullValue){result=val===this.options.nullValue?true:false}else{result=false}}else if(this.options.isLimitedToListValues&&this._dropDownList){if(this._valueIndexInList(val)!==-1){result=true}else{this._sendNotification("warning",{optName:"allowedValuesMsg"});result=false}}else if(this.options.maxLength){if(val.toString().length<=this.options.maxLength){result=true}else{result=false}}else{result=true}return result},_setEditableMode:function(){this._super("_setEditableMode");if(this._dropDownList&&!this.options.dropDownOnReadOnly){this._dropDownList.removeClass(this.css.disabled);this._attachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("dropdown",this._dropDownButton)}if(this._clearButton){this._clearButton.removeClass(this.css.disabled);this._attachButtonsEvents("clear",this._clearButton)}if(this._spinUpButton&&this.options.value!==this.options.maxValue){this._spinUpButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinUp",this._spinUpButton)}if(this._spinDownButton&&this.options.value!==this.options.minValue){this._spinDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinDown",this._spinDownButton)}},_calculateDropDownListOrientation:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerHeight=parseFloat(this._editorContainer.css("height")),dropDownAndEditorHeight=parseInt(containerTop+containerHeight+this._listInitialHeight),windowHeight=$(window).height(),orientation;if(this.options.dropDownOrientation==="auto"){if(dropDownAndEditorHeight<windowHeight+$(window).scrollTop()){orientation="bottom"}else if(containerTop-this._listInitialHeight>0){orientation="top"}else{orientation="bottom"}}else{orientation=this.options.dropDownOrientation}return orientation},_positionDropDownList:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerLeft=containerOffset.left,containerHeight=parseFloat(this._editorContainer.css("height")),orientation=this._calculateDropDownListOrientation();if(this.options.dropDownAttachedToBody){this._dropDownList.css("left",containerLeft);if(orientation==="bottom"){this._dropDownList.css("top",containerTop+containerHeight);this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",containerTop-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}else{this._dropDownList.css("left","");if(orientation==="bottom"){this._dropDownList.css("top","");this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}this._setDropDownListWidth()},_createList:function(){if(Array.isArray(this.options.listItems)){this.options.listItems=this.options.listItems.filter(function(item){return item||item===0})}if(this.options.textMode!=="multiline"&&this.options.textMode!=="password"&&this.options.listItems&&this.options.listItems.length>0){if(this.options.buttonType.toString().indexOf("dropdown")===-1){this._renderDropDownButton()}this._renderList();this._positionDropDownList();this._attachListEvents()}},_renderList:function(){var i,list=this.options.listItems,itemValue,currentItem,itemHeight,dropdown,id=this.id,html,listBorderHeight;html="<div id='"+id+"_list"+"' tabindex='-1' class='"+this.css.dropDownList+"' role='listbox' aria-activedescendant='"+this._editorInputId+"'>";this._editorInput.attr("aria-owns",this.id+"_list");for(i=0;i<list.length;i++){itemValue=list[i]?this._getEditModeValue(list[i]):list[i];currentItem="<span id='"+id+"_item_"+(i+1)+"' tabindex='-1' role='option' aria-selected='false' aria-posinset='"+(i+1).toString()+"' class='"+this.css.listItem+"' title='"+itemValue+"'>"+itemValue+"</span>";html+=currentItem}html+="</div>";dropdown=$(html);if(this.options.dropDownAttachedToBody){$(document.body).append(dropdown)}else{this._editorContainer.append(dropdown)}itemHeight=dropdown.children().eq(0).outerHeight();if(itemHeight===0){itemHeight=23}if(this._calculateDropDownListOrientation()==="bottom"){listBorderHeight=parseInt(dropdown.css("borderBottomWidth"))}else{listBorderHeight=parseInt(dropdown.css("borderTopWidth"))}if(list.length<this.options.visibleItemsCount){dropdown.css("height",parseFloat(itemHeight*list.length+listBorderHeight));this._listInitialHeight=parseFloat(itemHeight*list.length+listBorderHeight)}else{dropdown.css("height",parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight);this._listInitialHeight=parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight}this._dropDownList=dropdown;this._setDropDownListWidth();dropdown.hide();dropdown.visible=false},_setDropDownListWidth:function(){if(this.options.listWidth&&this.options.listWidth>0){this._dropDownList.css("width",this.options.listWidth)}else{this._dropDownList.css("width",this._editorContainer.css("width"))}},_attachListEvents:function(){var self=this;this._dropDownList.on({"mouseenter.editorList":function(event){var item=event.target;$(item).addClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).attr("data-hovered",true)},"mouseleave.editorList":function(event){var item=event.target;$(item).removeClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).removeAttr("data-hovered")},"click.editorList":function(event){self._triggerListItemClick(event.target)},"mousedown.editorList":function(event){event.preventDefault();if(!$.ig.util.isIE8){event.stopPropagation()}}},".ui-igedit-listitem");this._dropDownList.on("mousedown.editorList",function(event){self._listMouseDownHandler(event)})},_listMouseDownHandler:function(event){if($.ig.util.isIE||$.ig.util.isEdge){this._cancelBlurOnInput=true}else{event.preventDefault();event.stopPropagation()}},_deleteList:function(){this._detachListEvents();this._dropDownList.remove();delete this._dropDownList},_deleteDropDownButton:function(){this._detachButtonsEvents(this._dropDownButton);this._dropDownButton.remove();delete this._dropDownButton},_detachListEvents:function(){if(this._dropDownList){this._dropDownList.off("mouseenter.editorList mouseleave.editorList ");this._dropDownList.off("click.editorList mousedown.editorList")}},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");if(this._dropDownButton){return}dropDownButton.addClass(this.css.buttonCommon).attr({role:"button",tabindex:-1,id:this.id+"_dropDownButton",title:this._getLocaleValue("buttonTitle"),"data-localeid":"buttonTitle","data-localeattr":"title"});this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_renderSpinButtons:function(){var spinButtonUp=$("<div></div>"),spinButtonUpImage=$("<div></div>"),spinButtonDown=$("<div></div>"),spinButtonDownImage=$("<div></div>");if(this._spinUpButton){return}spinButtonUp.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinUpperTitle"),role:"button",tabindex:-1,id:this.id+"_spinUpButton","data-localeid":"spinUpperTitle","data-localeattr":"title"}).append(spinButtonUpImage.addClass(this.css.spinButtonUpImage));spinButtonDown.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinLowerTitle"),role:"button",tabindex:-1,id:this.id+"_spinDownButton","data-localeid":"spinLowerTitle","data-localeattr":"title"}).append(spinButtonDownImage.addClass(this.css.spinButtonDownImage));this._editorContainer.prepend(spinButtonDown).prepend(spinButtonUp);this._attachButtonsEvents("spinDown",spinButtonDown);this._attachButtonsEvents("spinUp",spinButtonUp);this._spinUpButton=spinButtonUp;this._spinDownButton=spinButtonDown},_renderClearButton:function(){var clearButton=$("<div></div>"),buttonClearIcon=$("<div></div>");if(this._clearButton){return}clearButton.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("clearTitle"),role:"button",id:this.id+"_clearButton",tabindex:-1,"data-localeid":"clearTitle","data-localeattr":"title"}).append(buttonClearIcon.addClass(this.css.clearButtonImage));this._editorContainer.prepend(clearButton.addClass(this.css.clearButton));this._clearButton=clearButton;this._attachButtonsEvents("clear",clearButton)},_renderButtons:function(){var buttons=this.options.buttonType.toString().split(/[\s,]+/),buttonsCountRendered=0;if($.inArray("clear",buttons)!==-1){this._renderClearButton();buttonsCountRendered++}if($.inArray("spin",buttons)!==-1){if(this._numericType||this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderSpinButtons();buttonsCountRendered+=2}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if($.inArray("dropdown",buttons)!==-1){if(this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderDropDownButton();buttonsCountRendered++}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if(buttonsCountRendered===0){throw new Error(this._getLocaleValue("btnValueNotSupported"))}},_attachButtonsEvents:function(type,target){var self=this;if(!target){return}this._detachButtonsEvents(target);target.on({"mouseenter.button":function(){target.addClass(self.css.buttonHover)},"mouseleave.button":function(){target.removeClass(self.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(self.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"mousedown.button":function(event){if(event.button===0||event.button===1&&$.ig.util.isIE8){target.addClass(self.css.buttonPressed);target._pressed=true;event.preventDefault();if(type==="spinUp"||type==="spinDown"){self._handleSpinEvent(type,target)}}event.stopPropagation()},"mouseup.button":function(){target.removeClass(self.css.buttonPressed);delete target._pressed;if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"click.button":function(event){self._triggerButtonClick(event,type)}})},_detachButtonsEvents:function(target){if(target){target.off("mouseenter.button mouseleave.button mousedown.button mouseup.button click.button")}},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"focus.editor":function(event){self._setFocus(event)},"input.editor":function(){if(!self._editMode){self._processTextChanged();self._processValueChanging(self._editorInput.val())}},"dragenter.editor":function(){if(!self._focused&&!self._editMode){self._dragging=true;self._enterEditMode()}},"dragleave.editor":function(e){if($.ig.util.isFF&&e.relatedTarget===this){return}if(self._dragging&&self._editMode){self._exitEditMode();delete self._dragging}},"blur.editor":function(event){self._setBlur(event)},"paste.editor":function(event){self._currentInputTextValue=self._editorInput.val();self._pasteHandler(event)},"drop.editor":function(event){self._focused=true;delete self._dragging;self._pasteHandler(event,true)},"keydown.editor":function(event){if((event.keyCode===8||event.keyCode===46)&&self._editorInput.val()!==self._currentInputTextValue){self._processTextChanged()}self._triggerKeyDown(event)},"keyup.editor":function(event){self._triggerKeyUp(event);self._processTextChanged()},"keypress.editor":function(event){self._triggerKeyPress(event)},"compositionstart.editor":function(){var widgetName=self.widgetName,cursorPosition=self._getCursorPosition();if(cursorPosition===-1){switch(widgetName){case"igMaskEditor":case"igDateEditor":case"igDatePicker":{self._editorInput.val(self._maskWithPrompts);self._setCursorPosition(0)}break;default:}}self._compositionStartValue=self._editorInput.val();self._compositionStartIndex=self._getCursorPosition();self._inComposition=true},"compositionend.editor":function(){setTimeout(function(){var value,widgetName=self.widgetName,cursorPosition=self._getCursorPosition(),selection={start:cursorPosition,end:cursorPosition};if(self._focused!==true){return}switch(widgetName){case"igMaskEditor":{value=self._replaceStringRange(self._compositionStartValue,self._currentCompositionValue,self._compositionStartIndex,self._compositionStartIndex+self._currentCompositionValue.length-1)}break;default:{value=self._editorInput.val()}}self._insert(value,self._compositionStartValue,selection);delete self._inComposition;delete self._compositionStartIndex;delete self._currentCompositionValue;delete self._compositionStartValue},0)},"compositionupdate.editor":function(evt){if(typeof self._compositionStartIndex==="undefined"){var startIndex=self._getCursorPosition();startIndex-=evt.originalEvent.data?evt.originalEvent.data.length:1;self._compositionStartIndex=startIndex;self._compositionStartValue=self._editorInput.val().substring(0,startIndex)}setTimeout(function(){self._currentCompositionValue=$(evt.target).val().toString().substring(self._compositionStartIndex,self._getCursorPosition())},0)}})},_detachEvents:function(){this._super();if(this._editorInput){this._editorInput.off("focus.editor input.editor blur.editor paste.editor");this._editorInput.off("dragenter.editor dragleave.editor drop.editor");this._editorInput.off("keydown.editor keyup.editor keypress.editor");this._editorInput.off("compositionstart.editor compositionend.editor compositionupdate.editor")}},_processValueChanging:function(value){if(value!==this.value()){if(!(this.value()===null&&value==="")){this._triggerInternalValueChange(value)}}},_triggerInternalValueChange:function(value){var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var listIndex;if(this.options.maxLength){if(value&&value.toString().length>this.options.maxLength){value=value.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(value)){if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(value))!==-1){value=this.options.listItems[listIndex]}this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_triggerKeyDown:function(event){var e=event,noCancel,activeItem,args,currentInputVal,selection;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){if(event.altKey&&this.options.textMode==="multiline"){this._carryOverNewLine(this._editorInput.val())}else{currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0){this._triggerListItemClick(activeItem)}else{this._toggleDropDown();this._processValueChanging(currentInputVal);this._enterEditMode()}}else{this._processValueChanging(currentInputVal);if(this.options.textMode!=="multiline"){this._enterEditMode()}}}}else{if(this._dropDownList){if(e.keyCode===38){if(e.altKey&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0&&!activeItem.is(":first-child")){this._hoverPreviousDropDownListItem()}else{this._toggleDropDown()}e.preventDefault()}}else if(e.keyCode===40||e.keyCode===38&&e.altKey){if(!this._dropDownList.is(":visible")){this._toggleDropDown()}else{this._hoverNextDropDownListItem()}e.preventDefault()}else if(e.keyCode===2