/*
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 * as tslib_1 from "tslib";
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
 */
var GridColumnMoveOptionsView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnMoveOptionsView, _super);
    function GridColumnMoveOptionsView() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.q = null;
        _this.v = null;
        _this.w = null;
        _this.o = null;
        _this.p = null;
        _this.r = null;
        return _this;
    }
    Object.defineProperty(GridColumnMoveOptionsView.prototype, "n", {
        get: function () {
            return this.b;
        },
        enumerable: true,
        configurable: true
    });
    GridColumnMoveOptionsView.prototype.s = function () {
        var _this = this;
        var a = this.e;
        var b = a.createElement("div");
        var 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");
        var d = ((function () { var e = _this.u(true, _this.v); _this.v = e.p1; return e.ret; })());
        var e = ((function () { var f = _this.u(false, _this.w); _this.w = f.p1; return f.ret; })());
        c.append(d);
        c.append(e);
        return b;
    };
    GridColumnMoveOptionsView.prototype.t = function () {
        var a = this.e.createElement("label");
        return a;
    };
    GridColumnMoveOptionsView.prototype.u = function (a, b) {
        var c = this.e;
        var d = this.n;
        var e = a ? GridColumnMoveOptionsView.x : GridColumnMoveOptionsView.y;
        var f;
        var g;
        var h;
        var i = ((function () { var 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
        };
    };
    GridColumnMoveOptionsView.prototype.k = function () {
        _super.prototype.k.call(this);
        if (null == this.g || null == this.e) {
            return;
        }
        this.r = this.t();
        this.q = this.s();
        var 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);
    };
    GridColumnMoveOptionsView.prototype.ab = function () {
        var a = this.n.b2();
        var b = this.n.b3();
        if (null != this.o) {
            this.o.disabled = !a;
        }
        if (null != this.p) {
            this.p.disabled = !b;
        }
    };
    GridColumnMoveOptionsView.prototype.m = function () {
        _super.prototype.m.call(this);
        var a = this.n;
        if (null != this.r) {
            this.r.setRawText(a.bw);
            var 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);
    };
    GridColumnMoveOptionsView.prototype.z = function (a, b) {
        this.n.cd();
    };
    GridColumnMoveOptionsView.prototype.aa = function (a, b) {
        this.n.cf();
    };
    GridColumnMoveOptionsView.$t = 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;
}(GridColumnOptionsViewBase));
export { GridColumnMoveOptionsView };
/**
 * @hidden
 */
var GridColumnMoveOptions = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnMoveOptions, _super);
    function GridColumnMoveOptions() {
        var _this = _super.call(this) || this;
        _this.b4 = "Left";
        _this.b8 = "Right";
        return _this;
    }
    GridColumnMoveOptions.prototype.f = function () {
        return new GridColumnMoveOptionsView();
    };
    GridColumnMoveOptions.prototype.get_by = function () {
        return "Move";
    };
    Object.defineProperty(GridColumnMoveOptions.prototype, "by", {
        get: function () {
            return this.get_by();
        },
        enumerable: true,
        configurable: true
    });
    GridColumnMoveOptions.prototype.bq = function () {
        if (null == this.column) {
            return false;
        }
        var a = this.c;
        if (null == a) {
            return false;
        }
        switch (a.bh) {
            case 0: return true;
            case 1: return false;
            default: break;
        }
        return true;
    };
    GridColumnMoveOptions.prototype.a7 = function (a, b) {
        _super.prototype.a7.call(this, a, b);
        this.b0.ab();
    };
    GridColumnMoveOptions.prototype.a5 = function () {
        _super.prototype.a5.call(this);
        this.b0.ab();
    };
    GridColumnMoveOptions.prototype.a6 = function (a, b) {
        _super.prototype.a6.call(this, a, b);
        var c = this.column;
        if (null == c) {
            return;
        }
        switch (b.propertyName) {
            case "Pinned":
                this.b0.ab();
                break;
        }
    };
    GridColumnMoveOptions.prototype.bc = function (a, b, c) {
        _super.prototype.bc.call(this, a, b, c);
        switch (a) {
            case "MoveLeftCaption":
            case "MoveRightCaption":
                this.b0.m();
                break;
        }
    };
    Object.defineProperty(GridColumnMoveOptions.prototype, "b0", {
        get: function () {
            return this.e;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnMoveOptions.prototype, "b5", {
        get: function () {
            return this.b4;
        },
        set: function (a) {
            if (0 == StringComparer.b.compare(a, this.b4)) {
                return;
            }
            var b = this.b4;
            this.b4 = a;
            this.ba("MoveLeftCaption", b, this.b4);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnMoveOptions.prototype, "b9", {
        get: function () {
            return this.b8;
        },
        set: function (a) {
            if (0 == StringComparer.b.compare(a, this.b8)) {
                return;
            }
            var b = this.b8;
            this.b8 = a;
            this.ba("MoveRightCaption", b, this.b8);
        },
        enumerable: true,
        configurable: true
    });
    GridColumnMoveOptions.prototype.b1 = function (a) {
        var b = this.column;
        if (null == b) {
            return false;
        }
        var c = b.grid;
        if (null == c) {
            return false;
        }
        var d = c.actualColumns;
        var e = d.indexOf(b);
        if (e < 0) {
            return false;
        }
        if (a) {
            return this.c.hf(e);
        }
        else {
            return this.c.hg(e);
        }
    };
    GridColumnMoveOptions.prototype.cc = function (a) {
        var b = this.column;
        if (null == b) {
            return;
        }
        var c = this.c;
        if (null == c) {
            return;
        }
        if (!this.b1(a)) {
            return;
        }
        var d = c.actualColumns;
        var e = d.indexOf(b);
        if (a) {
            c.rd(e);
        }
        else {
            c.re(e);
        }
    };
    GridColumnMoveOptions.prototype.b2 = function () {
        return this.b1(true);
    };
    GridColumnMoveOptions.prototype.b3 = function () {
        return this.b1(false);
    };
    GridColumnMoveOptions.prototype.cd = function () {
        this.cc(true);
    };
    GridColumnMoveOptions.prototype.cf = function () {
        this.cc(false);
    };
    GridColumnMoveOptions.prototype.ce = function (a, b) {
        this.cd();
    };
    GridColumnMoveOptions.prototype.cg = function (a, b) {
        this.cf();
    };
    GridColumnMoveOptions.$t = markType(GridColumnMoveOptions, 'GridColumnMoveOptions', GridColumnOptionsSimpleSectionBase.$);
    return GridColumnMoveOptions;
}(GridColumnOptionsSimpleSectionBase));
export { GridColumnMoveOptions };
//# sourceMappingURL=GridColumnMoveOptionsView_combined.js.map
