igniteui-react-grids
Version:
Ignite UI React grid components.
140 lines (139 loc) • 5.17 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, delegateCombine, Point_$type, markType } from "igniteui-react-core";
import { IDraggerView_$type } from "./IDraggerView";
import { CanvasGestureDOMEventProxy } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { BaseDOMEventProxy } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { ElevationHelper } from "igniteui-react-core";
/**
* @hidden
*/
export let DraggerView = /*@__PURE__*/ (() => {
class DraggerView extends Base {
get model() {
return this._model;
}
set model(a) {
this._model = a;
}
constructor(a) {
super();
this._model = null;
this.c = null;
this.d = null;
this.a = null;
this.model = a;
}
provideContainer(a) {
if (a == null) {
if (this.c != null) {
this.c = null;
}
if (this.a != null) {
this.a.ao = null;
this.a.av();
}
return;
}
this.c = a;
let b = Math.round(this.c.rootWrapper.width());
let c = Math.round(this.c.rootWrapper.height());
this.a = new CanvasGestureDOMEventProxy(this.c.rootWrapper, this.c, true);
this.a.c8 = true;
let d = this.a;
d.onMouseOver = delegateCombine(d.onMouseOver, runOn(this, this.e));
let e = this.a;
e.onMouseUp = delegateCombine(e.onMouseUp, runOn(this, this.f));
this.a.ao = runOn(this, this.b);
this.model.viewportWidth = b;
this.model.viewportHeight = c;
}
onDetachedFromUI() {
if (this.a != null && this.c != null) {
this.a.bh(this.c.rootWrapper, "");
}
}
onAttachedToUI() {
if (this.a != null) {
this.a.at(this.c.rootWrapper, "");
}
}
b(a) {
return this.model.isDragActive;
}
e(a, b, c) {
this.g(a);
}
f(a) {
this.h(a);
}
captureMouse() {
}
releaseMouse() {
}
transformPoint(a, b) {
let c = BaseDOMEventProxy.c4(this.c.rootWrapper);
let d = { $type: Point_$type, x: a - c.x, y: b - c.y };
return d;
}
g(a) {
this.model.onMouseMove(a.x, a.y);
}
h(a) {
this.model.onMouseUp(a.x, a.y);
}
onViewportSizeChanged(a, b) {
this.a.bl = new Rect(0, 0, 0, a, b);
}
addCloneCellToDom() {
if (this.c != null) {
if (this.model.cloneCell != null) {
this.d = this.model.cloneCell;
document.documentElement.appendChild(this.d.getNativeElement());
let a = ElevationHelper.e(12, BrushUtil.h(66, 0, 0, 0), BrushUtil.h(30, 0, 0, 0), BrushUtil.h(20, 0, 0, 0));
this.d.setStyleProperty("boxShadow", a);
this.d.setStyleProperty("z-index", "12000");
this.d.setStyleProperty("min-width", "170px");
this.d.setStyleProperty("max-width", "250px");
let b = BrushUtil.a("background-color", this.d);
let c = BrushUtil.h(200, b[0].color.o, b[0].color.n, b[0].color.m);
this.d.setStyleProperty("background-color", c._fill);
let d = this.d.getChildAt(0);
let e = BrushUtil.a("color", d);
let f = BrushUtil.h(200, e[0].color.o, e[0].color.n, e[0].color.m);
d.setStyleProperty("color", f._fill);
}
}
}
removeCloneCellFromDom() {
if (this.c != null) {
this.d.remove();
}
}
getTopAndLeft() {
let rect_ = this.c.rootWrapper.getNativeElement().getBoundingClientRect();
let a = (rect_.top);
let b = (rect_.left);
let c = new Array(2);
c[0] = a;
c[1] = b;
return c;
}
getWindowScrollPos() {
let a = window.pageYOffset;
let b = window.pageXOffset;
let c = new Array(2);
c[0] = a;
c[1] = b;
return c;
}
}
DraggerView.$t = /*@__PURE__*/ markType(DraggerView, 'DraggerView', Base.$, [IDraggerView_$type]);
return DraggerView;
})();