igniteui-react-core
Version:
Ignite UI React Core.
86 lines (85 loc) • 4.01 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 { IgcButtonBridge } from "./IgcButtonBridge";
import { EnumUtil, markType } from "./type";
import { NativeUIDisplayDensity_$type } from "./NativeUIDisplayDensity";
import { SvgIconRegistry } from "./SvgIconRegistry";
import { stringReplace } from "./string";
/**
* @hidden
*/
export let IgcIconButtonBridge = /*@__PURE__*/ (() => {
class IgcIconButtonBridge extends IgcButtonBridge {
constructor() {
super(...arguments);
this.z = null;
this.y = "default";
this.aa = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"@@Inject\"/></svg>";
}
getValue(a, b) {
switch (b) {
case 16: return this.z;
case 15: return this.y;
}
return super.getValue(a, b);
}
setValue(a, b, c) {
let nativeEle_ = a.getNativeElement();
switch (b) {
case 16:
this.z = c;
if (this.z != null && this.y != null) {
if (SvgIconRegistry.instance.getSvgPathString(this.y, this.z) != null) {
let svg_ = stringReplace(this.aa, "@@Inject", (SvgIconRegistry.instance.getSvgPathString(this.y, this.z)));
let iconName_ = this.z;
let iconCollection_ = this.y;
nativeEle_.registerIconFromText(iconName_, svg_, iconCollection_);
a.setProperty("name", this.z);
a.setProperty("collection", this.y);
}
else {
a.setProperty("name", this.z);
a.setProperty("collection", this.y);
}
}
return;
case 15:
this.y = c;
if (this.z != null && this.y != null) {
if (SvgIconRegistry.instance.getSvgPathString(this.y, this.z) != null) {
let svg_ = stringReplace(this.aa, "@@Inject", (SvgIconRegistry.instance.getSvgPathString(this.y, this.z)));
let iconName_ = this.z;
let iconCollection_ = this.y;
nativeEle_.registerIconFromText(iconName_, svg_, iconCollection_);
a.setProperty("name", this.z);
a.setProperty("collection", this.y);
}
else {
a.setProperty("name", this.z);
a.setProperty("collection", this.y);
}
}
return;
case 1:
switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) {
case 1:
nativeEle_.size = "large";
break;
case 2:
nativeEle_.size = "medium";
break;
case 3:
nativeEle_.size = "small";
break;
}
break;
}
}
}
IgcIconButtonBridge.$t = /*@__PURE__*/ markType(IgcIconButtonBridge, 'IgcIconButtonBridge', IgcButtonBridge.$);
return IgcIconButtonBridge;
})();