/*
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, runOn, delegateCombine, fromEnum, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateRemove, enumGetBox } from "igniteui-webcomponents-core";
import { DomWrapper_$type } from "igniteui-webcomponents-core";
import { Dictionary$2 } from "igniteui-webcomponents-core";
import { Checkbox } from "igniteui-webcomponents-inputs";
import { Prefix } from "igniteui-webcomponents-inputs";
import { InputGroup } from "igniteui-webcomponents-inputs";
import { Icon } from "igniteui-webcomponents-inputs";
import { Input } from "igniteui-webcomponents-inputs";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
import { NativeUI } from "igniteui-webcomponents-core";
import { PrimaryKeyValue } from "./PrimaryKeyValue";
import { Thickness } from "igniteui-webcomponents-core";
import { CheckboxListIndexType_$type } from "./CheckboxListIndexType";
import { SRProvider } from "igniteui-webcomponents-core";
import { GridSelectedKeysCollection } from "./GridSelectedKeysCollection";
import { InputGroupDisplayType_$type } from "igniteui-webcomponents-inputs";
import { BaseControlTheme_$type } from "igniteui-webcomponents-core";
import { FilterFactory } from "igniteui-webcomponents-core";
import { CheckedChangedEventArgs } from "./CheckedChangedEventArgs";
import { TemplateColumn } from "./TemplateColumn";
import { DataSourceSchemaPropertyType_$type } from "igniteui-webcomponents-core";
import { FastReflectionHelper } from "igniteui-webcomponents-core";
import { ColumnWidth } from "./ColumnWidth";
import { DateTimeColumn } from "./DateTimeColumn";
import { NumericColumn } from "./NumericColumn";
import { TextColumn } from "./TextColumn";
import { ArgumentException } from "igniteui-webcomponents-core";
import { SelectAllCheckboxChangedEventArgs } from "./SelectAllCheckboxChangedEventArgs";
import { BrushUtil } from "igniteui-webcomponents-core";
import { stringIsNullOrWhiteSpace } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var CheckboxListView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CheckboxListView, _super);
    function CheckboxListView() {
        var _this = _super.call(this) || this;
        _this.d = new Dictionary$2(DomWrapper_$type, Checkbox.$, 0);
        _this.i = null;
        _this.a = null;
        _this.h = null;
        _this.g = null;
        _this.b = null;
        _this.e = null;
        _this.c = false;
        _this.f = null;
        return _this;
    }
    CheckboxListView.prototype.m = function () {
    };
    CheckboxListView.prototype.l = function (a) {
        if (a == null) {
            this.e = null;
            this.d.clear();
            return;
        }
        this.e = a;
        this.u();
        this.aa();
        this.ad();
        this.r();
        var b = Math.round(a.rootWrapper.width());
        var c = Math.round(a.rootWrapper.height());
        this.e.rootWrapper.setStyleProperty("position", "relative");
        this.e.rootWrapper.setStyleProperty("padding-bottom", "4px");
    };
    CheckboxListView.prototype.u = function () {
        if (this.e != null) {
            this.v(this.e);
        }
    };
    CheckboxListView.prototype.v = function (a) {
        var b = a.rootWrapper.getChildAt(0);
        this.g = b;
        this.b.v = new InputGroup();
        var c = a.getSubRenderer(b);
        this.b.v.provideContainer(c);
        this.b.v.k = this.b.x;
        this.b.v.d = this.b.l;
        this.b.v.h = this.b.n;
        var d = a.createElement("div");
        var e = a.getSubRenderer(d);
        var f = new Prefix();
        f.provideContainer(e);
        var g = a.createElement("div");
        var h = a.getSubRenderer(g);
        var i = new Icon();
        i.provideContainer(h);
        i.fill = CheckboxList.cv;
        i.svgPath = CheckboxList.be;
        f.appendContentChild(g);
        this.b.v.appendContentChild(d);
        this.b.v.inputs.add(f);
        var j = a.createElement("div");
        j.setRawStyleProperty("flex-grow", "1");
        var k = a.getSubRenderer(j);
        this.b.t = new Input();
        this.b.t.provideContainer(k);
        this.b.t.b1 = "text";
        if (this.b.a6 != null) {
            this.b.t.b8 = this.b.a6;
        }
        this.b.v.appendContentChild(j);
        this.b.v.inputs.add(this.b.t);
        this.b.b3();
    };
    CheckboxListView.prototype.r = function () {
        if (this.e != null) {
            var a = this.e.rootWrapper.getChildAt(3);
            a.setStyleProperty("width", "100%");
            a.setStyleProperty("margin", "4px 0px 0px 0px");
            if (this.b.ao == false) {
                a.setStyleProperty("height", "calc(100% - 50px");
            }
            else {
                a.setStyleProperty("height", "calc(100% - 75px");
            }
            if (!this.b.am && !this.b.ao) {
                a.setStyleProperty("height", "100%");
            }
        }
    };
    CheckboxListView.prototype.n = function (a, b, c) {
        var d = null;
        if (a.getChildCount() == 0) {
            d = new Checkbox();
            var e = this.e.getSubRenderer(a);
            d.provideContainer(e);
            this.d.addItem(a, d);
            d.d = this.b.l;
            d.t = true;
            d.change = delegateCombine(d.change, runOn(this, this.j));
            var f = this.e.createElement("div");
            a.setStyleProperty("display", "flex");
            a.setStyleProperty("height", "100%");
            a.setStyleProperty("align-items", "center");
            switch (this.b.n) {
                case 1:
                    a.setStyleProperty("margin-top", "-4px");
                    break;
                case 2:
                    a.setStyleProperty("margin-top", "-1px");
                    break;
                case 3:
                    a.setStyleProperty("margin-top", "1px");
                    break;
            }
            a.append(f);
        }
        else {
            d = this.d.item(a);
        }
        if (d != null) {
            var g = d.u;
            try {
                d.u = true;
                d.a5 = b;
                if (c) {
                    if (this.b.p == 0) {
                        d.checked = false;
                    }
                    else {
                        d.checked = true;
                    }
                }
                else {
                    if (this.b.p == 0) {
                        d.checked = true;
                    }
                    else {
                        d.checked = false;
                    }
                }
            }
            finally {
                d.u = g;
            }
        }
    };
    CheckboxListView.prototype.x = function () {
        var e_1, _a;
        if (this.d != null) {
            try {
                for (var _b = tslib_1.__values(fromEnum(this.d)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    var b = a.value;
                    b.d = this.b.l;
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
        if (this.a != null) {
            this.a.d = this.b.l;
        }
    };
    CheckboxListView.prototype.w = function () {
    };
    CheckboxListView.prototype.j = function (a, b) {
        var c = a;
        var d = parseInt(c.a5.toString());
        var e = c.checked;
        if (e == true) {
            if (this.b.p == 0) {
                this.b.cf(d);
            }
            else {
                this.b.bo(d);
            }
        }
        else {
            if (this.b.p == 0) {
                this.b.bo(d);
            }
            else {
                this.b.cf(d);
            }
        }
        this.b.b1(d, e);
        this.ac(false);
    };
    CheckboxListView.prototype.k = function () {
    };
    CheckboxListView.prototype.s = function (a, b) {
        var e_2, _a;
        try {
            for (var _b = tslib_1.__values(fromEnum(this.d)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = c.value;
                var e = parseInt(d.a5.toString());
                if (e == a) {
                    d.checked = b;
                    this.b.b1(e, b);
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
        this.ac();
    };
    CheckboxListView.prototype.t = function (a) {
        var e_3, _a;
        try {
            for (var _b = tslib_1.__values(fromEnum(this.d)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.value;
                c.checked = a;
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
    };
    CheckboxListView.prototype.p = function (a) {
        this.i = a;
        if (null != this.i) {
            this.i.setStyleProperty("margin", "5px 0px 4px 0px");
        }
    };
    CheckboxListView.prototype.ad = function () {
        var a = this.e;
        if (null == a || null == this.i) {
            return;
        }
        var b = a.createElement("div");
        var c = a.getSubRenderer(b);
        this.a = new Checkbox();
        this.a.provideContainer(c);
        this.a.d = this.b.l;
        this.h = a.createElement("label");
        this.h.setRawText(this.b.bg);
        this.h.setStyleProperty("font-size", "13px");
        this.i.setStyleProperty("display", "flex");
        this.i.setStyleProperty("flex-direction", "row");
        this.i.setStyleProperty("font-family", "'Segoe UI', Verdana");
        this.i.setStyleProperty("align-items", "center");
        this.i.append(b);
        this.i.append(this.h);
        this.ae();
        this.ab();
        var d = this.a;
        d.change = delegateCombine(d.change, runOn(this, this.q));
        this.a.t = true;
    };
    CheckboxListView.prototype.ab = function () {
        if (null != this.h) {
            this.h.setRawText(this.b.bg);
            NativeUI.n(this.h, this.b.cq);
        }
    };
    CheckboxListView.prototype.ae = function () {
        if (null != this.h) {
            var a = this.b.ao ? "flex" : "none";
            this.i.setStyleProperty("display", a);
        }
    };
    CheckboxListView.prototype.aa = function () {
        if (this.g != null) {
            this.g.setStyleProperty("display", this.b.am ? "block" : "none");
        }
        if (this.f != null) {
            this.f.setStyleProperty("display", this.b.am ? "block" : "none");
        }
    };
    CheckboxListView.prototype.ac = function (a) {
        if (a === void 0) {
            a = true;
        }
        var b = this.c;
        this.c = true;
        var c = this.a.u;
        this.a.u = a;
        try {
            if (this.b.ak) {
                this.a.indeterminate = true;
                return;
            }
            this.a.indeterminate = false;
            if (this.b.p == 0) {
                this.a.checked = this.b.g.count == 0;
            }
            else {
                this.a.checked = this.b.g.count != 0;
            }
        }
        finally {
            this.a.u = c;
            this.c = b;
        }
    };
    CheckboxListView.prototype.q = function (a, b) {
        if (this.c || b.isIndeterminate) {
            return;
        }
        if (b.isChecked) {
            this.b.ch();
            this.b.b8(b.isChecked);
        }
        else {
            this.b.bs();
            this.b.b8(b.isChecked);
        }
    };
    CheckboxListView.prototype.z = function () {
        var a = this.e;
        if (null == a) {
            return;
        }
        var b = a.rootWrapper;
        if (null != b) {
            NativeUI.n(b, this.b.cw);
            NativeUI.j(b, this.b.cr);
        }
    };
    CheckboxListView.prototype.y = function (a) {
        if (this.f != null) {
            NativeUI.s(this.f, a);
        }
    };
    CheckboxListView.prototype.o = function (a) {
        this.f = a;
    };
    CheckboxListView.$t = markType(CheckboxListView, 'CheckboxListView');
    return CheckboxListView;
}(Base));
export { CheckboxListView };
/**
 * @hidden
 */
