define(["require", "exports", "./helper-common", "@syncfusion/ej2-base"], function (require, exports, helper_common_1, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getMousePosition(pageX, pageY, element) {
var elementRect = element.getBoundingClientRect();
var pageXOffset = element.ownerDocument.defaultView.pageXOffset;
var pageYOffset = element.ownerDocument.defaultView.pageYOffset;
var clientTop = element.ownerDocument.documentElement.clientTop;
var clientLeft = element.ownerDocument.documentElement.clientLeft;
var positionX = elementRect.left + pageXOffset - clientLeft;
var positionY = elementRect.top + pageYOffset - clientTop;
return new helper_common_1.GaugeLocation((pageX - positionX), (pageY - positionY));
}
exports.getMousePosition = getMousePosition;
function getElementSize(template, gauge, parent) {
var elementSize;
var element;
var templateFn = helper_common_1.getTemplateFunction(template, gauge);
var tooltipData = templateFn ? (gauge.isVue || gauge.isVue3) ? templateFn({}, gauge, null, gauge.element.id + 'Template')
: templateFn({}, null, null, gauge.element.id + 'Template') : [];
Eif (templateFn && tooltipData.length) {
element = gauge.createElement('div', { id: gauge.element.id + '_Measure_Element' });
gauge.element.appendChild(element);
var templateElement = (gauge.isVue || gauge.isVue3) ? templateFn({}, gauge, null, gauge.element.id + 'Template')
: templateFn({}, null, null, gauge.element.id + 'Template');
var templateLength = templateElement.length;
while (templateLength > 0) {
element.appendChild(templateElement[0]);
templateLength--;
}
parent.appendChild(element);
elementSize = new helper_common_1.Size(parent.getBoundingClientRect().width, parent.getBoundingClientRect().height);
ej2_base_1.remove(element);
}
return elementSize;
}
exports.getElementSize = getElementSize;
});
|