/*
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 { GridColumnOptionsViewBase } from "./GridColumnOptionsViewBase";
import { Size } from "igniteui-webcomponents-core";
import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities";
import { runOn, delegateCombine, markType } from "igniteui-webcomponents-core";
import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase";
import { StringComparer } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let GridColumnMoveOptionsView = /*@__PURE__*/ (() => {
    class GridColumnMoveOptionsView extends GridColumnOptionsViewBase {
        constructor() {
            super(...arguments);
            this.q = null;
            this.v = null;
            this.w = null;
            this.o = null;
            this.p = null;
            this.r = null;
        }
        get n() {
            return this.b;
        }
        s() {
            let a = this.e;
            let b = a.createElement("div");
            let c = a.createElement("div");
            b.append(c);
            c.setStyleProperty("display", "flex");
            c.setStyleProperty("flexDirection", "row");
            c.setStyleProperty("flexWrap", "no-wrap");
            c.setStyleProperty("justify-content", "center");
            let d = ((() => { let e = this.u(true, this.v); this.v = e.p1; return e.ret; })());
            let e = ((() => { let f = this.u(false, this.w); this.w = f.p1; return f.ret; })());
            c.append(d);
            c.append(e);
            return b;
        }
        t() {
            let a = this.e.createElement("label");
            return a;
        }
        u(a, b) {
            let c = this.e;
            let d = this.n;
            let e = a ? GridColumnMoveOptionsView.x : GridColumnMoveOptionsView.y;
            let f;
            let g;
            let h;
            let i = ((() => { let j = GridColumnOptionsUtilities.g(c, e, 1, d.p, d.j, new Size(1, 18, 18), f, g, b, h, a, false); f = j.p6; g = j.p7; b = j.p8; h = j.p9; return j.ret; })());
            if (a) {
                this.o = f;
                f.clicked = delegateCombine(f.clicked, runOn(this, this.z));
            }
            else {
                this.p = f;
                f.clicked = delegateCombine(f.clicked, runOn(this, this.aa));
            }
            return {
                ret: i,
                p1: b
            };
        }
        k() {
            super.k();
            if (null == this.g || null == this.e) {
                return;
            }
            this.r = this.t();
            this.q = this.s();
            let a = this.g;
            a.setStyleProperty("display", "flex");
            a.setStyleProperty("flex-direction", "row");
            a.setStyleProperty("flex-wrap", "no-wrap");
            a.setStyleProperty("justify-content", "space-between");
            a.setStyleProperty("align-items", "center");
            a.append(this.r);
            a.append(this.q);
        }
        ab() {
            let a = this.n.b2();
            let b = this.n.b3();
            if (null != this.o) {
                this.o.disabled = !a;
            }
            if (null != this.p) {
                this.p.disabled = !b;
            }
        }
        m() {
            super.m();
            let a = this.n;
            if (null != this.r) {
                this.r.setRawText(a.bw);
                let b = a.bu;
                if (a.bu) {
                    this.g.setStyleProperty("display", "flex");
                    this.r.setStyleProperty("display", "inline-block");
                }
                else {
                    this.g.setStyleProperty("display", "block");
                    this.r.setStyleProperty("display", "none");
                }
                this.r.setStyleProperty("font", a.aa.fontString);
            }
            if (null != this.v) {
                this.v.setRawText(this.n.b5);
            }
            if (null != this.w) {
                this.w.setRawText(this.n.b9);
            }
            a.bf(this.o);
            a.bf(this.p);
        }
        z(a, b) {
            this.n.cd();
        }
        aa(a, b) {
            this.n.cf();
        }
    }
    GridColumnMoveOptionsView.$t = /*@__PURE__*/ markType(GridColumnMoveOptionsView, 'GridColumnMoveOptionsView', GridColumnOptionsViewBase.$);
    GridColumnMoveOptionsView.x = "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z";
    GridColumnMoveOptionsView.y = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z";
    return GridColumnMoveOptionsView;
})();
/**
 * @hidden
 */
export let GridColumnMoveOptions = /*@__PURE__*/ (() => {
    class GridColumnMoveOptions extends GridColumnOptionsSimpleSectionBase {
        constructor() {
            super();
            this.b4 = "Left";
            this.b8 = "Right";
        }
        f() {
            return new GridColumnMoveOptionsView();
        }
        get_by() {
            return "Move";
        }
        get by() {
            return this.get_by();
        }
        bq() {
            if (null == this.column) {
                return false;
            }
            let a = this.c;
            if (null == a) {
                return false;
            }
            switch (a.bh) {
                case 0: return true;
                case 1: return false;
                default: break;
            }
            return true;
        }
        a7(a, b) {
            super.a7(a, b);
            this.b0.ab();
        }
        a5() {
            super.a5();
            this.b0.ab();
        }
        a6(a, b) {
            super.a6(a, b);
            let c = this.column;
            if (null == c) {
                return;
            }
            switch (b.propertyName) {
                case "Pinned":
                    this.b0.ab();
                    break;
            }
        }
        bc(a, b, c) {
            super.bc(a, b, c);
            switch (a) {
                case "MoveLeftCaption":
                case "MoveRightCaption":
                    this.b0.m();
                    break;
            }
        }
        get b0() {
            return this.e;
        }
        get b5() {
            return this.b4;
        }
        set b5(a) {
            if (0 == StringComparer.b.compare(a, this.b4)) {
                return;
            }
            let b = this.b4;
            this.b4 = a;
            this.ba("MoveLeftCaption", b, this.b4);
        }
        get b9() {
            return this.b8;
        }
        set b9(a) {
            if (0 == StringComparer.b.compare(a, this.b8)) {
                return;
            }
            let b = this.b8;
            this.b8 = a;
            this.ba("MoveRightCaption", b, this.b8);
        }
        b1(a) {
            let b = this.column;
            if (null == b) {
                return false;
            }
            let c = b.grid;
            if (null == c) {
                return false;
            }
            let d = c.actualColumns;
            let e = d.indexOf(b);
            if (e < 0) {
                return false;
            }
            if (a) {
                return this.c.hf(e);
            }
            else {
                return this.c.hg(e);
            }
        }
        cc(a) {
            let b = this.column;
            if (null == b) {
                return;
            }
            let c = this.c;
            if (null == c) {
                return;
            }
            if (!this.b1(a)) {
                return;
            }
            let d = c.actualColumns;
            let e = d.indexOf(b);
            if (a) {
                c.rd(e);
            }
            else {
                c.re(e);
            }
        }
        b2() {
            return this.b1(true);
        }
        b3() {
            return this.b1(false);
        }
        cd() {
            this.cc(true);
        }
        cf() {
            this.cc(false);
        }
        ce(a, b) {
            this.cd();
        }
        cg(a, b) {
            this.cf();
        }
    }
    GridColumnMoveOptions.$t = /*@__PURE__*/ markType(GridColumnMoveOptions, 'GridColumnMoveOptions', GridColumnOptionsSimpleSectionBase.$);
    return GridColumnMoveOptions;
})();
//# sourceMappingURL=GridColumnMoveOptionsView_combined.js.map
