let Jade = window["Jade"];
export class EditorBase extends Jade.UI.Control {
    constructor(options) {
        super(options);
    }
    get focusCallback() {
        return this.state.get("focus", () => { });
    }
    focus() {
        this.focusCallback();
    }
    onValidationErrors() {
    }
}
export class EditorBaseOf extends EditorBase {
    constructor(options) {
        super(options);
        this.m_source = options.source;
        this.state.unset("source", { silent: true });
        this.onCreated();
    }
    get source() {
        return this.m_source;
    }
    get feature() {
        return this.source.feature;
    }
    get featureGroup() {
        return this.feature.parent;
    }
    get featureSet() {
        return this.featureGroup.parent;
    }
    get globals() {
        return this.source.root.context.globals;
    }
    get locals() {
        return this.featureGroup.locals;
    }
    onCreated() {
    }
}
