@syncfusion/ej2-inplace-editor
Advanced tools
Comparing version 16.4.48 to 16.4.52
@@ -1,2 +0,11 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-richtexteditor")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-inputs","@syncfusion/ej2-popups","@syncfusion/ej2-dropdowns","@syncfusion/ej2-richtexteditor"],t):t(e.ej={},e.ej2Base,e.ej2Data,e.ej2Buttons,e.ej2Calendars,e.ej2Inputs,e.ej2Popups,e.ej2Dropdowns,e.ej2Richtexteditor)}(this,function(e,t,i,o,n,s,r,a,l){"use strict";function p(e,i){if(t.isNullOrUndefined(i)||""===i)return"";var o;switch(e){case"Color":var n=i;o=n.length>7?n.slice(0,-2):n;break;case"Date":o=h.formatDate(i,{skeleton:"yMd"});break;case"DateRange":var s=i;o=h.formatDate(s[0],{skeleton:"yMd"})+" - "+h.formatDate(s[1],{skeleton:"yMd"});break;case"DateTime":o=h.formatDate(i,{skeleton:"yMd"})+" "+h.formatDate(i,{skeleton:"hm"});break;case"Time":o=h.formatDate(i,{skeleton:"hm"});break;default:o=i.toString()}return o}function d(e,i){if(t.isNullOrUndefined(i)||""===i)return i;if("Date"!==e&&"Time"!==e&&"DateTime"!==e||"string"!=typeof i){if("DateRange"===e)if("object"==typeof i&&"string"==typeof i[0])i=[new Date(i[0]),new Date(i[1])];else if("string"==typeof i){var o=i.split("-");i=[new Date(o[0]),new Date(o[1])]}}else i=new Date(i);return i}var h=new t.Internationalization,c="render",u="update",m="destroy",y="set-focus",f="access-value",v="destroy-modules",b=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),E=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return b(i,e),E([t.Property("")],i.prototype,"title",void 0),E([t.Property(null)],i.prototype,"model",void 0),i}(t.ChildProperty),C={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},g={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"}},w="e-inplaceeditor",j="e-inplaceeditor-tip",k="e-editable-value-wrapper",D="e-editable-value",P="e-editable-overlay-icon",H="e-editable-tip-title",M="e-editable-title",B="e-editable-inline",T="e-editable-popup",R="e-editable-wrapper",N="e-editable-loading",V="e-editable-form",S="e-component-group",A="e-editable-component",x="e-editable-action-buttons",L="e-editable-error",I="e-editable-elements",W="e-editable-open",U="e-btn-save",_="e-btn-cancel",K="e-disable",q="e-show",F="e-hide",z="e-rtl",Q="e-error",G=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Y=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$=function(e){function l(t,i){var o=e.call(this,t,i)||this;return o.initRender=!0,o.isTemplate=!1,o.isExtModule=!1,o.submitBtn=void 0,o.cancelBtn=void 0,o.isClearTarget=!1,o.btnElements=void 0,o.dataManager=void 0,o.divComponents=["RTE","Slider"],o.clearComponents=["AutoComplete","Mask","Text"],o.dateType=["Date","DateTime","Time"],o.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],o.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],o.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"],o.needsID=!0,o}return G(l,e),l.prototype.preRender=function(){t.isNullOrUndefined(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:M})},l.prototype.render=function(){this.element.setAttribute("tabindex","0"),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value))),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode),this.setClass("add",this.cssClass)},l.prototype.setClass=function(e,i){this.isEmpty(i)||("add"===e?t.addClass([this.element],[i]):t.removeClass([this.element],[i]))},l.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:k}),this.element.innerHTML="",this.valueEle=this.createElement("span",{className:D}),this.editIcon=this.createElement("span",{className:P+" e-icons",attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},l.prototype.renderValue=function(e){this.valueEle.innerHTML=e,"Color"===this.type&&t.setStyleAttribute(this.valueEle,{color:e}),"Inline"===this.mode&&t.removeClass([this.valueWrap],[F])},l.prototype.renderEditor=function(){var e=void 0,i=t.select("."+k,this.element);if(!this.valueWrap.classList.contains(W)){if("Inline"===this.mode)this.loaderWidth=this.valueWrap.offsetWidth,t.addClass([this.valueWrap],[F]),this.inlineWrapper=this.createElement("div",{className:B}),this.element.appendChild(this.inlineWrapper),this.renderControl(this.inlineWrapper),this.afterOpenHandler(null);else{var o=this.createElement("div",{className:T});this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,o.appendChild(this.titleEle)),e={content:o,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:j,afterOpen:this.afterOpenHandler.bind(this)},o.appendChild(this.renderControl(document.body)),t.extend(e,this.popupSettings.model,e,!0),this.tipObj=new r.Tooltip(e),this.tipObj.appendTo(i),this.tipObj.open(i)}"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),this.initRender=!1,t.addClass([this.valueWrap],[W]),this.setProperties({enableEditMode:!0},!0)}},l.prototype.setAttribute=function(e,t){var i=this.name&&0!==this.name.length?this.name:this.element.id;t.forEach(function(t){e.setAttribute(t,"id"===t?i+"_editor":i)})},l.prototype.renderControl=function(e){var t;this.containerEle=this.createElement("div",{className:R}),this.loader=this.createElement("div",{className:N}),this.formEle=this.createElement("form",{className:V});var i=this.createElement("div",{className:S}),o=this.createElement("div",{className:A});return e.appendChild(this.containerEle),this.containerEle.appendChild(this.loader),this.loadSpinner(),this.containerEle.appendChild(this.formEle),this.formEle.appendChild(i),this.isTemplate?this.appendTemplate(o,this.template):(Array.prototype.indexOf.call(this.divComponents,this.type)>-1?(t=this.createElement("div"),this.setAttribute(t,["id"])):(t=this.createElement("input"),this.setAttribute(t,["id","name"])),this.componentRoot=t,o.appendChild(t)),i.appendChild(o),i.appendChild(this.createElement("div",{className:L})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},l.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},l.prototype.renderButtons=function(){var e=this.createElement("div",{className:x}),i=t.isNullOrUndefined(this.saveButton.content)||0===this.saveButton.content.length?"":" e-primary";return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:e,title:{save:"Save"},model:this.saveButton,className:U+i}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:e,model:this.cancelButton,className:_}),e},l.prototype.createButtons=function(e){var t=void 0;if(Object.keys(e.model).length>0){var i=this.createElement("button",{className:e.className,attrs:{type:e.type,title:this.getLocale(e.title,e.constant)}});e.container.appendChild(i),t=new o.Button(e.model,i)}return t},l.prototype.renderComponent=function(e){if(this.isExtModule=Array.prototype.indexOf.call(this.moduleList,this.type)>-1,t.extend(this.model,this.model,{cssClass:I}),t.isNullOrUndefined(this.value)||this.updateModelValue(),this.isExtModule)this.notify(c,{module:C[this.type],target:e,type:this.type});else switch(this.model.showClearButton=!0,this.type){case"Date":this.componentObj=new n.DatePicker(this.model,e);break;case"DateTime":this.componentObj=new n.DateTimePicker(this.model,e);break;case"DropDownList":this.componentObj=new a.DropDownList(this.model,e);break;case"Mask":this.componentObj=new s.MaskedTextBox(this.model,e);break;case"Numeric":this.model.value&&(this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"")),this.componentObj=new s.NumericTextBox(this.model,e);break;case"Text":this.componentObj=new s.TextBox(this.model,e)}},l.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new i.UrlAdaptor;break;case"ODataV4Adaptor":this.dataAdaptor=new i.ODataV4Adaptor}},l.prototype.loadSpinner=function(){t.addClass([this.loader],[q]),t.setStyleAttribute(this.loader,{width:this.loaderWidth+"px"}),this.spinObj={target:this.loader},r.createSpinner(this.spinObj),r.showSpinner(this.spinObj.target),this.formEle&&t.addClass([this.formEle],[F])},l.prototype.removeSpinner=function(){this.loader.removeAttribute("style"),r.hideSpinner(this.spinObj.target),t.detach(this.spinObj.target.firstChild),this.formEle&&t.removeClass([this.formEle],[F]),t.removeClass([this.loader],[q])},l.prototype.getLocale=function(e,i){return new t.L10n("inplace-editor",e,this.locale).getConstant(i)},l.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},l.prototype.updateValue=function(){t.isNullOrUndefined(this.value)||this.setProperties({value:d(this.type,this.value)},!0)},l.prototype.updateModelValue=function(){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=this.value:this.model.value=this.value.slice()},l.prototype.setValue=function(){this.isExtModule?this.notify(u,{type:this.type}):this.componentObj&&this.setProperties({value:this.componentObj.value},!0)},l.prototype.getDropDownsValue=function(){var e;return Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1&&"MultiSelect"!==this.type?e=t.select(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:"MultiSelect"===this.type&&(this.notify(f,{type:this.type}),e=this.printValue),e},l.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():Array.prototype.indexOf.call(this.dateType,this.type)>-1?this.value.toISOString():"DateRange"===this.type?this.value[0].toISOString()+" - "+this.value[1].toISOString():this.value.toString()},l.prototype.getRenderValue=function(){return"Mask"===this.type&&0!==this.componentObj.value.length?this.componentObj.getMaskedValue():Array.prototype.indexOf.call(this.inputDataEle,this.type)>-1?this.componentRoot.value:Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():p(this.type,this.value)},l.prototype.setRtl=function(e){e?t.addClass([this.element],[z]):t.removeClass([this.element],[z])},l.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify(y,{}):this.componentObj.element.focus())},l.prototype.removeEditor=function(){this.tipObj&&this.formEle&&t.closest(this.formEle,"."+j).classList.add(F),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,t.isNullOrUndefined(t.select("."+B,this.element))?this.tipObj&&("MultiSelect"===this.type&&(t.EventHandler.remove(this.containerEle,"mousedown",this.popMouseDown),t.EventHandler.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):(t.detach(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,t.removeClass([this.valueWrap],[W,F]),this.setProperties({enableEditMode:!1},!0)},l.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify(v,{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),t.isNullOrUndefined(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},l.prototype.destroyButtons=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.remove(this.submitBtn.element,"mousedown",this.submitHandler),t.EventHandler.remove(this.submitBtn.element,"click",this.submitPrevent),t.EventHandler.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.remove(this.cancelBtn.element,"mousedown",this.cancelHandler),t.EventHandler.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},l.prototype.getQuery=function(e){var t=new i.Query;return Object.keys(e).forEach(function(i){t.addParams(i,e[i])}),t},l.prototype.sendValue=function(){var e={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};if(this.trigger("actionBegin",e),this.isEmpty(this.url)||this.isEmpty(this.primaryKey)){var t={data:{},value:e.data.value};this.triggerSuccess(t)}else this.dataManager=new i.DataManager({url:this.url,adaptor:this.dataAdaptor}),this.dataManager.executeQuery(this.getQuery(e.data),this.successHandler.bind(this),this.failureHandler.bind(this));this.dataManager=void 0},l.prototype.isEmpty=function(e){return!(!t.isNullOrUndefined(e)&&0!==e.length)},l.prototype.checkIsTemplate=function(){this.isTemplate=!t.isNullOrUndefined(this.template)&&""!==this.template},l.prototype.templateCompile=function(e,i){var o;"string"==typeof i&&(i=i.trim());var n=t.compile(i);t.isNullOrUndefined(n)||(o=n({},this,"template")),!t.isNullOrUndefined(n)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},l.prototype.appendTemplate=function(e,i){"string"==typeof i||t.isNullOrUndefined(i.innerHTML)?("."===i[0]||"#"===i[0])&&document.querySelectorAll(i).length?(this.templateEle=document.querySelector(i),e.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(e,i):(this.templateEle=i,e.appendChild(this.templateEle))},l.prototype.disable=function(e){e?t.addClass([this.element],[K]):t.removeClass([this.element],[K])},l.prototype.enableEditor=function(e){e?this.renderEditor():this.cancelHandler()},l.prototype.checkValidation=function(){var e,i=this;this.validationRules?(this.formValidate=new s.FormValidator(this.formEle,{rules:this.validationRules,validationComplete:function(t){e={errorMessage:t.message,data:{name:i.name,primaryKey:i.primaryKey,value:i.checkValue(i.getSendValue())}},i.trigger("validating",e),"failure"===t.status?(t.errorElement.innerText=e.errorMessage,i.toggleErrorClass(!0)):i.toggleErrorClass(!1)},customPlacement:function(e,o){t.select("."+L,i.formEle).appendChild(o)}}),this.formValidate.validate()):(e={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",e),e.errorMessage&&"Empty"===e.data.value?(t.select("."+L,this.formEle).innerHTML=e.errorMessage,this.toggleErrorClass(!0)):this.toggleErrorClass(!1))},l.prototype.toggleErrorClass=function(e){if(!t.isNullOrUndefined(this.formEle)){var i=t.select(".e-input-group",this.formEle);!function(e,i,o){[].slice.call(e).forEach(function(e){e&&("add"===o?t.addClass([e],[i]):t.removeClass([e],[i]))})}([this.formEle,i],Q,e?"add":"remove")}},l.prototype.hideForm=function(e){t.isNullOrUndefined(this.formEle)||(e?t.addClass([this.formEle],[F]):t.removeClass([this.formEle],[F]))},l.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},l.prototype.triggerSuccess=function(e){var t=e.value;this.trigger("actionSuccess",e),this.removeSpinner(),this.hideForm(!1),this.renderValue(this.checkValue(e.value!==t?e.value:this.getRenderValue())),this.removeEditor()},l.prototype.wireEvents=function(){this.wireEditEvent(this.editableOn),t.EventHandler.add(this.editIcon,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.valueKeyDownHandler,this),t.EventHandler.add(document,"scroll",this.scrollResizeHandler,this),window.addEventListener("resize",this.scrollResizeHandler.bind(this)),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this)},l.prototype.wireDocEvent=function(){t.EventHandler.add(document,"mousedown",this.docClickHandler,this)},l.prototype.wireEditEvent=function(e){if("EditIconClick"!==e){var i="Click"===e?"editAreaClick":"editAreaDoubleClick";this.element.setAttribute("title",this.getLocale(g[e],i)),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?this.touchModule=new t.Touch(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):t.EventHandler.add(this.valueWrap,e.toLowerCase(),this.clickHandler,this)}},l.prototype.wireEditorKeyDownEvent=function(e){t.EventHandler.add(e,"keydown",this.enterKeyDownHandler,this)},l.prototype.wireBtnEvents=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.add(this.submitBtn.element,"mousedown",this.submitHandler,this),t.EventHandler.add(this.submitBtn.element,"click",this.submitPrevent,this),t.EventHandler.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.add(this.cancelBtn.element,"mousedown",this.cancelHandler,this),t.EventHandler.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},l.prototype.unWireEvents=function(){this.unWireEditEvent(this.editableOn),t.EventHandler.remove(this.editIcon,"click",this.clickHandler),t.EventHandler.remove(document,"scroll",this.scrollResizeHandler),window.removeEventListener("resize",this.scrollResizeHandler.bind(this)),t.EventHandler.remove(this.element,"keydown",this.valueKeyDownHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler)},l.prototype.unWireDocEvent=function(){t.EventHandler.remove(document,"mousedown",this.docClickHandler)},l.prototype.unWireEditEvent=function(e){"EditIconClick"!==e&&(this.element.removeAttribute("title"),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?(this.touchModule.destroy(),this.touchModule=void 0):t.EventHandler.remove(this.valueWrap,e.toLowerCase(),this.clickHandler))},l.prototype.unWireEditorKeyDownEvent=function(e){t.EventHandler.remove(e,"keydown",this.enterKeyDownHandler)},l.prototype.submitPrevent=function(e){e.preventDefault()},l.prototype.btnKeyDownHandler=function(e){var t=e.target;(13===e.keyCode&&13===e.which||32===e.keyCode&&32===e.which)&&(t.classList.contains(U)?this.save():t.classList.contains(_)&&this.cancelHandler())},l.prototype.afterOpenHandler=function(e){"Popup"===this.mode&&"MultiSelect"===this.type&&(t.EventHandler.add(this.containerEle,"mousedown",this.popMouseDown,this),t.EventHandler.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||e.element.classList.add(H),"RTE"===this.type?this.rteModule.refresh():"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute(t.select(".e-slider-input",this.containerEle),["name"])),this.setFocus()},l.prototype.popMouseDown=function(e){var t=e.target.classList;t.contains("e-chips-close")&&!t.contains("e-close-hooker")&&this.updateArrow()},l.prototype.doubleTapHandler=function(e){e.tapCount>1&&this.clickHandler(e.originalEvent)},l.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},l.prototype.submitHandler=function(e){e.preventDefault(),this.save()},l.prototype.cancelHandler=function(){this.removeEditor()},l.prototype.popClickHandler=function(e){var i=t.select("."+k,this.element);e.target.classList.contains("e-chips-close")&&this.tipObj.refresh(i)},l.prototype.successHandler=function(e){var t={data:e,value:this.getSendValue()};this.triggerSuccess(t)},l.prototype.failureHandler=function(e){var t={data:e,value:this.getSendValue()};this.trigger("actionFailure",t),this.removeSpinner(),this.hideForm(!1),"Popup"===this.mode&&this.updateArrow()},l.prototype.enterKeyDownHandler=function(e){13===e.keyCode&&13===e.which&&t.closest(e.target,"."+A)?this.save():27===e.keyCode&&27===e.which&&this.cancelHandler()},l.prototype.valueKeyDownHandler=function(e){13!==e.keyCode||13!==e.which||!e.target.classList.contains(w)||this.valueWrap.classList.contains(W)||this.element.classList.contains(K)||(e.preventDefault(),this.renderEditor())},l.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},l.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&this.removeEditor()},l.prototype.docClickHandler=function(e){var i=e.target;if(this.isClearTarget)this.isClearTarget=!1;else{var o=t.closest(i,"."+w),n=t.closest(i,"."+j),s=t.closest(i,"."+I),r=t.closest(i,".e-rte-elements");!t.isNullOrUndefined(o)&&o.isEqualNode(this.element)||!t.isNullOrUndefined(n)&&this.tipObj&&n.id.indexOf(this.valueWrap.id)>-1||!t.isNullOrUndefined(s)||!t.isNullOrUndefined(r)||i.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler())}},l.prototype.validate=function(){this.checkValidation()},l.prototype.save=function(){this.formEle&&(this.element.focus(),this.editEle=t.select("."+A,this.formEle),t.select("."+Q,this.editEle)&&t.isNullOrUndefined(this.validationRules)||(this.isTemplate||this.setValue(),this.checkValidation(),this.formEle.classList.contains(Q)||(this.loadSpinner(),this.hideForm(!0),"Popup"===this.mode&&this.updateArrow(),this.sendValue())))},l.prototype.destroy=function(){var i=this;this.removeEditor(),this.isExtModule&&this.notify(m,{}),this.unWireEvents();for([K,z].forEach(function(e){t.removeClass([i.element],[e])});this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.prototype.destroy.call(this)},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.requiredModules=function(){var e=[];return e.push({member:C[this.type],args:[this]}),e},l.prototype.getModuleName=function(){return"inplaceeditor"},l.prototype.onPropertyChanged=function(e,t){this.removeEditor();for(var i=0,o=Object.keys(e);i<o.length;i++){switch(o[i]){case"showButtons":e.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value)));break;case"emptyText":this.renderValue(this.checkValue(p(this.type,this.value)));break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(e.disabled);break;case"enableRtl":this.setRtl(e.enableRtl);break;case"cssClass":this.setClass("remove",t.cssClass),this.setClass("add",e.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(e.enableEditMode);break;case"editableOn":this.unWireEditEvent(t.editableOn),"EditIconClick"!==e.editableOn&&this.wireEditEvent(e.editableOn)}}},Y([t.Property("")],l.prototype,"name",void 0),Y([t.Property(null)],l.prototype,"value",void 0),Y([t.Property("")],l.prototype,"template",void 0),Y([t.Property("")],l.prototype,"cssClass",void 0),Y([t.Property("")],l.prototype,"primaryKey",void 0),Y([t.Property("Empty")],l.prototype,"emptyText",void 0),Y([t.Property("")],l.prototype,"url",void 0),Y([t.Property("Popup")],l.prototype,"mode",void 0),Y([t.Property("UrlAdaptor")],l.prototype,"adaptor",void 0),Y([t.Property("Text")],l.prototype,"type",void 0),Y([t.Property("Click")],l.prototype,"editableOn",void 0),Y([t.Property("Submit")],l.prototype,"actionOnBlur",void 0),Y([t.Property(!1)],l.prototype,"enableRtl",void 0),Y([t.Property(!1)],l.prototype,"enablePersistence",void 0),Y([t.Property(!1)],l.prototype,"disabled",void 0),Y([t.Property(!0)],l.prototype,"showButtons",void 0),Y([t.Property(!1)],l.prototype,"enableEditMode",void 0),Y([t.Property(!0)],l.prototype,"submitOnEnter",void 0),Y([t.Complex({},O)],l.prototype,"popupSettings",void 0),Y([t.Property(null)],l.prototype,"model",void 0),Y([t.Property({iconCss:"e-icons e-save-icon"})],l.prototype,"saveButton",void 0),Y([t.Property({iconCss:"e-icons e-cancel-icon"})],l.prototype,"cancelButton",void 0),Y([t.Property(null)],l.prototype,"validationRules",void 0),Y([t.Event()],l.prototype,"created",void 0),Y([t.Event()],l.prototype,"actionBegin",void 0),Y([t.Event()],l.prototype,"actionSuccess",void 0),Y([t.Event()],l.prototype,"actionFailure",void 0),Y([t.Event()],l.prototype,"validating",void 0),Y([t.Event()],l.prototype,"destroyed",void 0),l=Y([t.NotifyPropertyChanges],l)}(t.Component),J=function(){function e(e,t){this.parent=e,this.module=t,this.addEventListener()}return e.prototype.render=function(e){this.module.render(e)},e.prototype.focus=function(){this.module.focus()},e.prototype.update=function(e){this.module.updateValue(e)},e.prototype.getValue=function(){this.module.getRenderValue()},e.prototype.destroyComponent=function(){t.isNullOrUndefined(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},e.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on(c,this.render,this),this.parent.on(y,this.focus,this),this.parent.on(u,this.update,this),this.parent.on(f,this.getValue,this),this.parent.on(v,this.destroyComponent,this),this.parent.on(m,this.destroy,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(c,this.render),this.parent.off(y,this.focus),this.parent.off(u,this.update),this.parent.off(f,this.getValue),this.parent.off(v,this.destroyComponent),this.parent.off(m,this.destroy))},e}(),X=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.atcModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.AutoComplete(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"AutoComplete"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"auto-complete"},e}(),Z=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.colorModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.ColorPicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Color"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"color-picker"},e}(),ee=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.comboBoxModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.ComboBox(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"combo-box"},e}(),te=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.dateRangeModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.DateRangePicker(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"date-range-picker"},e}(),ie=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.multiSelectModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.MultiSelect(this.parent.model,e.target)},e.prototype.focus=function(){t.closest(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(new MouseEvent("mousedown"))},e.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"multi-select"},e}();l.RichTextEditor.Inject(l.HtmlEditor,l.MarkdownEditor,l.Toolbar,l.Link,l.Image,l.QuickToolbar,l.Table);var oe=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.rteModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new l.RichTextEditor(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"rte"},e}(),ne=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.sliderModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.Slider(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Slider"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"slider"},e}(),se=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.timeModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.TimePicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.focusIn()},e.prototype.updateValue=function(e){this.compObj&&"Time"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"time-picker"},e}();e.parseValue=p,e.getCompValue=d,e.render=c,e.update=u,e.destroy=m,e.setFocus=y,e.accessValue=f,e.destroyModules=v,e.PopupSettings=O,e.modulesList=C,e.localeConstant=g,e.ROOT=w,e.ROOT_TIP=j,e.VALUE_WRAPPER=k,e.VALUE=D,e.OVERLAY_ICON=P,e.TIP_TITLE=H,e.TITLE=M,e.INLINE=B,e.POPUP=T,e.WRAPPER=R,e.LOADING=N,e.FORM=V,e.CTRL_GROUP=S,e.INPUT=A,e.BUTTONS=x,e.EDITABLE_ERROR=L,e.ELEMENTS=I,e.OPEN=W,e.BTN_SAVE=U,e.BTN_CANCEL=_,e.DISABLE=K,e.ICONS="e-icons",e.PRIMARY="e-primary",e.SHOW=q,e.HIDE=F,e.RTL=z,e.ERROR=Q,e.InPlaceEditor=$,e.Base=J,e.AutoComplete=X,e.ColorPicker=Z,e.ComboBox=ee,e.DateRangePicker=te,e.MultiSelect=ie,e.Rte=oe,e.Slider=ne,e.TimePicker=se,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
/*! | ||
* filename: ej2-inplace-editor.umd.min.js | ||
* version : 16.4.52 | ||
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-richtexteditor")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-inputs","@syncfusion/ej2-popups","@syncfusion/ej2-dropdowns","@syncfusion/ej2-richtexteditor"],t):t(e.ej={},e.ej2Base,e.ej2Data,e.ej2Buttons,e.ej2Calendars,e.ej2Inputs,e.ej2Popups,e.ej2Dropdowns,e.ej2Richtexteditor)}(this,function(e,t,i,o,n,s,r,a,l){"use strict";function p(e,i){if(t.isNullOrUndefined(i)||""===i)return"";var o;switch(e){case"Color":var n=i;o=n.length>7?n.slice(0,-2):n;break;case"Date":o=h.formatDate(i,{skeleton:"yMd"});break;case"DateRange":var s=i;o=h.formatDate(s[0],{skeleton:"yMd"})+" - "+h.formatDate(s[1],{skeleton:"yMd"});break;case"DateTime":o=h.formatDate(i,{skeleton:"yMd"})+" "+h.formatDate(i,{skeleton:"hm"});break;case"Time":o=h.formatDate(i,{skeleton:"hm"});break;default:o=i.toString()}return o}function d(e,i){if(t.isNullOrUndefined(i)||""===i)return i;if("Date"!==e&&"Time"!==e&&"DateTime"!==e||"string"!=typeof i){if("DateRange"===e)if("object"==typeof i&&"string"==typeof i[0])i=[new Date(i[0]),new Date(i[1])];else if("string"==typeof i){var o=i.split("-");i=[new Date(o[0]),new Date(o[1])]}}else i=new Date(i);return i}var h=new t.Internationalization,c="render",u="update",m="destroy",y="set-focus",f="access-value",v="destroy-modules",b=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),E=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return b(i,e),E([t.Property("")],i.prototype,"title",void 0),E([t.Property(null)],i.prototype,"model",void 0),i}(t.ChildProperty),C={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},g={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"}},w="e-inplaceeditor",j="e-inplaceeditor-tip",k="e-editable-value-wrapper",D="e-editable-value",P="e-editable-overlay-icon",H="e-editable-tip-title",M="e-editable-title",B="e-editable-inline",T="e-editable-popup",R="e-editable-wrapper",N="e-editable-loading",V="e-editable-form",S="e-component-group",A="e-editable-component",x="e-editable-action-buttons",L="e-editable-error",I="e-editable-elements",W="e-editable-open",U="e-btn-save",_="e-btn-cancel",K="e-disable",q="e-show",F="e-hide",z="e-rtl",Q="e-error",G=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Y=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$=function(e){function l(t,i){var o=e.call(this,t,i)||this;return o.initRender=!0,o.isTemplate=!1,o.isExtModule=!1,o.submitBtn=void 0,o.cancelBtn=void 0,o.isClearTarget=!1,o.btnElements=void 0,o.dataManager=void 0,o.divComponents=["RTE","Slider"],o.clearComponents=["AutoComplete","Mask","Text"],o.dateType=["Date","DateTime","Time"],o.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],o.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],o.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"],o.needsID=!0,o}return G(l,e),l.prototype.preRender=function(){t.isNullOrUndefined(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:M})},l.prototype.render=function(){this.element.setAttribute("tabindex","0"),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value))),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode),this.setClass("add",this.cssClass)},l.prototype.setClass=function(e,i){this.isEmpty(i)||("add"===e?t.addClass([this.element],[i]):t.removeClass([this.element],[i]))},l.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:k}),this.element.innerHTML="",this.valueEle=this.createElement("span",{className:D}),this.editIcon=this.createElement("span",{className:P+" e-icons",attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},l.prototype.renderValue=function(e){this.valueEle.innerHTML=e,"Color"===this.type&&t.setStyleAttribute(this.valueEle,{color:e}),"Inline"===this.mode&&t.removeClass([this.valueWrap],[F])},l.prototype.renderEditor=function(){var e=void 0,i=t.select("."+k,this.element);if(!this.valueWrap.classList.contains(W)){if("Inline"===this.mode)this.loaderWidth=this.valueWrap.offsetWidth,t.addClass([this.valueWrap],[F]),this.inlineWrapper=this.createElement("div",{className:B}),this.element.appendChild(this.inlineWrapper),this.renderControl(this.inlineWrapper),this.afterOpenHandler(null);else{var o=this.createElement("div",{className:T});this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,o.appendChild(this.titleEle)),e={content:o,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:j,afterOpen:this.afterOpenHandler.bind(this)},o.appendChild(this.renderControl(document.body)),t.extend(e,this.popupSettings.model,e,!0),this.tipObj=new r.Tooltip(e),this.tipObj.appendTo(i),this.tipObj.open(i)}"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),this.initRender=!1,t.addClass([this.valueWrap],[W]),this.setProperties({enableEditMode:!0},!0)}},l.prototype.setAttribute=function(e,t){var i=this.name&&0!==this.name.length?this.name:this.element.id;t.forEach(function(t){e.setAttribute(t,"id"===t?i+"_editor":i)})},l.prototype.renderControl=function(e){var t;this.containerEle=this.createElement("div",{className:R}),this.loader=this.createElement("div",{className:N}),this.formEle=this.createElement("form",{className:V});var i=this.createElement("div",{className:S}),o=this.createElement("div",{className:A});return e.appendChild(this.containerEle),this.containerEle.appendChild(this.loader),this.loadSpinner(),this.containerEle.appendChild(this.formEle),this.formEle.appendChild(i),this.isTemplate?this.appendTemplate(o,this.template):(Array.prototype.indexOf.call(this.divComponents,this.type)>-1?(t=this.createElement("div"),this.setAttribute(t,["id"])):(t=this.createElement("input"),this.setAttribute(t,["id","name"])),this.componentRoot=t,o.appendChild(t)),i.appendChild(o),i.appendChild(this.createElement("div",{className:L})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},l.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},l.prototype.renderButtons=function(){var e=this.createElement("div",{className:x}),i=t.isNullOrUndefined(this.saveButton.content)||0===this.saveButton.content.length?"":" e-primary";return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:e,title:{save:"Save"},model:this.saveButton,className:U+i}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:e,model:this.cancelButton,className:_}),e},l.prototype.createButtons=function(e){var t=void 0;if(Object.keys(e.model).length>0){var i=this.createElement("button",{className:e.className,attrs:{type:e.type,title:this.getLocale(e.title,e.constant)}});e.container.appendChild(i),t=new o.Button(e.model,i)}return t},l.prototype.renderComponent=function(e){if(this.isExtModule=Array.prototype.indexOf.call(this.moduleList,this.type)>-1,t.extend(this.model,this.model,{cssClass:I}),t.isNullOrUndefined(this.value)||this.updateModelValue(),this.isExtModule)this.notify(c,{module:C[this.type],target:e,type:this.type});else switch(this.model.showClearButton=!0,this.type){case"Date":this.componentObj=new n.DatePicker(this.model,e);break;case"DateTime":this.componentObj=new n.DateTimePicker(this.model,e);break;case"DropDownList":this.componentObj=new a.DropDownList(this.model,e);break;case"Mask":this.componentObj=new s.MaskedTextBox(this.model,e);break;case"Numeric":this.model.value&&(this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"")),this.componentObj=new s.NumericTextBox(this.model,e);break;case"Text":this.componentObj=new s.TextBox(this.model,e)}},l.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new i.UrlAdaptor;break;case"WebApiAdaptor":this.dataAdaptor=new i.WebApiAdaptor;break;case"ODataV4Adaptor":this.dataAdaptor=new i.ODataV4Adaptor}},l.prototype.loadSpinner=function(){t.addClass([this.loader],[q]),t.setStyleAttribute(this.loader,{width:this.loaderWidth+"px"}),this.spinObj={target:this.loader},r.createSpinner(this.spinObj),r.showSpinner(this.spinObj.target),this.formEle&&t.addClass([this.formEle],[F])},l.prototype.removeSpinner=function(){this.loader.removeAttribute("style"),r.hideSpinner(this.spinObj.target),t.detach(this.spinObj.target.firstChild),this.formEle&&t.removeClass([this.formEle],[F]),t.removeClass([this.loader],[q])},l.prototype.getLocale=function(e,i){return new t.L10n("inplace-editor",e,this.locale).getConstant(i)},l.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},l.prototype.updateValue=function(){t.isNullOrUndefined(this.value)||this.setProperties({value:d(this.type,this.value)},!0)},l.prototype.updateModelValue=function(){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=this.value:this.model.value=this.value.slice()},l.prototype.setValue=function(){this.isExtModule?this.notify(u,{type:this.type}):this.componentObj&&this.setProperties({value:this.componentObj.value},!0)},l.prototype.getDropDownsValue=function(){var e;return Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1&&"MultiSelect"!==this.type?e=t.select(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:"MultiSelect"===this.type&&(this.notify(f,{type:this.type}),e=this.printValue),e},l.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():Array.prototype.indexOf.call(this.dateType,this.type)>-1?this.value.toISOString():"DateRange"===this.type?this.value[0].toISOString()+" - "+this.value[1].toISOString():this.value.toString()},l.prototype.getRenderValue=function(){return"Mask"===this.type&&0!==this.componentObj.value.length?this.componentObj.getMaskedValue():Array.prototype.indexOf.call(this.inputDataEle,this.type)>-1?this.componentRoot.value:Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():p(this.type,this.value)},l.prototype.setRtl=function(e){e?t.addClass([this.element],[z]):t.removeClass([this.element],[z])},l.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify(y,{}):this.componentObj.element.focus())},l.prototype.removeEditor=function(){this.tipObj&&this.formEle&&t.closest(this.formEle,"."+j).classList.add(F),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,t.isNullOrUndefined(t.select("."+B,this.element))?this.tipObj&&("MultiSelect"===this.type&&(t.EventHandler.remove(this.containerEle,"mousedown",this.popMouseDown),t.EventHandler.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):(t.detach(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,t.removeClass([this.valueWrap],[W,F]),this.setProperties({enableEditMode:!1},!0)},l.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify(v,{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),t.isNullOrUndefined(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},l.prototype.destroyButtons=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.remove(this.submitBtn.element,"mousedown",this.submitHandler),t.EventHandler.remove(this.submitBtn.element,"click",this.submitPrevent),t.EventHandler.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.remove(this.cancelBtn.element,"mousedown",this.cancelHandler),t.EventHandler.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},l.prototype.getQuery=function(e){var t=new i.Query;return Object.keys(e).forEach(function(i){t.addParams(i,e[i])}),t},l.prototype.sendValue=function(){var e=this,t={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};if(this.trigger("actionBegin",t),this.isEmpty(this.url)||this.isEmpty(this.primaryKey)){var o={data:{},value:t.data.value};this.triggerSuccess(o)}else if(this.dataManager=new i.DataManager({url:this.url,adaptor:this.dataAdaptor}),"UrlAdaptor"===this.adaptor)this.dataManager.executeQuery(this.getQuery(t.data),this.successHandler.bind(this),this.failureHandler.bind(this));else{this.dataManager.insert(t.data).then(function(t){return e.successHandler(t)}).catch(function(t){return e.failureHandler(t)})}this.dataManager=void 0},l.prototype.isEmpty=function(e){return!(!t.isNullOrUndefined(e)&&0!==e.length)},l.prototype.checkIsTemplate=function(){this.isTemplate=!t.isNullOrUndefined(this.template)&&""!==this.template},l.prototype.templateCompile=function(e,i){var o;"string"==typeof i&&(i=i.trim());var n=t.compile(i);t.isNullOrUndefined(n)||(o=n({},this,"template")),!t.isNullOrUndefined(n)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},l.prototype.appendTemplate=function(e,i){"string"==typeof i||t.isNullOrUndefined(i.innerHTML)?("."===i[0]||"#"===i[0])&&document.querySelectorAll(i).length?(this.templateEle=document.querySelector(i),e.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(e,i):(this.templateEle=i,e.appendChild(this.templateEle))},l.prototype.disable=function(e){e?t.addClass([this.element],[K]):t.removeClass([this.element],[K])},l.prototype.enableEditor=function(e){e?this.renderEditor():this.cancelHandler()},l.prototype.checkValidation=function(){var e,i=this;this.validationRules?(this.formValidate=new s.FormValidator(this.formEle,{rules:this.validationRules,validationComplete:function(t){e={errorMessage:t.message,data:{name:i.name,primaryKey:i.primaryKey,value:i.checkValue(i.getSendValue())}},i.trigger("validating",e),"failure"===t.status?(t.errorElement.innerText=e.errorMessage,i.toggleErrorClass(!0)):i.toggleErrorClass(!1)},customPlacement:function(e,o){t.select("."+L,i.formEle).appendChild(o)}}),this.formValidate.validate()):(e={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",e),e.errorMessage&&"Empty"===e.data.value?(t.select("."+L,this.formEle).innerHTML=e.errorMessage,this.toggleErrorClass(!0)):this.toggleErrorClass(!1))},l.prototype.toggleErrorClass=function(e){if(!t.isNullOrUndefined(this.formEle)){var i=t.select(".e-input-group",this.formEle);!function(e,i,o){[].slice.call(e).forEach(function(e){e&&("add"===o?t.addClass([e],[i]):t.removeClass([e],[i]))})}([this.formEle,i],Q,e?"add":"remove")}},l.prototype.hideForm=function(e){t.isNullOrUndefined(this.formEle)||(e?t.addClass([this.formEle],[F]):t.removeClass([this.formEle],[F]))},l.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},l.prototype.triggerSuccess=function(e){var t=e.value;this.trigger("actionSuccess",e),this.removeSpinner(),this.hideForm(!1),this.renderValue(this.checkValue(e.value!==t?e.value:this.getRenderValue())),this.removeEditor()},l.prototype.wireEvents=function(){this.wireEditEvent(this.editableOn),t.EventHandler.add(this.editIcon,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.valueKeyDownHandler,this),t.EventHandler.add(document,"scroll",this.scrollResizeHandler,this),window.addEventListener("resize",this.scrollResizeHandler.bind(this)),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this)},l.prototype.wireDocEvent=function(){t.EventHandler.add(document,"mousedown",this.docClickHandler,this)},l.prototype.wireEditEvent=function(e){if("EditIconClick"!==e){var i="Click"===e?"editAreaClick":"editAreaDoubleClick";this.element.setAttribute("title",this.getLocale(g[e],i)),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?this.touchModule=new t.Touch(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):t.EventHandler.add(this.valueWrap,e.toLowerCase(),this.clickHandler,this)}},l.prototype.wireEditorKeyDownEvent=function(e){t.EventHandler.add(e,"keydown",this.enterKeyDownHandler,this)},l.prototype.wireBtnEvents=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.add(this.submitBtn.element,"mousedown",this.submitHandler,this),t.EventHandler.add(this.submitBtn.element,"click",this.submitPrevent,this),t.EventHandler.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.add(this.cancelBtn.element,"mousedown",this.cancelHandler,this),t.EventHandler.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},l.prototype.unWireEvents=function(){this.unWireEditEvent(this.editableOn),t.EventHandler.remove(this.editIcon,"click",this.clickHandler),t.EventHandler.remove(document,"scroll",this.scrollResizeHandler),window.removeEventListener("resize",this.scrollResizeHandler.bind(this)),t.EventHandler.remove(this.element,"keydown",this.valueKeyDownHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler)},l.prototype.unWireDocEvent=function(){t.EventHandler.remove(document,"mousedown",this.docClickHandler)},l.prototype.unWireEditEvent=function(e){"EditIconClick"!==e&&(this.element.removeAttribute("title"),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?(this.touchModule.destroy(),this.touchModule=void 0):t.EventHandler.remove(this.valueWrap,e.toLowerCase(),this.clickHandler))},l.prototype.unWireEditorKeyDownEvent=function(e){t.EventHandler.remove(e,"keydown",this.enterKeyDownHandler)},l.prototype.submitPrevent=function(e){e.preventDefault()},l.prototype.btnKeyDownHandler=function(e){var t=e.target;(13===e.keyCode&&13===e.which||32===e.keyCode&&32===e.which)&&(t.classList.contains(U)?this.save():t.classList.contains(_)&&this.cancelHandler())},l.prototype.afterOpenHandler=function(e){"Popup"===this.mode&&"MultiSelect"===this.type&&(t.EventHandler.add(this.containerEle,"mousedown",this.popMouseDown,this),t.EventHandler.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||e.element.classList.add(H),"RTE"===this.type?this.rteModule.refresh():"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute(t.select(".e-slider-input",this.containerEle),["name"])),this.setFocus()},l.prototype.popMouseDown=function(e){var t=e.target.classList;t.contains("e-chips-close")&&!t.contains("e-close-hooker")&&this.updateArrow()},l.prototype.doubleTapHandler=function(e){e.tapCount>1&&this.clickHandler(e.originalEvent)},l.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},l.prototype.submitHandler=function(e){e.preventDefault(),this.save()},l.prototype.cancelHandler=function(){this.removeEditor()},l.prototype.popClickHandler=function(e){var i=t.select("."+k,this.element);e.target.classList.contains("e-chips-close")&&this.tipObj.refresh(i)},l.prototype.successHandler=function(e){var t={data:e,value:this.getSendValue()};this.triggerSuccess(t)},l.prototype.failureHandler=function(e){var t={data:e,value:this.getSendValue()};this.trigger("actionFailure",t),this.removeSpinner(),this.hideForm(!1),"Popup"===this.mode&&this.updateArrow()},l.prototype.enterKeyDownHandler=function(e){13===e.keyCode&&13===e.which&&t.closest(e.target,"."+A)?this.save():27===e.keyCode&&27===e.which&&this.cancelHandler()},l.prototype.valueKeyDownHandler=function(e){13!==e.keyCode||13!==e.which||!e.target.classList.contains(w)||this.valueWrap.classList.contains(W)||this.element.classList.contains(K)||(e.preventDefault(),this.renderEditor())},l.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},l.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&this.removeEditor()},l.prototype.docClickHandler=function(e){var i=e.target;if(this.isClearTarget)this.isClearTarget=!1;else{var o=t.closest(i,"."+w),n=t.closest(i,"."+j),s=t.closest(i,"."+I),r=t.closest(i,".e-rte-elements");!t.isNullOrUndefined(o)&&o.isEqualNode(this.element)||!t.isNullOrUndefined(n)&&this.tipObj&&n.id.indexOf(this.valueWrap.id)>-1||!t.isNullOrUndefined(s)||!t.isNullOrUndefined(r)||i.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler())}},l.prototype.validate=function(){this.checkValidation()},l.prototype.save=function(){this.formEle&&(this.element.focus(),this.editEle=t.select("."+A,this.formEle),t.select("."+Q,this.editEle)&&t.isNullOrUndefined(this.validationRules)||(this.isTemplate||this.setValue(),this.checkValidation(),this.formEle.classList.contains(Q)||(this.loadSpinner(),this.hideForm(!0),"Popup"===this.mode&&this.updateArrow(),this.sendValue())))},l.prototype.destroy=function(){var i=this;this.removeEditor(),this.isExtModule&&this.notify(m,{}),this.unWireEvents();for([K,z].forEach(function(e){t.removeClass([i.element],[e])});this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.prototype.destroy.call(this)},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.requiredModules=function(){var e=[];return e.push({member:C[this.type],args:[this]}),e},l.prototype.getModuleName=function(){return"inplaceeditor"},l.prototype.onPropertyChanged=function(e,t){this.removeEditor();for(var i=0,o=Object.keys(e);i<o.length;i++){switch(o[i]){case"showButtons":e.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value)));break;case"emptyText":this.renderValue(this.checkValue(p(this.type,this.value)));break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(e.disabled);break;case"enableRtl":this.setRtl(e.enableRtl);break;case"cssClass":this.setClass("remove",t.cssClass),this.setClass("add",e.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(e.enableEditMode);break;case"editableOn":this.unWireEditEvent(t.editableOn),"EditIconClick"!==e.editableOn&&this.wireEditEvent(e.editableOn)}}},Y([t.Property("")],l.prototype,"name",void 0),Y([t.Property(null)],l.prototype,"value",void 0),Y([t.Property("")],l.prototype,"template",void 0),Y([t.Property("")],l.prototype,"cssClass",void 0),Y([t.Property("")],l.prototype,"primaryKey",void 0),Y([t.Property("Empty")],l.prototype,"emptyText",void 0),Y([t.Property("")],l.prototype,"url",void 0),Y([t.Property("Popup")],l.prototype,"mode",void 0),Y([t.Property("UrlAdaptor")],l.prototype,"adaptor",void 0),Y([t.Property("Text")],l.prototype,"type",void 0),Y([t.Property("Click")],l.prototype,"editableOn",void 0),Y([t.Property("Submit")],l.prototype,"actionOnBlur",void 0),Y([t.Property(!1)],l.prototype,"enableRtl",void 0),Y([t.Property(!1)],l.prototype,"enablePersistence",void 0),Y([t.Property(!1)],l.prototype,"disabled",void 0),Y([t.Property(!0)],l.prototype,"showButtons",void 0),Y([t.Property(!1)],l.prototype,"enableEditMode",void 0),Y([t.Property(!0)],l.prototype,"submitOnEnter",void 0),Y([t.Complex({},O)],l.prototype,"popupSettings",void 0),Y([t.Property(null)],l.prototype,"model",void 0),Y([t.Property({iconCss:"e-icons e-save-icon"})],l.prototype,"saveButton",void 0),Y([t.Property({iconCss:"e-icons e-cancel-icon"})],l.prototype,"cancelButton",void 0),Y([t.Property(null)],l.prototype,"validationRules",void 0),Y([t.Event()],l.prototype,"created",void 0),Y([t.Event()],l.prototype,"actionBegin",void 0),Y([t.Event()],l.prototype,"actionSuccess",void 0),Y([t.Event()],l.prototype,"actionFailure",void 0),Y([t.Event()],l.prototype,"validating",void 0),Y([t.Event()],l.prototype,"destroyed",void 0),l=Y([t.NotifyPropertyChanges],l)}(t.Component),J=function(){function e(e,t){this.parent=e,this.module=t,this.addEventListener()}return e.prototype.render=function(e){this.module.render(e)},e.prototype.focus=function(){this.module.focus()},e.prototype.update=function(e){this.module.updateValue(e)},e.prototype.getValue=function(){this.module.getRenderValue()},e.prototype.destroyComponent=function(){t.isNullOrUndefined(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},e.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on(c,this.render,this),this.parent.on(y,this.focus,this),this.parent.on(u,this.update,this),this.parent.on(f,this.getValue,this),this.parent.on(v,this.destroyComponent,this),this.parent.on(m,this.destroy,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(c,this.render),this.parent.off(y,this.focus),this.parent.off(u,this.update),this.parent.off(f,this.getValue),this.parent.off(v,this.destroyComponent),this.parent.off(m,this.destroy))},e}(),X=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.atcModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.AutoComplete(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"AutoComplete"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"auto-complete"},e}(),Z=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.colorModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.ColorPicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Color"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"color-picker"},e}(),ee=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.comboBoxModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.ComboBox(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"combo-box"},e}(),te=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.dateRangeModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.DateRangePicker(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"date-range-picker"},e}(),ie=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.multiSelectModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.MultiSelect(this.parent.model,e.target)},e.prototype.focus=function(){t.closest(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(new MouseEvent("mousedown"))},e.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"multi-select"},e}();l.RichTextEditor.Inject(l.HtmlEditor,l.MarkdownEditor,l.Toolbar,l.Link,l.Image,l.QuickToolbar,l.Table);var oe=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.rteModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new l.RichTextEditor(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"rte"},e}(),ne=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.sliderModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.Slider(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Slider"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"slider"},e}(),se=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.timeModule=this,this.base=new J(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.TimePicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.focusIn()},e.prototype.updateValue=function(e){this.compObj&&"Time"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"time-picker"},e}();e.parseValue=p,e.getCompValue=d,e.render=c,e.update=u,e.destroy=m,e.setFocus=y,e.accessValue=f,e.destroyModules=v,e.PopupSettings=O,e.modulesList=C,e.localeConstant=g,e.ROOT=w,e.ROOT_TIP=j,e.VALUE_WRAPPER=k,e.VALUE=D,e.OVERLAY_ICON=P,e.TIP_TITLE=H,e.TITLE=M,e.INLINE=B,e.POPUP=T,e.WRAPPER=R,e.LOADING=N,e.FORM=V,e.CTRL_GROUP=S,e.INPUT=A,e.BUTTONS=x,e.EDITABLE_ERROR=L,e.ELEMENTS=I,e.OPEN=W,e.BTN_SAVE=U,e.BTN_CANCEL=_,e.DISABLE=K,e.ICONS="e-icons",e.PRIMARY="e-primary",e.SHOW=q,e.HIDE=F,e.RTL=z,e.ERROR=Q,e.InPlaceEditor=$,e.Base=J,e.AutoComplete=X,e.ColorPicker=Z,e.ComboBox=ee,e.DateRangePicker=te,e.MultiSelect=ie,e.Rte=oe,e.Slider=ne,e.TimePicker=se,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ej2-inplace-editor.umd.min.js.map |
import { Browser, ChildProperty, Complex, Component, Event, EventHandler, Internationalization, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, compile, detach, extend, isNullOrUndefined, removeClass, select, setStyleAttribute } from '@syncfusion/ej2-base'; | ||
import { DataManager, ODataV4Adaptor, Query, UrlAdaptor } from '@syncfusion/ej2-data'; | ||
import { DataManager, ODataV4Adaptor, Query, UrlAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -434,2 +434,5 @@ import { DatePicker, DateRangePicker, DateTimePicker, TimePicker } from '@syncfusion/ej2-calendars'; | ||
break; | ||
case 'WebApiAdaptor': | ||
this.dataAdaptor = new WebApiAdaptor; | ||
break; | ||
case 'ODataV4Adaptor': | ||
@@ -616,3 +619,9 @@ this.dataAdaptor = new ODataV4Adaptor; | ||
this.dataManager = new DataManager({ url: this.url, adaptor: this.dataAdaptor }); | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
if (this.adaptor === 'UrlAdaptor') { | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
} | ||
else { | ||
let crud = this.dataManager.insert(eventArgs.data); | ||
crud.then((e) => this.successHandler(e)).catch((e) => this.failureHandler(e)); | ||
} | ||
} | ||
@@ -619,0 +628,0 @@ else { |
import { Browser, ChildProperty, Complex, Component, Event, EventHandler, Internationalization, L10n, NotifyPropertyChanges, Property, Touch, addClass, closest, compile, detach, extend, isNullOrUndefined, removeClass, select, setStyleAttribute } from '@syncfusion/ej2-base'; | ||
import { DataManager, ODataV4Adaptor, Query, UrlAdaptor } from '@syncfusion/ej2-data'; | ||
import { DataManager, ODataV4Adaptor, Query, UrlAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -467,2 +467,5 @@ import { DatePicker, DateRangePicker, DateTimePicker, TimePicker } from '@syncfusion/ej2-calendars'; | ||
break; | ||
case 'WebApiAdaptor': | ||
this.dataAdaptor = new WebApiAdaptor; | ||
break; | ||
case 'ODataV4Adaptor': | ||
@@ -645,2 +648,3 @@ this.dataAdaptor = new ODataV4Adaptor; | ||
InPlaceEditor.prototype.sendValue = function () { | ||
var _this = this; | ||
var eventArgs = { data: { name: this.name, primaryKey: this.primaryKey, value: this.getSendValue() } }; | ||
@@ -650,3 +654,9 @@ this.trigger('actionBegin', eventArgs); | ||
this.dataManager = new DataManager({ url: this.url, adaptor: this.dataAdaptor }); | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
if (this.adaptor === 'UrlAdaptor') { | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
} | ||
else { | ||
var crud = this.dataManager.insert(eventArgs.data); | ||
crud.then(function (e) { return _this.successHandler(e); }).catch(function (e) { return _this.failureHandler(e); }); | ||
} | ||
} | ||
@@ -653,0 +663,0 @@ else { |
@@ -1,2 +0,11 @@ | ||
this.ej=this.ej||{},this.ej.inplaceeditor=function(e,t,i,o,n,s,r,a,l){"use strict";function p(e,i){if(t.isNullOrUndefined(i)||""===i)return"";var o;switch(e){case"Color":var n=i;o=n.length>7?n.slice(0,-2):n;break;case"Date":o=h.formatDate(i,{skeleton:"yMd"});break;case"DateRange":var s=i;o=h.formatDate(s[0],{skeleton:"yMd"})+" - "+h.formatDate(s[1],{skeleton:"yMd"});break;case"DateTime":o=h.formatDate(i,{skeleton:"yMd"})+" "+h.formatDate(i,{skeleton:"hm"});break;case"Time":o=h.formatDate(i,{skeleton:"hm"});break;default:o=i.toString()}return o}function d(e,i){if(t.isNullOrUndefined(i)||""===i)return i;if("Date"!==e&&"Time"!==e&&"DateTime"!==e||"string"!=typeof i){if("DateRange"===e)if("object"==typeof i&&"string"==typeof i[0])i=[new Date(i[0]),new Date(i[1])];else if("string"==typeof i){var o=i.split("-");i=[new Date(o[0]),new Date(o[1])]}}else i=new Date(i);return i}var h=new t.Internationalization,c=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),u=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return c(i,e),u([t.Property("")],i.prototype,"title",void 0),u([t.Property(null)],i.prototype,"model",void 0),i}(t.ChildProperty),y={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},f={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"}},v="e-inplaceeditor",b="e-inplaceeditor-tip",E="e-editable-value-wrapper",O="e-editable-value",C="e-editable-title",g="e-editable-inline",w="e-editable-popup",k="e-editable-form",j="e-editable-component",D="e-editable-action-buttons",P="e-editable-elements",H="e-editable-open",M="e-hide",B="e-rtl",T=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),R=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},N=function(e){function l(t,i){var o=e.call(this,t,i)||this;return o.initRender=!0,o.isTemplate=!1,o.isExtModule=!1,o.submitBtn=void 0,o.cancelBtn=void 0,o.isClearTarget=!1,o.btnElements=void 0,o.dataManager=void 0,o.divComponents=["RTE","Slider"],o.clearComponents=["AutoComplete","Mask","Text"],o.dateType=["Date","DateTime","Time"],o.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],o.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],o.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"],o.needsID=!0,o}return T(l,e),l.prototype.preRender=function(){t.isNullOrUndefined(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:C})},l.prototype.render=function(){this.element.setAttribute("tabindex","0"),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value))),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode),this.setClass("add",this.cssClass)},l.prototype.setClass=function(e,i){this.isEmpty(i)||("add"===e?t.addClass([this.element],[i]):t.removeClass([this.element],[i]))},l.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:E}),this.element.innerHTML="",this.valueEle=this.createElement("span",{className:O}),this.editIcon=this.createElement("span",{className:"e-editable-overlay-icon e-icons",attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},l.prototype.renderValue=function(e){this.valueEle.innerHTML=e,"Color"===this.type&&t.setStyleAttribute(this.valueEle,{color:e}),"Inline"===this.mode&&t.removeClass([this.valueWrap],[M])},l.prototype.renderEditor=function(){var e=void 0,i=t.select("."+E,this.element);if(!this.valueWrap.classList.contains(H)){if("Inline"===this.mode)this.loaderWidth=this.valueWrap.offsetWidth,t.addClass([this.valueWrap],[M]),this.inlineWrapper=this.createElement("div",{className:g}),this.element.appendChild(this.inlineWrapper),this.renderControl(this.inlineWrapper),this.afterOpenHandler(null);else{var o=this.createElement("div",{className:w});this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,o.appendChild(this.titleEle)),e={content:o,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:b,afterOpen:this.afterOpenHandler.bind(this)},o.appendChild(this.renderControl(document.body)),t.extend(e,this.popupSettings.model,e,!0),this.tipObj=new r.Tooltip(e),this.tipObj.appendTo(i),this.tipObj.open(i)}"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),this.initRender=!1,t.addClass([this.valueWrap],[H]),this.setProperties({enableEditMode:!0},!0)}},l.prototype.setAttribute=function(e,t){var i=this.name&&0!==this.name.length?this.name:this.element.id;t.forEach(function(t){e.setAttribute(t,"id"===t?i+"_editor":i)})},l.prototype.renderControl=function(e){var t;this.containerEle=this.createElement("div",{className:"e-editable-wrapper"}),this.loader=this.createElement("div",{className:"e-editable-loading"}),this.formEle=this.createElement("form",{className:k});var i=this.createElement("div",{className:"e-component-group"}),o=this.createElement("div",{className:j});return e.appendChild(this.containerEle),this.containerEle.appendChild(this.loader),this.loadSpinner(),this.containerEle.appendChild(this.formEle),this.formEle.appendChild(i),this.isTemplate?this.appendTemplate(o,this.template):(Array.prototype.indexOf.call(this.divComponents,this.type)>-1?(t=this.createElement("div"),this.setAttribute(t,["id"])):(t=this.createElement("input"),this.setAttribute(t,["id","name"])),this.componentRoot=t,o.appendChild(t)),i.appendChild(o),i.appendChild(this.createElement("div",{className:"e-editable-error"})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},l.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},l.prototype.renderButtons=function(){var e=this.createElement("div",{className:D}),i=t.isNullOrUndefined(this.saveButton.content)||0===this.saveButton.content.length?"":" e-primary";return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:e,title:{save:"Save"},model:this.saveButton,className:"e-btn-save"+i}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:e,model:this.cancelButton,className:"e-btn-cancel"}),e},l.prototype.createButtons=function(e){var t=void 0;if(Object.keys(e.model).length>0){var i=this.createElement("button",{className:e.className,attrs:{type:e.type,title:this.getLocale(e.title,e.constant)}});e.container.appendChild(i),t=new o.Button(e.model,i)}return t},l.prototype.renderComponent=function(e){if(this.isExtModule=Array.prototype.indexOf.call(this.moduleList,this.type)>-1,t.extend(this.model,this.model,{cssClass:P}),t.isNullOrUndefined(this.value)||this.updateModelValue(),this.isExtModule)this.notify("render",{module:y[this.type],target:e,type:this.type});else switch(this.model.showClearButton=!0,this.type){case"Date":this.componentObj=new n.DatePicker(this.model,e);break;case"DateTime":this.componentObj=new n.DateTimePicker(this.model,e);break;case"DropDownList":this.componentObj=new a.DropDownList(this.model,e);break;case"Mask":this.componentObj=new s.MaskedTextBox(this.model,e);break;case"Numeric":this.model.value&&(this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"")),this.componentObj=new s.NumericTextBox(this.model,e);break;case"Text":this.componentObj=new s.TextBox(this.model,e)}},l.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new i.UrlAdaptor;break;case"ODataV4Adaptor":this.dataAdaptor=new i.ODataV4Adaptor}},l.prototype.loadSpinner=function(){t.addClass([this.loader],["e-show"]),t.setStyleAttribute(this.loader,{width:this.loaderWidth+"px"}),this.spinObj={target:this.loader},r.createSpinner(this.spinObj),r.showSpinner(this.spinObj.target),this.formEle&&t.addClass([this.formEle],[M])},l.prototype.removeSpinner=function(){this.loader.removeAttribute("style"),r.hideSpinner(this.spinObj.target),t.detach(this.spinObj.target.firstChild),this.formEle&&t.removeClass([this.formEle],[M]),t.removeClass([this.loader],["e-show"])},l.prototype.getLocale=function(e,i){return new t.L10n("inplace-editor",e,this.locale).getConstant(i)},l.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},l.prototype.updateValue=function(){t.isNullOrUndefined(this.value)||this.setProperties({value:d(this.type,this.value)},!0)},l.prototype.updateModelValue=function(){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=this.value:this.model.value=this.value.slice()},l.prototype.setValue=function(){this.isExtModule?this.notify("update",{type:this.type}):this.componentObj&&this.setProperties({value:this.componentObj.value},!0)},l.prototype.getDropDownsValue=function(){var e;return Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1&&"MultiSelect"!==this.type?e=t.select(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:"MultiSelect"===this.type&&(this.notify("access-value",{type:this.type}),e=this.printValue),e},l.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():Array.prototype.indexOf.call(this.dateType,this.type)>-1?this.value.toISOString():"DateRange"===this.type?this.value[0].toISOString()+" - "+this.value[1].toISOString():this.value.toString()},l.prototype.getRenderValue=function(){return"Mask"===this.type&&0!==this.componentObj.value.length?this.componentObj.getMaskedValue():Array.prototype.indexOf.call(this.inputDataEle,this.type)>-1?this.componentRoot.value:Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():p(this.type,this.value)},l.prototype.setRtl=function(e){e?t.addClass([this.element],[B]):t.removeClass([this.element],[B])},l.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify("set-focus",{}):this.componentObj.element.focus())},l.prototype.removeEditor=function(){this.tipObj&&this.formEle&&t.closest(this.formEle,"."+b).classList.add(M),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,t.isNullOrUndefined(t.select("."+g,this.element))?this.tipObj&&("MultiSelect"===this.type&&(t.EventHandler.remove(this.containerEle,"mousedown",this.popMouseDown),t.EventHandler.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):(t.detach(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,t.removeClass([this.valueWrap],[H,M]),this.setProperties({enableEditMode:!1},!0)},l.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify("destroy-modules",{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),t.isNullOrUndefined(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},l.prototype.destroyButtons=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.remove(this.submitBtn.element,"mousedown",this.submitHandler),t.EventHandler.remove(this.submitBtn.element,"click",this.submitPrevent),t.EventHandler.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.remove(this.cancelBtn.element,"mousedown",this.cancelHandler),t.EventHandler.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},l.prototype.getQuery=function(e){var t=new i.Query;return Object.keys(e).forEach(function(i){t.addParams(i,e[i])}),t},l.prototype.sendValue=function(){var e={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};if(this.trigger("actionBegin",e),this.isEmpty(this.url)||this.isEmpty(this.primaryKey)){var t={data:{},value:e.data.value};this.triggerSuccess(t)}else this.dataManager=new i.DataManager({url:this.url,adaptor:this.dataAdaptor}),this.dataManager.executeQuery(this.getQuery(e.data),this.successHandler.bind(this),this.failureHandler.bind(this));this.dataManager=void 0},l.prototype.isEmpty=function(e){return!(!t.isNullOrUndefined(e)&&0!==e.length)},l.prototype.checkIsTemplate=function(){this.isTemplate=!t.isNullOrUndefined(this.template)&&""!==this.template},l.prototype.templateCompile=function(e,i){var o;"string"==typeof i&&(i=i.trim());var n=t.compile(i);t.isNullOrUndefined(n)||(o=n({},this,"template")),!t.isNullOrUndefined(n)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},l.prototype.appendTemplate=function(e,i){"string"==typeof i||t.isNullOrUndefined(i.innerHTML)?("."===i[0]||"#"===i[0])&&document.querySelectorAll(i).length?(this.templateEle=document.querySelector(i),e.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(e,i):(this.templateEle=i,e.appendChild(this.templateEle))},l.prototype.disable=function(e){e?t.addClass([this.element],["e-disable"]):t.removeClass([this.element],["e-disable"])},l.prototype.enableEditor=function(e){e?this.renderEditor():this.cancelHandler()},l.prototype.checkValidation=function(){var e,i=this;this.validationRules?(this.formValidate=new s.FormValidator(this.formEle,{rules:this.validationRules,validationComplete:function(t){e={errorMessage:t.message,data:{name:i.name,primaryKey:i.primaryKey,value:i.checkValue(i.getSendValue())}},i.trigger("validating",e),"failure"===t.status?(t.errorElement.innerText=e.errorMessage,i.toggleErrorClass(!0)):i.toggleErrorClass(!1)},customPlacement:function(e,o){t.select(".e-editable-error",i.formEle).appendChild(o)}}),this.formValidate.validate()):(e={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",e),e.errorMessage&&"Empty"===e.data.value?(t.select(".e-editable-error",this.formEle).innerHTML=e.errorMessage,this.toggleErrorClass(!0)):this.toggleErrorClass(!1))},l.prototype.toggleErrorClass=function(e){if(!t.isNullOrUndefined(this.formEle)){var i=t.select(".e-input-group",this.formEle);!function(e,i,o){[].slice.call(e).forEach(function(e){e&&("add"===o?t.addClass([e],[i]):t.removeClass([e],[i]))})}([this.formEle,i],"e-error",e?"add":"remove")}},l.prototype.hideForm=function(e){t.isNullOrUndefined(this.formEle)||(e?t.addClass([this.formEle],[M]):t.removeClass([this.formEle],[M]))},l.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},l.prototype.triggerSuccess=function(e){var t=e.value;this.trigger("actionSuccess",e),this.removeSpinner(),this.hideForm(!1),this.renderValue(this.checkValue(e.value!==t?e.value:this.getRenderValue())),this.removeEditor()},l.prototype.wireEvents=function(){this.wireEditEvent(this.editableOn),t.EventHandler.add(this.editIcon,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.valueKeyDownHandler,this),t.EventHandler.add(document,"scroll",this.scrollResizeHandler,this),window.addEventListener("resize",this.scrollResizeHandler.bind(this)),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this)},l.prototype.wireDocEvent=function(){t.EventHandler.add(document,"mousedown",this.docClickHandler,this)},l.prototype.wireEditEvent=function(e){if("EditIconClick"!==e){var i="Click"===e?"editAreaClick":"editAreaDoubleClick";this.element.setAttribute("title",this.getLocale(f[e],i)),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?this.touchModule=new t.Touch(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):t.EventHandler.add(this.valueWrap,e.toLowerCase(),this.clickHandler,this)}},l.prototype.wireEditorKeyDownEvent=function(e){t.EventHandler.add(e,"keydown",this.enterKeyDownHandler,this)},l.prototype.wireBtnEvents=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.add(this.submitBtn.element,"mousedown",this.submitHandler,this),t.EventHandler.add(this.submitBtn.element,"click",this.submitPrevent,this),t.EventHandler.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.add(this.cancelBtn.element,"mousedown",this.cancelHandler,this),t.EventHandler.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},l.prototype.unWireEvents=function(){this.unWireEditEvent(this.editableOn),t.EventHandler.remove(this.editIcon,"click",this.clickHandler),t.EventHandler.remove(document,"scroll",this.scrollResizeHandler),window.removeEventListener("resize",this.scrollResizeHandler.bind(this)),t.EventHandler.remove(this.element,"keydown",this.valueKeyDownHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler)},l.prototype.unWireDocEvent=function(){t.EventHandler.remove(document,"mousedown",this.docClickHandler)},l.prototype.unWireEditEvent=function(e){"EditIconClick"!==e&&(this.element.removeAttribute("title"),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?(this.touchModule.destroy(),this.touchModule=void 0):t.EventHandler.remove(this.valueWrap,e.toLowerCase(),this.clickHandler))},l.prototype.unWireEditorKeyDownEvent=function(e){t.EventHandler.remove(e,"keydown",this.enterKeyDownHandler)},l.prototype.submitPrevent=function(e){e.preventDefault()},l.prototype.btnKeyDownHandler=function(e){var t=e.target;(13===e.keyCode&&13===e.which||32===e.keyCode&&32===e.which)&&(t.classList.contains("e-btn-save")?this.save():t.classList.contains("e-btn-cancel")&&this.cancelHandler())},l.prototype.afterOpenHandler=function(e){"Popup"===this.mode&&"MultiSelect"===this.type&&(t.EventHandler.add(this.containerEle,"mousedown",this.popMouseDown,this),t.EventHandler.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||e.element.classList.add("e-editable-tip-title"),"RTE"===this.type?this.rteModule.refresh():"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute(t.select(".e-slider-input",this.containerEle),["name"])),this.setFocus()},l.prototype.popMouseDown=function(e){var t=e.target.classList;t.contains("e-chips-close")&&!t.contains("e-close-hooker")&&this.updateArrow()},l.prototype.doubleTapHandler=function(e){e.tapCount>1&&this.clickHandler(e.originalEvent)},l.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},l.prototype.submitHandler=function(e){e.preventDefault(),this.save()},l.prototype.cancelHandler=function(){this.removeEditor()},l.prototype.popClickHandler=function(e){var i=t.select("."+E,this.element);e.target.classList.contains("e-chips-close")&&this.tipObj.refresh(i)},l.prototype.successHandler=function(e){var t={data:e,value:this.getSendValue()};this.triggerSuccess(t)},l.prototype.failureHandler=function(e){var t={data:e,value:this.getSendValue()};this.trigger("actionFailure",t),this.removeSpinner(),this.hideForm(!1),"Popup"===this.mode&&this.updateArrow()},l.prototype.enterKeyDownHandler=function(e){13===e.keyCode&&13===e.which&&t.closest(e.target,"."+j)?this.save():27===e.keyCode&&27===e.which&&this.cancelHandler()},l.prototype.valueKeyDownHandler=function(e){13!==e.keyCode||13!==e.which||!e.target.classList.contains(v)||this.valueWrap.classList.contains(H)||this.element.classList.contains("e-disable")||(e.preventDefault(),this.renderEditor())},l.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},l.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&this.removeEditor()},l.prototype.docClickHandler=function(e){var i=e.target;if(this.isClearTarget)return void(this.isClearTarget=!1);var o=t.closest(i,"."+v),n=t.closest(i,"."+b),s=t.closest(i,"."+P),r=t.closest(i,".e-rte-elements");!t.isNullOrUndefined(o)&&o.isEqualNode(this.element)||!t.isNullOrUndefined(n)&&this.tipObj&&n.id.indexOf(this.valueWrap.id)>-1||!t.isNullOrUndefined(s)||!t.isNullOrUndefined(r)||i.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler())},l.prototype.validate=function(){this.checkValidation()},l.prototype.save=function(){this.formEle&&(this.element.focus(),this.editEle=t.select("."+j,this.formEle),t.select(".e-error",this.editEle)&&t.isNullOrUndefined(this.validationRules)||(this.isTemplate||this.setValue(),this.checkValidation(),this.formEle.classList.contains("e-error")||(this.loadSpinner(),this.hideForm(!0),"Popup"===this.mode&&this.updateArrow(),this.sendValue())))},l.prototype.destroy=function(){var i=this;for(this.removeEditor(),this.isExtModule&&this.notify("destroy",{}),this.unWireEvents(),["e-disable",B].forEach(function(e){t.removeClass([i.element],[e])});this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.prototype.destroy.call(this)},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.requiredModules=function(){var e=[];return e.push({member:y[this.type],args:[this]}),e},l.prototype.getModuleName=function(){return"inplaceeditor"},l.prototype.onPropertyChanged=function(e,t){this.removeEditor();for(var i=0,o=Object.keys(e);i<o.length;i++)switch(o[i]){case"showButtons":e.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value)));break;case"emptyText":this.renderValue(this.checkValue(p(this.type,this.value)));break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(e.disabled);break;case"enableRtl":this.setRtl(e.enableRtl);break;case"cssClass":this.setClass("remove",t.cssClass),this.setClass("add",e.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(e.enableEditMode);break;case"editableOn":this.unWireEditEvent(t.editableOn),"EditIconClick"!==e.editableOn&&this.wireEditEvent(e.editableOn)}},R([t.Property("")],l.prototype,"name",void 0),R([t.Property(null)],l.prototype,"value",void 0),R([t.Property("")],l.prototype,"template",void 0),R([t.Property("")],l.prototype,"cssClass",void 0),R([t.Property("")],l.prototype,"primaryKey",void 0),R([t.Property("Empty")],l.prototype,"emptyText",void 0),R([t.Property("")],l.prototype,"url",void 0),R([t.Property("Popup")],l.prototype,"mode",void 0),R([t.Property("UrlAdaptor")],l.prototype,"adaptor",void 0),R([t.Property("Text")],l.prototype,"type",void 0),R([t.Property("Click")],l.prototype,"editableOn",void 0),R([t.Property("Submit")],l.prototype,"actionOnBlur",void 0),R([t.Property(!1)],l.prototype,"enableRtl",void 0),R([t.Property(!1)],l.prototype,"enablePersistence",void 0),R([t.Property(!1)],l.prototype,"disabled",void 0),R([t.Property(!0)],l.prototype,"showButtons",void 0),R([t.Property(!1)],l.prototype,"enableEditMode",void 0),R([t.Property(!0)],l.prototype,"submitOnEnter",void 0),R([t.Complex({},m)],l.prototype,"popupSettings",void 0),R([t.Property(null)],l.prototype,"model",void 0),R([t.Property({iconCss:"e-icons e-save-icon"})],l.prototype,"saveButton",void 0),R([t.Property({iconCss:"e-icons e-cancel-icon"})],l.prototype,"cancelButton",void 0),R([t.Property(null)],l.prototype,"validationRules",void 0),R([t.Event()],l.prototype,"created",void 0),R([t.Event()],l.prototype,"actionBegin",void 0),R([t.Event()],l.prototype,"actionSuccess",void 0),R([t.Event()],l.prototype,"actionFailure",void 0),R([t.Event()],l.prototype,"validating",void 0),R([t.Event()],l.prototype,"destroyed",void 0),l=R([t.NotifyPropertyChanges],l)}(t.Component),V=function(){function e(e,t){this.parent=e,this.module=t,this.addEventListener()}return e.prototype.render=function(e){this.module.render(e)},e.prototype.focus=function(){this.module.focus()},e.prototype.update=function(e){this.module.updateValue(e)},e.prototype.getValue=function(){this.module.getRenderValue()},e.prototype.destroyComponent=function(){t.isNullOrUndefined(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},e.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("render",this.render,this),this.parent.on("set-focus",this.focus,this),this.parent.on("update",this.update,this),this.parent.on("access-value",this.getValue,this),this.parent.on("destroy-modules",this.destroyComponent,this),this.parent.on("destroy",this.destroy,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("render",this.render),this.parent.off("set-focus",this.focus),this.parent.off("update",this.update),this.parent.off("access-value",this.getValue),this.parent.off("destroy-modules",this.destroyComponent),this.parent.off("destroy",this.destroy))},e}(),S=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.atcModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.AutoComplete(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"AutoComplete"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"auto-complete"},e}(),A=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.colorModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.ColorPicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Color"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"color-picker"},e}(),L=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.comboBoxModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.ComboBox(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"combo-box"},e}(),x=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.dateRangeModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.DateRangePicker(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"date-range-picker"},e}(),I=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.multiSelectModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.MultiSelect(this.parent.model,e.target)},e.prototype.focus=function(){t.closest(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(new MouseEvent("mousedown"))},e.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"multi-select"},e}();l.RichTextEditor.Inject(l.HtmlEditor,l.MarkdownEditor,l.Toolbar,l.Link,l.Image,l.QuickToolbar,l.Table);var W=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.rteModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new l.RichTextEditor(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"rte"},e}(),U=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.sliderModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.Slider(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Slider"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"slider"},e}(),_=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.timeModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.TimePicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.focusIn()},e.prototype.updateValue=function(e){this.compObj&&"Time"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"time-picker"},e}();return e.parseValue=p,e.getCompValue=d,e.render="render",e.update="update",e.destroy="destroy",e.setFocus="set-focus",e.accessValue="access-value",e.destroyModules="destroy-modules",e.PopupSettings=m,e.modulesList=y,e.localeConstant=f,e.ROOT=v,e.ROOT_TIP=b,e.VALUE_WRAPPER=E,e.VALUE=O,e.OVERLAY_ICON="e-editable-overlay-icon",e.TIP_TITLE="e-editable-tip-title",e.TITLE=C,e.INLINE=g,e.POPUP=w,e.WRAPPER="e-editable-wrapper",e.LOADING="e-editable-loading",e.FORM=k,e.CTRL_GROUP="e-component-group",e.INPUT=j,e.BUTTONS=D,e.EDITABLE_ERROR="e-editable-error",e.ELEMENTS=P,e.OPEN=H,e.BTN_SAVE="e-btn-save",e.BTN_CANCEL="e-btn-cancel",e.DISABLE="e-disable",e.ICONS="e-icons",e.PRIMARY="e-primary",e.SHOW="e-show",e.HIDE=M,e.RTL=B,e.ERROR="e-error",e.InPlaceEditor=N,e.Base=V,e.AutoComplete=S,e.ColorPicker=A,e.ComboBox=L,e.DateRangePicker=x,e.MultiSelect=I,e.Rte=W,e.Slider=U,e.TimePicker=_,e}({},ej.base,ej.data,ej.buttons,ej.calendars,ej.inputs,ej.popups,ej.dropdowns,ej.richtexteditor),this.ejs=ej; | ||
/*! | ||
* filename: ej2-inplace-editor.min.js | ||
* version : 16.4.52 | ||
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
this.ej=this.ej||{},this.ej.inplaceeditor=function(e,t,i,o,n,s,r,a,l){"use strict";function p(e,i){if(t.isNullOrUndefined(i)||""===i)return"";var o;switch(e){case"Color":var n=i;o=n.length>7?n.slice(0,-2):n;break;case"Date":o=h.formatDate(i,{skeleton:"yMd"});break;case"DateRange":var s=i;o=h.formatDate(s[0],{skeleton:"yMd"})+" - "+h.formatDate(s[1],{skeleton:"yMd"});break;case"DateTime":o=h.formatDate(i,{skeleton:"yMd"})+" "+h.formatDate(i,{skeleton:"hm"});break;case"Time":o=h.formatDate(i,{skeleton:"hm"});break;default:o=i.toString()}return o}function d(e,i){if(t.isNullOrUndefined(i)||""===i)return i;if("Date"!==e&&"Time"!==e&&"DateTime"!==e||"string"!=typeof i){if("DateRange"===e)if("object"==typeof i&&"string"==typeof i[0])i=[new Date(i[0]),new Date(i[1])];else if("string"==typeof i){var o=i.split("-");i=[new Date(o[0]),new Date(o[1])]}}else i=new Date(i);return i}var h=new t.Internationalization,c=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),u=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return c(i,e),u([t.Property("")],i.prototype,"title",void 0),u([t.Property(null)],i.prototype,"model",void 0),i}(t.ChildProperty),y={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},f={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"}},v="e-inplaceeditor",b="e-inplaceeditor-tip",E="e-editable-value-wrapper",O="e-editable-value",g="e-editable-title",C="e-editable-inline",w="e-editable-popup",k="e-editable-form",j="e-editable-component",D="e-editable-action-buttons",P="e-editable-elements",H="e-editable-open",M="e-hide",B="e-rtl",T=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),R=function(e,t,i,o){var n,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},N=function(e){function l(t,i){var o=e.call(this,t,i)||this;return o.initRender=!0,o.isTemplate=!1,o.isExtModule=!1,o.submitBtn=void 0,o.cancelBtn=void 0,o.isClearTarget=!1,o.btnElements=void 0,o.dataManager=void 0,o.divComponents=["RTE","Slider"],o.clearComponents=["AutoComplete","Mask","Text"],o.dateType=["Date","DateTime","Time"],o.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],o.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],o.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"],o.needsID=!0,o}return T(l,e),l.prototype.preRender=function(){t.isNullOrUndefined(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:g})},l.prototype.render=function(){this.element.setAttribute("tabindex","0"),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value))),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode),this.setClass("add",this.cssClass)},l.prototype.setClass=function(e,i){this.isEmpty(i)||("add"===e?t.addClass([this.element],[i]):t.removeClass([this.element],[i]))},l.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:E}),this.element.innerHTML="",this.valueEle=this.createElement("span",{className:O}),this.editIcon=this.createElement("span",{className:"e-editable-overlay-icon e-icons",attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},l.prototype.renderValue=function(e){this.valueEle.innerHTML=e,"Color"===this.type&&t.setStyleAttribute(this.valueEle,{color:e}),"Inline"===this.mode&&t.removeClass([this.valueWrap],[M])},l.prototype.renderEditor=function(){var e=void 0,i=t.select("."+E,this.element);if(!this.valueWrap.classList.contains(H)){if("Inline"===this.mode)this.loaderWidth=this.valueWrap.offsetWidth,t.addClass([this.valueWrap],[M]),this.inlineWrapper=this.createElement("div",{className:C}),this.element.appendChild(this.inlineWrapper),this.renderControl(this.inlineWrapper),this.afterOpenHandler(null);else{var o=this.createElement("div",{className:w});this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,o.appendChild(this.titleEle)),e={content:o,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:b,afterOpen:this.afterOpenHandler.bind(this)},o.appendChild(this.renderControl(document.body)),t.extend(e,this.popupSettings.model,e,!0),this.tipObj=new r.Tooltip(e),this.tipObj.appendTo(i),this.tipObj.open(i)}"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),this.initRender=!1,t.addClass([this.valueWrap],[H]),this.setProperties({enableEditMode:!0},!0)}},l.prototype.setAttribute=function(e,t){var i=this.name&&0!==this.name.length?this.name:this.element.id;t.forEach(function(t){e.setAttribute(t,"id"===t?i+"_editor":i)})},l.prototype.renderControl=function(e){var t;this.containerEle=this.createElement("div",{className:"e-editable-wrapper"}),this.loader=this.createElement("div",{className:"e-editable-loading"}),this.formEle=this.createElement("form",{className:k});var i=this.createElement("div",{className:"e-component-group"}),o=this.createElement("div",{className:j});return e.appendChild(this.containerEle),this.containerEle.appendChild(this.loader),this.loadSpinner(),this.containerEle.appendChild(this.formEle),this.formEle.appendChild(i),this.isTemplate?this.appendTemplate(o,this.template):(Array.prototype.indexOf.call(this.divComponents,this.type)>-1?(t=this.createElement("div"),this.setAttribute(t,["id"])):(t=this.createElement("input"),this.setAttribute(t,["id","name"])),this.componentRoot=t,o.appendChild(t)),i.appendChild(o),i.appendChild(this.createElement("div",{className:"e-editable-error"})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},l.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},l.prototype.renderButtons=function(){var e=this.createElement("div",{className:D}),i=t.isNullOrUndefined(this.saveButton.content)||0===this.saveButton.content.length?"":" e-primary";return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:e,title:{save:"Save"},model:this.saveButton,className:"e-btn-save"+i}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:e,model:this.cancelButton,className:"e-btn-cancel"}),e},l.prototype.createButtons=function(e){var t=void 0;if(Object.keys(e.model).length>0){var i=this.createElement("button",{className:e.className,attrs:{type:e.type,title:this.getLocale(e.title,e.constant)}});e.container.appendChild(i),t=new o.Button(e.model,i)}return t},l.prototype.renderComponent=function(e){if(this.isExtModule=Array.prototype.indexOf.call(this.moduleList,this.type)>-1,t.extend(this.model,this.model,{cssClass:P}),t.isNullOrUndefined(this.value)||this.updateModelValue(),this.isExtModule)this.notify("render",{module:y[this.type],target:e,type:this.type});else switch(this.model.showClearButton=!0,this.type){case"Date":this.componentObj=new n.DatePicker(this.model,e);break;case"DateTime":this.componentObj=new n.DateTimePicker(this.model,e);break;case"DropDownList":this.componentObj=new a.DropDownList(this.model,e);break;case"Mask":this.componentObj=new s.MaskedTextBox(this.model,e);break;case"Numeric":this.model.value&&(this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"")),this.componentObj=new s.NumericTextBox(this.model,e);break;case"Text":this.componentObj=new s.TextBox(this.model,e)}},l.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new i.UrlAdaptor;break;case"WebApiAdaptor":this.dataAdaptor=new i.WebApiAdaptor;break;case"ODataV4Adaptor":this.dataAdaptor=new i.ODataV4Adaptor}},l.prototype.loadSpinner=function(){t.addClass([this.loader],["e-show"]),t.setStyleAttribute(this.loader,{width:this.loaderWidth+"px"}),this.spinObj={target:this.loader},r.createSpinner(this.spinObj),r.showSpinner(this.spinObj.target),this.formEle&&t.addClass([this.formEle],[M])},l.prototype.removeSpinner=function(){this.loader.removeAttribute("style"),r.hideSpinner(this.spinObj.target),t.detach(this.spinObj.target.firstChild),this.formEle&&t.removeClass([this.formEle],[M]),t.removeClass([this.loader],["e-show"])},l.prototype.getLocale=function(e,i){return new t.L10n("inplace-editor",e,this.locale).getConstant(i)},l.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},l.prototype.updateValue=function(){t.isNullOrUndefined(this.value)||this.setProperties({value:d(this.type,this.value)},!0)},l.prototype.updateModelValue=function(){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=this.value:this.model.value=this.value.slice()},l.prototype.setValue=function(){this.isExtModule?this.notify("update",{type:this.type}):this.componentObj&&this.setProperties({value:this.componentObj.value},!0)},l.prototype.getDropDownsValue=function(){var e;return Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1&&"MultiSelect"!==this.type?e=t.select(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:"MultiSelect"===this.type&&(this.notify("access-value",{type:this.type}),e=this.printValue),e},l.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():Array.prototype.indexOf.call(this.dateType,this.type)>-1?this.value.toISOString():"DateRange"===this.type?this.value[0].toISOString()+" - "+this.value[1].toISOString():this.value.toString()},l.prototype.getRenderValue=function(){return"Mask"===this.type&&0!==this.componentObj.value.length?this.componentObj.getMaskedValue():Array.prototype.indexOf.call(this.inputDataEle,this.type)>-1?this.componentRoot.value:Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue():p(this.type,this.value)},l.prototype.setRtl=function(e){e?t.addClass([this.element],[B]):t.removeClass([this.element],[B])},l.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify("set-focus",{}):this.componentObj.element.focus())},l.prototype.removeEditor=function(){this.tipObj&&this.formEle&&t.closest(this.formEle,"."+b).classList.add(M),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,t.isNullOrUndefined(t.select("."+C,this.element))?this.tipObj&&("MultiSelect"===this.type&&(t.EventHandler.remove(this.containerEle,"mousedown",this.popMouseDown),t.EventHandler.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):(t.detach(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,t.removeClass([this.valueWrap],[H,M]),this.setProperties({enableEditMode:!1},!0)},l.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify("destroy-modules",{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),t.isNullOrUndefined(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},l.prototype.destroyButtons=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.remove(this.submitBtn.element,"mousedown",this.submitHandler),t.EventHandler.remove(this.submitBtn.element,"click",this.submitPrevent),t.EventHandler.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.remove(this.cancelBtn.element,"mousedown",this.cancelHandler),t.EventHandler.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},l.prototype.getQuery=function(e){var t=new i.Query;return Object.keys(e).forEach(function(i){t.addParams(i,e[i])}),t},l.prototype.sendValue=function(){var e=this,t={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};if(this.trigger("actionBegin",t),this.isEmpty(this.url)||this.isEmpty(this.primaryKey)){var o={data:{},value:t.data.value};this.triggerSuccess(o)}else this.dataManager=new i.DataManager({url:this.url,adaptor:this.dataAdaptor}),"UrlAdaptor"===this.adaptor?this.dataManager.executeQuery(this.getQuery(t.data),this.successHandler.bind(this),this.failureHandler.bind(this)):this.dataManager.insert(t.data).then(function(t){return e.successHandler(t)}).catch(function(t){return e.failureHandler(t)});this.dataManager=void 0},l.prototype.isEmpty=function(e){return!(!t.isNullOrUndefined(e)&&0!==e.length)},l.prototype.checkIsTemplate=function(){this.isTemplate=!t.isNullOrUndefined(this.template)&&""!==this.template},l.prototype.templateCompile=function(e,i){var o;"string"==typeof i&&(i=i.trim());var n=t.compile(i);t.isNullOrUndefined(n)||(o=n({},this,"template")),!t.isNullOrUndefined(n)&&o.length>0&&[].slice.call(o).forEach(function(t){e.appendChild(t)})},l.prototype.appendTemplate=function(e,i){"string"==typeof i||t.isNullOrUndefined(i.innerHTML)?("."===i[0]||"#"===i[0])&&document.querySelectorAll(i).length?(this.templateEle=document.querySelector(i),e.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(e,i):(this.templateEle=i,e.appendChild(this.templateEle))},l.prototype.disable=function(e){e?t.addClass([this.element],["e-disable"]):t.removeClass([this.element],["e-disable"])},l.prototype.enableEditor=function(e){e?this.renderEditor():this.cancelHandler()},l.prototype.checkValidation=function(){var e,i=this;this.validationRules?(this.formValidate=new s.FormValidator(this.formEle,{rules:this.validationRules,validationComplete:function(t){e={errorMessage:t.message,data:{name:i.name,primaryKey:i.primaryKey,value:i.checkValue(i.getSendValue())}},i.trigger("validating",e),"failure"===t.status?(t.errorElement.innerText=e.errorMessage,i.toggleErrorClass(!0)):i.toggleErrorClass(!1)},customPlacement:function(e,o){t.select(".e-editable-error",i.formEle).appendChild(o)}}),this.formValidate.validate()):(e={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",e),e.errorMessage&&"Empty"===e.data.value?(t.select(".e-editable-error",this.formEle).innerHTML=e.errorMessage,this.toggleErrorClass(!0)):this.toggleErrorClass(!1))},l.prototype.toggleErrorClass=function(e){if(!t.isNullOrUndefined(this.formEle)){var i=t.select(".e-input-group",this.formEle);!function(e,i,o){[].slice.call(e).forEach(function(e){e&&("add"===o?t.addClass([e],[i]):t.removeClass([e],[i]))})}([this.formEle,i],"e-error",e?"add":"remove")}},l.prototype.hideForm=function(e){t.isNullOrUndefined(this.formEle)||(e?t.addClass([this.formEle],[M]):t.removeClass([this.formEle],[M]))},l.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},l.prototype.triggerSuccess=function(e){var t=e.value;this.trigger("actionSuccess",e),this.removeSpinner(),this.hideForm(!1),this.renderValue(this.checkValue(e.value!==t?e.value:this.getRenderValue())),this.removeEditor()},l.prototype.wireEvents=function(){this.wireEditEvent(this.editableOn),t.EventHandler.add(this.editIcon,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.valueKeyDownHandler,this),t.EventHandler.add(document,"scroll",this.scrollResizeHandler,this),window.addEventListener("resize",this.scrollResizeHandler.bind(this)),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this)},l.prototype.wireDocEvent=function(){t.EventHandler.add(document,"mousedown",this.docClickHandler,this)},l.prototype.wireEditEvent=function(e){if("EditIconClick"!==e){var i="Click"===e?"editAreaClick":"editAreaDoubleClick";this.element.setAttribute("title",this.getLocale(f[e],i)),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?this.touchModule=new t.Touch(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):t.EventHandler.add(this.valueWrap,e.toLowerCase(),this.clickHandler,this)}},l.prototype.wireEditorKeyDownEvent=function(e){t.EventHandler.add(e,"keydown",this.enterKeyDownHandler,this)},l.prototype.wireBtnEvents=function(){t.isNullOrUndefined(this.submitBtn)||(t.EventHandler.add(this.submitBtn.element,"mousedown",this.submitHandler,this),t.EventHandler.add(this.submitBtn.element,"click",this.submitPrevent,this),t.EventHandler.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),t.isNullOrUndefined(this.cancelBtn)||(t.EventHandler.add(this.cancelBtn.element,"mousedown",this.cancelHandler,this),t.EventHandler.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},l.prototype.unWireEvents=function(){this.unWireEditEvent(this.editableOn),t.EventHandler.remove(this.editIcon,"click",this.clickHandler),t.EventHandler.remove(document,"scroll",this.scrollResizeHandler),window.removeEventListener("resize",this.scrollResizeHandler.bind(this)),t.EventHandler.remove(this.element,"keydown",this.valueKeyDownHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler)},l.prototype.unWireDocEvent=function(){t.EventHandler.remove(document,"mousedown",this.docClickHandler)},l.prototype.unWireEditEvent=function(e){"EditIconClick"!==e&&(this.element.removeAttribute("title"),t.Browser.isDevice&&t.Browser.isIos&&"DblClick"===e?(this.touchModule.destroy(),this.touchModule=void 0):t.EventHandler.remove(this.valueWrap,e.toLowerCase(),this.clickHandler))},l.prototype.unWireEditorKeyDownEvent=function(e){t.EventHandler.remove(e,"keydown",this.enterKeyDownHandler)},l.prototype.submitPrevent=function(e){e.preventDefault()},l.prototype.btnKeyDownHandler=function(e){var t=e.target;(13===e.keyCode&&13===e.which||32===e.keyCode&&32===e.which)&&(t.classList.contains("e-btn-save")?this.save():t.classList.contains("e-btn-cancel")&&this.cancelHandler())},l.prototype.afterOpenHandler=function(e){"Popup"===this.mode&&"MultiSelect"===this.type&&(t.EventHandler.add(this.containerEle,"mousedown",this.popMouseDown,this),t.EventHandler.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||e.element.classList.add("e-editable-tip-title"),"RTE"===this.type?this.rteModule.refresh():"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute(t.select(".e-slider-input",this.containerEle),["name"])),this.setFocus()},l.prototype.popMouseDown=function(e){var t=e.target.classList;t.contains("e-chips-close")&&!t.contains("e-close-hooker")&&this.updateArrow()},l.prototype.doubleTapHandler=function(e){e.tapCount>1&&this.clickHandler(e.originalEvent)},l.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},l.prototype.submitHandler=function(e){e.preventDefault(),this.save()},l.prototype.cancelHandler=function(){this.removeEditor()},l.prototype.popClickHandler=function(e){var i=t.select("."+E,this.element);e.target.classList.contains("e-chips-close")&&this.tipObj.refresh(i)},l.prototype.successHandler=function(e){var t={data:e,value:this.getSendValue()};this.triggerSuccess(t)},l.prototype.failureHandler=function(e){var t={data:e,value:this.getSendValue()};this.trigger("actionFailure",t),this.removeSpinner(),this.hideForm(!1),"Popup"===this.mode&&this.updateArrow()},l.prototype.enterKeyDownHandler=function(e){13===e.keyCode&&13===e.which&&t.closest(e.target,"."+j)?this.save():27===e.keyCode&&27===e.which&&this.cancelHandler()},l.prototype.valueKeyDownHandler=function(e){13!==e.keyCode||13!==e.which||!e.target.classList.contains(v)||this.valueWrap.classList.contains(H)||this.element.classList.contains("e-disable")||(e.preventDefault(),this.renderEditor())},l.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},l.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&this.removeEditor()},l.prototype.docClickHandler=function(e){var i=e.target;if(this.isClearTarget)return void(this.isClearTarget=!1);var o=t.closest(i,"."+v),n=t.closest(i,"."+b),s=t.closest(i,"."+P),r=t.closest(i,".e-rte-elements");!t.isNullOrUndefined(o)&&o.isEqualNode(this.element)||!t.isNullOrUndefined(n)&&this.tipObj&&n.id.indexOf(this.valueWrap.id)>-1||!t.isNullOrUndefined(s)||!t.isNullOrUndefined(r)||i.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler())},l.prototype.validate=function(){this.checkValidation()},l.prototype.save=function(){this.formEle&&(this.element.focus(),this.editEle=t.select("."+j,this.formEle),t.select(".e-error",this.editEle)&&t.isNullOrUndefined(this.validationRules)||(this.isTemplate||this.setValue(),this.checkValidation(),this.formEle.classList.contains("e-error")||(this.loadSpinner(),this.hideForm(!0),"Popup"===this.mode&&this.updateArrow(),this.sendValue())))},l.prototype.destroy=function(){var i=this;for(this.removeEditor(),this.isExtModule&&this.notify("destroy",{}),this.unWireEvents(),["e-disable",B].forEach(function(e){t.removeClass([i.element],[e])});this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.prototype.destroy.call(this)},l.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l.prototype.requiredModules=function(){var e=[];return e.push({member:y[this.type],args:[this]}),e},l.prototype.getModuleName=function(){return"inplaceeditor"},l.prototype.onPropertyChanged=function(e,t){this.removeEditor();for(var i=0,o=Object.keys(e);i<o.length;i++)switch(o[i]){case"showButtons":e.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),this.renderValue(this.checkValue(p(this.type,this.value)));break;case"emptyText":this.renderValue(this.checkValue(p(this.type,this.value)));break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(e.disabled);break;case"enableRtl":this.setRtl(e.enableRtl);break;case"cssClass":this.setClass("remove",t.cssClass),this.setClass("add",e.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(e.enableEditMode);break;case"editableOn":this.unWireEditEvent(t.editableOn),"EditIconClick"!==e.editableOn&&this.wireEditEvent(e.editableOn)}},R([t.Property("")],l.prototype,"name",void 0),R([t.Property(null)],l.prototype,"value",void 0),R([t.Property("")],l.prototype,"template",void 0),R([t.Property("")],l.prototype,"cssClass",void 0),R([t.Property("")],l.prototype,"primaryKey",void 0),R([t.Property("Empty")],l.prototype,"emptyText",void 0),R([t.Property("")],l.prototype,"url",void 0),R([t.Property("Popup")],l.prototype,"mode",void 0),R([t.Property("UrlAdaptor")],l.prototype,"adaptor",void 0),R([t.Property("Text")],l.prototype,"type",void 0),R([t.Property("Click")],l.prototype,"editableOn",void 0),R([t.Property("Submit")],l.prototype,"actionOnBlur",void 0),R([t.Property(!1)],l.prototype,"enableRtl",void 0),R([t.Property(!1)],l.prototype,"enablePersistence",void 0),R([t.Property(!1)],l.prototype,"disabled",void 0),R([t.Property(!0)],l.prototype,"showButtons",void 0),R([t.Property(!1)],l.prototype,"enableEditMode",void 0),R([t.Property(!0)],l.prototype,"submitOnEnter",void 0),R([t.Complex({},m)],l.prototype,"popupSettings",void 0),R([t.Property(null)],l.prototype,"model",void 0),R([t.Property({iconCss:"e-icons e-save-icon"})],l.prototype,"saveButton",void 0),R([t.Property({iconCss:"e-icons e-cancel-icon"})],l.prototype,"cancelButton",void 0),R([t.Property(null)],l.prototype,"validationRules",void 0),R([t.Event()],l.prototype,"created",void 0),R([t.Event()],l.prototype,"actionBegin",void 0),R([t.Event()],l.prototype,"actionSuccess",void 0),R([t.Event()],l.prototype,"actionFailure",void 0),R([t.Event()],l.prototype,"validating",void 0),R([t.Event()],l.prototype,"destroyed",void 0),l=R([t.NotifyPropertyChanges],l)}(t.Component),V=function(){function e(e,t){this.parent=e,this.module=t,this.addEventListener()}return e.prototype.render=function(e){this.module.render(e)},e.prototype.focus=function(){this.module.focus()},e.prototype.update=function(e){this.module.updateValue(e)},e.prototype.getValue=function(){this.module.getRenderValue()},e.prototype.destroyComponent=function(){t.isNullOrUndefined(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},e.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("render",this.render,this),this.parent.on("set-focus",this.focus,this),this.parent.on("update",this.update,this),this.parent.on("access-value",this.getValue,this),this.parent.on("destroy-modules",this.destroyComponent,this),this.parent.on("destroy",this.destroy,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("render",this.render),this.parent.off("set-focus",this.focus),this.parent.off("update",this.update),this.parent.off("access-value",this.getValue),this.parent.off("destroy-modules",this.destroyComponent),this.parent.off("destroy",this.destroy))},e}(),S=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.atcModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.AutoComplete(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"AutoComplete"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"auto-complete"},e}(),A=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.colorModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.ColorPicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Color"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"color-picker"},e}(),L=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.comboBoxModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.ComboBox(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"combo-box"},e}(),x=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.dateRangeModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.DateRangePicker(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"date-range-picker"},e}(),I=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.multiSelectModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new a.MultiSelect(this.parent.model,e.target)},e.prototype.focus=function(){t.closest(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(new MouseEvent("mousedown"))},e.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"multi-select"},e}();l.RichTextEditor.Inject(l.HtmlEditor,l.MarkdownEditor,l.Toolbar,l.Link,l.Image,l.QuickToolbar,l.Table);var W=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.rteModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new l.RichTextEditor(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"rte"},e}(),U=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.sliderModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.compObj=new s.Slider(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.updateValue=function(e){this.compObj&&"Slider"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"slider"},e}(),_=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.timeModule=this,this.base=new V(this.parent,this)}return e.prototype.render=function(e){this.parent.model.showClearButton=!0,this.compObj=new n.TimePicker(this.parent.model,e.target)},e.prototype.focus=function(){this.compObj.focusIn()},e.prototype.updateValue=function(e){this.compObj&&"Time"===e.type&&this.parent.setProperties({value:this.compObj.value},!0)},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"time-picker"},e}();return e.parseValue=p,e.getCompValue=d,e.render="render",e.update="update",e.destroy="destroy",e.setFocus="set-focus",e.accessValue="access-value",e.destroyModules="destroy-modules",e.PopupSettings=m,e.modulesList=y,e.localeConstant=f,e.ROOT=v,e.ROOT_TIP=b,e.VALUE_WRAPPER=E,e.VALUE=O,e.OVERLAY_ICON="e-editable-overlay-icon",e.TIP_TITLE="e-editable-tip-title",e.TITLE=g,e.INLINE=C,e.POPUP=w,e.WRAPPER="e-editable-wrapper",e.LOADING="e-editable-loading",e.FORM=k,e.CTRL_GROUP="e-component-group",e.INPUT=j,e.BUTTONS=D,e.EDITABLE_ERROR="e-editable-error",e.ELEMENTS=P,e.OPEN=H,e.BTN_SAVE="e-btn-save",e.BTN_CANCEL="e-btn-cancel",e.DISABLE="e-disable",e.ICONS="e-icons",e.PRIMARY="e-primary",e.SHOW="e-show",e.HIDE=M,e.RTL=B,e.ERROR="e-error",e.InPlaceEditor=N,e.Base=V,e.AutoComplete=S,e.ColorPicker=A,e.ComboBox=L,e.DateRangePicker=x,e.MultiSelect=I,e.Rte=W,e.Slider=U,e.TimePicker=_,e}({},ej.base,ej.data,ej.buttons,ej.calendars,ej.inputs,ej.popups,ej.dropdowns,ej.richtexteditor),this.ejs=ej; | ||
//# sourceMappingURL=ej2-inplace-editor.min.js.map |
@@ -0,1 +1,10 @@ | ||
/*! | ||
* filename: index.d.ts | ||
* version : 16.4.52 | ||
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
import * as _inplaceeditor from '@syncfusion/ej2-inplace-editor'; | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "@syncfusion/ej2-inplace-editor", | ||
"version": "16.4.48", | ||
"version": "16.4.52", | ||
"description": "A package of Essential JS 2 Inplace editor components, which is used to edit and update the value dynamically in server.", | ||
@@ -11,13 +11,13 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~16.4.47", | ||
"@syncfusion/ej2-data": "~16.4.48", | ||
"@syncfusion/ej2-lists": "~16.4.47", | ||
"@syncfusion/ej2-inputs": "~16.4.48", | ||
"@syncfusion/ej2-popups": "~16.4.47", | ||
"@syncfusion/ej2-buttons": "~16.4.47", | ||
"@syncfusion/ej2-dropdowns": "~16.4.48", | ||
"@syncfusion/ej2-calendars": "~16.4.48", | ||
"@syncfusion/ej2-navigations": "~16.4.47", | ||
"@syncfusion/ej2-splitbuttons": "~16.4.47", | ||
"@syncfusion/ej2-richtexteditor": "~16.4.48" | ||
"@syncfusion/ej2-base": "~16.4.52", | ||
"@syncfusion/ej2-data": "~16.4.52", | ||
"@syncfusion/ej2-lists": "~16.4.52", | ||
"@syncfusion/ej2-inputs": "~16.4.52", | ||
"@syncfusion/ej2-popups": "~16.4.52", | ||
"@syncfusion/ej2-buttons": "~16.4.52", | ||
"@syncfusion/ej2-dropdowns": "~16.4.52", | ||
"@syncfusion/ej2-calendars": "~16.4.52", | ||
"@syncfusion/ej2-navigations": "~16.4.52", | ||
"@syncfusion/ej2-splitbuttons": "~16.4.52", | ||
"@syncfusion/ej2-richtexteditor": "~16.4.52" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, Property, Event, EmitType, select } from '@syncfusion/ej2-base';import { detach, addClass, removeClass, EventHandler, setStyleAttribute, Complex, ModuleDeclaration } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, closest, extend, L10n, compile, Browser, Touch, TapEventArgs } from '@syncfusion/ej2-base';import { DataManager, UrlAdaptor, Query, WebApiAdaptor, ODataV4Adaptor } from '@syncfusion/ej2-data';import { Button, ButtonModel } from '@syncfusion/ej2-buttons';import { RichTextEditorModel } from '@syncfusion/ej2-richtexteditor';import { DatePicker, DatePickerModel, DateTimePicker } from '@syncfusion/ej2-calendars';import { DateTimePickerModel, DateRangePickerModel, TimePickerModel } from '@syncfusion/ej2-calendars';import { NumericTextBox, NumericTextBoxModel, TextBox, TextBoxModel } from '@syncfusion/ej2-inputs';import { createSpinner, hideSpinner, SpinnerArgs, showSpinner } from '@syncfusion/ej2-popups';import { Tooltip, TooltipEventArgs, TipPointerPosition } from '@syncfusion/ej2-popups';import { ColorPickerModel, FormValidator, MaskedTextBox, MaskedTextBoxModel, SliderModel } from '@syncfusion/ej2-inputs';import { AutoCompleteModel, ComboBoxModel, DropDownList, DropDownListModel, MultiSelectModel } from '@syncfusion/ej2-dropdowns';import { Rte } from '../modules/rte';import { Slider } from '../modules/slider';import { ComboBox } from '../modules/combo-box';import { TimePicker } from '../modules/time-picker';import { MultiSelect } from '../modules/multi-select';import { ColorPicker } from '../modules/color-picker';import { AutoComplete } from '../modules/auto-complete';import { DateRangePicker } from '../modules/date-range-picker';import * as events from './events';import * as classes from './classes';import { PopupSettings, modulesList, localeConstant } from './models';import { PopupSettingsModel } from './models-model';import { ActionBeginEventArgs, ActionEventArgs, FormEventArgs, ValidateEventArgs, IButton } from './interface';import { parseValue, getCompValue } from './util'; | ||
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, Property, Event, EmitType, select } from '@syncfusion/ej2-base';import { detach, addClass, removeClass, EventHandler, setStyleAttribute, Complex, ModuleDeclaration } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, closest, extend, L10n, compile, Browser, Touch, TapEventArgs } from '@syncfusion/ej2-base';import { DataManager, UrlAdaptor, Query, WebApiAdaptor, ODataV4Adaptor, ReturnOption } from '@syncfusion/ej2-data';import { Button, ButtonModel } from '@syncfusion/ej2-buttons';import { RichTextEditorModel } from '@syncfusion/ej2-richtexteditor';import { DatePicker, DatePickerModel, DateTimePicker } from '@syncfusion/ej2-calendars';import { DateTimePickerModel, DateRangePickerModel, TimePickerModel } from '@syncfusion/ej2-calendars';import { NumericTextBox, NumericTextBoxModel, TextBox, TextBoxModel } from '@syncfusion/ej2-inputs';import { createSpinner, hideSpinner, SpinnerArgs, showSpinner } from '@syncfusion/ej2-popups';import { Tooltip, TooltipEventArgs, TipPointerPosition } from '@syncfusion/ej2-popups';import { ColorPickerModel, FormValidator, MaskedTextBox, MaskedTextBoxModel, SliderModel } from '@syncfusion/ej2-inputs';import { AutoCompleteModel, ComboBoxModel, DropDownList, DropDownListModel, MultiSelectModel } from '@syncfusion/ej2-dropdowns';import { Rte } from '../modules/rte';import { Slider } from '../modules/slider';import { ComboBox } from '../modules/combo-box';import { TimePicker } from '../modules/time-picker';import { MultiSelect } from '../modules/multi-select';import { ColorPicker } from '../modules/color-picker';import { AutoComplete } from '../modules/auto-complete';import { DateRangePicker } from '../modules/date-range-picker';import * as events from './events';import * as classes from './classes';import { PopupSettings, modulesList, localeConstant } from './models';import { PopupSettingsModel } from './models-model';import { ActionBeginEventArgs, ActionEventArgs, FormEventArgs, ValidateEventArgs, IButton } from './interface';import { parseValue, getCompValue } from './util'; | ||
import {RenderMode,AdaptorType,InputType,EditableType,ActionBlur} from "./inplace-editor"; | ||
@@ -3,0 +3,0 @@ import {ComponentModel} from '@syncfusion/ej2-base'; |
@@ -23,3 +23,3 @@ var __extends = (this && this.__extends) || (function () { | ||
import { isNullOrUndefined as isNOU, closest, extend, L10n, compile, Browser, Touch } from '@syncfusion/ej2-base'; | ||
import { DataManager, UrlAdaptor, Query, ODataV4Adaptor } from '@syncfusion/ej2-data'; | ||
import { DataManager, UrlAdaptor, Query, WebApiAdaptor, ODataV4Adaptor } from '@syncfusion/ej2-data'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -289,2 +289,5 @@ import { DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars'; | ||
break; | ||
case 'WebApiAdaptor': | ||
this.dataAdaptor = new WebApiAdaptor; | ||
break; | ||
case 'ODataV4Adaptor': | ||
@@ -467,2 +470,3 @@ this.dataAdaptor = new ODataV4Adaptor; | ||
InPlaceEditor.prototype.sendValue = function () { | ||
var _this = this; | ||
var eventArgs = { data: { name: this.name, primaryKey: this.primaryKey, value: this.getSendValue() } }; | ||
@@ -472,3 +476,9 @@ this.trigger('actionBegin', eventArgs); | ||
this.dataManager = new DataManager({ url: this.url, adaptor: this.dataAdaptor }); | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
if (this.adaptor === 'UrlAdaptor') { | ||
this.dataManager.executeQuery(this.getQuery(eventArgs.data), this.successHandler.bind(this), this.failureHandler.bind(this)); | ||
} | ||
else { | ||
var crud = this.dataManager.insert(eventArgs.data); | ||
crud.then(function (e) { return _this.successHandler(e); }).catch(function (e) { return _this.failureHandler(e); }); | ||
} | ||
} | ||
@@ -475,0 +485,0 @@ else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
921616
11775