@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
36 lines (35 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWindowPopupSize = exports.getSettingsPanelSize = exports.getActionPanelSize = exports.getMiddlePosition = void 0;
const Helper_1 = require("../../../Utilities/Helpers/Helper");
const getMiddlePosition = (size) => {
const height = window.innerHeight;
const width = window.innerWidth;
return {
x: width / 2 - size.width / 2,
y: height / 2 - size.height / 2,
};
};
exports.getMiddlePosition = getMiddlePosition;
const getActionPanelSize = () => {
const height = window.innerHeight;
const width = window.innerWidth;
return {
height: (0, Helper_1.clamp)(600, 0, height * 0.9),
width: (0, Helper_1.clamp)(800, 0, width * 0.9),
};
};
exports.getActionPanelSize = getActionPanelSize;
const getSettingsPanelSize = () => {
const height = window.innerHeight;
const width = window.innerWidth;
return {
height: (0, Helper_1.clamp)(height * 0.9, 0, 800),
width: (0, Helper_1.clamp)(width * 0.9, 0, 800),
};
};
exports.getSettingsPanelSize = getSettingsPanelSize;
const getWindowPopupSize = () => {
return (0, exports.getSettingsPanelSize)();
};
exports.getWindowPopupSize = getWindowPopupSize;