/*
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, 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
 */
export let GridColumnOptionsViewBase = /*@__PURE__*/ (() => {
    class GridColumnOptionsViewBase extends Base {
        constructor() {
            super(...arguments);
            this.d = null;
            this.f = null;
            this.a = null;
        }
        get g() {
            return this.f;
        }
        get b() {
            return this.a;
        }
        get e() {
            return this.d;
        }
        c() {
            let a = this.f.outerWidth();
            let b = this.f.outerHeight();
            let c = new SizeData(a, b);
            return c;
        }
        k() {
        }
        m() {
            let a = this.g;
            if (null != a) {
                NativeUI.j(a, this.b.bm);
                NativeUI.n(a, this.b.bp);
            }
        }
        l(a) {
            if (a == null) {
                this.d = null;
                this.f = null;
                this.k();
                return;
            }
            this.d = a;
            let b = this.d.rootWrapper;
            this.h(b);
        }
        h(a) {
            this.f = a;
            this.k();
            this.m();
        }
        i(a) {
            this.a = a;
        }
        j() {
        }
    }
    GridColumnOptionsViewBase.$t = /*@__PURE__*/ markType(GridColumnOptionsViewBase, 'GridColumnOptionsViewBase');
    return GridColumnOptionsViewBase;
})();
/**
 * @hidden
 */
