igniteui-react-core
Version:
Ignite UI React Core.
112 lines (111 loc) • 4.05 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 { NativeUIElementBridge } from "./NativeUIElementBridge";
import { runOn, enumGetBox, typeCast, EnumUtil, markType } from "./type";
import { NativeUIComponent } from "./NativeUIComponent";
import { NativeUIButtonClickedEventArgs } from "./NativeUIButtonClickedEventArgs";
import { NativeUIDisplayDensity_$type } from "./NativeUIDisplayDensity";
/**
* @hidden
*/
export let IgcButtonBridge = /*@__PURE__*/ (() => {
class IgcButtonBridge extends NativeUIElementBridge {
constructor() {
super(...arguments);
this.u = null;
this.s = null;
this.v = null;
this.w = null;
this.t = null;
}
addHandler(a, b, c, d) {
switch (c) {
case 1:
let e = a;
this.u = e.listen("click", runOn(this, this.x));
this.s = d;
this.v = b;
break;
}
}
x(a) {
if (this.s != null) {
let b = new NativeUIButtonClickedEventArgs();
this.s(this.v, b);
}
}
getValue(a, b) {
switch (b) {
case 3: return this.t != null ? this.t : this.w;
case 1:
let c = a.getProperty("size");
let d = 1;
switch (c) {
case "small":
d = 3;
break;
case "medium":
d = 2;
break;
case "large":
d = 1;
break;
default:
d = 1;
break;
}
return enumGetBox(NativeUIDisplayDensity_$type, d);
}
return null;
}
removeHandler(a, b, c, d) {
switch (c) {
case 1:
if (this.u != null) {
this.u();
}
this.s = null;
this.v = null;
break;
}
}
setValue(a, b, c) {
switch (b) {
case 3:
if (typeCast(NativeUIComponent.$, c) !== null) {
this.t = c;
a.append(this.t.an);
}
else {
this.w = c == null ? null : c.toString();
a.setText(this.w);
}
break;
case 1:
let d = "large";
switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) {
case 0:
d = "large";
break;
case 1:
d = "large";
break;
case 3:
d = "small";
break;
case 2:
d = "medium";
break;
}
a.setProperty("size", d);
break;
}
}
}
IgcButtonBridge.$t = /*@__PURE__*/ markType(IgcButtonBridge, 'IgcButtonBridge', NativeUIElementBridge.$);
return IgcButtonBridge;
})();