UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

1,494 lines 59.7 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 { __extends, __values } from "tslib"; import { Base, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, runOn, delegateCombine, typeCast, delegateRemove, fromEn, enumGetBox, fromEnum, Number_$type, String_$type } from "igniteui-react-core"; import { RenderingContext } from "igniteui-react-core"; import { FontInfo } from "igniteui-react-core"; import { CanvasViewRenderer } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { NativeUI } from "igniteui-react-core"; import { FontUtil } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { SRProvider } from "igniteui-react-core"; import { PropertyEditorPropertyDescriptionCollection } from "igniteui-react-layouts"; import { InputGroupDisplayType_$type } from "igniteui-react-inputs"; import { BaseControlTheme_$type } from "igniteui-react-core"; import { ControlDisplayDensity_$type } from "igniteui-react-core"; import { Dictionary$2 } from "igniteui-react-core"; import { DataGridColumn } from "./DataGridColumn"; import { FilterFactory } from "igniteui-react-core"; import { PropertyEditorPropertyDescription } from "igniteui-react-layouts"; import { HorizontalPropertyEditorDataSource } from "./HorizontalPropertyEditorDataSource"; import { PropertyEditorDataSource } from "igniteui-react-layouts"; import { TextColumn } from "./TextColumn"; import { TemplateColumn } from "./TemplateColumn"; import { Thickness } from "igniteui-react-core"; import { ColumnWidth } from "./ColumnWidth"; import { PropertyEditorValueType_$type } from "igniteui-react-layouts"; import { DropDownDataListItem } from "./DropDownDataListItem"; import { PropertyEditorTreeTransformer } from "igniteui-react-layouts"; import { BrushUtil } from "igniteui-react-core"; import { truncate, tryParseNumber } from "igniteui-react-core"; import { stringIsNullOrEmpty, stringContains, stringReplace } from "igniteui-react-core"; import { stringSplit } from "igniteui-react-core"; /** * @hidden */ var PropertyEditorView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(PropertyEditorView, _super); function PropertyEditorView() { var _this = _super.call(this) || this; _this.o = null; _this.n = null; _this.b = null; _this.j = null; _this.m = null; _this.f = null; _this.l = null; _this.c = ((function () { var $ret = new FontInfo(); $ret.q = "Verdana"; $ret.f = 13; $ret.t = "Normal"; $ret.v = "Normal"; $ret.r = "Normal"; return $ret; })()); _this.af = new Size(); _this.d = null; _this._gridExternal = null; _this.a = null; _this.g = false; _this.k = null; return _this; } PropertyEditorView.prototype.z = function () { }; PropertyEditorView.prototype.x = function (a) { var _this = this; if (a == null) { this.j = null; return; } this.j = a; this.m = this.j.createElement("canvas"); this.f = new RenderingContext(new CanvasViewRenderer(), this.j.get2DCanvasContext(this.m)); this.l = this.j.createElement("div"); this.ad(); this.j.getPortal(this.j.rootWrapper, "DataGrid", function (b) { _this._gridExternal = b.componentRef; _this.a = (_this._gridExternal.i); _this._gridExternal.height = '100%'; _this.b.dk(_this.a, null); _this.ab(); }, false); var b = Math.round(a.rootWrapper.width()); var c = Math.round(a.rootWrapper.height()); this.j.rootWrapper.setStyleProperty("position", "relative"); }; PropertyEditorView.prototype.ad = function () { }; PropertyEditorView.prototype.ab = function () { if (this.j != null) { } }; PropertyEditorView.prototype.w = function () { if (this.j == null) { return; } var a = this.j.rootWrapper.width(); var b = this.j.rootWrapper.height(); this.af = new Size(1, a, b); if (this.b.l != null) { this.b.d5(); } }; PropertyEditorView.prototype.ae = function () { var a = this.j; if (null == a) { return; } var b = a.rootWrapper; if (null != b) { NativeUI.q(b, this.b.ec); NativeUI.m(b, this.b.d8); } }; PropertyEditorView.prototype.e = function () { return this.c; }; PropertyEditorView.prototype.y = function () { }; PropertyEditorView.prototype.aa = function () { }; PropertyEditorView.prototype.v = function () { var a = this.b.ed(); if (a.height > 0) { this.j.rootWrapper.setStyleProperty("min-height", a.height + "px"); } }; PropertyEditorView.prototype.h = function () { return this.af.width; }; PropertyEditorView.prototype.i = function (a) { this.d = this.b.ae(); return FontUtil.measureStringWidth(a, this.d, this.f); }; PropertyEditorView.prototype.t = function (a, b) { var _this = this; var cnt_ = a.content; var c = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; var d = false; if (c == null) { this.j.getPortal(cnt_.element, "XInputGroup", function (e) { var contenti_ = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; d = true; var inputExternal_ = e.componentRef; var inputInternal_ = (inputExternal_.i); var f = inputInternal_.view.s; cnt_.__int = inputInternal_; inputExternal_.width = '100%'; inputExternal_.height = '100%'; cnt_.element.setStyleProperty("line-height", "0"); _this.j.getPortal(f, "XInput", function (g) { var iExternal_ = g.componentRef; var iInternal_ = (iExternal_.i); inputInternal_.inputs.add(iInternal_); b(inputInternal_, d); }, false); }, false); } else { var content_ = c; var impl_ = cnt_.__int; var e = (impl_ == null || impl_ == undefined); if (e) { return; } b(impl_, d); } }; PropertyEditorView.prototype.s = function (a, b) { var cnt_ = a.content; var c = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; var d = false; if (c == null) { this.j.getPortal(cnt_.element, "MultiColumnComboBox", function (e) { var contenti_ = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; d = true; var inputExternal_ = e.componentRef; var inputInternal_ = (inputExternal_.i); cnt_.__int = inputInternal_; inputExternal_.width = '100%'; inputExternal_.height = '100%'; cnt_.element.setStyleProperty("line-height", "0"); b(inputInternal_, d); }, false); } else { var content_ = c; var impl_ = cnt_.__int; var e = (impl_ == null || impl_ == undefined); if (e) { return; } b(impl_, d); } }; PropertyEditorView.prototype.r = function (a, b) { var cnt_ = a.content; var c = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; var d = false; if (c == null) { cnt_.element.setStyleProperty("height", "100%"); var e_1 = this.j.createElement("div"); e_1.setStyleProperty("width", "100%"); e_1.setStyleProperty("height", "100%"); e_1.setStyleProperty("display", "flex"); e_1.setStyleProperty("flex-direction", "column"); e_1.setStyleProperty("justify-content", "center"); cnt_.element.append(e_1); this.j.getPortal(e_1, "XCheckbox", function (f) { d = true; var inputExternal_ = f.componentRef; var inputInternal_ = (inputExternal_.i); cnt_.__int = inputInternal_; inputExternal_.width = '100%'; inputExternal_.height = '100%'; e_1.setStyleProperty("line-height", "0"); b(inputInternal_, d); }, false); } else { var content_ = c.getChildAt(0); var impl_ = cnt_.__int; var f = (impl_ == null || impl_ == undefined); if (f) { return; } b(impl_, d); } }; PropertyEditorView.prototype.q = function (a, b) { var cnt_ = a.content; var c = cnt_.element.getChildCount() > 0 ? cnt_.element.getChildAt(0) : null; var d = false; if (c == null) { cnt_.element.setStyleProperty("height", "100%"); var e_2 = this.j.createElement("div"); e_2.setStyleProperty("width", "100%"); e_2.setStyleProperty("height", "100%"); e_2.setStyleProperty("display", "flex"); e_2.setStyleProperty("flex-direction", "column"); e_2.setStyleProperty("justify-content", "center"); cnt_.element.append(e_2); this.j.getPortal(e_2, "XButton", function (f) { d = true; var buttonExternal_ = f.componentRef; var buttonInternal_ = (buttonExternal_.i); cnt_.__int = buttonInternal_; buttonExternal_.width = '100%'; buttonExternal_.height = '100%'; e_2.setStyleProperty("line-height", "0"); b(buttonInternal_, d); }, false); } else { var content_ = c.getChildAt(0); var impl_ = cnt_.__int; var f = (impl_ == null || impl_ == undefined); if (f) { return; } b(impl_, d); } }; PropertyEditorView.prototype.u = function (a, b) { if (this.k == null) { this.k = this.j.createElement("div"); } b(this.k.getNativeElement()); }; PropertyEditorView.prototype.ac = function (ig_, a) { var b = null; var c = ig_.__span ? ig_.__span : null; if (c != null) { b = c; } else { b = this.j.createElement("span"); var set_ = b; ig_.__span = set_; ig_.appendButtonContent(b); } b.setRawText(a); }; PropertyEditorView.$t = markType(PropertyEditorView, 'PropertyEditorView'); return PropertyEditorView; }(Base)); export { PropertyEditorView }; /** * @hidden */ var PropertyEditor = /** @class */ /*@__PURE__*/ (function (_super) { __extends(PropertyEditor, _super); function PropertyEditor() { var _this = _super.call(this) || this; _this.m = null; _this.l = null; _this.ab = null; _this.d = null; _this.ah = false; _this.c = null; _this.n = null; _this.o = null; _this.ai = false; _this.af = null; _this.propertyChanged = null; _this.an = false; _this.t = null; _this.u = new PropertyEditorPropertyDescriptionCollection(); _this.bx = null; _this.p = 3; _this.bn = -1; _this.ac = null; _this.x = 1; _this.z = 2; _this.bv = null; _this.am = true; _this.au = new Dictionary$2(DataGridColumn.$, Number_$type, 0); _this.h = null; _this.i = null; _this.f = null; _this.bt = null; _this.bw = null; _this.aj = false; _this.al = false; _this.ak = false; _this.d6 = PropertyEditor.d9; _this.d7 = PropertyEditor.ea; _this.br = 0; _this.bo = -1; _this.r = null; _this.d = new FilterFactory(); var a = new PropertyEditorView(); a.b = _this; var b = _this.properties; b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.dz)); _this.m = a; _this.m.z(); return _this; } Object.defineProperty(PropertyEditor.prototype, "e", { get: function () { if (this.l == null) { return null; } return this.l.actualDataSource; }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "ag", { get: function () { if (this.af == null) { this.af = new SRProvider(this.m.j); this.af.cb("DataGrid"); } return this.af; }, enumerable: false, configurable: true }); PropertyEditor.prototype.dz = function (a, b) { var e_3, _a, e_4, _b; if (b.oldItems != null) { try { for (var _c = __values(fromEn(b.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) { var c = _d.value; if (typeCast(INotifyPropertyChanged_$type, c) !== null) { var d = c; d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.dn)); } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_3) throw e_3.error; } } } if (b.newItems != null) { try { for (var _e = __values(fromEn(b.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) { var e = _f.value; if (typeCast(INotifyPropertyChanged_$type, e) !== null) { var f = e; f.propertyChanged = delegateCombine(f.propertyChanged, runOn(this, this.dn)); } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_4) throw e_4.error; } } } this.ar(); if (this.properties.count > 0 && this.actualProperties != this.properties) { this.actualProperties = this.properties; } if (this.l != null) { this.l.notifyClearItems(); } }; PropertyEditor.prototype.dn = function (a, b) { if (!this.an) { this.ar(); if (this.l != null) { this.d5(); } } }; PropertyEditor.prototype.notifySizeChanged = function () { this.m.w(); }; PropertyEditor.prototype.dk = function (a, b) { this.l = a; if (null != this.l) { this.l.headerHeight = 0; this.l.rowSeparatorHeight = 0; this.l.autoGenerateColumns = false; this.l.activationMode = 0; this.l.editMode = 0; var c = this.l; c.cellClicked = delegateCombine(c.cellClicked, runOn(this, this.dj)); if (this.actualProperties != null) { this.l.itemsSource = this.actualProperties; this.cn(); } if (this.actualProperties != null) { this.d5(); } } }; PropertyEditor.prototype.destroy = function () { if (this.l != null) { var a = this.l; a.cellClicked = delegateRemove(a.cellClicked, runOn(this, this.dj)); } if (this.n != null) { var b = this.n; b.change = delegateRemove(b.change, runOn(this, this.dm)); } this.provideContainer(null); }; PropertyEditor.prototype.provideContainer = function (a) { this.m.x(a); }; PropertyEditor.prototype.dj = function (a, b) { }; PropertyEditor.prototype.dv = function (a) { }; Object.defineProperty(PropertyEditor.prototype, "actualProperties", { get: function () { return this.t; }, set: function (a) { var b = this.t; this.t = a; if (b != this.t) { this.dw("ActualProperties", b, this.t); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "properties", { get: function () { return this.u; }, set: function (a) { var b = this.u; this.u = a; if (b != this.u) { this.dw("Properties", b, this.u); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "b9", { get: function () { return this.bx; }, set: function (a) { var b = this.bx; this.bx = a; if (b != this.bx) { this.dw("FilterPlaceholderText", b, this.bx); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "q", { get: function () { return this.p; }, set: function (a) { var b = this.p; this.p = a; if (b != this.p) { this.dw("SearchInputType", enumGetBox(InputGroupDisplayType_$type, b), enumGetBox(InputGroupDisplayType_$type, this.p)); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "bs", { get: function () { return this.bn; }, set: function (a) { var b = this.bn; this.bn = a; if (b != this.bn) { this.dw("RowHeight", b, this.bn); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "ad", { get: function () { return this.ac; }, set: function (a) { var b = this.ac; this.ac = a; if (b != this.ac) { this.dw("CellTextStyle", b, this.ac); } }, enumerable: false, configurable: true }); PropertyEditor.prototype.ae = function () { if (this.ad == null) { return this.m.e(); } return this.ad; }; Object.defineProperty(PropertyEditor.prototype, "y", { get: function () { return this.x; }, set: function (a) { var b = this.x; this.x = a; if (b != this.x) { this.dw("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.x)); } }, enumerable: false, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "aa", { get: function () { return this.z; }, set: function (a) { var b = this.z; this.z = a; if (b != this.z) { this.dw("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.z)); } }, enumerable: false, configurable: true }); PropertyEditor.prototype.dw = function (a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } this.d0(a, b, c); }; PropertyEditor.prototype.d0 = function (a, b, c) { switch (a) { case "DescriptionType": if (this.b7 == null) { if (this.properties == null) { this.actualProperties = null; } } if (this.b7 != null) { if (this.r == null) { this.r = new PropertyEditorDataSource(); } this.r.n = this.b7; } if (this.properties == null || this.properties.count == 0) { if (this.r.h != null) { this.actualProperties = this.r.h; } } else { if (this.properties != null && this.properties.count > 0) { this.ar(); } } break; case "ComponentRenderer": if (b != null) { b.removeTargetPropertyUpdatingListener(runOn(this, this.at)); } if (b != c) { this.am = true; } if (this.g == null) { this.j = this.k; } else { this.j = this.g.context; } break; case "Target": break; case "DescriptionContext": if (this.g == null) { this.j = c; } break; case "ActualContext": if (this.j == null) { if (this.properties == null) { this.actualProperties = null; } } if (this.j != null) { if (this.r == null) { this.r = new PropertyEditorDataSource(); } this.r.b = this.j; } if (this.properties == null || this.properties.count == 0) { if (this.r.h != null) { this.actualProperties = this.r.h; } } else { if (this.properties != null && this.properties.count > 0) { this.ar(); } } break; case "Properties": this.actualProperties = this.properties; break; case "IsWrappingEnabled": this.d5(); break; case "IsHorizontal": if (this.ao) { if (this.actualProperties != null && !(typeCast(HorizontalPropertyEditorDataSource.$, this.actualProperties) !== null)) { this.actualProperties = new HorizontalPropertyEditorDataSource(this.actualProperties); } } else { if (typeCast(HorizontalPropertyEditorDataSource.$, this.actualProperties) !== null) { var d = this.actualProperties; this.actualProperties = d.ae; } } break; case "ActualProperties": if (this.ao) { if (this.actualProperties != null && !(typeCast(HorizontalPropertyEditorDataSource.$, this.actualProperties) !== null)) { this.actualProperties = new HorizontalPropertyEditorDataSource(this.actualProperties); } } else { if (typeCast(HorizontalPropertyEditorDataSource.$, this.actualProperties) !== null) { var e = this.actualProperties; this.actualProperties = e.ae; } } if (this.l != null) { if (c != null) { this.l.groupDescriptions.n(); this.l.sortDescriptions.n(); this.l.filterExpressions.clear(); this.l.summaryDescriptions.n(); } if (this.l.actualDataSource != null) { var f = this.l.actualDataSource; f.schemaChanged = delegateRemove(f.schemaChanged, runOn(this, this.dy)); } var g = this.l.itemsSource != this.actualProperties; var h = this.actualProperties; h = this.actualProperties.toArray(); this.l.itemsSource = h; this.cn(); if (this.l.actualDataSource != null) { var i = this.l.actualDataSource; i.schemaChanged = delegateCombine(i.schemaChanged, runOn(this, this.dy)); } if (g) { this.d5(); } } break; case "FilterPlaceholderText": if (this.n != null) { this.n.cg = this.b9; } break; case "SearchInputType": if (this.o != null) { this.o.d = this.q; } break; case "RowHeight": if (this.l != null) { this.l.rowHeight = this.bs; } break; case "CellTextStyle": if (this.l != null) { this.l.cellTextStyle = this.ad; } break; case "BackgroundColor": case "TextColor": var j = this.l; if (null != j) { j.cellTextColor = this.ec; j.cellBackground = this.d8; } this.m.ae(); break; case "BaseTheme": this.d4(); break; case "Density": this.d3(); break; } }; PropertyEditor.prototype.ar = function () { var e_5, _a; var a = this.an; this.an = true; var b = false; try { for (var _b = __values(fromEnum(this.properties)), _c = _b.next(); !_c.done; _c = _b.next()) { var c = _c.value; var d = c.a3; if (this.r != null) { var e = this.r.e(d, false); if (e != null) { if (c.z(e)) { b = true; } } } } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_5) throw e_5.error; } } if (b) { this.d5(); } else if (this.l != null) { this.l.notifyClearItems(); } this.an = a; return b; }; PropertyEditor.prototype.d3 = function () { if (this.l != null) { this.l.density = this.aa; } if (this.o != null) { this.o.t = this.aa; } this.m.y(); }; PropertyEditor.prototype.d4 = function () { if (this.o != null) { this.o.p = this.y; } this.m.aa(); }; PropertyEditor.prototype.dy = function (a, b) { this.ai = true; this.cn(); this.ai = false; }; PropertyEditor.prototype.d5 = function () { if (this.l == null) { return; } this.au.clear(); this.l.actualColumns.clear(); this.l.isGroupRowSticky = false; this.l.rowHeight = this.bs == -1 ? 38 : this.bs; this.l.cellBackground = this.d8; this.l.cellSelectedBackground = this.d8; this.l.density = this.aa; this.l.borderWidth = new Thickness(0, 0); if (this.ad != null) { this.l.cellTextStyle = this.ad; } if (this.ao) { this.cp(); } else { var a = new TextColumn(); a.kk = 10; a.kl = 5; a.lo = "PropertyPath"; a.dataBinding = delegateCombine(a.dataBinding, runOn(this, this.dp)); this.l.columns.add(a); var b = new TemplateColumn(); b.lo = "ValueType"; b.kk = 5; b.kl = 5; b.dataBinding = delegateCombine(b.dataBinding, runOn(this, this.cu)); b.cellStyleKeyRequested = delegateCombine(b.cellStyleKeyRequested, runOn(this, this.cs)); b.cellUpdating = delegateCombine(b.cellUpdating, runOn(this, this.ct)); this.l.columns.add(b); } }; PropertyEditor.prototype.cp = function () { if (this.actualProperties == null) { return; } var a = this.actualProperties.ae; var b = a.count; var c = new List$1(DataGridColumn.$, 0); var d = this.bp(a, b, c, 0x7FFFFFFF); for (var e = 0; e < c.count; e++) { this.l.columns.add(c._inner[e]); } this.br = d; var f = this.actualProperties; var g = f.count; f.clear(); for (var h = 0; h < this.br; h++) { f.add(new PropertyEditorPropertyDescription()); } if (f.count != g) { var i = f.toArray(); this.l.itemsSource = i; this.m.v(); } }; PropertyEditor.prototype.ed = function () { if (this.ao && this.l != null && this.l.itemsSource != null) { var a = this.l.actualRowHeight; var b = this.l.itemsSource; return new Size(1, 0, b.count * a); } else { return new Size(1, 0, 0); } }; PropertyEditor.prototype.bp = function (a, b, c, d) { var e = 0; var f = 0; var g = 0; var h = this.m.h(); h -= 5; if (!this.aq) { h = 1.7976931348623157E+308; } var i = 0; var j = h; var _loop_1 = function (k) { var l = a.item(k); var m = this_1.be(l); var n = this_1.ba(l); if ((i + m + n > h && g > 0) || g >= d) { if (f != 0 && g < d && d > 2) { var o = c._inner[g]; var p = c._inner[g + 1]; o.width.f = m; p.width.f = n; this_1.d2(h, c); if (c.count == 0) { return { value: 0 }; } return { value: this_1.bp(a, b, c, c.count) }; } d = Math.max(Math.min(d, g), 2); f++; var q = h - i; if (q < j) { j = q; } i = 0; g = 0; } var r = this_1.cc(l); if (c.count <= g) { var s = new TextColumn(); s.kk = 10; s.kl = 5; s.width = ((function () { var $ret = new ColumnWidth(); $ret.c = false; $ret.f = m; return $ret; })()); s.dataBinding = delegateCombine(s.dataBinding, runOn(this_1, this_1.dp)); s.mf = "PropertyName_" + k; s.lo = "PropertyName"; c.add(s); this_1.au.item(s, c.count - 1); g++; } else { var t = c._inner[g]; if (m > t.width.f) { var u = m - t.width.f; t.width = ((function () { var $ret = new ColumnWidth(); $ret.c = false; $ret.f = m; return $ret; })()); if (u > j && d > 2) { this_1.d2(h, c); if (c.count == 0) { return { value: 0 }; } return { value: this_1.bp(a, b, c, c.count) }; } else { j -= u; if (j < 0) { j = 0; } g++; } } else { m = t.width.f; g++; } } if (c.count <= g) { var v = new TemplateColumn(); v.mf = "ValueType_" + k; v.lo = "ValueType"; v.kk = 5; v.kl = 5; v.dataBinding = delegateCombine(v.dataBinding, runOn(this_1, this_1.cu)); v.width = ((function () { var $ret = new ColumnWidth(); $ret.c = false; $ret.f = n; return $ret; })()); v.cellStyleKeyRequested = delegateCombine(v.cellStyleKeyRequested, runOn(this_1, this_1.cs)); v.cellUpdating = delegateCombine(v.cellUpdating, runOn(this_1, this_1.ct)); c.add(v); this_1.au.item(v, c.count - 1); g++; } else { var w = c._inner[g]; if (n > w.width.f) { var x = n - w.width.f; w.width = ((function () { var $ret = new ColumnWidth(); $ret.c = false; $ret.f = n; return $ret; })()); if (x > j && d > 2) { this_1.d2(h, c); if (c.count == 0) { return { value: 0 }; } return { value: this_1.bp(a, b, c, c.count) }; } else { j -= x; if (j < 0) { j = 0; } g++; } } else { n = w.width.f; g++; } } i += m + n; }; var this_1 = this; for (var k = 0; k < b; k++) { var state_1 = _loop_1(k); if (typeof state_1 === "object") return state_1.value; } return f + 1; }; PropertyEditor.prototype.d2 = function (a, b) { var e_6, _a; var c = 0; try { for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) { var d = _c.value; c += d.width.f; } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_6) throw e_6.error; } } while (c > a) { if (b.count < 1) { return; } if (typeCast(TemplateColumn.$, b._inner[b.count - 1]) !== null) { c -= b._inner[b.count - 1].width.f; c -= b._inner[b.count - 2].width.f; b.removeAt(b.count - 1); b.removeAt(b.count - 1); } else { c -= b._inner[b.count - 1].width.f; b.removeAt(b.count - 1); } } }; PropertyEditor.prototype.cu = function (a, b) { var c = a; var d = this.s(c, b.cellInfo.fb, b.rowObject); b.resolvedValue = enumGetBox(PropertyEditorValueType_$type, d != null ? d.w : 0); }; PropertyEditor.prototype.dp = function (a, b) { var c = a; var d = this.s(c, b.cellInfo.fb, b.rowObject); if (d == null) { b.resolvedValue = null; return; } b.resolvedValue = d.az != null ? d.az : d.a3; }; PropertyEditor.prototype.ba = function (a) { switch (a.w) { case 10: return this.aw(a); case 7: return this.ax(a); case 4: return this.az(a); case 6: return this.ay(a); case 23: return this.a8(a); case 9: return this.a2(a); case 5: return this.a4(a); case 14: return this.a3(a); case 18: return this.a5(a); case 3: return this.a6(a); case 15: return this.bb(a); case 17: return this.bc(a); case 16: return this.bf(a); case 1: return this.bg(a); case 11: return this.bh(a); case 13: return this.bi(a); case 12: return this.bj(a); case 2: return this.bk(a); case 8: return this.bl(a); case 19: return this.bm(a); case 0: return this.bd(a); case 20: return this.a0(a); } return 100; }; PropertyEditor.prototype.bm = function (a) { return this.bd(a); }; PropertyEditor.prototype.bd = function (a) { return 175; }; PropertyEditor.prototype.a0 = function (a) { return 80; }; PropertyEditor.prototype.bl = function (a) { return this.a0(a); }; PropertyEditor.prototype.bk = function (a) { return this.bd(a); }; PropertyEditor.prototype.bj = function (a) { return this.bd(a); }; PropertyEditor.prototype.bi = function (a) { return this.bd(a); }; PropertyEditor.prototype.bh = function (a) { return this.bd(a); }; PropertyEditor.prototype.bg = function (a) { return this.bd(a); }; PropertyEditor.prototype.bf = function (a) { return this.a0(a); }; PropertyEditor.prototype.bc = function (a) { return this.a0(a); }; PropertyEditor.prototype.bb = function (a) { return this.a9(a); }; PropertyEditor.prototype.a9 = function (a) { return this.bd(a); }; PropertyEditor.prototype.a6 = function (a) { return this.a7(a); }; PropertyEditor.prototype.a7 = function (a) { return this.bd(a); }; PropertyEditor.prototype.a5 = function (a) { return this.a0(a); }; PropertyEditor.prototype.a3 = function (a) { return this.a0(a); }; PropertyEditor.prototype.a4 = function (a) { return this.bd(a); }; PropertyEditor.prototype.a2 = function (a) { return this.a0(a); }; PropertyEditor.prototype.ay = function (a) { return this.a0(a); }; PropertyEditor.prototype.a8 = function (a) { return this.bd(a); }; PropertyEditor.prototype.az = function (a) { return this.bd(a); }; PropertyEditor.prototype.ax = function (a) { return this.a1(a); }; PropertyEditor.prototype.a1 = function (a) { return 50; }; PropertyEditor.prototype.aw = function (a) { return this.a0(a); }; PropertyEditor.prototype.be = function (a) { return this.m.i(this.cc(a)) + 17; }; PropertyEditor.prototype.cc = function (a) { return a.az != null ? a.az : a.a3; }; PropertyEditor.prototype.ct = function (a, b) { var c = a; var d = this.s(c, b.cellInfo.fb, b.cellInfo.hn); var e = d != null ? d.w : 0; switch (e) { case 10: this.cv(c, b); break; case 7: this.cw(c, b); break; case 4: this.cy(c, b); break; case 6: this.cx(c, b); break; case 23: this.c6(c, b); break; case 9: this.c0(c, b); break; case 5: this.c2(c, b); break; case 14: this.c1(c, b); break; case 18: this.c3(c, b); break; case 3: this.c4(c, b); break; case 15: this.c8(c, b); break; case 17: this.c9(c, b); break; case 16: this.db(c, b); break; case 1: this.dc(c, b); break; case 11: this.dd(c, b); break; case 13: this.de(c, b); break; case 12: this.df(c, b); break; case 2: this.dg(c, b); break; case 8: this.dh(c, b); break; case 19: this.di(c, b); break; case 20: this.cz(c, b); break; case 0: break; } }; PropertyEditor.prototype.di = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.dh = function (a, b) { }; PropertyEditor.prototype.dg = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.df = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.de = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.dd = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.dc = function (a, b) { this.da(a, b); }; PropertyEditor.prototype.da = function (a, b) { var _this = this; this.m.t(b, function (c, d) { if (c.d != 2) { c.d = 2; } if (c.t != 3) { c.t = 3; } var e = _this.s(a, b.cellInfo.fb, b.cellInfo.hn); var f = c.inputs._inner[0]; f.bh = e; f.cq = (e.ar != null ? e.ar.toString() : ""); if (d) { f.changing = delegateCombine(f.changing, runOn(_this, _this.dl)); } }); }; PropertyEditor.prototype.cz = function (a, b) { var _this = this; this.m.q(b, function (c, d) { if (c.r != 3) { c.r = 3; } var e = _this.s(a, b.cellInfo.fb, b.cellInfo.hn); c.ed = e; var f = e.ar; if (typeof e.ar === 'number' || typeof e.ar === 'number') { f = e.ar.toString(); } _this.m.ac(c, f); if (d) { c.clicked = delegateCombine(c.clicked, runOn(_this, _this.cm)); } }); }; PropertyEditor.prototype.c7 = function (a, b) { var _this = this; this.m.s(b, function (c, d) { if (c.density != 3) { c.density = 3; } var e = _this.s(a, b.cellInfo.fb, b.cellInfo.hn); if (c.dd != e) { if (!d) { c.selectedValueChanged = delegateRemove(c.selectedValueChanged, runOn(_this, _this.cq)); } c.dd = e; c.value = null; c.itemsSource = _this.b(_this.a(e)); if (e.ar != c.value) { if (typeof e.ar === 'number' || typeof e.ar === 'number') { c.value = e.ar.toString(); } else { c.value = e.ar; } } if (!d) { c.selectedValueChanged = delegateCombine(c.selectedValueChanged, runOn(_this, _this.cq)); } } else { if (e.ar != c.value) { if (typeof e.ar === 'number' || typeof e.ar === 'number') { c.value = e.ar.toString(); } else { c.value = e.ar; } } } if (d) { c.selectedValueChanged = delegateCombine(c.selectedValueChanged, runOn(_this, _this.cq)); c.hw = BrushUtil.h(255, 255, 255, 255); c.g = ["Name"]; c.columnHeadersVisible = false; c.defaultColumnWidth = ((function () { var $ret = new ColumnWidth(); $ret.c = false; $ret.f = _this.ba(e); return $ret; })()); c.fv = "Name"; } }); }; PropertyEditor.prototype.b = function (a) { var b = new List$1(DropDownDataListItem.$, 0); if (a == null) { return []; } var _loop_2 = function (c) { b.add(((function () { var $ret = new DropDownDataListItem(); $ret.Name = a[c]; $ret.Value = a[c]; return $ret; })())); }; for (var c = 0; c < a.length; c++) { _loop_2(c); } return b.toArray(); }; PropertyEditor.prototype.a = function (a) { return a.c; }; PropertyEditor.prototype.cq = function (a, b) { var c = a; var d = c.dd; this.an = true; d.ar = c.value; d.a5(); this.an = false; this.dx(d); }; PropertyEditor.prototype.dl = function (a, b) { var c = a; var d = c.bh; this.an = true; if (d.w == 1) { var e = 0; var f = tryParseNumber(c.cq, e); e = f.p1; d.ar = e; } else if (d.w == 23) { if (c.cq != null) { var g = c.cq.split(' '); var h = new List$1(Number_$type, 0); var _loop_3 = function (j) { var i = g[j]; if (!stringIsNullOrEmpty(i)) { var k_1 = 0; if (((function () { var l = tryParseNumber(c.cq, k_1); k_1 = l.p1; return l.ret; })())) { h.add(k_1); } } }; for (var j = 0; j < g.length; j++) { _loop_3(j); } d.ar = h.toArray(); } } else { d.ar = c.cq; } d.a5(); this.an = false; this.dx(d); }; PropertyEditor.prototype.cm = function (a, b) { var c = a; var d = c.ed; this.an = true; d.a6(); this.an = false; this.dx(d); }; PropertyEditor.prototype.dx = function (a) { var _this = this; if (this.bu != null && this.g != null) { if (this.am) { this.am = false; this.g.addTargetPropertyUpdatingListener(runOn(this, this.at)); } var b = this.bv == null; this.bv = this.cb(); if (b) { this.m.u(this.bu, function (c) { return _this.g.loadJsonOverlay(_this.bv, function (d) { return c; }, function (d) { return _this.bu; }); }); } else { this.m.u(this.bu, function (c) { return _this.g.loadJsonDelta(_this.bv, function (d) { return c; }, false); }); } } }; PropertyEditor.prototype.at = function (a, b, c) { var d = this.actualProperties; if (typeCast(HorizontalPropertyEditorDataSource.$, d) !== null) { d = d.ae; } for (var e = 0; e < d.count; e++) { var f = d._inner[e].a3; if (this.as(f, a)) { d._inner[e].a9(a, b, c); } } if (this.ap) { return true; } return false; }; PropertyEditor.prototype.as = function (a, b) { if (a == null && b == null) { return true; } if (a == null) { return false; } if (b == null) { return false; } var c = stringSplit(a, ['.', '['], 0); var d = stringSplit(b, ['.', '['], 0); if (c.length != d.length) { return false; } for (var e = 0; e < c.length; e++) { var f = c[e]; var g = d[e]; if (st