UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

146 lines (145 loc) 5.54 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, 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 */ var DraggerView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DraggerView, _super); function DraggerView(a) { var _this = _super.call(this) || this; _this._model = null; _this.c = null; _this.d = null; _this.a = null; _this.model = a; return _this; } Object.defineProperty(DraggerView.prototype, "model", { get: function () { return this._model; }, set: function (a) { this._model = a; }, enumerable: false, configurable: true }); DraggerView.prototype.provideContainer = function (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; var b = Math.round(this.c.rootWrapper.width()); var c = Math.round(this.c.rootWrapper.height()); this.a = new CanvasGestureDOMEventProxy(this.c.rootWrapper, this.c, true); this.a.c8 = true; var d = this.a; d.onMouseOver = delegateCombine(d.onMouseOver, runOn(this, this.e)); var 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; }; DraggerView.prototype.onDetachedFromUI = function () { if (this.a != null && this.c != null) { this.a.bh(this.c.rootWrapper, ""); } }; DraggerView.prototype.onAttachedToUI = function () { if (this.a != null) { this.a.at(this.c.rootWrapper, ""); } }; DraggerView.prototype.b = function (a) { return this.model.isDragActive; }; DraggerView.prototype.e = function (a, b, c) { this.g(a); }; DraggerView.prototype.f = function (a) { this.h(a); }; DraggerView.prototype.captureMouse = function () { }; DraggerView.prototype.releaseMouse = function () { }; DraggerView.prototype.transformPoint = function (a, b) { var c = BaseDOMEventProxy.c4(this.c.rootWrapper); var d = { $type: Point_$type, x: a - c.x, y: b - c.y }; return d; }; DraggerView.prototype.g = function (a) { this.model.onMouseMove(a.x, a.y); }; DraggerView.prototype.h = function (a) { this.model.onMouseUp(a.x, a.y); }; DraggerView.prototype.onViewportSizeChanged = function (a, b) { this.a.bl = new Rect(0, 0, 0, a, b); }; DraggerView.prototype.addCloneCellToDom = function () { if (this.c != null) { if (this.model.cloneCell != null) { this.d = this.model.cloneCell; document.documentElement.appendChild(this.d.getNativeElement()); var 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"); var b = BrushUtil.a("background-color", this.d); var c = BrushUtil.h(200, b[0].color.o, b[0].color.n, b[0].color.m); this.d.setStyleProperty("background-color", c._fill); var d = this.d.getChildAt(0); var e = BrushUtil.a("color", d); var f = BrushUtil.h(200, e[0].color.o, e[0].color.n, e[0].color.m); d.setStyleProperty("color", f._fill); } } }; DraggerView.prototype.removeCloneCellFromDom = function () { if (this.c != null) { this.d.remove(); } }; DraggerView.prototype.getTopAndLeft = function () { var rect_ = this.c.rootWrapper.getNativeElement().getBoundingClientRect(); var a = (rect_.top); var b = (rect_.left); var c = new Array(2); c[0] = a; c[1] = b; return c; }; DraggerView.prototype.getWindowScrollPos = function () { var a = window.pageYOffset; var b = window.pageXOffset; var c = new Array(2); c[0] = a; c[1] = b; return c; }; DraggerView.$t = markType(DraggerView, 'DraggerView', Base.$, [IDraggerView_$type]); return DraggerView; }(Base)); export { DraggerView };