/*
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 { Base, markType, fromEnum, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox, runOn, delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { SizeData } from "igniteui-webcomponents-core";
import { NativeUI } from "igniteui-webcomponents-core";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
import { BaseControlTheme_$type } from "igniteui-webcomponents-core";
import { Button } from "igniteui-webcomponents-inputs";
import { Icon } from "igniteui-webcomponents-inputs";
import { ButtonGroup } from "igniteui-webcomponents-inputs";
import { stringIsNullOrEmpty } from "igniteui-webcomponents-core";
import { stringFormat } from "igniteui-webcomponents-core";
import { FontInfo } from "igniteui-webcomponents-core";
import { SRProvider } from "igniteui-webcomponents-core";
import { BrushUtil } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var GridColumnOptionsViewBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnOptionsViewBase, _super);
    function GridColumnOptionsViewBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.d = null;
        _this.f = null;
        _this.a = null;
        return _this;
    }
    Object.defineProperty(GridColumnOptionsViewBase.prototype, "g", {
        get: function () {
            return this.f;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsViewBase.prototype, "b", {
        get: function () {
            return this.a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsViewBase.prototype, "e", {
        get: function () {
            return this.d;
        },
        enumerable: true,
        configurable: true
    });
    GridColumnOptionsViewBase.prototype.c = function () {
        var a = this.f.outerWidth();
        var b = this.f.outerHeight();
        var c = new SizeData(a, b);
        return c;
    };
    GridColumnOptionsViewBase.prototype.k = function () {
    };
    GridColumnOptionsViewBase.prototype.m = function () {
        var a = this.g;
        if (null != a) {
            NativeUI.j(a, this.b.bm);
            NativeUI.n(a, this.b.bp);
        }
    };
    GridColumnOptionsViewBase.prototype.l = function (a) {
        if (a == null) {
            this.d = null;
            this.f = null;
            this.k();
            return;
        }
        this.d = a;
        var b = this.d.rootWrapper;
        this.h(b);
    };
    GridColumnOptionsViewBase.prototype.h = function (a) {
        this.f = a;
        this.k();
        this.m();
    };
    GridColumnOptionsViewBase.prototype.i = function (a) {
        this.a = a;
    };
    GridColumnOptionsViewBase.prototype.j = function () {
    };
    GridColumnOptionsViewBase.$t = markType(GridColumnOptionsViewBase, 'GridColumnOptionsViewBase');
    return GridColumnOptionsViewBase;
}(Base));
export { GridColumnOptionsViewBase };
/**
 * @hidden
 */
