UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

252 lines (251 loc) 8.88 kB
/* 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 { 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 */ var NativeUIElementBridge = /** @class */ /*@__PURE__*/ (function (_super) { __extends(NativeUIElementBridge, _super); function NativeUIElementBridge() { var _this = _super !== null && _super.apply(this, arguments) || this; _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; return _this; } NativeUIElementBridge.prototype.getDesiredSize = function (a, b) { if ((a.getNativeElement)) { a = a.getNativeElement(); } var c = (a); return new Size(1, c.offsetWidth, c.offsetHeight); }; NativeUIElementBridge.prototype.getBoundingRect = function (a) { var b = a.getNativeElement(); var c = b.getBoundingClientRect(); return new Rect(0, (c.left), (c.top), (c.width), (c.height)); }; NativeUIElementBridge.prototype.contains = function (a, b) { var c = a.getNativeElement(); return (c.contains(b)); }; NativeUIElementBridge.prototype.focus = function (a) { var b = a.getNativeElement(); b.focus(); }; NativeUIElementBridge.prototype.focusWithScrollPrevented = function (a) { var ele_ = a.getNativeElement(); ele_.focus({ preventScroll: true }); }; NativeUIElementBridge.prototype.getMethodTarget = function (a) { return a; }; NativeUIElementBridge.prototype.getTargetForProperty = function (a, b) { return b; }; NativeUIElementBridge.prototype.addHandler = function (a, b, c, d) { switch (c) { case 7: { var e = a; this.i = e.listen("mouseenter", runOn(this, this.q)); this.e = d; this.m = b; } break; case 8: { var f = a; this.j = f.listen("mouseleave", runOn(this, this.r)); this.f = d; this.n = b; } break; case 13: { var g = a; this.g = g.listen("focus", runOn(this, this.o)); this.c = d; this.k = b; } break; case 14: { var h = a; this.h = h.listen("blur", runOn(this, this.p)); this.d = d; this.l = b; } break; } }; NativeUIElementBridge.prototype.getHorizontalAlignment = function (a) { return this.a; }; NativeUIElementBridge.prototype.getTargetForBuildInEvent = function (a, b) { return a; }; NativeUIElementBridge.prototype.getTargetForBuildInProperty = function (a, b) { return a; }; NativeUIElementBridge.prototype.getValue = function (a, b) { switch (b) { case 108: var c = a; return c.getAttribute("data-automation-name"); } return null; }; NativeUIElementBridge.prototype.getVerticalAlignment = function (a) { return this.b; }; NativeUIElementBridge.prototype.removeHandler = function (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; } }; NativeUIElementBridge.prototype.setHorizontalAlignment = function (a, b) { this.a = b; var 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; } }; NativeUIElementBridge.prototype.setValue = function (a, b, c) { switch (b) { case 108: var d = a; d.setAttribute("data-automation-name", c); break; } }; NativeUIElementBridge.prototype.setVerticalAlignment = function (a, b) { this.b = b; var 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; } }; NativeUIElementBridge.prototype.q = function (a) { if (this.e != null) { var b = new NativeUIMouseEventArgs(); this.e(this.m, b); } }; NativeUIElementBridge.prototype.r = function (a) { if (this.f != null) { var b = new NativeUIMouseEventArgs(); this.f(this.n, b); } }; NativeUIElementBridge.prototype.o = function (a) { if (this.c != null) { var b = new NativeUIFocusEventArgs(); this.c(this.k, b); } }; NativeUIElementBridge.prototype.p = function (a) { if (this.d != null) { var b = new NativeUIFocusEventArgs(); this.d(this.l, b); } }; NativeUIElementBridge.prototype.getHorizontalContentAlignment = function (a) { return 3; }; NativeUIElementBridge.prototype.setHorizontalContentAlignment = function (a, b) { }; NativeUIElementBridge.prototype.getVerticalContentAlignment = function (a) { return 3; }; NativeUIElementBridge.prototype.setVerticalContentAlignment = function (a, b) { }; NativeUIElementBridge.prototype.beforeSetNativeValue = function (a, b) { }; NativeUIElementBridge.prototype.afterSetNativeValue = function (a, b) { }; NativeUIElementBridge.prototype.exportVisualData = function (a) { return null; }; NativeUIElementBridge.$t = markType(NativeUIElementBridge, 'NativeUIElementBridge', Base.$, [INativeUIElementBridge_$type]); return NativeUIElementBridge; }(Base)); export { NativeUIElementBridge };