define(["require", "exports", "@syncfusion/ej2-richtexteditor", "@syncfusion/ej2-richtexteditor", "./base-module"], function (require, exports, ej2_richtexteditor_1, ej2_richtexteditor_2, base_module_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Rte = (function () {
function Rte(parent) {
this.compObj = undefined;
ej2_richtexteditor_1.RichTextEditor.Inject(ej2_richtexteditor_1.HtmlEditor, ej2_richtexteditor_2.MarkdownEditor, ej2_richtexteditor_2.Toolbar, ej2_richtexteditor_2.Link, ej2_richtexteditor_2.Image, ej2_richtexteditor_2.QuickToolbar, ej2_richtexteditor_2.Table, ej2_richtexteditor_2.FileManager, ej2_richtexteditor_2.PasteCleanup, ej2_richtexteditor_2.EmojiPicker, ej2_richtexteditor_2.Audio, ej2_richtexteditor_2.Video, ej2_richtexteditor_2.FormatPainter, ej2_richtexteditor_2.Count);
this.parent = parent;
this.parent.rteModule = this;
this.base = new base_module_1.Base(this.parent, this);
}
Rte.prototype.render = function (e) {
this.compObj = new ej2_richtexteditor_1.RichTextEditor(this.parent.model);
this.compObj.appendTo(e.target);
};
Rte.prototype.focus = function () {
this.compObj.focusIn();
};
Rte.prototype.updateValue = function (e) {
if (this.compObj && e.type === 'RTE') {
this.parent.setProperties({ value: this.getRteValue() }, true);
this.parent.extendModelValue(this.compObj.value);
}
};
Rte.prototype.getRteValue = function () {
var rteVal;
if (this.compObj.editorMode === 'Markdown') {
rteVal = this.compObj.contentModule.getEditPanel().value;
return (rteVal === '') ? '' : rteVal;
}
else {
rteVal = this.compObj.contentModule.getEditPanel().innerHTML;
return (rteVal === '<p><br></p>' || rteVal === '<p><br></p>' || rteVal === '') ? '' : rteVal;
}
};
Rte.prototype.refresh = function () {
this.compObj.refresh();
};
Rte.prototype.destroy = function () {
this.base.destroy();
};
Rte.prototype.getModuleName = function () {
return 'rte';
};
return Rte;
}());
exports.Rte = Rte;
});
|