export let GridColumnOptionsUtilities = /*@__PURE__*/ (() => {
    class GridColumnOptionsUtilities extends Base {
        static d(a, b, c, d, e, f, g = false) {
            let 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
            };
        }
        static e(a, b, c, d, e, f) {
            let g = a.createElement("label");
            f = a.createElement("input");
            f.setAttribute("name", c);
            f.setAttribute("type", "radio");
            f.setAttribute("id", b);
            g.append(f);
            let h = a.createElement("text");
            h.setRawText(d);
            f.setAttribute("AccessKey", e);
            g.append(h);
            return {
                ret: g,
                p5: f
            };
        }
        static f(a, b, c, d, e, f, g, h, i = true, j = false) {
            let k;
            return {
                ret: ((() => { let 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
            };
        }
        static g(a, b, c, d, e, f, g, h, i, j, k = true, l = false, m = true) {
            let n = a.createElement("div");
            let o = a.getSubRenderer(n);
            g = new Button();
            g.provideContainer(o);
            g.s = c;
            g.h = d;
            g.d = e;
            let p = null != b;
            j = null;
            if (p) {
                j = a.createElement("div");
                j.setStyleProperty("display", "inline-block");
                h = new Icon();
                let 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");
            let 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
            };
        }
        static h(a, b, c, d, e, f) {
            let g = a.createElement("div");
            let h = a.getSubRenderer(g);
            f = new ButtonGroup();
            f.k = d;
            f.g = e;
            f.provideContainer(h);
            f.p = 0;
            for (let i of fromEnum(b)) {
                f.buttons.add(i);
            }
            let j = g.getChildAt(0);
            for (let k of fromEnum(c)) {
                j.append(k);
            }
            return {
                ret: g,
                p5: f
            };
        }
        static b(a) {
            let b = a.getNativeElement();
            return b.checked;
        }
        static i(a, b) {
            let c = a.getNativeElement();
            c.checked = b;
        }
        static a(a) {
            switch (a) {
                case 0: return 1;
                case 1: return 2;
                default: return 1;
            }
        }
        static c(a) {
            switch (a) {
                case 1: return 0;
                case 2: return 1;
                case 0:
                default: return 0;
            }
        }
        static j(a, b, c = "block") {
            let d = b ? c : "none";
            a.setStyleProperty("display", d);
        }
        static l(a, b) {
            if (null != a) {
                a.d = b.i;
                a.h = b.p;
                a.v = b.z;
            }
        }
        static k(a, b) {
            if (null != a) {
                a.g = b.i;
                a.k = b.p;
            }
        }
    }
    GridColumnOptionsUtilities.$t = /*@__PURE__*/ markType(GridColumnOptionsUtilities, 'GridColumnOptionsUtilities');
    return GridColumnOptionsUtilities;
})();
/**
 * @hidden
 */
export let GridColumnOptionsBase = /*@__PURE__*/ (() => {
    class GridColumnOptionsBase extends Base {
        constructor() {
            super();
            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;
            let a = this.f();
            this.e = a;
            this.onViewInitialized();
            a.i(this);
        }
        ba(a, b, c) {
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
            this.bc(a, b, c);
        }
        get ad() {
            if (null == this.ac) {
                this.ac = new FontInfo();
                this.ac.n = "'Segoe UI', Verdana";
                this.ac.d = 12;
            }
            return this.ac;
        }
        get af() {
            if (null == this.ae) {
                this.ae = new FontInfo();
                this.ae.n = "'Segoe UI', Verdana";
                this.ae.d = 14;
            }
            return this.ae;
        }
        get ai() {
            if (this.ah == null) {
                this.ah = new SRProvider(this.e.e);
                this.ah.cb("DataGrid");
            }
            return this.ah;
        }
        get ak() {
            return this.aj;
        }
        set ak(a) {
            let b = this.aj;
            this.aj = a;
            if (b != this.aj) {
                this.ba("AutoSize", b, this.aj);
            }
        }
        get bm() {
            return this.bk;
        }
        set bm(a) {
            let b = this.bk;
            this.bk = a;
            if (b != this.bk) {
                this.ba("BackgroundColor", b, a);
            }
        }
        get j() {
            return this.h;
        }
        set j(a) {
            let b = this.h;
            this.h = a;
            if (b != this.h) {
                this.ba("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        }
        get i() {
            return this.g;
        }
        set i(a) {
            let b = this.g;
            this.g = a;
            if (b != this.g) {
                this.ba("ActualBaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, a));
            }
        }
        get buttonDensity() {
            return this.n;
        }
        set buttonDensity(a) {
            let b = this.n;
            this.n = a;
            if (b != this.n) {
                this.ba("ButtonDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get p() {
            return this.l;
        }
        set p(a) {
            let b = this.l;
            this.l = a;
            if (b != this.l) {
                this.ba("ActualButtonDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get ab() {
            return this.x;
        }
        set ab(a) {
            let b = this.x;
            this.x = a;
            if (b != this.x) {
                this.ba("ButtonTextStyle", b, this.x);
            }
        }
        get z() {
            return this.v;
        }
        set z(a) {
            let b = this.v;
            this.v = a;
            if (this.v != b) {
                this.ba("ActualButtonTextStyle", b, this.v);
            }
        }
        get column() {
            return this.a;
        }
        set column(a) {
            let b = this.a;
            if (b != a) {
                this.a3(false);
                this.a = a;
                this.ba("Column", b, this.a);
                this.a3(true);
            }
        }
        get density() {
            return this.o;
        }
        set density(a) {
            let b = this.o;
            this.o = a;
            if (b != this.o) {
                this.ba("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get q() {
            return this.m;
        }
        set q(a) {
            let b = this.m;
            this.m = a;
            if (b != this.m) {
                this.ba("ActualDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a));
            }
        }
        get ag() {
            return this.y;
        }
        set ag(a) {
            let b = this.y;
            this.y = a;
            if (b != this.y) {
                this.ba("LabelTextStyle", b, this.y);
            }
        }
        get aa() {
            return this.w;
        }
        set aa(a) {
            let b = this.w;
            this.w = a;
            if (this.w != b) {
                this.ba("ActualLabelTextStyle", b, this.w);
            }
        }
        get c() {
            let a = this.column;
            if (null == a) {
                return null;
            }
            return a.grid;
        }
        get bp() {
            return this.bl;
        }
        set bp(a) {
            let b = this.bl;
            this.bl = a;
            if (b != this.bl) {
                this.ba("TextColor", b, a);
            }
        }
        a5() {
            this.bi(this.d, this.c);
            this.e.m();
        }
        a6(a, b) {
            let c = this.column;
            if (null == c) {
                return;
            }
        }
        a7(a, b) {
        }
        a8(a, b) {
        }
        a9(a, b) {
        }
        onViewInitialized() {
        }
        bc(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;
            }
        }
        bg() {
            this.z = (null == this.ab) ? this.ad : this.ab;
        }
        bi(a, b) {
            if (a != b) {
                this.bh(a, b);
            }
        }
        bh(a, b) {
            if (null != a) {
                this.a4(a, false);
            }
            if (null != b) {
                this.a4(b, true);
            }
            this.d = b;
        }
        bj() {
            this.aa = (null == this.ag) ? this.af : this.ag;
        }
        a3(a) {
            let 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));
            }
        }
        a4(a, b) {
            if (b) {
                a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.a9));
                let 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));
                let d = a.actualColumns;
                d.collectionChanged = delegateRemove(d.collectionChanged, runOn(this, this.a7));
                a.a8.o(runOn(this, this.a8));
            }
        }
        bf(a) {
            GridColumnOptionsUtilities.l(a, this);
        }
        be(a) {
            GridColumnOptionsUtilities.k(a, this);
        }
        destroy() {
            this.provideRenderer(null);
        }
        provideRenderer(a) {
            this.e.l(a);
        }
    }
    GridColumnOptionsBase.$t = /*@__PURE__*/ markType(GridColumnOptionsBase, 'GridColumnOptionsBase', Base.$, [INotifyPropertyChanged_$type]);
    GridColumnOptionsBase.bn = /*@__PURE__*/ BrushUtil.g(255, 248, 248, 248);
    GridColumnOptionsBase.bo = /*@__PURE__*/ BrushUtil.g(255, 24, 29, 31);
    return GridColumnOptionsBase;
})();
//# sourceMappingURL=GridColumnOptionsViewBase_combined.js.map
