igniteui-react-core
Version:
Ignite UI React Core.
250 lines (249 loc) • 8.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 { Base, runOn, markType } from "./type";
import { INativeUIElementBridge_$type } from "./INativeUIElementBridge";
import { Size } from "./Size";
import { Rect } from "./Rect";
import { NativeUIMouseEventArgs } from "./NativeUIMouseEventArgs";
import { NativeUIFocusEventArgs } from "./NativeUIFocusEventArgs";
/**
* @hidden
*/
export let NativeUIElementBridge = /*@__PURE__*/ (() => {
class NativeUIElementBridge extends Base {
constructor() {
super(...arguments);
this.i = null;
this.e = null;
this.m = null;
this.j = null;
this.f = null;
this.n = null;
this.g = null;
this.c = null;
this.k = null;
this.h = null;
this.d = null;
this.l = null;
this.b = 0;
this.a = 0;
}
getDesiredSize(a, b) {
if ((a.getNativeElement)) {
a = a.getNativeElement();
}
let c = (a);
return new Size(1, c.offsetWidth, c.offsetHeight);
}
getBoundingRect(a) {
let b = a.getNativeElement();
let c = b.getBoundingClientRect();
return new Rect(0, (c.left), (c.top), (c.width), (c.height));
}
contains(a, b) {
let c = a.getNativeElement();
return (c.contains(b));
}
focus(a) {
let b = a.getNativeElement();
b.focus();
}
focusWithScrollPrevented(a) {
let ele_ = a.getNativeElement();
ele_.focus({ preventScroll: true });
}
getMethodTarget(a) {
return a;
}
getTargetForProperty(a, b) {
return b;
}
addHandler(a, b, c, d) {
switch (c) {
case 7:
{
let e = a;
this.i = e.listen("mouseenter", runOn(this, this.q));
this.e = d;
this.m = b;
}
break;
case 8:
{
let f = a;
this.j = f.listen("mouseleave", runOn(this, this.r));
this.f = d;
this.n = b;
}
break;
case 13:
{
let g = a;
this.g = g.listen("focus", runOn(this, this.o));
this.c = d;
this.k = b;
}
break;
case 14:
{
let h = a;
this.h = h.listen("blur", runOn(this, this.p));
this.d = d;
this.l = b;
}
break;
}
}
getHorizontalAlignment(a) {
return this.a;
}
getTargetForBuildInEvent(a, b) {
return a;
}
getTargetForBuildInProperty(a, b) {
return a;
}
getValue(a, b) {
switch (b) {
case 108:
let c = a;
return c.getAttribute("data-automation-name");
}
return null;
}
getVerticalAlignment(a) {
return this.b;
}
removeHandler(a, b, c, d) {
switch (c) {
case 7:
if (this.i != null) {
this.i();
}
this.e = null;
this.m = null;
break;
case 8:
if (this.j != null) {
this.j();
}
this.f = null;
this.n = null;
break;
case 13:
if (this.g != null) {
this.g();
}
this.c = null;
this.k = null;
break;
case 14:
if (this.h != null) {
this.h();
}
this.d = null;
this.l = null;
break;
}
}
setHorizontalAlignment(a, b) {
this.a = b;
let c = a;
switch (b) {
case 0:
c.setStyleProperty("justify-self", "start");
c.setStyleProperty("text-align", "left");
break;
case 1:
c.setStyleProperty("justify-self", "center");
c.setStyleProperty("text-align", "center");
break;
case 2:
c.setStyleProperty("justify-self", "end");
c.setStyleProperty("text-align", "right");
break;
case 3:
c.setStyleProperty("justify-self", "stretch");
c.setStyleProperty("text-align", "center");
break;
}
}
setValue(a, b, c) {
switch (b) {
case 108:
let d = a;
d.setAttribute("data-automation-name", c);
break;
}
}
setVerticalAlignment(a, b) {
this.b = b;
let c = a;
switch (b) {
case 0:
c.setStyleProperty("align-self", "start");
c.setStyleProperty("valign", "top");
break;
case 1:
c.setStyleProperty("align-self", "center");
c.setStyleProperty("valign", "center");
break;
case 2:
c.setStyleProperty("align-self", "end");
c.setStyleProperty("valign", "bottom");
break;
case 3:
c.setStyleProperty("align-self", "stretch");
c.setStyleProperty("valign", "center");
break;
}
}
q(a) {
if (this.e != null) {
let b = new NativeUIMouseEventArgs();
this.e(this.m, b);
}
}
r(a) {
if (this.f != null) {
let b = new NativeUIMouseEventArgs();
this.f(this.n, b);
}
}
o(a) {
if (this.c != null) {
let b = new NativeUIFocusEventArgs();
this.c(this.k, b);
}
}
p(a) {
if (this.d != null) {
let b = new NativeUIFocusEventArgs();
this.d(this.l, b);
}
}
getHorizontalContentAlignment(a) {
return 3;
}
setHorizontalContentAlignment(a, b) {
}
getVerticalContentAlignment(a) {
return 3;
}
setVerticalContentAlignment(a, b) {
}
beforeSetNativeValue(a, b) {
}
afterSetNativeValue(a, b) {
}
exportVisualData(a) {
return null;
}
}
NativeUIElementBridge.$t = /*@__PURE__*/ markType(NativeUIElementBridge, 'NativeUIElementBridge', Base.$, [INativeUIElementBridge_$type]);
return NativeUIElementBridge;
})();