igniteui-react-inputs
Version:
Ignite UI React input components.
180 lines (179 loc) • 6.53 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 { INativeUIButtonGroupBridge_$type } from "igniteui-react-core";
import { runOn, delegateCombine, delegateRemove, enumGetBox, EnumUtil, markType } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { NativeUIButton } from "igniteui-react-core";
import { NativeUIButtonGroupSelectionChangedEventArgs } from "igniteui-react-core";
import { NativeUIDisplayDensity_$type } from "igniteui-react-core";
import { BaseControlTheme_$type } from "igniteui-react-core";
import { NativeUIButtonGroupDisplayType_$type } from "igniteui-react-core";
import { NativeUIButtonDisplayType_$type } from "igniteui-react-core";
/**
* @hidden
*/
var XButtonGroupBridge = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(XButtonGroupBridge, _super);
function XButtonGroupBridge(a) {
var _this = _super.call(this, a) || this;
_this.u = null;
_this.w = null;
_this.v = new List$1(NativeUIButton.$, 0);
return _this;
}
XButtonGroupBridge.prototype.addHandler = function (a, b, c, d) {
var e = a;
switch (c) {
case 3:
e.selectionChanged = delegateCombine(e.selectionChanged, runOn(this, this.x));
this.u = d;
this.w = b;
break;
}
};
XButtonGroupBridge.prototype.removeHandler = function (a, b, c, d) {
var e = a;
switch (c) {
case 3:
e.selectionChanged = delegateRemove(e.selectionChanged, runOn(this, this.x));
this.u = null;
this.w = null;
break;
}
};
XButtonGroupBridge.prototype.x = function (a, b) {
if (this.u != null) {
var c = new NativeUIButtonGroupSelectionChangedEventArgs();
var d = a;
var e = d.d;
var f = null;
c.a = e;
this.u(this.w, c);
}
};
XButtonGroupBridge.prototype.getValue = function (a, b) {
var c = a;
switch (b) {
case 1:
var d = c.t;
var e = 1;
switch (d) {
case 0:
e = 0;
break;
case 1:
e = 1;
break;
case 2:
e = 2;
break;
case 3:
e = 3;
break;
case 4:
e = 4;
break;
}
return enumGetBox(NativeUIDisplayDensity_$type, e);
case 18: return enumGetBox(BaseControlTheme_$type, c.p);
case 87: return c.d;
case 0:
switch (c.i) {
case 0: return enumGetBox(NativeUIButtonGroupDisplayType_$type, 0);
case 1: return enumGetBox(NativeUIButtonGroupDisplayType_$type, 1);
}
return enumGetBox(NativeUIButtonDisplayType_$type, 0);
case 32: return c.disabled;
case 24: return c.hs;
case 17: return c.a1;
}
return null;
};
XButtonGroupBridge.prototype.setValue = function (a, b, c) {
var d = a;
switch (b) {
case 1:
var e = 0;
switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) {
case 0:
e = 0;
break;
case 1:
e = 1;
break;
case 3:
e = 3;
break;
case 4:
e = 4;
break;
case 2:
e = 2;
break;
}
d.t = e;
break;
case 18:
d.p = EnumUtil.getEnumValue(BaseControlTheme_$type, c);
break;
case 87:
d.d = c;
break;
case 0:
switch (EnumUtil.getEnumValue(NativeUIButtonGroupDisplayType_$type, c)) {
case 0:
d.i = 0;
break;
case 1:
d.i = 1;
break;
}
break;
case 32:
d.disabled = c;
break;
case 24:
d.hs = c;
break;
case 17:
d.a1 = c.e;
break;
}
};
XButtonGroupBridge.prototype.exportVisualData = function (a) {
return a.a5();
};
XButtonGroupBridge.prototype.addButton = function (a, b) {
this.v.add(b);
a.buttons.add(b.d.getMethodTarget(null));
a.appendContentChild(b.an);
};
XButtonGroupBridge.prototype.updateButton = function (a, b, c) {
this.v._inner[b] = c;
a.buttons._inner[b] = c.d.getMethodTarget(null);
};
XButtonGroupBridge.prototype.insertButton = function (a, b, c) {
this.v.insert(b, c);
a.buttons.insert(b, c.d.getMethodTarget(null));
a.appendContentChild(c.an);
};
XButtonGroupBridge.prototype.removeButton = function (a, b) {
this.v.removeAt(b);
a.buttons.removeAt(b);
};
XButtonGroupBridge.prototype.getButtonAt = function (a, b) {
return this.v._inner[b];
};
XButtonGroupBridge.prototype.clearSelection = function (a) {
a.d = new Array(0);
};
XButtonGroupBridge.$t = markType(XButtonGroupBridge, 'XButtonGroupBridge', XComponentBridge.$, [INativeUIButtonGroupBridge_$type]);
return XButtonGroupBridge;
}(XComponentBridge));
export { XButtonGroupBridge };