{"version":3,"sources":["webpack://jrs-ui/./src/util/tools.drag.js","webpack://jrs-ui/./src/util/tools.truncator.js","webpack://jrs-ui/./src/util/utils.common.enum.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnavAlerting.ts"],"names":["DragListener","this","agents","currentAgentName","dragger","Dragger","evt","draggingObjs","dragsX","dragsY","sigMove","dragListener","cleanUpUtil","event","originalX","originalY","i","length","parseInt","style","left","top","mouseX","clientX","mouseY","clientY","isDragging","initDragger","DRAGGING_STARTED","DRAGGING_FINISHED","DRAGGING","prototype","registerAgent","agentName","publishEvent","action","notify","dragListenerEvent","browserEvent","currentAgent","thisAction","setCurrentAgentName","getCurrentAgentName","addAnotherDraggingObject","draggingObj","document","onmousemove","dragging","onmouseup","draggingFinished","invokeDraggingFinished","e","movedSignificantly","xDiff","yDiff","Math","abs","display","j","k","l","m","clearDraggingObjects","thisOne","parentNode","removeChild","Truncator","Class","initialize","elements","fixedWidth","columnWidth","each","element","truncate","bind","nodeName","fullContent","title","replace","update","strip","escapeHTML","content","Object","isUndefined","innerText","textContent","insert","template","evaluate","divId","tmpDivId","spanId","tmpSpanId","contentTmp","jQuery","containerWidth","getWidth","remove","truncatedContent","a","b","p","substr","isIE","truncateString","ellipsifyString","untruncate","s","full","Template","MESSAGE_PATTERN","ERROR_CLASS","MESSAGE_WARNING_PATTERN","DETAILS_PATTERN","MESSAGE_WARNING_DETAILS_PATTERN","SUCCESS_CLASS","MESSAGE_SUCCESS_PATTERN","DIALOG_PATTERN","AlertLevel","AlertLevelToElementIdMap","Alert","Polite","timeout","Map","setLiveRegionValue","level","message","clearAlertTimeout","levelEmentId","get","clearTimeout","empty","append","levelTimeout","window","setTimeout","set","alert","polite"],"mappings":"iGAiCA,SAASA,IACLC,KAAKC,OAAS,GACdD,KAAKE,iBAAmB,KACxBF,KAAKG,QA0FT,SAASC,EAAQC,EAAKC,EAAcC,EAAQC,EAAQC,EAASC,EAAcC,GACvEN,EAAMA,GAAYO,MAClBZ,KAAK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JA,SACIC,gBAAiB,WACjBC,YAAa,QACbC,wBAAyB,mBACzBC,gBAAiB,WACjBC,gCAAiC,WACjCC,cAAe,QACfC,wBAAyB,mBACzBC,eAAgB,Y,oDCNfC,E,sJAAAA,O,iBAAAA,I,oBAAAA,M,KAKL,IAAMC,GAAuD,OACxDD,EAAWE,MAAQ,gBADqC,IAExDF,EAAWG,OAAS,iBAFoC,GAOvDC,EAAmC,IAAIC,IAE7C,SAASC,EAAmBC,EAAmBC,GAA4E,IAAjDC,EAAiD,uDAJvF,IAK1BC,EAAeT,EAAyBM,GAE1CH,EAAQO,IAAIJ,KACZK,aAAaR,EAAQO,IAAIJ,IACzBH,EAAO,OAAQG,IAGnB/B,IAAO,GAAD,OAAIkC,IAAgBG,QAAQC,OAAON,GAEzC,IAAMO,EAAeC,OAAOC,YAAW,WACnCzC,IAAO,GAAD,OAAIkC,IAAgBG,QAC1BT,EAAO,OAAQG,KAChBE,GAEHL,EAAQc,IAAIX,EAAOQ,GAGvB,SACII,MADW,SACLX,EAA2BC,GAC7BH,EAAmBN,EAAWE,MAAOM,EAASC,IAElDW,OAJW,SAIJZ,EAA2BC,GAC9BH,EAAmBN,EAAWG,OAAQK,EAASC","file":"_chunks/chunk.3890.js","sourcesContent":["/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n/**\n * @author: Angus Croll\n * @version: $Id$\n */\n//////////////////////////////////////////////////////////\n// Drag.js\n// Generic drag objects and functions\n// Note: Not yet utilized by all dragging in Jasperserver\n//////////////////////////////////////////////////////////\n/**\n * Drag Listener\n * Co-ordinates drag callbacks\n */\nfunction DragListener() {\n this.agents = [];\n this.currentAgentName = null;\n this.dragger;\n} /**\n * Standard drag events\n */\n/**\n * Standard drag events\n */\nDragListener.DRAGGING_STARTED = 'draggingStarted';\nDragListener.DRAGGING_FINISHED = 'draggingFinished';\nDragListener.DRAGGING = 'dragging'; /**\n * register a dragging agent with teh drag listener\n * @param {String} agentName A key identifying the distinct functional area from which the drag originates (eg 'Tree', Table' etc.)\n * This allows us to segregate event actions according to type of drag\n */\n/**\n * register a dragging agent with teh drag listener\n * @param {String} agentName A key identifying the distinct functional area from which the drag originates (eg 'Tree', Table' etc.)\n * This allows us to segregate event actions according to type of drag\n */\nDragListener.prototype.registerAgent = function (agentName) {\n this.agents[agentName] = [];\n}; /**\n * Register the event with an action\n * @param {String} agentName A key identifying the distinct functional area from which the drag originates (eg Tree, Table etc.)\n * @param {String} event Something that happens during drag, e.g. 'mouseOverColumn', 'mouseOutGroup' 'draggingStarted'\n * @param {Function} action Function to be performed when the specified event is triggered by the specified agent\n */\n/**\n * Register the event with an action\n * @param {String} agentName A key identifying the distinct functional area from which the drag originates (eg Tree, Table etc.)\n * @param {String} event Something that happens during drag, e.g. 'mouseOverColumn', 'mouseOutGroup' 'draggingStarted'\n * @param {Function} action Function to be performed when the specified event is triggered by the specified agent\n */\nDragListener.prototype.publishEvent = function (agentName, event, action) {\n this.agents[agentName][event] = action;\n}; /**\n * Trigger the event\n * @param {Object} dragListenerEvent Something that happens during drag, e.g. 'mouseOverColumn', 'mouseOutGroup' 'draggingStarted'\n * @param {Object} browserEvent The window event\n */\n/**\n * Trigger the event\n * @param {Object} dragListenerEvent Something that happens during drag, e.g. 'mouseOverColumn', 'mouseOutGroup' 'draggingStarted'\n * @param {Object} browserEvent The window event\n */\nDragListener.prototype.notify = function (dragListenerEvent, browserEvent) {\n var currentAgent = this.agents[this.currentAgentName];\n if (currentAgent) {\n var thisAction = currentAgent[dragListenerEvent];\n if (thisAction) {\n var draggingObjs = this.dragger ? this.dragger.draggingObjs : null;\n thisAction(browserEvent, draggingObjs);\n }\n }\n}; /**\n * any dragging going on right now?\n */\n/**\n * any dragging going on right now?\n */\nDragListener.prototype.isDragging = function () {\n return this.currentAgentName != null;\n};\nDragListener.prototype.setCurrentAgentName = function (agentName) {\n this.currentAgentName = agentName;\n};\nDragListener.prototype.getCurrentAgentName = function () {\n return this.currentAgentName;\n}; /**\n * Dragger\n * Drags anything......\n * @param {Object} evt current window event that triggered drag\n * @param {Array} draggingObjs are all objects being dragged whether or not the mouse is over them (multi-select)\n * @param {Boolean} dragsX can we drag horizontally\n * @param {Boolean} dragsY can we drag vertically\n * @param {Number} sigMove the number of pixels user must move mouse before we consider drag initiated\n * @param {DragListener} dragListener a dragListener instance\n * @param {Function} cleanUpUtil an optional utlity function to be invoked after drag is released (i.e. dropped)\n */\n/**\n * Dragger\n * Drags anything......\n * @param {Object} evt current window event that triggered drag\n * @param {Array} draggingObjs are all objects being dragged whether or not the mouse is over them (multi-select)\n * @param {Boolean} dragsX can we drag horizontally\n * @param {Boolean} dragsY can we drag vertically\n * @param {Number} sigMove the number of pixels user must move mouse before we consider drag initiated\n * @param {DragListener} dragListener a dragListener instance\n * @param {Function} cleanUpUtil an optional utlity function to be invoked after drag is released (i.e. dropped)\n */\nfunction Dragger(evt, draggingObjs, dragsX, dragsY, sigMove, dragListener, cleanUpUtil) {\n evt = evt ? evt : event;\n this.originalX = [];\n this.originalY = [];\n this.draggingObjs = draggingObjs;\n this.dragsX = dragsX;\n this.dragsY = dragsY;\n this.sigMove = sigMove;\n this.dragListener = dragListener;\n this.cleanUpUtil = cleanUpUtil;\n if (this.dragListener) {\n this.dragListener.dragger = this;\n }\n for (var i = 0; i < draggingObjs.length; i++) {\n this.originalX[i] = parseInt(draggingObjs[i].style.left);\n this.originalY[i] = parseInt(draggingObjs[i].style.top);\n }\n this.mouseX = evt.clientX;\n this.mouseY = evt.clientY;\n this.isDragging = false;\n this.initDragger(evt);\n}\nvar invokeDragging = function (dragger) {\n return function (event) {\n dragger.dragging(event);\n };\n};\nvar invokeDraggingFinished = function (dragger) {\n return function (event) {\n dragger.draggingFinished(event);\n };\n}; /**\n * Add an additional Element to the collection of dragging objects already defined in an existing Dragger\n * @param {Object} evt The window event\n * @param {Element} draggingObj An HTML element\n */\n/**\n * Add an additional Element to the collection of dragging objects already defined in an existing Dragger\n * @param {Object} evt The window event\n * @param {Element} draggingObj An HTML element\n */\nDragger.prototype.addAnotherDraggingObject = function (evt, draggingObj) {\n evt = evt ? evt : event;\n this.draggingObjs[this.draggingObjs.length] = draggingObj;\n this.originalX[this.originalX.length] = parseInt(draggingObj.style.left);\n this.originalY[this.originalY.length] = parseInt(draggingObj.style.top);\n this.initDragger(evt);\n};\nDragger.prototype.initDragger = function (evt) {\n this.isDragging = false;\n this.mouseX = evt.clientX;\n this.mouseY = evt.clientY;\n document.onmousemove = invokeDragging(this);\n document.onmouseup = invokeDraggingFinished(this);\n};\nDragger.prototype.dragging = function (evt) {\n var e = evt ? evt : event;\n var movedSignificantly = false;\n var xDiff = 0;\n var yDiff = 0;\n if (this.dragsX) {\n xDiff = e.clientX - this.mouseX;\n movedSignificantly = Math.abs(xDiff) > this.sigMove;\n }\n if (this.dragsY) {\n yDiff = e.clientY - this.mouseY;\n movedSignificantly = movedSignificantly || Math.abs(yDiff) > this.sigMove;\n }\n if (!this.isDragging && movedSignificantly) {\n this.isDragging = true;\n if (this.dragListener) {\n this.dragListener.notify(DragListener.DRAGGING_STARTED, evt);\n }\n for (var i = 0; i < this.draggingObjs.length; i++) {\n this.draggingObjs[i].style.display = 'block';\n }\n }\n if (this.isDragging) {\n if (xDiff) {\n for (var j = 0; j < this.draggingObjs.length; j++) {\n var left = parseInt(this.originalX[j] + xDiff); // if (left < 0 || left + $(this.draggingObjs[i]).getWidth() > document.body.clientWidth) {\n // xDiff = false;\n // break;\n // }\n }\n if (xDiff) {\n for (var k = 0; k < this.draggingObjs.length; k++) {\n this.draggingObjs[k].style.left = parseInt(this.originalX[k] + xDiff) + 'px';\n }\n }\n }\n if (yDiff) {\n for (var l = 0; l < this.draggingObjs.length; l++) {\n var top = parseInt(this.originalY[l] + yDiff); // if (top < 0 || top + $(this.draggingObjs[i]).getHeight() > document.body.clientHeight) {\n // yDiff = false;\n // break;\n // }\n }\n if (yDiff) {\n for (var m = 0; m < this.draggingObjs.length; m++) {\n this.draggingObjs[m].style.top = parseInt(this.originalY[m] + yDiff) + 'px';\n }\n }\n }\n if (xDiff || yDiff) {\n this.dragListener.notify(DragListener.DRAGGING, evt);\n }\n }\n};\nDragger.prototype.draggingFinished = function (evt) {\n document.onmousemove = 'default';\n document.onmouseup = 'default';\n if (this.isDragging) {\n this.isDragging = false; //generic housekeeping for this drag host\n //generic housekeeping for this drag host\n if (this.cleanUpUtil) {\n this.cleanUpUtil();\n }\n if (this.dragListener) {\n this.dragListener.notify(DragListener.DRAGGING_FINISHED, evt);\n this.dragListener.setCurrentAgentName(null);\n }\n } else {\n if (this.dragListener) {\n this.dragListener.setCurrentAgentName(null);\n }\n }\n};\nDragger.prototype.clearDraggingObjects = function () {\n for (var i = 0; i < this.draggingObjs.length; i++) {\n var thisOne = this.draggingObjs[i];\n if (thisOne) {\n if (thisOne.parentNode) {\n thisOne.parentNode.removeChild(thisOne);\n }\n thisOne = null;\n }\n }\n};\n\nexport {Dragger, DragListener};","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n/**\n * @author: stas.chubar\n * @version: $Id$\n */\n/*\n * Truncator is based on Abbreviator jQuery Plugin\n *\n * Abbreviator Homepage: http://bentlegen.github.com/abbreviator\n * Abbreviator is hosted on GitHub: http://github.com/bentlegen/abbreviator/tree/master\n * Abbreviator Author: Ben Vinegar (http://www.benlog.org)\n * Abbreviator is distributed under the MIT License: http://www.opensource.org/licenses/mit-license.php\n */\n/**\n * Truncator Prototype Plugin (Prototype >= 1.6.0.3)\n *\n * Truncator can be applied to elements only with text\n * Usage:\n * new Truncator($$('selector')); - truncate array of elements\n * new Truncator().truncate($('id')); - truncate one element\n * new Truncator().truncate($$('selector'),100); - truncate array to 100px (Angus added)\n * new Truncator().untruncate($$('selector')); - untruncate array of elements\n */\n\nimport {Class, Template} from 'prototype';\nimport jQuery from 'jquery';\nimport {\n isIE\n} from '../util/utils.common';\n\nvar Truncator = Class.create({\n initialize: function (elements, fixedWidth) {\n if (!elements || !elements[0])\n return;\n var columnWidth = null;\n if (fixedWidth) {\n columnWidth = fixedWidth;\n }\n /*\n Note: commenting this out cause it is causing an error.\n getMarginLeft, getMarginRight, getPaddingLeft and getPaddingRight where part of the old search layout..\n will send an email out on this...\n */\n // var parent = $(elements[0].parentNode);\n // var columnWidth = parent.getWidth() - parent.getMarginLeft() - parent.getMarginRight() - parent.getPaddingLeft() - parent.getPaddingRight();\n // var columnWidth = parent.getWidth() - getBufferWidth(parent, true);\n elements.each(function (element) {\n this.truncate(element, columnWidth);\n }.bind(this));\n },\n truncate: function (element, columnWidth) {\n if (element.nodeName == 'ABBR') {\n var fullContent = element.title.replace('"', '\"');\n element = element.parentNode;\n element.update(fullContent.strip().escapeHTML());\n } //var content = element.innerHTML;\n //var content = element.innerHTML;\n var content = Object.isUndefined(element.innerText) ? element.textContent : element.innerText;\n element.insert(Truncator.template.evaluate({\n divId: Truncator.tmpDivId,\n spanId: Truncator.tmpSpanId\n }));\n var contentTmp = jQuery('#' + Truncator.tmpSpanId)[0];\n contentTmp.insert(content.escapeHTML());\n var containerWidth = columnWidth ? columnWidth : element.getWidth();\n var contentWidth = contentTmp.getWidth();\n if (contentWidth <= containerWidth) {\n jQuery('#' + Truncator.tmpDivId)[0].remove();\n return;\n } // var coverage = containerWidth / contentWidth;\n // var l = content.length;\n //\n // var truncatedContent = content.substr(0, parseInt(l * coverage));\n //\n // while (contentWidth >= containerWidth) {\n // if (isIE()) {\n // contentTmp.innerText = this.ellipsifyString(truncatedContent);\n // } else {\n // contentTmp.update(this.ellipsifyString(truncatedContent));\n // }\n // contentWidth = (contentTmp.getWidth() < 0) ? 0 : contentTmp.getWidth();\n //\n // truncatedContent = truncatedContent.substring(0, truncatedContent.length - 1);\n //\n // if (truncatedContent.length == 0) {\n // break;\n // }\n // }\n // var coverage = containerWidth / contentWidth;\n // var l = content.length;\n //\n // var truncatedContent = content.substr(0, parseInt(l * coverage));\n //\n // while (contentWidth >= containerWidth) {\n // if (isIE()) {\n // contentTmp.innerText = this.ellipsifyString(truncatedContent);\n // } else {\n // contentTmp.update(this.ellipsifyString(truncatedContent));\n // }\n // contentWidth = (contentTmp.getWidth() < 0) ? 0 : contentTmp.getWidth();\n //\n // truncatedContent = truncatedContent.substring(0, truncatedContent.length - 1);\n //\n // if (truncatedContent.length == 0) {\n // break;\n // }\n // }\n var truncatedContent = content;\n var a = 0;\n var b = content.length;\n var p = (b - a) / 2;\n while (p > 1) {\n p += a;\n truncatedContent = content.substr(0, p);\n if (isIE()) {\n contentTmp.innerText = truncatedContent;\n } else {\n contentTmp.update(truncatedContent.escapeHTML());\n }\n if (contentTmp.getWidth() + 30 > containerWidth) {\n b = p;\n } else {\n a = p;\n }\n p = (b - a) / 2;\n }\n jQuery('#' + Truncator.tmpDivId)[0].remove();\n element.update(this.truncateString(this.ellipsifyString(truncatedContent.escapeHTML()), content.escapeHTML().replace('\"', '"')));\n },\n untruncate: function (elements) {\n elements.each(function (element) {\n if (element.nodeName == 'ABBR') {\n element.update(element.title.strip().escapeHTML());\n }\n });\n },\n ellipsifyString: function (s) {\n return s + '…';\n },\n truncateString: function (s, full) {\n return '' + s + '';\n }\n});\nTruncator.tmpDivId = 'truncator-tmp-div';\nTruncator.tmpSpanId = 'truncator-tmp-span';\nTruncator.template = new Template('
');\n\nexport default Truncator;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nexport default {\n MESSAGE_PATTERN: '.message',\n ERROR_CLASS: 'error',\n MESSAGE_WARNING_PATTERN: '.message.warning',\n DETAILS_PATTERN: '.details',\n MESSAGE_WARNING_DETAILS_PATTERN: '.details',\n SUCCESS_CLASS: 'error',\n MESSAGE_SUCCESS_PATTERN: '.message.success',\n DIALOG_PATTERN: '.dialog'\n}","/*\n * Copyright (C) 2005 - 2020 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport jQuery from 'jquery';\n\nenum AlertLevel {\n Alert,\n Polite\n}\n\nconst AlertLevelToElementIdMap: {[key in AlertLevel]: string} = {\n [AlertLevel.Alert]: '#stdnavAlert',\n [AlertLevel.Polite]: '#stdnvaPolite'\n}\n\nconst DEFAULT_CLEAR_ALERT_TIMEOUT = 5 * 1000; // 5 seconds\n\nconst timeout: Map = new Map();\n\nfunction setLiveRegionValue(level: AlertLevel, message: Element | string, clearAlertTimeout = DEFAULT_CLEAR_ALERT_TIMEOUT) {\n const levelEmentId = AlertLevelToElementIdMap[level];\n\n if (timeout.get(level)) {\n clearTimeout(timeout.get(level))\n timeout.delete(level);\n }\n\n jQuery(`${levelEmentId}`).empty().append(message);\n\n const levelTimeout = window.setTimeout(() => {\n jQuery(`${levelEmentId}`).empty();\n timeout.delete(level);\n }, clearAlertTimeout)\n\n timeout.set(level, levelTimeout);\n}\n\nexport default {\n alert(message: Element | string, clearAlertTimeout?: number) {\n setLiveRegionValue(AlertLevel.Alert, message, clearAlertTimeout)\n },\n polite(message: Element | string, clearAlertTimeout?: number) {\n setLiveRegionValue(AlertLevel.Polite, message, clearAlertTimeout)\n }\n}\n"],"sourceRoot":""}