igniteui-react-grids
Version:
Ignite UI React grid components.
1,542 lines • 57 kB
JavaScript
/*
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 { __extends, __values } from "tslib";
import { Base, runOn, delegateCombine, fromEnum, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateRemove, enumGetBox, EnumUtil } from "igniteui-react-core";
import { DomWrapper_$type } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { XCheckbox } from "igniteui-react-inputs";
import { XPrefix } from "igniteui-react-inputs";
import { XInputGroup } from "igniteui-react-inputs";
import { XIcon } from "igniteui-react-inputs";
import { XInput } from "igniteui-react-inputs";
import { ControlDisplayDensity_$type } from "igniteui-react-core";
import { NativeUI } from "igniteui-react-core";
import { PrimaryKeyValue } from "./PrimaryKeyValue";
import { Thickness } from "igniteui-react-core";
import { CheckboxListIndexType_$type } from "./CheckboxListIndexType";
import { SRProvider } from "igniteui-react-core";
import { GridSelectedKeysCollection } from "./GridSelectedKeysCollection";
import { InputGroupDisplayType_$type } from "igniteui-react-inputs";
import { GridStyleRepository } from "./GridStyleRepository";
import { BaseControlTheme_$type } from "igniteui-react-core";
import { ScrollbarStyle_$type } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { FilterFactory } from "igniteui-react-core";
import { CheckboxListKeysClearedEventArgs } from "./CheckboxListKeysClearedEventArgs";
import { CheckedChangedEventArgs } from "./CheckedChangedEventArgs";
import { TemplateColumn } from "./TemplateColumn";
import { FastReflectionHelper } from "igniteui-react-core";
import { DataSourceSchemaPropertyType_$type } from "igniteui-react-core";
import { CheckboxListIndexTypeChangedEventArgs } from "./CheckboxListIndexTypeChangedEventArgs";
import { ColumnWidth } from "./ColumnWidth";
import { DateTimeColumn } from "./DateTimeColumn";
import { NumericColumn } from "./NumericColumn";
import { TextColumn } from "./TextColumn";
import { ArgumentException } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { ComponentSizeHelpers } from "igniteui-react-core";
import { SelectAllCheckboxChangedEventArgs } from "./SelectAllCheckboxChangedEventArgs";
import { isPositiveInfinity } from "igniteui-react-core";
import { stringIsNullOrWhiteSpace } from "igniteui-react-core";
/**
* @hidden
*/
var CheckboxListView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CheckboxListView, _super);
function CheckboxListView() {
var _this = _super.call(this) || this;
_this.e = new Dictionary$2(DomWrapper_$type, XCheckbox.$, 0);
_this.j = null;
_this.a = null;
_this.i = null;
_this.h = null;
_this.c = null;
_this.b = null;
_this.f = null;
_this.d = false;
_this.g = null;
return _this;
}
CheckboxListView.prototype.n = function () {
};
CheckboxListView.prototype.m = function (a) {
if (a == null) {
this.f = null;
this.e.clear();
return;
}
this.f = a;
this.v();
this.ae();
this.ah();
this.s();
var b = Math.round(a.rootWrapper.width());
var c = Math.round(a.rootWrapper.height());
this.f.rootWrapper.setStyleProperty("position", "relative");
this.f.rootWrapper.setStyleProperty("padding-bottom", "4px");
this.ag();
};
CheckboxListView.prototype.v = function () {
if (this.f != null) {
this.w(this.f);
}
};
CheckboxListView.prototype.w = function (a) {
var b = a.rootWrapper.getChildAt(0);
this.h = b;
this.b.v = new XInputGroup();
var c = a.getSubRenderer(b);
this.b.v.provideContainer(c);
var d = c.getExternal(this.b.v, c.rootWrapper, c.getExternal(this.b, null, null));
this.b.v.d = this.b.x;
this.b.v.p = this.b.baseTheme;
this.b.v.t = this.b.density;
var e = a.createElement("div");
var f = a.getSubRenderer(e);
var g = new XPrefix();
g.provideContainer(f);
var h = f.getExternal(g, f.rootWrapper, f.getExternal(this.b, null, null));
var i = a.createElement("div");
var j = a.getSubRenderer(i);
this.c = new XIcon();
this.c.provideContainer(j);
this.c.fill = this.b.searchIconColor;
this.c.svgPath = CheckboxList.b0;
var k = f.getExternal(this.c, j.rootWrapper, j.getExternal(this.b, null, null));
g.appendContentChild(i);
this.b.v.appendContentChild(e);
this.b.v.inputs.add(g);
var l = a.createElement("div");
l.setRawStyleProperty("flex-grow", "1");
var m = a.getSubRenderer(l);
this.b.t = new XInput();
this.b.t.provideContainer(m);
this.b.t.b8 = "text";
var n = m.getExternal(this.b.t, m.rootWrapper, m.getExternal(this.b, null, null));
if (this.b.bm != null) {
this.b.t.cg = this.b.bm;
}
this.b.v.appendContentChild(l);
this.b.v.inputs.add(this.b.t);
this.b.cx();
};
CheckboxListView.prototype.s = function () {
if (this.f != null) {
var a = this.f.rootWrapper.getChildAt(3);
a.setStyleProperty("width", "100%");
a.setStyleProperty("margin", "4px 0px 0px 0px");
if (!this.b.au && !this.b.showSelectAll) {
a.setStyleProperty("height", "100%");
}
else {
var b = this.b.ay();
a.setStyleProperty("height", "calc(100% - " + b + "px");
}
}
};
CheckboxListView.prototype.o = function (a, b, c) {
var d = null;
if (a.getChildCount() == 0) {
d = new XCheckbox();
var e = this.f.getSubRenderer(a);
d.provideContainer(e);
var f = this.f.getExternal(d, e.rootWrapper, this.f.getExternal(this.b, null, null));
this.e.addItem(a, d);
d.n = this.b.baseTheme;
d.y = true;
d.change = delegateCombine(d.change, runOn(this, this.k));
var g = this.f.createElement("div");
a.setStyleProperty("display", "flex");
a.setStyleProperty("height", "100%");
a.setStyleProperty("align-items", "center");
switch (this.b.density) {
case 1:
a.setStyleProperty("margin-top", "-4px");
break;
case 2:
a.setStyleProperty("margin-top", "-1px");
break;
case 4:
case 3:
a.setStyleProperty("margin-top", "1px");
break;
}
a.append(g);
}
else {
d = this.e.item(a);
}
if (d != null) {
var h = d.z;
try {
d.z = true;
d.a4 = b;
if (c) {
if (this.b.indexType == 0) {
d.checked = false;
}
else {
d.checked = true;
}
}
else {
if (this.b.indexType == 0) {
d.checked = true;
}
else {
d.checked = false;
}
}
}
finally {
d.z = h;
}
d.dk = this.b.d2;
d.dd = this.b.d0;
d.dl = this.b.d3;
d.de = this.b.d1;
d.dm = this.b.d4;
}
};
CheckboxListView.prototype.z = function () {
var e_1, _a;
if (this.e != null) {
try {
for (var _b = __values(fromEnum(this.e)), _c = _b.next(); !_c.done; _c = _b.next()) {
var a = _c.value;
var b = a.value;
b.n = this.b.baseTheme;
}
}
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.n = this.b.baseTheme;
}
};
CheckboxListView.prototype.x = function () {
};
CheckboxListView.prototype.k = function (a, b) {
var c = a;
var d = parseInt(c.a4.toString());
var e = c.checked;
if (e == true) {
if (this.b.indexType == 0) {
this.b.da(d);
}
else {
this.b.cc(d);
}
}
else {
if (this.b.indexType == 0) {
this.b.cc(d);
}
else {
this.b.da(d);
}
}
this.b.cu(d, e);
this.ag(false);
};
CheckboxListView.prototype.l = function () {
};
CheckboxListView.prototype.t = function (a, b) {
var e_2, _a;
try {
for (var _b = __values(fromEnum(this.e)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
var d = c.value;
var e = parseInt(d.a4.toString());
if (e == a) {
d.checked = b;
this.b.cu(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.ag();
};
CheckboxListView.prototype.u = function (a) {
var e_3, _a;
try {
for (var _b = __values(fromEnum(this.e)), _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.q = function (a) {
this.j = a;
if (null != this.j) {
this.j.setStyleProperty("margin", "5px 0px 4px 0px");
}
};
CheckboxListView.prototype.ah = function () {
var a = this.f;
if (null == a || null == this.j) {
return;
}
var b = a.createElement("div");
var c = a.getSubRenderer(b);
this.a = new XCheckbox();
this.a.provideContainer(c);
var d = this.f.getExternal(this.a, c.rootWrapper, this.f.getExternal(this.b, null, null));
this.a.n = this.b.baseTheme;
this.i = a.createElement("label");
this.i.setRawText(this.b.b4);
this.i.setStyleProperty("font-size", "13px");
this.j.setStyleProperty("display", "flex");
this.j.setStyleProperty("flex-direction", "row");
this.j.setStyleProperty("font-family", "Verdana");
this.j.setStyleProperty("align-items", "center");
this.j.append(b);
this.j.append(this.i);
this.ai();
this.af();
var e = this.a;
e.change = delegateCombine(e.change, runOn(this, this.r));
this.a.y = true;
};
CheckboxListView.prototype.af = function () {
if (null != this.i) {
this.i.setRawText(this.b.b4);
NativeUI.q(this.i, this.b.dy);
}
};
CheckboxListView.prototype.ai = function () {
if (null != this.i) {
var a = this.b.showSelectAll ? "flex" : "none";
this.j.setStyleProperty("display", a);
}
};
CheckboxListView.prototype.ae = function () {
if (this.h != null) {
this.h.setStyleProperty("display", this.b.au ? "block" : "none");
}
if (this.g != null) {
this.g.setStyleProperty("display", this.b.au ? "block" : "none");
}
};
CheckboxListView.prototype.ag = function (a) {
if (a === void 0) {
a = true;
}
if (this.a == null) {
return;
}
var b = this.d;
this.d = true;
var c = this.a.z;
this.a.z = a;
try {
if (this.b.as) {
this.a.indeterminate = true;
return;
}
this.a.indeterminate = false;
if (this.b.indexType == 0) {
this.a.checked = this.b.keys.count == 0;
}
else {
this.a.checked = this.b.keys.count != 0;
}
}
finally {
this.a.z = c;
this.d = b;
}
};
CheckboxListView.prototype.r = function (a, b) {
if (this.d || b.isIndeterminate) {
return;
}
if (b.isChecked) {
this.b.dd();
this.b.c2(b.isChecked);
}
else {
this.b.ci();
this.b.c2(b.isChecked);
}
};
CheckboxListView.prototype.ad = function () {
var a = this.f;
if (null == a) {
return;
}
var b = a.rootWrapper;
if (null != b) {
NativeUI.q(b, this.b.eg);
NativeUI.m(b, this.b.backgroundColor);
}
};
CheckboxListView.prototype.ab = function () {
if (this.c != null) {
this.c.fill = this.b.searchIconColor;
}
};
CheckboxListView.prototype.ac = function () {
if (this.b.ai != null) {
this.i.setStyleProperty("font", this.b.ai.fontString);
}
else {
this.i.setStyleProperty("font-family", "Verdana");
this.i.setStyleProperty("font-size", 13 + "px");
}
};
CheckboxListView.prototype.y = function () {
this.a.dk = this.b.d2;
this.a.dd = this.b.d0;
this.a.dl = this.b.d3;
this.a.de = this.b.d1;
this.a.dm = this.b.d4;
};
CheckboxListView.prototype.aa = function (a) {
if (this.g != null) {
NativeUI.w(this.g, a);
}
};
CheckboxListView.prototype.p = function (a) {
this.g = a;
};
CheckboxListView.$t = markType(CheckboxListView, 'CheckboxListView');
return CheckboxListView;
}(Base));
export { CheckboxListView };
/**
* @hidden
*/
var CheckboxList = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CheckboxList, _super);
function CheckboxList() {
var _this = _super.call(this) || this;
_this._view = null;
_this.f = null;
_this.j = null;
_this.af = null;
_this.d = null;
_this.am = false;
_this.c = null;
_this.s = null;
_this.u = null;
_this.an = false;
_this.ak = null;
_this.g = new GridSelectedKeysCollection();
_this.a = null;
_this.propertyChanged = null;
_this.selectedKeyAdded = null;
_this.selectedKeyRemoved = null;
_this.checkedChanged = null;
_this.a4 = null;
_this.a6 = null;
_this.a8 = null;
_this.a7 = null;
_this.w = 3;
_this.a0 = -1;
_this.ag = null;
_this.k = 1;
_this.ab = 1;
_this.ad = 2;
_this.du = BrushUtil.h(255, 24, 29, 31);
_this.ds = null;
_this.dv = null;
_this.dt = null;
_this.ah = null;
_this.dm = null;
_this.dk = null;
_this.dn = null;
_this.dl = null;
_this.dp = null;
_this.z = 0;
_this.dr = null;
_this.indexTypeChanged = null;
_this.b3 = null;
_this.dw = null;
_this.di = CheckboxList.d7;
_this.av = true;
_this.dj = CheckboxList.d5;
_this.dq = CheckboxList.d6;
_this.dx = CheckboxList.d7;
_this.keysCleared = null;
_this.selectAllCheckboxChanged = null;
_this.a2 = -1;
_this.at = true;
_this.aq = true;
var a = _this.g;
a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.c5));
_this.g.am(runOn(_this, _this.c4));
_this.d = new FilterFactory();
var b = new CheckboxListView();
b.b = _this;
_this.view = b;
_this.view.n();
return _this;
}
Object.defineProperty(CheckboxList.prototype, "view", {
get: function () {
return this._view;
},
set: function (a) {
this._view = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "v", {
get: function () {
return this.u;
},
set: function (a) {
this.u = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "t", {
get: function () {
return this.s;
},
set: function (a) {
this.s = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "e", {
get: function () {
if (this.f == null) {
return null;
}
return this.f.actualDataSource;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "al", {
get: function () {
if (this.ak == null) {
this.ak = new SRProvider(this.view.f);
this.ak.cb("DataGrid");
}
return this.ak;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "keys", {
get: function () {
return this.g;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "primaryKey", {
get: function () {
return this.a;
},
set: function (a) {
var b = this.a;
this.a = a;
if (b != this.a) {
this.c0("PrimaryKey", b, this.a);
}
},
enumerable: false,
configurable: true
});
CheckboxList.prototype.clearSelectedKeys = function () {
this.keys.clear();
if (this.keysCleared != null) {
this.keysCleared(this, new CheckboxListKeysClearedEventArgs());
}
};
CheckboxList.prototype.addSelectedKey = function (a, b) {
this.keys.add(new PrimaryKeyValue(a, b));
};
CheckboxList.prototype.insertSelectedKey = function (a, b, c) {
this.keys.insert(a, new PrimaryKeyValue(b, c));
};
CheckboxList.prototype.removeSelectedKeyAt = function (a) {
this.keys.removeAt(a);
};
CheckboxList.prototype.c4 = function () {
this.co();
if (this.keysCleared != null) {
this.keysCleared(this, new CheckboxListKeysClearedEventArgs());
}
};
CheckboxList.prototype.c5 = function (a, b) {
if (this.e == null || this.e.actualSchema == null || this.am) {
return;
}
switch (b.action) {
case 0:
for (var c = 0; c < b.newItems.count; c++) {
this.cy(b.newItems.item(c));
}
break;
case 1:
for (var d = 0; d < b.oldItems.count; d++) {
this.cz(b.oldItems.item(d));
}
break;
case 2:
for (var e = 0; e < b.oldItems.count; e++) {
this.cz(b.oldItems.item(e));
}
for (var f = 0; f < b.newItems.count; f++) {
this.cy(b.newItems.item(f));
}
break;
case 4:
this.view.u(this.indexType == 0);
for (var g = 0; g < this.keys.ae.count; g++) {
this.cy(this.keys.ae._inner[g]);
}
break;
}
};
CheckboxList.prototype.cy = function (a) {
var _this = this;
var b = this.e.indexOfKey(a.value);
if (b >= 0) {
this.view.t(b, this.indexType == 1);
}
if (this.selectedKeyAdded == null) {
return;
}
this.selectedKeyAdded(this, ((function () {
var $ret = new CheckedChangedEventArgs();
$ret.c = b;
$ret.b = _this.indexType == 1;
$ret.a = a.value;
return $ret;
})()));
};
CheckboxList.prototype.cz = function (a) {
var _this = this;
var b = this.e.indexOfKey(a.value);
if (b >= 0) {
this.view.t(b, this.indexType == 0);
}
if (this.selectedKeyRemoved == null) {
return;
}
this.selectedKeyRemoved(this, ((function () {
var $ret = new CheckedChangedEventArgs();
$ret.c = b;
$ret.b = _this.indexType == 0;
$ret.a = a.value;
return $ret;
})()));
};
CheckboxList.prototype.cu = function (a, b) {
if (this.checkedChanged != null && this.an == false) {
var c_1 = null;
if (this.e.actualPrimaryKey != null && this.e.actualPrimaryKey.length > 0) {
c_1 = new Array(this.e.actualPrimaryKey.length);
for (var d = 0; d < this.e.actualPrimaryKey.length; d++) {
c_1[d] = this.e.getItemPropertyAtIndex(a, this.e.actualPrimaryKey[d]);
}
}
this.checkedChanged(this, ((function () {
var $ret = new CheckedChangedEventArgs();
$ret.c = a;
$ret.b = b;
$ret.a = c_1;
return $ret;
})()));
}
};
CheckboxList.prototype.notifySizeChanged = function () {
this.view.l();
};
CheckboxList.prototype.destroy = function () {
if (this.f != null) {
var a = this.f;
a.cellClicked = delegateRemove(a.cellClicked, runOn(this, this.ck));
var b = this.f;
b.sizeChanged = delegateRemove(b.sizeChanged, runOn(this, this.cl));
if (this.f.actualDataSource != null) {
var c = this.f.actualDataSource;
c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.c1));
}
}
if (this.s != null) {
var d = this.s;
d.change = delegateRemove(d.change, runOn(this, this.cm));
}
this.provideContainer(null, null, null);
if (this.j != null) {
var e = this.j;
e.cellUpdating = delegateRemove(e.cellUpdating, runOn(this, this.cg));
}
};
CheckboxList.prototype.provideContainer = function (a, b, c) {
this.f = b;
if (null != this.f) {
this.f.scrollbarStyle = 1;
var d = this.f;
d.sizeChanged = delegateCombine(d.sizeChanged, runOn(this, this.cl));
this.f.scrollbarBackground = this.d9;
this.f.headerHeight = 0;
this.f.rowSeparatorHeight = 0;
this.f.defaultColumnMinWidth = NaN;
this.f.autoGenerateColumns = false;
this.f.activationMode = 0;
this.f.editMode = 0;
var e = this.f;
e.cellClicked = delegateCombine(e.cellClicked, runOn(this, this.ck));
if (this.a4 != null) {
this.f.itemsSource = this.a4;
this.cf();
this.c3();
}
if (this.a6 != null) {
this.c3();
this.dg();
}
}
this.view.q(c);
this.view.m(a);
};
CheckboxList.prototype.cl = function (a, b) {
this.f.scrollbarStyle = this.aa;
};
CheckboxList.prototype.provideSelectAllSection = function (a) {
this.view.q(a);
};
CheckboxList.prototype.ck = function (a, b) {
if (b.cellInfo.l.a5 == 0) {
return;
}
var c = b.cellInfo.l.x;
if (-1 == c) {
return;
}
var d = b.cellInfo.hn;
var e = this.i(d);
if (this.keys.contains(e)) {
if (this.af != null) {
this.af.setPropertyValue(d, false);
}
this.keys.remove(e);
}
else {
if (this.af != null) {
this.af.setPropertyValue(d, true);
}
this.keys.add(e);
}
};
CheckboxList.prototype.cg = function (a, b) {
var c = b.cellInfo.l.x;
if (-1 == c) {
return;
}
var d = false;
if (b.cellInfo.hn != null) {
var e = this.i(b.cellInfo.hn);
if (this.keys.contains(e)) {
d = true;
}
}
this.view.o(b.content.element, c, d);
};
CheckboxList.prototype.cv = function (a) {
if (this.a6 != null) {
var b = this.d.property(this.a6).cast(enumGetBox(DataSourceSchemaPropertyType_$type, 0)).toLower();
var c = b.contains(a);
if (!this.f.filterExpressions.k.contains(this.c)) {
this.c = c;
this.f.filterExpressions.add(this.c);
}
else {
var d = this.f.filterExpressions.k.indexOf(this.c);
this.f.filterExpressions.k.item(d, this.c = c);
}
}
};
Object.defineProperty(CheckboxList.prototype, "itemsSource", {
get: function () {
return this.a4;
},
set: function (a) {
var b = this.a4;
this.a4 = a;
if (b != this.a4) {
this.c0("ItemsSource", b, this.a4);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "dataMemberPath", {
get: function () {
return this.a6;
},
set: function (a) {
var b = this.a6;
this.a6 = a;
if (b != this.a6) {
this.c0("DataMemberPath", b, this.a6);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "selectedMemberPath", {
get: function () {
return this.a8;
},
set: function (a) {
var b = this.a8;
this.a8 = a;
if (b != this.a8) {
this.c0("SelectedMemberPath", b, this.a8);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "bm", {
get: function () {
return this.a7;
},
set: function (a) {
var b = this.a7;
this.a7 = a;
if (b != this.a7) {
this.c0("FilterPlaceholderText", b, this.a7);
}
},
enumerable: false,
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.c0("SearchInputType", enumGetBox(InputGroupDisplayType_$type, b), enumGetBox(InputGroupDisplayType_$type, this.w));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "a3", {
get: function () {
return this.a0;
},
set: function (a) {
var b = this.a0;
this.a0 = a;
if (b != this.a0) {
this.c0("RowHeight", b, this.a0);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "a1", {
get: function () {
if (this.f != null) {
return this.f.actualRowHeight;
}
else if (this.a0 != -1) {
return this.a0;
}
else {
switch (this.density) {
case 4:
case 3: return GridStyleRepository.q;
case 0:
case 2: return GridStyleRepository.r;
case 1: return GridStyleRepository.p;
}
return GridStyleRepository.r;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "ai", {
get: function () {
return this.ag;
},
set: function (a) {
var b = this.ag;
this.ag = a;
if (b != this.ag) {
this.c0("CellTextStyle", b, this.ag);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "indexType", {
get: function () {
return this.k;
},
set: function (a) {
var b = this.k;
this.k = a;
if (b != this.k) {
this.c0("IndexType", enumGetBox(CheckboxListIndexType_$type, b), enumGetBox(CheckboxListIndexType_$type, this.k));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "baseTheme", {
get: function () {
return this.ab;
},
set: function (a) {
var b = this.ab;
this.ab = a;
if (b != this.ab) {
this.c0("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.ab));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "density", {
get: function () {
return this.ad;
},
set: function (a) {
var b = this.ad;
this.ad = a;
if (b != this.ad) {
this.c0("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.ad));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "searchIconColor", {
get: function () {
return this.du;
},
set: function (a) {
var b = this.du;
this.du = a;
if (b != this.du) {
this.c0("SearchIconColor", b, this.du);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "ea", {
get: function () {
return this.ds;
},
set: function (a) {
var b = this.ds;
this.ds = a;
if (b != this.ds) {
this.c0("SearchBackgroundColor", b, this.ds);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "searchTextColor", {
get: function () {
return this.dv;
},
set: function (a) {
var b = this.dv;
this.dv = a;
if (b != this.dv) {
this.c0("SearchTextColor", b, this.dv);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "eb", {
get: function () {
return this.dt;
},
set: function (a) {
var b = this.dt;
this.dt = a;
if (b != this.dt) {
this.c0("SearchBorderColor", b, this.dt);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "aj", {
get: function () {
return this.ah;
},
set: function (a) {
var b = this.ah;
this.ah = a;
if (b != this.ah) {
this.c0("SearchTextStyle", b, this.ah);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d2", {
get: function () {
return this.dm;
},
set: function (a) {
var b = this.dm;
this.dm = a;
if (b != this.dm) {
this.c0("CheckboxTickColor", b, this.dm);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d0", {
get: function () {
return this.dk;
},
set: function (a) {
var b = this.dk;
this.dk = a;
if (b != this.dk) {
this.c0("CheckboxCheckedBackgroundColor", b, this.dk);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d3", {
get: function () {
return this.dn;
},
set: function (a) {
var b = this.dn;
this.dn = a;
if (b != this.dn) {
this.c0("CheckboxUncheckedBackgroundColor", b, this.dn);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d1", {
get: function () {
return this.dl;
},
set: function (a) {
var b = this.dl;
this.dl = a;
if (b != this.dl) {
this.c0("CheckboxCheckedBorderColor", b, this.dl);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d4", {
get: function () {
return this.dp;
},
set: function (a) {
var b = this.dp;
this.dp = a;
if (b != this.dp) {
this.c0("CheckboxUncheckedBorderColor", b, this.dp);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "aa", {
get: function () {
return this.z;
},
set: function (a) {
var b = this.z;
this.z = a;
if (b != this.z) {
this.c0("ScrollbarStyle", enumGetBox(ScrollbarStyle_$type, b), enumGetBox(ScrollbarStyle_$type, this.z));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(CheckboxList.prototype, "d9", {
get: function () {
return this.dr;
},
set: function (a) {
var b = this.dr;
this.dr = a;
if (b != this.dr) {
this.c0("ScrollbarBackground", b, this.dr);
}
},
enumerable: false,
configurable: true
});
CheckboxList.prototype.c0 = function (a, b, c) {
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
this.c6(a, b, c);
};
CheckboxList.prototype.c6 = function (a, b, c) {
switch (a) {
case "IndexType":
this.keys.clear();
this.co();
if (this.keysCleared != null) {
this.keysCleared(this, new CheckboxListKeysClearedEventArgs());
}
this.view.ag();
this.cw(b, c);
break;
case "ItemsSource":
if (this.f != null) {
this.indexType = 1;
if (c != null) {
this.f.groupDescriptions.n();
this.f.sortDescriptions.n();
this.f.filterExpressions.clear();
this.f.summaryDescriptions.n();
}
if (this.f.actualDataSource != null) {
var d = this.f.actualDataSource;
d.schemaChanged = delegateRemove(d.schemaChanged, runOn(this, this.c1));
}
this.f.itemsSource = this.a4;
this.cf();
if (this.f.actualDataSource != null) {
var e = this.f.actualDataSource;
e.schemaChanged = delegateCombine(e.schemaChanged, runOn(this, this.c1));
}
this.an = true;
this.c3();
this.an = false;
this.view.ag();
}
break;
case "DataMemberPath":
case "SelectedMemberPath":
if (this.f != null) {
if (this.a6 != null) {
this.c3();
this.dg();
}
}
break;
case "PrimaryKey":
if (this.f != null) {
this.f.primaryKey = this.primaryKey;
}
break;
case "SelectAllCaptionTextColor":
this.dy = null != this.ee ? this.ee : CheckboxList.d7;
break;
case "SelectAllCaption":
case "ActualSelectAllCaptionTextColor":
this.view.af();
break;
case "showSelectAll":
this.view.ai();
this.view.s();
break;
case "ShowFilter":
this.view.ae();
this.view.s();
break;
case "FilterPlaceholderText":
if (this.s != null) {
this.s.cg = this.bm;
}
break;
case "SearchInputType":
if (this.u != null) {
this.u.d = this.x;
}
break;
case "RowHeight":
if (this.f != null) {
this.f.rowHeight = this.a3;
}
break;
case "CellTextStyle":
if (this.f != null) {
this.f.cellTextStyle = this.ai;
}
this.view.ac();
break;
case "BackgroundColor":
case "TextColor":
case "RowHoverBackgroundColor":
var f = this.f;
if (null != f) {
f.cellTextColor = this.eg;
f.cellBackground = this.backgroundColor;
f.cellSelectedBackground = this.backgroundColor;
f.rowHoverBackground = this.rowHoverBackgroundColor;
}
this.view.ad();
break;
case "BaseTheme":
this.df();
break;
case "Density":
this.de();
break;
case "IsRowHoverEnabled":
if (this.f != null) {
this.f.isRowHoverEnabled = this.ar;
}
break;
case "ScrollbarStyle":
if (this.f != null) {
this.f.scrollbarStyle = this.aa;
}
break;
case "ScrollbarBackground":
if (this.f != null) {
this.f.scrollbarBackground = this.d9;
}
break;
case "SearchIconColor":
this.view.ab();
break;
case "SearchBackgroundColor":
this.v.mc = this.ea;
break;
case "SearchBorderColor":
this.v.md = this.eb;
break;
case "SearchTextColor":
if (this.t != null) {
this.t.d8 = this.searchTextColor;
}
break;
case "SearchTextStyle":
this.t.af = this.aj;
break;
case "CheckboxTickColor":
case "CheckboxCheckedBackgroundColor":
case "CheckboxUncheckedBackgroundColor":
case "CheckboxCheckedBorderColor":
case "CheckboxUncheckedBorderColor":
this.view.y();
if (this.f != null) {
this.f.xq();
}
break;
}
};
CheckboxList.prototype.cw = function (a, b) {
if (this.indexTypeChanged != null) {
this.indexTypeChanged(this, ((function () {
var $ret = new CheckboxListIndexTypeChangedEventArgs();
$ret.b = EnumUtil.getEnumValue(CheckboxListIndexType_$type, a);
$ret.a = EnumUtil.getEnumValue(CheckboxListIndexType_$type, b);
return $ret;
})()));
}
};
CheckboxList.prototype.de = function () {
if (this.f != null) {
this.f.density = this.density;
}
if (this.u != null) {
this.u.t = this.density;
}
this.view.x();
};
CheckboxList.prototype.df = function () {
if (this.u != null) {
this.u.p = this.baseTheme;
}
if (this.t != null) {
this.t.d8 = this.searchTextColor;
}
if (this.f != null) {
this.f.cellTextColor = this.eg;
this.f.cellBackground = this.backgroundColor;
this.f.cellSelectedBackground = this.backgroundColor;
this.f.rowHoverBackground = this.rowHoverBackgroundColor;
}
this.view.z();
};
CheckboxList.prototype.c1 = function (a, b) {
this.an = true;
this.cf();
if (b.schema != null) {
this.c3();
for (var c = 0; c < this.keys.count; c++) {
this.cy(this.keys._inner[c]);
}
this.view.ag();
}
this.an = false;
};
CheckboxList.prototype.c3 = function () {
if (this.af == null && this.a8 != null && this.a8 != "") {
this.af = new FastReflectionHelper(false, this.a8);
}
if (this.a4 != null && this.af != null && this.f.actualDataSource.actualSchema != null) {
this.af.propertyName = this.a8;
var a = this.f.actualDataSource.actualCount;
for (var b = 0; b < a; b++) {
var c = this.f.actualDataSource.getItemAtIndex(b);
var d = this.af.getPropertyValue(c);
if (d == true) {
var e = this.i(c);
if (!this.keys.contains(e)) {
this.keys.add(e);
}
}
}
}
};
CheckboxList.prototype.dg = function () {
this.f.actualColumns.clear();
this.f.primaryKey = this.primaryKey;
this.f.isGroupRowSticky = false;
this.f.rowHeight = this.a3;
this.f.cellBackground = this.backgroundColor;
this.f.cellSelectedBackground = this.backgroundColor;
this.f.density = this.density;
this.f.isRowHoverEnabled = this.ar;
this.f.borderWidth = new Thickness(0, 0);
if (this.ai != null) {
this.f.cellTextStyle = this.ai;
}
var a = new TemplateColumn();
if (this.a8 == null) {
this.a8 = "";
}
a.lo = this.a8;
a.mf = "CheckboxColumn";
var b = new ColumnWidth();
b.c = false;
b.f = 28;
a.width = b;
a.kk = 0;
a.kl = 0;
a.cellUpdating = delegateCombine(a.cellUpdating, runOn(this, this.cg));
this.f.columns.add(a);
this.j = a;
var c = this.f.actualDataSource.resolveSchemaPropertyType(this.a6);
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.lo = this.a6;
d.mf = "DataColumn";
d.kk = 0;
d.g = 0;
this.f.columns.add(d);
};
CheckboxList.prototype.updateHrMargin = function (a) {
this.view.aa(a);
};
CheckboxList.prototype.provideHrElement = function (a) {
this.view.p(a);
};
CheckboxList.prototype.cx = function () {
var a = this.t;
a.changing = delegateCombine(a.changing, runOn(this, this.cm));
this.df();
};
CheckboxList.prototype.cm = function (a, b) {
var c = b.value.toLowerCase();
this.cv(c);
};
CheckboxList.prototype.i = function (a) {
if (this.primaryKey == null) {
return PrimaryKeyValue.createIdentityKey(a);
}
var b = new Array(this.primaryKey.length);
var c = new Array(this.primaryKey.length);
for (var d = 0; d < b.length; d++) {
b[d] = this.primaryKey[d];
c[d] = this.e.getItemProperty(a, b[d]);
}
return new PrimaryKeyValue(b, c);
};
CheckboxList.prototype.da = function (a) {
this.am = true;
var b = this.e.getItemAtIndex(a);
if (this.af != null) {
this.af.setPropertyValue(b, false);
}
var c = this.i(b);
this.keys.remove(c);
this.am = false;
};
CheckboxList.prototype.cc = function (a) {
this.am = true;
var b = this.e.getItemAtIndex(a);
if (this.af != null) {
this.af.setPropertyValue(b, true);
}
var c = this.i(b);
this.keys.add(c);
this.am = false;
};
CheckboxList.prototype.dd = function () {
this.indexType = 0;
this.keys.clear();
this.co();
if (this.keysCleared != null) {
this.keysCleared(this, new CheckboxListKeysClearedEventArgs());
}
};
CheckboxList.prototype.ci = function () {
this.indexType = 1;
this.keys.clear();
this.co();
if (this.keysCleared != null) {
this.keysCleared(this, new CheckboxListKeysClearedEventArgs());
}
};
CheckboxList.prototype.cs = function (a, b, c) {
if (this.f != null) {
this.f.notifySetItem(a, b, c);
}
};
CheckboxList.prototype.cp = function () {
if (this.f != null) {
this.f.notifyClearItems();
}
};
CheckboxList.prototype.co = function () {
if (this.f != null) {
this.f.invalidateVisibleRows();
}
};
CheckboxList.prototype.cq = function (a, b) {
if (this.f != null) {
this.f.notifyInsertItem(a, b);
}
;
};
CheckboxList.prototype.cr = function (a, b) {
if (this.f != null) {
this.f.notifyRemoveItem(a, b);
}
;
};
CheckboxList.prototype.cd = function (a) {
var b = null;
if (this.primaryKey == null || this.primaryKey.length == 0) {
b = new PrimaryKeyValue(null, a);
}
else if (this.primaryKey.length == a.length) {
b = new PrimaryKeyValue(this.primaryKey, a);
}
else {
throw new ArgumentException(1, "value length must match PrimaryKey length");
}
if (b != null) {
if (this.af != null) {
var c = this.e.indexOfKey(a);
var d = this.e.getItemAtIndex(c);
this.af.setPropertyValue(d, true);
}
this.keys.add(b);
}
};
CheckboxList.prototype.db = function (a) {
var b = null;
if (this.primaryKey == null || this.primaryKey.length == 0) {
b = new PrimaryKeyValue(null, a);
}
else if (this.primaryKey.length == a.length) {
b = new PrimaryKeyValue(this.primaryKey, a);
}
else {
throw new ArgumentException(1, "value length must match PrimaryKey length");
}
if (this.keys.contains(b)) {
if (this.af != null) {
var c = this.e.indexOfKey(a);
var d = this.e.getItemAtIndex(c);
this.af.setPropertyValue(d, false);
}
this.keys.remove(b);
}
};
CheckboxList.prototype.getDesiredSize = function (a) {
var b = 248;
var c = 0;
var d = this.ay();