UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

1,515 lines 51.5 kB
/* 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, 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 */ export let CheckboxListView = /*@__PURE__*/ (() => { class CheckboxListView extends Base { constructor() { super(); 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; } n() { } m(a) { if (a == null) { this.f = null; this.e.clear(); return; } this.f = a; this.v(); this.ae(); this.ah(); this.s(); let b = Math.round(a.rootWrapper.width()); let c = Math.round(a.rootWrapper.height()); this.f.rootWrapper.setStyleProperty("position", "relative"); this.f.rootWrapper.setStyleProperty("padding-bottom", "4px"); this.ag(); } v() { if (this.f != null) { this.w(this.f); } } w(a) { let b = a.rootWrapper.getChildAt(0); this.h = b; this.b.v = new XInputGroup(); let c = a.getSubRenderer(b); this.b.v.provideContainer(c); let 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; let e = a.createElement("div"); let f = a.getSubRenderer(e); let g = new XPrefix(); g.provideContainer(f); let h = f.getExternal(g, f.rootWrapper, f.getExternal(this.b, null, null)); let i = a.createElement("div"); let j = a.getSubRenderer(i); this.c = new XIcon(); this.c.provideContainer(j); this.c.fill = this.b.searchIconColor; this.c.svgPath = CheckboxList.b0; let 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); let l = a.createElement("div"); l.setRawStyleProperty("flex-grow", "1"); let m = a.getSubRenderer(l); this.b.t = new XInput(); this.b.t.provideContainer(m); this.b.t.b8 = "text"; let 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(); } s() { if (this.f != null) { let 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 { let b = this.b.ay(); a.setStyleProperty("height", "calc(100% - " + b + "px"); } } } o(a, b, c) { let d = null; if (a.getChildCount() == 0) { d = new XCheckbox(); let e = this.f.getSubRenderer(a); d.provideContainer(e); let 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)); let 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) { let 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; } } z() { if (this.e != null) { for (let a of fromEnum(this.e)) { let b = a.value; b.n = this.b.baseTheme; } } if (this.a != null) { this.a.n = this.b.baseTheme; } } x() { } k(a, b) { let c = a; let d = parseInt(c.a4.toString()); let 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); } l() { } t(a, b) { for (let c of fromEnum(this.e)) { let d = c.value; let e = parseInt(d.a4.toString()); if (e == a) { d.checked = b; this.b.cu(e, b); } } this.ag(); } u(a) { for (let b of fromEnum(this.e)) { let c = b.value; c.checked = a; } } q(a) { this.j = a; if (null != this.j) { this.j.setStyleProperty("margin", "5px 0px 4px 0px"); } } ah() { let a = this.f; if (null == a || null == this.j) { return; } let b = a.createElement("div"); let c = a.getSubRenderer(b); this.a = new XCheckbox(); this.a.provideContainer(c); let 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(); let e = this.a; e.change = delegateCombine(e.change, runOn(this, this.r)); this.a.y = true; } af() { if (null != this.i) { this.i.setRawText(this.b.b4); NativeUI.q(this.i, this.b.dy); } } ai() { if (null != this.i) { let a = this.b.showSelectAll ? "flex" : "none"; this.j.setStyleProperty("display", a); } } ae() { 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"); } } ag(a = true) { if (this.a == null) { return; } let b = this.d; this.d = true; let 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; } } r(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); } } ad() { let a = this.f; if (null == a) { return; } let b = a.rootWrapper; if (null != b) { NativeUI.q(b, this.b.eg); NativeUI.m(b, this.b.backgroundColor); } } ab() { if (this.c != null) { this.c.fill = this.b.searchIconColor; } } ac() { 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"); } } y() { 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; } aa(a) { if (this.g != null) { NativeUI.w(this.g, a); } } p(a) { this.g = a; } } CheckboxListView.$t = /*@__PURE__*/ markType(CheckboxListView, 'CheckboxListView'); return CheckboxListView; })(); /** * @hidden */ export let CheckboxList = /*@__PURE__*/ (() => { class CheckboxList extends Base { get view() { return this._view; } set view(a) { this._view = a; } get v() { return this.u; } set v(a) { this.u = a; } get t() { return this.s; } set t(a) { this.s = a; } get e() { if (this.f == null) { return null; } return this.f.actualDataSource; } get al() { if (this.ak == null) { this.ak = new SRProvider(this.view.f); this.ak.cb("DataGrid"); } return this.ak; } get keys() { return this.g; } get primaryKey() { return this.a; } set primaryKey(a) { let b = this.a; this.a = a; if (b != this.a) { this.c0("PrimaryKey", b, this.a); } } constructor() { super(); 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; let a = this.g; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.c5)); this.g.am(runOn(this, this.c4)); this.d = new FilterFactory(); let b = new CheckboxListView(); b.b = this; this.view = b; this.view.n(); } clearSelectedKeys() { this.keys.clear(); if (this.keysCleared != null) { this.keysCleared(this, new CheckboxListKeysClearedEventArgs()); } } addSelectedKey(a, b) { this.keys.add(new PrimaryKeyValue(a, b)); } insertSelectedKey(a, b, c) { this.keys.insert(a, new PrimaryKeyValue(b, c)); } removeSelectedKeyAt(a) { this.keys.removeAt(a); } c4() { this.co(); if (this.keysCleared != null) { this.keysCleared(this, new CheckboxListKeysClearedEventArgs()); } } c5(a, b) { if (this.e == null || this.e.actualSchema == null || this.am) { return; } switch (b.action) { case 0: for (let c = 0; c < b.newItems.count; c++) { this.cy(b.newItems.item(c)); } break; case 1: for (let d = 0; d < b.oldItems.count; d++) { this.cz(b.oldItems.item(d)); } break; case 2: for (let e = 0; e < b.oldItems.count; e++) { this.cz(b.oldItems.item(e)); } for (let f = 0; f < b.newItems.count; f++) { this.cy(b.newItems.item(f)); } break; case 4: this.view.u(this.indexType == 0); for (let g = 0; g < this.keys.ae.count; g++) { this.cy(this.keys.ae._inner[g]); } break; } } cy(a) { let b = this.e.indexOfKey(a.value); if (b >= 0) { this.view.t(b, this.indexType == 1); } if (this.selectedKeyAdded == null) { return; } this.selectedKeyAdded(this, ((() => { let $ret = new CheckedChangedEventArgs(); $ret.c = b; $ret.b = this.indexType == 1; $ret.a = a.value; return $ret; })())); } cz(a) { let b = this.e.indexOfKey(a.value); if (b >= 0) { this.view.t(b, this.indexType == 0); } if (this.selectedKeyRemoved == null) { return; } this.selectedKeyRemoved(this, ((() => { let $ret = new CheckedChangedEventArgs(); $ret.c = b; $ret.b = this.indexType == 0; $ret.a = a.value; return $ret; })())); } cu(a, b) { if (this.checkedChanged != null && this.an == false) { let c = null; if (this.e.actualPrimaryKey != null && this.e.actualPrimaryKey.length > 0) { c = new Array(this.e.actualPrimaryKey.length); for (let d = 0; d < this.e.actualPrimaryKey.length; d++) { c[d] = this.e.getItemPropertyAtIndex(a, this.e.actualPrimaryKey[d]); } } this.checkedChanged(this, ((() => { let $ret = new CheckedChangedEventArgs(); $ret.c = a; $ret.b = b; $ret.a = c; return $ret; })())); } } notifySizeChanged() { this.view.l(); } destroy() { if (this.f != null) { let a = this.f; a.cellClicked = delegateRemove(a.cellClicked, runOn(this, this.ck)); let b = this.f; b.sizeChanged = delegateRemove(b.sizeChanged, runOn(this, this.cl)); if (this.f.actualDataSource != null) { let c = this.f.actualDataSource; c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.c1)); } } if (this.s != null) { let d = this.s; d.change = delegateRemove(d.change, runOn(this, this.cm)); } this.provideContainer(null, null, null); if (this.j != null) { let e = this.j; e.cellUpdating = delegateRemove(e.cellUpdating, runOn(this, this.cg)); } } provideContainer(a, b, c) { this.f = b; if (null != this.f) { this.f.scrollbarStyle = 1; let 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; let 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); } cl(a, b) { this.f.scrollbarStyle = this.aa; } provideSelectAllSection(a) { this.view.q(a); } ck(a, b) { if (b.cellInfo.l.a5 == 0) { return; } let c = b.cellInfo.l.x; if (-1 == c) { return; } let d = b.cellInfo.hn; let 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); } } cg(a, b) { let c = b.cellInfo.l.x; if (-1 == c) { return; } let d = false; if (b.cellInfo.hn != null) { let e = this.i(b.cellInfo.hn); if (this.keys.contains(e)) { d = true; } } this.view.o(b.content.element, c, d); } cv(a) { if (this.a6 != null) { let b = this.d.property(this.a6).cast(enumGetBox(DataSourceSchemaPropertyType_$type, 0)).toLower(); let c = b.contains(a); if (!this.f.filterExpressions.k.contains(this.c)) { this.c = c; this.f.filterExpressions.add(this.c); } else { let d = this.f.filterExpressions.k.indexOf(this.c); this.f.filterExpressions.k.item(d, this.c = c); } } } get itemsSource() { return this.a4; } set itemsSource(a) { let b = this.a4; this.a4 = a; if (b != this.a4) { this.c0("ItemsSource", b, this.a4); } } get dataMemberPath() { return this.a6; } set dataMemberPath(a) { let b = this.a6; this.a6 = a; if (b != this.a6) { this.c0("DataMemberPath", b, this.a6); } } get selectedMemberPath() { return this.a8; } set selectedMemberPath(a) { let b = this.a8; this.a8 = a; if (b != this.a8) { this.c0("SelectedMemberPath", b, this.a8); } } get bm() { return this.a7; } set bm(a) { let b = this.a7; this.a7 = a; if (b != this.a7) { this.c0("FilterPlaceholderText", b, this.a7); } } get x() { return this.w; } set x(a) { let b = this.w; this.w = a; if (b != this.w) { this.c0("SearchInputType", enumGetBox(InputGroupDisplayType_$type, b), enumGetBox(InputGroupDisplayType_$type, this.w)); } } get a3() { return this.a0; } set a3(a) { let b = this.a0; this.a0 = a; if (b != this.a0) { this.c0("RowHeight", b, this.a0); } } get a1() { 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; } } get ai() { return this.ag; } set ai(a) { let b = this.ag; this.ag = a; if (b != this.ag) { this.c0("CellTextStyle", b, this.ag); } } get indexType() { return this.k; } set indexType(a) { let b = this.k; this.k = a; if (b != this.k) { this.c0("IndexType", enumGetBox(CheckboxListIndexType_$type, b), enumGetBox(CheckboxListIndexType_$type, this.k)); } } get baseTheme() { return this.ab; } set baseTheme(a) { let b = this.ab; this.ab = a; if (b != this.ab) { this.c0("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.ab)); } } get density() { return this.ad; } set density(a) { let b = this.ad; this.ad = a; if (b != this.ad) { this.c0("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.ad)); } } get searchIconColor() { return this.du; } set searchIconColor(a) { let b = this.du; this.du = a; if (b != this.du) { this.c0("SearchIconColor", b, this.du); } } get ea() { return this.ds; } set ea(a) { let b = this.ds; this.ds = a; if (b != this.ds) { this.c0("SearchBackgroundColor", b, this.ds); } } get searchTextColor() { return this.dv; } set searchTextColor(a) { let b = this.dv; this.dv = a; if (b != this.dv) { this.c0("SearchTextColor", b, this.dv); } } get eb() { return this.dt; } set eb(a) { let b = this.dt; this.dt = a; if (b != this.dt) { this.c0("SearchBorderColor", b, this.dt); } } get aj() { return this.ah; } set aj(a) { let b = this.ah; this.ah = a; if (b != this.ah) { this.c0("SearchTextStyle", b, this.ah); } } get d2() { return this.dm; } set d2(a) { let b = this.dm; this.dm = a; if (b != this.dm) { this.c0("CheckboxTickColor", b, this.dm); } } get d0() { return this.dk; } set d0(a) { let b = this.dk; this.dk = a; if (b != this.dk) { this.c0("CheckboxCheckedBackgroundColor", b, this.dk); } } get d3() { return this.dn; } set d3(a) { let b = this.dn; this.dn = a; if (b != this.dn) { this.c0("CheckboxUncheckedBackgroundColor", b, this.dn); } } get d1() { return this.dl; } set d1(a) { let b = this.dl; this.dl = a; if (b != this.dl) { this.c0("CheckboxCheckedBorderColor", b, this.dl); } } get d4() { return this.dp; } set d4(a) { let b = this.dp; this.dp = a; if (b != this.dp) { this.c0("CheckboxUncheckedBorderColor", b, this.dp); } } get aa() { return this.z; } set aa(a) { let b = this.z; this.z = a; if (b != this.z) { this.c0("ScrollbarStyle", enumGetBox(ScrollbarStyle_$type, b), enumGetBox(ScrollbarStyle_$type, this.z)); } } get d9() { return this.dr; } set d9(a) { let b = this.dr; this.dr = a; if (b != this.dr) { this.c0("ScrollbarBackground", b, this.dr); } } c0(a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } this.c6(a, b, c); } c6(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) { let 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) { let 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": let 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; } } cw(a, b) { if (this.indexTypeChanged != null) { this.indexTypeChanged(this, ((() => { let $ret = new CheckboxListIndexTypeChangedEventArgs(); $ret.b = EnumUtil.getEnumValue(CheckboxListIndexType_$type, a); $ret.a = EnumUtil.getEnumValue(CheckboxListIndexType_$type, b); return $ret; })())); } } de() { if (this.f != null) { this.f.density = this.density; } if (this.u != null) { this.u.t = this.density; } this.view.x(); } df() { 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(); } c1(a, b) { this.an = true; this.cf(); if (b.schema != null) { this.c3(); for (let c = 0; c < this.keys.count; c++) { this.cy(this.keys._inner[c]); } this.view.ag(); } this.an = false; } c3() { 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; let a = this.f.actualDataSource.actualCount; for (let b = 0; b < a; b++) { let c = this.f.actualDataSource.getItemAtIndex(b); let d = this.af.getPropertyValue(c); if (d == true) { let e = this.i(c); if (!this.keys.contains(e)) { this.keys.add(e); } } } } } dg() { 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; } let a = new TemplateColumn(); if (this.a8 == null) { this.a8 = ""; } a.lo = this.a8; a.mf = "CheckboxColumn"; let 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; let c = this.f.actualDataSource.resolveSchemaPropertyType(this.a6); let 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); } updateHrMargin(a) { this.view.aa(a); } provideHrElement(a) { this.view.p(a); } cx() { let a = this.t; a.changing = delegateCombine(a.changing, runOn(this, this.cm)); this.df(); } cm(a, b) { let c = b.value.toLowerCase(); this.cv(c); } i(a) { if (this.primaryKey == null) { return PrimaryKeyValue.createIdentityKey(a); } let b = new Array(this.primaryKey.length); let c = new Array(this.primaryKey.length); for (let d = 0; d < b.length; d++) { b[d] = this.primaryKey[d]; c[d] = this.e.getItemProperty(a, b[d]); } return new PrimaryKeyValue(b, c); } da(a) { this.am = true; let b = this.e.getItemAtIndex(a); if (this.af != null) { this.af.setPropertyValue(b, false); } let c = this.i(b); this.keys.remove(c); this.am = false; } cc(a) { this.am = true; let b = this.e.getItemAtIndex(a); if (this.af != null) { this.af.setPropertyValue(b, true); } let c = this.i(b); this.keys.add(c); this.am = false; } dd() { this.indexType = 0; this.keys.clear(); this.co(); if (this.keysCleared != null) { this.keysCleared(this, new CheckboxListKeysClearedEventArgs()); } } ci() { this.indexType = 1; this.keys.clear(); this.co(); if (this.keysCleared != null) { this.keysCleared(this, new CheckboxListKeysClearedEventArgs()); } } cs(a, b, c) { if (this.f != null) { this.f.notifySetItem(a, b, c); } } cp() { if (this.f != null) { this.f.notifyClearItems(); } } co() { if (this.f != null) { this.f.invalidateVisibleRows(); } } cq(a, b) { if (this.f != null) { this.f.notifyInsertItem(a, b); } ; } cr(a, b) { if (this.f != null) { this.f.notifyRemoveItem(a, b); } ; } cd(a) { let 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) { let c = this.e.indexOfKey(a); let d = this.e.getItemAtIndex(c); this.af.setPropertyValue(d, true); } this.keys.add(b); } } db(a) { let 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) { let c = this.e.indexOfKey(a); let d = this.e.getItemAtIndex(c); this.af.setPropertyValue(d, false); } this.keys.remove(b); } } getDesiredSize(a) { let b = 248; let c = 0; let d = this.ay(); let e = 5; if (this.f != null && this.f.actualDataSource != null && this.f.actualDataSource.actualCount > 0) { e = this.f.actualDataSource.actualCount; } let f = this.a1 * e; let g = this.a1 * (this.showSelectAll ? 4 : 5); let h = f > g ? g : f; let i = d + h; if (isPositiveInfinity(a.height)) { c = i; } else { if (a.height <= i) { c = i; } else { let j = a.height - i; c = d + j; } } return new Size(1, b, c); } ay() { let a = 0; a += ComponentSizeHelpers.d(this.density, this.baseTheme); a += ComponentSizeHelpers.c(this.density, this.baseTheme); a += (0.8 + 6); a += 4; if (this.showSelectAll) { a += this.a1; } a += 4; return a; } get b4() { return this.b3 != null ? this.b3 : !stringIsNullOrWhiteSpace(this.al.b1("Select_All")) ? this.al.b1("Select_All") : "(Select All)"; } set b4(a) { if (a == this.b3) { return; } let b = this.b3; this.b3 = a; this.c0("SelectAllCaption", b, this.b3); } get ee() { return this.dw; } set ee(a) { let b = this.dw; this.dw = a; if (b != this.dw) { this.c0("SelectAllCaptionTextColor", b, a); } } get dy() { return this.di; } set dy(a) { let b = this.di; this.di = a; if (b != this.di) { this.c0("ActualSelectAllCaptionTextColor", b, a); } } get as() { if (-1 == this.a2) { return false; } let a = this.keys.count; if (0 == a) { return false; } if (a == this.a2) { return false; } return true; } get showSelectAll() { return this.av; } set showSelectAll(a) { if (a == this.av) { return; } let b = this.av; this.av = a; this.c0("showSelectAll", b, this.av); } get backgroundColor() { return this.dj; } set backgroundColor(a) { let b = this.dj; this.dj = a; if (b != this.dj) { this.c0("BackgroundColor", b, a); } } get rowHoverBackgroundColor() { return this.dq; } set rowHoverBackgroundColor(a) { let b = this.dq; this.dq = a; if (b != this.dq) { this.c0("RowHoverBackgroundColor", b, a); } } get eg() { return this.dx; } set eg(a) { let b = this.dx; this.dx = a; if (b != this.dx) { this.c0("TextColor", b, a); } } c2(a) { if (this.selectAllCheckboxChanged != null) { this.selectAllCheckboxChanged(this, ((() => { let $ret = new SelectAllCheckboxChangedEventArgs(); $ret.a = a; return $ret; })())); } } ap() { if (-1 == this.a2) { return true; } let a = this.keys.count; switch (this.indexType) { case 0: return this.a2 == a; case 1: return 0 == a; default: return false; } } ao() { if (-1 == this.a2) { return false; } let a = this.keys.count; switch (this.indexType) { case 0: return 0 == a; case 1: return this.a2 == a; default: return false; } } cf() { let a = this.f.ac