var GridColumnOptionsUtilities = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnOptionsUtilities, _super);
    function GridColumnOptionsUtilities() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    GridColumnOptionsUtilities.d = function (a, b, c, d, e, f, g) {
        if (g === void 0) {
            g = false;
        }
        var h = a.createElement("label");
        e = a.createElement("input");
        e.setAttribute("type", "checkbox");
        if (!stringIsNullOrEmpty(b)) {
            e.setAttribute("id", b);
        }
        if (!stringIsNullOrEmpty(d)) {
            e.setAttribute("AccessKey", d);
        }
        f = a.createElement("text");
        f.setRawText(c);
        if (g) {
            h.append(f);
            h.append(e);
        }
        else {
            h.append(e);
            h.append(f);
        }
        return {
            ret: h,
            p4: e,
            p5: f
        };
    };
    GridColumnOptionsUtilities.e = function (a, b, c, d, e, f) {
        var g = a.createElement("label");
        f = a.createElement("input");
        f.setAttribute("name", c);
        f.setAttribute("type", "radio");
        f.setAttribute("id", b);
        g.append(f);
        var h = a.createElement("text");
        h.setRawText(d);
        f.setAttribute("AccessKey", e);
        g.append(h);
        return {
            ret: g,
            p5: f
        };
    };
    GridColumnOptionsUtilities.f = function (a, b, c, d, e, f, g, h, i, j) {
        if (i === void 0) {
            i = true;
        }
        if (j === void 0) {
            j = false;
        }
        var k;
        return {
            ret: ((function () { var l = GridColumnOptionsUtilities.g(a, b, 0, c, d, e, f, g, h, k, i, j); f = l.p6; g = l.p7; h = l.p8; k = l.p9; return l.ret; })()),
            p5: f,
            p6: g,
            p7: h
        };
    };
    GridColumnOptionsUtilities.g = function (a, b, c, d, e, f, g, h, i, j, k, l, m) {
        if (k === void 0) {
            k = true;
        }
        if (l === void 0) {
            l = false;
        }
        if (m === void 0) {
            m = true;
        }
        var n = a.createElement("div");
        var o = a.getSubRenderer(n);
        g = new Button();
        g.provideContainer(o);
        g.s = c;
        g.h = d;
        g.d = e;
        var p = null != b;
        j = null;
        if (p) {
            j = a.createElement("div");
            j.setStyleProperty("display", "inline-block");
            h = new Icon();
            var q = a.getSubRenderer(j);
            h.provideContainer(q);
            h.svgPath = b;
            j.setStyleProperty("width", stringFormat("{0}px", f.width.toString()));
            j.setStyleProperty("height", stringFormat("{0}px", f.height.toString()));
            if (m) {
                if (k) {
                    j.setStyleProperty("margin-right", "7px");
                }
                else {
                    j.setStyleProperty("margin-left", "7px");
                }
            }
        }
        else {
            h = null;
        }
        i = o.createElement("label");
        i.setStyleProperty("display", "inline-block");
        i.setStyleProperty("margin", "0px");
        var r = a.createElement("div");
        r.setStyleProperty("display", "flex");
        r.setStyleProperty("flex-direction", "row");
        r.setStyleProperty("flex-wrap", "no-wrap");
        r.setStyleProperty("align-items", "center");
        if (k) {
            if (p) {
                r.append(j);
            }
            r.append(i);
        }
        else {
            r.append(i);
            if (p) {
                r.append(j);
            }
        }
        if (l) {
            r.setStyleProperty("justify-content", "space-between");
            g.hg = "1";
            n.setStyleProperty("display", "flex");
            n.setStyleProperty("flex-direction", "column");
            n.setStyleProperty("align-items", "stretch");
            g.gb = "flex";
            g.he = "column";
            g.fv = "stretch";
        }
        g.appendButtonContent(r);
        return {
            ret: n,
            p6: g,
            p7: h,
            p8: i,
            p9: j
        };
    };
    GridColumnOptionsUtilities.h = function (a, b, c, d, e, f) {
        var e_1, _a, e_2, _b;
        var g = a.createElement("div");
        var h = a.getSubRenderer(g);
        f = new ButtonGroup();
        f.k = d;
        f.g = e;
        f.provideContainer(h);
        f.p = 0;
        try {
            for (var _c = tslib_1.__values(fromEnum(b)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var i = _d.value;
                f.buttons.add(i);
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        var j = g.getChildAt(0);
        try {
            for (var _e = tslib_1.__values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var k = _f.value;
                j.append(k);
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
        return {
            ret: g,
            p5: f
        };
    };
    GridColumnOptionsUtilities.b = function (a) {
        var b = a.getNativeElement();
        return b.checked;
    };
    GridColumnOptionsUtilities.i = function (a, b) {
        var c = a.getNativeElement();
        c.checked = b;
    };
    GridColumnOptionsUtilities.a = function (a) {
        switch (a) {
            case 0: return 1;
            case 1: return 2;
            default: return 1;
        }
    };
    GridColumnOptionsUtilities.c = function (a) {
        switch (a) {
            case 1: return 0;
            case 2: return 1;
            case 0:
            default: return 0;
        }
    };
    GridColumnOptionsUtilities.j = function (a, b, c) {
        if (c === void 0) {
            c = "block";
        }
        var d = b ? c : "none";
        a.setStyleProperty("display", d);
    };
    GridColumnOptionsUtilities.l = function (a, b) {
        if (null != a) {
            a.d = b.i;
            a.h = b.p;
            a.v = b.z;
        }
    };
    GridColumnOptionsUtilities.k = function (a, b) {
        if (null != a) {
            a.g = b.i;
            a.k = b.p;
        }
    };
    GridColumnOptionsUtilities.$t = markType(GridColumnOptionsUtilities, 'GridColumnOptionsUtilities');
    return GridColumnOptionsUtilities;
}(Base));
export { GridColumnOptionsUtilities };
/**
 * @hidden
 */
var GridColumnOptionsBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(GridColumnOptionsBase, _super);
    function GridColumnOptionsBase() {
        var _this = _super.call(this) || this;
        _this.d = null;
        _this.propertyChanged = null;
        _this.ac = null;
        _this.ae = null;
        _this.e = null;
        _this.ah = null;
        _this.aj = false;
        _this.bk = GridColumnOptionsBase.bn;
        _this.h = 0;
        _this.g = 1;
        _this.n = 0;
        _this.l = 0;
        _this.x = null;
        _this.v = null;
        _this.a = null;
        _this.o = 0;
        _this.m = 2;
        _this.y = null;
        _this.w = null;
        _this.bl = GridColumnOptionsBase.bo;
        var a = _this.f();
        _this.e = a;
        _this.onViewInitialized();
        a.i(_this);
        return _this;
    }
    GridColumnOptionsBase.prototype.ba = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        this.bc(a, b, c);
    };
    Object.defineProperty(GridColumnOptionsBase.prototype, "ad", {
        get: function () {
            if (null == this.ac) {
                this.ac = new FontInfo();
                this.ac.n = "'Segoe UI', Verdana";
                this.ac.d = 12;
            }
            return this.ac;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "af", {
        get: function () {
            if (null == this.ae) {
                this.ae = new FontInfo();
                this.ae.n = "'Segoe UI', Verdana";
                this.ae.d = 14;
            }
            return this.ae;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "ai", {
        get: function () {
            if (this.ah == null) {
                this.ah = new SRProvider(this.e.e);
                this.ah.cb("DataGrid");
            }
            return this.ah;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "ak", {
        get: function () {
            return this.aj;
        },
        set: function (a) {
            var b = this.aj;
            this.aj = a;
            if (b != this.aj) {
                this.ba("AutoSize", b, this.aj);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "bm", {
        get: function () {
            return this.bk;
        },
        set: function (a) {
            var b = this.bk;
            this.bk = a;
            if (b != this.bk) {
                this.ba("BackgroundColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "j", {
        get: function () {
            return this.h;
        },
        set: function (a) {
            var b = this.h;
            this.h = a;
            if (b != this.h) {
                this.ba("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "i", {
        get: function () {
            return this.g;
        },
        set: function (a) {
            var b = this.g;
            this.g = a;
            if (b != this.g) {
                this.ba("ActualBaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "buttonDensity", {
        get: function () {
            return this.n;
        },
        set: function (a) {
            var b = this.n;
            this.n = a;
            if (b != this.n) {
                this.ba("ButtonDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "p", {
        get: function () {
            return this.l;
        },
        set: function (a) {
            var b = this.l;
            this.l = a;
            if (b != this.l) {
                this.ba("ActualButtonDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "ab", {
        get: function () {
            return this.x;
        },
        set: function (a) {
            var b = this.x;
            this.x = a;
            if (b != this.x) {
                this.ba("ButtonTextStyle", b, this.x);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "z", {
        get: function () {
            return this.v;
        },
        set: function (a) {
            var b = this.v;
            this.v = a;
            if (this.v != b) {
                this.ba("ActualButtonTextStyle", b, this.v);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "column", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            if (b != a) {
                this.a3(false);
                this.a = a;
                this.ba("Column", b, this.a);
                this.a3(true);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "density", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            if (b != this.o) {
                this.ba("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "q", {
        get: function () {
            return this.m;
        },
        set: function (a) {
            var b = this.m;
            this.m = a;
            if (b != this.m) {
                this.ba("ActualDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "ag", {
        get: function () {
            return this.y;
        },
        set: function (a) {
            var b = this.y;
            this.y = a;
            if (b != this.y) {
                this.ba("LabelTextStyle", b, this.y);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "aa", {
        get: function () {
            return this.w;
        },
        set: function (a) {
            var b = this.w;
            this.w = a;
            if (this.w != b) {
                this.ba("ActualLabelTextStyle", b, this.w);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "c", {
        get: function () {
            var a = this.column;
            if (null == a) {
                return null;
            }
            return a.grid;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GridColumnOptionsBase.prototype, "bp", {
        get: function () {
            return this.bl;
        },
        set: function (a) {
            var b = this.bl;
            this.bl = a;
            if (b != this.bl) {
                this.ba("TextColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    GridColumnOptionsBase.prototype.a5 = function () {
        this.bi(this.d, this.c);
        this.e.m();
    };
    GridColumnOptionsBase.prototype.a6 = function (a, b) {
        var c = this.column;
        if (null == c) {
            return;
        }
    };
    GridColumnOptionsBase.prototype.a7 = function (a, b) {
    };
    GridColumnOptionsBase.prototype.a8 = function (a, b) {
    };
    GridColumnOptionsBase.prototype.a9 = function (a, b) {
    };
    GridColumnOptionsBase.prototype.onViewInitialized = function () {
    };
    GridColumnOptionsBase.prototype.bc = function (a, b, c) {
        switch (a) {
            case "Column":
                this.a5();
                break;
            case "LabelTextStyle":
                this.bj();
                break;
            case "ButtonTextStyle":
                this.bg();
                break;
            case "BackgroundColor":
            case "TextColor":
                this.e.m();
                break;
            case "ButtonDensity":
            case "Density":
                this.q = this.density == 0 ? 2 : this.density;
                this.p = this.buttonDensity == 0 ? this.q : this.buttonDensity;
                break;
            case "BaseTheme":
                this.i = this.j == 0 ? 1 : this.j;
                break;
        }
    };
    GridColumnOptionsBase.prototype.bg = function () {
        this.z = (null == this.ab) ? this.ad : this.ab;
    };
    GridColumnOptionsBase.prototype.bi = function (a, b) {
        if (a != b) {
            this.bh(a, b);
        }
    };
    GridColumnOptionsBase.prototype.bh = function (a, b) {
        if (null != a) {
            this.a4(a, false);
        }
        if (null != b) {
            this.a4(b, true);
        }
        this.d = b;
    };
    GridColumnOptionsBase.prototype.bj = function () {
        this.aa = (null == this.ag) ? this.af : this.ag;
    };
    GridColumnOptionsBase.prototype.a3 = function (a) {
        var b = this.column;
        if (null == b) {
            return;
        }
        if (a) {
            b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.a6));
        }
        else {
            b.propertyChanged = delegateRemove(b.propertyChanged, runOn(this, this.a6));
        }
    };
    GridColumnOptionsBase.prototype.a4 = function (a, b) {
        if (b) {
            a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.a9));
            var c = a.actualColumns;
            c.collectionChanged = delegateCombine(c.collectionChanged, runOn(this, this.a7));
            a.a8.l(runOn(this, this.a8));
        }
        else {
            a.propertyChanged = delegateRemove(a.propertyChanged, runOn(this, this.a9));
            var d = a.actualColumns;
            d.collectionChanged = delegateRemove(d.collectionChanged, runOn(this, this.a7));
            a.a8.o(runOn(this, this.a8));
        }
    };
    GridColumnOptionsBase.prototype.bf = function (a) {
        GridColumnOptionsUtilities.l(a, this);
    };
    GridColumnOptionsBase.prototype.be = function (a) {
        GridColumnOptionsUtilities.k(a, this);
    };
    GridColumnOptionsBase.prototype.destroy = function () {
        this.provideRenderer(null);
    };
    GridColumnOptionsBase.prototype.provideRenderer = function (a) {
        this.e.l(a);
    };
    GridColumnOptionsBase.$t = markType(GridColumnOptionsBase, 'GridColumnOptionsBase', Base.$, [INotifyPropertyChanged_$type]);
    GridColumnOptionsBase.bn = BrushUtil.g(255, 248, 248, 248);
    GridColumnOptionsBase.bo = BrushUtil.g(255, 24, 29, 31);
    return GridColumnOptionsBase;
}(Base));
export { GridColumnOptionsBase };
//# sourceMappingURL=GridColumnOptionsViewBase_combined.js.map
