igniteui-react-core
Version:
Ignite UI React Core.
88 lines (87 loc) • 3.25 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, Delegate_$type, runOn, markType } from "./type";
import { INativeUIWindowBridge_$type } from "./INativeUIWindowBridge";
import { List$1 } from "./List$1";
import { NativeUISizeChangedEventArgs } from "./NativeUISizeChangedEventArgs";
import { NativeUIMouseEventArgs } from "./NativeUIMouseEventArgs";
/**
* @hidden
*/
export let DOMWindowBridge = /*@__PURE__*/ (() => {
class DOMWindowBridge extends Base {
constructor() {
super(...arguments);
this.b = new List$1(Delegate_$type, 0);
this.a = new List$1(Delegate_$type, 0);
}
addEventListener(a, b) {
switch (a) {
case 15:
if (this.b.count == 0) {
window.addEventListener("resize", runOn(this, this.d), false);
}
this.b.add(b);
break;
case 9:
if (this.a.count == 0) {
window.addEventListener("pointerdown", runOn(this, this.c), false);
}
this.a.add(b);
break;
}
}
addEventListener1(a, b, c) {
this.addEventListener(a, b);
}
getHeight() {
return (window.innerHeight);
}
getHeight1(a) {
return (window.innerHeight);
}
getWidth() {
return (window.innerWidth);
}
getWidth1(a) {
return (window.innerWidth);
}
removeEventListener(a, b) {
switch (a) {
case 15:
this.b.remove(b);
if (this.b.count == 0) {
window.removeEventListener("resize", runOn(this, this.d), false);
}
break;
case 9:
this.a.remove(b);
if (this.a.count == 0) {
window.removeEventListener("pointerdown", runOn(this, this.c), false);
}
break;
}
}
d(a) {
let b = new NativeUISizeChangedEventArgs();
b.b = this.getWidth();
b.a = this.getHeight();
for (let c = 0; c < this.b.count; c++) {
this.b._inner[c](b);
}
}
c(a) {
let b = new NativeUIMouseEventArgs();
b.b = a.target;
for (let c = 0; c < this.a.count; c++) {
this.a._inner[c](b);
}
}
}
DOMWindowBridge.$t = /*@__PURE__*/ markType(DOMWindowBridge, 'DOMWindowBridge', Base.$, [INativeUIWindowBridge_$type]);
return DOMWindowBridge;
})();