@highcharts/dashboards
Version:
Highcharts Dashboards framework
95 lines (94 loc) • 2.37 kB
JavaScript
/* *
*
* (c) 2009-2026 Highsoft AS
*
* Integration of this software requires a license.
* - For commercial use, see www.highcharts.com/license
* - For non-commercial, see www.highcharts.com/license-eula
*
*
* Authors:
* - Sebastian Bochan
* - Wojciech Chmiel
* - Gøran Slettemark
* - Sophie Bremer
* - Paweł Lysy
* - Karol Kołodziej
*
* */
;
/* *
*
* Constants
*
* */
/**
* Prefix of a GUIElement HTML class name.
*/
export const classNamePrefix = 'highcharts-dashboards-';
export const version = '4.2.1';
/** @internal */
export const classNames = {
layout: classNamePrefix + 'layout',
cell: classNamePrefix + 'cell',
cellHover: classNamePrefix + 'cell-state-hover',
cellActive: classNamePrefix + 'cell-state-active',
cellLoading: classNamePrefix + 'cell-state-loading',
row: classNamePrefix + 'row',
layoutsWrapper: classNamePrefix + 'layouts-wrapper',
boardContainer: classNamePrefix + 'wrapper'
};
/** @internal */
export const guiElementType = {
row: 'row',
cell: 'cell',
layout: 'layout'
};
/**
* Contains all Board instances of this window.
*/
export const boards = [];
/**
* Reference to the window used by Dashboards.
*/
export const win = window;
export const doc = document;
export const noop = function () { };
export const isMS = /(edge|msie|trident)/i
.test((win.navigator && win.navigator.userAgent) || '') && !win.opera;
export const supportsPassiveEvents = (function () {
// Checks whether the browser supports passive events, (#11353).
let supportsPassive = false;
// Object.defineProperty doesn't work on IE as well as passive
// events - instead of using polyfill, we can exclude IE totally.
if (!isMS) {
const opts = Object.defineProperty({}, 'passive', {
get: function () {
supportsPassive = true;
}
});
if (win.addEventListener && win.removeEventListener) {
win.addEventListener('testPassive', noop, opts);
win.removeEventListener('testPassive', noop, opts);
}
}
return supportsPassive;
}());
const Globals = {
boards,
classNamePrefix,
classNames,
doc,
guiElementType,
isMS,
noop,
supportsPassiveEvents,
version,
win
};
/* *
*
* Default Export
*
* */
export default Globals;