igniteui-react-inputs
Version:
Ignite UI React input components.
323 lines (322 loc) • 11 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 } from "tslib";
import { XComponentBridge } from "./XComponentBridge";
import { runOn, delegateCombine, delegateRemove, typeCast, EnumUtil, enumGetBox, markType } from "igniteui-react-core";
import { NativeUIComponent } from "igniteui-react-core";
import { NativeUIButtonClickedEventArgs } from "igniteui-react-core";
import { NativeUIMouseEventArgs } from "igniteui-react-core";
import { NativeUIFocusEventArgs } from "igniteui-react-core";
import { NativeUIDisplayDensity_$type } from "igniteui-react-core";
import { NativeUIButtonDisplayType_$type } from "igniteui-react-core";
import { BaseControlTheme_$type } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
/**
* @hidden
*/
var XButtonBridge = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(XButtonBridge, _super);
function XButtonBridge(a) {
var _this = _super.call(this, a) || this;
_this.ac = null;
_this.aa = null;
_this.u = null;
_this.z = null;
_this.x = null;
_this.ae = null;
_this.y = null;
_this.af = null;
_this.v = null;
_this.ab = null;
_this.w = null;
_this.ad = null;
return _this;
}
XButtonBridge.prototype.addHandler = function (a, b, c, d) {
var e = a;
switch (c) {
case 1:
e.clicked = delegateCombine(e.clicked, runOn(this, this.ag));
this.u = d;
this.z = b;
break;
case 7:
e.mouseEnter = delegateCombine(e.mouseEnter, runOn(this, this.aj));
this.x = d;
this.ae = b;
break;
case 8:
e.mouseLeave = delegateCombine(e.mouseLeave, runOn(this, this.ak));
this.y = d;
this.af = b;
break;
case 13:
e.gotFocus = delegateCombine(e.gotFocus, runOn(this, this.ah));
this.v = d;
this.ab = b;
break;
case 14:
e.lostFocus = delegateCombine(e.lostFocus, runOn(this, this.ai));
this.w = d;
this.ad = b;
break;
}
};
XButtonBridge.prototype.removeHandler = function (a, b, c, d) {
var e = a;
switch (c) {
case 1:
e.clicked = delegateRemove(e.clicked, runOn(this, this.ag));
this.u = null;
this.z = null;
break;
case 7:
e.mouseEnter = delegateRemove(e.mouseEnter, runOn(this, this.aj));
this.x = null;
this.ae = null;
break;
case 8:
e.mouseLeave = delegateRemove(e.mouseLeave, runOn(this, this.ak));
this.y = null;
this.af = null;
break;
}
};
XButtonBridge.prototype.ag = function (a, b) {
if (this.u != null) {
var c = new NativeUIButtonClickedEventArgs();
this.u(this.z, c);
}
};
XButtonBridge.prototype.aj = function (a, b) {
if (this.x != null) {
var c = new NativeUIMouseEventArgs();
this.x(this.ae, c);
}
};
XButtonBridge.prototype.ak = function (a, b) {
if (this.y != null) {
var c = new NativeUIMouseEventArgs();
this.y(this.af, c);
}
};
XButtonBridge.prototype.ah = function (a, b) {
if (this.v != null) {
this.v(this.ab, new NativeUIFocusEventArgs());
}
};
XButtonBridge.prototype.ai = function (a, b) {
if (this.w != null) {
this.w(this.ad, ((function () {
var $ret = new NativeUIFocusEventArgs();
$ret.b = b.b;
$ret.a = b.a;
return $ret;
})()));
}
};
XButtonBridge.prototype.setValue = function (a, b, c) {
var d = a;
switch (b) {
case 3:
d.clearButtonContent();
if (typeCast(NativeUIComponent.$, c) !== null) {
this.ac = c;
d.appendButtonContent(this.ac.an);
}
else {
this.ac = c;
var e = d.view.k.createElement("span");
e.setText(this.ac == null ? null : this.ac.toString());
d.appendButtonContent(e);
}
break;
case 1:
switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) {
case 0:
d.r = 0;
break;
case 1:
d.r = 1;
break;
case 3:
d.r = 3;
break;
case 2:
d.r = 2;
break;
case 4:
d.r = 4;
break;
}
break;
case 18:
d.n = EnumUtil.getEnumValue(BaseControlTheme_$type, c);
break;
case 54:
if (typeCast(NativeUIComponent.$, c) !== null) {
this.aa = c;
d.appendButtonContent(this.aa.an);
}
break;
case 0:
switch (EnumUtil.getEnumValue(NativeUIButtonDisplayType_$type, c)) {
case 3:
d.e = 3;
break;
case 1:
d.e = 1;
break;
case 4:
d.e = 4;
break;
case 2:
d.e = 2;
break;
case 0:
d.e = 0;
break;
}
break;
case 4:
d.aw = c;
break;
case 32:
d.disabled = c;
break;
case 5:
d.au = c;
break;
case 6:
d.a2 = !c;
break;
case 24:
d.qg = c;
break;
case 55:
d.bm = c.left;
d.bo = c.top;
d.bn = c.right;
d.bl = c.bottom;
break;
case 57:
d.ay = c;
break;
case 56:
d.av = c;
break;
case 58:
d.at = c;
break;
case 17:
d.k1 = c;
break;
case 11:
d.aa = c;
break;
case 88:
d.by = c;
break;
case 59:
d.a5 = c;
break;
}
};
XButtonBridge.prototype.getValue = function (a, b) {
var c = a;
switch (b) {
case 3: return this.ac;
case 54: return this.aa;
case 1:
switch (c.r) {
case 0: return enumGetBox(NativeUIDisplayDensity_$type, 0);
case 1: return enumGetBox(NativeUIDisplayDensity_$type, 1);
case 3: return enumGetBox(NativeUIDisplayDensity_$type, 3);
case 2: return enumGetBox(NativeUIDisplayDensity_$type, 2);
case 4: return enumGetBox(NativeUIDisplayDensity_$type, 4);
}
break;
case 18: return enumGetBox(BaseControlTheme_$type, c.n);
case 0:
switch (c.e) {
case 3: return enumGetBox(NativeUIButtonDisplayType_$type, 3);
case 1: return enumGetBox(NativeUIButtonDisplayType_$type, 1);
case 4: return enumGetBox(NativeUIButtonDisplayType_$type, 4);
case 2: return enumGetBox(NativeUIButtonDisplayType_$type, 2);
case 0: return enumGetBox(NativeUIButtonDisplayType_$type, 0);
}
return enumGetBox(NativeUIButtonDisplayType_$type, 0);
case 4: return c.aw;
case 32: return c.disabled;
case 5: return c.au;
case 6: return !c.a2;
case 24: return c.qg;
case 55: return new Thickness(1, c.bm, c.bo, c.bn, c.bl);
case 57: return c.ay;
case 56: return c.av;
case 58: return c.at;
case 17: return c.k1;
case 88: return c.by;
case 59: return c.a5;
}
return null;
};
XButtonBridge.prototype.setHorizontalContentAlignment = function (a, b) {
switch (b) {
case 1:
this.t.le = 1;
break;
case 0:
this.t.le = 0;
break;
case 2:
this.t.le = 2;
break;
case 3:
this.t.le = 3;
break;
}
};
XButtonBridge.prototype.getHorizontalContentAlignment = function (a) {
switch (this.t.le) {
case 1: return 1;
case 0: return 0;
case 2: return 2;
default: return 3;
}
};
XButtonBridge.prototype.setVerticalContentAlignment = function (a, b) {
switch (b) {
case 2:
this.t.ri = 2;
break;
case 1:
this.t.ri = 1;
break;
case 3:
this.t.ri = 3;
break;
case 0:
this.t.ri = 0;
break;
}
};
XButtonBridge.prototype.getVerticalContentAlignment = function (a) {
switch (this.t.ri) {
case 2: return 2;
case 1: return 1;
case 0: return 0;
default: return 3;
}
};
XButtonBridge.prototype.exportVisualData = function (a) {
return a.eb();
};
XButtonBridge.$t = markType(XButtonBridge, 'XButtonBridge', XComponentBridge.$);
return XButtonBridge;
}(XComponentBridge));
export { XButtonBridge };