@highcharts/dashboards
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -10,2 +10,12 @@ /*!* | ||
import "./es-modules/Dashboards/Components/HTMLComponent"; | ||
import "./es-modules/Dashboards/Components/KPIComponent"; | ||
import "./es-modules/Data/Connectors/CSVConnector"; | ||
import "./es-modules/Data/Connectors/GoogleSheetsConnector"; | ||
import "./es-modules/Data/Connectors/HTMLTableConnector"; | ||
import "./es-modules/Data/Modifiers/ChainModifier"; | ||
import "./es-modules/Data/Modifiers/InvertModifier"; | ||
import "./es-modules/Data/Modifiers/RangeModifier"; | ||
import "./es-modules/Data/Modifiers/SortModifier"; | ||
export * as Board from "./es-modules/Dashboards/Board"; | ||
@@ -12,0 +22,0 @@ export * as Component from "./es-modules/Dashboards/Components/Component"; |
@@ -10,2 +10,12 @@ /*!* | ||
import "./es-modules/Dashboards/Components/HTMLComponent"; | ||
import "./es-modules/Dashboards/Components/KPIComponent"; | ||
import "./es-modules/Data/Connectors/CSVConnector"; | ||
import "./es-modules/Data/Connectors/GoogleSheetsConnector"; | ||
import "./es-modules/Data/Connectors/HTMLTableConnector"; | ||
import "./es-modules/Data/Modifiers/ChainModifier"; | ||
import "./es-modules/Data/Modifiers/InvertModifier"; | ||
import "./es-modules/Data/Modifiers/RangeModifier"; | ||
import "./es-modules/Data/Modifiers/SortModifier"; | ||
export * as Board from "./es-modules/Dashboards/Board"; | ||
@@ -12,0 +22,0 @@ export * as Component from "./es-modules/Dashboards/Components/Component"; |
/* | ||
Highcharts Dashboards v1.0.1 (2023-07-19) | ||
Highcharts Dashboards v1.0.2 (2023-08-10) | ||
@@ -42,17 +42,17 @@ (c) 2009-2023 Highsoft AS | ||
a*this.options.cellHeight}getColumnsToDisplay(){const a=this.options.columns,c=this.dataTable.modified.getColumnNames(),b=[];for(let e=0;e<c.length;e++){const d=c[e],f=a[d];f&&B(f.show)?a[d].show&&b.push(d):b.push(d)}return b}isColumnEditable(a){return E((this.options.columns[a]||{}).editable,this.options.editable)}initDataTable(){return this.options.dataTable?this.options.dataTable:new a}render(){const {options:a}=this;this.prevTop=-1;this.bottom=!1;n(this.innerContainer);a.columnHeaders.enabled? | ||
(this.columnNames=this.getColumnsToDisplay(),this.outerContainer.style.top=this.options.cellHeight+"px",this.renderColumnHeaders()):this.outerContainer.style.top="0";this.updateInnerContainerWidth();this.renderInitialRows();this.addEvents();this.updateScrollingLength();this.updateVisibleCells();a.columnHeaders.enabled&&a.resizableColumns&&this.renderColumnDragHandles()}addEvents(){this.outerContainer.addEventListener("scroll",a=>{this.onScroll(a)});document.addEventListener("click",a=>{this.onDocumentClick(a)}); | ||
this.container.addEventListener("mouseover",a=>{this.handleMouseOver(a)})}updateVisibleCells(){var a=this.outerContainer.scrollTop;v.isSafari&&(a=q(a,0,this.outerContainer.scrollHeight-this.outerContainer.clientHeight));a=Math.floor(a/this.options.cellHeight);if(a!==this.prevTop){this.prevTop=a;var c=this.columnNames,b=this.dataTable.modified.getRowCount();for(let e=0;e<this.rowElements.length&&a<b;e++,a++){const b=this.rowElements[e];b.dataset.rowIndex=String(a);const d=b.childNodes;for(let e=0, | ||
f=c.length;e<f;e++){const f=d[e],h=c[e],r=this.dataTable.modified.getCell(c[e],a);f.textContent=this.formatCell(r,h);f.dataset.originalData=""+r;f.dataset.columnName=c[e];f.dataset.dataType=typeof r;0===e&&(b.dataset.rowXIndex=String(k(r)?r:a))}}this.prevTop+this.scrollEndRowCount===b?!this.bottom&&this.scrollEndTop&&(this.bottom=!0,this.innerContainer.scrollTop=this.scrollEndTop):this.bottom&&(this.bottom=!1,this.innerContainer.scrollTop=0)}}onScroll(a){a.preventDefault();window.requestAnimationFrame(this.updateVisibleCells.bind(this))}onCellClick(a, | ||
c){if(this.isColumnEditable(c)){c=a.querySelector("input");const e=a.getAttribute("data-original-data");if(!c){this.removeCellInputElement();const d=a.clientHeight;a.textContent="";c=this.cellInputEl=document.createElement("input");c.style.height=d+"px";c.className=b.classNames.cellInput;a.appendChild(c);c.focus();c.value=e||""}this.emit({type:"cellClick",input:c})}}onDocumentClick(a){if(this.cellInputEl&&a.target){const c=this.cellInputEl.parentNode;c&&c.contains(a.target)||this.removeCellInputElement()}}handleMouseOver(a){(a= | ||
a.target)&&a.classList.contains(b.classNames.cell)?(a=a.parentElement,this.toggleRowHighlight(a),this.hoveredRow=a,p(this.container,"dataGridHover",{row:a})):this.hoveredRow&&(this.toggleRowHighlight(),this.hoveredRow=void 0)}removeCellInputElement(){const a=this.cellInputEl;if(a){const c=a.parentNode;if(c){const b=c.getAttribute("data-data-type"),e=c.getAttribute("data-column-name");let d=a.value;"number"===b&&(d=parseFloat(d));c.textContent=this.formatCell(d,e||"")}a.remove();delete this.cellInputEl}}updateInnerContainerWidth(){this.innerContainer.style.width= | ||
this.outerContainer.offsetWidth+"px"}updateScrollingLength(){var a=this.columnNames,c=this.dataTable.modified.getRowCount()-1,b=0;const d=c-this.getNumRowsToDraw(),h=this.outerContainer.clientHeight;this.innerContainer.style.height=h+"px";for(let b=0;b<this.rowElements.length;b++){const e=this.rowElements[b].childNodes;for(let d=0;d<a.length;d++)e[d].textContent=A(this.dataTable.modified.getCell(a[d],c-b))}this.scrollContainer.appendChild(this.innerContainer);for(a=0;c>d;c--,a++)if(b+=this.rowElements[a].offsetHeight, | ||
b>h){c--;break}c-=d;this.scrollEndRowCount=this.rowElements.length-c;this.scrollEndTop=b-h;b=(this.dataTable.modified.getRowCount()+c)*this.options.cellHeight;this.scrollContainer.style.height=b+"px"}getNumRowsToDraw(){return Math.min(this.dataTable.modified.getRowCount(),Math.ceil(this.outerContainer.offsetHeight/this.options.cellHeight))}getDataGridSize(){const a=this.options,{height:c}=this.container.getBoundingClientRect();return 2<c?c:a.defaultHeight}renderCell(a,c){let e=b.classNames.cell;this.isColumnEditable(c)|| | ||
(e+=` ${e}-readonly`);const f=d(e);f.style.minHeight=this.options.cellHeight+"px";f.addEventListener("click",()=>this.onCellClick(f,c));a.appendChild(f)}renderRow(){const a=d(b.classNames.row);for(let c=0;c<this.columnNames.length;c++)this.renderCell(a,this.columnNames[c]);this.innerContainer.appendChild(a);this.rowElements.push(a)}formatHeaderCell(a){var c=this.options.columns[a];return(c=c&&c.headerFormat)?t.format(c,{text:a}):a}formatCell(a,c){c=(c=this.options.columns[c])&&c.cellFormat;let b= | ||
B(a)?a:"";c&&("number"===typeof a&&-1<c.indexOf("value")?b=t.format(c,{value:a}):"string"===typeof a&&-1<c.indexOf("text")&&(b=t.format(c,{text:a})));return b.toString()}renderColumnHeader(a,c){var e=b.classNames.columnHeader;this.isColumnEditable(c)||(e+=` ${e}-readonly`);e=d(e);e.style.height=this.options.cellHeight+"px";e.textContent=this.formatHeaderCell(c);a.appendChild(e)}renderColumnHeaders(){const a=this.columnNames,c=this.columnHeadersContainer=this.columnHeadersContainer||d(`${b.classNamePrefix}column-headers`); | ||
n(c);a.forEach(this.renderColumnHeader.bind(this,c));this.headerContainer||(this.headerContainer=d(`${b.classNamePrefix}header-container`),this.headerContainer.appendChild(c));this.gridContainer.insertBefore(this.headerContainer,this.outerContainer)}renderInitialRows(){this.rowElements=[];const a=this.getNumRowsToDraw();for(let c=0;c<a;c++)this.renderRow()}renderColumnDragHandles(){if(this.columnHeadersContainer){var a=this.columnDragHandlesContainer=this.columnDragHandlesContainer||d(`${b.classNamePrefix}col-resize-container`), | ||
c=this.columnHeadersContainer.children,g=this.options.cellHeight;n(a);for(let e=1;e<c.length;++e){const h=c[e],f=d(`${b.classNamePrefix}col-resize-handle`);f.style.height=g+"px";f.style.left=h.offsetLeft-2+"px";f.addEventListener("mouseover",()=>{this.draggedResizeHandle||(f.style.opacity="1")});f.addEventListener("mouseleave",()=>{this.draggedResizeHandle||(f.style.opacity="0")});f.addEventListener("mousedown",this.onHandleMouseDown.bind(this,f,e));a.appendChild(f)}this.renderColumnResizeCrosshair(a); | ||
document.addEventListener("mouseup",a=>{this.draggedResizeHandle&&this.stopColumnResize(this.draggedResizeHandle,a)});document.addEventListener("mousemove",a=>{this.draggedResizeHandle&&this.updateColumnResizeDrag(a)});this.headerContainer&&this.headerContainer.appendChild(a)}}renderColumnResizeCrosshair(a){const c=this.columnResizeCrosshair=this.columnResizeCrosshair||d(`${b.classNamePrefix}col-resize-crosshair`);c.style.top=this.options.cellHeight+"px";c.style.height=this.innerContainer.offsetHeight+ | ||
"px";a.appendChild(c)}onHandleMouseDown(a,c,b){!this.draggedResizeHandle&&(b.preventDefault(),this.draggedResizeHandle=a,this.draggedColumnRightIx=c,this.dragResizeStart=b.pageX,c=this.columnResizeCrosshair)&&(c.style.left=a.offsetLeft+a.offsetWidth/2-c.offsetWidth/2+"px",c.style.opacity="1")}updateColumnResizeDrag(a){const b=this.draggedResizeHandle,d=this.columnResizeCrosshair,e=this.draggedColumnRightIx,h=this.columnHeadersContainer;b&&d&&null!==e&&h&&this.dragResizeStart&&(a=h.children[e].offsetLeft+ | ||
(a.pageX-this.dragResizeStart),b.style.left=a-b.offsetWidth/2+"px",d.style.left=a-d.offsetWidth/2+"px")}stopColumnResize(a,b){var c=this.columnResizeCrosshair;const d=this.draggedColumnRightIx;var e=this.columnHeadersContainer;c&&e&&this.dragResizeStart&&null!==d&&(a.style.opacity="0",c.style.opacity="0",a=e.children[d-1],e=e.children[d],c=b.pageX-this.dragResizeStart,b=(a.offsetWidth+c)/a.offsetWidth,c=(e.offsetWidth-c)/e.offsetWidth,a=(a.style.flex?parseFloat(a.style.flex):1)*b,e=(e.style.flex? | ||
parseFloat(e.style.flex):1)*c,this.resizeColumn(a,d-1),this.resizeColumn(e,d),this.draggedColumnRightIx=this.draggedResizeHandle=null)}setSize(a,b){a&&(this.innerContainer.style.width=a+"px");b&&(this.gridContainer.style.height=this.getDataGridSize()+"px",this.outerContainer.style.height=b-(this.options.cellHeight+this.getMarginHeight(b))+"px");this.render()}getMarginHeight(a){return a-this.gridContainer.getBoundingClientRect().height}}F.defaultOptions=z;return F});t(a,"masters/datagrid.src.js",[a["DataGrid/Globals.js"], | ||
a["DataGrid/DataGrid.js"]],function(a,l){a.DataGrid=l;a.win.DataGrid||(a.win.DataGrid=a);return a})});//# sourceMappingURL=datagrid.js.map | ||
(this.columnNames=this.getColumnsToDisplay(),this.outerContainer.style.top=this.options.cellHeight+"px",this.renderColumnHeaders()):this.outerContainer.style.top="0";this.renderInitialRows();this.addEvents();this.updateScrollingLength();this.updateVisibleCells();a.columnHeaders.enabled&&a.resizableColumns&&this.renderColumnDragHandles()}addEvents(){this.outerContainer.addEventListener("scroll",a=>{this.onScroll(a)});document.addEventListener("click",a=>{this.onDocumentClick(a)});this.container.addEventListener("mouseover", | ||
a=>{this.handleMouseOver(a)})}updateVisibleCells(){var a=this.outerContainer.scrollTop;v.isSafari&&(a=q(a,0,this.outerContainer.scrollHeight-this.outerContainer.clientHeight));a=Math.floor(a/this.options.cellHeight);if(a!==this.prevTop){this.prevTop=a;var c=this.columnNames,b=this.dataTable.modified.getRowCount();for(let e=0;e<this.rowElements.length&&a<b;e++,a++){const b=this.rowElements[e];b.dataset.rowIndex=String(a);const d=b.childNodes;for(let e=0,f=c.length;e<f;e++){const f=d[e],h=c[e],r=this.dataTable.modified.getCell(c[e], | ||
a);f.textContent=this.formatCell(r,h);f.dataset.originalData=""+r;f.dataset.columnName=c[e];f.dataset.dataType=typeof r;0===e&&(b.dataset.rowXIndex=String(k(r)?r:a))}}this.prevTop+this.scrollEndRowCount===b?!this.bottom&&this.scrollEndTop&&(this.bottom=!0,this.innerContainer.scrollTop=this.scrollEndTop):this.bottom&&(this.bottom=!1,this.innerContainer.scrollTop=0)}}onScroll(a){a.preventDefault();window.requestAnimationFrame(this.updateVisibleCells.bind(this))}onCellClick(a,c){if(this.isColumnEditable(c)){c= | ||
a.querySelector("input");const e=a.getAttribute("data-original-data");if(!c){this.removeCellInputElement();const d=a.clientHeight;a.textContent="";c=this.cellInputEl=document.createElement("input");c.style.height=d+"px";c.className=b.classNames.cellInput;a.appendChild(c);c.focus();c.value=e||""}this.emit({type:"cellClick",input:c})}}onDocumentClick(a){if(this.cellInputEl&&a.target){const c=this.cellInputEl.parentNode;c&&c.contains(a.target)||this.removeCellInputElement()}}handleMouseOver(a){(a=a.target)&& | ||
a.classList.contains(b.classNames.cell)?(a=a.parentElement,this.toggleRowHighlight(a),this.hoveredRow=a,p(this.container,"dataGridHover",{row:a})):this.hoveredRow&&(this.toggleRowHighlight(),this.hoveredRow=void 0)}removeCellInputElement(){const a=this.cellInputEl;if(a){const c=a.parentNode;if(c){const b=c.getAttribute("data-data-type"),e=c.getAttribute("data-column-name");let d=a.value;"number"===b&&(d=parseFloat(d));c.textContent=this.formatCell(d,e||"")}a.remove();delete this.cellInputEl}}updateScrollingLength(){var a= | ||
this.columnNames,c=this.dataTable.modified.getRowCount()-1,b=0;const d=c-this.getNumRowsToDraw(),h=this.outerContainer.clientHeight;this.innerContainer.style.height=h+"px";for(let b=0;b<this.rowElements.length;b++){const e=this.rowElements[b].childNodes;for(let d=0;d<a.length;d++)e[d].textContent=A(this.dataTable.modified.getCell(a[d],c-b))}this.scrollContainer.appendChild(this.innerContainer);for(a=0;c>d;c--,a++)if(b+=this.rowElements[a].offsetHeight,b>h){c--;break}c-=d;this.scrollEndRowCount=this.rowElements.length- | ||
c;this.scrollEndTop=b-h;b=(this.dataTable.modified.getRowCount()+c)*this.options.cellHeight;this.scrollContainer.style.height=b+"px"}getNumRowsToDraw(){return Math.min(this.dataTable.modified.getRowCount(),Math.ceil(this.outerContainer.offsetHeight/this.options.cellHeight))}getDataGridSize(){const a=this.options,{height:c}=this.container.getBoundingClientRect();return 2<c?c:a.defaultHeight}renderCell(a,c){let e=b.classNames.cell;this.isColumnEditable(c)||(e+=` ${e}-readonly`);const f=d(e);f.style.minHeight= | ||
this.options.cellHeight+"px";f.addEventListener("click",()=>this.onCellClick(f,c));a.appendChild(f)}renderRow(){const a=d(b.classNames.row);for(let c=0;c<this.columnNames.length;c++)this.renderCell(a,this.columnNames[c]);this.innerContainer.appendChild(a);this.rowElements.push(a)}formatHeaderCell(a){var c=this.options.columns[a];return(c=c&&c.headerFormat)?t.format(c,{text:a}):a}formatCell(a,c){c=(c=this.options.columns[c])&&c.cellFormat;let b=B(a)?a:"";c&&("number"===typeof a&&-1<c.indexOf("value")? | ||
b=t.format(c,{value:a}):"string"===typeof a&&-1<c.indexOf("text")&&(b=t.format(c,{text:a})));return b.toString()}renderColumnHeader(a,c){var e=b.classNames.columnHeader;this.isColumnEditable(c)||(e+=` ${e}-readonly`);e=d(e);e.style.height=this.options.cellHeight+"px";e.textContent=this.formatHeaderCell(c);a.appendChild(e)}renderColumnHeaders(){const a=this.columnNames,c=this.columnHeadersContainer=this.columnHeadersContainer||d(`${b.classNamePrefix}column-headers`);n(c);a.forEach(this.renderColumnHeader.bind(this, | ||
c));this.headerContainer||(this.headerContainer=d(`${b.classNamePrefix}header-container`),this.headerContainer.appendChild(c));this.gridContainer.insertBefore(this.headerContainer,this.outerContainer)}renderInitialRows(){this.rowElements=[];const a=this.getNumRowsToDraw();for(let c=0;c<a;c++)this.renderRow()}renderColumnDragHandles(){if(this.columnHeadersContainer){var a=this.columnDragHandlesContainer=this.columnDragHandlesContainer||d(`${b.classNamePrefix}col-resize-container`),c=this.columnHeadersContainer.children, | ||
g=this.options.cellHeight;n(a);for(let e=1;e<c.length;++e){const h=c[e],f=d(`${b.classNamePrefix}col-resize-handle`);f.style.height=g+"px";f.style.left=h.offsetLeft-2+"px";f.addEventListener("mouseover",()=>{this.draggedResizeHandle||(f.style.opacity="1")});f.addEventListener("mouseleave",()=>{this.draggedResizeHandle||(f.style.opacity="0")});f.addEventListener("mousedown",this.onHandleMouseDown.bind(this,f,e));a.appendChild(f)}this.renderColumnResizeCrosshair(a);document.addEventListener("mouseup", | ||
a=>{this.draggedResizeHandle&&this.stopColumnResize(this.draggedResizeHandle,a)});document.addEventListener("mousemove",a=>{this.draggedResizeHandle&&this.updateColumnResizeDrag(a)});this.headerContainer&&this.headerContainer.appendChild(a)}}renderColumnResizeCrosshair(a){const c=this.columnResizeCrosshair=this.columnResizeCrosshair||d(`${b.classNamePrefix}col-resize-crosshair`);c.style.top=this.options.cellHeight+"px";c.style.height=this.innerContainer.offsetHeight+"px";a.appendChild(c)}onHandleMouseDown(a, | ||
c,b){!this.draggedResizeHandle&&(b.preventDefault(),this.draggedResizeHandle=a,this.draggedColumnRightIx=c,this.dragResizeStart=b.pageX,c=this.columnResizeCrosshair)&&(c.style.left=a.offsetLeft+a.offsetWidth/2-c.offsetWidth/2+"px",c.style.opacity="1")}updateColumnResizeDrag(a){const b=this.draggedResizeHandle,d=this.columnResizeCrosshair,e=this.draggedColumnRightIx,h=this.columnHeadersContainer;b&&d&&null!==e&&h&&this.dragResizeStart&&(a=h.children[e].offsetLeft+(a.pageX-this.dragResizeStart),b.style.left= | ||
a-b.offsetWidth/2+"px",d.style.left=a-d.offsetWidth/2+"px")}stopColumnResize(a,b){var c=this.columnResizeCrosshair;const d=this.draggedColumnRightIx;var e=this.columnHeadersContainer;c&&e&&this.dragResizeStart&&null!==d&&(a.style.opacity="0",c.style.opacity="0",a=e.children[d-1],e=e.children[d],c=b.pageX-this.dragResizeStart,b=(a.offsetWidth+c)/a.offsetWidth,c=(e.offsetWidth-c)/e.offsetWidth,a=(a.style.flex?parseFloat(a.style.flex):1)*b,e=(e.style.flex?parseFloat(e.style.flex):1)*c,this.resizeColumn(a, | ||
d-1),this.resizeColumn(e,d),this.draggedColumnRightIx=this.draggedResizeHandle=null)}setSize(a,b){a&&(this.innerContainer.style.width=a+"px");b&&(this.gridContainer.style.height=this.getDataGridSize()+"px",this.outerContainer.style.height=b-(this.options.cellHeight+this.getMarginHeight(b))+"px");this.render()}getMarginHeight(a){return a-this.gridContainer.getBoundingClientRect().height}}F.defaultOptions=z;return F});t(a,"masters/datagrid.src.js",[a["DataGrid/Globals.js"],a["DataGrid/DataGrid.js"]], | ||
function(a,l){a.DataGrid=l;a.win.DataGrid||(a.win.DataGrid=a);return a})});//# sourceMappingURL=datagrid.js.map |
@@ -27,3 +27,3 @@ /* * | ||
* */ | ||
Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '1.0.1', Globals.win = (typeof window !== 'undefined' ? | ||
Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '1.0.2', Globals.win = (typeof window !== 'undefined' ? | ||
window : | ||
@@ -30,0 +30,0 @@ {}), // eslint-disable-line node/no-unsupported-features/es-builtins |
@@ -379,3 +379,3 @@ import type Component from './Components/Component'; | ||
**/ | ||
enabled: boolean; | ||
enabled?: boolean; | ||
/** | ||
@@ -382,0 +382,0 @@ * General options for the layouts applied to all layouts. |
@@ -157,3 +157,3 @@ import type Board from '../Board'; | ||
*/ | ||
protected syncHandlers: Sync.OptionsRecord; | ||
protected syncHandlers?: Sync.OptionsRecord; | ||
/** | ||
@@ -207,8 +207,8 @@ * DataModifier that is applied on top of modifiers set on the DataStore. | ||
* @returns | ||
* Promise resolviing to the component. | ||
* Promise resolving to the component. | ||
*/ | ||
initConnector(): Promise<this>; | ||
/** | ||
* Handles the sync options. Applies the given defaults if no | ||
* specific callback given. | ||
* Filter the sync options that are declared in the component options. | ||
* Assigns the sync options to the component and to the sync instance. | ||
* | ||
@@ -218,8 +218,5 @@ * @param defaultHandlers | ||
* | ||
* @returns | ||
* Sync component. | ||
* | ||
* @internal | ||
*/ | ||
protected handleSyncOptions(defaultHandlers?: typeof Sync.defaultHandlers): Component['syncHandlers']; | ||
protected filterAndAssignSyncOptions(defaultHandlers?: typeof Sync.defaultHandlers): void; | ||
/** | ||
@@ -464,3 +461,3 @@ * Setup listeners on cell/other things up the chain | ||
/** | ||
* Events attached to the component : `mount`, `unmount`. | ||
* Events attached to the component : `mount`, `unmount`, `resize`, `update`. | ||
* | ||
@@ -546,2 +543,5 @@ * Try it: | ||
type ConnectorTypes = DataConnector; | ||
/** | ||
* Allowed types for the text. | ||
*/ | ||
type TextOptionsType = string | false | TextOptions | undefined; | ||
@@ -548,0 +548,0 @@ /** @internal */ |
@@ -165,3 +165,3 @@ /* * | ||
}; | ||
this.syncHandlers = this.handleSyncOptions(); | ||
this.filterAndAssignSyncOptions(); | ||
this.element = createElement('div', { | ||
@@ -180,3 +180,3 @@ className: this.options.className | ||
* @returns | ||
* Promise resolviing to the component. | ||
* Promise resolving to the component. | ||
*/ | ||
@@ -203,4 +203,4 @@ initConnector() { | ||
/** | ||
* Handles the sync options. Applies the given defaults if no | ||
* specific callback given. | ||
* Filter the sync options that are declared in the component options. | ||
* Assigns the sync options to the component and to the sync instance. | ||
* | ||
@@ -210,10 +210,7 @@ * @param defaultHandlers | ||
* | ||
* @returns | ||
* Sync component. | ||
* | ||
* @internal | ||
*/ | ||
handleSyncOptions(defaultHandlers = Sync.defaultHandlers) { | ||
filterAndAssignSyncOptions(defaultHandlers = Sync.defaultHandlers) { | ||
const sync = this.options.sync || {}; | ||
return Object.keys(sync) | ||
const syncHandlers = Object.keys(sync) | ||
.reduce((carry, handlerName) => { | ||
@@ -231,2 +228,4 @@ if (handlerName) { | ||
}, {}); | ||
this.sync ? this.sync.syncConfig = syncHandlers : void 0; | ||
this.syncHandlers = syncHandlers; | ||
} | ||
@@ -564,3 +563,3 @@ /** | ||
load() { | ||
// Set up the connector on inital load if it has not been done | ||
// Set up the connector on initial load if it has not been done | ||
if (!this.hasLoaded && this.connector) { | ||
@@ -567,0 +566,0 @@ this.setConnector(this.connector); |
@@ -5,2 +5,3 @@ import type Cell from '../Layout/Cell'; | ||
import type TextOptions from './TextOptions'; | ||
import type Types from '../../Shared/Types'; | ||
import Component from './Component.js'; | ||
@@ -42,3 +43,3 @@ /** | ||
*/ | ||
static defaultChartOptions: DeepPartial<Options>; | ||
static defaultChartOptions: Types.DeepPartial<Options>; | ||
/** | ||
@@ -45,0 +46,0 @@ * KPI component's options. |
@@ -47,3 +47,3 @@ import type ComponentType from '../ComponentType'; | ||
/** | ||
* Add new emmiter to the registered emitters. | ||
* Add new emitter to the registered emitters. | ||
* @param emitter | ||
@@ -50,0 +50,0 @@ The emitter to register. |
@@ -54,3 +54,3 @@ /* * | ||
/** | ||
* Add new emmiter to the registered emitters. | ||
* Add new emitter to the registered emitters. | ||
* @param emitter | ||
@@ -57,0 +57,0 @@ The emitter to register. |
@@ -18,8 +18,21 @@ /* * | ||
import type CSSObject from '../../Core/Renderer/CSSObject'; | ||
/** | ||
* Options for configuring a more custom text. | ||
*/ | ||
declare interface TextOptions { | ||
/** | ||
* The class name which is added to the text element. | ||
*/ | ||
className?: string; | ||
/** | ||
* A collection of CSS properties for the text. | ||
*/ | ||
style?: CSSObject; | ||
/** | ||
* The text content itself. | ||
*/ | ||
text?: string; | ||
className?: string; | ||
} | ||
export default TextOptions; |
@@ -304,2 +304,6 @@ import type Cell from '../Layout/Cell'; | ||
* Toolbar options. | ||
* | ||
* Try it: | ||
* | ||
* {@link https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/dashboards/edit-mode/toolbars-disabled} | ||
*/ | ||
@@ -306,0 +310,0 @@ toolbars?: Toolbars; |
@@ -63,3 +63,3 @@ /* * | ||
*/ | ||
this.iconsURLPrefix = 'https://code.highcharts.com/dashboards/1.0.1/gfx/dashboards-icons/'; | ||
this.iconsURLPrefix = 'https://code.highcharts.com/dashboards/1.0.2/gfx/dashboards-icons/'; | ||
this.iconsURLPrefix = | ||
@@ -94,2 +94,10 @@ (options && options.iconsURLPrefix) || this.iconsURLPrefix; | ||
} | ||
}, | ||
toolbars: { | ||
cell: { | ||
enabled: true | ||
}, | ||
row: { | ||
enabled: true | ||
} | ||
} | ||
@@ -157,3 +165,3 @@ }, options || {}); | ||
init() { | ||
var _a; | ||
var _a, _b, _c, _d, _e; | ||
const editMode = this; | ||
@@ -165,7 +173,7 @@ if ((_a = this.options.resize) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
// Init rowToolbar. | ||
if (!editMode.rowToolbar) { | ||
if (((_c = (_b = editMode.options.toolbars) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c.enabled) && !editMode.rowToolbar) { | ||
editMode.rowToolbar = new RowEditToolbar(editMode); | ||
} | ||
// Init cellToolbar. | ||
if (!editMode.cellToolbar) { | ||
if (((_e = (_d = editMode.options.toolbars) === null || _d === void 0 ? void 0 : _d.cell) === null || _e === void 0 ? void 0 : _e.enabled) && !editMode.cellToolbar) { | ||
editMode.cellToolbar = new CellEditToolbar(editMode); | ||
@@ -172,0 +180,0 @@ } |
import type Cell from '../Layout/Cell'; | ||
import type DataGrid from '../../DataGrid/DataGrid'; | ||
import type DataGridOptions from '../../DataGrid/DataGridOptions'; | ||
import type BaseDataGridOptions from '../../DataGrid/DataGridOptions'; | ||
@@ -38,6 +37,6 @@ import Component from '../Components/Component.js'; | ||
* | ||
* @param store | ||
* @param connector | ||
* Relate store of the change. | ||
*/ | ||
static onUpdate(e: KeyboardEvent, store: Component.ConnectorTypes): void; | ||
static onUpdate(e: KeyboardEvent, connector: Component.ConnectorTypes): void; | ||
/** @private */ | ||
@@ -48,3 +47,3 @@ static fromJSON(json: DataGridComponent.ClassJSON, cell: Cell): DataGridComponent; | ||
/** @private */ | ||
dataGridOptions: Partial<DataGridOptions>; | ||
dataGridOptions: Partial<BaseDataGridOptions>; | ||
/** @private */ | ||
@@ -58,2 +57,10 @@ options: DataGridComponent.ComponentOptions; | ||
/** | ||
* Disable editing of the columns that are modified by the data modifier. | ||
* @internal | ||
* | ||
* @param connector | ||
* Attached connector | ||
*/ | ||
private disableEditingModifiedColumns; | ||
/** | ||
* Triggered on component initialization. | ||
@@ -118,3 +125,3 @@ * @private | ||
/** | ||
* Generic options to adjust behavor and styling of the rendered data | ||
* Generic options to adjust behavior and styling of the rendered data | ||
* grid. | ||
@@ -121,0 +128,0 @@ */ |
@@ -53,6 +53,6 @@ /* * | ||
* | ||
* @param store | ||
* @param connector | ||
* Relate store of the change. | ||
*/ | ||
static onUpdate(e, store) { | ||
static onUpdate(e, connector) { | ||
const inputElement = e.target; | ||
@@ -73,3 +73,3 @@ if (inputElement) { | ||
columnName !== void 0) { | ||
const table = store.table.modified; | ||
const table = connector.table; | ||
if (table) { | ||
@@ -118,9 +118,16 @@ let valueToSet = converter | ||
} | ||
this.syncHandlers = this.handleSyncOptions(DataGridSyncHandlers); | ||
this.filterAndAssignSyncOptions(DataGridSyncHandlers); | ||
this.sync = new DataGridComponent.Sync(this, this.syncHandlers); | ||
this.dataGridOptions = this.options.dataGridOptions || {}; | ||
this.dataGridOptions = (this.options.dataGridOptions || | ||
{}); | ||
this.innerResizeTimeouts = []; | ||
this.on('afterSetConnector', (e) => { | ||
this.disableEditingModifiedColumns(e.connector); | ||
}); | ||
this.on('tableChanged', () => { | ||
var _a; | ||
(_a = this.dataGrid) === null || _a === void 0 ? void 0 : _a.update({ dataTable: this.filterColumns() }); | ||
// When the table is in the middle of editing a cell, don't update. | ||
if (!(this.dataGrid && this.dataGrid.cellInputEl)) { | ||
(_a = this.dataGrid) === null || _a === void 0 ? void 0 : _a.update({ dataTable: this.filterColumns() }); | ||
} | ||
}); | ||
@@ -130,2 +137,28 @@ // Add the component instance to the registry | ||
} | ||
/** | ||
* Disable editing of the columns that are modified by the data modifier. | ||
* @internal | ||
* | ||
* @param connector | ||
* Attached connector | ||
*/ | ||
disableEditingModifiedColumns(connector) { | ||
var _a; | ||
const modifierOptions = connector.options.dataModifier; | ||
if (!modifierOptions || modifierOptions.type !== 'Math') { | ||
return; | ||
} | ||
const modifierColumns = modifierOptions.columnFormulas; | ||
if (!modifierColumns) { | ||
return; | ||
} | ||
const options = {}; | ||
for (let i = 0, iEnd = modifierColumns.length; i < iEnd; ++i) { | ||
const columnName = modifierColumns[i].column; | ||
options[columnName] = { | ||
editable: false | ||
}; | ||
} | ||
(_a = this.dataGrid) === null || _a === void 0 ? void 0 : _a.update({ columns: options }); | ||
} | ||
/* * | ||
@@ -155,3 +188,3 @@ * | ||
})); | ||
// Update the DataGrid when store changed. | ||
// Update the DataGrid when connector changed. | ||
connectorListeners.push(this.connector.table | ||
@@ -162,3 +195,7 @@ .on('afterSetCell', (e) => { | ||
if (dataGrid) { | ||
const row = dataGrid.rowElements[e.rowIndex], cells = Array.prototype.slice.call(row.childNodes); | ||
const row = dataGrid.rowElements[e.rowIndex]; | ||
let cells = []; | ||
if (row) { | ||
cells = Array.prototype.slice.call(row.childNodes); | ||
} | ||
cells.forEach((cell) => { | ||
@@ -226,2 +263,3 @@ if (cell.childElementCount > 0) { | ||
if (this.dataGrid) { | ||
this.filterAndAssignSyncOptions(DataGridSyncHandlers); | ||
this.dataGrid.update(this.options.dataGridOptions || {}); | ||
@@ -228,0 +266,0 @@ } |
@@ -157,2 +157,45 @@ /* * | ||
} | ||
}, | ||
visibilityHandler: function () { | ||
const component = this, { board } = component; | ||
const handleVisibilityChange = (e) => { | ||
const cursor = e.cursor, dataGrid = component.dataGrid; | ||
if (!(dataGrid && cursor.type === 'position' && cursor.column)) { | ||
return; | ||
} | ||
const columnName = cursor.column; | ||
dataGrid.update({ | ||
columns: { | ||
[columnName]: { | ||
show: cursor.state !== 'series.hide' | ||
} | ||
} | ||
}); | ||
}; | ||
const registerCursorListeners = () => { | ||
const { dataCursor: cursor } = board; | ||
if (!cursor) { | ||
return; | ||
} | ||
const table = this.connector && this.connector.table; | ||
if (!table) { | ||
return; | ||
} | ||
cursor.addListener(table.id, 'series.show', handleVisibilityChange); | ||
cursor.addListener(table.id, 'series.hide', handleVisibilityChange); | ||
}; | ||
const unregisterCursorListeners = () => { | ||
const table = this.connector && this.connector.table; | ||
const { dataCursor: cursor } = board; | ||
if (!table) { | ||
return; | ||
} | ||
cursor.removeListener(table.id, 'series.show', handleVisibilityChange); | ||
cursor.removeListener(table.id, 'series.hide', handleVisibilityChange); | ||
}; | ||
if (board) { | ||
registerCursorListeners(); | ||
this.on('setConnector', () => unregisterCursorListeners()); | ||
this.on('afterSetConnector', () => registerCursorListeners()); | ||
} | ||
} | ||
@@ -163,4 +206,5 @@ } | ||
highlight: { emitter: configs.emitters.highlightEmitter, handler: configs.handlers.highlightHandler }, | ||
extremes: { handler: configs.handlers.extremesHandler } | ||
extremes: { handler: configs.handlers.extremesHandler }, | ||
visibility: { handler: configs.handlers.visibilityHandler } | ||
}; | ||
export default defaults; |
@@ -47,3 +47,3 @@ import type Cell from '../Layout/Cell'; | ||
}; | ||
columnAssignment: {}; | ||
columnAssignment: undefined; | ||
}; | ||
@@ -242,4 +242,7 @@ /** | ||
/** | ||
* Names / aliases that should be mapped to xAxis values. You can use | ||
* null to keep columns selectively out of the chart. | ||
* Names / aliases that should be mapped to xAxis values. You can | ||
* declare which columns will be visible selectively on the chart. | ||
* | ||
* When the columnAssignment is not declared, all columns are visible. | ||
* | ||
* ``` | ||
@@ -246,0 +249,0 @@ * Example |
@@ -32,3 +32,3 @@ /* * | ||
import U from '../../Core/Utilities.js'; | ||
const { addEvent, createElement, merge, splat, uniqueKey, error, diffObjects } = U; | ||
const { addEvent, createElement, merge, splat, uniqueKey, error, diffObjects, defined } = U; | ||
/* * | ||
@@ -185,3 +185,3 @@ * | ||
} | ||
this.syncHandlers = this.handleSyncOptions(HighchartsSyncHandlers); | ||
this.filterAndAssignSyncOptions(HighchartsSyncHandlers); | ||
} | ||
@@ -194,3 +194,3 @@ /** | ||
onChartUpdate(point, store) { | ||
const table = store.table, columnName = point.series.name, rowNumber = point.x, converter = new DataConverter(), valueToSet = converter.asNumber(point.y); | ||
const table = store.table, columnName = point.series.name, rowNumber = point.index, converter = new DataConverter(), valueToSet = converter.asNumber(point.y); | ||
table.setCell(columnName, rowNumber, valueToSet); | ||
@@ -224,3 +224,4 @@ } | ||
updateSeries() { | ||
// Heuristically create series from the store dataTable | ||
var _a; | ||
// Heuristically create series from the connector dataTable | ||
if (this.chart && this.connector) { | ||
@@ -239,3 +240,3 @@ this.presentationTable = this.presentationModifier ? | ||
} | ||
const table = this.presentationTable; | ||
const table = this.presentationTable, modifierOptions = (_a = table.getModifier()) === null || _a === void 0 ? void 0 : _a.options; | ||
this.emit({ type: 'afterPresentationModifier', table: table }); | ||
@@ -250,6 +251,6 @@ // Remove series names that match the xKeys | ||
true; | ||
if (!isVisible && !columnAssignment[name]) { | ||
return false; | ||
if (!defined(this.options.columnAssignment)) { | ||
return true; | ||
} | ||
if (columnAssignment[name] === null) { | ||
if (!isVisible || !columnAssignment[name]) { | ||
return false; | ||
@@ -265,2 +266,3 @@ } | ||
const seriesList = seriesNames.map((seriesName, index) => { | ||
var _a; | ||
let i = 0; | ||
@@ -281,5 +283,13 @@ while (i < chart.series.length) { | ||
} | ||
// Disable dragging on series, which were created out of a | ||
// columns which are created by MathModifier. | ||
const shouldBeDraggable = !((modifierOptions === null || modifierOptions === void 0 ? void 0 : modifierOptions.type) === 'Math' && | ||
((_a = modifierOptions | ||
.columnFormulas) === null || _a === void 0 ? void 0 : _a.some((formula) => formula.column === seriesName))); | ||
return chart.addSeries({ | ||
name: seriesName, | ||
id: `${storeTableID}-series-${index}` | ||
id: `${storeTableID}-series-${index}`, | ||
dragDrop: { | ||
draggableY: shouldBeDraggable | ||
} | ||
}, false); | ||
@@ -660,3 +670,3 @@ }); | ||
}), | ||
columnAssignment: {} | ||
columnAssignment: void 0 | ||
}); | ||
@@ -663,0 +673,0 @@ /* * |
@@ -97,3 +97,3 @@ /* * | ||
const table = connector && connector.table; | ||
if (table && // Has a store | ||
if (table && // Has a connector | ||
board && | ||
@@ -100,0 +100,0 @@ chart) { |
import type DataEvent from '../DataEvent'; | ||
import type CSVConnectorOptions from './CSVConnectorOptions'; | ||
import type Types from '../../Shared/Types'; | ||
import CSVConverter from '../Converters/CSVConverter.js'; | ||
@@ -76,3 +77,3 @@ import DataConnector from './DataConnector.js'; | ||
*/ | ||
type UserOptions = (DeepPartial<CSVConnectorOptions> & CSVConverter.UserOptions); | ||
type UserOptions = (Types.DeepPartial<CSVConnectorOptions> & CSVConverter.UserOptions); | ||
} | ||
@@ -79,0 +80,0 @@ declare module './DataConnectorType' { |
@@ -67,15 +67,28 @@ /* * | ||
load(eventDetail) { | ||
const connector = this, converter = connector.converter, table = connector.table, { csv, csvURL } = connector.options; | ||
if (csv) { | ||
// If already loaded, clear the current rows | ||
table.deleteRows(); | ||
const connector = this, converter = connector.converter, table = connector.table, { csv, csvURL, dataModifier } = connector.options; | ||
connector.emit({ | ||
type: 'load', | ||
csv, | ||
detail: eventDetail, | ||
table | ||
}); | ||
// If already loaded, clear the current rows | ||
table.deleteRows(); | ||
return Promise | ||
.resolve(csv ? | ||
csv : | ||
csvURL ? | ||
fetch(csvURL || '').then((response) => response.text()) : | ||
'') | ||
.then((csv) => { | ||
if (csv) { | ||
converter.parse({ csv }); | ||
table.setColumns(converter.getTable().getColumns()); | ||
} | ||
return connector | ||
.setModifierOptions(dataModifier) | ||
.then(() => csv); | ||
}) | ||
.then((csv) => { | ||
connector.emit({ | ||
type: 'load', | ||
csv, | ||
detail: eventDetail, | ||
table | ||
}); | ||
converter.parse({ csv }); | ||
table.setColumns(converter.getTable().getColumns()); | ||
connector.emit({ | ||
type: 'afterLoad', | ||
@@ -86,42 +99,12 @@ csv, | ||
}); | ||
} | ||
else if (csvURL) { | ||
// Clear the table | ||
connector.table.deleteColumns(); | ||
return connector; | ||
})['catch']((error) => { | ||
connector.emit({ | ||
type: 'load', | ||
detail: eventDetail, | ||
table: connector.table | ||
}); | ||
return fetch(csvURL || '') | ||
.then((response) => response.text().then((csv) => { | ||
connector.converter.parse({ csv }); | ||
// On inital fetch we need to set the columns | ||
connector.table.setColumns(connector.converter.getTable().getColumns()); | ||
connector.emit({ | ||
type: 'afterLoad', | ||
csv, | ||
detail: eventDetail, | ||
table: connector.table | ||
}); | ||
}))['catch']((error) => { | ||
connector.emit({ | ||
type: 'loadError', | ||
detail: eventDetail, | ||
error, | ||
table: connector.table | ||
}); | ||
return Promise.reject(error); | ||
}) | ||
.then(() => connector); | ||
} | ||
else { | ||
connector.emit({ | ||
type: 'loadError', | ||
detail: eventDetail, | ||
error: 'Unable to load: no CSV string or URL was provided', | ||
error, | ||
table | ||
}); | ||
} | ||
return Promise.resolve(connector); | ||
throw error; | ||
}); | ||
} | ||
@@ -128,0 +111,0 @@ } |
@@ -36,7 +36,7 @@ /* * | ||
*/ | ||
csv: string; | ||
csv?: string; | ||
/** | ||
* The URL to a remote CSV dataset | ||
*/ | ||
csvURL: string; | ||
csvURL?: string; | ||
/** | ||
@@ -46,7 +46,7 @@ * The rate in seconds for polling for live data. | ||
*/ | ||
dataRefreshRate: number; | ||
dataRefreshRate?: number; | ||
/** | ||
* Whether to enable polling for live data. | ||
*/ | ||
enablePolling: boolean; | ||
enablePolling?: boolean; | ||
/** | ||
@@ -56,3 +56,3 @@ * Whether to treat the first row of the data set as series names. | ||
*/ | ||
firstRowAsNames: boolean; | ||
firstRowAsNames?: boolean; | ||
} | ||
@@ -59,0 +59,0 @@ |
import type { DataConnectorTypes } from './DataConnectorType'; | ||
import type { DataConnectorOptions, MetaColumn, Metadata } from './DataConnectorOptions'; | ||
import type DataEvent from '../DataEvent'; | ||
import type { DataConnectorOptions, MetaColumn, Metadata } from './DataConnectorOptions'; | ||
import type { DataModifierTypeOptions } from '../Modifiers/DataModifierType'; | ||
import DataConverter from '../Converters/DataConverter.js'; | ||
@@ -122,2 +123,3 @@ import DataTable from '../DataTable.js'; | ||
setColumnOrder(columnNames: Array<string>): void; | ||
setModifierOptions(modifierOptions?: DataModifierTypeOptions): Promise<this>; | ||
/** | ||
@@ -124,0 +126,0 @@ * Starts polling new data after the specific time span in milliseconds. |
@@ -16,2 +16,3 @@ /* * | ||
'use strict'; | ||
import DataModifier from '../Modifiers/DataModifier.js'; | ||
import DataTable from '../DataTable.js'; | ||
@@ -173,2 +174,11 @@ import U from '../../Core/Utilities.js'; | ||
} | ||
setModifierOptions(modifierOptions) { | ||
const ModifierClass = (modifierOptions && | ||
DataModifier.types[modifierOptions.type]); | ||
return this.table | ||
.setModifier(ModifierClass ? | ||
new ModifierClass(modifierOptions) : | ||
void 0) | ||
.then(() => this); | ||
} | ||
/** | ||
@@ -175,0 +185,0 @@ * Starts polling new data after the specific time span in milliseconds. |
@@ -14,2 +14,3 @@ /* * | ||
/* * | ||
@@ -21,3 +22,5 @@ * | ||
import type { DataModifierTypeOptions } from '../Modifiers/DataModifierType'; | ||
import type DataTable from '../DataTable'; | ||
@@ -35,6 +38,25 @@ | ||
export interface DataConnectorOptions { | ||
/** | ||
* Option of the modifier that is used to modify the data. | ||
* Options for the modifier that shall be applied to the table to create a | ||
* modified version. This modified version is available via the | ||
* `DataTable.modified` property. | ||
* | ||
* @example | ||
* ``` JavaScript | ||
* const connector = new CSVConnector({ | ||
* csv: 'a,b,c\n1,2,3\n4,5,6', | ||
* dataModifier: { | ||
* type: 'Invert' | ||
* } | ||
* }); | ||
* await connector.load(); | ||
* console.log(table.getColumns()); | ||
* // {"a":[1,4],"b":[2,5],"c":[3,6]} | ||
* console.log(table.modified.getColumns()); | ||
* // {0:[1,2,3],1:[4,5,6],columnNames:["a","b","c"]} | ||
* ``` | ||
*/ | ||
dataModifier?: DataModifierTypeOptions; | ||
/** | ||
@@ -44,2 +66,3 @@ * Options for the data table. | ||
dataTable?: DataTable.Options; | ||
/** | ||
@@ -50,4 +73,6 @@ * Contains custom metadata related to the connector source, for example the | ||
metadata?: Metadata; | ||
} | ||
/** | ||
@@ -58,2 +83,3 @@ * Contains custom metadata related to the connector source, for example the | ||
export interface Metadata { | ||
/** | ||
@@ -63,4 +89,6 @@ * Metadata entry containing the name of the column and a metadata object. | ||
columns: Record<string, MetaColumn>; | ||
} | ||
/** | ||
@@ -70,8 +98,14 @@ * Metadata for a specific column in the connector source. | ||
export interface MetaColumn { | ||
dataType?: string; | ||
defaultValue?: (boolean|null|number|string); | ||
index?: number; | ||
title?: string; | ||
} | ||
/* * | ||
@@ -83,2 +117,3 @@ * | ||
export default DataConnectorOptions; |
import type DataEvent from '../DataEvent'; | ||
import type GoogleSheetsConnectorOptions from './GoogleSheetsConnectorOptions'; | ||
import type Types from '../../Shared/Types'; | ||
import DataConnector from './DataConnector.js'; | ||
@@ -47,3 +48,3 @@ import GoogleSheetsConverter from '../Converters/GoogleSheetsConverter.js'; | ||
*/ | ||
type UserOptions = (DeepPartial<GoogleSheetsConnectorOptions> & GoogleSheetsConverter.UserOptions); | ||
type UserOptions = (Types.DeepPartial<GoogleSheetsConnectorOptions> & GoogleSheetsConverter.UserOptions); | ||
/** | ||
@@ -50,0 +51,0 @@ * Creates GoogleSheets API v4 URL. |
@@ -79,14 +79,13 @@ /* * | ||
load(eventDetail) { | ||
const connector = this, { dataRefreshRate, enablePolling, firstRowAsNames, googleAPIKey, googleSpreadsheetKey } = connector.options, url = GoogleSheetsConnector.buildFetchURL(googleAPIKey, googleSpreadsheetKey, connector.options); | ||
// If already loaded, clear the current table | ||
connector.table.deleteColumns(); | ||
const connector = this, converter = connector.converter, table = connector.table, { dataModifier, dataRefreshRate, enablePolling, firstRowAsNames, googleAPIKey, googleSpreadsheetKey } = connector.options, url = GoogleSheetsConnector.buildFetchURL(googleAPIKey, googleSpreadsheetKey, connector.options); | ||
connector.emit({ | ||
type: 'load', | ||
detail: eventDetail, | ||
table: connector.table, | ||
table, | ||
url | ||
}); | ||
// If already loaded, clear the current table | ||
table.deleteColumns(); | ||
return fetch(url) | ||
.then((response) => response | ||
.json() | ||
.then((response) => (response.json())) | ||
.then((json) => { | ||
@@ -96,11 +95,14 @@ if (isGoogleError(json)) { | ||
} | ||
connector.converter.parse({ | ||
converter.parse({ | ||
firstRowAsNames, | ||
json: json | ||
json | ||
}); | ||
connector.table.setColumns(connector.converter.getTable().getColumns()); | ||
table.setColumns(converter.getTable().getColumns()); | ||
return connector.setModifierOptions(dataModifier); | ||
}) | ||
.then(() => { | ||
connector.emit({ | ||
type: 'afterLoad', | ||
detail: eventDetail, | ||
table: connector.table, | ||
table, | ||
url | ||
@@ -112,3 +114,4 @@ }); | ||
} | ||
}))['catch']((error) => { | ||
return connector; | ||
})['catch']((error) => { | ||
connector.emit({ | ||
@@ -118,7 +121,6 @@ type: 'loadError', | ||
error, | ||
table: connector.table | ||
table | ||
}); | ||
return Promise.reject(error); | ||
}) | ||
.then(() => connector); | ||
throw error; | ||
}); | ||
} | ||
@@ -125,0 +127,0 @@ } |
@@ -37,7 +37,7 @@ /* * | ||
*/ | ||
dataRefreshRate: number; | ||
dataRefreshRate?: number; | ||
/** | ||
* Whether to enable polling for live data. | ||
*/ | ||
enablePolling: boolean; | ||
enablePolling?: boolean; | ||
/** | ||
@@ -54,3 +54,3 @@ * The number of the last column to load. | ||
*/ | ||
firstRowAsNames: boolean; | ||
firstRowAsNames?: boolean; | ||
/** | ||
@@ -57,0 +57,0 @@ * The key for a Google Spreadsheet to load. See [general information |
import type DataEvent from '../DataEvent'; | ||
import type HTMLTableConnectorOptions from './HTMLTableConnectorOptions'; | ||
import type Types from '../../Shared/Types'; | ||
import DataConnector from './DataConnector.js'; | ||
@@ -80,3 +81,3 @@ import HTMLTableConverter from '../Converters/HTMLTableConverter.js'; | ||
*/ | ||
type UserOptions = (DeepPartial<HTMLTableConnectorOptions> & HTMLTableConverter.UserOptions); | ||
type UserOptions = (Types.DeepPartial<HTMLTableConnectorOptions> & HTMLTableConverter.UserOptions); | ||
} | ||
@@ -83,0 +84,0 @@ declare module './DataConnectorType' { |
@@ -62,12 +62,11 @@ /* * | ||
load(eventDetail) { | ||
const connector = this; | ||
// If already loaded, clear the current rows | ||
connector.table.deleteColumns(); | ||
const connector = this, converter = connector.converter, table = connector.table, { dataModifier, table: tableHTML } = connector.options; | ||
connector.emit({ | ||
type: 'load', | ||
detail: eventDetail, | ||
table: connector.table, | ||
table, | ||
tableElement: connector.tableElement | ||
}); | ||
const { table: tableHTML } = connector.options; | ||
// If already loaded, clear the current rows | ||
table.deleteColumns(); | ||
let tableElement; | ||
@@ -89,15 +88,19 @@ if (typeof tableHTML === 'string') { | ||
error, | ||
table: connector.table | ||
table | ||
}); | ||
return Promise.reject(new Error(error)); | ||
} | ||
connector.converter.parse(merge({ tableElement: connector.tableElement }, connector.options), eventDetail); | ||
connector.table.setColumns(connector.converter.getTable().getColumns()); | ||
connector.emit({ | ||
type: 'afterLoad', | ||
detail: eventDetail, | ||
table: connector.table, | ||
tableElement: connector.tableElement | ||
converter.parse(merge({ tableElement: connector.tableElement }, connector.options), eventDetail); | ||
table.setColumns(converter.getTable().getColumns()); | ||
return connector | ||
.setModifierOptions(dataModifier) | ||
.then(() => { | ||
connector.emit({ | ||
type: 'afterLoad', | ||
detail: eventDetail, | ||
table, | ||
tableElement: connector.tableElement | ||
}); | ||
return connector; | ||
}); | ||
return Promise.resolve(this); | ||
} | ||
@@ -104,0 +107,0 @@ } |
@@ -177,3 +177,3 @@ /* * | ||
for (let i = 0; i < headers.length; i++) { | ||
headers[i] = headers[i].replace(/^["']|["']$/g, ''); | ||
headers[i] = headers[i].trim().replace(/^["']|["']$/g, ''); | ||
} | ||
@@ -307,8 +307,6 @@ converter.headers = headers; | ||
while (i < columnStr.length) { | ||
if (c === '"' && cl !== '"' && cn !== '"') { | ||
if (c === '"') { | ||
break; | ||
} | ||
if (c !== '"' || (c === '"' && cl !== '"')) { | ||
token += c; | ||
} | ||
token += c; | ||
read(++i); | ||
@@ -315,0 +313,0 @@ } |
@@ -69,4 +69,2 @@ import type DataTable from './DataTable'; | ||
* | ||
* @function #emitCursor | ||
* | ||
* @param {Data.DataTable} table | ||
@@ -90,2 +88,23 @@ * The related table of the cursor. | ||
/** | ||
* @param {Data.DataTable} table | ||
* The related table of the cursor. | ||
* | ||
* @param {string} group | ||
* The related group on the table. | ||
* | ||
* @param {Data.DataCursor.Type} cursor | ||
* The state cursor to emit. | ||
* | ||
* @param {Event} [event] | ||
* Optional event information from a related source. | ||
* | ||
* @param {boolean} [lasting] | ||
* Whether this state cursor should be kept until it is cleared with | ||
* {@link DataCursor#remitCursor}. | ||
* | ||
* @return {Data.DataCursor} | ||
* Returns the DataCursor instance for a call chain. | ||
*/ | ||
emitCursor(table: DataTable, group: string, cursor: DataCursor.Type, event?: Event, lasting?: boolean): this; | ||
/** | ||
* Removes a lasting state cursor. | ||
@@ -143,5 +162,6 @@ * | ||
interface Event { | ||
event?: globalThis.Event; | ||
cursor: Type; | ||
cursors: Array<Type>; | ||
event?: globalThis.Event; | ||
group?: string; | ||
table: DataTable; | ||
@@ -148,0 +168,0 @@ } |
@@ -98,44 +98,20 @@ /* * | ||
} | ||
/** | ||
* This function emits a state cursor related to a table. It will provide | ||
* lasting state cursors of the table to listeners. | ||
* | ||
* @example | ||
* ```TypeScript | ||
* dataCursor.emit(myTable, { | ||
* type: 'position', | ||
* column: 'city', | ||
* row: 4, | ||
* state: 'hover', | ||
* }); | ||
* ``` | ||
* | ||
* @function #emitCursor | ||
* | ||
* @param {Data.DataTable} table | ||
* The related table of the cursor. | ||
* | ||
* @param {Data.DataCursor.Type} cursor | ||
* The state cursor to emit. | ||
* | ||
* @param {Event} [event] | ||
* Optional event information from a related source. | ||
* | ||
* @param {boolean} [lasting] | ||
* Whether this state cursor should be kept until it is cleared with | ||
* {@link DataCursor#remitCursor}. | ||
* | ||
* @return {Data.DataCursor} | ||
* Returns the DataCursor instance for a call chain. | ||
*/ | ||
emitCursor(table, cursor, event, lasting) { | ||
const tableId = table.id, state = cursor.state, listeners = (this.listenerMap[tableId] && | ||
// Implementation | ||
emitCursor(table, groupOrCursor, cursorOrEvent, eventOrLasting, lasting) { | ||
const cursor = (typeof groupOrCursor === 'object' ? | ||
groupOrCursor : | ||
cursorOrEvent), event = (typeof eventOrLasting === 'object' ? | ||
eventOrLasting : | ||
cursorOrEvent), group = (typeof groupOrCursor === 'string' ? | ||
groupOrCursor : | ||
void 0), tableId = table.id, state = cursor.state, listeners = (this.listenerMap[tableId] && | ||
this.listenerMap[tableId][state]); | ||
lasting = (lasting || eventOrLasting === true); | ||
if (listeners) { | ||
const stateMap = this.stateMap[tableId] = (this.stateMap[tableId] || | ||
{}); | ||
let cursors = stateMap[cursor.state]; | ||
const cursors = stateMap[cursor.state] || []; | ||
if (lasting) { | ||
if (!cursors) { | ||
cursors = stateMap[cursor.state] = []; | ||
if (!cursors.length) { | ||
stateMap[cursor.state] = cursors; | ||
} | ||
@@ -148,3 +124,3 @@ if (DataCursor.getIndex(cursor, cursors) === -1) { | ||
cursor, | ||
cursors: cursors || [], | ||
cursors, | ||
table | ||
@@ -155,2 +131,5 @@ }; | ||
} | ||
if (group) { | ||
e.group = group; | ||
} | ||
const emittingRegister = this.emittingRegister, emittingTag = this.buildEmittingTag(e); | ||
@@ -157,0 +136,0 @@ if (emittingRegister.indexOf(emittingTag) >= 0) { |
@@ -5,2 +5,3 @@ import type DataEvent from './DataEvent'; | ||
import DataConnector from './Connectors/DataConnector.js'; | ||
type ConnectorResolve = (value: (DataConnector | PromiseLike<DataConnector>)) => void; | ||
/** | ||
@@ -18,2 +19,7 @@ * Data pool to load connectors on-demand. | ||
/** | ||
* Internal dictionary with the connectors and their names. | ||
* @private | ||
*/ | ||
protected readonly connectors: Record<string, DataConnector>; | ||
/** | ||
* Pool options with all connectors. | ||
@@ -26,6 +32,7 @@ * | ||
/** | ||
* Internal dictionary with the connectors and their names. | ||
* Internal dictionary with the promise resolves waiting for connectors to | ||
* be done loading. | ||
* @private | ||
*/ | ||
protected readonly connectors: (Record<string, (DataConnector | undefined)>); | ||
protected readonly waiting: Record<string, Array<ConnectorResolve>>; | ||
/** | ||
@@ -32,0 +39,0 @@ * Emits an event on this data pool to all registered callbacks of the given |
@@ -15,3 +15,2 @@ /* * | ||
import DataConnector from './Connectors/DataConnector.js'; | ||
import DataModifier from './Modifiers/DataModifier.js'; | ||
import DataPoolDefaults from './DataPoolDefaults.js'; | ||
@@ -41,4 +40,5 @@ import U from '../Core/Utilities.js'; | ||
options.connectors = (options.connectors || []); | ||
this.connectors = {}; | ||
this.options = options; | ||
this.connectors = {}; | ||
this.waiting = {}; | ||
} | ||
@@ -74,9 +74,27 @@ /* * | ||
const connector = this.connectors[name]; | ||
// already loaded | ||
if (connector) { | ||
// already loaded | ||
return Promise.resolve(connector); | ||
} | ||
let waiting = this.waiting[name]; | ||
// currently loading | ||
if (waiting) { | ||
return new Promise((resolve) => { | ||
waiting.push(resolve); | ||
}); | ||
} | ||
this.waiting[name] = waiting = []; | ||
const connectorOptions = this.getConnectorOptions(name); | ||
if (connectorOptions) { | ||
return this.loadConnector(connectorOptions); | ||
return this | ||
.loadConnector(connectorOptions) | ||
.then((connector) => { | ||
delete this.waiting[name]; | ||
window.setTimeout(() => { | ||
for (let i = 0, iEnd = waiting.length; i < iEnd; ++i) { | ||
waiting[i](connector); | ||
} | ||
}, 1); | ||
return connector; | ||
}); | ||
} | ||
@@ -157,3 +175,2 @@ throw new Error(`Connector not found. (${name})`); | ||
const connector = new ConnectorClass(options.options); | ||
this.connectors[options.id] = connector; | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
@@ -163,13 +180,2 @@ connector | ||
.then((connector) => { | ||
var _a; | ||
if ((_a = options === null || options === void 0 ? void 0 : options.options) === null || _a === void 0 ? void 0 : _a.dataModifier) { | ||
const ModifierClass = DataModifier | ||
.types[options.options.dataModifier.type]; | ||
return connector.table | ||
.setModifier(new ModifierClass(options.options.dataModifier)) | ||
.then(() => connector); | ||
} | ||
return connector; | ||
}) | ||
.then((connector) => { | ||
this.emit({ | ||
@@ -179,2 +185,3 @@ type: 'afterLoad', | ||
}); | ||
this.connectors[options.id] = connector; | ||
resolve(connector); | ||
@@ -181,0 +188,0 @@ })['catch'](reject); |
@@ -19,3 +19,3 @@ import type ChainModifierOptions from './ChainModifierOptions'; | ||
* | ||
* @param {DeepPartial<ChainModifier.Options>} [options] | ||
* @param {Partial<ChainModifier.Options>} [options] | ||
* Options to configure the modifier chain. | ||
@@ -26,3 +26,3 @@ * | ||
*/ | ||
constructor(options?: DeepPartial<ChainModifierOptions>, ...chain: Array<DataModifier>); | ||
constructor(options?: Partial<ChainModifierOptions>, ...chain: Array<DataModifier>); | ||
/** | ||
@@ -29,0 +29,0 @@ * Ordered chain of modifiers. |
@@ -36,3 +36,3 @@ /* * | ||
* | ||
* @param {DeepPartial<ChainModifier.Options>} [options] | ||
* @param {Partial<ChainModifier.Options>} [options] | ||
* Options to configure the modifier chain. | ||
@@ -55,3 +55,3 @@ * | ||
if (ModifierClass) { | ||
chain.unshift(new ModifierClass(modifierOptions)); | ||
chain.push(new ModifierClass(modifierOptions)); | ||
} | ||
@@ -122,2 +122,5 @@ } | ||
this.chain.slice()); | ||
if (table.modified === table) { | ||
table.modified = table.clone(false, eventDetail); | ||
} | ||
let promiseChain = Promise.resolve(table); | ||
@@ -129,3 +132,4 @@ for (let i = 0, iEnd = modifiers.length; i < iEnd; ++i) { | ||
promiseChain = promiseChain.then((chainTable) => { | ||
table.modified = chainTable.modified; | ||
table.modified.deleteColumns(); | ||
table.modified.setColumns(chainTable.modified.getColumns()); | ||
return table; | ||
@@ -132,0 +136,0 @@ }); |
@@ -14,3 +14,3 @@ import type DataModifierOptions from './DataModifierOptions'; | ||
*/ | ||
chain?: Array<DeepPartial<DataModifierTypeOptions>>; | ||
chain?: Array<Partial<DataModifierTypeOptions>>; | ||
/** | ||
@@ -17,0 +17,0 @@ * Whether to revert the order before execution. |
@@ -18,6 +18,6 @@ import type DataEvent from '../DataEvent'; | ||
* | ||
* @param {InvertModifier.Options} [options] | ||
* @param {Partial<InvertModifier.Options>} [options] | ||
* Options to configure the invert modifier. | ||
*/ | ||
constructor(options?: DeepPartial<InvertModifierOptions>); | ||
constructor(options?: Partial<InvertModifierOptions>); | ||
/** | ||
@@ -24,0 +24,0 @@ * Options of the invert modifier. |
@@ -37,3 +37,3 @@ /* * | ||
* | ||
* @param {InvertModifier.Options} [options] | ||
* @param {Partial<InvertModifier.Options>} [options] | ||
* Options to configure the invert modifier. | ||
@@ -40,0 +40,0 @@ */ |
@@ -18,6 +18,6 @@ import type DataEvent from '../DataEvent'; | ||
* | ||
* @param {RangeModifier.Options} [options] | ||
* @param {Partial<RangeModifier.Options>} [options] | ||
* Options to configure the range modifier. | ||
*/ | ||
constructor(options?: DeepPartial<RangeModifierOptions>); | ||
constructor(options?: Partial<RangeModifierOptions>); | ||
/** | ||
@@ -43,5 +43,8 @@ * Options of the range modifier. | ||
* if the table has been modified by a range modifier | ||
* @param {DataTable} table the table to get the offset from | ||
* | ||
* @return {number} The row offset of the modified table | ||
* @param {DataTable} table | ||
* The table to get the offset from. | ||
* | ||
* @return {number} | ||
* The row offset of the modified table. | ||
*/ | ||
@@ -48,0 +51,0 @@ getModifiedTableOffset(table: DataTable): number; |
@@ -36,3 +36,3 @@ /* * | ||
* | ||
* @param {RangeModifier.Options} [options] | ||
* @param {Partial<RangeModifier.Options>} [options] | ||
* Options to configure the range modifier. | ||
@@ -64,5 +64,6 @@ */ | ||
modifier.emit({ type: 'modify', detail: eventDetail, table }); | ||
const { ranges, strict } = modifier.options; | ||
const { additive, ranges, strict } = modifier.options; | ||
if (ranges.length) { | ||
const columns = table.getColumns(), rows = [], modified = table.modified; | ||
const modified = table.modified; | ||
let columns = table.getColumns(), rows = []; | ||
for (let i = 0, iEnd = ranges.length, range, rangeColumn; i < iEnd; ++i) { | ||
@@ -74,2 +75,8 @@ range = ranges[i]; | ||
} | ||
if (i > 0 && !additive) { | ||
modified.deleteRows(); | ||
modified.setRows(rows); | ||
columns = modified.getColumns(); | ||
rows = []; | ||
} | ||
rangeColumn = (columns[range.column] || []); | ||
@@ -92,3 +99,5 @@ for (let j = 0, jEnd = rangeColumn.length, cell, row; j < jEnd; ++j) { | ||
cell <= range.maxValue) { | ||
row = table.getRow(j); | ||
row = (additive ? | ||
table.getRow(j) : | ||
modified.getRow(j)); | ||
if (row) { | ||
@@ -109,5 +118,8 @@ rows.push(row); | ||
* if the table has been modified by a range modifier | ||
* @param {DataTable} table the table to get the offset from | ||
* | ||
* @return {number} The row offset of the modified table | ||
* @param {DataTable} table | ||
* The table to get the offset from. | ||
* | ||
* @return {number} | ||
* The row offset of the modified table. | ||
*/ | ||
@@ -141,4 +153,3 @@ getModifiedTableOffset(table) { | ||
type: 'Range', | ||
ranges: [], | ||
strict: false | ||
ranges: [] | ||
}; | ||
@@ -145,0 +156,0 @@ DataModifier.registerType('Range', RangeModifier); |
@@ -11,2 +11,6 @@ import type DataModifierOptions from './DataModifierOptions'; | ||
/** | ||
* If set to true, multiple ranges will add up instead of reduce. | ||
*/ | ||
additive?: boolean; | ||
/** | ||
* Value ranges to include in the result. | ||
@@ -18,3 +22,3 @@ */ | ||
*/ | ||
strict: boolean; | ||
strict?: boolean; | ||
} | ||
@@ -21,0 +25,0 @@ /** |
@@ -25,6 +25,6 @@ import type DataEvent from '../DataEvent'; | ||
* | ||
* @param {RangeDataModifier.Options} [options] | ||
* @param {Partial<RangeDataModifier.Options>} [options] | ||
* Options to configure the range modifier. | ||
*/ | ||
constructor(options?: DeepPartial<SortModifierOptions>); | ||
constructor(options?: Partial<SortModifierOptions>); | ||
options: SortModifierOptions; | ||
@@ -31,0 +31,0 @@ /** |
@@ -52,3 +52,3 @@ /* * | ||
* | ||
* @param {RangeDataModifier.Options} [options] | ||
* @param {Partial<RangeDataModifier.Options>} [options] | ||
* Options to configure the range modifier. | ||
@@ -55,0 +55,0 @@ */ |
@@ -64,3 +64,3 @@ import type DataEvent from '../Data/DataEvent'; | ||
*/ | ||
private cellInputEl?; | ||
cellInputEl?: HTMLInputElement; | ||
/** | ||
@@ -288,7 +288,2 @@ * The container for the column headers. | ||
/** | ||
* Inherits the inner width from the scroll container. | ||
* @internal | ||
*/ | ||
private updateInnerContainerWidth; | ||
/** | ||
* Updates the scroll container to reflect the data size. | ||
@@ -295,0 +290,0 @@ * @internal |
@@ -304,3 +304,2 @@ /* * | ||
} | ||
this.updateInnerContainerWidth(); | ||
this.renderInitialRows(); | ||
@@ -485,10 +484,2 @@ this.addEvents(); | ||
/** | ||
* Inherits the inner width from the scroll container. | ||
* @internal | ||
*/ | ||
updateInnerContainerWidth() { | ||
const newWidth = this.outerContainer.offsetWidth; | ||
this.innerContainer.style.width = newWidth + 'px'; | ||
} | ||
/** | ||
* Updates the scroll container to reflect the data size. | ||
@@ -495,0 +486,0 @@ * @internal |
/** | ||
* @license Highcharts Dashboards v1.0.1 (2023-07-19) | ||
* @license Highcharts Dashboards v1.0.2 (2023-08-10) | ||
* @module dashboards/dashboards | ||
@@ -4,0 +4,0 @@ * |
/** | ||
* @license Highcharts Dashboards v1.0.1 (2023-07-19) | ||
* @license Highcharts Dashboards v1.0.2 (2023-08-10) | ||
* @module dashboards/datagrid | ||
@@ -4,0 +4,0 @@ * @requires dashboards |
/** | ||
* @license Highcharts Dashboards v1.0.1 (2023-07-19) | ||
* @license Highcharts Dashboards v1.0.2 (2023-08-10) | ||
* @module dashboards/modules/dashboards-plugin | ||
@@ -4,0 +4,0 @@ * @requires dashboards |
/** | ||
* @license Highcharts Dashboards Math 1.0.1 (2023-07-19) | ||
* @license Highcharts Dashboards Math 1.0.2 (2023-08-10) | ||
* @module dashboards/modules/math-modifier | ||
@@ -4,0 +4,0 @@ * @requires dashboards |
/* | ||
Highcharts Dashboards v1.0.1 (2023-07-19) | ||
Highcharts Dashboards v1.0.2 (2023-08-10) | ||
@@ -8,88 +8,90 @@ (c) 2009-2023 Highsoft AS | ||
*/ | ||
'use strict';var r=r||{};r.scope={};r.ASSUME_ES5=!1;r.ASSUME_NO_NATIVE_MAP=!1;r.ASSUME_NO_NATIVE_SET=!1;r.SIMPLE_FROUND_POLYFILL=!1;r.ISOLATE_POLYFILLS=!1;r.defineProperty=r.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,k,g){if(a==Array.prototype||a==Object.prototype)return a;a[k]=g.value;return a}; | ||
r.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var k=0;k<a.length;++k){var g=a[k];if(g&&g.Math==Math)return g}throw Error("Cannot find global object");};r.global=r.getGlobal(this);r.polyfills={};r.propertyToPolyfillSymbol={};r.POLYFILL_PREFIX="$jscp$";r.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x"); | ||
r.polyfill=function(a,k,g,c){k&&(r.ISOLATE_POLYFILLS?r.polyfillIsolated(a,k,g,c):r.polyfillUnisolated(a,k,g,c))};r.polyfillUnisolated=function(a,k){var g=r.global;a=a.split(".");for(var c=0;c<a.length-1;c++){var f=a[c];f in g||(g[f]={});g=g[f]}a=a[a.length-1];c=g[a];k=k(c);k!=c&&null!=k&&r.defineProperty(g,a,{configurable:!0,writable:!0,value:k})}; | ||
r.polyfillIsolated=function(a,k,g){var c=a.split(".");a=1===c.length;var f=c[0];f=!a&&f in r.polyfills?r.polyfills:r.global;for(var x=0;x<c.length-1;x++){var y=c[x];y in f||(f[y]={});f=f[y]}c=c[c.length-1];g=r.IS_SYMBOL_NATIVE&&"es6"===g?f[c]:null;k=k(g);null!=k&&(a?r.defineProperty(r.polyfills,c,{configurable:!0,writable:!0,value:k}):k!==g&&(r.propertyToPolyfillSymbol[c]=r.IS_SYMBOL_NATIVE?r.global.Symbol(c):r.POLYFILL_PREFIX+c,c=r.propertyToPolyfillSymbol[c],r.defineProperty(f,c,{configurable:!0, | ||
writable:!0,value:k})))};r.polyfill("Array.prototype.includes",function(a){return a?a:function(a,g){var c=this;c instanceof String&&(c=String(c));var f=c.length;g=g||0;for(0>g&&(g=Math.max(g+f,0));g<f;g++){var x=c[g];if(x===a||Object.is(x,a))return!0}return!1}},"es7","es3"); | ||
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("dashboards/modules/dashboards-plugin",["dashboards"],function(k){a(k);a.Dashboards=k;return a}):a("undefined"!==typeof Dashboards?Dashboards:void 0)})(function(a){function k(a,c,f,x){a.hasOwnProperty(c)||(a[c]=x.apply(null,f),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("DashboardsModuleLoaded",{detail:{path:c,module:a[c]}})))}a=a?a._modules: | ||
{};k(a,"Dashboards/Plugins/DataGridSyncHandlers.js",[a["Core/Utilities.js"]],function(a){const {addEvent:c}=a;return{highlight:{emitter:["highlightEmitter",function(){if("DataGrid"===this.type){const {dataGrid:f,board:a}=this;if(a){const {dataCursor:g}=a,m=[];if(f)return m.push(c(f.container,"dataGridHover",b=>{const a=this.connector&&this.connector.table;if(a){b=b.row;const e=b.querySelector(`.highcharts-datagrid-cell[data-original-data="${b.dataset.rowXIndex}"]`);g.emitCursor(a,{type:"position", | ||
row:parseInt(b.dataset.rowIndex,10),column:e?e.dataset.columnName:void 0,state:"dataGrid.hoverRow"})}})),m.push(c(f.container,"mouseout",()=>{const b=this.connector&&this.connector.table;b&&g.emitCursor(b,{type:"position",state:"dataGrid.hoverOut"})})),function(){m.forEach(b=>b())}}}}],handler:["highlightHandler",void 0,function(){const {board:a}=this,c=b=>{b=b.cursor;if("position"===b.type){var {row:a}=b;({dataGrid:b}=this);void 0!==a&&b&&(a=b.container.querySelector(`.highcharts-datagrid-row[data-row-index="${a}"]`))&& | ||
(b.toggleRowHighlight(a),b.hoveredRow=a)}},g=()=>{const {dataGrid:b}=this;b&&b.toggleRowHighlight(void 0)},m=()=>{const {dataCursor:b}=a;if(b){var e=this.connector&&this.connector.table;e&&(b.addListener(e.id,"point.mouseOver",c),b.addListener(e.id,"point.mouseOut",g))}},b=()=>{const b=a.dataCursor,e=this.connector&&this.connector.table;e&&(b.addListener(e.id,"point.mouseOver",c),b.addListener(e.id,"point.mouseOut",g))};a&&(m(),this.on("setConnector",()=>b()),this.on("afterSetConnector",()=>m()))}]}, | ||
extremes:{handler:function(){const {board:a}=this,c=b=>{"position"===b.cursor.type&&this.dataGrid&&b.cursors.length&&(b=b.cursors[b.cursors.length-1],"row"in b&&"number"===typeof b.row&&({row:b}=b,this.dataGrid.scrollToRow(b)))},g=()=>{const {dataCursor:b}=a;if(b){var f=this.connector&&this.connector.table;f&&b.addListener(f.id,"xAxis.extremes.min",c)}},m=()=>{const b=this.connector&&this.connector.table,{dataCursor:f}=a;b&&f.removeListener(b.id,"xAxis.extremes.min",c)};a&&(g(),this.on("setConnector", | ||
()=>m()),this.on("afterSetConnector",()=>g()))}}}});k(a,"Dashboards/Plugins/DataGridComponent.js",[a["Dashboards/Components/Component.js"],a["Data/Converters/DataConverter.js"],a["Dashboards/Plugins/DataGridSyncHandlers.js"],a["Core/Utilities.js"]],function(a,c,f,x){var g=this&&this.__awaiter||function(d,b,a,e){function f(d){return d instanceof a?d:new a(function(h){h(d)})}return new (a||(a=Promise))(function(a,h){function l(l){try{u(e.next(l))}catch(A){h(A)}}function w(l){try{u(e["throw"](l))}catch(A){h(A)}} | ||
function u(h){h.done?a(h.value):f(h.value).then(l,w)}u((e=e.apply(d,b||[])).next())})};const {diffObjects:m,merge:b,uniqueKey:v}=x;class e extends a{static onUpdate(d,b){if(d=d.target){var a=d.closest(".highcharts-datagrid-row"),e=d.closest(".highcharts-datagrid-cell");const f=new c;a&&a instanceof HTMLElement&&e&&e instanceof HTMLElement&&(a=a.dataset.rowIndex,{columnName:e}=e.dataset,void 0!==a&&void 0!==e&&(b=b.table.modified))&&(d=f.asGuessedType(d.value),d instanceof Date&&(d=d.toString()),b.setCell(e, | ||
parseInt(a,10),d))}}static fromJSON(d,a){const f=d.options,u=JSON.parse(d.options.dataGridOptions||"");a=new e(a,b(f,{dataGridOptions:u,syncHandlers:e.syncHandlers}));a.emit({type:"fromJSON",json:d});return a}constructor(d,u){u=b(e.defaultOptions,u);super(d,u);this.connectorListeners=[];this.options=u;this.type="DataGrid";this.options.dataGridClassName&&this.contentElement.classList.add(this.options.dataGridClassName);this.options.dataGridID&&(this.contentElement.id=this.options.dataGridID);this.syncHandlers= | ||
this.handleSyncOptions(f);this.sync=new e.Sync(this,this.syncHandlers);this.dataGridOptions=this.options.dataGridOptions||{};this.innerResizeTimeouts=[];this.on("tableChanged",()=>{var d;null===(d=this.dataGrid)||void 0===d?void 0:d.update({dataTable:this.filterColumns()})});a.addInstance(this)}load(){this.emit({type:"load"});super.load();this.parentElement.appendChild(this.element);this.hasLoaded=!0;if(this.connector&&!this.connectorListeners.length){const d=this.connectorListeners;d.push(this.connector.on("afterLoad", | ||
d=>{d.table&&this.connector&&this.connector.table.setColumns(d.table.getColumns())}));d.push(this.connector.table.on("afterSetCell",d=>{const a=this.dataGrid;let b=!0;a&&Array.prototype.slice.call(a.rowElements[d.rowIndex].childNodes).forEach(a=>{if(0<a.childElementCount){var e=a.childNodes[0];e="string"===typeof d.cellValue?e.value:+e.value;a.dataset.columnName===d.columnName&&e===d.cellValue&&(b=!1)}});b?this.update({}):void 0}))}this.emit({type:"afterLoad"});return this}render(){this.emit({type:"beforeRender"}); | ||
super.render();this.dataGrid||(this.dataGrid=this.constructDataGrid());this.connector&&this.dataGrid&&this.dataGrid.dataTable.modified!==this.connector.table.modified&&this.dataGrid.update({dataTable:this.filterColumns()});this.sync.start();this.emit({type:"afterRender"});this.setupConnectorUpdate();return this}redraw(){super.redraw();return this.render()}resize(d,a){this.dataGrid&&(super.resize(d,a),this.dataGrid.setSize(d,a))}update(d){const a=Object.create(null,{update:{get:()=>super.update}}); | ||
var b;return g(this,void 0,void 0,function*(){if((null===(b=d.connector)||void 0===b?void 0:b.id)!==this.connectorId){const d=this.connectorListeners;for(let a=0,b=d.length;a<b;++a)d[a]();d.length=0}yield a.update.call(this,d);this.dataGrid&&this.dataGrid.update(this.options.dataGridOptions||{});this.emit({type:"afterUpdate"})})}constructDataGrid(){if(e.DataGridConstructor)return this.dataGrid=new e.DataGridConstructor(this.contentElement,Object.assign(Object.assign({},this.options.dataGridOptions), | ||
{dataTable:this.connector&&this.connector.table.modified}));throw Error("DataGrid not connected.");}setupConnectorUpdate(){const {connector:d,dataGrid:a}=this;if(d&&a)a.on("cellClick",a=>{"input"in a&&a.input.addEventListener("keyup",a=>this.options.onUpdate(a,d))})}filterColumns(){var a,b=null===(a=this.connector)||void 0===a?void 0:a.table.modified;const e=this.options.visibleColumns;if(b){if(null===e||void 0===e||!e.length)return b;a=b.getColumnNames().filter(a=>0<(null===e||void 0===e?void 0: | ||
e.length)&&!e.includes(a));b=b.clone();b.deleteColumns(a);return b}}toJSON(){var a=JSON.stringify(this.options.dataGridOptions);const b=super.toJSON();a=Object.assign(Object.assign({},b),{options:Object.assign(Object.assign({},b.options),{dataGridOptions:a})});this.emit({type:"toJSON",json:a});return a}getOptions(){return Object.assign(Object.assign({},m(this.options,e.defaultOptions)),{type:"DataGrid"})}}e.syncHandlers=f;e.defaultOptions=b(a.defaultOptions,{dataGridClassName:"dataGrid-container", | ||
dataGridID:"dataGrid-"+v(),dataGridOptions:{},editableOptions:[{name:"connectorName",propertyPath:["connector","id"],type:"select"}],syncHandlers:f,onUpdate:e.onUpdate});return e});k(a,"Dashboards/Plugins/DataGridPlugin.js",[a["Dashboards/Plugins/DataGridComponent.js"]],function(a){return{custom:{connectDataGrid:function(c){a.DataGridConstructor=c}},name:"DataGrid.DashboardsPlugin",onRegister:function(c){({ComponentRegistry:c}=c);c.registerComponent("DataGrid",a)},onUnregister:function(){}}});k(a, | ||
"Dashboards/Plugins/HighchartsSyncHandlers.js",[a["Core/Utilities.js"]],function(a){const {addEvent:c}=a;return{extremes:{emitter:function(){if("Highcharts"===this.type){const a=this,g=[];this.on("afterRender",()=>{const {chart:f,connector:m,board:b}=a,v=m&&m.table,{dataCursor:e}=b;if(v&&f){const a=a=>{var b=!!a.resetSelection;if((!a.trigger||a.trigger&&"dashboards-sync"!==a.trigger)&&!b){var h=a.target;const l=h.series.filter(a=>v.hasColumns([a.name])),[d]=l.length?l:h.series;if(d){b=d.points.filter(a=> | ||
a.isInside||!1);const w={type:"position",state:`${h.coll}.extremes.min`},f={type:"position",state:`${h.coll}.extremes.max`};l.length&&"xAxis"===h.coll&&b.length&&(h=h.dateTime&&v.hasColumns(["x"])?"x":d.name,w.row=b[0].index,w.column=h,f.row=b[b.length-1].index,f.column=h);e.emitCursor(v,w,a,!0).emitCursor(v,f,a,!0)}}},b=()=>f.axes.map(b=>c(b,"afterSetExtremes",a));let m=b();const p=()=>{m.forEach(a=>{a()});m=[]};g.push(c(f,"selection",a=>{a.resetSelection&&(p(),e.emitCursor(v,{type:"position",state:"chart.zoomOut"}, | ||
a),m.push(...b()))}));g.push(()=>{e.remitCursor(v.id,{type:"position",state:"xAxis.extremes.min"});e.remitCursor(v.id,{type:"position",state:"xAxis.extremes.max"});p()})}});return function(){g.forEach(a=>a())}}},handler:function(){const {chart:a,board:c}=this;a&&c&&["xAxis","yAxis"].forEach(f=>{const g=[],b=b=>{const {cursor:d,event:e}=b;if("position"===d.type){const b=e&&e.target;if(b&&a){let d=!1;a[f].forEach(a=>{b.coll===a.coll&&b!==a&&null!==b.min&&null!==b.max&&a.max!==b.max&&a.min!==b.min&& | ||
(a.setExtremes(b.min,b.max,!1,void 0,{trigger:"dashboards-sync"}),d=!0)});d&&!a.resetZoomButton&&a.showResetZoom();a.redraw()}}},v=()=>{const {dataCursor:d}=c,{connector:e}=this;if(e){const {table:c}=e;d.addListener(c.id,`${f}.extremes.min`,b);d.addListener(c.id,`${f}.extremes.max`,b);const m=()=>{a.zoomOut();setTimeout(()=>{this.element.querySelectorAll(".highcharts-reset-zoom").forEach(a=>{a.remove()})})};d.addListener(c.id,"chart.zoomOut",m);g.push(()=>{d.removeListener(c.id,`${f}.extremes.min`, | ||
b);d.removeListener(c.id,`${f}.extremes.max`,b);d.removeListener(c.id,"chart.zoomOut",m)})}},e=()=>{g.forEach(a=>a())};c&&(v(),this.on("setConnector",()=>e()),this.on("afterSetConnector",()=>v()))})}},highlight:{emitter:["highlightEmitter",function(){if("Highcharts"===this.type){const {chart:a,board:c}=this;if(c){const {dataCursor:f}=c;this.on("afterRender",()=>{const c=this.connector&&this.connector.table;a&&a.series&&c&&a.series.forEach(a=>{a.update({point:{events:{mouseOver:function(){let b=0; | ||
const e=c.getModifier();e&&"getModifiedTableOffset"in e&&(b=e.getModifiedTableOffset(c));f.emitCursor(c,{type:"position",row:b+this.index,column:a.name,state:"point.mouseOver"})},mouseOut:function(){let b=0;const e=c.getModifier();e&&"getModifiedTableOffset"in e&&(b=e.getModifiedTableOffset(c));f.emitCursor(c,{type:"position",row:b+this.index,column:a.name,state:"point.mouseOut"})}}}})})});return function(){a&&a.series&&a.series.forEach(a=>{a.update({point:{events:{mouseOver:void 0,mouseOut:void 0}}})})}}}}], | ||
handler:function(){const {chart:a,board:c}=this,g=b=>{const d=this.connector&&this.connector.table;if(d){var e=0,c=d.getModifier();c&&"getModifiedTableOffset"in c&&(e=c.getModifiedTableOffset(d));if(a&&a.series.length){const d=b.cursor;"position"===d.type&&([b]=1<a.series.length&&d.column?a.series.filter(a=>a.name===d.column):a.series,b&&b.visible&&void 0!==d.row&&(e=b.points[d.row-e])&&a.tooltip&&a.tooltip.refresh(e))}}},m=()=>{a&&a.series.length&&a.tooltip&&a.tooltip.hide()},b=()=>{const {dataCursor:a}= | ||
c;if(a){const b=this.connector&&this.connector.table;b&&(a.addListener(b.id,"point.mouseOver",g),a.addListener(b.id,"dataGrid.hoverRow",g),a.addListener(b.id,"point.mouseOut",m),a.addListener(b.id,"dataGrid.hoverOut",m))}},v=()=>{const a=this.connector&&this.connector.table;a&&(c.dataCursor.removeListener(a.id,"point.mouseOver",g),c.dataCursor.removeListener(a.id,"dataGrid.hoverRow",g),c.dataCursor.removeListener(a.id,"point.mouseOut",m),c.dataCursor.removeListener(a.id,"dataGrid.hoverOut",m))};c&& | ||
(b(),this.on("setConnector",()=>v()),this.on("afterSetConnector",()=>b()))}},visibility:{emitter:function(){if("Highcharts"===this.type){const a=this;return this.on("afterRender",()=>{const {chart:c,connector:f,board:g}=a,b=f&&f.table;if(b&&g&&c){const {dataCursor:a}=g,{series:e}=c;e.forEach(d=>{d.update({events:{show:function(){a.emitCursor(b,{type:"position",state:"series.show",column:this.name})},hide:function(){a.emitCursor(b,{type:"position",state:"series.hide",column:this.name})}}})})}})}}, | ||
handler:function(){const a=this,{board:c}=this,g=(a,b)=>{for(const d of a)if(d.name===b)return d},m=b=>{const d=a.chart;d&&"position"===b.cursor.type&&void 0!==b.cursor.column&&(b=g(d.series,b.cursor.column))&&b.setVisible(!0,!0)},b=b=>{const d=a.chart;d&&"position"===b.cursor.type&&void 0!==b.cursor.column&&(b=g(d.series,b.cursor.column))&&b.setVisible(!1,!0)},v=()=>{const {dataCursor:a}=c;if(a){var e=this.connector&&this.connector.table;e&&(a.addListener(e.id,"series.show",m),a.addListener(e.id, | ||
"series.hide",b))}},e=()=>{const a=this.connector&&this.connector.table;a&&(c.dataCursor.removeListener(a.id,"series.show",m),c.dataCursor.removeListener(a.id,"series.hide",b))};c&&(v(),this.on("setConnector",()=>e()),this.on("afterSetConnector",()=>v()))}}}});k(a,"Dashboards/Plugins/HighchartsComponent.js",[a["Dashboards/Components/Component.js"],a["Data/Converters/DataConverter.js"],a["Data/DataTable.js"],a["Dashboards/Globals.js"],a["Dashboards/Plugins/HighchartsSyncHandlers.js"],a["Core/Utilities.js"]], | ||
function(a,c,f,k,y,m){var b=this&&this.__awaiter||function(a,b,d,c){function h(a){return a instanceof d?a:new d(function(b){b(a)})}return new (d||(d=Promise))(function(l,d){function w(a){try{f(c.next(a))}catch(t){d(t)}}function e(a){try{f(c["throw"](a))}catch(t){d(t)}}function f(a){a.done?l(a.value):h(a.value).then(w,e)}f((c=c.apply(a,b||[])).next())})};const {addEvent:g,createElement:e,merge:d,splat:u,uniqueKey:x,error:p,diffObjects:z}=m;class n extends a{static fromJSON(a,b){const h=a.options,l= | ||
JSON.parse(a.options.chartOptions||"{}");b=new n(b,d(h,{chartOptions:l,syncHandlers:n.syncHandlers}));b.emit({type:"fromJSON",json:a});return b}constructor(b,l){l=d(n.defaultOptions,l);super(b,l);this.options=l;this.chartConstructor=this.options.chartConstructor;this.type="Highcharts";this.chartContainer=e("figure",void 0,void 0,void 0,!0);this.setOptions();this.sync=new n.Sync(this,this.syncHandlers);this.chartOptions=d(this.options.chartOptions||{chart:{}},{tooltip:{}});this.on("tableChanged",()=> | ||
this.updateSeries());if(this.connector)this.connector.on("afterLoad",a=>{a.table&&this.connector&&this.connector.table.setColumns(a.table.getColumns())});this.innerResizeTimeouts=[];a.addInstance(this)}load(){this.emit({type:"load"});super.load();this.parentElement.appendChild(this.element);this.contentElement.appendChild(this.chartContainer);this.hasLoaded=!0;this.emit({type:"afterLoad"});return this}render(){this.emit({type:"beforeRender"});super.render();this.chart=this.getChart();this.updateSeries(); | ||
this.sync.start();this.emit({type:"afterRender"});this.setupConnectorUpdate();return this}resize(a,b){for(super.resize(a,b);this.innerResizeTimeouts.length;)(a=this.innerResizeTimeouts.pop())&&clearTimeout(a);this.innerResizeTimeouts.push(setTimeout(()=>{this.chart&&this.chart.setSize(null,this.contentElement.clientHeight,!1)},33));return this}setupConnectorUpdate(){const {connector:a,chart:b}=this;a&&b&&this.options.allowConnectorUpdate&&b.series.forEach(b=>{b.points.forEach(b=>{g(b,"drag",()=>{this.onChartUpdate(b, | ||
a)})})})}setOptions(){this.options.chartClassName&&this.chartContainer.classList.add(this.options.chartClassName);this.options.chartID&&(this.chartContainer.id=this.options.chartID);this.syncHandlers=this.handleSyncOptions(y)}onChartUpdate(a,b){b=b.table;const h=a.series.name,l=a.x;a=(new c).asNumber(a.y);b.setCell(h,l,a)}update(a,l=!0){const h=Object.create(null,{update:{get:()=>super.update}});return b(this,void 0,void 0,function*(){yield h.update.call(this,a,!1);this.setOptions();this.chart&&this.chart.update(d(this.options.chartOptions)|| | ||
{});this.emit({type:"afterUpdate"});l&&this.redraw()})}updateSeries(){if(this.chart&&this.connector){this.presentationTable=this.presentationModifier?this.connector.table.modified.clone():this.connector.table;const {id:a}=this.connector.table,{chart:b}=this,d=this.options.columnAssignment||{},c={};this.presentationModifier&&(this.presentationTable=this.presentationModifier.modifyTable(this.presentationTable).modified);const e=this.presentationTable;this.emit({type:"afterPresentationModifier",table:e}); | ||
const A=e.modified.getColumnNames().filter(a=>this.activeGroup&&!1===this.activeGroup.getSharedState().getColumnVisibility(a)&&!d[a]||null===d[a]?!1:"x"===d[a]?(c[a]=a,!1):!0);A.map((h,d)=>{let l=0;for(;l<b.series.length;){const h=b.series[l],c=h.options.id===`${a}-series-${d}`,e=-1!==A.indexOf(h.name);l++;if(e&&c)return h;!e&&c&&h.destroy()}return b.addSeries({name:h,id:`${a}-series-${d}`},!1)}).forEach(a=>{var b=Object.keys(c)[0];const h=new f({columns:e.modified.getColumns([b,a.name])});h.renameColumn(a.name, | ||
"y");b&&h.renameColumn(b,"x");b=h.getRowObjects().reduce((a,b)=>{a.push([b.x,b.y]);return a},[]);a.setData(b)})}}getChart(){return this.chart||this.createChart()}createChart(){const a=n.charter||k.win.Highcharts;if("chart"!==this.chartConstructor){const b=a[this.chartConstructor];if(b)try{return b(this.chartContainer,this.chartOptions)}catch(w){p("The Highcharts component is misconfigured: `"+this.cell.id+"`")}}if("function"!==typeof a.chart)throw Error("Chart constructor not found");return this.chart= | ||
a.chart(this.chartContainer,this.chartOptions)}registerChartEvents(){if(this.chart&&this.chart.options){const a=this.chart.options;"chart series yAxis xAxis colorAxis annotations navigation".split(" ").map(b=>{let h=a[b]||{};!Array.isArray(h)&&h.events&&(h=[h]);return h&&"object"===typeof h&&Array.isArray(h)?h.reduce((a,h,d)=>{h&&h.events&&(a[h.id||`${b}-${d}`]=h.events);return a},{})||{}:{}}).forEach(a=>{Object.keys(a).forEach(b=>{const h=a[b];Object.keys(h).forEach(a=>{this.callbackRegistry.addCallback(`${b}-${a}`, | ||
{type:"seriesEvent",func:h[a]})})})})}}setConnector(a){var b;const h=this.chart;if(this.connector&&h&&h.series&&this.connector.table.id!==(null===a||void 0===a?void 0:a.table.id)){const a=this.connector.table.id;for(let d=h.series.length-1;0<=d;d--){const c=h.series[d];-1!==(null===(b=c.options.id)||void 0===b?void 0:b.indexOf(a))&&c.remove(!1)}}super.setConnector(a);return this}toJSON(){var a=JSON.stringify(this.options.chartOptions);const b=this.options.chartConstructor;this.registerChartEvents(); | ||
const d=super.toJSON();a=Object.assign(Object.assign({},d),{type:"Highcharts",options:Object.assign(Object.assign({},d.options),{chartOptions:a,chartConstructor:b,type:"Highcharts",sync:{}})});this.emit({type:"toJSON",json:a});return a}getOptions(){return Object.assign(Object.assign({},z(this.options,n.defaultOptions)),{type:"Highcharts"})}getEditableOptions(){var a;const b=this.options,c=this.chart,e=c&&c.options,f=e&&(null===(a=e.chart)||void 0===a?void 0:a.type)||"line";return d(b,{chartOptions:e}, | ||
{chartOptions:{yAxis:u(c&&c.yAxis[0].options),xAxis:u(c&&c.xAxis[0].options),plotOptions:{series:(e&&e.plotOptions||{})[f]}}})}getEditableOptionValue(a){if(a)return 1===a.length&&"chartOptions"===a[0]?JSON.stringify(this.options.chartOptions,null,2):super.getEditableOptionValue.call(this,a)}}n.syncHandlers=y;n.defaultOptions=d(a.defaultOptions,{allowConnectorUpdate:!0,chartClassName:"chart-container",chartID:"chart-"+x(),chartOptions:{chart:{styledMode:!0},series:[]},chartConstructor:"",editableOptions:(a.defaultOptions.editableOptions|| | ||
[]).concat([{name:"chartOptions",type:"nested",nestedOptions:[{name:"chart",options:[{name:"title",propertyPath:["chartOptions","title","text"],type:"input"},{name:"subtitle",propertyPath:["chartOptions","subtitle","text"],type:"input"},{name:"type",propertyPath:["chartOptions","chart","type"],type:"select",selectOptions:[{name:"column",iconURL:"series-types/icon-column.svg"},{name:"line",iconURL:"series-types/icon-line.svg"},{name:"scatter",iconURL:"series-types/icon-scatter.svg"},{name:"pie",iconURL:"series-types/icon-pie.svg"}]}]}, | ||
{name:"xAxis",options:[{name:"title",propertyPath:["chartOptions","xAxis","title","text"],type:"input"},{name:"type",propertyPath:["chartOptions","xAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"yAxis",options:[{name:"title",propertyPath:["chartOptions","yAxis","title","text"],type:"input"},{name:"type",propertyPath:["chartOptions","yAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"legend", | ||
showToggle:!0,propertyPath:["chartOptions","legend","enabled"],options:[{name:"align",propertyPath:["chartOptions","legend","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"tooltip",showToggle:!0,propertyPath:["chartOptions","tooltip","enabled"],options:[{name:"split",propertyPath:["chartOptions","tooltip","split"],type:"toggle"}]},{name:"dataLabels",propertyPath:["chartOptions","plotOptions","series","dataLabels","enabled"],showToggle:!0,options:[{name:"align", | ||
propertyPath:["chartOptions","plotOptions","series","dataLabels","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"credits",showToggle:!0,propertyPath:["chartOptions","credits","enabled"],options:[{name:"name",propertyPath:["chartOptions","credits","text"],type:"input"},{name:"url",propertyPath:["chartOptions","credits","href"],type:"input"}]}]},{name:"chartConfig",propertyPath:["chartOptions"],type:"textarea"},{name:"chartClassName",propertyPath:["chartClassName"], | ||
type:"input"},{name:"chartID",propertyPath:["chartID"],type:"input"}]),syncHandlers:y,editableOptionsBindings:d(a.defaultOptions.editableOptionsBindings,{skipRedraw:["chartOptions","chartConfig"]}),columnAssignment:{}});return n});k(a,"Core/Chart/ChartDefaults.js",[],function(){return{alignThresholds:!1,panning:{enabled:!1,type:"x"},styledMode:!1,borderRadius:0,colorCount:10,allowMutatingData:!0,ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right", | ||
x:-10,y:10}},reflow:!0,type:"line",zooming:{singleTouch:!1,resetButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}}},width:null,height:null,borderColor:"#334eff",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"}});k(a,"Core/Color/Color.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,c){const {isNumber:f,merge:g,pInt:k}=c;class m{static parse(a){return a?new m(a):m.None}constructor(b){this.rgba=[NaN,NaN,NaN,NaN];this.input=b;const c=a.Color;if(c&&c!==m)return new c(b);this.init(b)}init(a){let b; | ||
let c;if("object"===typeof a&&"undefined"!==typeof a.stops)this.stops=a.stops.map(a=>new m(a[1]));else if("string"===typeof a){this.input=a=m.names[a.toLowerCase()]||a;if("#"===a.charAt(0)){var d=a.length;var f=parseInt(a.substr(1),16);7===d?b=[(f&16711680)>>16,(f&65280)>>8,f&255,1]:4===d&&(b=[(f&3840)>>4|(f&3840)>>8,(f&240)>>4|f&240,(f&15)<<4|f&15,1])}if(!b)for(f=m.parsers.length;f--&&!b;)c=m.parsers[f],(d=c.regex.exec(a))&&(b=c.parse(d))}b&&(this.rgba=b)}get(a){const b=this.input,c=this.rgba;if("object"=== | ||
typeof b&&"undefined"!==typeof this.stops){const c=g(b);c.stops=[].slice.call(c.stops);this.stops.forEach((b,d)=>{c.stops[d]=[c.stops[d][0],b.get(a)]});return c}return c&&f(c[0])?"rgb"===a||!a&&1===c[3]?"rgb("+c[0]+","+c[1]+","+c[2]+")":"a"===a?`${c[3]}`:"rgba("+c.join(",")+")":b}brighten(a){const b=this.rgba;if(this.stops)this.stops.forEach(function(b){b.brighten(a)});else if(f(a)&&0!==a)for(let c=0;3>c;c++)b[c]+=k(255*a),0>b[c]&&(b[c]=0),255<b[c]&&(b[c]=255);return this}setOpacity(a){this.rgba[3]= | ||
a;return this}tweenTo(a,c){const b=this.rgba,d=a.rgba;if(!f(b[0])||!f(d[0]))return a.input||"none";a=1!==d[3]||1!==b[3];return(a?"rgba(":"rgb(")+Math.round(d[0]+(b[0]-d[0])*(1-c))+","+Math.round(d[1]+(b[1]-d[1])*(1-c))+","+Math.round(d[2]+(b[2]-d[2])*(1-c))+(a?","+(d[3]+(b[3]-d[3])*(1-c)):"")+")"}}m.names={white:"#ffffff",black:"#000000"};m.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[k(a[1]),k(a[2]),k(a[3]), | ||
parseFloat(a[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(a){return[k(a[1]),k(a[2]),k(a[3]),1]}}];m.None=new m("");"";return m});k(a,"Core/Color/Palettes.js",[],function(){return{colors:"#2caffe #544fc5 #00e272 #fe6a35 #6b8abc #d568fb #2ee0ca #fa4b42 #feb56a #91e8e1".split(" ")}});k(a,"Core/Time.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,c){const {win:f}=a,{defined:g,error:k,extend:m,isObject:b,merge:v,objectEach:e,pad:d,pick:u, | ||
splat:D,timeUnits:p}=c,z=a.isSafari&&f.Intl&&f.Intl.DateTimeFormat.prototype.formatRange,n=a.isSafari&&f.Intl&&!f.Intl.DateTimeFormat.prototype.formatRange;class h{constructor(a){this.options={};this.variableTimezone=this.useUTC=!1;this.Date=f.Date;this.getTimezoneOffset=this.timezoneOffsetFunction();this.update(a)}get(a,b){if(this.variableTimezone||this.timezoneOffset){const c=b.getTime(),h=c-this.getTimezoneOffset(b);b.setTime(h);a=b["getUTC"+a]();b.setTime(c);return a}return this.useUTC?b["getUTC"+ | ||
a]():b["get"+a]()}set(a,b,c){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===a||"Seconds"===a||"Minutes"===a&&0===this.getTimezoneOffset(b)%36E5)return b["setUTC"+a](c);var h=this.getTimezoneOffset(b);h=b.getTime()-h;b.setTime(h);b["setUTC"+a](c);a=this.getTimezoneOffset(b);h=b.getTime()+a;return b.setTime(h)}return this.useUTC||z&&"FullYear"===a?b["setUTC"+a](c):b["set"+a](c)}update(a={}){const b=u(a.useUTC,!0);this.options=a=v(!0,this.options,a);this.Date=a.Date||f.Date||Date; | ||
this.timezoneOffset=(this.useUTC=b)&&a.timezoneOffset||void 0;this.getTimezoneOffset=this.timezoneOffsetFunction();this.variableTimezone=b&&!(!a.getTimezoneOffset&&!a.timezone)}makeTime(a,b,c,h,d,f){let e,l,A;this.useUTC?(e=this.Date.UTC.apply(0,arguments),l=this.getTimezoneOffset(e),e+=l,A=this.getTimezoneOffset(e),l!==A?e+=A-l:l-36E5!==this.getTimezoneOffset(e-36E5)||n||(e-=36E5)):e=(new this.Date(a,b,u(c,1),u(h,0),u(d,0),u(f,0))).getTime();return e}timezoneOffsetFunction(){const a=this,b=this.options, | ||
c=b.getTimezoneOffset,h=b.moment||f.moment;if(!this.useUTC)return function(a){return 6E4*(new Date(a.toString())).getTimezoneOffset()};if(b.timezone){if(h)return function(a){return 6E4*-h.tz(a,b.timezone).utcOffset()};k(25)}return this.useUTC&&c?function(a){return 6E4*c(a.valueOf())}:function(){return 6E4*(a.timezoneOffset||0)}}dateFormat(b,c,h){if(!g(c)||isNaN(c))return a.defaultOptions.lang&&a.defaultOptions.lang.invalidDate||"";b=u(b,"%Y-%m-%d %H:%M:%S");const f=this;var l=new this.Date(c);const n= | ||
this.get("Hours",l),w=this.get("Day",l),k=this.get("Date",l),p=this.get("Month",l),G=this.get("FullYear",l),t=a.defaultOptions.lang,q=t&&t.weekdays,F=t&&t.shortWeekdays;l=m({a:F?F[w]:q[w].substr(0,3),A:q[w],d:d(k),e:d(k,2," "),w,b:t.shortMonths[p],B:t.months[p],m:d(p+1),o:p+1,y:G.toString().substr(2,2),Y:G,H:d(n),k:n,I:d(n%12||12),l:n%12||12,M:d(this.get("Minutes",l)),p:12>n?"AM":"PM",P:12>n?"am":"pm",S:d(l.getSeconds()),L:d(Math.floor(c%1E3),3)},a.dateFormats);e(l,function(a,h){for(;-1!==b.indexOf("%"+ | ||
h);)b=b.replace("%"+h,"function"===typeof a?a.call(f,c):a)});return h?b.substr(0,1).toUpperCase()+b.substr(1):b}resolveDTLFormat(a){return b(a,!0)?a:(a=D(a),{main:a[0],from:a[1],to:a[2]})}getTimeTicks(a,b,c,h){const d=this,e=[],f={};var l=new d.Date(b);const n=a.unitRange,k=a.count||1;let w;h=u(h,1);if(g(b)){d.set("Milliseconds",l,n>=p.second?0:k*Math.floor(d.get("Milliseconds",l)/k));n>=p.second&&d.set("Seconds",l,n>=p.minute?0:k*Math.floor(d.get("Seconds",l)/k));n>=p.minute&&d.set("Minutes",l,n>= | ||
p.hour?0:k*Math.floor(d.get("Minutes",l)/k));n>=p.hour&&d.set("Hours",l,n>=p.day?0:k*Math.floor(d.get("Hours",l)/k));n>=p.day&&d.set("Date",l,n>=p.month?1:Math.max(1,k*Math.floor(d.get("Date",l)/k)));if(n>=p.month){d.set("Month",l,n>=p.year?0:k*Math.floor(d.get("Month",l)/k));var q=d.get("FullYear",l)}n>=p.year&&d.set("FullYear",l,q-q%k);n===p.week&&(q=d.get("Day",l),d.set("Date",l,d.get("Date",l)-q+h+(q<h?-7:0)));q=d.get("FullYear",l);h=d.get("Month",l);const a=d.get("Date",l),m=d.get("Hours",l); | ||
b=l.getTime();!d.variableTimezone&&d.useUTC||!g(c)||(w=c-b>4*p.month||d.getTimezoneOffset(b)!==d.getTimezoneOffset(c));b=l.getTime();for(l=1;b<c;)e.push(b),b=n===p.year?d.makeTime(q+l*k,0):n===p.month?d.makeTime(q,h+l*k):!w||n!==p.day&&n!==p.week?w&&n===p.hour&&1<k?d.makeTime(q,h,a,m+l*k):b+n*k:d.makeTime(q,h,a+l*k*(n===p.day?1:7)),l++;e.push(b);n<=p.hour&&1E4>e.length&&e.forEach(function(a){0===a%18E5&&"000000000"===d.dateFormat("%H%M%S%L",a)&&(f[a]="day")})}e.info=m(a,{higherRanks:f,totalRange:n* | ||
k});return e}getDateFormat(a,b,c,d){const h=this.dateFormat("%m-%d %H:%M:%S.%L",b),l={millisecond:15,second:12,minute:9,hour:6,day:3};let e,f="millisecond";for(e in p){if(a===p.week&&+this.dateFormat("%w",b)===c&&"00:00:00.000"===h.substr(6)){e="week";break}if(p[e]>a){e=f;break}if(l[e]&&h.substr(l[e])!=="01-01 00:00:00.000".substr(l[e]))break;"week"!==e&&(f=e)}return this.resolveDTLFormat(d[e]).main}}"";return h});k(a,"Core/Defaults.js",[a["Core/Chart/ChartDefaults.js"],a["Core/Color/Color.js"],a["Core/Globals.js"], | ||
a["Core/Color/Palettes.js"],a["Core/Time.js"],a["Core/Utilities.js"]],function(a,c,f,k,y,m){const {isTouchDevice:b,svg:g}=f,{merge:e}=m,d={colors:k.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), | ||
decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:a,title:{style:{color:"#333333",fontWeight:"bold"},text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{style:{color:"#666666",fontSize:"0.8em"},text:"",align:"center",widthAdjust:-44},caption:{margin:15,style:{color:"#666666",fontSize:"0.8em"},text:"", | ||
'use strict';var r=r||{};r.scope={};r.ASSUME_ES5=!1;r.ASSUME_NO_NATIVE_MAP=!1;r.ASSUME_NO_NATIVE_SET=!1;r.SIMPLE_FROUND_POLYFILL=!1;r.ISOLATE_POLYFILLS=!1;r.defineProperty=r.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,g,k){if(b==Array.prototype||b==Object.prototype)return b;b[g]=k.value;return b}; | ||
r.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var g=0;g<b.length;++g){var k=b[g];if(k&&k.Math==Math)return k}throw Error("Cannot find global object");};r.global=r.getGlobal(this);r.polyfills={};r.propertyToPolyfillSymbol={};r.POLYFILL_PREFIX="$jscp$";r.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x"); | ||
r.polyfill=function(b,g,k,d){g&&(r.ISOLATE_POLYFILLS?r.polyfillIsolated(b,g,k,d):r.polyfillUnisolated(b,g,k,d))};r.polyfillUnisolated=function(b,g){var k=r.global;b=b.split(".");for(var d=0;d<b.length-1;d++){var f=b[d];f in k||(k[f]={});k=k[f]}b=b[b.length-1];d=k[b];g=g(d);g!=d&&null!=g&&r.defineProperty(k,b,{configurable:!0,writable:!0,value:g})}; | ||
r.polyfillIsolated=function(b,g,k){var d=b.split(".");b=1===d.length;var f=d[0];f=!b&&f in r.polyfills?r.polyfills:r.global;for(var x=0;x<d.length-1;x++){var y=d[x];y in f||(f[y]={});f=f[y]}d=d[d.length-1];k=r.IS_SYMBOL_NATIVE&&"es6"===k?f[d]:null;g=g(k);null!=g&&(b?r.defineProperty(r.polyfills,d,{configurable:!0,writable:!0,value:g}):g!==k&&(r.propertyToPolyfillSymbol[d]=r.IS_SYMBOL_NATIVE?r.global.Symbol(d):r.POLYFILL_PREFIX+d,d=r.propertyToPolyfillSymbol[d],r.defineProperty(f,d,{configurable:!0, | ||
writable:!0,value:g})))};r.polyfill("Array.prototype.includes",function(b){return b?b:function(b,k){var d=this;d instanceof String&&(d=String(d));var f=d.length;k=k||0;for(0>k&&(k=Math.max(k+f,0));k<f;k++){var x=d[k];if(x===b||Object.is(x,b))return!0}return!1}},"es7","es3"); | ||
(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("dashboards/modules/dashboards-plugin",["dashboards"],function(g){b(g);b.Dashboards=g;return b}):b("undefined"!==typeof Dashboards?Dashboards:void 0)})(function(b){function g(b,d,f,x){b.hasOwnProperty(d)||(b[d]=x.apply(null,f),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("DashboardsModuleLoaded",{detail:{path:d,module:b[d]}})))}b=b?b._modules: | ||
{};g(b,"Dashboards/Plugins/DataGridSyncHandlers.js",[b["Core/Utilities.js"]],function(b){const {addEvent:d}=b;return{highlight:{emitter:["highlightEmitter",function(){if("DataGrid"===this.type){const {dataGrid:f,board:b}=this;if(b){const {dataCursor:y}=b,l=[];if(f)return l.push(d(f.container,"dataGridHover",a=>{const t=this.connector&&this.connector.table;if(t){a=a.row;const c=a.querySelector(`.highcharts-datagrid-cell[data-original-data="${a.dataset.rowXIndex}"]`);y.emitCursor(t,{type:"position", | ||
row:parseInt(a.dataset.rowIndex,10),column:c?c.dataset.columnName:void 0,state:"dataGrid.hoverRow"})}})),l.push(d(f.container,"mouseout",()=>{const a=this.connector&&this.connector.table;a&&y.emitCursor(a,{type:"position",state:"dataGrid.hoverOut"})})),function(){l.forEach(a=>a())}}}}],handler:["highlightHandler",void 0,function(){const {board:f}=this,b=a=>{a=a.cursor;if("position"===a.type){var {row:c}=a;({dataGrid:a}=this);void 0!==c&&a&&(c=a.container.querySelector(`.highcharts-datagrid-row[data-row-index="${c}"]`))&& | ||
(a.toggleRowHighlight(c),a.hoveredRow=c)}},d=()=>{const {dataGrid:a}=this;a&&a.toggleRowHighlight(void 0)},l=()=>{const {dataCursor:a}=f;if(a){var c=this.connector&&this.connector.table;c&&(a.addListener(c.id,"point.mouseOver",b),a.addListener(c.id,"point.mouseOut",d))}},a=()=>{const a=f.dataCursor,c=this.connector&&this.connector.table;c&&(a.addListener(c.id,"point.mouseOver",b),a.addListener(c.id,"point.mouseOut",d))};f&&(l(),this.on("setConnector",()=>a()),this.on("afterSetConnector",()=>l()))}]}, | ||
extremes:{handler:function(){const {board:b}=this,d=a=>{"position"===a.cursor.type&&this.dataGrid&&a.cursors.length&&(a=a.cursors[a.cursors.length-1],"row"in a&&"number"===typeof a.row&&({row:a}=a,this.dataGrid.scrollToRow(a)))},k=()=>{const {dataCursor:a}=b;if(a){var f=this.connector&&this.connector.table;f&&a.addListener(f.id,"xAxis.extremes.min",d)}},l=()=>{const a=this.connector&&this.connector.table,{dataCursor:f}=b;a&&f.removeListener(a.id,"xAxis.extremes.min",d)};b&&(k(),this.on("setConnector", | ||
()=>l()),this.on("afterSetConnector",()=>k()))}},visibility:{handler:function(){const b=this,{board:d}=b,k=a=>{a=a.cursor;const c=b.dataGrid;c&&"position"===a.type&&a.column&&c.update({columns:{[a.column]:{show:"series.hide"!==a.state}}})},l=()=>{const {dataCursor:a}=d;if(a){var c=this.connector&&this.connector.table;c&&(a.addListener(c.id,"series.show",k),a.addListener(c.id,"series.hide",k))}},a=()=>{const a=this.connector&&this.connector.table,{dataCursor:c}=d;a&&(c.removeListener(a.id,"series.show", | ||
k),c.removeListener(a.id,"series.hide",k))};d&&(l(),this.on("setConnector",()=>a()),this.on("afterSetConnector",()=>l()))}}}});g(b,"Dashboards/Plugins/DataGridComponent.js",[b["Dashboards/Components/Component.js"],b["Data/Converters/DataConverter.js"],b["Dashboards/Plugins/DataGridSyncHandlers.js"],b["Core/Utilities.js"]],function(b,d,f,x){var k=this&&this.__awaiter||function(a,b,c,f){function e(a){return a instanceof c?a:new c(function(e){e(a)})}return new (c||(c=Promise))(function(c,m){function h(h){try{B(f.next(h))}catch(C){m(C)}} | ||
function w(h){try{B(f["throw"](h))}catch(C){m(C)}}function B(a){a.done?c(a.value):e(a.value).then(h,w)}B((f=f.apply(a,b||[])).next())})};const {diffObjects:l,merge:a,uniqueKey:t}=x;class c extends b{static onUpdate(a,c){if(a=a.target){var e=a.closest(".highcharts-datagrid-row"),b=a.closest(".highcharts-datagrid-cell");const f=new d;e&&e instanceof HTMLElement&&b&&b instanceof HTMLElement&&(e=e.dataset.rowIndex,{columnName:b}=b.dataset,void 0!==e&&void 0!==b&&(c=c.table))&&(a=f.asGuessedType(a.value), | ||
a instanceof Date&&(a=a.toString()),c.setCell(b,parseInt(e,10),a))}}static fromJSON(e,b){const f=e.options,u=JSON.parse(e.options.dataGridOptions||"");b=new c(b,a(f,{dataGridOptions:u,syncHandlers:c.syncHandlers}));b.emit({type:"fromJSON",json:e});return b}constructor(e,u){u=a(c.defaultOptions,u);super(e,u);this.connectorListeners=[];this.options=u;this.type="DataGrid";this.options.dataGridClassName&&this.contentElement.classList.add(this.options.dataGridClassName);this.options.dataGridID&&(this.contentElement.id= | ||
this.options.dataGridID);this.filterAndAssignSyncOptions(f);this.sync=new c.Sync(this,this.syncHandlers);this.dataGridOptions=this.options.dataGridOptions||{};this.innerResizeTimeouts=[];this.on("afterSetConnector",a=>{this.disableEditingModifiedColumns(a.connector)});this.on("tableChanged",()=>{var a;this.dataGrid&&this.dataGrid.cellInputEl||(null===(a=this.dataGrid)||void 0===a?void 0:a.update({dataTable:this.filterColumns()}))});b.addInstance(this)}disableEditingModifiedColumns(a){var e;if((a= | ||
a.options.dataModifier)&&"Math"===a.type&&(a=a.columnFormulas)){var b={};for(let e=0,c=a.length;e<c;++e)b[a[e].column]={editable:!1};null===(e=this.dataGrid)||void 0===e?void 0:e.update({columns:b})}}load(){this.emit({type:"load"});super.load();this.parentElement.appendChild(this.element);this.hasLoaded=!0;if(this.connector&&!this.connectorListeners.length){const a=this.connectorListeners;a.push(this.connector.on("afterLoad",a=>{a.table&&this.connector&&this.connector.table.setColumns(a.table.getColumns())})); | ||
a.push(this.connector.table.on("afterSetCell",a=>{var e=this.dataGrid;let b=!0;if(e){e=e.rowElements[a.rowIndex];let c=[];e&&(c=Array.prototype.slice.call(e.childNodes));c.forEach(e=>{if(0<e.childElementCount){var c=e.childNodes[0];c="string"===typeof a.cellValue?c.value:+c.value;e.dataset.columnName===a.columnName&&c===a.cellValue&&(b=!1)}})}b?this.update({}):void 0}))}this.emit({type:"afterLoad"});return this}render(){this.emit({type:"beforeRender"});super.render();this.dataGrid||(this.dataGrid= | ||
this.constructDataGrid());this.connector&&this.dataGrid&&this.dataGrid.dataTable.modified!==this.connector.table.modified&&this.dataGrid.update({dataTable:this.filterColumns()});this.sync.start();this.emit({type:"afterRender"});this.setupConnectorUpdate();return this}redraw(){super.redraw();return this.render()}resize(a,b){this.dataGrid&&(super.resize(a,b),this.dataGrid.setSize(a,b))}update(a){const e=Object.create(null,{update:{get:()=>super.update}});var b;return k(this,void 0,void 0,function*(){if((null=== | ||
(b=a.connector)||void 0===b?void 0:b.id)!==this.connectorId){const a=this.connectorListeners;for(let e=0,b=a.length;e<b;++e)a[e]();a.length=0}yield e.update.call(this,a);this.dataGrid&&(this.filterAndAssignSyncOptions(f),this.dataGrid.update(this.options.dataGridOptions||{}));this.emit({type:"afterUpdate"})})}constructDataGrid(){if(c.DataGridConstructor)return this.dataGrid=new c.DataGridConstructor(this.contentElement,Object.assign(Object.assign({},this.options.dataGridOptions),{dataTable:this.connector&& | ||
this.connector.table.modified}));throw Error("DataGrid not connected.");}setupConnectorUpdate(){const {connector:a,dataGrid:b}=this;if(a&&b)b.on("cellClick",e=>{"input"in e&&e.input.addEventListener("keyup",e=>this.options.onUpdate(e,a))})}filterColumns(){var a,b=null===(a=this.connector)||void 0===a?void 0:a.table.modified;const c=this.options.visibleColumns;if(b){if(null===c||void 0===c||!c.length)return b;a=b.getColumnNames().filter(a=>0<(null===c||void 0===c?void 0:c.length)&&!c.includes(a)); | ||
b=b.clone();b.deleteColumns(a);return b}}toJSON(){var a=JSON.stringify(this.options.dataGridOptions);const b=super.toJSON();a=Object.assign(Object.assign({},b),{options:Object.assign(Object.assign({},b.options),{dataGridOptions:a})});this.emit({type:"toJSON",json:a});return a}getOptions(){return Object.assign(Object.assign({},l(this.options,c.defaultOptions)),{type:"DataGrid"})}}c.syncHandlers=f;c.defaultOptions=a(b.defaultOptions,{dataGridClassName:"dataGrid-container",dataGridID:"dataGrid-"+t(), | ||
dataGridOptions:{},editableOptions:[{name:"connectorName",propertyPath:["connector","id"],type:"select"}],syncHandlers:f,onUpdate:c.onUpdate});return c});g(b,"Dashboards/Plugins/DataGridPlugin.js",[b["Dashboards/Plugins/DataGridComponent.js"]],function(b){return{custom:{connectDataGrid:function(d){b.DataGridConstructor=d}},name:"DataGrid.DashboardsPlugin",onRegister:function(d){({ComponentRegistry:d}=d);d.registerComponent("DataGrid",b)},onUnregister:function(){}}});g(b,"Dashboards/Plugins/HighchartsSyncHandlers.js", | ||
[b["Core/Utilities.js"]],function(b){const {addEvent:d}=b;return{extremes:{emitter:function(){if("Highcharts"===this.type){const b=this,k=[];this.on("afterRender",()=>{const {chart:f,connector:l,board:a}=b,t=l&&l.table,{dataCursor:c}=a;if(t&&f){const a=a=>{var b=!!a.resetSelection;if((!a.trigger||a.trigger&&"dashboards-sync"!==a.trigger)&&!b){var e=a.target;const h=e.series.filter(a=>t.hasColumns([a.name])),[w]=h.length?h:e.series;if(w){b=w.points.filter(a=>a.isInside||!1);const f={type:"position", | ||
state:`${e.coll}.extremes.min`},m={type:"position",state:`${e.coll}.extremes.max`};h.length&&"xAxis"===e.coll&&b.length&&(e=e.dateTime&&t.hasColumns(["x"])?"x":w.name,f.row=b[0].index,f.column=e,m.row=b[b.length-1].index,m.column=e);c.emitCursor(t,f,a,!0).emitCursor(t,m,a,!0)}}},b=()=>f.axes.map(b=>d(b,"afterSetExtremes",a));let l=b();const y=()=>{l.forEach(a=>{a()});l=[]};k.push(d(f,"selection",a=>{a.resetSelection&&(y(),c.emitCursor(t,{type:"position",state:"chart.zoomOut"},a),l.push(...b()))})); | ||
k.push(()=>{c.remitCursor(t.id,{type:"position",state:"xAxis.extremes.min"});c.remitCursor(t.id,{type:"position",state:"xAxis.extremes.max"});y()})}});return function(){k.forEach(b=>b())}}},handler:function(){const {chart:b,board:d}=this;b&&d&&["xAxis","yAxis"].forEach(f=>{const l=[],a=a=>{const {cursor:e,event:c}=a;if("position"===e.type){const a=c&&c.target;if(a&&b){let e=!1;b[f].forEach(b=>{a.coll===b.coll&&a!==b&&null!==a.min&&null!==a.max&&b.max!==a.max&&b.min!==a.min&&(b.setExtremes(a.min,a.max, | ||
!1,void 0,{trigger:"dashboards-sync"}),e=!0)});e&&!b.resetZoomButton&&b.showResetZoom();b.redraw()}}},k=()=>{const {dataCursor:e}=d,{connector:c}=this;if(c){const {table:d}=c;e.addListener(d.id,`${f}.extremes.min`,a);e.addListener(d.id,`${f}.extremes.max`,a);const k=()=>{b.zoomOut();setTimeout(()=>{this.element.querySelectorAll(".highcharts-reset-zoom").forEach(a=>{a.remove()})})};e.addListener(d.id,"chart.zoomOut",k);l.push(()=>{e.removeListener(d.id,`${f}.extremes.min`,a);e.removeListener(d.id, | ||
`${f}.extremes.max`,a);e.removeListener(d.id,"chart.zoomOut",k)})}},c=()=>{l.forEach(a=>a())};d&&(k(),this.on("setConnector",()=>c()),this.on("afterSetConnector",()=>k()))})}},highlight:{emitter:["highlightEmitter",function(){if("Highcharts"===this.type){const {chart:b,board:d}=this;if(d){const {dataCursor:f}=d;this.on("afterRender",()=>{const d=this.connector&&this.connector.table;b&&b.series&&d&&b.series.forEach(a=>{a.update({point:{events:{mouseOver:function(){let b=0;const c=d.getModifier();c&& | ||
"getModifiedTableOffset"in c&&(b=c.getModifiedTableOffset(d));f.emitCursor(d,{type:"position",row:b+this.index,column:a.name,state:"point.mouseOver"})},mouseOut:function(){let b=0;const c=d.getModifier();c&&"getModifiedTableOffset"in c&&(b=c.getModifiedTableOffset(d));f.emitCursor(d,{type:"position",row:b+this.index,column:a.name,state:"point.mouseOut"})}}}})})});return function(){b&&b.series&&b.series.forEach(b=>{b.update({point:{events:{mouseOver:void 0,mouseOut:void 0}}})})}}}}],handler:function(){const {chart:b, | ||
board:d}=this,k=a=>{const e=this.connector&&this.connector.table;if(e){var c=0,d=e.getModifier();d&&"getModifiedTableOffset"in d&&(c=d.getModifiedTableOffset(e));if(b&&b.series.length){const e=a.cursor;"position"===e.type&&([a]=1<b.series.length&&e.column?b.series.filter(a=>a.name===e.column):b.series,a&&a.visible&&void 0!==e.row&&(c=a.points[e.row-c])&&b.tooltip&&b.tooltip.refresh(c))}}},l=()=>{b&&b.series.length&&b.tooltip&&b.tooltip.hide()},a=()=>{const {dataCursor:a}=d;if(a){const b=this.connector&& | ||
this.connector.table;b&&(a.addListener(b.id,"point.mouseOver",k),a.addListener(b.id,"dataGrid.hoverRow",k),a.addListener(b.id,"point.mouseOut",l),a.addListener(b.id,"dataGrid.hoverOut",l))}},t=()=>{const a=this.connector&&this.connector.table;a&&(d.dataCursor.removeListener(a.id,"point.mouseOver",k),d.dataCursor.removeListener(a.id,"dataGrid.hoverRow",k),d.dataCursor.removeListener(a.id,"point.mouseOut",l),d.dataCursor.removeListener(a.id,"dataGrid.hoverOut",l))};d&&(a(),this.on("setConnector",()=> | ||
t()),this.on("afterSetConnector",()=>a()))}},visibility:{emitter:function(){if("Highcharts"===this.type){const b=this;return this.on("afterRender",()=>{const {chart:d,connector:f,board:k}=b,a=f&&f.table;if(a&&k&&d){const {dataCursor:b}=k,{series:c}=d;c.forEach(e=>{e.update({events:{show:function(){b.emitCursor(a,{type:"position",state:"series.show",column:this.name})},hide:function(){b.emitCursor(a,{type:"position",state:"series.hide",column:this.name})}}})})}})}},handler:function(){const b=this, | ||
{board:d}=this,k=(a,b)=>{for(const e of a)if(e.name===b)return e},l=a=>{const e=b.chart;e&&"position"===a.cursor.type&&void 0!==a.cursor.column&&(a=k(e.series,a.cursor.column))&&a.setVisible(!0,!0)},a=a=>{const e=b.chart;e&&"position"===a.cursor.type&&void 0!==a.cursor.column&&(a=k(e.series,a.cursor.column))&&a.setVisible(!1,!0)},t=()=>{const {dataCursor:b}=d;if(b){var c=this.connector&&this.connector.table;c&&(b.addListener(c.id,"series.show",l),b.addListener(c.id,"series.hide",a))}},c=()=>{const b= | ||
this.connector&&this.connector.table;b&&(d.dataCursor.removeListener(b.id,"series.show",l),d.dataCursor.removeListener(b.id,"series.hide",a))};d&&(t(),this.on("setConnector",()=>c()),this.on("afterSetConnector",()=>t()))}}}});g(b,"Dashboards/Plugins/HighchartsComponent.js",[b["Dashboards/Components/Component.js"],b["Data/Converters/DataConverter.js"],b["Data/DataTable.js"],b["Dashboards/Globals.js"],b["Dashboards/Plugins/HighchartsSyncHandlers.js"],b["Core/Utilities.js"]],function(b,d,f,g,y,l){var a= | ||
this&&this.__awaiter||function(a,b,c,e){function h(a){return a instanceof c?a:new c(function(b){b(a)})}return new (c||(c=Promise))(function(c,d){function w(a){try{C(e.next(a))}catch(q){d(q)}}function m(a){try{C(e["throw"](a))}catch(q){d(q)}}function C(a){a.done?c(a.value):h(a.value).then(w,m)}C((e=e.apply(a,b||[])).next())})};const {addEvent:k,createElement:c,merge:e,splat:u,uniqueKey:x,error:p,diffObjects:A,defined:n}=l;class m extends b{static fromJSON(a,b){const h=a.options,c=JSON.parse(a.options.chartOptions|| | ||
"{}");b=new m(b,e(h,{chartOptions:c,syncHandlers:m.syncHandlers}));b.emit({type:"fromJSON",json:a});return b}constructor(a,d){d=e(m.defaultOptions,d);super(a,d);this.options=d;this.chartConstructor=this.options.chartConstructor;this.type="Highcharts";this.chartContainer=c("figure",void 0,void 0,void 0,!0);this.setOptions();this.sync=new m.Sync(this,this.syncHandlers);this.chartOptions=e(this.options.chartOptions||{chart:{}},{tooltip:{}});this.on("tableChanged",()=>this.updateSeries());if(this.connector)this.connector.on("afterLoad", | ||
a=>{a.table&&this.connector&&this.connector.table.setColumns(a.table.getColumns())});this.innerResizeTimeouts=[];b.addInstance(this)}load(){this.emit({type:"load"});super.load();this.parentElement.appendChild(this.element);this.contentElement.appendChild(this.chartContainer);this.hasLoaded=!0;this.emit({type:"afterLoad"});return this}render(){this.emit({type:"beforeRender"});super.render();this.chart=this.getChart();this.updateSeries();this.sync.start();this.emit({type:"afterRender"});this.setupConnectorUpdate(); | ||
return this}resize(a,b){for(super.resize(a,b);this.innerResizeTimeouts.length;)(a=this.innerResizeTimeouts.pop())&&clearTimeout(a);this.innerResizeTimeouts.push(setTimeout(()=>{this.chart&&this.chart.setSize(null,this.contentElement.clientHeight,!1)},33));return this}setupConnectorUpdate(){const {connector:a,chart:b}=this;a&&b&&this.options.allowConnectorUpdate&&b.series.forEach(b=>{b.points.forEach(b=>{k(b,"drag",()=>{this.onChartUpdate(b,a)})})})}setOptions(){this.options.chartClassName&&this.chartContainer.classList.add(this.options.chartClassName); | ||
this.options.chartID&&(this.chartContainer.id=this.options.chartID);this.filterAndAssignSyncOptions(y)}onChartUpdate(a,b){b=b.table;const h=a.series.name,c=a.index;a=(new d).asNumber(a.y);b.setCell(h,c,a)}update(b,c=!0){const h=Object.create(null,{update:{get:()=>super.update}});return a(this,void 0,void 0,function*(){yield h.update.call(this,b,!1);this.setOptions();this.chart&&this.chart.update(e(this.options.chartOptions)||{});this.emit({type:"afterUpdate"});c&&this.redraw()})}updateSeries(){var a; | ||
if(this.chart&&this.connector){this.presentationTable=this.presentationModifier?this.connector.table.modified.clone():this.connector.table;const {id:b}=this.connector.table,{chart:c}=this,h=this.options.columnAssignment||{},e={};this.presentationModifier&&(this.presentationTable=this.presentationModifier.modifyTable(this.presentationTable).modified);const d=this.presentationTable,m=null===(a=d.getModifier())||void 0===a?void 0:a.options;this.emit({type:"afterPresentationModifier",table:d});const k= | ||
d.modified.getColumnNames().filter(a=>{const b=this.activeGroup?!1!==this.activeGroup.getSharedState().getColumnVisibility(a):!0;return n(this.options.columnAssignment)?b&&h[a]?"x"===h[a]?(e[a]=a,!1):!0:!1:!0});k.map((a,h)=>{for(var e,d=0;d<c.series.length;){const a=c.series[d],e=a.options.id===`${b}-series-${h}`,m=-1!==k.indexOf(a.name);d++;if(m&&e)return a;!m&&e&&a.destroy()}d=!("Math"===(null===m||void 0===m?void 0:m.type)&&(null===(e=m.columnFormulas)||void 0===e?0:e.some(b=>b.column===a)));return c.addSeries({name:a, | ||
id:`${b}-series-${h}`,dragDrop:{draggableY:d}},!1)}).forEach(a=>{var b=Object.keys(e)[0];const c=new f({columns:d.modified.getColumns([b,a.name])});c.renameColumn(a.name,"y");b&&c.renameColumn(b,"x");b=c.getRowObjects().reduce((a,b)=>{a.push([b.x,b.y]);return a},[]);a.setData(b)})}}getChart(){return this.chart||this.createChart()}createChart(){const a=m.charter||g.win.Highcharts;if("chart"!==this.chartConstructor){const b=a[this.chartConstructor];if(b)try{return b(this.chartContainer,this.chartOptions)}catch(B){p("The Highcharts component is misconfigured: `"+ | ||
this.cell.id+"`")}}if("function"!==typeof a.chart)throw Error("Chart constructor not found");return this.chart=a.chart(this.chartContainer,this.chartOptions)}registerChartEvents(){if(this.chart&&this.chart.options){const a=this.chart.options;"chart series yAxis xAxis colorAxis annotations navigation".split(" ").map(b=>{let c=a[b]||{};!Array.isArray(c)&&c.events&&(c=[c]);return c&&"object"===typeof c&&Array.isArray(c)?c.reduce((a,c,e)=>{c&&c.events&&(a[c.id||`${b}-${e}`]=c.events);return a},{})||{}: | ||
{}}).forEach(a=>{Object.keys(a).forEach(b=>{const c=a[b];Object.keys(c).forEach(a=>{this.callbackRegistry.addCallback(`${b}-${a}`,{type:"seriesEvent",func:c[a]})})})})}}setConnector(a){var b;const c=this.chart;if(this.connector&&c&&c.series&&this.connector.table.id!==(null===a||void 0===a?void 0:a.table.id)){const a=this.connector.table.id;for(let e=c.series.length-1;0<=e;e--){const d=c.series[e];-1!==(null===(b=d.options.id)||void 0===b?void 0:b.indexOf(a))&&d.remove(!1)}}super.setConnector(a);return this}toJSON(){var a= | ||
JSON.stringify(this.options.chartOptions);const b=this.options.chartConstructor;this.registerChartEvents();const c=super.toJSON();a=Object.assign(Object.assign({},c),{type:"Highcharts",options:Object.assign(Object.assign({},c.options),{chartOptions:a,chartConstructor:b,type:"Highcharts",sync:{}})});this.emit({type:"toJSON",json:a});return a}getOptions(){return Object.assign(Object.assign({},A(this.options,m.defaultOptions)),{type:"Highcharts"})}getEditableOptions(){var a;const b=this.options,c=this.chart, | ||
d=c&&c.options,m=d&&(null===(a=d.chart)||void 0===a?void 0:a.type)||"line";return e(b,{chartOptions:d},{chartOptions:{yAxis:u(c&&c.yAxis[0].options),xAxis:u(c&&c.xAxis[0].options),plotOptions:{series:(d&&d.plotOptions||{})[m]}}})}getEditableOptionValue(a){if(a)return 1===a.length&&"chartOptions"===a[0]?JSON.stringify(this.options.chartOptions,null,2):super.getEditableOptionValue.call(this,a)}}m.syncHandlers=y;m.defaultOptions=e(b.defaultOptions,{allowConnectorUpdate:!0,chartClassName:"chart-container", | ||
chartID:"chart-"+x(),chartOptions:{chart:{styledMode:!0},series:[]},chartConstructor:"",editableOptions:(b.defaultOptions.editableOptions||[]).concat([{name:"chartOptions",type:"nested",nestedOptions:[{name:"chart",options:[{name:"title",propertyPath:["chartOptions","title","text"],type:"input"},{name:"subtitle",propertyPath:["chartOptions","subtitle","text"],type:"input"},{name:"type",propertyPath:["chartOptions","chart","type"],type:"select",selectOptions:[{name:"column",iconURL:"series-types/icon-column.svg"}, | ||
{name:"line",iconURL:"series-types/icon-line.svg"},{name:"scatter",iconURL:"series-types/icon-scatter.svg"},{name:"pie",iconURL:"series-types/icon-pie.svg"}]}]},{name:"xAxis",options:[{name:"title",propertyPath:["chartOptions","xAxis","title","text"],type:"input"},{name:"type",propertyPath:["chartOptions","xAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"yAxis",options:[{name:"title",propertyPath:["chartOptions","yAxis","title","text"], | ||
type:"input"},{name:"type",propertyPath:["chartOptions","yAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"legend",showToggle:!0,propertyPath:["chartOptions","legend","enabled"],options:[{name:"align",propertyPath:["chartOptions","legend","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"tooltip",showToggle:!0,propertyPath:["chartOptions","tooltip","enabled"],options:[{name:"split",propertyPath:["chartOptions", | ||
"tooltip","split"],type:"toggle"}]},{name:"dataLabels",propertyPath:["chartOptions","plotOptions","series","dataLabels","enabled"],showToggle:!0,options:[{name:"align",propertyPath:["chartOptions","plotOptions","series","dataLabels","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"credits",showToggle:!0,propertyPath:["chartOptions","credits","enabled"],options:[{name:"name",propertyPath:["chartOptions","credits","text"],type:"input"},{name:"url",propertyPath:["chartOptions", | ||
"credits","href"],type:"input"}]}]},{name:"chartConfig",propertyPath:["chartOptions"],type:"textarea"},{name:"chartClassName",propertyPath:["chartClassName"],type:"input"},{name:"chartID",propertyPath:["chartID"],type:"input"}]),syncHandlers:y,editableOptionsBindings:e(b.defaultOptions.editableOptionsBindings,{skipRedraw:["chartOptions","chartConfig"]}),columnAssignment:void 0});return m});g(b,"Core/Chart/ChartDefaults.js",[],function(){return{alignThresholds:!1,panning:{enabled:!1,type:"x"},styledMode:!1, | ||
borderRadius:0,colorCount:10,allowMutatingData:!0,ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},reflow:!0,type:"line",zooming:{singleTouch:!1,resetButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}}},width:null,height:null,borderColor:"#334eff",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"}});g(b,"Core/Color/Color.js",[b["Core/Globals.js"],b["Core/Utilities.js"]],function(b,d){const {isNumber:f,merge:k,pInt:g}=d; | ||
class l{static parse(a){return a?new l(a):l.None}constructor(a){this.rgba=[NaN,NaN,NaN,NaN];this.input=a;const d=b.Color;if(d&&d!==l)return new d(a);this.init(a)}init(a){let b;let c;if("object"===typeof a&&"undefined"!==typeof a.stops)this.stops=a.stops.map(a=>new l(a[1]));else if("string"===typeof a){this.input=a=l.names[a.toLowerCase()]||a;if("#"===a.charAt(0)){var d=a.length;var f=parseInt(a.substr(1),16);7===d?b=[(f&16711680)>>16,(f&65280)>>8,f&255,1]:4===d&&(b=[(f&3840)>>4|(f&3840)>>8,(f&240)>> | ||
4|f&240,(f&15)<<4|f&15,1])}if(!b)for(f=l.parsers.length;f--&&!b;)c=l.parsers[f],(d=c.regex.exec(a))&&(b=c.parse(d))}b&&(this.rgba=b)}get(a){const b=this.input,c=this.rgba;if("object"===typeof b&&"undefined"!==typeof this.stops){const c=k(b);c.stops=[].slice.call(c.stops);this.stops.forEach((b,d)=>{c.stops[d]=[c.stops[d][0],b.get(a)]});return c}return c&&f(c[0])?"rgb"===a||!a&&1===c[3]?"rgb("+c[0]+","+c[1]+","+c[2]+")":"a"===a?`${c[3]}`:"rgba("+c.join(",")+")":b}brighten(a){const b=this.rgba;if(this.stops)this.stops.forEach(function(b){b.brighten(a)}); | ||
else if(f(a)&&0!==a)for(let c=0;3>c;c++)b[c]+=g(255*a),0>b[c]&&(b[c]=0),255<b[c]&&(b[c]=255);return this}setOpacity(a){this.rgba[3]=a;return this}tweenTo(a,b){const c=this.rgba,d=a.rgba;if(!f(c[0])||!f(d[0]))return a.input||"none";a=1!==d[3]||1!==c[3];return(a?"rgba(":"rgb(")+Math.round(d[0]+(c[0]-d[0])*(1-b))+","+Math.round(d[1]+(c[1]-d[1])*(1-b))+","+Math.round(d[2]+(c[2]-d[2])*(1-b))+(a?","+(d[3]+(c[3]-d[3])*(1-b)):"")+")"}}l.names={white:"#ffffff",black:"#000000"};l.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/, | ||
parse:function(a){return[g(a[1]),g(a[2]),g(a[3]),parseFloat(a[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(a){return[g(a[1]),g(a[2]),g(a[3]),1]}}];l.None=new l("");"";return l});g(b,"Core/Color/Palettes.js",[],function(){return{colors:"#2caffe #544fc5 #00e272 #fe6a35 #6b8abc #d568fb #2ee0ca #fa4b42 #feb56a #91e8e1".split(" ")}});g(b,"Core/Time.js",[b["Core/Globals.js"],b["Core/Utilities.js"]],function(b,d){const {win:f}=b,{defined:k,error:g,extend:l, | ||
isObject:a,merge:t,objectEach:c,pad:e,pick:u,splat:z,timeUnits:p}=d,A=b.isSafari&&f.Intl&&f.Intl.DateTimeFormat.prototype.formatRange,n=b.isSafari&&f.Intl&&!f.Intl.DateTimeFormat.prototype.formatRange;class m{constructor(a){this.options={};this.variableTimezone=this.useUTC=!1;this.Date=f.Date;this.getTimezoneOffset=this.timezoneOffsetFunction();this.update(a)}get(a,b){if(this.variableTimezone||this.timezoneOffset){const c=b.getTime(),d=c-this.getTimezoneOffset(b);b.setTime(d);a=b["getUTC"+a]();b.setTime(c); | ||
return a}return this.useUTC?b["getUTC"+a]():b["get"+a]()}set(a,b,c){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===a||"Seconds"===a||"Minutes"===a&&0===this.getTimezoneOffset(b)%36E5)return b["setUTC"+a](c);var d=this.getTimezoneOffset(b);d=b.getTime()-d;b.setTime(d);b["setUTC"+a](c);a=this.getTimezoneOffset(b);d=b.getTime()+a;return b.setTime(d)}return this.useUTC||A&&"FullYear"===a?b["setUTC"+a](c):b["set"+a](c)}update(a={}){const b=u(a.useUTC,!0);this.options=a=t(!0,this.options, | ||
a);this.Date=a.Date||f.Date||Date;this.timezoneOffset=(this.useUTC=b)&&a.timezoneOffset||void 0;this.getTimezoneOffset=this.timezoneOffsetFunction();this.variableTimezone=b&&!(!a.getTimezoneOffset&&!a.timezone)}makeTime(a,b,c,d,e,m){let f,h,k;this.useUTC?(f=this.Date.UTC.apply(0,arguments),h=this.getTimezoneOffset(f),f+=h,k=this.getTimezoneOffset(f),h!==k?f+=k-h:h-36E5!==this.getTimezoneOffset(f-36E5)||n||(f-=36E5)):f=(new this.Date(a,b,u(c,1),u(d,0),u(e,0),u(m,0))).getTime();return f}timezoneOffsetFunction(){const a= | ||
this,b=this.options,c=b.getTimezoneOffset,d=b.moment||f.moment;if(!this.useUTC)return function(a){return 6E4*(new Date(a.toString())).getTimezoneOffset()};if(b.timezone){if(d)return function(a){return 6E4*-d.tz(a,b.timezone).utcOffset()};g(25)}return this.useUTC&&c?function(a){return 6E4*c(a.valueOf())}:function(){return 6E4*(a.timezoneOffset||0)}}dateFormat(a,d,m){if(!k(d)||isNaN(d))return b.defaultOptions.lang&&b.defaultOptions.lang.invalidDate||"";a=u(a,"%Y-%m-%d %H:%M:%S");const f=this;var h= | ||
new this.Date(d);const n=this.get("Hours",h),w=this.get("Day",h),g=this.get("Date",h),B=this.get("Month",h),G=this.get("FullYear",h),p=b.defaultOptions.lang,q=p&&p.weekdays,t=p&&p.shortWeekdays;h=l({a:t?t[w]:q[w].substr(0,3),A:q[w],d:e(g),e:e(g,2," "),w,b:p.shortMonths[B],B:p.months[B],m:e(B+1),o:B+1,y:G.toString().substr(2,2),Y:G,H:e(n),k:n,I:e(n%12||12),l:n%12||12,M:e(this.get("Minutes",h)),p:12>n?"AM":"PM",P:12>n?"am":"pm",S:e(h.getSeconds()),L:e(Math.floor(d%1E3),3)},b.dateFormats);c(h,function(b, | ||
c){for(;-1!==a.indexOf("%"+c);)a=a.replace("%"+c,"function"===typeof b?b.call(f,d):b)});return m?a.substr(0,1).toUpperCase()+a.substr(1):a}resolveDTLFormat(b){return a(b,!0)?b:(b=z(b),{main:b[0],from:b[1],to:b[2]})}getTimeTicks(a,b,c,d){const e=this,m=[],f={};var h=new e.Date(b);const n=a.unitRange,g=a.count||1;let w;d=u(d,1);if(k(b)){e.set("Milliseconds",h,n>=p.second?0:g*Math.floor(e.get("Milliseconds",h)/g));n>=p.second&&e.set("Seconds",h,n>=p.minute?0:g*Math.floor(e.get("Seconds",h)/g));n>=p.minute&& | ||
e.set("Minutes",h,n>=p.hour?0:g*Math.floor(e.get("Minutes",h)/g));n>=p.hour&&e.set("Hours",h,n>=p.day?0:g*Math.floor(e.get("Hours",h)/g));n>=p.day&&e.set("Date",h,n>=p.month?1:Math.max(1,g*Math.floor(e.get("Date",h)/g)));if(n>=p.month){e.set("Month",h,n>=p.year?0:g*Math.floor(e.get("Month",h)/g));var q=e.get("FullYear",h)}n>=p.year&&e.set("FullYear",h,q-q%g);n===p.week&&(q=e.get("Day",h),e.set("Date",h,e.get("Date",h)-q+d+(q<d?-7:0)));q=e.get("FullYear",h);d=e.get("Month",h);const a=e.get("Date", | ||
h),l=e.get("Hours",h);b=h.getTime();!e.variableTimezone&&e.useUTC||!k(c)||(w=c-b>4*p.month||e.getTimezoneOffset(b)!==e.getTimezoneOffset(c));b=h.getTime();for(h=1;b<c;)m.push(b),b=n===p.year?e.makeTime(q+h*g,0):n===p.month?e.makeTime(q,d+h*g):!w||n!==p.day&&n!==p.week?w&&n===p.hour&&1<g?e.makeTime(q,d,a,l+h*g):b+n*g:e.makeTime(q,d,a+h*g*(n===p.day?1:7)),h++;m.push(b);n<=p.hour&&1E4>m.length&&m.forEach(function(a){0===a%18E5&&"000000000"===e.dateFormat("%H%M%S%L",a)&&(f[a]="day")})}m.info=l(a,{higherRanks:f, | ||
totalRange:n*g});return m}getDateFormat(a,b,c,d){const e=this.dateFormat("%m-%d %H:%M:%S.%L",b),m={millisecond:15,second:12,minute:9,hour:6,day:3};let f,h="millisecond";for(f in p){if(a===p.week&&+this.dateFormat("%w",b)===c&&"00:00:00.000"===e.substr(6)){f="week";break}if(p[f]>a){f=h;break}if(m[f]&&e.substr(m[f])!=="01-01 00:00:00.000".substr(m[f]))break;"week"!==f&&(h=f)}return this.resolveDTLFormat(d[f]).main}}"";return m});g(b,"Core/Defaults.js",[b["Core/Chart/ChartDefaults.js"],b["Core/Color/Color.js"], | ||
b["Core/Globals.js"],b["Core/Color/Palettes.js"],b["Core/Time.js"],b["Core/Utilities.js"]],function(b,d,f,g,y,l){const {isTouchDevice:a,svg:k}=f,{merge:c}=l,e={colors:g.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), | ||
decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:b,title:{style:{color:"#333333",fontWeight:"bold"},text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{style:{color:"#666666",fontSize:"0.8em"},text:"",align:"center",widthAdjust:-44},caption:{margin:15,style:{color:"#666666",fontSize:"0.8em"},text:"", | ||
align:"left",verticalAlign:"bottom"},plotOptions:{},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",itemMarginBottom:2,itemMarginTop:2,labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{style:{fontSize:"0.8em"},activeColor:"#0022ff",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"0.8em",textDecoration:"none",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#666666", | ||
textDecoration:"line-through"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontSize:"0.8em",fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:g,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %e %b, %H:%M:%S.%L",second:"%A, %e %b, %H:%M:%S", | ||
minute:"%A, %e %b, %H:%M",hour:"%A, %e %b, %H:%M",day:"%A, %e %b %Y",week:"Week from %A, %e %b %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:b?25:10,headerFormat:'<span style="font-size: 0.8em">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:"#ffffff",borderWidth:void 0,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default", | ||
fontSize:"0.8em"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"0.6em"},text:"Highcharts.com"}};d.chart.styledMode=!1;"";const u=new y(d.time);a={defaultOptions:d,defaultTime:u,getOptions:function(){return d},setOptions:function(a){e(!0,d,a);if(a.time||a.global)f.time?f.time.update(e(d.global,d.time,a.global,a.time)):f.time=u;return d}};"";return a});k(a,"Core/Templating.js", | ||
[a["Core/Defaults.js"],a["Core/Utilities.js"]],function(a,c){function f(a="",b,c){const d=/\{([a-zA-Z0-9:\.,;\-\/<>%_@"'= #\(\)]+)\}/g,h=/\(([a-zA-Z0-9:\.,;\-\/<>%_@"'= ]+)\)/g,e=[],l=/f$/,n=/\.([0-9])/,p=g.lang,u=c&&c.time||m,x=c&&c.numberFormatter||k,y=(a="")=>{let c;return"true"===a?!0:"false"===a?!1:(c=Number(a)).toString()===a?c:v(a,b)};let t,q,E=0,H;for(;null!==(t=d.exec(a));){const c=h.exec(t[1]);c&&(t=c,H=!0);q&&q.isBlock||(q={ctx:b,expression:t[1],find:t[0],isBlock:"#"===t[1].charAt(0),start:t.index, | ||
startInner:t.index+t[0].length,length:t[0].length});var B=t[1].split(" ")[0].replace("#","");z[B]&&(q.isBlock&&B===q.fn&&E++,q.fn||(q.fn=B));B="else"===t[1];if(q.isBlock&&q.fn&&(t[1]===`/${q.fn}`||B))if(E)B||E--;else{var C=q.startInner;C=a.substr(C,t.index-C);void 0===q.body?(q.body=C,q.startInner=t.index+t[0].length):q.elseBody=C;q.find+=C+t[0];B||(e.push(q),q=void 0)}else q.isBlock||e.push(q);if(c&&(null===q||void 0===q||!q.isBlock))break}e.forEach(c=>{const {body:d,elseBody:h,expression:e,fn:k}= | ||
c;var g;if(k){var m=[c],w=e.split(" ");for(g=z[k].length;g--;)m.unshift(y(w[g+1]));g=z[k].apply(b,m);c.isBlock&&"boolean"===typeof g&&(g=f(g?d:h,b))}else m=e.split(":"),g=y(m.shift()||""),m.length&&"number"===typeof g&&(m=m.join(":"),l.test(m)?(w=parseInt((m.match(n)||["","-1"])[1],10),null!==g&&(g=x(g,w,p.decimalPoint,-1<m.indexOf(",")?p.thousandsSep:""))):g=u.dateFormat(m,g));a=a.replace(c.find,D(g,""))});return H?f(a,b,c):a}function k(a,b,c,e){a=+a||0;b=+b;const h=g.lang;var l=(a.toString().split(".")[1]|| | ||
"").split("e")[0].length;const f=a.toString().split("e"),k=b;if(-1===b)b=Math.min(l,20);else if(!d(b))b=2;else if(b&&f[1]&&0>f[1]){var n=b+ +f[1];0<=n?(f[0]=(+f[0]).toExponential(n).split("e")[0],b=n):(f[0]=f[0].split(".")[0]||0,a=20>b?(f[0]*Math.pow(10,f[1])).toFixed(b):0,f[1]=0)}n=(Math.abs(f[1]?f[0]:a)+Math.pow(10,-Math.max(b,l)-1)).toFixed(b);l=String(p(n));const m=3<l.length?l.length%3:0;c=D(c,h.decimalPoint);e=D(e,h.thousandsSep);a=(0>a?"-":"")+(m?l.substr(0,m)+e:"");a=0>+f[1]&&!k?"0":a+l.substr(m).replace(/(\d{3})(?=\d)/g, | ||
"$1"+e);b&&(a+=c+n.slice(-b));f[1]&&0!==+a&&(a+="e"+f[1]);return a}const {defaultOptions:g,defaultTime:m}=a,{extend:b,getNestedProperty:v,isArray:e,isNumber:d,isObject:u,pick:D,pInt:p}=c,z={add:(a,b)=>a+b,divide:(a,b)=>0!==b?a/b:"",eq:(a,b)=>a==b,each:function(a){const c=arguments[arguments.length-1];return e(a)?a.map((d,h)=>f(c.body,b(u(d)?d:{"@this":d},{"@index":h,"@first":0===h,"@last":h===a.length-1}))).join(""):!1},ge:(a,b)=>a>=b,gt:(a,b)=>a>b,"if":a=>!!a,le:(a,b)=>a<=b,lt:(a,b)=>a<b,multiply:(a, | ||
b)=>a*b,ne:(a,b)=>a!=b,subtract:(a,b)=>a-b,unless:a=>!a};return{dateFormat:function(a,b,c){return m.dateFormat(a,b,c)},format:f,helpers:z,numberFormat:k}});k(a,"Dashboards/Components/KPIComponent.js",[a["Core/Renderer/HTML/AST.js"],a["Dashboards/Components/Component.js"],a["Core/Templating.js"],a["Core/Utilities.js"]],function(a,c,f,k){var g=this&&this.__awaiter||function(a,b,c,d){function h(a){return a instanceof c?a:new c(function(b){b(a)})}return new (c||(c=Promise))(function(c,e){function f(a){try{g(d.next(a))}catch(t){e(t)}} | ||
function l(a){try{g(d["throw"](a))}catch(t){e(t)}}function g(a){a.done?c(a.value):h(a.value).then(f,l)}g((d=d.apply(a,b||[])).next())})};const {format:m}=f,{createElement:b,css:v,defined:e,getStyle:d,isArray:u,isNumber:x,merge:p,diffObjects:z}=k;class n extends c{static fromJSON(a,b){a=a.options;const c=a.chartOptions&&JSON.parse(a.chartOptions),d=JSON.parse(a.subtitle||"{}"),e=a.title&&JSON.parse(a.title);return new n(b,p(a,{chartOptions:c,title:e,subtitle:d}))}constructor(a,d){d=p(n.defaultOptions, | ||
d);super(a,d);this.options=d;this.type="KPI";this.sync=new c.Sync(this,this.syncHandlers);this.value=b("span",{className:`${c.defaultOptions.className}-kpi-value`},{},this.contentElement);this.subtitle=b("span",{className:this.getSubtitleClassName()},{},this.contentElement);this.options.chartOptions&&(this.chartContainer=b("div",{className:`${c.defaultOptions.className}-kpi-chart-container`},{},this.contentElement))}load(){super.load();this.contentElement.style.display="flex";this.contentElement.style.flexDirection= | ||
textDecoration:"line-through"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontSize:"0.8em",fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:k,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %e %b, %H:%M:%S.%L",second:"%A, %e %b, %H:%M:%S", | ||
minute:"%A, %e %b, %H:%M",hour:"%A, %e %b, %H:%M",day:"%A, %e %b %Y",week:"Week from %A, %e %b %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:a?25:10,headerFormat:'<span style="font-size: 0.8em">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:"#ffffff",borderWidth:void 0,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default", | ||
fontSize:"0.8em"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"0.6em"},text:"Highcharts.com"}};e.chart.styledMode=!1;"";const x=new y(e.time);b={defaultOptions:e,defaultTime:x,getOptions:function(){return e},setOptions:function(a){c(!0,e,a);if(a.time||a.global)f.time?f.time.update(c(e.global,e.time,a.global,a.time)):f.time=x;return e}};"";return b});g(b,"Core/Templating.js", | ||
[b["Core/Defaults.js"],b["Core/Utilities.js"]],function(b,d){function f(a="",b,c){const d=/\{([a-zA-Z0-9:\.,;\-\/<>%_@"'= #\(\)]+)\}/g,e=/\(([a-zA-Z0-9:\.,;\-\/<>%_@"'= ]+)\)/g,m=[],h=/f$/,n=/\.([0-9])/,p=g.lang,x=c&&c.time||l,y=c&&c.numberFormatter||k,u=(a="")=>{let c;return"true"===a?!0:"false"===a?!1:(c=Number(a)).toString()===a?c:t(a,b)};let v,q,F=0,H;for(;null!==(v=d.exec(a));){const c=e.exec(v[1]);c&&(v=c,H=!0);q&&q.isBlock||(q={ctx:b,expression:v[1],find:v[0],isBlock:"#"===v[1].charAt(0),start:v.index, | ||
startInner:v.index+v[0].length,length:v[0].length});var D=v[1].split(" ")[0].replace("#","");A[D]&&(q.isBlock&&D===q.fn&&F++,q.fn||(q.fn=D));D="else"===v[1];if(q.isBlock&&q.fn&&(v[1]===`/${q.fn}`||D))if(F)D||F--;else{var E=q.startInner;E=a.substr(E,v.index-E);void 0===q.body?(q.body=E,q.startInner=v.index+v[0].length):q.elseBody=E;q.find+=E+v[0];D||(m.push(q),q=void 0)}else q.isBlock||m.push(q);if(c&&(null===q||void 0===q||!q.isBlock))break}m.forEach(c=>{const {body:d,elseBody:e,expression:m,fn:k}= | ||
c;var g;if(k){var l=[c],w=m.split(" ");for(g=A[k].length;g--;)l.unshift(u(w[g+1]));g=A[k].apply(b,l);c.isBlock&&"boolean"===typeof g&&(g=f(g?d:e,b))}else l=m.split(":"),g=u(l.shift()||""),l.length&&"number"===typeof g&&(l=l.join(":"),h.test(l)?(w=parseInt((l.match(n)||["","-1"])[1],10),null!==g&&(g=y(g,w,p.decimalPoint,-1<l.indexOf(",")?p.thousandsSep:""))):g=x.dateFormat(l,g));a=a.replace(c.find,z(g,""))});return H?f(a,b,c):a}function k(a,b,c,d){a=+a||0;b=+b;const f=g.lang;var m=(a.toString().split(".")[1]|| | ||
"").split("e")[0].length;const h=a.toString().split("e"),k=b;if(-1===b)b=Math.min(m,20);else if(!e(b))b=2;else if(b&&h[1]&&0>h[1]){var l=b+ +h[1];0<=l?(h[0]=(+h[0]).toExponential(l).split("e")[0],b=l):(h[0]=h[0].split(".")[0]||0,a=20>b?(h[0]*Math.pow(10,h[1])).toFixed(b):0,h[1]=0)}l=(Math.abs(h[1]?h[0]:a)+Math.pow(10,-Math.max(b,m)-1)).toFixed(b);m=String(p(l));const n=3<m.length?m.length%3:0;c=z(c,f.decimalPoint);d=z(d,f.thousandsSep);a=(0>a?"-":"")+(n?m.substr(0,n)+d:"");a=0>+h[1]&&!k?"0":a+m.substr(n).replace(/(\d{3})(?=\d)/g, | ||
"$1"+d);b&&(a+=c+l.slice(-b));h[1]&&0!==+a&&(a+="e"+h[1]);return a}const {defaultOptions:g,defaultTime:l}=b,{extend:a,getNestedProperty:t,isArray:c,isNumber:e,isObject:u,pick:z,pInt:p}=d,A={add:(a,b)=>a+b,divide:(a,b)=>0!==b?a/b:"",eq:(a,b)=>a==b,each:function(b){const d=arguments[arguments.length-1];return c(b)?b.map((c,e)=>f(d.body,a(u(c)?c:{"@this":c},{"@index":e,"@first":0===e,"@last":e===b.length-1}))).join(""):!1},ge:(a,b)=>a>=b,gt:(a,b)=>a>b,"if":a=>!!a,le:(a,b)=>a<=b,lt:(a,b)=>a<b,multiply:(a, | ||
b)=>a*b,ne:(a,b)=>a!=b,subtract:(a,b)=>a-b,unless:a=>!a};return{dateFormat:function(a,b,c){return l.dateFormat(a,b,c)},format:f,helpers:A,numberFormat:k}});g(b,"Dashboards/Components/KPIComponent.js",[b["Core/Renderer/HTML/AST.js"],b["Dashboards/Components/Component.js"],b["Core/Templating.js"],b["Core/Utilities.js"]],function(b,d,f,g){var k=this&&this.__awaiter||function(a,b,c,d){function e(a){return a instanceof c?a:new c(function(b){b(a)})}return new (c||(c=Promise))(function(c,f){function h(a){try{g(d.next(a))}catch(v){f(v)}} | ||
function m(a){try{g(d["throw"](a))}catch(v){f(v)}}function g(a){a.done?c(a.value):e(a.value).then(h,m)}g((d=d.apply(a,b||[])).next())})};const {format:l}=f,{createElement:a,css:t,defined:c,getStyle:e,isArray:x,isNumber:z,merge:p,diffObjects:A}=g;class n extends d{static fromJSON(a,b){a=a.options;const c=a.chartOptions&&JSON.parse(a.chartOptions),d=JSON.parse(a.subtitle||"{}"),e=a.title&&JSON.parse(a.title);return new n(b,p(a,{chartOptions:c,title:e,subtitle:d}))}constructor(b,c){c=p(n.defaultOptions, | ||
c);super(b,c);this.options=c;this.type="KPI";this.sync=new d.Sync(this,this.syncHandlers);this.value=a("span",{className:`${d.defaultOptions.className}-kpi-value`},{},this.contentElement);this.subtitle=a("span",{className:this.getSubtitleClassName()},{},this.contentElement);this.options.chartOptions&&(this.chartContainer=a("div",{className:`${d.defaultOptions.className}-kpi-chart-container`},{},this.contentElement))}load(){super.load();this.contentElement.style.display="flex";this.contentElement.style.flexDirection= | ||
"column";this.parentElement.appendChild(this.element);this.updateElements();return this}resize(a,b){super.resize(a,b);!this.updatingSize&&this.dimensions.width&&this.dimensions.height&&this.updateSize(this.dimensions.width,this.dimensions.height);this.chart&&this.chart.reflow();this.updatingSize=!1;return this}updateTitleSize(a,b){this.titleElement&&(this.titleElement.style.fontSize=this.getFontSize(a,b,.08*(this.chart?1:1.7)))}getFontSize(a,b,c){return Math.max(this.options.minFontSize,Math.round(c* | ||
Math.min(a,b)))+"px"}updateSize(a,b){this.updateTitleSize(a,b);const c=this.chart?1:1.7;this.value.style.fontSize=this.getFontSize(a,b,.15*c*(this.options.title?.7:1));this.subtitle.style.fontSize=this.getFontSize(a,b,.08*c);this.updatingSize=!0;super.resize(Number(d(this.parentElement,"width")),Number(d(this.parentElement,"height")))}render(){super.render();const a=n.charter;a&&this.options.chartOptions&&!this.chart&&this.chartContainer?this.chart=a.chart(this.chartContainer,p(n.defaultChartOptions, | ||
this.options.chartOptions)):this.chart&&!this.options.chartOptions&&"chartOptions"in this.options&&(this.chart.destroy(),this.chart=void 0);return this}redraw(){super.redraw();this.updateElements();return this}update(a){const b=Object.create(null,{update:{get:()=>super.update}});return g(this,void 0,void 0,function*(){yield b.update.call(this,a);a.chartOptions&&this.chart&&this.chart.update(a.chartOptions);this.redraw()})}updateElements(){const {style:b,subtitle:c,valueFormat:d,valueFormatter:f}= | ||
this.options;this.options.title&&(this.setTitle(this.options.title),this.dimensions.width&&this.dimensions.height&&this.updateTitleSize(this.dimensions.width,this.dimensions.height));let g=this.options.value;if(e(g)){let b;x(g)&&(b=g);f?g=f.call(this,g):d?g=m(d,{value:g}):x(g)&&(g=g.toLocaleString());a.setElementHTML(this.value,g);a.setElementHTML(this.subtitle,this.getSubtitle());this.prevValue=b}b&&v(this.element,b);"object"===typeof c&&(c.style&&v(this.subtitle,c.style),this.subtitle.className= | ||
this.getSubtitleClassName());this.chartContainer&&(this.chartContainer.style.flex=this.options.chartOptions?"1":"0");this.chart&&this.chart.reflow();this.value.style.color=this.getValueColor()}getSubtitle(){const {subtitle:a,value:b}=this.options;if("string"===typeof a)return a;if(a){if(x(this.prevValue)&&x(b)){const c=b-this.prevValue;let d;if(0<c)d='<span style="color:green">▲</span> +';else if(0>c)d='<span style="color:red">▼</span> ';else return this.subtitle.innerHTML;if("diff"=== | ||
a.type)return d+c.toLocaleString();if("diffpercent"===a.type)return d+m("{v:,.2f}%",{v:c/this.prevValue*100})}return a.text||""}return""}getSubtitleClassName(){const {subtitle:a}=this.options;return`${c.defaultOptions.className}-kpi-subtitle`+("object"===typeof a&&a.className||"")}getValueColor(){const {threshold:a,thresholdColors:b,value:c}=this.options;if(b&&a&&x(c)){if(u(a))for(let d=a.length-1;0<=d;d--){if(c>=a[d])return d+1<b.length?b[d+1]:b[b.length-1]}else if(c>=a)return b[1];return b[0]}return""}toJSON(){const a= | ||
Math.min(a,b)))+"px"}updateSize(a,b){this.updateTitleSize(a,b);const c=this.chart?1:1.7;this.value.style.fontSize=this.getFontSize(a,b,.15*c*(this.options.title?.7:1));this.subtitle.style.fontSize=this.getFontSize(a,b,.08*c);this.updatingSize=!0;super.resize(Number(e(this.parentElement,"width")),Number(e(this.parentElement,"height")))}render(){super.render();const a=n.charter;a&&this.options.chartOptions&&!this.chart&&this.chartContainer?this.chart=a.chart(this.chartContainer,p(n.defaultChartOptions, | ||
this.options.chartOptions)):this.chart&&!this.options.chartOptions&&"chartOptions"in this.options&&(this.chart.destroy(),this.chart=void 0);return this}redraw(){super.redraw();this.updateElements();return this}update(a){const b=Object.create(null,{update:{get:()=>super.update}});return k(this,void 0,void 0,function*(){yield b.update.call(this,a);a.chartOptions&&this.chart&&this.chart.update(a.chartOptions);this.redraw()})}updateElements(){const {style:a,subtitle:d,valueFormat:e,valueFormatter:f}= | ||
this.options;this.options.title&&(this.setTitle(this.options.title),this.dimensions.width&&this.dimensions.height&&this.updateTitleSize(this.dimensions.width,this.dimensions.height));let g=this.options.value;if(c(g)){let a;z(g)&&(a=g);f?g=f.call(this,g):e?g=l(e,{value:g}):z(g)&&(g=g.toLocaleString());b.setElementHTML(this.value,g);b.setElementHTML(this.subtitle,this.getSubtitle());this.prevValue=a}a&&t(this.element,a);"object"===typeof d&&(d.style&&t(this.subtitle,d.style),this.subtitle.className= | ||
this.getSubtitleClassName());this.chartContainer&&(this.chartContainer.style.flex=this.options.chartOptions?"1":"0");this.chart&&this.chart.reflow();this.value.style.color=this.getValueColor()}getSubtitle(){const {subtitle:a,value:b}=this.options;if("string"===typeof a)return a;if(a){if(z(this.prevValue)&&z(b)){const c=b-this.prevValue;let d;if(0<c)d='<span style="color:green">▲</span> +';else if(0>c)d='<span style="color:red">▼</span> ';else return this.subtitle.innerHTML;if("diff"=== | ||
a.type)return d+c.toLocaleString();if("diffpercent"===a.type)return d+l("{v:,.2f}%",{v:c/this.prevValue*100})}return a.text||""}return""}getSubtitleClassName(){const {subtitle:a}=this.options;return`${d.defaultOptions.className}-kpi-subtitle`+("object"===typeof a&&a.className||"")}getValueColor(){const {threshold:a,thresholdColors:b,value:c}=this.options;if(b&&a&&z(c)){if(x(a))for(let d=a.length-1;0<=d;d--){if(c>=a[d])return d+1<b.length?b[d+1]:b[b.length-1]}else if(c>=a)return b[1];return b[0]}return""}toJSON(){const a= | ||
super.toJSON(),b=Object.assign(Object.assign({},a),{type:"KPI",options:Object.assign(Object.assign({},a.options),{type:"KPI",value:this.options.value,subtitle:JSON.stringify(this.options.subtitle),title:JSON.stringify(this.options.title),threshold:this.options.threshold,thresholdColors:this.options.thresholdColors,chartOptions:JSON.stringify(this.options.chartOptions),valueFormat:this.options.valueFormat})});this.emit({type:"toJSON",json:a});return b}getOptions(){return Object.assign(Object.assign({}, | ||
z(this.options,n.defaultOptions)),{type:"KPI"})}}n.defaultOptions=p(c.defaultOptions,{type:"KPI",className:[c.defaultOptions.className,`${c.defaultOptions.className}-kpi`].join(" "),minFontSize:20,thresholdColors:["#f45b5b","#90ed7d"]});n.defaultChartOptions={chart:{type:"spline",backgroundColor:"transparent"},title:{text:void 0},xAxis:{visible:!1},yAxis:{visible:!1,title:{text:null}},legend:{enabled:!1},credits:{enabled:!1},tooltip:{outside:!0},plotOptions:{series:{marker:{enabled:!1}}}};return n}); | ||
k(a,"Dashboards/Plugins/HighchartsPlugin.js",[a["Dashboards/Plugins/HighchartsComponent.js"],a["Dashboards/Components/KPIComponent.js"],a["Dashboards/Plugins/HighchartsSyncHandlers.js"]],function(a,c,f){return{custom:{connectHighcharts:function(f){a.charter=f;c.charter=f}},name:"Highcharts.DashboardsPlugin",onRegister:function(g){const {Sync:k,ComponentRegistry:m}=g;m.registerComponent("Highcharts",a);m.registerComponent("KPI",c);k.defaultHandlers=Object.assign(Object.assign({},k.defaultHandlers), | ||
f)},onUnregister:function(a){const {Sync:c}=a;Object.keys(f).forEach(a=>{c.defaultHandlers[a]===f[a]&&delete c.defaultHandlers[a]})}}});k(a,"masters/modules/dashboards-plugin.src.js",[a["Dashboards/Plugins/DataGridPlugin.js"],a["Dashboards/Globals.js"],a["Dashboards/Plugins/HighchartsPlugin.js"]],function(a,c,f){c.DataGridPlugin=a;c.HighchartsPlugin=f;c.win.Highcharts&&(f.custom.connectHighcharts(c.win.Highcharts),c.PluginHandler.addPlugin(f));c.win.DataGrid&&(a.custom.connectDataGrid(c.win.DataGrid.DataGrid), | ||
c.PluginHandler.addPlugin(a));return c})});//# sourceMappingURL=dashboards-plugin.js.map | ||
A(this.options,n.defaultOptions)),{type:"KPI"})}}n.defaultOptions=p(d.defaultOptions,{type:"KPI",className:[d.defaultOptions.className,`${d.defaultOptions.className}-kpi`].join(" "),minFontSize:20,thresholdColors:["#f45b5b","#90ed7d"]});n.defaultChartOptions={chart:{type:"spline",backgroundColor:"transparent"},title:{text:void 0},xAxis:{visible:!1},yAxis:{visible:!1,title:{text:null}},legend:{enabled:!1},credits:{enabled:!1},tooltip:{outside:!0},plotOptions:{series:{marker:{enabled:!1}}}};return n}); | ||
g(b,"Dashboards/Plugins/HighchartsPlugin.js",[b["Dashboards/Plugins/HighchartsComponent.js"],b["Dashboards/Components/KPIComponent.js"],b["Dashboards/Plugins/HighchartsSyncHandlers.js"]],function(b,d,f){return{custom:{connectHighcharts:function(f){b.charter=f;d.charter=f}},name:"Highcharts.DashboardsPlugin",onRegister:function(g){const {Sync:k,ComponentRegistry:l}=g;l.registerComponent("Highcharts",b);l.registerComponent("KPI",d);k.defaultHandlers=Object.assign(Object.assign({},k.defaultHandlers), | ||
f)},onUnregister:function(b){const {Sync:d}=b;Object.keys(f).forEach(b=>{d.defaultHandlers[b]===f[b]&&delete d.defaultHandlers[b]})}}});g(b,"masters/modules/dashboards-plugin.src.js",[b["Dashboards/Plugins/DataGridPlugin.js"],b["Dashboards/Globals.js"],b["Dashboards/Plugins/HighchartsPlugin.js"]],function(b,d,f){d.DataGridPlugin=b;d.HighchartsPlugin=f;d.win.Highcharts&&(f.custom.connectHighcharts(d.win.Highcharts),d.PluginHandler.addPlugin(f));d.win.DataGrid&&(b.custom.connectDataGrid(d.win.DataGrid.DataGrid), | ||
d.PluginHandler.addPlugin(b));return d})});//# sourceMappingURL=dashboards-plugin.js.map |
@@ -8,4 +8,7 @@ /*!* | ||
import * as _Dashboards from "../dashboards"; | ||
import _Formula from "../es-modules/Data/Formula/Formula"; | ||
import "../es-modules/Data/Modifiers/MathModifier"; | ||
declare module "../dashboards" { | ||
@@ -12,0 +15,0 @@ const Formula: typeof _Formula; |
/* | ||
Highcharts Dashboards Math 1.0.1 (2023-07-19) | ||
Highcharts Dashboards Math 1.0.2 (2023-08-10) | ||
@@ -4,0 +4,0 @@ (c) 2009-2023 Highsoft AS |
@@ -8,4 +8,7 @@ /*!* | ||
import * as _Dashboards from "../dashboards.src"; | ||
import _Formula from "../es-modules/Data/Formula/Formula"; | ||
import "../es-modules/Data/Modifiers/MathModifier"; | ||
declare module "../dashboards.src" { | ||
@@ -12,0 +15,0 @@ const Formula: typeof _Formula; |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://www.highcharts.com/products/dashboards/", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Highsoft AS <support@highcharts.com> (http://www.highcharts.com/about)", | ||
@@ -21,3 +21,6 @@ "bugs": "https://github.com/highcharts/highcharts/issues", | ||
"visualization" | ||
] | ||
], | ||
"peerDependencies": { | ||
"highcharts": ">=10.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5117140
423
123032
1