igniteui-react-grids
Version:
Ignite UI React grid components.
1,432 lines (1,431 loc) • 102 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, Delegate_$type, runOn, delegateCombine, fromEnum, typeCast, Array_$type, delegateRemove, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox, String_$type } from "igniteui-react-core";
import { Popup } from "igniteui-react-core";
import { XSuffix } from "igniteui-react-inputs";
import { XInputGroup } from "igniteui-react-inputs";
import { XLabel } from "igniteui-react-inputs";
import { XInput } from "igniteui-react-inputs";
import { List$1 } from "igniteui-react-core";
import { XIcon } from "igniteui-react-inputs";
import { BrushUtil } from "igniteui-react-core";
import { GridCellPosition } from "./GridCellPosition";
import { Rect } from "igniteui-react-core";
import { GotFocusEventArgs } from "./GotFocusEventArgs";
import { LostFocusEventArgs } from "./LostFocusEventArgs";
import { FilterFactory } from "igniteui-react-core";
import { ColumnComparisonFilterCondition } from "./ColumnComparisonFilterCondition";
import { NativeUI } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
import { MultiColumnComboBoxUtilities } from "./MultiColumnComboBoxUtilities";
import { ColumnWidth } from "./ColumnWidth";
import { SortMode_$type } from "./SortMode";
import { IDataSourceUpdateNotifier_$type } from "igniteui-react-core";
import { MultipleDataSourceNotifier } from "./MultipleDataSourceNotifier";
import { TextHeaderCellModel } from "./TextHeaderCellModel";
import { CornerRadius } from "igniteui-react-core";
import { stringEmpty, stringIsNullOrEmpty, stringIsNullOrWhiteSpace } from "igniteui-react-core";
import { stringFormat } from "igniteui-react-core";
import { SRProvider } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { BaseControlTheme_$type } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { ControlDisplayDensity_$type } from "igniteui-react-core";
import { StringComparer } from "igniteui-react-core";
import { InputGroupDisplayType_$type } from "igniteui-react-inputs";
import { ThemeResolver } from "igniteui-react-inputs";
import { MultiColumnComboBoxTextChangedEventArgs } from "./MultiColumnComboBoxTextChangedEventArgs";
import { MultiColumnComboBoxValueChangedEventArgs } from "./MultiColumnComboBoxValueChangedEventArgs";
import { FastReflectionHelper } from "igniteui-react-core";
import { MultiColumnComboVisualModelExport } from "./MultiColumnComboVisualModelExport";
import { AppearanceHelper } from "igniteui-react-core";
import { FontUtil } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
var MultiColumnComboBoxView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(MultiColumnComboBoxView, _super);
function MultiColumnComboBoxView() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.ac = null;
_this.ak = null;
_this.f = null;
_this.ai = null;
_this.k = null;
_this.ah = null;
_this.j = null;
_this.aj = null;
_this.l = null;
_this.h = null;
_this.ae = null;
_this.i = null;
_this.af = null;
_this.m = null;
_this.ag = null;
_this.d = null;
_this.aq = null;
_this.ab = new List$1(Delegate_$type, 0);
_this.au = null;
_this.aa = true;
_this.ap = 0;
_this.x = false;
_this.a = null;
_this.c = 0;
_this.w = false;
_this.s = false;
_this.r = false;
_this.p = false;
_this.an = null;
_this.am = null;
_this.v = false;
_this.ao = -1;
_this.z = false;
_this.t = false;
return _this;
}
Object.defineProperty(MultiColumnComboBoxView.prototype, "e", {
get: function () {
return this.d;
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiColumnComboBoxView.prototype, "y", {
get: function () {
return this.ap == 46;
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiColumnComboBoxView.prototype, "n", {
get: function () {
return this.m;
},
enumerable: false,
configurable: true
});
MultiColumnComboBoxView.prototype.bg = function (a) {
this.ak = a;
this.b2();
};
MultiColumnComboBoxView.prototype.bh = function (a) {
this.f = a;
};
MultiColumnComboBoxView.prototype.bq = function () {
};
MultiColumnComboBoxView.prototype.b2 = function () {
this.ag = this.ac.createElement("div");
this.cx();
this.a1();
this.a0();
this.ak.append(this.ai);
this.cm();
this.co();
document.addEventListener("click", runOn(this, this.a2), false);
window.addEventListener("resize", runOn(this, this.c3), false);
};
MultiColumnComboBoxView.prototype.aw = function (a) {
var b = this.g.p();
if (null == b) {
return;
}
this.p = false;
if (b.g1 != a) {
b.g1 = a;
this.p = true;
}
else {
this.a3();
}
};
MultiColumnComboBoxView.prototype.ay = function () {
var a = this.e;
a.activeCell = null;
};
MultiColumnComboBoxView.prototype.az = function () {
var a = this.n;
if (null != a) {
a.b6();
}
this.co();
var b = this.g.p();
if (null != b) {
var c = b.g1;
if (null != c) {
b.g1 = null;
}
}
};
MultiColumnComboBoxView.prototype.u = function (a) {
if (null == a) {
return false;
}
var b = this.ai.getNativeElement();
var c = this.ag.getNativeElement();
var d = this.am.getNativeElement();
return b.contains(a) || c.contains(a) || d.contains(a);
};
MultiColumnComboBoxView.prototype.a0 = function () {
var a = this.ad;
var b = this.g;
this.ai = a.createElement("div");
this.ai.setStyleProperty("display", "flex");
this.ai.setStyleProperty("height", "100%");
this.ai.setAttribute("tabIndex", "0");
this.ai.setAttribute("outline", "none !important");
this.ai.listen("focusin", runOn(this, this.bn));
this.ai.listen("focusout", runOn(this, this.bo));
var c = a.getSubRenderer(this.ai);
this.k = new XInputGroup();
this.k.provideContainer(c);
var d = c.getExternal(this.k, c.rootWrapper, c.getExternal(this.g, null, null));
this.k.d = this.g.ac;
this.aj = a.createElement("div");
var e = a.getSubRenderer(this.aj);
this.l = new XLabel();
this.l.provideContainer(e);
var f = e.getExternal(this.l, e.rootWrapper, e.getExternal(this.g, null, null));
if (this.f.actualLabelVisible) {
this.c0();
}
this.ah = a.createElement("div");
this.ah.addClass("ig-input");
this.ah.setRawStyleProperty("flex-grow", "1");
var g = a.getSubRenderer(this.ah);
this.j = new XInput();
this.j.provideContainer(g);
a.getExternal(this.j, a.rootWrapper, a.getExternal(b, null, null));
this.j.b8 = "text";
this.j.cq = b.text;
var h = this.j;
h.changing = delegateCombine(h.changing, runOn(this, this.bi));
var i = this.j;
i.compositionEnd = delegateCombine(i.compositionEnd, runOn(this, this.bj));
var j = this.j;
j.keyDown = delegateCombine(j.keyDown, runOn(this, this.bl));
var k = this.j;
k.gotFocus = delegateCombine(k.gotFocus, runOn(this, this.bk));
var l = this.j;
l.mouseDown = delegateCombine(l.mouseDown, runOn(this, this.bm));
this.k.appendContentChild(this.ah);
this.k.inputs.add(this.j);
this.a5(this.g.bg);
var m = a.createElement("div");
var n = a.getSubRenderer(m);
var o = new XSuffix();
o.provideContainer(n);
var p = n.getExternal(o, n.rootWrapper, n.getExternal(this.g, null, null));
this.ae = a.createElement("div");
this.h = new XIcon();
var q = a.getSubRenderer(this.ae);
this.h.provideContainer(q);
var r = q.getExternal(this.h, q.rootWrapper, q.getExternal(this.g, null, null));
this.h.svgPath = MultiColumnComboBoxView.ar;
this.ae.setStyleProperty("height", "16px");
this.ae.setStyleProperty("width", "16px");
o.appendContentChild(this.ae);
this.k.appendContentChild(m);
this.k.inputs.add(o);
this.cj();
var s = a.createElement("div");
var t = a.getSubRenderer(s);
var u = new XSuffix();
u.provideContainer(t);
var v = t.getExternal(u, t.rootWrapper, t.getExternal(this.g, null, null));
this.af = a.createElement("div");
this.i = new XIcon();
var w = a.getSubRenderer(this.af);
this.i.provideContainer(w);
var x = w.getExternal(this.i, w.rootWrapper, w.getExternal(this.g, null, null));
this.i.svgPath = MultiColumnComboBoxView.at;
u.appendContentChild(this.af);
this.k.appendContentChild(s);
this.k.inputs.add(u);
this.ae.listen("click", runOn(this, this.ax));
this.af.listen("click", runOn(this, this.a4));
this.cq();
};
MultiColumnComboBoxView.prototype.a1 = function () {
var a = this.ac.createElement("div");
var b = this.ac.getSubRenderer(a);
this.m = new Popup();
this.m.ar = this.f.bn;
this.m.ay = this.f.br;
this.m.c0 = BrushUtil.h(255, 255, 255, 255);
this.m.a9 = 150;
this.m.provideRenderer(b);
var c = b.getExternal(this.m, b.rootWrapper, b.getExternal(this.g, null, null));
this.am = this.ac.createElement("div");
this.am.setStyleProperty("padding", "4px");
this.am.setStyleProperty("white-space", "nowrap");
this.an = this.ac.createElement("div");
this.an.append(this.am);
this.an.append(this.ag);
this.m.appendPopupContent(this.an);
};
MultiColumnComboBoxView.prototype.bu = function (a, b) {
};
MultiColumnComboBoxView.prototype.bx = function (a, b, c) {
};
MultiColumnComboBoxView.prototype.bt = function () {
switch (this.c) {
case 2:
case 1:
if (null == this.a) {
this.c = 0;
}
break;
}
var a = null;
switch (this.c) {
case 2:
{
var b = this.a.actualCount;
if (b == 0) {
this.g.value = null;
}
else {
if (b > 1) {
}
a = this.a.getItemAtIndex(0);
var c = this.g.i();
var d = new List$1(Base.$, 0);
for (var f = 0; f < c.length; f++) {
var e = c[f];
var g = this.a.getItemProperty(a, e);
d.add1(g);
}
this.g.value = d.count == 1 ? d._inner[0] : d.toArray();
}
}
break;
case 1:
{
var h = this.a.actualCount;
if (h == 0) {
this.g.text = stringEmpty();
}
else {
if (h > 1) {
}
var i = this.g.e5();
a = this.a.getItemAtIndex(0);
var j = this.a.getItemProperty(a, i).toString();
this.g.text = j;
}
var k = this.b();
var l = k.indexOfItem(a);
this.ch(l);
}
break;
case 0:
default: return;
}
if (null != a) {
var m = this.b();
var n = m.indexOfItem(a);
this.ch(n);
}
else {
this.ch(-1);
}
if (this.a != null) {
this.a.updateNotifier = null;
this.a = null;
}
this.c = 0;
};
MultiColumnComboBoxView.prototype.bv = function (a, b) {
};
MultiColumnComboBoxView.prototype.bw = function (a, b) {
};
MultiColumnComboBoxView.prototype.b0 = function (a, b) {
var c = this.e;
if (null != c) {
var d = c.activeCell;
if (null != d) {
if (d.b >= a && d.b <= b) {
this.cf(d.b);
this.cy();
}
}
}
};
MultiColumnComboBoxView.prototype.b5 = function (a, b, c) {
};
MultiColumnComboBoxView.prototype.bs = function () {
this.b8();
if (this.w) {
var a = this.b();
var b = a.actualCount;
if (this.aa && b > 0) {
this.ca();
}
else {
this.cb();
}
}
else {
this.cw();
}
};
MultiColumnComboBoxView.prototype.b1 = function (a, b) {
};
MultiColumnComboBoxView.prototype.b3 = function (a, b) {
};
MultiColumnComboBoxView.prototype.o = function () {
var a = document.activeElement;
return this.u(a);
};
MultiColumnComboBoxView.prototype.a3 = function () {
this.c1();
this.bp();
var a = this.n;
if (a.ax) {
return;
}
var b = this.c4();
a.am = !this.w;
if (this.f.bo) {
a.cr(this.ac.rootWrapper.getNativeElement(), 1, 1);
}
else {
a.showRelativeToExclusionRect(b, 1, 1);
}
this.co();
};
MultiColumnComboBoxView.prototype.c4 = function () {
var a = this.ac.rootWrapper.getNativeElement();
var b = (a.getBoundingClientRect());
return new Rect(0, b.left + window.pageXOffset, b.top + window.pageYOffset, b.width, b.height);
};
MultiColumnComboBoxView.prototype.b = function () {
var a = this.e;
if (null != a) {
return a.actualDataSource;
}
return null;
};
MultiColumnComboBoxView.prototype.q = function (a) {
var b = this.d.selectedItems;
var c = b.count;
if (0 == c) {
a = null;
return {
ret: true,
p0: a
};
}
else if (1 == c) {
a = b._inner[0];
}
else {
a = b._inner[0];
}
return {
ret: null != a,
p0: a
};
};
MultiColumnComboBoxView.prototype.a8 = function (a) {
var b = null != a ? a.b : -1;
this.cf(b);
};
MultiColumnComboBoxView.prototype.bc = function () {
var _this = this;
if (this.v) {
return;
}
var a = this.g;
var b;
var c = ((function () { var d = _this.q(b); b = d.p0; return d.ret; })());
if (!c) {
return;
}
if (b == null) {
return;
}
a.gi(b);
};
MultiColumnComboBoxView.prototype.bp = function () {
this.n.b9();
};
MultiColumnComboBoxView.prototype.br = function () {
var a = this.n;
if (a.ax) {
this.az();
var b = this.j;
b.focus();
var c = b.cq;
var d = null != c ? b.cq.length : 0;
b.dr(d, d);
}
};
MultiColumnComboBoxView.prototype.by = function () {
this.k.an = true;
this.j.dp();
var a = new GotFocusEventArgs();
this.g.ge(a);
};
MultiColumnComboBoxView.prototype.bz = function () {
this.az();
this.k.j8();
var a = new LostFocusEventArgs();
this.g.gg(a);
};
MultiColumnComboBoxView.prototype.b4 = function (a) {
var e_1, _a;
if (a == null) {
this.ac = null;
try {
for (var _b = __values(fromEnum(this.ab)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b();
}
}
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;
}
}
this.ab.clear();
return;
}
this.ac = a;
var c = a.rootWrapper;
this.bg(c);
};
MultiColumnComboBoxView.prototype.b6 = function (a, b) {
var c = this.b();
if (null == c) {
return;
}
if (null != this.a) {
if (a != this.c) {
}
this.a.updateNotifier = null;
this.a = null;
}
this.c = a;
var d = new FilterFactory();
var e = null;
var f = null;
switch (a) {
case 2:
{
var g = this.g.e5();
if (stringIsNullOrEmpty(g)) {
return;
}
e = b.toString();
var h = d.property(g);
f = h.isEqualTo(e);
}
break;
case 1:
{
var i = this.g.i();
if (i == null || i.length < 1) {
return;
}
var j = typeCast(Array_$type, b) !== null ? b : [b];
if (i.length != j.length) {
return;
}
for (var k = 0; k < i.length; k++) {
var l = i[k];
e = j[k];
var m = d.property(l);
var n = m.isEqualTo(e);
if (null == f) {
f = n;
}
else {
f.and(n);
}
}
}
break;
case 0:
default: return;
}
this.a = c.clone();
this.a.filterExpressions.clear();
this.a.updateNotifier = new MultiColumnComboBoxDataSourceNotificationHandler(this, true);
this.a.filterExpressions.add(f);
if (!this.a.isVirtual) {
this.a.flushAutoRefresh();
}
};
MultiColumnComboBoxView.prototype.b7 = function () {
this.cu();
var a = this.f.text;
var b = this.au.length;
var c = !stringIsNullOrEmpty(a) ? a.length : 0;
if (this.x && !stringIsNullOrEmpty(this.au) && b > 0) {
b--;
}
this.j.dr(b, c);
};
MultiColumnComboBoxView.prototype.b8 = function () {
if (this.p) {
this.p = false;
this.a3();
}
};
MultiColumnComboBoxView.prototype.b9 = function (a) {
this.au = a;
this.aa = !this.y;
this.cc();
this.cj();
};
MultiColumnComboBoxView.prototype.ca = function () {
if (stringIsNullOrEmpty(this.au)) {
this.ay();
}
else {
this.ch(0);
}
this.b7();
this.w = false;
};
MultiColumnComboBoxView.prototype.cj = function () {
if (this.ae != null && this.j != null) {
if (this.g.bq == false) {
this.ae.setStyleProperty("display", "none");
}
else if ((this.g.value != null && this.g.value != "") || (this.j.cq != null && this.j.cq != "")) {
this.ae.show();
}
else {
this.ae.setStyleProperty("display", "none");
}
}
};
MultiColumnComboBoxView.prototype.a5 = function (a) {
if (this.j != null) {
this.j.disabled = !a;
}
};
MultiColumnComboBoxView.prototype.cb = function () {
var a = this.d;
a.selectedItemsChanged = delegateRemove(a.selectedItemsChanged, runOn(this, this.bd));
this.v = true;
try {
this.g.gq(this.au);
}
finally {
this.v = false;
var b = this.d;
b.selectedItemsChanged = delegateCombine(b.selectedItemsChanged, runOn(this, this.bd));
}
this.w = false;
};
MultiColumnComboBoxView.prototype.cc = function () {
var a = this.g.p();
if (null == a) {
return;
}
this.w = true;
if (stringIsNullOrEmpty(this.au)) {
if (null != a.g1) {
this.aw(null);
}
else {
this.cb();
}
}
else {
var b = new ColumnComparisonFilterCondition();
b.operator = 14;
b.value = this.au;
b.isCaseSensitive = false;
this.aw(b);
}
};
MultiColumnComboBoxView.prototype.cd = function () {
this.ap = 0;
this.x = false;
};
MultiColumnComboBoxView.prototype.cf = function (a) {
var b = this.b();
var c = b.isPlaceholderItem(a);
if (c) {
}
else {
var d = this.e;
if (a < 0) {
this.s = false;
d.selectedItems.clear();
if (!this.s) {
this.bc();
}
return;
}
d.selectedItemsChanged = delegateRemove(d.selectedItemsChanged, runOn(this, this.bd));
try {
d.selectedItems.clear();
}
finally {
d.selectedItemsChanged = delegateCombine(d.selectedItemsChanged, runOn(this, this.bd));
}
if (a >= 0) {
var e = b.getItemAtIndex(a);
this.s = false;
d.selectedItems.add1(e);
if (!this.s) {
this.bc();
}
}
}
};
MultiColumnComboBoxView.prototype.ch = function (a) {
var b = this.e;
if (-1 == a) {
b.activeCell = null;
return;
}
var c = b.activeCell;
var d = new GridCellPosition();
var e;
if (null != c) {
e = c.d;
}
else {
if (b.actualColumns.count == 0) {
this.ao = a;
return;
}
var f = this.g;
var g = this.g.p();
e = g.lt();
}
d.d = e;
d.b = a;
this.r = false;
b.activeCell = d;
if (!this.r) {
this.a8(b.activeCell);
}
this.cy();
};
MultiColumnComboBoxView.prototype.cl = function (a) {
this.b6(2, a);
};
MultiColumnComboBoxView.prototype.ck = function (a) {
this.b6(1, a);
};
MultiColumnComboBoxView.prototype.cm = function () {
var a = this.g;
if (null != this.k) {
this.k.t = a.density;
this.k.p = a.ah;
this.k.d = a.ac;
this.k.mc = a.hl;
this.k.md = a.hm;
this.k.c0 = a.cc;
this.k.oi = a.il;
this.k.ks = a.gw;
this.k.t = a.am;
this.k.no = a.hn;
this.k.eg = a.cd;
this.k.np = a.ho;
this.k.eh = a.ce;
this.k.ei = a.cf;
this.k.nq = a.hp;
this.k.ej = a.cg;
this.k.ek = a.ch;
this.k.n6 = a.hu;
this.k.e5 = a.ci;
this.k.n7 = a.hv;
this.k.e6 = a.cj;
this.k.e7 = a.ck;
this.k.e8 = a.cl;
}
if (null != this.j) {
this.j.d8 = a.ht;
this.j.af = a.ax;
this.j.cg = a.fn;
}
if (null != this.l) {
this.l.text = a.fb;
this.l.dj = a.hq;
this.l.y = a.av;
}
if (null != this.am) {
NativeUI.q(this.am, a.hs);
NativeUI.m(this.am, a.hr);
if (null != a.aw) {
this.am.setStyleProperty("font", a.aw.fontString);
}
this.am.setRawText(a.actualNoMatchesFoundLabel);
this.bp();
}
if (null != this.d) {
this.d.density = a.density;
var b = a.columnHeadersVisible;
this.d.headerHeight = b ? -1 : 0;
this.d.rowSeparatorHeight = a.rowSeparatorsVisible ? 1 : 0;
}
if (null != this.af) {
var c = a.dropDownButtonVisible;
MultiColumnComboBoxUtilities.c(this.af, c);
}
};
MultiColumnComboBoxView.prototype.cu = function () {
if (!this.v) {
if (null != this.j) {
var a = this.f.text;
this.j.cq = a;
}
}
};
MultiColumnComboBoxView.prototype.co = function () {
var a = this.n;
var b = null != a ? a.ax : false;
this.i.svgPath = b ? MultiColumnComboBoxView.as : MultiColumnComboBoxView.at;
};
MultiColumnComboBoxView.prototype.ct = function () {
var a = this.d.actualHeaderHeight + 3;
var b = this.d.actualRowHeight + this.d.rowSeparatorHeight;
var c = this.d.actualDataSource;
var d = null != c ? c.actualCount : 0;
if (d > 8) {
d = 8;
}
var e = d * b;
e += a;
var f = stringFormat("{0}px", e);
this.ag.setStyleProperty("height", f);
var g = 0;
var h = this.d.actualColumns.count;
var i = 100;
if (this.d.defaultColumnWidth != null) {
i = this.d.defaultColumnWidth.f;
}
g = h * i;
this.d.defaultColumnMinWidth = 0;
g += 2;
var j = stringFormat("{0}px", g);
this.ag.setStyleProperty("width", j);
if (null != this.am) {
var k = this.g;
var l = MultiColumnComboBoxUtilities.e(this.ad, k.actualNoMatchesFoundLabel, k.av);
var m = l.width;
var n = l.height;
var o = stringFormat("{0}px", m);
var p = stringFormat("{0}px", n);
this.am.setStyleProperty("width", o);
this.am.setStyleProperty("height", p);
}
};
MultiColumnComboBoxView.prototype.cv = function () {
if (this.w) {
return;
}
this.au = null;
var a = this.g.p();
if (null != a) {
var b = a.g1;
if (null != b) {
a.g1 = null;
}
else {
this.cw();
}
}
};
MultiColumnComboBoxView.prototype.cw = function () {
var a = this.g;
if (null != a.value) {
var b = this.g.value;
var c = typeCast(Array_$type, b) !== null ? b : [b];
var d = this.b();
var e = d.indexOfKey(c);
if (-1 != e) {
this.ch(e);
}
}
};
MultiColumnComboBoxView.prototype.cx = function () {
var _this = this;
if (null == this.d) {
this.ac.getPortal(this.ag, "DataGrid", function (a) {
_this.aq = a.componentRef;
_this.aq.height = '100%';
_this.aq.width = '100%';
_this.d = (_this.aq.i);
_this.cz();
_this.d.selectionMode = 1;
_this.d.selectionBehavior = 0;
_this.d.activationMode = 1;
_this.d.defaultColumnWidth = _this.f.defaultColumnWidth;
_this.cr();
_this.d.editMode = 0;
_this.d.isColumnOptionsEnabled = false;
_this.d.isActiveCellStyleEnabled = false;
_this.d.cornerRadius = new CornerRadius(0, 0);
_this.d.ix = false;
var b = _this.d;
b.activeCellChanged = delegateCombine(b.activeCellChanged, runOn(_this, _this.a7));
var c = _this.d;
c.selectedItemsChanged = delegateCombine(c.selectedItemsChanged, runOn(_this, _this.bd));
var d = _this.d;
d.cellClicked = delegateCombine(d.cellClicked, runOn(_this, _this.ba));
var e = _this.d;
e.sizeChanged = delegateCombine(e.sizeChanged, runOn(_this, _this.be));
var f = _this.d;
f.viewportChanged = delegateCombine(f.viewportChanged, runOn(_this, _this.bf));
var g = _this.d;
g.actualColumnsChanged = delegateCombine(g.actualColumnsChanged, runOn(_this, _this.a9));
var h = _this.d;
h.columnWidthChanged = delegateCombine(h.columnWidthChanged, runOn(_this, _this.bb));
_this.cm();
}, false);
}
};
MultiColumnComboBoxView.prototype.cn = function (a) {
if (this.d != null) {
this.d.defaultColumnWidth = a;
this.ct();
}
};
MultiColumnComboBoxView.prototype.cr = function () {
if (this.d != null) {
var a = 0;
switch (this.f.x) {
case 0:
a = 0;
break;
case 1:
a = 1;
break;
case 2:
a = 2;
break;
case 3:
a = 3;
break;
case 4:
a = 4;
break;
}
this.d.headerClickAction = a;
}
};
MultiColumnComboBoxView.prototype.cy = function () {
if (!this.t) {
return;
}
var a = this.d;
var b = a.activeCell;
if (null != b) {
var c = this.b();
if (null != c) {
var d = c.getItemAtIndex(b.b);
if (null == d) {
return;
}
a.scrollToItem(d);
}
}
else {
a.scrollToRowByIndex(0);
}
};
MultiColumnComboBoxView.prototype.cz = function () {
if (null != this.aq) {
var a = this.g;
var b = a.itemsSource;
this.d.selectedItems.clear();
if (this.d.actualDataSource != null) {
var c = this.d.actualDataSource;
c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.av));
}
this.aq.dataSource = b;
this.aq.autoGenerateDesiredProperties = a.g;
this.d.primaryKey = a.i();
this.ao = -1;
var d = this.b();
if (null != d) {
var e = d.updateNotifier;
var f = new MultiColumnComboBoxDataSourceNotificationHandler(this, false);
var g = new MultipleDataSourceNotifier(1, [e, f]);
d.updateNotifier = g;
d.propertiesRequested = a.f;
d.schemaChanged = delegateCombine(d.schemaChanged, runOn(this, this.av));
if (this.g.value != null) {
this.b6(1, this.g.value);
}
}
this.a = null;
if (this.n != null && this.n.ax) {
this.c1();
this.n.b9();
}
}
};
MultiColumnComboBoxView.prototype.av = function (a, b) {
if (this.ao != -1) {
this.ch(this.ao);
this.ao = -1;
}
};
MultiColumnComboBoxView.prototype.c0 = function () {
if (null != this.aj) {
var a = this.f.actualLabelVisible;
if (a) {
this.k.appendContentChild(this.aj);
this.k.inputs.add(this.l);
}
else {
this.k.j7(this.aj);
this.k.inputs.remove(this.l);
}
}
};
MultiColumnComboBoxView.prototype.cg = function (a) {
if (this.j != null) {
this.j.disabled = !a;
}
if (this.k != null) {
this.k.disabled = !a;
}
};
MultiColumnComboBoxView.prototype.c1 = function () {
this.ct();
if (!this.w) {
this.z = false;
}
else {
var a = this.b();
this.z = a.actualCount == 0;
}
MultiColumnComboBoxUtilities.c(this.am, this.z);
MultiColumnComboBoxUtilities.c(this.ag, !this.z);
};
MultiColumnComboBoxView.prototype.a6 = function (a) {
if (this.j != null) {
this.j.focus(a);
}
};
MultiColumnComboBoxView.prototype.ce = function () {
if (this.j != null) {
this.j.dp();
}
};
MultiColumnComboBoxView.prototype.ci = function (a) {
if (this.j != null) {
this.j.e = a;
}
};
Object.defineProperty(MultiColumnComboBoxView.prototype, "al", {
get: function () {
return this.ak;
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiColumnComboBoxView.prototype, "g", {
get: function () {
return this.f;
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiColumnComboBoxView.prototype, "ad", {
get: function () {
return this.ac;
},
enumerable: false,
configurable: true
});
MultiColumnComboBoxView.prototype.c2 = function () {
if (null != this.al) {
this.al.setStyleProperty("box-sizing", "border-box");
}
};
MultiColumnComboBoxView.prototype.a2 = function (a) {
var b = a.target;
if (!this.o()) {
this.bz();
}
};
MultiColumnComboBoxView.prototype.ax = function (a) {
this.d.selectedItems.clear();
this.j.cq = "";
this.g.text = "";
this.g.value = null;
};
MultiColumnComboBoxView.prototype.a4 = function (a) {
var b = this.n;
if (b.ax) {
this.az();
}
else {
this.aw(null);
}
if (null != this.j) {
this.j.focus();
this.j.dp();
}
};
MultiColumnComboBoxView.prototype.a7 = function (a, b) {
var c = b.newActiveCell;
this.a8(c);
this.r = true;
};
MultiColumnComboBoxView.prototype.a9 = function (a, b) {
this.cv();
};
MultiColumnComboBoxView.prototype.ba = function (a, b) {
if (typeCast(TextHeaderCellModel.$, b.cellInfo) !== null) {
return;
}
this.br();
};
MultiColumnComboBoxView.prototype.bb = function (a, b) {
this.ct();
this.bp();
};
MultiColumnComboBoxView.prototype.bd = function (a, b) {
this.bc();
this.s = true;
this.cj();
};
MultiColumnComboBoxView.prototype.be = function (a, b) {
this.t = b.b != 0 && b.a != 0;
this.cy();
};
MultiColumnComboBoxView.prototype.bf = function (a, b) {
this.cy();
var c = this.d;
c.viewportChanged = delegateRemove(c.viewportChanged, runOn(this, this.bf));
};
MultiColumnComboBoxView.prototype.bi = function (a, b) {
if (b.isCompositionInProgress) {
return;
}
this.f.gd(b);
var c = b.value;
this.b9(c);
};
MultiColumnComboBoxView.prototype.bj = function (a, b) {
var c = this.j.cq;
this.b9(c);
};
MultiColumnComboBoxView.prototype.bk = function (a, b) {
this.cd();
};
MultiColumnComboBoxView.prototype.bl = function (a, b) {
this.f.gf(b);
if (b.defaultPrevented) {
return;
}
var c = b.keyCode;
this.ap = c;
this.x = false;
var d = b.modifiers;
switch (c) {
case 8:
var e = this.j.selectionStart;
if (0 == e) {
break;
}
var f = this.j.cq;
if (stringIsNullOrEmpty(f)) {
break;
}
var g = f.length;
var h = this.j.selectionEnd;
var i = h - e;
if (i > 0 && i < g && h == g) {
this.x = true;
}
break;
case 40:
if (d == 1) {
this.a3();
this.cv();
b.preventDefault();
}
else {
var j = this.e;
if (null == j) {
return;
}
var k = this.e.activeCell;
if (null != j.activeCell) {
this.d.kk(false, false);
b.preventDefault();
}
else {
var l = this.b();
if (null != l) {
var m = l.actualCount;
if (m > 0) {
this.ch(0);
b.preventDefault();
}
}
}
}
break;
case 38:
if (d == 1) {
this.az();
b.preventDefault();
}
else {
var n = this.e;
if (null == n) {
return;
}
var o = this.e.activeCell;
if (null != n.activeCell) {
this.d.kx(false, false);
b.preventDefault();
}
else {
var p = this.b();
if (null != p) {
var q = p.actualCount;
if (q > 0) {
this.ch(q - 1);
b.preventDefault();
}
}
}
}
break;
case 13:
if (this.n.ax) {
b.stopPropagation();
}
this.br();
break;
case 27:
this.az();
break;
}
};
MultiColumnComboBoxView.prototype.bm = function (a, b) {
if (false == this.o()) {
this.j.dp();
b.handled = true;
}
};
MultiColumnComboBoxView.prototype.bn = function (a) {
this.j.focus();
var b = (a.originalEvent.relatedTarget);
if (!this.u(b)) {
this.by();
}
};
MultiColumnComboBoxView.prototype.bo = function (a) {
var b = (a.originalEvent.relatedTarget);
if (!this.u(b)) {
this.bz();
}
};
MultiColumnComboBoxView.prototype.c3 = function (a) {
var b = this.n;
if (null == b || false == b.ax) {
return;
}
var c = this.c4();
this.m.ca(c);
};
MultiColumnComboBoxView.prototype.cq = function () {
if (this.g.disallowTabFocus) {
if (this.ai != null) {
this.ai.setAttribute("tabIndex", "-1");
}
if (this.j != null) {
this.j.be = -1;
}
}
else {
if (this.ai != null) {
this.ai.setAttribute("tabIndex", "0");
}
if (this.j != null) {
this.j.cu();
}
}
};
MultiColumnComboBoxView.prototype.cp = function () {
if (this.m != null) {
this.m.ar = this.g.bn;
}
};
MultiColumnComboBoxView.prototype.cs = function () {
if (this.m != null) {
this.m.ay = this.g.br;
}
};
MultiColumnComboBoxView.$t = markType(MultiColumnComboBoxView, 'MultiColumnComboBoxView');
MultiColumnComboBoxView.ar = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";
MultiColumnComboBoxView.at = "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z";
MultiColumnComboBoxView.as = "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z";
return MultiColumnComboBoxView;
}(Base));
export { MultiColumnComboBoxView };
/**
* @hidden
*/
var MultiColumnComboBox = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(MultiColumnComboBox, _super);
function MultiColumnComboBox() {
var _this = _super.call(this) || this;
_this.dd = null;
_this.h1 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "BackgroundColor");
_this.h2 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "BorderColor");
_this.co = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "BorderWidth");
_this.io = XInputGroup.m.ai(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "ContentPadding");
_this.gy = XInputGroup.m.y(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "CornerRadius");
_this.h3 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusBorderColor");
_this.cp = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusBorderWidth");
_this.h4 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineColor");
_this.cq = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineOpacity");
_this.cr = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineRippleOpacity");
_this.h5 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineColor");
_this.cs = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineOpacity");
_this.ct = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineWidth");
_this.h6 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineColor");
_this.cu = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineOpacity");
_this.h7 = XInputGroup.m.ad(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineRippleColor");
_this.cv = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineRippleOpacity");
_this.cw = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineRippleWidth");
_this.cx = XInputGroup.m.i(MultiColumnComboBox.ag, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineWidth");
_this.a5 = null;
_this.a0 = null;
_this.v = null;
_this.a8 = false;
_this.bc = true;
_this.c = null;
_this.m = ColumnWidth.a;
_this.ha = null;
_this.gz = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "BackgroundColor");
_this.af = 0;
_this.ae = 1;
_this.hb = null;
_this.g0 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "BorderColor");
_this.b2 = NaN;
_this.bs = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "BorderWidth");
_this.bh = true;
_this.ik = new Thickness(1, NaN, NaN, NaN, NaN);
_this.ij = ThemeResolver.ak(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "ContentPadding");
_this.gv = new CornerRadius(1, NaN, NaN, NaN, NaN);
_this.gu = ThemeResolver.aa(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "CornerRadius");
_this.b = null;
_this.al = 0;
_this.ak = 0;
_this.bk = true;
_this.hc = null;
_this.g1 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "FocusBorderColor");
_this.b3 = NaN;
_this.bt = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "FocusBorderWidth");
_this.hd = null;
_this.g2 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineColor");
_this.b4 = NaN;
_this.bu = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineOpacity");
_this.b5 = NaN;
_this.bv = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "FocusUnderlineRippleOpacity");
_this.he = null;
_this.g3 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineColor");
_this.b6 = NaN;
_this.bw = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineOpacity");
_this.b7 = NaN;
_this.bx = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "HoverUnderlineWidth");
_this.c7 = null;
_this.fd = null;
_this.hf = null;
_this.g4 = MultiColumnComboBox.hy;
_this.as = null;
_this.ap = null;
_this.be = false;
_this.fg = null;
_this.d1 = "No Matches Found";
_this.hg = null;
_this.g5 = MultiColumnComboBox.hz;
_this.hh = null;
_this.g6 = MultiColumnComboBox.h0;
_this.at = null;
_this.aq = null;
_this.fo = "";
_this.bb = true;
_this.hi = MultiColumnComboBox.h8;
_this.g7 = MultiColumnComboBox.h8;
_this.au = null;
_this.ar = null;
_this.hj = null;
_this.g8 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineColor");
_this.b8 = NaN;
_this.by = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineOpacity");
_this.hk = null;
_this.g9 = ThemeResolver.af(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineRippleColor");
_this.b9 = NaN;
_this.bz = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineRippleOpacity");
_this.ca = NaN;
_this.b0 = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineRippleWidth");
_this.cb = NaN;
_this.b1 = ThemeResolver.k(MultiColumnComboBox.ag, XInputGroup.m, enumGetBox(InputGroupDisplayType_$type, 0), "UnderlineWidth");
_this.a7 = true;
_this.w = 0;
_this.dg = null;
_this.df = null;
_this.d = null;
_this.a = null;
_this.c8 = null;
_this.aa = 0;
_this.bm = false;
_this.a9 = false;
_this.ba = false;
_this.bd = false;
_this.gotFocus = null;
_this.lostFocus = null;
_this.textValueChanged = null;
_this.selectedValueChanged = null;
_this.keyDown = null;
_this.change = null;
_this.changing = null;
_this.propertyChanged = null;
_this.m = new ColumnWidth();
_this.m.f = 100;
var a = _this.u();
_this.v = a;
a.bh(_this);
return _this;
}
Object.defineProperty(MultiColumnComboBox.prototype, "a6", {
get: function () {
if (this.a5 == null) {
this.a5 = new SRProvider(this.v.ad);
this.a5.cb("MultiColumnComboBox");
}
return this.a5;
},
enumerable: false,
configurable: true
});
MultiColumnComboBox.prototype.u = function () {
return new MultiColumnComboBoxView();
};
MultiColumnComboBox.prototype.gm = function (a, b, c) {
switch (a) {
case "BackgroundColor":