import { __decorate } from "tslib";
import { Component, Emit } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '../../../decorators';
import { EditorBase } from '../editor-base/editor-base';
// import { AppCodeEditor } from 'ibiz-plugin';
/**
 * 代码编辑器
 *
 * @export
 * @class TextboxEditor
 * @extends {EditorBase}
 */
let CodeEditor = class CodeEditor extends EditorBase {
    /**
     * 编辑器change事件
     *
     * @param {*} value
     * @memberof EditorBase
     */
    editorChange(value) { }
    /**
     * 编辑器change事件
     *
     * @param {*} value
     * @memberof TextboxEditor
     */
    handleChange($event) {
        this.editorChange({ name: this.editorInstance.name, value: $event });
    }
    /**
     * 编辑器enter事件
     *
     * @param {*} value
     * @memberof TextboxEditor
     */
    handleEnter($event) {
        this.$emit('enter', arguments);
    }
    /**
     * 绘制内容
     *
     * @returns {*}
     * @memberof TextboxEditor
     */
    render() {
        if (!this.editorIsLoaded) {
            return null;
        }
        return this.$createElement(this.editorComponentName, {
            props: Object.assign({ name: this.editorInstance.name, value: this.value, disabled: this.disabled, isSetLanguage: this.customProps.language ? true : false }, this.customProps),
            on: {
                change: this.handleChange,
                enter: this.handleEnter,
            },
            style: this.customStyle,
        });
    }
};
__decorate([
    Emit('change')
], CodeEditor.prototype, "editorChange", null);
CodeEditor = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], CodeEditor);
export default CodeEditor;
