igniteui-react-grids
Version:
Ignite UI React grid components.
1,403 lines • 89.4 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 { 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
*/
export let MultiColumnComboBoxView = /*@__PURE__*/ (() => {
class MultiColumnComboBoxView extends Base {
constructor() {
super(...arguments);
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;
}
get e() {
return this.d;
}
get y() {
return this.ap == 46;
}
get n() {
return this.m;
}
bg(a) {
this.ak = a;
this.b2();
}
bh(a) {
this.f = a;
}
bq() {
}
b2() {
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);
}
aw(a) {
let b = this.g.p();
if (null == b) {
return;
}
this.p = false;
if (b.g1 != a) {
b.g1 = a;
this.p = true;
}
else {
this.a3();
}
}
ay() {
let a = this.e;
a.activeCell = null;
}
az() {
let a = this.n;
if (null != a) {
a.b6();
}
this.co();
let b = this.g.p();
if (null != b) {
let c = b.g1;
if (null != c) {
b.g1 = null;
}
}
}
u(a) {
if (null == a) {
return false;
}
let b = this.ai.getNativeElement();
let c = this.ag.getNativeElement();
let d = this.am.getNativeElement();
return b.contains(a) || c.contains(a) || d.contains(a);
}
a0() {
let a = this.ad;
let 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));
let c = a.getSubRenderer(this.ai);
this.k = new XInputGroup();
this.k.provideContainer(c);
let d = c.getExternal(this.k, c.rootWrapper, c.getExternal(this.g, null, null));
this.k.d = this.g.ac;
this.aj = a.createElement("div");
let e = a.getSubRenderer(this.aj);
this.l = new XLabel();
this.l.provideContainer(e);
let 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");
let 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;
let h = this.j;
h.changing = delegateCombine(h.changing, runOn(this, this.bi));
let i = this.j;
i.compositionEnd = delegateCombine(i.compositionEnd, runOn(this, this.bj));
let j = this.j;
j.keyDown = delegateCombine(j.keyDown, runOn(this, this.bl));
let k = this.j;
k.gotFocus = delegateCombine(k.gotFocus, runOn(this, this.bk));
let 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);
let m = a.createElement("div");
let n = a.getSubRenderer(m);
let o = new XSuffix();
o.provideContainer(n);
let p = n.getExternal(o, n.rootWrapper, n.getExternal(this.g, null, null));
this.ae = a.createElement("div");
this.h = new XIcon();
let q = a.getSubRenderer(this.ae);
this.h.provideContainer(q);
let 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();
let s = a.createElement("div");
let t = a.getSubRenderer(s);
let u = new XSuffix();
u.provideContainer(t);
let v = t.getExternal(u, t.rootWrapper, t.getExternal(this.g, null, null));
this.af = a.createElement("div");
this.i = new XIcon();
let w = a.getSubRenderer(this.af);
this.i.provideContainer(w);
let 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();
}
a1() {
let a = this.ac.createElement("div");
let 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);
let 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);
}
bu(a, b) {
}
bx(a, b, c) {
}
bt() {
switch (this.c) {
case 2:
case 1:
if (null == this.a) {
this.c = 0;
}
break;
}
let a = null;
switch (this.c) {
case 2:
{
let b = this.a.actualCount;
if (b == 0) {
this.g.value = null;
}
else {
if (b > 1) {
}
a = this.a.getItemAtIndex(0);
let c = this.g.i();
let d = new List$1(Base.$, 0);
for (let f = 0; f < c.length; f++) {
let e = c[f];
let g = this.a.getItemProperty(a, e);
d.add1(g);
}
this.g.value = d.count == 1 ? d._inner[0] : d.toArray();
}
}
break;
case 1:
{
let h = this.a.actualCount;
if (h == 0) {
this.g.text = stringEmpty();
}
else {
if (h > 1) {
}
let i = this.g.e5();
a = this.a.getItemAtIndex(0);
let j = this.a.getItemProperty(a, i).toString();
this.g.text = j;
}
let k = this.b();
let l = k.indexOfItem(a);
this.ch(l);
}
break;
case 0:
default: return;
}
if (null != a) {
let m = this.b();
let 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;
}
bv(a, b) {
}
bw(a, b) {
}
b0(a, b) {
let c = this.e;
if (null != c) {
let d = c.activeCell;
if (null != d) {
if (d.b >= a && d.b <= b) {
this.cf(d.b);
this.cy();
}
}
}
}
b5(a, b, c) {
}
bs() {
this.b8();
if (this.w) {
let a = this.b();
let b = a.actualCount;
if (this.aa && b > 0) {
this.ca();
}
else {
this.cb();
}
}
else {
this.cw();
}
}
b1(a, b) {
}
b3(a, b) {
}
o() {
let a = document.activeElement;
return this.u(a);
}
a3() {
this.c1();
this.bp();
let a = this.n;
if (a.ax) {
return;
}
let 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();
}
c4() {
let a = this.ac.rootWrapper.getNativeElement();
let b = (a.getBoundingClientRect());
return new Rect(0, b.left + window.pageXOffset, b.top + window.pageYOffset, b.width, b.height);
}
b() {
let a = this.e;
if (null != a) {
return a.actualDataSource;
}
return null;
}
q(a) {
let b = this.d.selectedItems;
let 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
};
}
a8(a) {
let b = null != a ? a.b : -1;
this.cf(b);
}
bc() {
if (this.v) {
return;
}
let a = this.g;
let b;
let c = ((() => { let d = this.q(b); b = d.p0; return d.ret; })());
if (!c) {
return;
}
if (b == null) {
return;
}
a.gi(b);
}
bp() {
this.n.b9();
}
br() {
let a = this.n;
if (a.ax) {
this.az();
let b = this.j;
b.focus();
let c = b.cq;
let d = null != c ? b.cq.length : 0;
b.dr(d, d);
}
}
by() {
this.k.an = true;
this.j.dp();
let a = new GotFocusEventArgs();
this.g.ge(a);
}
bz() {
this.az();
this.k.j8();
let a = new LostFocusEventArgs();
this.g.gg(a);
}
b4(a) {
if (a == null) {
this.ac = null;
for (let b of fromEnum(this.ab)) {
b();
}
this.ab.clear();
return;
}
this.ac = a;
let c = a.rootWrapper;
this.bg(c);
}
b6(a, b) {
let 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;
let d = new FilterFactory();
let e = null;
let f = null;
switch (a) {
case 2:
{
let g = this.g.e5();
if (stringIsNullOrEmpty(g)) {
return;
}
e = b.toString();
let h = d.property(g);
f = h.isEqualTo(e);
}
break;
case 1:
{
let i = this.g.i();
if (i == null || i.length < 1) {
return;
}
let j = typeCast(Array_$type, b) !== null ? b : [b];
if (i.length != j.length) {
return;
}
for (let k = 0; k < i.length; k++) {
let l = i[k];
e = j[k];
let m = d.property(l);
let 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();
}
}
b7() {
this.cu();
let a = this.f.text;
let b = this.au.length;
let c = !stringIsNullOrEmpty(a) ? a.length : 0;
if (this.x && !stringIsNullOrEmpty(this.au) && b > 0) {
b--;
}
this.j.dr(b, c);
}
b8() {
if (this.p) {
this.p = false;
this.a3();
}
}
b9(a) {
this.au = a;
this.aa = !this.y;
this.cc();
this.cj();
}
ca() {
if (stringIsNullOrEmpty(this.au)) {
this.ay();
}
else {
this.ch(0);
}
this.b7();
this.w = false;
}
cj() {
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");
}
}
}
a5(a) {
if (this.j != null) {
this.j.disabled = !a;
}
}
cb() {
let 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;
let b = this.d;
b.selectedItemsChanged = delegateCombine(b.selectedItemsChanged, runOn(this, this.bd));
}
this.w = false;
}
cc() {
let 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 {
let b = new ColumnComparisonFilterCondition();
b.operator = 14;
b.value = this.au;
b.isCaseSensitive = false;
this.aw(b);
}
}
cd() {
this.ap = 0;
this.x = false;
}
cf(a) {
let b = this.b();
let c = b.isPlaceholderItem(a);
if (c) {
}
else {
let 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) {
let e = b.getItemAtIndex(a);
this.s = false;
d.selectedItems.add1(e);
if (!this.s) {
this.bc();
}
}
}
}
ch(a) {
let b = this.e;
if (-1 == a) {
b.activeCell = null;
return;
}
let c = b.activeCell;
let d = new GridCellPosition();
let e;
if (null != c) {
e = c.d;
}
else {
if (b.actualColumns.count == 0) {
this.ao = a;
return;
}
let f = this.g;
let 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();
}
cl(a) {
this.b6(2, a);
}
ck(a) {
this.b6(1, a);
}
cm() {
let 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.di = 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;
let b = a.columnHeadersVisible;
this.d.headerHeight = b ? -1 : 0;
this.d.rowSeparatorHeight = a.rowSeparatorsVisible ? 1 : 0;
}
if (null != this.af) {
let c = a.dropDownButtonVisible;
MultiColumnComboBoxUtilities.c(this.af, c);
}
}
cu() {
if (!this.v) {
if (null != this.j) {
let a = this.f.text;
this.j.cq = a;
}
}
}
co() {
let a = this.n;
let b = null != a ? a.ax : false;
this.i.svgPath = b ? MultiColumnComboBoxView.as : MultiColumnComboBoxView.at;
}
ct() {
let a = this.d.actualHeaderHeight + 3;
let b = this.d.actualRowHeight + this.d.rowSeparatorHeight;
let c = this.d.actualDataSource;
let d = null != c ? c.actualCount : 0;
if (d > 8) {
d = 8;
}
let e = d * b;
e += a;
let f = stringFormat("{0}px", e);
this.ag.setStyleProperty("height", f);
let g = 0;
let h = this.d.actualColumns.count;
let i = 100;
if (this.d.defaultColumnWidth != null) {
i = this.d.defaultColumnWidth.f;
}
g = h * i;
this.d.defaultColumnMinWidth = 0;
g += 2;
let j = stringFormat("{0}px", g);
this.ag.setStyleProperty("width", j);
if (null != this.am) {
let k = this.g;
let l = MultiColumnComboBoxUtilities.e(this.ad, k.actualNoMatchesFoundLabel, k.av);
let m = l.width;
let n = l.height;
let o = stringFormat("{0}px", m);
let p = stringFormat("{0}px", n);
this.am.setStyleProperty("width", o);
this.am.setStyleProperty("height", p);
}
}
cv() {
if (this.w) {
return;
}
this.au = null;
let a = this.g.p();
if (null != a) {
let b = a.g1;
if (null != b) {
a.g1 = null;
}
else {
this.cw();
}
}
}
cw() {
let a = this.g;
if (null != a.value) {
let b = this.g.value;
let c = typeCast(Array_$type, b) !== null ? b : [b];
let d = this.b();
let e = d.indexOfKey(c);
if (-1 != e) {
this.ch(e);
}
}
}
cx() {
if (null == this.d) {
this.ac.getPortal(this.ag, "DataGrid", (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;
let b = this.d;
b.activeCellChanged = delegateCombine(b.activeCellChanged, runOn(this, this.a7));
let c = this.d;
c.selectedItemsChanged = delegateCombine(c.selectedItemsChanged, runOn(this, this.bd));
let d = this.d;
d.cellClicked = delegateCombine(d.cellClicked, runOn(this, this.ba));
let e = this.d;
e.sizeChanged = delegateCombine(e.sizeChanged, runOn(this, this.be));
let f = this.d;
f.viewportChanged = delegateCombine(f.viewportChanged, runOn(this, this.bf));
let g = this.d;
g.actualColumnsChanged = delegateCombine(g.actualColumnsChanged, runOn(this, this.a9));
let h = this.d;
h.columnWidthChanged = delegateCombine(h.columnWidthChanged, runOn(this, this.bb));
this.cm();
}, false);
}
}
cn(a) {
if (this.d != null) {
this.d.defaultColumnWidth = a;
this.ct();
}
}
cr() {
if (this.d != null) {
let 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;
}
}
cy() {
if (!this.t) {
return;
}
let a = this.d;
let b = a.activeCell;
if (null != b) {
let c = this.b();
if (null != c) {
let d = c.getItemAtIndex(b.b);
if (null == d) {
return;
}
a.scrollToItem(d);
}
}
else {
a.scrollToRowByIndex(0);
}
}
cz() {
if (null != this.aq) {
let a = this.g;
let b = a.itemsSource;
this.d.selectedItems.clear();
if (this.d.actualDataSource != null) {
let 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;
let d = this.b();
if (null != d) {
let e = d.updateNotifier;
let f = new MultiColumnComboBoxDataSourceNotificationHandler(this, false);
let 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();
}
}
}
av(a, b) {
if (this.ao != -1) {
this.ch(this.ao);
this.ao = -1;
}
}
c0() {
if (null != this.aj) {
let 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);
}
}
}
cg(a) {
if (this.j != null) {
this.j.disabled = !a;
}
if (this.k != null) {
this.k.disabled = !a;
}
}
c1() {
this.ct();
if (!this.w) {
this.z = false;
}
else {
let a = this.b();
this.z = a.actualCount == 0;
}
MultiColumnComboBoxUtilities.c(this.am, this.z);
MultiColumnComboBoxUtilities.c(this.ag, !this.z);
}
a6(a) {
if (this.j != null) {
this.j.focus(a);
}
}
ce() {
if (this.j != null) {
this.j.dp();
}
}
ci(a) {
if (this.j != null) {
this.j.e = a;
}
}
get al() {
return this.ak;
}
get g() {
return this.f;
}
get ad() {
return this.ac;
}
c2() {
if (null != this.al) {
this.al.setStyleProperty("box-sizing", "border-box");
}
}
a2(a) {
let b = a.target;
if (!this.o()) {
this.bz();
}
}
ax(a) {
this.d.selectedItems.clear();
this.j.cq = "";
this.g.text = "";
this.g.value = null;
}
a4(a) {
let b = this.n;
if (b.ax) {
this.az();
}
else {
this.aw(null);
}
if (null != this.j) {
this.j.focus();
this.j.dp();
}
}
a7(a, b) {
let c = b.newActiveCell;
this.a8(c);
this.r = true;
}
a9(a, b) {
this.cv();
}
ba(a, b) {
if (typeCast(TextHeaderCellModel.$, b.cellInfo) !== null) {
return;
}
this.br();
}
bb(a, b) {
this.ct();
this.bp();
}
bd(a, b) {
this.bc();
this.s = true;
this.cj();
}
be(a, b) {
this.t = b.b != 0 && b.a != 0;
this.cy();
}
bf(a, b) {
this.cy();
let c = this.d;
c.viewportChanged = delegateRemove(c.viewportChanged, runOn(this, this.bf));
}
bi(a, b) {
if (b.isCompositionInProgress) {
return;
}
this.f.gd(b);
let c = b.value;
this.b9(c);
}
bj(a, b) {
let c = this.j.cq;
this.b9(c);
}
bk(a, b) {
this.cd();
}
bl(a, b) {
this.f.gf(b);
if (b.defaultPrevented) {
return;
}
let c = b.keyCode;
this.ap = c;
this.x = false;
let d = b.modifiers;
switch (c) {
case 8:
let e = this.j.selectionStart;
if (0 == e) {
break;
}
let f = this.j.cq;
if (stringIsNullOrEmpty(f)) {
break;
}
let g = f.length;
let h = this.j.selectionEnd;
let 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 {
let j = this.e;
if (null == j) {
return;
}
let k = this.e.activeCell;
if (null != j.activeCell) {
this.d.kk(false, false);
b.preventDefault();
}
else {
let l = this.b();
if (null != l) {
let m = l.actualCount;
if (m > 0) {
this.ch(0);
b.preventDefault();
}
}
}
}
break;
case 38:
if (d == 1) {
this.az();
b.preventDefault();
}
else {
let n = this.e;
if (null == n) {
return;
}
let o = this.e.activeCell;
if (null != n.activeCell) {
this.d.kx(false, false);
b.preventDefault();
}
else {
let p = this.b();
if (null != p) {
let 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;
}
}
bm(a, b) {
if (false == this.o()) {
this.j.dp();
b.handled = true;
}
}
bn(a) {
this.j.focus();
let b = (a.originalEvent.relatedTarget);
if (!this.u(b)) {
this.by();
}
}
bo(a) {
let b = (a.originalEvent.relatedTarget);
if (!this.u(b)) {
this.bz();
}
}
c3(a) {
let b = this.n;
if (null == b || false == b.ax) {
return;
}
let c = this.c4();
this.m.ca(c);
}
cq() {
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();
}
}
}
cp() {
if (this.m != null) {
this.m.ar = this.g.bn;
}
}
cs() {
if (this.m != null) {
this.m.ay = this.g.br;
}
}
}
MultiColumnComboBoxView.$t = /*@__PURE__*/ 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;
})();
/**
* @hidden
*/
export let MultiColumnComboBox = /*@__PURE__*/ (() => {
class MultiColumnComboBox extends Base {
constructor() {
super();
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;
let a = this.u();
this.v = a;
a.bh(this);
}
get a6() {
if (this.a5 == null) {
this.a5 = new SRProvider(this.v.ad);
this.a5.cb("MultiColumnComboBox");
}
return this.a5;
}
u() {
return new MultiColumnComboBoxView();
}
gm(a, b, c) {
switch (a) {
case "BackgroundColor":
this.hl = this.hw != null ? this.hw : this.h1;
break;
case "BorderColor":
this.hm = this.hx != null ? this.hx : this.h2;
break;
case "BorderWidth":
this.cc = !isNaN_(this.cm) ? this.cm : this.co;
break;
case "ContentPadding":
this.il = XInputGroup.oh(this.im, this.io);
break;
case "CornerRadius":
this.gw = XInputGroup.kr(this.gx, this.gy);
break;
case "FocusBorderColor":
this.hn = this.h9 != null ? this.h9 : this.h3;
break;
case "FocusBorderWidth":
this.cd = !isNaN_(this.cy) ? this.cy : this.cp;
break;
case "FocusUnderlineColor":
this.ho = this.ia != null ? this