@syncfusion/ej2-inplace-editor
Version:
A package of Essential JS 2 Inplace editor components, which is used to edit and update the value dynamically in server.
1 lines • 47.4 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionCalendars"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionRichtexteditor")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionButtons","SyncfusionCalendars","SyncfusionPopups","SyncfusionInputs","SyncfusionDropdowns","SyncfusionRichtexteditor"],t):"object"==typeof exports?exports.SyncfusionInplaceEditor=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons"),require("SyncfusionCalendars"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionRichtexteditor")):e.SyncfusionInplaceEditor=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionButtons,e.SyncfusionCalendars,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionDropdowns,e.SyncfusionRichtexteditor)}(self,(e,t,i,o,n,s,r,a)=>(()=>{"use strict";var l={766:t=>{t.exports=e},741:e=>{e.exports=i},570:e=>{e.exports=o},74:e=>{e.exports=t},778:e=>{e.exports=r},323:e=>{e.exports=s},197:e=>{e.exports=n},674:e=>{e.exports=a}},p={};function d(e){var t=p[e];if(void 0!==t)return t.exports;var i=p[e]={exports:{}};return l[e](i,i.exports,d),i.exports}d.d=(e,t)=>{for(var i in t)d.o(t,i)&&!d.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var h={};return(()=>{d.r(h),d.d(h,{AutoComplete:()=>re,BTN_CANCEL:()=>I,BTN_SAVE:()=>L,BUTTONS:()=>x,Base:()=>se,CTRL_GROUP:()=>T,CTRL_OVERLAY:()=>W,ColorPicker:()=>ae,ComboBox:()=>le,DISABLE:()=>z,DateRangePicker:()=>pe,EDITABLE_ERROR:()=>N,ELEMENTS:()=>R,ERROR:()=>Y,FORM:()=>V,HIDE:()=>F,ICONS:()=>_,INLINE:()=>P,INPUT:()=>H,InPlaceEditor:()=>ne,LOAD:()=>G,LOADING:()=>B,MultiSelect:()=>he,OPEN:()=>A,OVERLAY_ICON:()=>S,POPUP:()=>D,PRIMARY:()=>q,PopupSettings:()=>v,ROOT:()=>O,ROOT_TIP:()=>g,RTE_SPIN_WRAP:()=>U,RTL:()=>Q,Rte:()=>ue,SHOW:()=>K,Slider:()=>me,TIP_TITLE:()=>j,TITLE:()=>k,TimePicker:()=>fe,VALUE:()=>w,VALUE_WRAPPER:()=>C,WRAPPER:()=>M,accessValue:()=>c,destroy:()=>l,destroyModules:()=>u,encode:()=>n,getCompValue:()=>o,localeConstant:()=>E,modulesList:()=>b,parseValue:()=>i,render:()=>r,setFocus:()=>p,showPopup:()=>m,update:()=>a});var e=d(766),t=new e.Internationalization;function i(i,o,n){if((0,e.isNullOrUndefined)(o)||""===o)return"";var s,r;switch(i){case"Color":var a=o;s=a.length>7?a.slice(0,-2):a;break;case"Date":r=n.format,s=t.formatDate(o,{format:r,type:i,skeleton:(0,e.isBlazor)()?"d":"yMd"});break;case"DateRange":r=n.format;var l=o;s=t.formatDate(l[0],{format:r,type:i,skeleton:(0,e.isBlazor)()?"d":"yMd"})+" - "+t.formatDate(l[1],{format:r,type:i,skeleton:(0,e.isBlazor)()?"d":"yMd"});break;case"DateTime":r=n.format,s=(0,e.isNullOrUndefined)(r)||""===r?t.formatDate(o,{format:r,type:i,skeleton:(0,e.isBlazor)()?"d":"yMd"})+" "+t.formatDate(o,{format:r,type:i,skeleton:(0,e.isBlazor)()?"t":"hm"}):t.formatDate(o,{format:r,type:i,skeleton:(0,e.isBlazor)()?"d":"yMd"});break;case"Time":r=n.format,s=t.formatDate(o,{format:r,type:i,skeleton:(0,e.isBlazor)()?"t":"hm"});break;case"Numeric":r=(0,e.isNullOrUndefined)(n.format)?"n2":n.format;var p=(0,e.isNullOrUndefined)(o)?null:"number"==typeof o?o:t.parseNumber(o);s=t.formatNumber(p,{format:r});break;default:s=o.toString()}return s}function o(t,i){if((0,e.isNullOrUndefined)(i)||""===i)return i;if("Date"!==t&&"Time"!==t&&"DateTime"!==t||"string"!=typeof i){if("DateRange"===t)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}function n(e){for(var t=[],i=e.length-1;i>=0;i--)t.unshift(["&#",e[i].charCodeAt(0),";"].join(""));return t.join("")}var s,r="render",a="update",l="destroy",p="set-focus",c="access-value",u="destroy-modules",m="show-popup",f=(s=function(e,t){return s=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])},s(e,t)},function(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),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},v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),y([(0,e.Property)("")],i.prototype,"title",void 0),y([(0,e.Property)(null)],i.prototype,"model",void 0),i}(e.ChildProperty),b={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},E={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"},EditIconClick:{editAreaClick:"Click to edit"}},O="e-inplaceeditor",g="e-inplaceeditor-tip",C="e-editable-value-wrapper",w="e-editable-value",S="e-editable-overlay-icon",j="e-editable-tip-title",k="e-editable-title",P="e-editable-inline",D="e-editable-popup",M="e-editable-wrapper",B="e-editable-loading",V="e-editable-form",T="e-component-group",H="e-editable-component",x="e-editable-action-buttons",N="e-editable-error",R="e-editable-elements",A="e-editable-open",L="e-btn-save",I="e-btn-cancel",U="e-rte-spin-wrap",W="e-control-overlay",z="e-disable",_="e-icons",q="e-primary",K="e-show",F="e-hide",Q="e-rtl",Y="e-error",G="e-loading",$=d(74),J=d(741),X=d(570),Z=d(197),ee=d(323),te=d(778),ie=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])},e(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)}}(),oe=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},ne=function(t){function s(e,i){var o=t.call(this,e,i)||this;return o.needsID=!0,o}return ie(s,t),s.prototype.initializeValue=function(){this.initRender=!0,this.isTemplate=!1,this.isVue=!1,this.isExtModule=!1,this.submitBtn=void 0,this.cancelBtn=void 0,this.isClearTarget=!1,this.btnElements=void 0,this.dataManager=void 0,this.oldValue=void 0,this.divComponents=["RTE","Slider"],this.clearComponents=["AutoComplete","Mask","Text"],this.dateType=["Date","DateTime","Time"],this.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],this.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],this.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"]},s.prototype.preRender=function(){this.initializeValue(),this.onScrollResizeHandler=this.scrollResizeHandler.bind(this),(0,e.isNullOrUndefined)(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:k}),!(0,e.isNullOrUndefined)(this.popupSettings.model)&&this.popupSettings.model.afterOpen&&(this.afterOpenEvent=this.popupSettings.model.afterOpen)},s.prototype.render=function(){(0,e.isNullOrUndefined)(this.element.getAttribute("tabindex"))&&(this.disabled?this.element.setAttribute("tabindex","-1"):this.element.setAttribute("tabindex","0")),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),"Never"===this.textOption?this.renderValue(this.checkValue(i(this.type,this.value,this.model))):this.renderInitialValue(),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode,!0),this.setClass("add",this.cssClass),this.renderComplete()},s.prototype.setClass=function(t,i){if(!this.isEmpty(i))for(var o=i.split(" "),n=0;n<o.length;n++)""!==o[n].trim()&&("add"===t?(0,e.addClass)([this.element],[o[n]]):(0,e.removeClass)([this.element],[o[n]]))},s.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:C}),(0,e.isBlazor)()||(this.element.innerHTML=""),this.valueEle=this.createElement("span",{className:w}),this.editIcon=this.createElement("span",{className:S+" "+_,attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},s.prototype.renderInitialValue=function(){!(["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type)>-1)||(0,e.isNullOrUndefined)(this.value)||this.isEmpty(this.value.toString())||(0,e.isNullOrUndefined)(this.model.fields)||(0,e.isNullOrUndefined)(this.model.dataSource)?this.renderValue(this.checkValue(i(this.type,this.value,this.model))):(this.renderValue(this.getLocale({loadingText:"Loading..."},"loadingText")),this.valueWrap.classList.add(G),(0,Z.createSpinner)({target:this.valueWrap,width:10}),(0,Z.showSpinner)(this.valueWrap),this.getInitFieldMapValue())},s.prototype.getInitFieldMapValue=function(){var t=this,i=this.model,o=i.fields.text,n=i.fields.value,s=(0,e.isNullOrUndefined)(i.query)?new $.Query:i.query;i.dataSource instanceof $.DataManager?i.dataSource.executeQuery(this.getInitQuery(i,s)).then(function(e){t.updateInitValue(o,n,e.result)}):this.updateInitValue(o,n,new $.DataManager(i.dataSource).executeLocal(this.getInitQuery(i,s)))},s.prototype.getInitQuery=function(e,t){var i,o=e.fields.value,n=this.value;if("MultiSelect"!==this.type||"object"!=typeof this.value)i=new $.Predicate(o,"equal",this.value);else for(var s=0,r=0,a=n;r<a.length;r++){var l=a[r];i=0===s?i=new $.Predicate(o,"equal",l):i.or(o,"equal",l),s++}return t.where(i)},s.prototype.updateInitValue=function(t,i,o){if(!(o.length<=0)){if(1===o.length)this.valueEle.innerHTML=this.checkValue((0,e.getValue)((0,e.isNullOrUndefined)(t)?i:t,o[0]));else{for(var n=[],s=0,r=o;s<r.length;s++){var a=r[s];n.push((0,e.getValue)((0,e.isNullOrUndefined)(t)?i:t,a))}this.valueEle.innerHTML=this.checkValue(n.toString())}(0,Z.hideSpinner)(this.valueWrap),this.valueWrap.classList.remove(G)}},s.prototype.renderValue=function(t){this.enableHtmlSanitizer&&"RTE"!==this.type&&"MultiSelect"!==this.type?this.valueEle.innerText=t:this.valueEle.innerHTML=this.enableHtmlParse?t:n(t),"Color"===this.type&&(0,e.setStyleAttribute)(this.valueEle,{color:t}),"Inline"===this.mode&&this.isEditorOpen()&&(0,e.removeClass)([this.valueWrap],[F])},s.prototype.isEditorOpen=function(){return!(this.isVue&&(this.enableEditMode||!((0,e.isNullOrUndefined)(this.valueWrap)||this.valueWrap.classList.contains(F)||this.valueWrap.classList.contains("e-tooltip"))))},s.prototype.renderEditor=function(){if(this.prevValue=this.value,this.beginEditArgs={mode:this.mode,cancelFocus:!1,cancel:!1},this.trigger("beginEdit",this.beginEditArgs),!this.beginEditArgs.cancel){var t=void 0,i=(0,e.select)("."+C,this.element);if("EditIconClick"!==this.editableOn&&i.parentElement.removeAttribute("title"),!this.valueWrap.classList.contains(A)){if("Inline"===this.mode)(0,e.addClass)([this.valueWrap],[F]),this.inlineWrapper=this.createElement("div",{className:P}),this.element.appendChild(this.inlineWrapper),["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type)>-1?this.checkRemoteData(this.model):this.renderAndOpen();else{!(0,e.isNullOrUndefined)(this.popupSettings.model)&&this.popupSettings.model.afterOpen&&(this.popupSettings.model.afterOpen=this.afterOpenHandler.bind(this));var o=this.createElement("div",{className:D});this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,o.appendChild(this.titleEle)),t={content:o,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:g,afterOpen:this.afterOpenHandler.bind(this)},o.appendChild(this.renderControl(document.body)),(0,e.extend)(t,this.popupSettings.model,t,!0),this.tipObj=new Z.Tooltip(t),this.tipObj.appendTo(i),this.tipObj.open(i)}"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),(0,e.addClass)([this.valueWrap],[A]),this.setProperties({enableEditMode:!0},!0),this.isReact&&this.renderReactTemplates()}}},s.prototype.renderAndOpen=function(){this.renderControl(this.inlineWrapper),this.afterOpenHandler(null)},s.prototype.checkRemoteData=function(t){var i=this;t.dataSource instanceof $.DataManager?(t.dataBound=function(){i.afterOpenHandler(null)},this.renderControl(this.inlineWrapper),((0,e.isNullOrUndefined)(t.value)&&(0,e.isNullOrUndefined)(this.value)||t.value===this.value&&!(0,e.isNullOrUndefined)(t.value)&&0===t.value.length)&&this.showDropDownPopup()):this.renderAndOpen()},s.prototype.showDropDownPopup=function(){"DropDownList"===this.type?(this.model.allowFiltering||this.componentObj.focusIn(),this.componentObj.showPopup()):this.isExtModule&&this.notify("MultiSelect"===this.type?p:m,{})},s.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)})},s.prototype.renderControl=function(e){var t;this.containerEle=this.createElement("div",{className:M}),this.loader=this.createElement("div",{className:B}),this.formEle=this.createElement("form",{className:V});var i=this.createElement("div",{className:T}),o=this.createElement("div",{className:H});return e.appendChild(this.containerEle),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),o.appendChild(this.loader)),i.appendChild(o),i.appendChild(this.createElement("div",{className:N})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},s.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},s.prototype.renderButtons=function(){var t=this.createElement("div",{className:x}),i=(0,e.isNullOrUndefined)(this.saveButton.content)||0===this.saveButton.content.length?"":" "+q;return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:t,title:{save:"Save"},model:this.saveButton,className:L+i}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:t,model:this.cancelButton,className:I}),t},s.prototype.createButtons=function(t){var i=void 0;if(Object.keys(t.model).length>0){var o=this.createElement("button",{className:t.className,attrs:{type:t.type,title:"save"==t.constant?(0,e.isNullOrUndefined)(this.saveButton.content)?this.getLocale(t.title,t.constant):this.saveButton.content:(0,e.isNullOrUndefined)(this.cancelButton.content)?this.getLocale(t.title,t.constant):this.cancelButton.content}});t.container.appendChild(o),i=new J.Button(t.model,o)}return i},s.prototype.renderComponent=function(t){var i;if(this.isExtModule=Array.prototype.indexOf.call(this.moduleList,this.type)>-1,i=(0,e.isNullOrUndefined)(this.model.cssClass)?R:this.model.cssClass.indexOf(R)<0?""===this.model.cssClass?R:this.model.cssClass+" "+R:this.model.cssClass,(0,e.extend)(this.model,this.model,{cssClass:i,enableRtl:this.enableRtl,locale:this.locale,change:this.changeHandler.bind(this)}),(0,e.isNullOrUndefined)(this.value)||this.updateModelValue(!1),this.isExtModule)this.notify(r,{module:b[this.type],target:t,type:this.type});else{switch((0,e.isNullOrUndefined)(this.model.showClearButton)&&!(0,e.isBlazor)()&&(this.model.showClearButton=!0),this.type){case"Date":this.componentObj=new X.DatePicker(this.model);break;case"DateTime":this.componentObj=new X.DateTimePicker(this.model);break;case"DropDownList":this.componentObj=new te.DropDownList(this.model);break;case"Mask":this.componentObj=new ee.MaskedTextBox(this.model);break;case"Numeric":if(this.model.value)new RegExp("[eE][-+]?([0-9]+)").test(this.model.value)?this.model.value=this.model.value:this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"");this.componentObj=new ee.NumericTextBox(this.model);break;case"Text":this.componentObj=new ee.TextBox(this.model)}this.componentObj.appendTo(t)}},s.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new $.UrlAdaptor;break;case"WebApiAdaptor":this.dataAdaptor=new $.WebApiAdaptor;break;case"ODataV4Adaptor":this.dataAdaptor=new $.ODataV4Adaptor}},s.prototype.loadSpinner=function(t){(0,e.addClass)([this.loader],[K]),"validate"!==t||"RTE"!==this.type&&"Color"!==this.type&&"Slider"!==this.type?this.spinObj={target:this.loader,width:e.Browser.isDevice?"16px":"14px"}:((0,e.addClass)([this.loader],[U]),(0,e.addClass)([this.getEditElement()],[W]),this.spinObj={target:this.loader}),this.formEle&&(0,e.addClass)([this.formEle],[G]),this.btnElements&&(0,e.addClass)([this.btnElements],[F]),(0,e.setStyleAttribute)(this.loader,{width:"100%"}),(0,Z.createSpinner)(this.spinObj),(0,Z.showSpinner)(this.spinObj.target)},s.prototype.removeSpinner=function(t){this.loader.removeAttribute("style"),(0,Z.hideSpinner)(this.spinObj.target),(0,e.detach)(this.spinObj.target.firstChild),"submit"!==t||"RTE"!==this.type&&"Color"!==this.type&&"Slider"!==this.type||((0,e.removeClass)([this.loader],[U]),(0,e.removeClass)([this.getEditElement()],[W])),this.formEle&&(0,e.removeClass)([this.formEle],[G]),this.btnElements&&(0,e.removeClass)([this.btnElements],[F]),(0,e.removeClass)([this.loader],[K])},s.prototype.getEditElement=function(){return(0,e.select)("."+R,this.formEle)},s.prototype.getLocale=function(t,i){return new e.L10n("inplace-editor",t,this.locale).getConstant(i)},s.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},s.prototype.extendModelValue=function(t){var i=this.model;(0,e.extend)(i,{value:t}),this.setProperties({model:i},!0)},s.prototype.updateValue=function(){this.oldValue=this.value,this.enableHtmlSanitizer&&"string"==typeof this.value&&(this.oldValue=this.sanitizeHelper(this.value)),(0,e.isNullOrUndefined)(this.value)||(this.setProperties({value:o(this.type,this.oldValue)},!0),this.extendModelValue(o(this.type,this.oldValue)))},s.prototype.updateModelValue=function(e){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=e?this.oldValue:this.value:this.model.value=e?this.oldValue.slice():this.value.slice()},s.prototype.setValue=function(){this.isExtModule?this.notify(a,{type:this.type}):this.componentObj&&("Numeric"===this.type&&null===this.componentObj.value&&this.componentObj.setProperties({value:null},!0),this.setProperties({value:this.componentObj.value},!0),this.extendModelValue(this.componentObj.value))},s.prototype.getDropDownsValue=function(t){var i;return Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1&&"MultiSelect"!==this.type?i=t?(0,e.select)(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:this.value.toString():"MultiSelect"===this.type&&(this.notify(c,{type:this.type}),i=t?this.printValue:this.value.join()),i},s.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":Array.prototype.indexOf.call(this.dropDownEle,this.type)>-1?this.getDropDownsValue(!1):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()},s.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(!0):i(this.type,this.value,this.model)},s.prototype.setRtl=function(t){t?(0,e.addClass)([this.element],[Q]):(0,e.removeClass)([this.element],[Q])},s.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify(p,{}):"dropdownlist"===this.componentObj.getModuleName()?this.componentObj.focusIn():this.componentObj.element.focus())},s.prototype.removeEditor=function(t){Object.keys(window);if((0,e.isBlazor)()&&!this.isStringTemplate&&(0,e.resetBlazorTemplate)(this.element.id+"template","Template"),this.tipObj&&this.formEle&&(0,e.closest)(this.formEle,"."+g).classList.add(F),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,(0,e.isNullOrUndefined)((0,e.select)("."+P,this.element))?this.tipObj&&("MultiSelect"===this.type&&(e.EventHandler.remove(this.containerEle,"mousedown",this.popMouseDown),e.EventHandler.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):((0,e.detach)(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,(0,e.removeClass)([this.valueWrap],[A,F]),t||this.setProperties({enableEditMode:!1},!0),!(0,e.isNullOrUndefined)(this.editableOn)&&"EditIconClick"!==this.editableOn){var i="DblClick"===this.editableOn?"editAreaDoubleClick":"editAreaClick";(0,e.isNullOrUndefined)(this.valueWrap.parentElement)||this.valueWrap.parentElement.setAttribute("title",this.getLocale(E[this.editableOn],i))}this.isReact&&this.clearTemplate()},s.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify(u,{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),(0,e.isNullOrUndefined)(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},s.prototype.destroyButtons=function(){(0,e.isNullOrUndefined)(this.submitBtn)||(e.EventHandler.remove(this.submitBtn.element,"mousedown",this.submitHandler),e.EventHandler.remove(this.submitBtn.element,"click",this.submitPrevent),e.EventHandler.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),(0,e.isNullOrUndefined)(this.cancelBtn)||(e.EventHandler.remove(this.cancelBtn.element,"mousedown",this.cancelBtnClick),e.EventHandler.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},s.prototype.getQuery=function(e){var t=new $.Query;return Object.keys(e).forEach(function(i){t.addParams(i,e[i])}),t},s.prototype.sendValue=function(){var e=this,t={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};this.trigger("actionBegin",t,function(t){if(t.cancel)e.removeSpinner("submit"),"Popup"===e.mode&&e.updateArrow();else{if(e.isEmpty(e.url)||e.isEmpty(e.primaryKey)||!e.initRender&&(e.initRender||e.prevValue===e.value)){var i={data:{},value:t.data.value};e.triggerSuccess(i)}else{if(e.dataManager=new $.DataManager({url:e.url,adaptor:e.dataAdaptor}),"UrlAdaptor"===e.adaptor)e.dataManager.executeQuery(e.getQuery(t.data),e.successHandler.bind(e),e.failureHandler.bind(e));else e.dataManager.insert(t.data).then(function(t){return e.successHandler(t)}).catch(function(t){return e.failureHandler(t)})}e.dataManager=void 0}})},s.prototype.isEmpty=function(t){return!(!(0,e.isNullOrUndefined)(t)&&0!==t.length)},s.prototype.checkIsTemplate=function(){this.isTemplate=!(0,e.isNullOrUndefined)(this.template)&&""!==this.template},s.prototype.templateCompile=function(t,i){var o;Object.keys(window);"string"==typeof i&&(i=i.trim());var n=(0,e.compile)(i);if(!(0,e.isNullOrUndefined)(n)){var s=!((0,e.isBlazor)()&&"function"!=typeof i&&!this.isStringTemplate&&0===i.indexOf("<div>Blazor"))||this.isStringTemplate;o=n({},this,"template",this.element.id+"template",s)}!(0,e.isNullOrUndefined)(n)&&o.length>0&&([].slice.call(o).forEach(function(e){t.appendChild(e)}),(0,e.isBlazor)()&&!this.isStringTemplate&&"function"!=typeof i&&0===i.indexOf("<div>Blazor")&&(0,e.updateBlazorTemplate)(this.element.id+"template","Template",this))},s.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize();(0,e.extend)(i,i,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",i,function(o){i.cancel&&!(0,e.isNullOrUndefined)(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))})}return t},s.prototype.appendTemplate=function(t,i){i="string"==typeof i?this.sanitizeHelper(i):i,this.setProperties({template:i},!0),"function"==typeof i?this.templateCompile(t,i):"string"==typeof i||(0,e.isNullOrUndefined)(i.innerHTML)?("."===i[0]||"#"===i[0])&&document.querySelectorAll(i).length?(this.templateEle=document.querySelector(i),t.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(t,i):(this.templateEle=i,t.appendChild(this.templateEle))},s.prototype.disable=function(t){t?(0,e.addClass)([this.element],[z]):(0,e.removeClass)([this.element],[z])},s.prototype.enableEditor=function(e,t){t&&!e||(e?this.renderEditor():this.cancelHandler("cancel"))},s.prototype.checkValidation=function(t,i){var o,n=this;if(this.validationRules){var s=Object.keys(this.validationRules),r=Object.keys(this.validationRules[s[0]]).length;r="validateHidden"in this.validationRules[s[0]]?r-1:r;var a=0;this.formValidate=new ee.FormValidator(this.formEle,{rules:this.validationRules,validationBegin:function(e){if("RTE"===n.type){var t=document.createElement("div");t.innerHTML=e.value,e.value=t.innerText}},validationComplete:function(s){a+=1,o={errorMessage:s.message,data:{name:n.name,primaryKey:n.primaryKey,value:n.checkValue(n.getSendValue())}},n.trigger("validating",o,function(o){"failure"===s.status?(s.errorElement.innerText=o.errorMessage,n.toggleErrorClass(!0)):n.toggleErrorClass(!1),(0,e.isNullOrUndefined)(t)||!t||r!==a&&"failure"!==s.status||(t=!1,n.afterValidation(i),a=0)})},customPlacement:function(t,i){n.formEle&&(0,e.select)("."+N,n.formEle).appendChild(i)}}),a=0,this.formValidate.validate()}else""!==this.template?(o={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",o,function(t){t.errorMessage?((0,e.select)("."+N,n.formEle).innerHTML=t.errorMessage,n.toggleErrorClass(!0)):n.toggleErrorClass(!1),n.afterValidation(i)})):this.afterValidation(i)},s.prototype.afterValidation=function(e){!this.formEle.classList.contains(Y)&&e&&(this.loadSpinner("validate"),"Popup"===this.mode&&this.updateArrow(),this.sendValue())},s.prototype.toggleErrorClass=function(t){if(!(0,e.isNullOrUndefined)(this.formEle)){var i,o,n,s=(0,e.select)(".e-input-group",this.formEle);i=[this.formEle,s],o=Y,n=t?"add":"remove",[].slice.call(i).forEach(function(t){t&&("add"===n?(0,e.addClass)([t],[o]):(0,e.removeClass)([t],[o]))})}},s.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},s.prototype.triggerSuccess=function(t){var i=this,o=t.value;this.trigger("actionSuccess",t,function(t){i.oldValue=o,i.removeSpinner("submit"),t.cancel||i.renderValue(i.checkValue(t.value!==o?t.value:i.getRenderValue())),t.cancel&&"Inline"===i.mode&&(0,e.removeClass)([i.valueWrap],[F]),i.removeEditor()})},s.prototype.triggerEndEdit=function(e){var t=this,i={cancel:!1,mode:this.mode,action:e};this.trigger("endEdit",i,function(e){e.cancel||(t.formEle&&t.formEle.classList.contains(Y)&&(t.updateModelValue(!0),t.setProperties({value:t.oldValue},!0)),t.removeEditor())})},s.prototype.wireEvents=function(){(0,e.isNullOrUndefined)(this.editableOn)||this.wireEditEvent(this.editableOn),e.EventHandler.add(this.editIcon,"click",this.clickHandler,this),e.EventHandler.add(this.element,"keydown",this.valueKeyDownHandler,this),document.addEventListener("scroll",this.onScrollResizeHandler),window.addEventListener("resize",this.onScrollResizeHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&e.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this)},s.prototype.wireDocEvent=function(){e.EventHandler.add(document,"mousedown",this.docClickHandler,this)},s.prototype.wireEditEvent=function(t){if("EditIconClick"!==t){var i="Click"===t?"editAreaClick":"editAreaDoubleClick";this.element.setAttribute("title",this.getLocale(E[t],i)),e.Browser.isDevice&&e.Browser.isIos&&"DblClick"===t?this.touchModule=new e.Touch(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):e.EventHandler.add(this.valueWrap,t.toLowerCase(),this.clickHandler,this)}},s.prototype.wireEditorKeyDownEvent=function(t){e.EventHandler.add(t,"keydown",this.enterKeyDownHandler,this)},s.prototype.wireBtnEvents=function(){(0,e.isNullOrUndefined)(this.submitBtn)||(e.EventHandler.add(this.submitBtn.element,"mousedown",this.submitHandler,this),e.EventHandler.add(this.submitBtn.element,"click",this.submitPrevent,this),e.EventHandler.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),(0,e.isNullOrUndefined)(this.cancelBtn)||(e.EventHandler.add(this.cancelBtn.element,"mousedown",this.cancelBtnClick,this),e.EventHandler.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},s.prototype.cancelBtnClick=function(e){this.cancelHandler("cancel"),this.trigger("cancelClick",e)},s.prototype.unWireEvents=function(){(0,e.isNullOrUndefined)(this.editableOn)||this.unWireEditEvent(this.editableOn),e.EventHandler.remove(this.editIcon,"click",this.clickHandler),document.removeEventListener("scroll",this.onScrollResizeHandler),window.removeEventListener("resize",this.onScrollResizeHandler),e.EventHandler.remove(this.element,"keydown",this.valueKeyDownHandler),Array.prototype.indexOf.call(this.clearComponents,this.type)>-1&&e.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler)},s.prototype.unWireDocEvent=function(){e.EventHandler.remove(document,"mousedown",this.docClickHandler)},s.prototype.unWireEditEvent=function(t){"EditIconClick"!==t&&(this.element.removeAttribute("title"),e.Browser.isDevice&&e.Browser.isIos&&"DblClick"===t?(this.touchModule.destroy(),this.touchModule=void 0):e.EventHandler.remove(this.valueWrap,t.toLowerCase(),this.clickHandler))},s.prototype.unWireEditorKeyDownEvent=function(t){e.EventHandler.remove(t,"keydown",this.enterKeyDownHandler)},s.prototype.submitPrevent=function(e){e.preventDefault()},s.prototype.btnKeyDownHandler=function(t){var i=t.target;(13===t.keyCode&&13===t.which||32===t.keyCode&&32===t.which)&&(i.classList.contains(L)?this.save():i.classList.contains(I)&&this.cancelHandler("cancel")),9!==t.keyCode||!1!==t.shiftKey||!(0,e.isNullOrUndefined)(t.target.nextElementSibling)&&"BUTTON"===t.target.nextElementSibling.tagName||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel"))},s.prototype.afterOpenHandler=function(t){"Popup"===this.mode&&"MultiSelect"===this.type&&(e.EventHandler.add(this.containerEle,"mousedown",this.popMouseDown,this),e.EventHandler.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||t.element.classList.add(j),"RTE"===this.type?(this.rteModule.refresh(),this.setAttribute((0,e.select)(".e-richtexteditor textarea",this.containerEle),["name"])):"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute((0,e.select)(".e-slider-input",this.containerEle),["name"])),this.beginEditArgs.cancelFocus||("Inline"===this.mode&&["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type)>-1&&this.model.dataSource instanceof $.DataManager?this.showDropDownPopup():this.setFocus()),this.afterOpenEvent&&(this.tipObj.setProperties({afterOpen:this.afterOpenEvent},!0),this.tipObj.trigger("afterOpen",t))},s.prototype.popMouseDown=function(e){var t=e.target.classList;t.contains("e-chips-close")&&!t.contains("e-close-hooker")&&this.updateArrow()},s.prototype.doubleTapHandler=function(e){e.tapCount>1&&this.clickHandler(e.originalEvent)},s.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},s.prototype.submitHandler=function(e){e.preventDefault(),this.save(),this.trigger("submitClick",e)},s.prototype.cancelHandler=function(e){this.triggerEndEdit(e)},s.prototype.popClickHandler=function(t){var i=(0,e.select)("."+C,this.element);t.target.classList.contains("e-chips-close")&&this.tipObj.refresh(i)},s.prototype.successHandler=function(e){this.initRender=!1;var t={data:e,value:this.getSendValue()};this.triggerSuccess(t)},s.prototype.failureHandler=function(e){var t=this,i={data:e,value:this.getSendValue()};this.trigger("actionFailure",i,function(e){t.removeSpinner("submit"),"Popup"===t.mode&&t.updateArrow()})},s.prototype.enterKeyDownHandler=function(t){(0,e.closest)(t.target,"."+H+" .e-richtexteditor")||t.currentTarget.getElementsByTagName("textarea")[0]||(13===t.keyCode&&13===t.which&&(0,e.closest)(t.target,"."+H)?(this.save(),this.trigger("submitClick",t)):27===t.keyCode&&27===t.which&&this.cancelHandler("cancel"))},s.prototype.valueKeyDownHandler=function(e){9===e.keyCode&&!0===e.shiftKey&&"BUTTON"!==e.target.tagName&&("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel")),13!==e.keyCode||13!==e.which||!e.target.classList.contains(O)||this.valueWrap.classList.contains(A)||this.element.classList.contains(z)||(e.preventDefault(),this.renderEditor())},s.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},s.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&!e.Browser.isDevice&&this.triggerEndEdit("cancel")},s.prototype.docClickHandler=function(t){var i=t.target;if(this.isClearTarget)this.isClearTarget=!1;else{var o=(0,e.closest)(i,"."+O),n=(0,e.closest)(i,"."+g),s=(0,e.closest)(i,"."+R),r=(0,e.closest)(i,".e-rte-elements");!(0,e.isNullOrUndefined)(o)&&o.isEqualNode(this.element)||!(0,e.isNullOrUndefined)(n)&&this.tipObj&&n.id.indexOf(this.valueWrap.id)>-1||!(0,e.isNullOrUndefined)(s)||!(0,e.isNullOrUndefined)(r)||i.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel"))}},s.prototype.changeHandler=function(e){var t={previousValue:void 0===this.compPrevValue?this.value:this.compPrevValue,value:e.value};"AutoComplete"!==this.type&&"ComboBox"!==this.type&&"DropDownList"!==this.type||(t.itemData=e.itemData,t.previousItemData=e.previousItemData),this.compPrevValue=t.value,this.trigger("change",t)},s.prototype.validate=function(){this.checkValidation(!0,!1)},s.prototype.save=function(){var t=this;if(this.formEle){this.element.focus(),this.editEle=(0,e.select)("."+H,this.formEle);(0,e.select)("."+Y,this.editEle),this.isTemplate||this.setValue();var i={cancel:!1,mode:this.mode,action:"submit"};this.trigger("endEdit",i,function(e){e.cancel||t.checkValidation(!0,!0)})}},s.prototype.destroy=function(){var i=this;for(this.removeEditor((0,e.isBlazor)()),this.isExtModule&&this.notify(l,{}),this.unWireEvents(),[z,Q].forEach(function(t){(0,e.removeClass)([i.element],[t])});this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild);(0,e.isBlazor)()&&this.isServerRendered||t.prototype.destroy.call(this),this.isReact&&this.clearTemplate()},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.requiredModules=function(){var e=[];return Array.prototype.indexOf.call(this.moduleList,this.type)>-1&&e.push({member:b[this.type],args:[this]}),e},s.prototype.getModuleName=function(){return"inplaceeditor"},s.prototype.onPropertyChanged=function(t,o){if(!this.validationRules||!(!(0,e.isNullOrUndefined)(this.element.querySelectorAll("."+Y))&&this.element.querySelectorAll("."+Y).length>0)){if(this.isEditorOpen()){var n="enableEditMode"in t;n&&o.enableEditMode&&!t.enableEditMode||!n&&this.enableEditMode?this.triggerEndEdit("cancel"):this.removeEditor()}for(var s=0,r=Object.keys(t);s<r.length;s++){switch(r[s]){case"showButtons":t.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),"Never"===this.textOption?this.renderValue(this.checkValue(i(this.type,this.value,this.model))):this.renderInitialValue();break;case"emptyText":"Never"===this.textOption?this.renderValue(this.checkValue(i(this.type,this.value,this.model))):this.renderInitialValue();break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(t.disabled),t.disabled?this.element.tabIndex=-1:this.element.tabIndex=0;break;case"enableRtl":this.setRtl(t.enableRtl);break;case"cssClass":this.setClass("remove",o.cssClass),this.setClass("add",t.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(t.enableEditMode);break;case"editableOn":this.unWireEditEvent(o.editableOn),"EditIconClick"!==t.editableOn&&this.wireEditEvent(t.editableOn)}}}},oe([(0,e.Property)("")],s.prototype,"name",void 0),oe([(0,e.Property)(null)],s.prototype,"value",void 0),oe([(0,e.Property)("")],s.prototype,"template",void 0),oe([(0,e.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),oe([(0,e.Property)(!0)],s.prototype,"enableHtmlParse",void 0),oe([(0,e.Property)("")],s.prototype,"cssClass",void 0),oe([(0,e.Property)("")],s.prototype,"primaryKey",void 0),oe([(0,e.Property)("Empty")],s.prototype,"emptyText",void 0),oe([(0,e.Property)("")],s.prototype,"url",void 0),oe([(0,e.Property)("Popup")],s.prototype,"mode",void 0),oe([(0,e.Property)("UrlAdaptor")],s.prototype,"adaptor",void 0),oe([(0,e.Property)("Text")],s.prototype,"type",void 0),oe([(0,e.Property)("Click")],s.prototype,"editableOn",void 0),oe([(0,e.Property)("Never")],s.prototype,"textOption",void 0),oe([(0,e.Property)("Submit")],s.prototype,"actionOnBlur",void 0),oe([(0,e.Property)(!1)],s.prototype,"enablePersistence",void 0),oe([(0,e.Property)(!1)],s.prototype,"disabled",void 0),oe([(0,e.Property)(!0)],s.prototype,"showButtons",void 0),oe([(0,e.Property)(!1)],s.prototype,"enableEditMode",void 0),oe([(0,e.Property)(!0)],s.prototype,"submitOnEnter",void 0),oe([(0,e.Complex)({},v)],s.prototype,"popupSettings",void 0),oe([(0,e.Property)(null)],s.prototype,"model",void 0),oe([(0,e.Property)({iconCss:"e-icons e-save-icon"})],s.prototype,"saveButton",void 0),oe([(0,e.Property)({iconCss:"e-icons e-cancel-icon"})],s.prototype,"cancelButton",void 0),oe([(0,e.Property)(null)],s.prototype,"validationRules",void 0),oe([(0,e.Event)()],s.prototype,"created",void 0),oe([(0,e.Event)()],s.prototype,"beforeSanitizeHtml",void 0),oe([(0,e.Event)()],s.prototype,"actionBegin",void 0),oe([(0,e.Event)()],s.prototype,"actionSuccess",void 0),oe([(0,e.Event)()],s.prototype,"actionFailure",void 0),oe([(0,e.Event)()],s.prototype,"validating",void 0),oe([(0,e.Event)()],s.prototype,"beginEdit",void 0),oe([(0,e.Event)()],s.prototype,"endEdit",void 0),oe([(0,e.Event)()],s.prototype,"change",void 0),oe([(0,e.Event)()],s.prototype,"submitClick",void 0),oe([(0,e.Event)()],s.prototype,"cancelClick",void 0),oe([(0,e.Event)()],s.prototype,"destroyed",void 0),s=oe([e.NotifyPropertyChanges],s)}(e.Component),se=function(){function t(e,t){this.parent=e,this.module=t,this.addEventListener()}return t.prototype.render=function(e){this.module.render(e)},t.prototype.showPopup=function(){this.module.showPopup()},t.prototype.focus=function(){this.module.focus()},t.prototype.update=function(e){this.module.updateValue(e)},t.prototype.getValue=function(){this.module.getRenderValue()},t.prototype.destroyComponent=function(){(0,e.isNullOrUndefined)(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},t.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},t.prototype.addEventListener=function(){this.parent.on(r,this.render,this),this.parent.on(p,this.focus,this),this.parent.on(m,this.showPopup,this),this.parent.on(a,this.update,this),this.parent.on(c,this.getValue,this),this.parent.on(u,this.destroyComponent,this),this.parent.on(l,this.destroy,this)},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(r,this.render),this.parent.off(p,this.focus),this.parent.off(m,this.showPopup),this.parent.off(a,this.update),this.parent.off(c,this.getValue),this.parent.off(u,this.destroyComponent),this.parent.off(l,this.destroy))},t}(),re=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.atcModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new te.AutoComplete(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.showPopup=function(){this.compObj.focusIn(),this.compObj.showPopup()},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),this.parent.extendModelValue(this.compObj.value))},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"auto-complete"},e}(),ae=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.colorModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new ee.ColorPicker(this.parent.model),this.compObj.appendTo(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),this.parent.extendModelValue(this.compObj.value))},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"color-picker"},e}(),le=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.comboBoxModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new te.ComboBox(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.showPopup=function(){this.compObj.focusIn(),this.compObj.showPopup()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},e.prototype.getModuleName=function(){return"combo-box"},e}(),pe=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.dateRangeModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new X.DateRangePicker(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.element.focus()},e.prototype.getModuleName=function(){return"date-range-picker"},e.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},e.prototype.destroy=function(){this.base.destroy()},e}(),de=function(){return de=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},de.apply(this,arguments)},he=function(){function t(e){this.isPopOpen=!1,this.compObj=void 0,this.parent=e,this.parent.multiSelectModule=this,this.base=new se(this.parent,this)}return t.prototype.render=function(e){var t=de({},this.parent.model);this.openEvent=t.open,this.closeEvent=t.close,t.open=this.openHandler.bind(this),t.close=this.closeHandler.bind(this),this.compObj=new te.MultiSelect(t),this.compObj.appendTo(e.target)},t.prototype.openHandler=function(e){this.isPopOpen=!0,this.openEvent&&(this.compObj.setProperties({open:this.openEvent},!0),this.compObj.trigger("open",e))},t.prototype.closeHandler=function(e){this.isPopOpen=!1,this.closeEvent&&(this.compObj.setProperties({close:this.closeEvent},!0),this.compObj.trigger("close",e))},t.prototype.focus=function(){if(!this.isPopOpen){var t=document.createEvent("MouseEvent");t.initEvent("mousedown",!0,!0),(0,e.closest)(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(t)}},t.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},t.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},t.prototype.destroy=function(){this.base.destroy()},t.prototype.getModuleName=function(){return"multi-select"},t}(),ce=d(674),ue=function(){function e(e){this.compObj=void 0,ce.RichTextEditor.Inject(ce.HtmlEditor,ce.MarkdownEditor,ce.Toolbar,ce.Link,ce.Image,ce.QuickToolbar,ce.Table,ce.FileManager,ce.PasteCleanup,ce.EmojiPicker,ce.Audio,ce.Video,ce.FormatPainter,ce.Count),this.parent=e,this.parent.rteModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new ce.RichTextEditor(this.parent.model),this.compObj.appendTo(e.target)},e.prototype.focus=function(){this.compObj.focusIn()},e.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&(this.parent.setProperties({value:this.getRteValue()},!0),this.parent.extendModelValue(this.compObj.value))},e.prototype.getRteValue=function(){var e;return"Markdown"===this.compObj.editorMode?""===(e=this.compObj.contentModule.getEditPanel().value)?"":e:"<p><br></p>"===(e=this.compObj.contentModule.getEditPanel().innerHTML)||"<p><br></p>"===e||""===e?"":e},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"rte"},e}(),me=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.sliderModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new ee.Slider(this.parent.model),this.compObj.appendTo(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),this.parent.extendModelValue(this.compObj.value))},e.prototype.refresh=function(){this.compObj.refresh()},e.prototype.destroy=function(){this.base.destroy()},e.prototype.getModuleName=function(){return"slider"},e}(),fe=function(){function e(e){this.compObj=void 0,this.parent=e,this.parent.timeModule=this,this.base=new se(this.parent,this)}return e.prototype.render=function(e){this.compObj=new X.TimePicker(this.parent.model),this.compObj.appendTo(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),this.parent.extendModelValue(this.compObj.value))},e.prototype.getModuleName=function(){return"time-picker"},e.prototype.destroy=function(){this.base.destroy()},e}()})(),h})());