var CheckboxList = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(CheckboxList, _super);
    function CheckboxList() {
        var _this = _super.call(this) || this;
        _this.q = null;
        _this.h = null;
        _this.i = null;
        _this.z = null;
        _this.d = null;
        _this.ae = false;
        _this.c = null;
        _this.s = null;
        _this.u = null;
        _this.af = false;
        _this.ac = null;
        _this.f = new GridSelectedKeysCollection();
        _this.a = null;
        _this.propertyChanged = null;
        _this.checkedChanged = null;
        _this.at = null;
        _this.av = null;
        _this.ax = null;
        _this.aw = null;
        _this.w = 3;
        _this.ap = -1;
        _this.aa = null;
        _this.o = 1;
        _this.k = 1;
        _this.m = 2;
        _this.bf = null;
        _this.co = null;
        _this.cm = CheckboxList.ct;
        _this.an = true;
        _this.cn = CheckboxList.cs;
        _this.cp = CheckboxList.ct;
        _this.selectAllCheckboxChanged = null;
        _this.ar = -1;
        _this.al = true;
        _this.ai = true;
        var a = _this.f;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.ca));
        _this.d = new FilterFactory();
        var b = new CheckboxListView();
        b.b = _this;
        _this.q = b;
        _this.q.m();
        return _this;
    }
    Object.defineProperty(CheckboxList.prototype, "v", {
        get: function () {
            return this.u;
        },
        set: function (a) {
            this.u = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "t", {
        get: function () {
            return this.s;
        },
        set: function (a) {
            this.s = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "e", {
        get: function () {
            if (this.h == null) {
                return null;
            }
            return this.h.actualDataSource;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "ad", {
        get: function () {
            if (this.ac == null) {
                this.ac = new SRProvider(this.q.e);
                this.ac.cb("DataGrid");
            }
            return this.ac;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "g", {
        get: function () {
            return this.f;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "b", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            this.a = a;
            if (b != this.a) {
                this.b6("PrimaryKey", b, this.a);
            }
        },
        enumerable: true,
        configurable: true
    });
    CheckboxList.prototype.ca = function (a, b) {
        if (this.e == null || this.e.actualSchema == null || this.ae) {
            return;
        }
        switch (b.action) {
            case 0:
                for (var c = 0; c < b.newItems.count; c++) {
                    this.b4(b.newItems.item(c));
                }
                break;
            case 1:
                for (var d = 0; d < b.oldItems.count; d++) {
                    this.b5(b.oldItems.item(d));
                }
                break;
            case 2:
                for (var e = 0; e < b.oldItems.count; e++) {
                    this.b5(b.oldItems.item(e));
                }
                for (var f = 0; f < b.newItems.count; f++) {
                    this.b4(b.newItems.item(f));
                }
                break;
            case 4:
                this.q.t(this.p == 0);
                for (var g = 0; g < this.g.ae.count; g++) {
                    this.b4(this.g.ae._inner[g]);
                }
                break;
        }
    };
    CheckboxList.prototype.b4 = function (a) {
        var b = this.e.indexOfKey(a.value);
        if (b >= 0) {
            this.q.s(b, this.p == 1);
        }
    };
    CheckboxList.prototype.b5 = function (a) {
        var b = this.e.indexOfKey(a.value);
        if (b >= 0) {
            this.q.s(b, this.p == 0);
        }
    };
    CheckboxList.prototype.b1 = function (a, b) {
        if (this.checkedChanged != null && this.af == false) {
            this.checkedChanged(this, ((function () {
                var $ret = new CheckedChangedEventArgs();
                $ret.b = a;
                $ret.a = b;
                return $ret;
            })()));
        }
    };
    CheckboxList.prototype.notifySizeChanged = function () {
        this.q.k();
    };
    CheckboxList.prototype.destroy = function () {
        if (this.h != null) {
            var a = this.h;
            a.cellClicked = delegateRemove(a.cellClicked, runOn(this, this.bu));
        }
        if (this.s != null) {
            var b = this.s;
            b.change = delegateRemove(b.change, runOn(this, this.bv));
        }
        this.provideContainer(null, null, null);
        if (this.i != null) {
            var c = this.i;
            c.cellUpdating = delegateRemove(c.cellUpdating, runOn(this, this.br));
        }
    };
    CheckboxList.prototype.provideContainer = function (a, b, c) {
        this.h = b;
        if (null != this.h) {
            this.h.lt = 0;
            this.h.l3 = 0;
            this.h.hc = false;
            this.h.cm = 0;
            this.h.cg = 0;
            var d = this.h;
            d.cellClicked = delegateCombine(d.cellClicked, runOn(this, this.bu));
            if (this.at != null) {
                this.h.itemsSource = this.at;
                this.bq();
                this.b9();
            }
            if (this.av != null) {
                this.b9();
                this.ck();
            }
        }
        this.q.p(c);
        this.q.l(a);
    };
    CheckboxList.prototype.provideSelectAllSection = function (a) {
        this.q.p(a);
    };
    CheckboxList.prototype.bu = function (a, b) {
        if (b.cellInfo.k.a0 == 0) {
            return;
        }
        var c = b.cellInfo.k.w;
        if (-1 == c) {
            return;
        }
        var d = this.j(b.cellInfo.gq);
        if (this.g.contains(d)) {
            this.g.remove(d);
        }
        else {
            this.g.add(d);
        }
    };
    CheckboxList.prototype.br = function (a, b) {
        var c = b.cellInfo.k.w;
        if (-1 == c) {
            return;
        }
        var d = false;
        if (b.cellInfo.gq != null) {
            var e = this.j(b.cellInfo.gq);
            if (this.g.contains(e)) {
                d = true;
            }
        }
        this.q.n(b.content.element, c, d);
    };
    CheckboxList.prototype.b2 = function (a) {
        if (this.av != null) {
            var b = this.d.property(this.av).cast(enumGetBox(DataSourceSchemaPropertyType_$type, 0)).toLower();
            var c = b.contains(a);
            if (!this.h.v.j.contains(this.c)) {
                this.c = c;
                this.h.v.add(this.c);
            }
            else {
                var d = this.h.v.j.indexOf(this.c);
                this.h.v.j.item(d, this.c = c);
            }
        }
    };
    Object.defineProperty(CheckboxList.prototype, "itemsSource", {
        get: function () {
            return this.at;
        },
        set: function (a) {
            var b = this.at;
            this.at = a;
            if (b != this.at) {
                this.b6("ItemsSource", b, this.at);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "a2", {
        get: function () {
            return this.av;
        },
        set: function (a) {
            var b = this.av;
            this.av = a;
            if (b != this.av) {
                this.b6("DataMemberPath", b, this.av);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "bj", {
        get: function () {
            return this.ax;
        },
        set: function (a) {
            var b = this.ax;
            this.ax = a;
            if (b != this.ax) {
                this.b6("SelectedMemberPath", b, this.ax);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "a6", {
        get: function () {
            return this.aw;
        },
        set: function (a) {
            var b = this.aw;
            this.aw = a;
            if (b != this.aw) {
                this.b6("FilterPlaceholderText", b, this.aw);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "x", {
        get: function () {
            return this.w;
        },
        set: function (a) {
            var b = this.w;
            this.w = a;
            if (b != this.w) {
                this.b6("SearchInputType", enumGetBox(InputGroupDisplayType_$type, b), enumGetBox(InputGroupDisplayType_$type, this.w));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "as", {
        get: function () {
            return this.ap;
        },
        set: function (a) {
            var b = this.ap;
            this.ap = a;
            if (b != this.ap) {
                this.b6("RowHeight", b, this.ap);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "aq", {
        get: function () {
            if (this.h != null) {
                return this.h.k8;
            }
            return -1;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "ab", {
        get: function () {
            return this.aa;
        },
        set: function (a) {
            var b = this.aa;
            this.aa = a;
            if (b != this.aa) {
                this.b6("CellTextStyle", b, this.aa);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "p", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            if (b != this.o) {
                this.b6("IndexType", enumGetBox(CheckboxListIndexType_$type, b), enumGetBox(CheckboxListIndexType_$type, this.o));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "l", {
        get: function () {
            return this.k;
        },
        set: function (a) {
            var b = this.k;
            this.k = a;
            if (b != this.k) {
                this.b6("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.k));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "n", {
        get: function () {
            return this.m;
        },
        set: function (a) {
            var b = this.m;
            this.m = a;
            if (b != this.m) {
                this.b6("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.m));
            }
        },
        enumerable: true,
        configurable: true
    });
    CheckboxList.prototype.b6 = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        this.cb(a, b, c);
    };
    CheckboxList.prototype.cb = function (a, b, c) {
        switch (a) {
            case "ItemsSource":
                if (this.h != null) {
                    this.p = 1;
                    if (c != null) {
                        this.h.a8.m();
                        this.h.b5.m();
                        this.h.v.clear();
                        this.h.b8.m();
                    }
                    if (this.h.actualDataSource != null) {
                        var d = this.h.actualDataSource;
                        d.schemaChanged = delegateRemove(d.schemaChanged, runOn(this, this.b7));
                    }
                    this.h.itemsSource = this.at;
                    this.bq();
                    if (this.h.actualDataSource != null) {
                        var e = this.h.actualDataSource;
                        e.schemaChanged = delegateCombine(e.schemaChanged, runOn(this, this.b7));
                    }
                    this.af = true;
                    this.b9();
                    this.af = false;
                    this.q.ac();
                }
                break;
            case "DataMemberPath":
            case "SelectedMemberPath":
                if (this.h != null) {
                    if (this.av != null) {
                        this.b9();
                        this.ck();
                    }
                }
                break;
            case "PrimaryKey":
                if (this.h != null) {
                    this.h.l = this.b;
                }
                break;
            case "SelectAllCaptionTextColor":
                this.cq = null != this.cu ? this.cu : CheckboxList.ct;
                break;
            case "SelectAllCaption":
            case "ActualSelectAllCaptionTextColor":
                this.q.ab();
                break;
            case "showSelectAll":
                this.q.ae();
                this.q.r();
                break;
            case "ShowFilter":
                this.q.aa();
                this.q.r();
                break;
            case "FilterPlaceholderText":
                if (this.s != null) {
                    this.s.b8 = this.a6;
                }
                break;
            case "SearchInputType":
                if (this.u != null) {
                    this.u.k = this.x;
                }
                break;
            case "RowHeight":
                if (this.h != null) {
                    this.h.l1 = this.as;
                }
                break;
            case "CellTextStyle":
                if (this.h != null) {
                    this.h.fu = this.ab;
                }
                break;
            case "BackgroundColor":
            case "TextColor":
                var f = this.h;
                if (null != f) {
                    f.v4 = this.cw;
                    f.v2 = this.cr;
                }
                this.q.z();
                break;
            case "BaseTheme":
                this.cj();
                break;
            case "Density":
                this.ci();
                break;
            case "IsRowHoverEnabled":
                if (this.h != null) {
                    this.h.ig = this.aj;
                }
                break;
        }
    };
    CheckboxList.prototype.ci = function () {
        if (this.h != null) {
            this.h.fl = this.n;
        }
        if (this.u != null) {
            this.u.h = this.n;
        }
        this.q.w();
    };
    CheckboxList.prototype.cj = function () {
        if (this.u != null) {
            this.u.d = this.l;
        }
        this.q.x();
    };
    CheckboxList.prototype.b7 = function (a, b) {
        this.af = true;
        this.bq();
        if (b.schema != null) {
            this.b9();
            for (var c = 0; c < this.g.count; c++) {
                this.b4(this.g._inner[c]);
            }
            this.q.ac();
        }
        this.af = false;
    };
    CheckboxList.prototype.b9 = function () {
        if (this.z == null && this.ax != null && this.ax != "") {
            this.z = new FastReflectionHelper(false, this.ax);
        }
        if (this.at != null && this.z != null && this.h.actualDataSource.actualSchema != null) {
            this.z.propertyName = this.ax;
            var a = this.h.actualDataSource.actualCount;
            for (var b = 0; b < a; b++) {
                var c = this.h.actualDataSource.getItemAtIndex(b);
                var d = this.z.getPropertyValue(c);
                if (d == true) {
                    var e = this.j(c);
                    if (!this.g.contains(e)) {
                        this.g.add(e);
                    }
                }
            }
        }
    };
    CheckboxList.prototype.ck = function () {
        this.h.actualColumns.clear();
        this.h.l = this.b;
        this.h.h5 = false;
        this.h.l1 = this.as;
        this.h.v2 = this.cr;
        this.h.v3 = this.cr;
        this.h.fl = this.n;
        this.h.ig = this.aj;
        this.h.w8 = new Thickness(0, 0);
        if (this.ab != null) {
            this.h.fu = this.ab;
        }
        var a = new TemplateColumn();
        if (this.ax == null) {
            this.ax = "";
        }
        a.h4 = this.ax;
        a.il = "CheckboxColumn";
        var b = new ColumnWidth();
        b.f = 28;
        a.width = b;
        a.g2 = 0;
        a.g3 = 0;
        a.cellUpdating = delegateCombine(a.cellUpdating, runOn(this, this.br));
        this.h.columns.add(a);
        this.i = a;
        var c = this.h.actualDataSource.resolveSchemaPropertyType(this.av);
        var d;
        switch (c) {
            case 8:
            case 9:
                d = new DateTimeColumn();
                break;
            case 1:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 10:
                d = new NumericColumn();
                break;
            case 2:
            case 11:
            case 0:
            default:
                d = new TextColumn();
                break;
        }
        d.h4 = this.av;
        d.il = "DataColumn";
        d.g2 = 0;
        d.e = 0;
        this.h.columns.add(d);
    };
    CheckboxList.prototype.updateHrMargin = function (a) {
        this.q.y(a);
    };
    CheckboxList.prototype.provideHrElement = function (a) {
        this.q.o(a);
    };
    CheckboxList.prototype.b3 = function () {
        var a = this.t;
        a.changing = delegateCombine(a.changing, runOn(this, this.bv));
    };
    CheckboxList.prototype.bv = function (a, b) {
        var c = b.value.toLowerCase();
        this.b2(c);
    };
    CheckboxList.prototype.j = function (a) {
        if (this.b == null) {
            return PrimaryKeyValue.createIdentityKey(a);
        }
        var b = new Array(this.b.length);
        var c = new Array(this.b.length);
        for (var d = 0; d < b.length; d++) {
            b[d] = this.b[d];
            c[d] = this.e.getItemProperty(a, b[d]);
        }
        return new PrimaryKeyValue(b, c);
    };
    CheckboxList.prototype.cf = function (a) {
        this.ae = true;
        var b = this.e.getItemAtIndex(a);
        var c = this.j(b);
        this.g.remove(c);
        this.ae = false;
    };
    CheckboxList.prototype.bo = function (a) {
        this.ae = true;
        var b = this.e.getItemAtIndex(a);
        var c = this.j(b);
        this.g.add(c);
        this.ae = false;
    };
    CheckboxList.prototype.ch = function () {
        this.p = 0;
        this.g.clear();
        this.bw();
        this.q.ac();
    };
    CheckboxList.prototype.bs = function () {
        this.p = 1;
        this.g.clear();
        this.bw();
        this.q.ac();
    };
    CheckboxList.prototype.bz = function (a, b, c) {
        if (this.h != null) {
            this.h.rm(a, b, c);
        }
    };
    CheckboxList.prototype.bw = function () {
        if (this.h != null) {
            this.h.rg();
        }
    };
    CheckboxList.prototype.bx = function (a, b) {
        if (this.h != null) {
            this.h.ri(a, b);
        }
        ;
    };
    CheckboxList.prototype.by = function (a, b) {
        if (this.h != null) {
            this.h.rj(a, b);
        }
        ;
    };
    CheckboxList.prototype.bp = function (a) {
        var b = null;
        if (this.b == null || this.b.length == 0) {
            b = new PrimaryKeyValue(null, a);
        }
        else if (this.b.length == a.length) {
            b = new PrimaryKeyValue(this.b, a);
        }
        else {
            throw new ArgumentException(1, "value length must match PrimaryKey length");
        }
        if (b != null) {
            this.g.add(b);
        }
    };
    CheckboxList.prototype.cg = function (a) {
        var b = null;
        if (this.b == null || this.b.length == 0) {
            b = new PrimaryKeyValue(null, a);
        }
        else if (this.b.length == a.length) {
            b = new PrimaryKeyValue(this.b, a);
        }
        else {
            throw new ArgumentException(1, "value length must match PrimaryKey length");
        }
        if (this.g.contains(b)) {
            this.g.remove(b);
        }
    };
    Object.defineProperty(CheckboxList.prototype, "bg", {
        get: function () {
            return this.bf != null ? this.bf : !stringIsNullOrWhiteSpace(this.ad.b1("Select_All")) ? this.ad.b1("Select_All") : "(Select All)";
        },
        set: function (a) {
            if (a == this.bf) {
                return;
            }
            var b = this.bf;
            this.bf = a;
            this.b6("SelectAllCaption", b, this.bf);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "cu", {
        get: function () {
            return this.co;
        },
        set: function (a) {
            var b = this.co;
            this.co = a;
            if (b != this.co) {
                this.b6("SelectAllCaptionTextColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "cq", {
        get: function () {
            return this.cm;
        },
        set: function (a) {
            var b = this.cm;
            this.cm = a;
            if (b != this.cm) {
                this.b6("ActualSelectAllCaptionTextColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "ak", {
        get: function () {
            if (-1 == this.ar) {
                return false;
            }
            var a = this.g.count;
            if (0 == a) {
                return false;
            }
            if (a == this.ar) {
                return false;
            }
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "ao", {
        get: function () {
            return this.an;
        },
        set: function (a) {
            if (a == this.an) {
                return;
            }
            var b = this.an;
            this.an = a;
            this.b6("showSelectAll", b, this.an);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "cr", {
        get: function () {
            return this.cn;
        },
        set: function (a) {
            var b = this.cn;
            this.cn = a;
            if (b != this.cn) {
                this.b6("BackgroundColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "cw", {
        get: function () {
            return this.cp;
        },
        set: function (a) {
            var b = this.cp;
            this.cp = a;
            if (b != this.cp) {
                this.b6("TextColor", b, a);
            }
        },
        enumerable: true,
        configurable: true
    });
    CheckboxList.prototype.b8 = function (a) {
        if (this.selectAllCheckboxChanged != null) {
            this.selectAllCheckboxChanged(this, ((function () {
                var $ret = new SelectAllCheckboxChangedEventArgs();
                $ret.a = a;
                return $ret;
            })()));
        }
    };
    CheckboxList.prototype.ah = function () {
        if (-1 == this.ar) {
            return true;
        }
        var a = this.g.count;
        switch (this.p) {
            case 0: return this.ar == a;
            case 1: return 0 == a;
            default: return false;
        }
    };
    CheckboxList.prototype.ag = function () {
        if (-1 == this.ar) {
            return false;
        }
        var a = this.g.count;
        switch (this.p) {
            case 0: return 0 == a;
            case 1: return this.ar == a;
            default: return false;
        }
    };
    CheckboxList.prototype.bq = function () {
        var a = this.h.actualDataSource;
        if (null != a) {
            if (null == a.actualSchema) {
                this.ar = -1;
                return;
            }
            var b = a.actualCount;
            this.ar = b;
        }
        else {
            this.ar = -1;
        }
    };
    Object.defineProperty(CheckboxList.prototype, "am", {
        get: function () {
            return this.al;
        },
        set: function (a) {
            if (a == this.al) {
                return;
            }
            var b = this.al;
            this.al = a;
            this.b6("ShowFilter", b, this.al);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CheckboxList.prototype, "aj", {
        get: function () {
            return this.ai;
        },
        set: function (a) {
            if (a == this.ai) {
                return;
            }
            var b = this.ai;
            this.ai = a;
            this.b6("IsRowHoverEnabled", b, this.ai);
        },
        enumerable: true,
        configurable: true
    });
    CheckboxList.$t = markType(CheckboxList, 'CheckboxList', Base.$, [INotifyPropertyChanged_$type]);
    CheckboxList.cv = BrushUtil.g(255, 24, 29, 31);
    CheckboxList.be = "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z";
    CheckboxList.cs = BrushUtil.g(255, 248, 248, 248);
    CheckboxList.ct = BrushUtil.g(255, 24, 29, 31);
    return CheckboxList;
}(Base));
export { CheckboxList };
//# sourceMappingURL=CheckboxListView_combined.js.map
