/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, markType } from "igniteui-webcomponents-core";
import { IEditorView_$type } from "./IEditorView";
/**
 * @hidden
 */
export let BaseEditorView = /*@__PURE__*/ (() => {
    class BaseEditorView extends Base {
        constructor(a, b) {
            super();
            this.c = false;
            this.f = null;
            this.b = null;
            this.e = null;
            this._container = null;
            this.d = false;
            this.valueProvided = null;
            this.userTyping = null;
            this.lostFocus = null;
            this.gotFocus = null;
            this.a = null;
            this.e = a;
            this.a = b;
        }
        get container() {
            return this._container;
        }
        set container(a) {
            this._container = a;
        }
        get value() {
            return this.f;
        }
        set value(a) {
            let b = this.f;
            this.f = a;
            if (b != this.f) {
                this.n("Value", b, this.f);
            }
        }
        k(a, b) {
            if (this.valueProvided != null) {
                this.valueProvided(this, a, b);
            }
        }
        j() {
            if (this.userTyping != null) {
                this.userTyping(this);
            }
        }
        i() {
            if (this.lostFocus != null) {
                this.lostFocus(this);
            }
        }
        h() {
            if (this.gotFocus != null) {
                this.gotFocus(this);
            }
        }
        setFont(a) {
        }
        attachEvents() {
        }
        detachEvents() {
        }
        onTargetChanged() {
        }
        onEditEnded() {
            this.d = false;
        }
        onEditStarted() {
            this.d = true;
        }
        cleanUp() {
            this.f = null;
            this.d = false;
        }
        focus() {
            if (this.c) {
                return;
            }
            if (this.b == null) {
                this.b = this.e.getRequestAnimationFrame();
            }
            this.b(() => {
                this.l();
                this.c = false;
            });
            this.c = true;
        }
        l() {
        }
        n(a, b, c) {
            switch (a) {
                case "Value":
                    this.o();
                    break;
            }
        }
        o() {
        }
        onInputKeyDown(a, b) {
            if (!this.d) {
                let c = b.keyCode;
                switch (c) {
                    case 37:
                    case 39:
                    case 38:
                    case 40:
                    case 32:
                        b.preventDefault();
                        break;
                }
            }
            else {
                let d = b.keyCode;
                switch (d) {
                    case 37:
                    case 39:
                    case 38:
                    case 40:
                    case 32:
                        b.stopPropagation();
                        break;
                }
            }
        }
    }
    BaseEditorView.$t = /*@__PURE__*/ markType(BaseEditorView, 'BaseEditorView', Base.$, [IEditorView_$type]);
    return BaseEditorView;
})();
//# sourceMappingURL=BaseEditorView.js.map
