\" +\r\n\t\t\tgantt.templates.drag_link(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start) +\r\n\t\t\t\"
\";\r\n\t\tmarker.innerHTML = html;\r\n\t}\r\n\r\n\tfunction advanceMarker(marker, pos){\r\n\t\tmarker.style.left = pos.x + \"px\";\r\n\t\tmarker.style.top = pos.y + \"px\";\r\n\t}\r\n\r\n\tfunction resetDndState(){\r\n\t\t_link_source_task =\r\n\t\t\t_link_source_task_start =\r\n\t\t\t\t_link_target_task = null;\r\n\t\t_link_target_task_start = true;\r\n\t}\r\n\tfunction showDirectingLine(s_x, s_y, e_x, e_y){\r\n\t\tvar div = getDirectionLine();\r\n\r\n\t\tvar link = getDndState();\r\n\r\n\t\tvar css = [\"gantt_link_direction\"];\r\n\t\tif(gantt.templates.link_direction_class){\r\n\t\t\tcss.push(gantt.templates.link_direction_class(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start));\r\n\t\t}\r\n\r\n\t\tvar dist =Math.sqrt( (Math.pow(e_x - s_x, 2)) + (Math.pow(e_y - s_y, 2)) );\r\n\t\tdist = Math.max(0, dist - 3);\r\n\t\tif(!dist)\r\n\t\t\treturn;\r\n\r\n\t\tdiv.className = css.join(\" \");\r\n\t\tvar tan = (e_y - s_y)/(e_x - s_x),\r\n\t\t\tangle = Math.atan(tan);\r\n\r\n\t\tif(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 2){\r\n\t\t\tangle += Math.PI;\r\n\t\t}else if(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 3){\r\n\t\t\tangle -= Math.PI;\r\n\t\t}\r\n\r\n\r\n\r\n\t\tvar sin = Math.sin(angle),\r\n\t\t\tcos = Math.cos(angle),\r\n\t\t\ttop = Math.round(s_y),\r\n\t\t\tleft = Math.round(s_x);\r\n\r\n\r\n\t\tvar style = [\r\n\t\t\t\"-webkit-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-moz-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-ms-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-o-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"width:\" + Math.round(dist) + \"px\"\r\n\t\t];\r\n\r\n\t\tif(window.navigator.userAgent.indexOf(\"MSIE 8.0\") != -1){\r\n\t\t\t//ms-filter breaks styles in ie9, so add it only for 8th\r\n\t\t\tstyle.push(\"-ms-filter: \\\"\" + ieTransform(sin, cos) + \"\\\"\");\r\n\r\n\t\t\tvar shiftLeft = Math.abs(Math.round(s_x - e_x)),\r\n\t\t\t\tshiftTop = Math.abs(Math.round(e_y - s_y));\r\n\t\t\t//fix rotation axis\r\n\t\t\tswitch(coordinateCircleQuarter(s_x, e_x, s_y, e_y)){\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\ttop -= shiftTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tleft -= shiftLeft;\r\n\t\t\t\t\ttop -= shiftTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tleft -= shiftLeft;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tstyle.push(\"top:\" + top + \"px\");\r\n\t\tstyle.push(\"left:\" + left + \"px\");\r\n\r\n\t\tdiv.style.cssText = style.join(\";\");\r\n\t}\r\n\r\n\tfunction ieTransform(sin, cos){\r\n\t\treturn \"progid:DXImageTransform.Microsoft.Matrix(\"+\r\n\t\t\t\"M11 = \"+cos+\",\"+\r\n\t\t\t\"M12 = -\"+sin+\",\"+\r\n\t\t\t\"M21 = \"+sin+\",\"+\r\n\t\t\t\"M22 = \"+cos+\",\"+\r\n\t\t\t\"SizingMethod = 'auto expand'\"+\r\n\t\t\")\";\r\n\t}\r\n\tfunction coordinateCircleQuarter(sX, eX, sY, eY){\r\n\t\tif(eX >= sX){\r\n\t\t\tif(eY <= sY){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 4;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(eY <= sY){\r\n\t\t\t\treturn 2;\r\n\t\t\t}else{\r\n\t\t\t\treturn 3;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\tfunction getDirectionLine(){\r\n\t\tif(!dnd._direction || !dnd._direction.parentNode){\r\n\t\t\tdnd._direction = document.createElement(\"div\");\r\n\t\t\ttimeline.$task_links.appendChild(dnd._direction);\r\n\t\t}\r\n\t\treturn dnd._direction;\r\n\t}\r\n\tfunction removeDirectionLine(){\r\n\t\tif(dnd._direction){\r\n\t\t\tif (dnd._direction.parentNode)\t//the event line can be detached because of data refresh\r\n\t\t\t\tdnd._direction.parentNode.removeChild(dnd._direction);\r\n\r\n\t\t\tdnd._direction = null;\r\n\t\t}\r\n\t}\r\n\tgantt.attachEvent(\"onGanttRender\", gantt.bind(function() {\r\n\t\tif(dnd._direction){\r\n\t\t\tshowDirectingLine(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y);\r\n\t\t}\r\n\t}, this));\r\n};\r\n\r\nexport default {\r\n\tcreateLinkDND: function(){\r\n\t\treturn {\r\n\t\t\tinit: initLinksDND\r\n\t\t};\r\n\t}\r\n};","import * as utils from \"../../../utils/utils\";\r\nimport taskDnD from \"./tasks_dnd\";\r\nimport linkDnD from \"./links_dnd\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport MouseDelegates from \"../mouse_event_container\";\r\n\r\nvar initializer = (function(){\r\n\treturn function(gantt){\r\n\t\tvar services = gantt.$services;\r\n\t\treturn {\r\n\t\t\tonCreated: function (timeline) {\r\n\t\t\t\tvar config = timeline.$config;\r\n\t\t\t\tconfig.bind = utils.defined(config.bind) ? config.bind : \"task\";\r\n\t\t\t\tconfig.bindLinks = utils.defined(config.bindLinks) ? config.bindLinks : \"link\";\r\n\r\n\t\t\t\ttimeline._linksDnD = linkDnD.createLinkDND();\r\n\t\t\t\ttimeline._tasksDnD = taskDnD.createTaskDND();\r\n\t\t\t\ttimeline._tasksDnD.extend(timeline);\r\n\r\n\t\t\t\tthis._mouseDelegates = MouseDelegates(gantt);\r\n\t\t\t},\r\n\t\t\tonInitialized: function (timeline) {\r\n\t\t\t\tthis._attachDomEvents(gantt);\r\n\r\n\t\t\t\tthis._attachStateProvider(gantt, timeline);\r\n\r\n\t\t\t\ttimeline._tasksDnD.init(timeline, gantt);\r\n\t\t\t\ttimeline._linksDnD.init(timeline, gantt);\r\n\r\n\t\t\t\tif(timeline.$config.id == \"timeline\"){\r\n\t\t\t\t\tthis.extendDom(timeline);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\tonDestroyed: function (timeline) {\r\n\t\t\t\tthis._clearDomEvents(gantt);\r\n\t\t\t\tthis._clearStateProvider(gantt);\r\n\t\t\t\tif (timeline._tasksDnD) {\r\n\t\t\t\t\ttimeline._tasksDnD.destructor();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\textendDom: function(timeline){\r\n\t\t\t\tgantt.$task = timeline.$task;\r\n\t\t\t\tgantt.$task_scale = timeline.$task_scale;\r\n\t\t\t\tgantt.$task_data = timeline.$task_data;\r\n\t\t\t\tgantt.$task_bg = timeline.$task_bg;\r\n\t\t\t\tgantt.$task_links = timeline.$task_links;\r\n\t\t\t\tgantt.$task_bars = timeline.$task_bars;\r\n\t\t\t},\r\n\r\n\t\t\t_clearDomEvents: function(){\r\n\t\t\t\tthis._mouseDelegates.destructor();\r\n\t\t\t\tthis._mouseDelegates = null;\r\n\t\t\t},\r\n\r\n\t\t\t_attachDomEvents: function(gantt){\r\n\t\t\t\tfunction _delete_link_handler(id, e) {\r\n\t\t\t\t\tif (id && this.callEvent(\"onLinkDblClick\", [id, e])) {\r\n\r\n\t\t\t\t\t\tvar link = this.getLink(id);\r\n\t\t\t\t\t\tif (this.isReadonly(link)) return;\r\n\r\n\t\t\t\t\t\tvar title = \"\";\r\n\t\t\t\t\t\tvar question = this.locale.labels.link + \" \" + this.templates.link_description(this.getLink(id)) + \" \" + this.locale.labels.confirm_link_deleting;\r\n\r\n\t\t\t\t\t\twindow.setTimeout(function () {\r\n\t\t\t\t\t\t\tgantt._simple_confirm(question, title, function () {\r\n\t\t\t\t\t\t\t\tgantt.deleteLink(id);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}, (this.config.touch ? 300 : 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_task_link\", gantt.bind(function (e, trg) {\r\n\t\t\t\t\tvar id = this.locate(e, this.config.link_attribute);\r\n\t\t\t\t\tif (id) {\r\n\t\t\t\t\t\tthis.callEvent(\"onLinkClick\", [id, e]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_scale_cell\", gantt.bind(function (e, trg) {\r\n\t\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\r\n\t\t\t\t\tvar date = gantt.dateFromPos(pos.x);\r\n\t\t\t\t\tvar coll = Math.floor(gantt.columnIndexByDate(date));\r\n\r\n\t\t\t\t\tvar coll_date = gantt.getScale().trace_x[coll];\r\n\r\n\t\t\t\t\tgantt.callEvent(\"onScaleClick\", [e, coll_date]);\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_task_link\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar id = this.locate(e, gantt.config.link_attribute);\r\n\t\t\t\t\t_delete_link_handler.call(this, id, e);\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_link_point\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar id = this.locate(e),\r\n\t\t\t\t\t\ttask = this.getTask(id);\r\n\r\n\t\t\t\t\tvar link = null;\r\n\t\t\t\t\tif (trg.parentNode && domHelpers.getClassName(trg.parentNode)) {\r\n\t\t\t\t\t\tif (domHelpers.getClassName(trg.parentNode).indexOf(\"_left\") > -1) {\r\n\t\t\t\t\t\t\tlink = task.$target[0];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlink = task.$source[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (link)\r\n\t\t\t\t\t\t_delete_link_handler.call(this, link, e);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}, gantt), this.$task);\r\n\t\t\t},\r\n\r\n\t\t\t_attachStateProvider: function(gantt, timeline){\r\n\t\t\t\tvar self = timeline;\r\n\t\t\t\tvar state = services.getService(\"state\");\r\n\t\t\t\tstate.registerProvider(\"tasksTimeline\", function(){\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tscale_unit: self._tasks ? self._tasks.unit : undefined,\r\n\t\t\t\t\t\tscale_step: self._tasks ? self._tasks.step : undefined\r\n\t\t\t\t\t};\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t_clearStateProvider: function(){\r\n\t\t\t\tvar state = services.getService(\"state\");\r\n\t\t\t\tstate.unregisterProvider(\"tasksTimeline\");\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n})();\r\n\r\nexport default initializer;","import * as domHelpers from \"./utils/dom_helpers\";\r\n\r\nvar initializer = (function() {\r\n\treturn function (gantt) {\r\n\t\treturn {\r\n\r\n\t\t\tgetVerticalScrollbar: function(){\r\n\t\t\t\treturn gantt.$ui.getView(\"scrollVer\");\r\n\t\t\t},\r\n\t\t\tgetHorizontalScrollbar: function(){\r\n\t\t\t\treturn gantt.$ui.getView(\"scrollHor\");\r\n\t\t\t},\r\n\r\n\t\t\t_legacyGridResizerClass: function(layout){\r\n\t\t\t\tvar resizers = layout.getCellsByType(\"resizer\");\r\n\t\t\t\tfor(var i = 0; i < resizers.length; i++){\r\n\t\t\t\t\tvar r = resizers[i];\r\n\t\t\t\t\tvar gridResizer = false;\r\n\r\n\t\t\t\t\tvar prev = r.$parent.getPrevSibling(r.$id);\r\n\t\t\t\t\tif(prev && prev.$config && prev.$config.id === \"grid\"){\r\n\t\t\t\t\t\tgridResizer= true;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar next = r.$parent.getNextSibling(r.$id);\r\n\t\t\t\t\t\tif(next && next.$config && next.$config.id === \"grid\"){\r\n\t\t\t\t\t\t\tgridResizer= true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(gridResizer){\r\n\t\t\t\t\t\tr.$config.css = (r.$config.css ? r.$config.css + \" \" : \"\") + \"gantt_grid_resize_wrap\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tonCreated: function(layout) {\r\n\t\t\t\tvar first = true;\r\n\r\n\t\t\t\tthis._legacyGridResizerClass(layout);\r\n\r\n\t\t\t\tlayout.attachEvent(\"onBeforeResize\", function() {\r\n\t\t\t\t\tvar mainTimeline = gantt.$ui.getView(\"timeline\");\r\n\t\t\t\t\tif (mainTimeline)\r\n\t\t\t\t\t\tmainTimeline.$config.hidden = mainTimeline.$parent.$config.hidden = !gantt.config.show_chart;\r\n\r\n\t\t\t\t\tvar mainGrid = gantt.$ui.getView(\"grid\");\r\n\r\n\t\t\t\t\tif(!mainGrid)\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\tvar colsWidth = mainGrid._getColsTotalWidth();\r\n\t\t\t\t\tvar hideGrid = !gantt.config.show_grid || !gantt.config.grid_width || colsWidth === 0;\r\n\t\t\t\t\tif (first && !hideGrid && colsWidth !== false){\r\n\t\t\t\t\t\t\tgantt.config.grid_width = colsWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmainGrid.$config.hidden = mainGrid.$parent.$config.hidden = hideGrid;\r\n\r\n\t\t\t\t\tif (!mainGrid.$config.hidden) {\r\n\t\t\t\t\t\t/* restrict grid width due to min_width, max_width, min_grid_column_width */\r\n\t\t\t\t\t\tvar grid_limits = mainGrid._getGridWidthLimits();\r\n\t\t\t\t\t\tif (grid_limits[0] && gantt.config.grid_width < grid_limits[0])\r\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[0];\r\n\t\t\t\t\t\tif (grid_limits[1] && gantt.config.grid_width > grid_limits[1])\r\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[1];\r\n\t\t\t\t\t\tif (mainTimeline && gantt.config.show_chart){\r\n\r\n\t\t\t\t\t\t\tmainGrid.$config.width = gantt.config.grid_width - 1;\r\n\r\n\t\t\t\t\t\t\t// GS-1314: Don't let the non-scrollable grid to be larger than the container with the correct width\r\n\t\t\t\t\t\t\tif (!mainGrid.$config.scrollable && mainGrid.$config.scrollY && gantt.$root.offsetWidth){\r\n\t\t\t\t\t\t\t\tvar ganttContainerWidth = mainGrid.$gantt.$layout.$container.offsetWidth;\r\n\t\t\t\t\t\t\t\tvar verticalScrollbar = gantt.$ui.getView(mainGrid.$config.scrollY);\r\n\t\t\t\t\t\t\t\tvar verticalScrollbarWidth = verticalScrollbar.$config.width;\r\n\r\n\t\t\t\t\t\t\t\t// GS-2488: to prevent grid from occupying the whole gantt container(timeline will be disabled) \r\n\t\t\t\t\t\t\t\t// need to leave min width for timeline\r\n\t\t\t\t\t\t\t\tvar gridOverflow = ganttContainerWidth - (mainGrid.$config.width + verticalScrollbarWidth) - 4;\r\n\t\t\t\t\t\t\t\tif (gridOverflow < 0){\r\n\t\t\t\t\t\t\t\t\tmainGrid.$config.width += gridOverflow;\r\n\t\t\t\t\t\t\t\t\tgantt.config.grid_width += gridOverflow;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\t\t\tif (mainTimeline && !domHelpers.isChildOf(mainTimeline.$task, layout.$view)) {\r\n\t\t\t\t\t\t\t\t\t// timeline is being displayed after being not visible, reset grid with from full screen\r\n\t\t\t\t\t\t\t\t\tif (!mainGrid.$config.original_grid_width) {\r\n\t\t\t\t\t\t\t\t\t\tvar skinSettings = gantt.skins[gantt.skin];\r\n\t\t\t\t\t\t\t\t\t\tif(skinSettings && skinSettings.config && skinSettings.config.grid_width){\r\n\t\t\t\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = skinSettings.config.grid_width;\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tgantt.config.grid_width = mainGrid.$config.original_grid_width;\r\n\t\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tmainGrid.$parent._setContentSize(mainGrid.$config.width, null);\r\n\t\t\t\t\t\t\t\t\tgantt.$layout._syncCellSizes(mainGrid.$parent.$config.group, {value: gantt.config.grid_width, isGravity: false});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t\tif (mainGrid.$parent.$config.group) {\r\n\t\t\t\t\t\t\t\t\tgantt.$layout._syncCellSizes(mainGrid.$parent.$config.group, {value: mainGrid.$parent.$config.width, isGravity: false});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (mainTimeline && domHelpers.isChildOf(mainTimeline.$task, layout.$view)) {\r\n\t\t\t\t\t\t\t\t// hiding timeline, remember grid with to restore it when timeline is displayed again\r\n\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfirst = false;\r\n\t\t\t\t});\r\n\t\t\t\tthis._initScrollStateEvents(layout);\r\n\t\t\t},\r\n\r\n\t\t\t_initScrollStateEvents: function(layout) {\r\n\t\t\t\tgantt._getVerticalScrollbar = this.getVerticalScrollbar;\r\n\t\t\t\tgantt._getHorizontalScrollbar = this.getHorizontalScrollbar;\r\n\r\n\t\t\t\tvar vertical = this.getVerticalScrollbar();\r\n\t\t\t\tvar horizontal = this.getHorizontalScrollbar();\r\n\t\t\t\tif (vertical) {\r\n\t\t\t\t\tvertical.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\r\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\r\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [scrollState.x, oldPos, scrollState.x, newPos]);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tif (horizontal) {\r\n\t\t\t\t\thorizontal.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\r\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\r\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [oldPos, scrollState.y, newPos, scrollState.y]);\r\n\r\n\t\t\t\t\t\t// if the grid doesn't fit the width, scroll the row container\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tif (grid && grid.$grid_data && !grid.$config.scrollable){\r\n\t\t\t\t\t\t\tgrid.$grid_data.style.left = grid.$grid.scrollLeft + \"px\";\r\n\t\t\t\t\t\t\tgrid.$grid_data.scrollLeft = grid.$grid.scrollLeft;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlayout.attachEvent(\"onResize\", function(){\r\n\t\t\t\t\tif (vertical && !gantt.$scroll_ver){\r\n\t\t\t\t\t\tgantt.$scroll_ver = vertical.$scroll_ver;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (horizontal && !gantt.$scroll_hor){\r\n\t\t\t\t\t\tgantt.$scroll_hor = horizontal.$scroll_hor;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t_findGridResizer: function(layout, grid){\r\n\t\t\t\tvar resizers = layout.getCellsByType(\"resizer\");\r\n\r\n\t\t\t\tvar gridFirst = true;\r\n\t\t\t\tvar gridResizer;\r\n\t\t\t\tfor(var i = 0; i < resizers.length; i++){\r\n\t\t\t\t\tvar res = resizers[i];\r\n\t\t\t\t\tres._getSiblings();\r\n\t\t\t\t\tvar prev = res._behind;\r\n\t\t\t\t\tvar next = res._front;\r\n\t\t\t\t\tif(prev && prev.$content === grid || (prev.isChild && prev.isChild(grid))){\r\n\t\t\t\t\t\tgridResizer = res;\r\n\t\t\t\t\t\tgridFirst = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else if(next && next.$content === grid || (next.isChild && next.isChild(grid))){\r\n\t\t\t\t\t\tgridResizer = res;\r\n\t\t\t\t\t\tgridFirst = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn {\r\n\t\t\t\t\tresizer: gridResizer,\r\n\t\t\t\t\tgridFirst: gridFirst\r\n\t\t\t\t};\r\n\t\t\t},\r\n\r\n\t\t\tonInitialized: function (layout) {\r\n\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\r\n\t\t\t\tvar resizeInfo = this._findGridResizer(layout, grid);\r\n\r\n\t\t\t\t// expose grid resize events\r\n\t\t\t\tif(resizeInfo.resizer){\r\n\t\t\t\t\tvar gridFirst = resizeInfo.gridFirst,\r\n\t\t\t\t\t\tnext = resizeInfo.resizer;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(next.$config.mode !== \"x\"){\r\n\t\t\t\t\t\treturn;// track only horizontal resize\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar initialWidth;\r\n\t\t\t\t\tnext.attachEvent(\"onResizeStart\", function(prevCellWidth, nextCellWidth){\r\n\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\r\n\t\t\t\t\t\tif(viewCell){\r\n\t\t\t\t\t\t\tvar limits = grid._getGridWidthLimits();\r\n\r\n\t\t\t\t\t\t\t// min grid width is defined by min widths of its columns, unless grid has horizontal scroll\r\n\t\t\t\t\t\t\tif(!grid.$config.scrollable)\r\n\t\t\t\t\t\t\t\tviewCell.$config.minWidth = limits[0];\r\n\r\n\t\t\t\t\t\t\tviewCell.$config.maxWidth = limits[1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tinitialWidth = gridFirst ? prevCellWidth : nextCellWidth;\r\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResizeStart\", [initialWidth]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tnext.attachEvent(\"onResize\", function(newBehindSize, newFrontSize){\r\n\t\t\t\t\t\tvar newSize = gridFirst ? newBehindSize : newFrontSize;\r\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResize\", [initialWidth, newSize]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tnext.attachEvent(\"onResizeEnd\", function(oldBackSize, oldFrontSize, newBackSize, newFrontSize){\r\n\r\n\t\t\t\t\t\tvar oldSize = gridFirst ? oldBackSize : oldFrontSize;\r\n\t\t\t\t\t\tvar newSize = gridFirst ? newBackSize : newFrontSize;\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\r\n\t\t\t\t\t\tif(viewCell){\r\n\t\t\t\t\t\t\tviewCell.$config.minWidth = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar res = gantt.callEvent(\"onGridResizeEnd\", [oldSize, newSize]);\r\n\t\t\t\t\t\tif(res && newSize !== 0){// new size may be numeric zero when cell size is defined by 'gravity', actual size will be calculated by layout later\r\n\t\t\t\t\t\t\tgantt.config.grid_width = newSize;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\tonDestroyed: function (timeline) {\r\n\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t};\r\n})();\r\n\r\nexport default initializer;","import uiFactory from \"./ui_factory\";\r\nimport mouseEvents from \"./mouse\";\r\nimport createLayers from \"./gantt_layers\";\r\nimport Cell from \"./layout/cell\";\r\nimport Layout from \"./layout/layout\";\r\nimport ViewLayout from \"./layout/view_layout\";\r\nimport ViewCell from \"./layout/view_cell\";\r\nimport Resizer from \"./layout/resizer_cell\";\r\nimport Scrollbar from \"./layout/scrollbar_cell\";\r\nimport Timeline from \"./timeline/timeline\";\r\nimport Grid from \"./grid/grid\";\r\nimport ResourceGrid from \"./grid/resource_grid\";\r\nimport ResourceTimeline from \"./timeline/resource_timeline\";\r\nimport ResourceHistogram from \"./timeline/resource_histogram\";\r\n\r\n\r\nimport gridEditorsFactory from \"./grid/editors/controller\";\r\n\r\nimport renderTaskBar from \"./render/task_bar_smart_render\";\r\nimport renderTimedProjectBar from \"./render/task_project_smart_render\";\r\nimport renderSplitTaskBar from \"./render/task_split_render\";\r\nimport renderRollupTaskBar from \"./render/task_rollup_render\";\r\nimport renderTaskBg from \"./render/task_bg_render\";\r\nimport renderLink from \"./render/link_render\";\r\nimport gridRenderer from \"./render/task_grid_line_render\";\r\nimport resourceMatrixRenderer from \"./render/resource_matrix_render\";\r\nimport resourceHistogramRenderer from \"./render/resource_histogram_render\";\r\nimport gridTaskRowResizerRenderer from \"./render/task_grid_row_resize_render\";\r\nimport renderConstraints from \"./render/task_constraints_render\";\r\nimport renderDeadline from \"./render/task_deadline_render\";\r\nimport renderBaselines from \"./render/task_baselines_render\";\r\nimport mainGridInitializer from \"./grid/main_grid_initializer\";\r\nimport mainTimelineInitializer from \"./timeline/main_timeline_initializer\";\r\nimport mainLayoutInitializer from \"./main_layout_initializer\";\r\n\r\nfunction initUI(gantt){\r\n\tfunction attachInitializer(view, initializer){\r\n\t\tvar ext = initializer(gantt);\r\n\t\tif(ext.onCreated)\r\n\t\t\text.onCreated(view);\r\n\t\tview.attachEvent(\"onReady\", function(){\r\n\t\t\tif(ext.onInitialized)\r\n\t\t\t\text.onInitialized(view);\r\n\t\t});\r\n\t\tview.attachEvent(\"onDestroy\", function(){\r\n\t\t\tif(ext.onDestroyed)\r\n\t\t\t\text.onDestroyed(view);\r\n\t\t});\r\n\t}\r\n\r\n\tvar factory = uiFactory.createFactory(gantt);\r\n\tfactory.registerView(\"cell\", Cell);\r\n\tfactory.registerView(\"resizer\", Resizer);\r\n\tfactory.registerView(\"scrollbar\", Scrollbar);\r\n\tfactory.registerView(\"layout\", Layout, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"main\"){\r\n\t\t\tattachInitializer(view, mainLayoutInitializer);\r\n\t\t}\r\n\t});\r\n\tfactory.registerView(\"viewcell\", ViewCell);\r\n\tfactory.registerView(\"multiview\", ViewLayout);\r\n\tfactory.registerView(\"timeline\", Timeline, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"timeline\" || view.$config.bind == \"task\"){\r\n\t\t\tattachInitializer(view, mainTimelineInitializer);\r\n\t\t}\r\n\t});\r\n\tfactory.registerView(\"grid\", Grid, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"grid\" || view.$config.bind == \"task\"){\r\n\t\t\tattachInitializer(view, mainGridInitializer);\r\n\t\t}\r\n\t});\r\n\r\n\tfactory.registerView(\"resourceGrid\", ResourceGrid);\r\n\tfactory.registerView(\"resourceTimeline\", ResourceTimeline);\r\n\tfactory.registerView(\"resourceHistogram\", ResourceHistogram);\r\n\r\n\tvar layersEngine = createLayers(gantt);\r\n\r\n\tvar inlineEditors = gridEditorsFactory(gantt);\r\n\r\n\tgantt.ext.inlineEditors = inlineEditors;\r\n\tgantt.ext._inlineEditors = inlineEditors;\r\n\tinlineEditors.init(gantt);\r\n\r\n\treturn {\r\n\t\tfactory:factory,\r\n\t\tmouseEvents: mouseEvents.init(gantt),\r\n\t\tlayersApi: layersEngine.init(),\r\n\t\trender:{\r\n\t\t\tgridLine: function(){\r\n\t\t\t\treturn gridRenderer(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBg: function(){\r\n\t\t\t\treturn renderTaskBg(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBar: function(){\r\n\t\t\t\treturn renderTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttimedProjectBar: function(){\r\n\t\t\t\treturn renderTimedProjectBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskRollupBar: function() {\r\n\t\t\t\treturn renderRollupTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskSplitBar: function(){\r\n\t\t\t\treturn renderSplitTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskConstraints: function(){\r\n\t\t\t\treturn renderConstraints(gantt);\r\n\t\t\t},\r\n\t\t\ttaskDeadline: function(){\r\n\t\t\t\treturn renderDeadline(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBaselines: function(){\r\n\t\t\t\treturn renderBaselines(gantt);\r\n\t\t\t},\r\n\t\t\tlink: function(){\r\n\t\t\t\treturn renderLink(gantt);\r\n\t\t\t},\r\n\t\t\tresourceRow: function(){\r\n\t\t\t\treturn resourceMatrixRenderer(gantt);\r\n\t\t\t},\r\n\t\t\tresourceHistogram: function(){\r\n\t\t\t\treturn resourceHistogramRenderer(gantt);\r\n\t\t\t},\r\n\t\t\tgridTaskRowResizer: function(){\r\n\t\t\t\treturn gridTaskRowResizerRenderer(gantt);\r\n\t\t\t}\r\n\t\t},\r\n\t\tlayersService: {\r\n\t\t\tgetDataRender: function(name){\r\n\t\t\t\treturn layersEngine.getDataRender(name, gantt);\r\n\t\t\t},\r\n\t\t\tcreateDataRender: function(config){\r\n\t\t\t\treturn layersEngine.createDataRender(config, gantt);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default {\r\n\tinit: initUI\r\n};","export default null;","import * as helpers from \"../../../utils/helpers\";\r\nimport getRowRectangle from \"./viewport/get_grid_row_rectangle\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\nimport isInViewPort from \"./viewport/is_grid_row_in_viewport\";\r\n\r\nfunction createGridLineRender(gantt){\r\n\r\n\tfunction _render_grid_item(item, view, config, viewport) {\r\n\t\tvar columns = view.getGridColumns();\r\n\t\tvar templates = view.$getTemplates();\r\n\r\n\t\tvar store = view.$config.rowStore;\r\n\r\n\t\tvar cells = [];\r\n\t\tvar has_child;\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar last = i == columns.length - 1;\r\n\t\t\tvar col = columns[i];\r\n\t\t\tvar cell;\r\n\r\n\t\t\tvar value;\r\n\t\t\tvar textValue;\r\n\t\t\tif (col.name == \"add\") {\r\n\t\t\t\tvar aria = gantt._waiAria.gridAddButtonAttrString(col);\r\n\r\n\t\t\t\tvalue = \" column.width) ? column.min_width : column.width;\r\n\t\t\t\tcolumn.width = (column.max_width && column.max_width < column.width) ? column.max_width : column.width;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (skinset.config.task_height){\r\n\t\tgantt.config.task_height = skinset.config.task_height || \"full\";\r\n\t}\r\n\tif (skinset.config.bar_height){\r\n\t\tgantt.config.bar_height = skinset.config.bar_height || \"full\";\r\n\t}\r\n\r\n\tif (skinset._lightbox_template)\r\n\t\tgantt._lightbox_template = skinset._lightbox_template;\r\n\r\n\tif (skinset._redefine_lightbox_buttons) {\r\n\t\tgantt.config.buttons_right = skinset._redefine_lightbox_buttons[\"buttons_right\"];\r\n\t\tgantt.config.buttons_left = skinset._redefine_lightbox_buttons[\"buttons_left\"];\r\n\t}\r\n\r\n\r\n\tgantt.resetLightbox();\r\n}\r\n\r\n\r\n\r\nexport default function(gantt) {\r\n\t\r\n\tif(!gantt.resetSkin){\r\n\t\tgantt.resetSkin = function () {\r\n\t\t\tthis.skin = \"\";\r\n\t\t\t_get_skin(true, this);\r\n\t\t};\r\n\t\tgantt.skins = {};\r\n\r\n\t\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t\t\t_get_skin(false, this);\r\n\t\t\tmonitorThemeChange();\r\n\t\t});\r\n\t}\r\n\r\n\tgantt._addThemeClass = function(){\r\n\t\tdocument.documentElement.setAttribute(\"data-gantt-theme\", gantt.skin);\r\n\t};\r\n\r\n\tgantt.setSkin = function(value){\r\n\t\tthis.skin = value;\r\n\t\tgantt._addThemeClass();\r\n\t\tmonitorThemeChange();\r\n\t\tif(gantt.$root){\r\n\t\t\t_get_skin(true, gantt);\r\n\t\t\tthis.render();\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t};\r\n\r\n\r\n\tlet monitorIntervalId = null;\r\n\tfunction monitorThemeChange(){\r\n\t\tconst container = gantt.$root;\r\n\t\t\r\n\t\tif(monitorIntervalId){\r\n\t\t\tclearInterval(monitorIntervalId);\r\n\t\t}\r\n\t\t\r\n\t\tif(container){\r\n\t\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-gantt-theme');\r\n\t\t\t\tif(csstheme && csstheme !== gantt.skin){\r\n\t\t\t\t\tgantt.setSkin(csstheme);\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t}\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(monitorIntervalId);\r\n\t});\r\n};","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport isHeadless from \"../../../utils/is_headless\";\r\n\r\nexport default function(gantt){\r\n\r\n\tvar scrollRange = 50,\r\n\t\tscrollStep = 30,\r\n\t\tscrollDelay = 10,\r\n\t\tscrollSpeed = 50;\r\n\r\n\tvar interval = null,\r\n\t\tisMove = false,\r\n\t\tdelayTimeout = null,\r\n\t\tstartPos = {\r\n\t\t\tstarted: false\r\n\t\t},\r\n\t\teventPos = {};\r\n\r\n\r\n\tfunction isDisplayed(element){\r\n\t\treturn element &&\r\n\t\t\tdomHelpers.isChildOf(element, gantt.$root) &&\r\n\t\t\telement.offsetHeight;\r\n\t}\r\n\r\n\tfunction getAutoscrollContainer(){\r\n\t\tvar element;\r\n\t\tif(isDisplayed(gantt.$task)){\r\n\t\t\telement = gantt.$task;\r\n\t\t}else if(isDisplayed(gantt.$grid)){\r\n\t\t\telement = gantt.$grid;\r\n\t\t}else{\r\n\t\t\telement = gantt.$root;\r\n\t\t}\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\tfunction isScrollState() {\r\n\t\tvar dragMarker = !!document.querySelector(\".gantt_drag_marker\");\r\n\t\tvar isResize = !!document.querySelector(\".gantt_drag_marker.gantt_grid_resize_area\")\r\n\t\t\t|| !!document.querySelector(\".gantt_drag_marker.gantt_row_grid_resize_area\") ;\r\n\t\tvar isLink = !!document.querySelector(\".gantt_link_direction\");\r\n\t\tvar state = gantt.getState();\r\n\t\tvar isClickDrag = state.autoscroll;\r\n\t\tisMove = dragMarker && !isResize && !isLink;\r\n\r\n\t\treturn !((!state.drag_mode && !dragMarker) || isResize) || isClickDrag;\r\n\t}\r\n\r\n\tfunction defineDelayTimeout(state) {\r\n\t\tif (delayTimeout) {\r\n\t\t\tclearTimeout(delayTimeout);\r\n\t\t\tdelayTimeout = null;\r\n\t\t}\r\n\t\tif (state) {\r\n\t\t\tvar speed = gantt.config.autoscroll_speed;\r\n\t\t\tif (speed && speed < 10) // limit speed value to 10\r\n\t\t\t\tspeed = 10;\r\n\r\n\t\t\tdelayTimeout = setTimeout(function() {\r\n\t\t\t\tinterval = setInterval(tick, speed || scrollSpeed);\r\n\t\t\t}, gantt.config.autoscroll_delay || scrollDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction defineScrollInterval(state) {\r\n\t\tif (state) {\r\n\t\t\tdefineDelayTimeout(true);\r\n\t\t\tif (!startPos.started) {\r\n\t\t\t\tstartPos.x = eventPos.x;\r\n\t\t\t\tstartPos.y = eventPos.y;\r\n\t\t\t\tstartPos.started = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (interval) {\r\n\t\t\t\tclearInterval(interval);\r\n\t\t\t\tinterval = null;\r\n\t\t\t}\r\n\t\t\tdefineDelayTimeout(false);\r\n\t\t\tstartPos.started = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction autoscrollInterval(event) {\r\n\t\tvar isScroll = isScrollState();\r\n\r\n\t\tif ((interval || delayTimeout) && !isScroll) {\r\n\t\t\tdefineScrollInterval(false);\r\n\t\t}\r\n\r\n\t\tif (!gantt.config.autoscroll || !isScroll) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\teventPos = {\r\n\t\t\tx: event.clientX,\r\n\t\t\ty: event.clientY\r\n\t\t};\r\n\r\n\t\t// if it is a mobile device, we need to detect the touch event coords\r\n\t\tif (event.type == \"touchmove\"){\r\n\t\t\teventPos.x = event.targetTouches[0].clientX;\r\n\t\t\teventPos.y = event.targetTouches[0].clientY;\r\n\t\t}\r\n\r\n\t\tif (!interval && isScroll) {\r\n\t\t\tdefineScrollInterval(true);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction tick() {\r\n\r\n\t\tif (!isScrollState()) {\r\n\t\t\tdefineScrollInterval(false);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar container = getAutoscrollContainer();\r\n\t\tif(!container){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// GS-1150: if we reorder or resize something in the grid, we should obtain the grid container\r\n\t\tvar gridDrag = false;\r\n\t\tvar gridMarkers = [\r\n\t\t\t\".gantt_drag_marker.gantt_grid_resize_area\",\r\n\t\t\t\".gantt_drag_marker .gantt_row.gantt_row_task\",\r\n\t\t\t\".gantt_drag_marker.gantt_grid_dnd_marker\"\r\n\t\t];\r\n\t\tgridMarkers.forEach(function (selector) {\r\n\t\t\tgridDrag = gridDrag || !!document.querySelector(selector);\r\n\t\t});\r\n\t\tif (gridDrag){\r\n\t\t\tcontainer = gantt.$grid;\r\n\t\t}\r\n\r\n\t\tvar box = domHelpers.getNodePosition(container);\r\n\r\n\t\tvar posX = eventPos.x - box.x;\r\n\t\tvar posY = eventPos.y - box.y + window.scrollY; // GS-1315: window.scrollY here and below for the elements above Gantt\r\n\r\n\t\tvar scrollLeft = isMove ? 0 : need_scroll(posX, box.width, startPos.x - box.x);\r\n\t\tvar scrollTop = need_scroll(posY, box.height, startPos.y - box.y + window.scrollY);\r\n\r\n\t\tvar scrollState = gantt.getScrollState();\r\n\r\n\t\tvar currentScrollTop = scrollState.y,\r\n\t\t\tscrollOuterHeight = scrollState.inner_height,\r\n\t\t\tscrollInnerHeight = scrollState.height,\r\n\t\t\tcurrentScrollLeft = scrollState.x,\r\n\t\t\tscrollOuterWidth = scrollState.inner_width,\r\n\t\t\tscrollInnerWidth = scrollState.width;\r\n\r\n\t\t// do scrolling only if we have scrollable area to do so\r\n\t\tif (scrollTop && !scrollOuterHeight) {\r\n\t\t\tscrollTop = 0;\r\n\t\t} else if (scrollTop < 0 && !currentScrollTop) {\r\n\t\t\tscrollTop = 0;\r\n\t\t} else if (scrollTop > 0 && currentScrollTop + scrollOuterHeight >= scrollInnerHeight + 2) {\r\n\t\t\tscrollTop = 0;\r\n\t\t}\r\n\r\n\t\tif (scrollLeft && !scrollOuterWidth) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t} else if (scrollLeft < 0 && !currentScrollLeft) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t} else if (scrollLeft > 0 && currentScrollLeft + scrollOuterWidth >= scrollInnerWidth) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t}\r\n\r\n\t\tvar step = gantt.config.autoscroll_step;\r\n\r\n\t\tif (step && step < 2) // limit step value to 2\r\n\t\t\tstep = 2;\r\n\r\n\t\tscrollLeft = scrollLeft * (step || scrollStep);\r\n\t\tscrollTop = scrollTop * (step || scrollStep);\r\n\r\n\t\tif (scrollLeft || scrollTop) {\r\n\t\t\tscroll(scrollLeft, scrollTop);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction need_scroll(pos, boxSize, startCoord) {\r\n\t\tif ((pos - scrollRange < 0) && (pos < startCoord))\r\n\t\t\treturn -1;\r\n\t\telse if ((pos > boxSize - scrollRange) && (pos > startCoord))\r\n\t\t\treturn 1;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfunction scroll(left, top) {\r\n\t\tvar scrollState = gantt.getScrollState();\r\n\r\n\t\tvar scrollLeft = null,\r\n\t\t\tscrollTop = null;\r\n\r\n\t\tif (left) {\r\n\t\t\tscrollLeft = scrollState.x + left;\r\n\t\t\tscrollLeft = Math.min(scrollState.width, scrollLeft);\r\n\t\t\tscrollLeft = Math.max(0, scrollLeft);\r\n\t\t}\r\n\r\n\t\tif (top) {\r\n\t\t\tscrollTop = scrollState.y + top;\r\n\t\t\tscrollTop = Math.min(scrollState.height, scrollTop);\r\n\t\t\tscrollTop = Math.max(0, scrollTop);\r\n\t\t}\r\n\r\n\t\tgantt.scrollTo(scrollLeft, scrollTop);\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", function() {\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tvar eventElement = domHelpers.getRootNode(gantt.$root) || document.body;\r\n\t\t\tgantt.eventRemove(eventElement, \"mousemove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"mousemove\", autoscrollInterval);\r\n\r\n\t\t\tgantt.eventRemove(eventElement, \"touchmove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"touchmove\", autoscrollInterval);\r\n\r\n\t\t\tgantt.eventRemove(eventElement, \"pointermove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"pointermove\", autoscrollInterval);\r\n\t\t}\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\tdefineScrollInterval(false);\r\n\t});\r\n\r\n};","if (window.jQuery){\r\n\r\n\t(function( $ ){\r\n\r\n\t\tvar methods = [];\r\n\t\t$.fn.dhx_gantt = function(config){\r\n\t\t\tconfig = config || {};\r\n\t\t\tif (typeof(config) === 'string') {\r\n\t\t\t\tif (methods[config] ) {\r\n\t\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t\t}else {\r\n\t\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_gantt');\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvar views = [];\r\n\t\t\t\tthis.each(function() {\r\n\t\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\t\tif (!this.gantt && !(window.gantt.$root == this)){\r\n\r\n\t\t\t\t\t\t\tvar newgantt = (window.gantt.$container && window.Gantt) ? window.Gantt.getGanttInstance():window.gantt;\r\n\t\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\t\tnewgantt.config[key] = config[key];\r\n\r\n\t\t\t\t\t\t\tnewgantt.init(this);\r\n\t\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\t\tnewgantt.parse(config.data);\r\n\r\n\t\t\t\t\t\t\tviews.push(newgantt);\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\tviews.push(typeof this.gantt == \"object\" ? this.gantt : window.gantt);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t\tif (views.length === 1) return views[0];\r\n\t\t\t\treturn views;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t})(window.jQuery);\r\n\r\n}\r\n\r\n\r\nexport default null;","if (window.dhtmlx){\r\n\r\n\tif (!window.dhtmlx.attaches)\r\n\twindow.dhtmlx.attaches = {};\r\n\r\n\twindow.dhtmlx.attaches.attachGantt=function(start, end, gantt){\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\r\n\t\tgantt = gantt || window.gantt;\r\n\r\n\t\tobj.id = \"gantt_\"+ gantt.uid();\r\n\t\tobj.style.width = \"100%\";\r\n\t\tobj.style.height = \"100%\";\r\n\t\tobj.cmp = \"grid\";\r\n\r\n\t\tdocument.body.appendChild(obj);\r\n\t\tthis.attachObject(obj.id);\r\n\t\tthis.dataType = \"gantt\";\r\n\t\tthis.dataObj = gantt;\r\n\r\n\t\tvar that = this.vs[this.av];\r\n\t\tthat.grid = gantt;\r\n\r\n\t\tgantt.init(obj.id, start, end);\r\n\t\tobj.firstChild.style.border = \"none\";\r\n\r\n\t\tthat.gridId = obj.id;\r\n\t\tthat.gridObj = obj;\r\n\r\n\t\tvar method_name=\"_viewRestore\";\r\n\t\treturn this.vs[this[method_name]()].grid;\r\n\t};\r\n\r\n}\r\nif (typeof(window.dhtmlXCellObject) != \"undefined\") {\r\n\r\n\twindow.dhtmlXCellObject.prototype.attachGantt=function(start, end, gantt){\r\n\t\tgantt = gantt || window.gantt;\r\n\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"gantt_\"+gantt.uid();\r\n\t\tobj.style.width = \"100%\";\r\n\t\tobj.style.height = \"100%\";\r\n\t\tobj.cmp = \"grid\";\r\n\r\n\t\tdocument.body.appendChild(obj);\r\n\t\tthis.attachObject(obj.id);\r\n\r\n\t\tthis.dataType = \"gantt\";\r\n\t\tthis.dataObj = gantt;\r\n\r\n\t\tgantt.init(obj.id, start, end);\r\n\t\tobj.firstChild.style.border = \"none\";\r\n\r\n\t\tobj = null;\r\n\t\tthis.callEvent(\"_onContentAttach\",[]);\r\n\r\n\t\treturn this.dataObj;\r\n\t};\r\n}\r\n\r\nexport default null;","import env from \"../../../utils/env\";\r\nimport eventable from \"../../../utils/eventable\";\r\nimport { IScale, TModifierKeys } from \"../../common/config\";\r\n\r\ninterface ITimelineZoomConfig {\r\n\thandler?: (e: Event) => {};\r\n\tstartDate?: Date;\r\n\tendDate?: Date;\r\n\tlevels: IZoomLevel[];\r\n\tactiveLevelIndex?: number;\r\n\twidthStep?: number;\r\n\tminColumnWidth?: number;\r\n\tmaxColumnWidth?: number;\r\n\tuseKey?: \"ctrlKey\" | \"altKey\" | \"shiftKey\";\r\n\ttrigger?: \"wheel\" | null | undefined;\r\n\telement?: Element | (() => Element);\r\n}\r\n\r\nconst USE_KEY = [\"ctrlKey\", \"altKey\", \"shiftKey\", \"metaKey\"];\r\n\r\ninterface IZoomLevel {\r\n\tname?: string;\r\n\tscale_height?: number;\r\n\tmin_column_width: number;\r\n\tscales: IScale[];\r\n}\r\n\r\nconst _defaultScales = [\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"month\",\r\n\t\t\tdate: \"%M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"hour\",\r\n\t\t\tdate: \"%H:00\",\r\n\t\t\tstep: 8\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"hour\",\r\n\t\t\tdate: \"%H:00\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t]\r\n];\r\n\r\nexport default class TimelineZoom {\r\n\tpublic attachEvent: (eventName: string, handler: () => void) => string;\r\n\tpublic callEvent: (eventName: string, args: any[]) => any;\r\n\tpublic detachEvent: (eventName: string) => any;\r\n\tprotected _initialStartDate: Date;\r\n\tprotected _initialEndDate: Date;\r\n\tprotected _activeLevelIndex: number;\r\n\tprotected _levels: IZoomLevel[];\r\n\tprotected _handler: (e: any) => void;\r\n\tprotected $gantt;\r\n\tprotected _widthStep: number;\r\n\tprotected _minColumnWidth: number;\r\n\tprotected _maxColumnWidth: number;\r\n\tprotected _useKey: TModifierKeys;\r\n\tprotected _visibleDate: Date;\r\n\tprotected _initialized: boolean;\r\n\tprotected _domEvents: any;\r\n\r\n\tconstructor(gantt) {\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis._domEvents = this.$gantt._createDomEventScope();\r\n\t}\r\n\r\n\tpublic init(config: ITimelineZoomConfig) {\r\n\t\t// GS-1354 and GS-1318. If we check the headless mode using the function,\r\n\t\t// it will return false when Gantt is not initialized, but we may want to do it later\r\n\t\tif(this.$gantt.env.isNode){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._initialStartDate = config.startDate;\r\n\t\tthis._initialEndDate = config.endDate;\r\n\t\tthis._activeLevelIndex = config.activeLevelIndex ? config.activeLevelIndex : 0;\r\n\t\tthis._levels = this._mapScales(config.levels || _defaultScales);\r\n\t\tthis._handler = config.handler || this._defaultHandler;\r\n\t\tthis._minColumnWidth = config.minColumnWidth || 60;\r\n\t\tthis._maxColumnWidth = config.maxColumnWidth || 240;\r\n\t\tthis._widthStep = config.widthStep || 3/8 * config.minColumnWidth;\r\n\t\tthis._useKey = config.useKey;\r\n\r\n\t\tif(!this._initialized){\r\n\t\t\teventable(this);\r\n\t\t\tthis.$gantt.attachEvent(\"onGanttScroll\", () => {\r\n\t\t\t\tthis._getVisibleDate();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\r\n\t\tif(config.trigger === \"wheel\"){\r\n\t\t\tif(this.$gantt.$root){\r\n\t\t\t\tthis._attachWheelEvent(config);\r\n\t\t\t}else{\r\n\t\t\t\tthis.$gantt.attachEvent(\"onGanttReady\", () => {\r\n\t\t\t\t\tthis._attachWheelEvent(config);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._initialized = true;\r\n\t\tthis.setLevel(this._activeLevelIndex);\r\n\t}\r\n\r\n\tpublic zoomIn = () => {\r\n\t\tconst index = this.getCurrentLevel() - 1;\r\n\t\tif(index < 0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.setLevel(index);\r\n\t};\r\n\r\n\tpublic zoomOut = () => {\r\n\t\tconst index = this.getCurrentLevel() + 1;\r\n\t\tif(index > this._levels.length - 1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.setLevel(index);\r\n\t};\r\n\r\n\tpublic getCurrentLevel = () => {\r\n\t\treturn this._activeLevelIndex;\r\n\t};\r\n\r\n\tpublic getLevels = () => {\r\n\t\treturn this._levels;\r\n\t};\r\n\r\n\tpublic setLevel = (level: number|string) => {\r\n\t\tconst zoomLevel = this._getZoomIndexByName(level);\r\n\r\n\t\tif(zoomLevel === -1){\r\n\t\t\tthis.$gantt.assert(zoomLevel !== -1, \"Invalid zoom level for gantt.ext.zoom.setLevel. \" + level + \" is not an expected value.\");\r\n\t\t}\r\n\t\tthis._setLevel(zoomLevel, 0);\r\n\t};\r\n\r\n\tprotected _getZoomIndexByName = (levelName: number|string) => {\r\n\t\tlet zoomLevel:number = -1;\r\n\t\tif(typeof levelName === \"string\"){\r\n\t\t\tif(!isNaN(Number(levelName)) && this._levels[Number(levelName)]){\r\n\t\t\t\tzoomLevel = Number(levelName);\r\n\t\t\t}else{\r\n\t\t\t\tfor(let i = 0; i < this._levels.length; i++){\r\n\t\t\t\t\tif(this._levels[i].name === levelName){\r\n\t\t\t\t\t\tzoomLevel = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tzoomLevel = levelName;\r\n\t\t}\r\n\t\treturn zoomLevel;\r\n\t};\r\n\r\n\tprotected _mapScales(levels: IScale[][] | any): IZoomLevel[]{\r\n\t\treturn levels.map((l) => {\r\n\t\t\tif(Array.isArray(l)){\r\n\t\t\t\treturn {\r\n\t\t\t\t\tscales: l\r\n\t\t\t\t};\r\n\t\t\t}else{\r\n\t\t\t\treturn l;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprotected _getVisibleDate = () => {\r\n\t\t// GS-1450. Don't try to get the visible date if there is no timeline\r\n\t\tif (!this.$gantt.$task){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst scrollPos = this.$gantt.getScrollState().x;\r\n\t\tconst viewPort = this.$gantt.$task.offsetWidth;\r\n\t\tthis._visibleDate = this.$gantt.dateFromPos(scrollPos + viewPort/2);\r\n\t};\r\n\r\n\tprotected _setLevel = (level: number, cursorOffset: number) => {\r\n\t\tthis._activeLevelIndex = level;\r\n\r\n\t\tconst gantt = this.$gantt;\r\n\t\tconst nextConfig = gantt.copy(this._levels[this._activeLevelIndex]);\r\n\t\tconst chartConfig = gantt.copy(nextConfig);\r\n\t\tdelete chartConfig.name;\r\n\r\n\t\tgantt.mixin(gantt.config, chartConfig, true);\r\n\r\n\t\tconst isRendered = !!gantt.$root && !!gantt.$task;\r\n\r\n\t\tif(isRendered){\r\n\t\t\tif(cursorOffset){\r\n\t\t\t\tconst cursorDate = this.$gantt.dateFromPos(cursorOffset + this.$gantt.getScrollState().x);\r\n\t\t\t\tthis.$gantt.render();\r\n\t\t\t\tconst newPosition = this.$gantt.posFromDate(cursorDate);\r\n\t\t\t\tthis.$gantt.scrollTo(newPosition - cursorOffset);\r\n\t\t\t}else{\r\n\t\t\t\tconst viewPort = this.$gantt.$task.offsetWidth;\r\n\t\t\t\tif(!this._visibleDate){\r\n\t\t\t\t\tthis._getVisibleDate();\r\n\t\t\t\t}\r\n\t\t\t\tconst middleDate = this._visibleDate;\r\n\t\t\t\tthis.$gantt.render();\r\n\t\t\t\tconst newPosition = this.$gantt.posFromDate(middleDate);\r\n\t\t\t\tthis.$gantt.scrollTo(newPosition - viewPort/2);\r\n\t\t\t}\r\n\r\n\t\t\tthis.callEvent(\"onAfterZoom\", [this._activeLevelIndex, nextConfig]);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _attachWheelEvent = (config) => {\r\n\t\tconst event = env.isFF ? \"wheel\" : \"mousewheel\";\r\n\t\tlet el: Element;\r\n\t\tif(typeof config.element === \"function\"){\r\n\t\t\tel = config.element();\r\n\t\t}else{\r\n\t\t\tel = config.element as Element;\r\n\t\t}\r\n\t\tif (!el){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(el, event, this.$gantt.bind(function(e) {\r\n\t\t\tif (this._useKey) {\r\n\t\t\t\tif (USE_KEY.indexOf(this._useKey) < 0) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!e[this._useKey]) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (typeof this._handler === \"function\") {\r\n\t\t\t\tthis._handler.apply(this, [e]);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}, this), {passive: false});\r\n\t};\r\n\r\n\tprivate _defaultHandler = (e: any):void => {\r\n\t\tconst timelineOffset = this.$gantt.$task.getBoundingClientRect().x;\r\n\t\tconst cursorOffset = e.clientX - timelineOffset;\r\n\t\tconst wheelY = this.$gantt.env.isFF ? (e.deltaY*-40) : e.wheelDelta;\r\n\t\tlet wheelUp = false;\r\n\t\tif (wheelY > 0) {\r\n\t\t\twheelUp = true;\r\n\t\t}\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t\tthis._setScaleSettings(wheelUp, cursorOffset);\r\n\t};\r\n\r\n\tprivate _setScaleSettings(wheelUp: boolean, cursorOffset: number) {\r\n\t\tif (wheelUp) {\r\n\t\t\tthis._stepUp(cursorOffset);\r\n\t\t} else {\r\n\t\t\tthis._stepDown(cursorOffset);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _setScaleDates = () => {\r\n\t\tif(this._initialStartDate && this._initialEndDate){\r\n\t\t\tthis.$gantt.config.start_date = this._initialStartDate;\r\n\t\t\tthis.$gantt.config.end_date = this._initialEndDate;\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _stepUp(cursorOffset) {\r\n\t\tif (this._activeLevelIndex >= this._levels.length - 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet nextLevel = this._activeLevelIndex;\r\n\t\tthis._setScaleDates();\r\n\r\n\t\tif(this._widthStep){\r\n\t\t\tlet newColumnWidth = this.$gantt.config.min_column_width + this._widthStep;\r\n\t\t\tif (newColumnWidth > this._maxColumnWidth) {\r\n\t\t\t\tnewColumnWidth = this._minColumnWidth;\r\n\t\t\t\tnextLevel++;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$gantt.config.min_column_width = newColumnWidth;\r\n\t\t}else{\r\n\t\t\tnextLevel++;\r\n\t\t}\r\n\t\tthis._setLevel(nextLevel, cursorOffset);\r\n\t}\r\n\tprivate _stepDown(cursorOffset) {\r\n\t\tif (this._activeLevelIndex < 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet nextLevel = this._activeLevelIndex;\r\n\t\tthis._setScaleDates();\r\n\r\n\t\tif(this._widthStep){\r\n\t\t\tlet newColumnWidth = this.$gantt.config.min_column_width - this._widthStep;\r\n\t\t\tif (newColumnWidth < this._minColumnWidth) {\r\n\t\t\t\tnewColumnWidth = this._maxColumnWidth;\r\n\t\t\t\tnextLevel--;\r\n\t\t\t}\r\n\t\t\tthis.$gantt.config.min_column_width = newColumnWidth;\r\n\t\t}else{\r\n\t\t\tnextLevel--;\r\n\t\t}\r\n\t\tthis._setLevel(nextLevel, cursorOffset);\r\n\t}\r\n}","export default function(gantt) {\r\n\r\n\tgantt.config.touch_drag = 75; //nearly immediate dnd\r\n\tgantt.config.touch = true;\r\n\tgantt.config.touch_feedback = true;\r\n\tgantt.config.touch_feedback_duration = 1;\r\n\tgantt._prevent_touch_scroll = false;\r\n\r\n\r\n\tgantt._touch_feedback = function () {\r\n\t\tif (gantt.config.touch_feedback) {\r\n\t\t\tif (navigator.vibrate)\r\n\t\t\t\tnavigator.vibrate(gantt.config.touch_feedback_duration);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif (gantt.$container)\t{\r\n\t\t\taddTouchEvents();\r\n\t\t}\r\n\t});\r\n\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t\tif (gantt.$container)\t{\r\n\t\t\t\tgantt.attachEvent(\"onGanttRender\", addTouchEvents, {once: true});\r\n\t\t}\r\n\t});\r\n\r\n\tfunction addTouchEvents(){\r\n\t\tif (gantt.config.touch != \"force\")\r\n\t\t\tgantt.config.touch = gantt.config.touch &&\r\n\t\t\t\t((navigator.userAgent.indexOf(\"Mobile\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"iPad\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Android\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Touch\") != -1)) ||\r\n\t\t\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\t\tif (gantt.config.touch) {\r\n\r\n\t\t\tvar touchEventsSupported = true;\r\n\t\t\ttry {\r\n\t\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t\t} catch (e) {\r\n\t\t\t\ttouchEventsSupported = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (touchEventsSupported) {\r\n\t\t\t\tgantt._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function () {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t} else if (window.navigator.pointerEnabled) {\r\n\t\t\t\tgantt._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function (ev) {\r\n\t\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t\t});\r\n\t\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\t\tgantt._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function (ev) {\r\n\t\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tfunction findTargetView(event){\r\n\t\tvar allViews = gantt.$layout.getCellsByType(\"viewCell\");\r\n\r\n\t\tfor(var i = 0; i < allViews.length; i++){\r\n\t\t\tvar box = allViews[i].$view.getBoundingClientRect();\r\n\t\t\tif(event.clientX >= box.left && event.clientX <= box.right &&\r\n\t\t\t\tevent.clientY <= box.bottom && event.clientY >= box.top){\r\n\t\t\t\t\treturn allViews[i];\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getScrollState(view){\r\n\t\tvar scrollX = view.$config.scrollX ? gantt.$ui.getView(view.$config.scrollX) : null;\r\n\t\tvar scrollY = view.$config.scrollY ? gantt.$ui.getView(view.$config.scrollY) : null;\r\n\r\n\t\tvar scrollState = {x: null, y: null};\r\n\t\tif(scrollX){\r\n\t\t\tvar state = scrollX.getScrollState();\r\n\t\t\tif(state.visible){\r\n\t\t\t\tscrollState.x = scrollX.$view.scrollLeft;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(scrollY){\r\n\t\t\tvar state = scrollY.getScrollState();\r\n\t\t\tif(state.visible){\r\n\t\t\t\tscrollState.y = scrollY.$view.scrollTop;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn scrollState;\r\n\t}\r\n\r\n\tfunction scrollView(view, left, top){\r\n\t\tvar scrollX = view.$config.scrollX ? gantt.$ui.getView(view.$config.scrollX) : null;\r\n\t\tvar scrollY = view.$config.scrollY ? gantt.$ui.getView(view.$config.scrollY) : null;\r\n\r\n\t\tif(scrollX){\r\n\t\t\tscrollX.scrollTo(left, null);\r\n\t\t}\r\n\t\tif(scrollY){\r\n\t\t\tscrollY.scrollTo(null, top);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getTaskDND(){\r\n\t\tvar tasksDnD;\r\n\t\tif(gantt.$ui.getView(\"timeline\")){\r\n\t\t\ttasksDnD = gantt.$ui.getView(\"timeline\")._tasks_dnd;\r\n\t\t}\r\n\t\treturn tasksDnD;\r\n\t}\r\n\r\n\tvar touchHandlers = [];\r\n\r\n//we can't use native scrolling, as we need to sync momentum between different parts\r\n//so we will block native scroll and use the custom one\r\n//in future we can add custom momentum\r\n\tgantt._touch_events = function (names, accessor, ignore) {\r\n\t\t//webkit on android need to be handled separately\r\n\t\tvar dblclicktime = 0;\r\n\t\tvar actionMode = false;\r\n\t\tvar scrollMode = false;\r\n\t\tvar actionStart = null;\r\n\t\tvar scrollState;\r\n\t\tvar longTapTimer = null;\r\n\t\tvar currentDndId = null;\r\n\t\tvar dndNodes = [];\r\n\t\tvar targetView = null;\r\n\t\tlet multiTouchEvents = {};\r\n\r\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\r\n\t\t\tgantt.eventRemove(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\r\n\t\t}\r\n\t\ttouchHandlers = [];\r\n\r\n\t\t//touch move\r\n\t\ttouchHandlers.push([gantt.$container, names[0], function (e) {\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\t\tif (ignore(e)) return;\r\n\r\n\t\t\t\t//ignore common and scrolling moves\r\n\t\t\t\tif (!actionMode) return;\r\n\r\n\t\t\t\tif (longTapTimer) clearTimeout(longTapTimer);\r\n\r\n\t\t\t\tvar source = accessor(e);\r\n\t\t\t\tif (tasksDnD && (tasksDnD.drag.id || tasksDnD.drag.start_drag)) {\r\n\t\t\t\t\ttasksDnD.on_mouse_move(source);\r\n\t\t\t\t\tif (e.preventDefault)\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\te.cancelBubble = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!gantt._prevent_touch_scroll) {\r\n\t\t\t\t\tif (source && actionStart) {\r\n\t\t\t\t\t\tvar dx = actionStart.pageX - source.pageX;\r\n\t\t\t\t\t\tvar dy = actionStart.pageY - source.pageY;\r\n\t\t\t\t\t\tif (!scrollMode && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {\r\n\t\t\t\t\t\t\tscrollMode = true;\r\n\t\t\t\t\t\t\t//gantt._touch_scroll_active = scroll_mode = true;\r\n\t\t\t\t\t\t\tdblclicktime = 0;\r\n\r\n\t\t\t\t\t\t\tif(targetView){\r\n\t\t\t\t\t\t\t\tscrollState = getScrollState(targetView);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tscrollState = gantt.getScrollState();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (scrollMode) {\r\n\r\n\t\t\t\t\t\t\tvar newScrollState;\r\n\t\t\t\t\t\t\tvar scrollX = scrollState.x + dx;\r\n\t\t\t\t\t\t\tvar scrollY = scrollState.y + dy;\r\n\t\t\t\t\t\t\tif(targetView){\r\n\t\t\t\t\t\t\t\tscrollView(targetView, scrollX, scrollY);\r\n\t\t\t\t\t\t\t\tnewScrollState = getScrollState(targetView);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tgantt.scrollTo(scrollX, scrollY);\r\n\t\t\t\t\t\t\t\tnewScrollState = gantt.getScrollState();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ((scrollState.x != newScrollState.x && dy > 2 * dx) ||\r\n\t\t\t\t\t\t\t\t(scrollState.y != newScrollState.y && dx > 2 * dy )) {\r\n\t\t\t\t\t\t\t\treturn block_action(e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn block_action(e);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}]);\r\n\r\n\t\t// prevent page drag on touch move\r\n\t\ttry{\r\n\t\t\tdocument.addEventListener('touchmove', function(e) {\r\n\t\t\t\tif (gantt._touch_drag) {\r\n\t\t\t\t\tblock_action(e);\r\n\t\t\t\t}\r\n\t\t\t}, { passive: false });\r\n\t\t}\r\n\t\tcatch(e){\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.warn(\"Cannot prevent touch event for the page drag\");\r\n\t\t}\r\n\r\n\t\t//block touch context menu in IE10\r\n\t\ttouchHandlers.push([this.$container, \"contextmenu\", function (e) {\r\n\t\t\tif (actionMode)\r\n\t\t\t\treturn block_action(e);\r\n\t\t}]);\r\n\r\n\t\t//touch start\r\n\t\ttouchHandlers.push([this.$container, names[1], function (e) {\r\n\t\t\tmultiTouchEvents = e.touches.length;\r\n\t\t\t// block pull-to-refresh\r\n\t\t\tif(document && document.body){\r\n\t\t\t\tdocument.body.classList.add(\"gantt_touch_active\");\r\n\t\t\t}\r\n\r\n\t\t\tif (ignore(e)) return;\r\n\t\t\tif (e.touches && e.touches.length > 1) {\r\n\t\t\t\tactionMode = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tactionStart = accessor(e);\r\n\t\t\ttargetView = findTargetView(actionStart);\r\n\t\t\tif (!gantt._locate_css(actionStart, \"gantt_hor_scroll\") && !gantt._locate_css(actionStart, \"gantt_ver_scroll\")) {\r\n\t\t\t\tactionMode = true;\r\n\t\t\t}\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\t//long tap\r\n\t\t\tlongTapTimer = setTimeout(function () {\r\n\t\t\t\tvar taskId = gantt.locate(actionStart);\r\n\t\t\t\tif (tasksDnD && (taskId && !gantt._locate_css(actionStart, \"gantt_link_control\") && !gantt._locate_css(actionStart, \"gantt_grid_data\"))) {\r\n\t\t\t\t\ttasksDnD.on_mouse_down(actionStart);\r\n\r\n\t\t\t\t\tif (tasksDnD.drag && tasksDnD.drag.start_drag) {\r\n\t\t\t\t\t\t// we need that as touch events break if the target node is removed from the DOM\r\n\t\t\t\t\t\tcloneTaskRendered(taskId);\r\n\t\t\t\t\t\ttasksDnD._start_dnd(actionStart);\r\n\t\t\t\t\t\tgantt._touch_drag = true;\r\n\r\n\t\t\t\t\t\tgantt.refreshTask(taskId);\r\n\r\n\t\t\t\t\t\tgantt._touch_feedback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlongTapTimer = null;\r\n\t\t\t}, gantt.config.touch_drag);\r\n\t\t}]);\r\n\r\n\t\t//touch end\r\n\t\ttouchHandlers.push([this.$container, names[2], function (e) {\r\n\t\t\tif(document && document.body){\r\n\t\t\t\tdocument.body.classList.remove(\"gantt_touch_active\");\r\n\t\t\t}\r\n\t\t\tif (ignore(e)) return;\r\n\t\t\tif (longTapTimer) clearTimeout(longTapTimer);\r\n\t\t\tgantt._touch_drag = false;\r\n\t\t\tactionMode = false;\r\n\t\t\tvar source = accessor(e);\r\n\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\tif(tasksDnD)\r\n\t\t\t\ttasksDnD.on_mouse_up(source);\r\n\r\n\t\t\tif (currentDndId && gantt.isTaskExists(currentDndId)) {\r\n\t\t\t\tgantt.refreshTask(currentDndId);\r\n\t\t\t\tif(dndNodes.length){\r\n\t\t\t\t\tdndNodes.forEach(function(node){\r\n\t\t\t\t\t\tif(node.parentNode){\r\n\t\t\t\t\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tgantt._touch_feedback();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//gantt._touch_scroll_active = action_mode = scroll_mode = false;\r\n\t\t\tactionMode = scrollMode = false;\r\n\t\t\tdndNodes = [];\r\n\t\t\tcurrentDndId = null;\r\n\r\n\t\t\t//dbl-tap handling\r\n\t\t\tif (actionStart && dblclicktime) {\r\n\t\t\t\tvar now = new Date();\r\n\t\t\t\t// doubletap shouldn't happen with multitouch\r\n\t\t\t\tif ((now - dblclicktime) < 500 && multiTouchEvents <= 1) {\r\n\r\n\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\r\n\t\t\t\t\tmouseEvents.onDoubleClick(actionStart);\r\n\t\t\t\t\tblock_action(e);\r\n\t\t\t\t} else\r\n\t\t\t\t\tdblclicktime = now;\r\n\t\t\t} else {\r\n\t\t\t\tdblclicktime = new Date();\r\n\t\t\t}\r\n\t\t}]);\r\n\r\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\r\n\t\t\tgantt.event(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\r\n\t\t}\r\n\r\n\t\t//common helper, prevents event\r\n\t\tfunction block_action(e) {\r\n\t\t\tif (e && e.preventDefault && e.cancelable){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfunction cloneTaskRendered(taskId) {\r\n\t\t\tconst renders = gantt._getTaskLayers();\r\n\t\t\tlet task = gantt.getTask(taskId);\r\n\t\t\tif (task) {\r\n\t\t\t\tlet visible = gantt.isTaskVisible(taskId);\r\n\t\t\t\tif (visible){\r\n\t\t\t\t\tcurrentDndId = taskId;\r\n\t\t\t\t\tfor (let i = 0; i < renders.length; i++) {\r\n\t\t\t\t\t\ttask = renders[i].rendered[taskId];\r\n\t\t\t\t\t\tif (task && task.getAttribute(gantt.config.task_attribute) && task.getAttribute(gantt.config.task_attribute) == taskId) {\r\n\t\t\t\t\t\t\tconst copy = task.cloneNode(true);\r\n\t\t\t\t\t\t\tdndNodes.push(task);\r\n\t\t\t\t\t\t\trenders[i].rendered[taskId] = copy;\r\n\t\t\t\t\t\t\ttask.style.display = \"none\";\r\n\t\t\t\t\t\t\tcopy.className += \" gantt_drag_move \";\r\n\t\t\t\t\t\t\ttask.parentNode.appendChild(copy);\r\n\t\t\t\t\t\t\t//return copy;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (task.$split_subtask){\r\n\t\t\t\t\tlet renderedParent = task.$rendered_parent;\r\n\t\t\t\t\tvisible = gantt.isTaskVisible(renderedParent);\r\n\t\t\t\t\tif (!visible){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcurrentDndId = taskId;\r\n\t\t\t\t\tfor (let i = 0; i < renders.length; i++) {\r\n\t\t\t\t\t\tconst parent = renders[i].rendered[renderedParent];\r\n\t\t\t\t\t\tlet taskNode;\r\n\t\t\t\t\t\tif (parent && parent.childNodes){\r\n\t\t\t\t\t\t\ttaskNode = parent.querySelector(`[${gantt.config.task_attribute}=\"${task.id}\"]`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (taskNode) {\r\n\t\t\t\t\t\t\t// move the child node to a different parent as the task bar will be repainted\r\n\t\t\t\t\t\t\t// and the initial node will be lost\r\n\t\t\t\t\t\t\tconst copy = taskNode.cloneNode(true);\r\n\t\t\t\t\t\t\ttaskNode.parentNode.appendChild(copy);\r\n\r\n\t\t\t\t\t\t\tgantt.$task_bars.appendChild(taskNode);\r\n\t\t\t\t\t\t\ttaskNode.style.display = \"none\";\r\n\r\n\t\t\t\t\t\t\t// don't add the node as rendered otherwise it will be lost:\r\n\t\t\t\t\t\t\t// renders[i].rendered[taskId] = taskNode;\r\n\t\t\t\t\t\t\t// instead, add it to dndNodes as its elements will be removed after drag\r\n\t\t\t\t\t\t\tdndNodes.push(taskNode);\r\n\r\n\t\t\t\t\t\t\ttaskNode = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n};","function dummy() {\r\n\t// eslint-disable-next-line\r\n\tconsole.log(\"Method is not implemented.\"); \r\n}\r\nfunction BaseControl() {\r\n}\r\n\r\n// base methods will be runned in gantt context\r\nBaseControl.prototype.render = dummy; // arguments: sns\r\nBaseControl.prototype.set_value = dummy; // arguments: node, value, ev, sns(config)\r\nBaseControl.prototype.get_value = dummy; // arguments node, ev, sns(config)\r\nBaseControl.prototype.focus = dummy; // arguments: node\r\n\r\nexport default function(gantt) { // we could send current instance of gantt to module\r\n\treturn BaseControl;\r\n};","import * as helpers from \"../../../utils/helpers\";\r\n\r\nvar htmlHelpers = {\r\n\tgetHtmlSelect: function(options, attributes, value) {\r\n\t\tvar innerHTML = \"\";\r\n\t\tvar _this = this;\r\n\r\n\t\toptions = options || [];\r\n\t\t\r\n\t\thelpers.forEach(options, function(entry) {\r\n\t\t\tvar _attributes = [{ key: \"value\", value: entry.key }];\r\n\r\n\t\t\tif (value == entry.key) {\r\n\t\t\t\t_attributes[_attributes.length] = { key: \"selected\", value: \"selected\" };\r\n\t\t\t}\r\n\t\t\tif (entry.attributes) {\r\n\t\t\t\t_attributes = _attributes.concat(entry.attributes);\r\n\t\t\t}\r\n\t\t\tinnerHTML += _this.getHtmlOption({ innerHTML: entry.label }, _attributes);\r\n\t\t});\r\n\r\n\t\treturn _getHtmlContainer(\"select\", { innerHTML: innerHTML }, attributes);\r\n\t},\r\n\tgetHtmlOption: function(options, attributes) { return _getHtmlContainer(\"option\", options, attributes); },\r\n\tgetHtmlButton: function(options, attributes) { return _getHtmlContainer(\"button\", options, attributes); },\r\n\tgetHtmlDiv: function(options, attributes) { return _getHtmlContainer(\"div\", options, attributes); },\r\n\tgetHtmlLabel: function(options, attributes) { return _getHtmlContainer(\"label\", options, attributes); },\r\n\tgetHtmlInput: function(attributes) {\r\n\t\treturn \" \";\r\n\t}\r\n};\r\n\r\nfunction _getHtmlContainer(tag, options, attributes) {\r\n\tvar html;\r\n\r\n\toptions = options || [];\r\n\t\r\n\thtml = \"<\" + tag + _getHtmlAttributes(attributes || []) + \">\" + (options.innerHTML || \"\") + \"\" + tag +\">\";\r\n\treturn html;\r\n\r\n}\r\n\r\nfunction _getHtmlAttributes(attributes) {\r\n\tvar html = \"\";\r\n\r\n\thelpers.forEach(attributes, function(entry) {\r\n\t\thtml += \" \" + entry.key + \"='\" + entry.value + \"'\";\r\n\t});\r\n\treturn html;\r\n}\r\n\r\nexport default htmlHelpers;","import __extends from \"../../../../utils/extends\";\r\nimport htmlHelpers from \"../../utils/html_helpers\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction SelectControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\t\r\n\t\treturn self; \r\n\t}\r\n\t\r\n\t__extends(SelectControl, _super);\r\n\t\r\n\tSelectControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\thtml += htmlHelpers.getHtmlSelect(sns.options, [{ key: \"style\", value: \"width:100%;\" }, { key: \"title\", value: sns.name }]);\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tSelectControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar select = node.firstChild;\r\n\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\tselect.onchange = sns.onchange;\r\n\t\t\tselect._dhx_onchange = true;\r\n\t\t}\r\n\t\tif (typeof value === \"undefined\")\r\n\t\t\tvalue = (select.options[0] || {}).value;\r\n\t\tselect.value = value || \"\";\r\n\t};\r\n\t\r\n\tSelectControl.prototype.get_value = function(node) {\r\n\t\treturn node.firstChild.value;\r\n\t};\r\n\t\r\n\tSelectControl.prototype.focus = function(node) {\r\n\t\tvar a = node.firstChild;\r\n\t\tgantt._focus(a, true);\r\n\t};\r\n\t\r\n\treturn SelectControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\nimport SelectControl from \"./select_control\";\r\nexport default function(gantt) {\r\n\tvar _super = SelectControl(gantt);\r\n\r\n\tfunction ParentControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(ParentControl, _super);\r\n\r\n\r\n\tParentControl.prototype.render = function(sns) {\r\n\t\treturn _display(sns, false);\r\n\t};\r\n\r\n\tParentControl.prototype.set_value = function(node, value, ev, config) {\r\n\t\t// GS-1051. If the value is `0`, the set_value function in the select control won't select \r\n\t\t// the first child because (0 || '') = '';\r\n\t\tif (value === 0) value = \"0\";\r\n\r\n\t\tvar tmpDom = document.createElement(\"div\");\r\n\t\ttmpDom.innerHTML = _display(config, ev.id);\r\n\t\tvar newOptions = tmpDom.removeChild(tmpDom.firstChild);\r\n\t\tnode.onselect = null;\r\n\t\tnode.parentNode.replaceChild(newOptions, node);\r\n\r\n\t\treturn gantt.form_blocks.select.set_value.apply(gantt, [newOptions, value, ev, config]);\r\n\t};\r\n\r\n\tfunction _display(config, item_id) {\r\n\t\tvar tasks = [],\r\n\t\t\toptions = [];\r\n\t\tif (item_id) {\r\n\t\t\ttasks = gantt.getTaskByTime();\r\n\t\t\tif (config.allow_root) {\r\n\t\t\t\ttasks.unshift({id: gantt.config.root_id, text: config.root_label || \"\"});\r\n\t\t\t}\r\n\t\t\ttasks = _filter(tasks, config, item_id);\r\n\t\t\tif (config.sort) {\r\n\t\t\t\ttasks.sort(config.sort);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar text = config.template || gantt.templates.task_text;\r\n\t\tfor (var i = 0; i < tasks.length; i++) {\r\n\t\t\tvar label = text.apply(gantt, [tasks[i].start_date, tasks[i].end_date, tasks[i]]);\r\n\t\t\tif (label === undefined) {\r\n\t\t\t\tlabel = \"\";\r\n\t\t\t}\r\n\t\t\toptions.push({\r\n\t\t\t\tkey: tasks[i].id,\r\n\t\t\t\tlabel: label\r\n\t\t\t});\r\n\t\t}\r\n\t\tconfig.options = options;\r\n\t\tconfig.map_to = config.map_to || \"parent\";\r\n\t\treturn gantt.form_blocks.select.render.apply(this, arguments);\r\n\t}\r\n\r\n\tfunction _filter(options, config, item_id) {\r\n\t\tvar filter = config.filter || function() {\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\t\toptions = options.slice(0);\r\n\r\n\t\tfor (var i = 0; i < options.length; i++) {\r\n\t\t\tvar task = options[i];\r\n\t\t\tif (task.id == item_id || gantt.isChildOf(task.id, item_id) || filter(task.id, task) === false) {\r\n\t\t\t\toptions.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\treturn ParentControl;\r\n};","import TemplateControlConstructor from \"./controls/template_control\";\r\nimport TextareaControlConstructor from \"./controls/textarea_control\";\r\nimport TimeControlConstructor from \"./controls/time_control\";\r\nimport SelectControlConstructor from \"./controls/select_control\";\r\nimport CheckboxControlConstructor from \"./controls/checkbox_control\";\r\nimport RadioControlConstructor from \"./controls/radio_control\";\r\nimport DurationControlConstructor from \"./controls/duration_control\";\r\nimport ParentControlConstructor from \"./controls/parent_control\";\r\nimport ResourcesControlConstructor from \"./controls/resources_control\";\r\nimport ConstraintControlConstructor from \"./controls/constraint_control\";\r\nimport TypeselectControlConstructor from \"./controls/typeselect_control\";\r\nimport BaselineControlConstructor from \"./controls/baseline_control\";\r\n\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport * as helpers from \"../../../utils/helpers\";\r\n\t\r\n\r\nexport default function (gantt) {\r\n\r\n\r\n\tvar TemplateControl = TemplateControlConstructor(gantt);\r\n\tvar TextareaControl = TextareaControlConstructor(gantt);\r\n\tvar TimeControl = TimeControlConstructor(gantt);\r\n\tvar SelectControl = SelectControlConstructor(gantt);\r\n\tvar CheckboxControl = CheckboxControlConstructor(gantt);\r\n\tvar RadioControl = RadioControlConstructor(gantt);\r\n\tvar DurationControl = DurationControlConstructor(gantt);\r\n\tvar ParentControl = ParentControlConstructor(gantt);\r\n\tvar ResourcesControl = ResourcesControlConstructor(gantt);\r\n\tvar ConstraintControl = ConstraintControlConstructor(gantt);\r\n\tvar TypeselectControl = TypeselectControlConstructor(gantt);\r\n\tvar BaselineControl = BaselineControlConstructor(gantt);\r\n\r\n\tgantt._lightbox_methods = {};\r\n\tgantt._lightbox_template = \"
\";\r\n\tgantt._lightbox_template = `
`;\r\n\r\n\t// GS-1952. Attaching the lightbox to the BODY element is not considered secure.\r\n\t// Attach it to Gantt container for Salesforce and other secure environments\r\n\tgantt._lightbox_root = gantt.$root;\r\n\tfunction setParentNode() {\r\n\t\tconst cspEnvironment = gantt.config.csp === true;\r\n\t\tconst salesforceEnvironment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"] || ('$shadowResolver$' in document.body);\r\n\t\tif (cspEnvironment || salesforceEnvironment) {\r\n\t\t\tgantt._lightbox_root = gantt.$root;\r\n\t\t} else {\r\n\t\t\tgantt._lightbox_root = document.body;\r\n\t\t}\r\n\t}\r\n\r\n\t//TODO: gantt._lightbox_id is changed from data.js and accessed from autoscheduling, check if it can be removed from gantt object\r\n\tvar state = gantt.$services.getService(\"state\");\r\n\tstate.registerProvider(\"lightbox\", function () {\r\n\t\treturn {\r\n\t\t\tlightbox: gantt._lightbox_id\r\n\t\t};\r\n\t});\r\n\r\n\tgantt.showLightbox = function (id) {\r\n\t\tvar task = this.getTask(id);\r\n\t\tif (!this.callEvent(\"onBeforeLightbox\", [id])) {\r\n\t\t\tif(gantt.isTaskExists(id) && gantt.getTask(id).$new){\r\n\t\t\t\t//GS-2340 if 'onBeforeLightbox' returns 'false' need update the order in datastore\r\n\t\t\t\tthis.$data.tasksStore._updateOrder();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar box = this.getLightbox(this.getTaskType(task.type));\r\n\r\n\t\tthis.showCover(box);\r\n\t\tthis._fill_lightbox(id, box);\r\n\t\tthis._setLbPosition(box);\r\n\t\tthis._waiAria.lightboxVisibleAttr(box);\r\n\r\n\t\tthis.callEvent(\"onLightbox\", [id]);\r\n\t};\r\n\r\n\tfunction _is_chart_visible(gantt) {\r\n\t\tvar timeline = gantt.$ui.getView(\"timeline\");\r\n\t\tif (timeline && timeline.isVisible()) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgantt._get_timepicker_step = function () {\r\n\t\tif (this.config.round_dnd_dates) {\r\n\t\t\tvar step;\r\n\t\t\tif (_is_chart_visible(this)) {\r\n\t\t\t\tvar scale = gantt.getScale();\r\n\t\t\t\tstep = (helpers.getSecondsInUnit(scale.unit) * scale.step) / 60;//timepicker step is measured in minutes\r\n\t\t\t}\r\n\r\n\t\t\tif (!step || step >= 60 * 24) {\r\n\t\t\t\tstep = this.config.time_step;\r\n\t\t\t}\r\n\t\t\treturn step;\r\n\t\t}\r\n\t\treturn this.config.time_step;\r\n\t};\r\n\tgantt.getLabel = function (property, key) {\r\n\t\tvar sections = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < sections.length; i++) {\r\n\t\t\tif (sections[i].map_to == property) {\r\n\t\t\t\tvar options = sections[i].options;\r\n\t\t\t\tfor (var j = 0; j < options.length; j++) {\r\n\t\t\t\t\tif (options[j].key == key) {\r\n\t\t\t\t\t\treturn options[j].label;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t};\r\n\r\n\tgantt.updateCollection = function (list_name, collection) {\r\n\t\tcollection = collection.slice(0);\r\n\t\tvar list = gantt.serverList(list_name);\r\n\t\tif (!list) return false;\r\n\t\tlist.splice(0, list.length);\r\n\t\tlist.push.apply(list, collection || []);\r\n\t\tgantt.resetLightbox();\r\n\t};\r\n\tgantt.getLightboxType = function () {\r\n\t\treturn this.getTaskType(this._lightbox_type);\r\n\t};\r\n\tgantt.getLightbox = function (type) {\r\n\t\tvar lightboxDiv;\r\n\t\tvar fullWidth;\r\n\t\tvar html;\r\n\t\tvar sns;\r\n\t\tvar ds;\r\n\t\tvar classNames = \"\";\r\n\t\tsetParentNode();\r\n\r\n\t\tif (type === undefined)\r\n\t\t\ttype = this.getLightboxType();\r\n\r\n\t\tif (!this._lightbox || this.getLightboxType() != this.getTaskType(type)) {\r\n\t\t\tthis._lightbox_type = this.getTaskType(type);\r\n\t\t\tlightboxDiv = document.createElement(\"div\");\r\n\t\t\tclassNames = \"gantt_cal_light\";\r\n\t\t\tfullWidth = this._is_lightbox_timepicker();\r\n\r\n\t\t\tif (gantt.config.wide_form)\r\n\t\t\t\tclassNames += \" gantt_cal_light_wide\";\r\n\r\n\t\t\tif (fullWidth) {\r\n\t\t\t\tclassNames += \" gantt_cal_light_full\";\r\n\t\t\t}\r\n\r\n\t\t\tlightboxDiv.className = classNames;\r\n\r\n\t\t\tlightboxDiv.style.visibility = \"hidden\";\r\n\t\t\thtml = this._lightbox_template;\r\n\t\t\thtml += \"\";\r\n\t\t\thtml += getHtmlButtons(this.config.buttons_left);\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += getHtmlButtons(this.config.buttons_right, true);\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\tlightboxDiv.innerHTML = html;\r\n\r\n\t\t\tgantt._waiAria.lightboxAttr(lightboxDiv);\r\n\r\n\t\t\tif (gantt.config.drag_lightbox) {\r\n\t\t\t\tlightboxDiv.firstChild.onmousedown = gantt._ready_to_dnd;\r\n\t\t\t\tlightboxDiv.firstChild.ontouchstart = function (e){\r\n\t\t\t\t\tgantt._ready_to_dnd(e.touches[0]);\r\n\t\t\t\t};\r\n\t\t\t\tlightboxDiv.firstChild.onselectstart = function () {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t};\r\n\t\t\t\tlightboxDiv.firstChild.style.cursor = \"pointer\";\r\n\t\t\t\tgantt._init_dnd_events();\r\n\t\t\t}\r\n\r\n\t\t\t// GS-1428: If there is lightbox node, we need to remove it from the DOM\r\n\t\t\tif (this._lightbox){\r\n\t\t\t\tthis.resetLightbox();\r\n\t\t\t}\r\n\t\t\tshow_cover();\r\n\t\t\tthis._cover.insertBefore(lightboxDiv, this._cover.firstChild);\r\n\t\t\tthis._lightbox = lightboxDiv;\r\n\r\n\t\t\tsns = this._get_typed_lightbox_config(type);\r\n\t\t\thtml = this._render_sections(sns);\r\n\r\n\t\t\tds = lightboxDiv.querySelector(\"div.gantt_cal_larea\");\r\n\t\t\t\r\n\t\t\t//GS-1131. If gantt_cal_larea is displayed, Firefox renders buttons incorrectly;\r\n\t\t\tvar backup_overflow = ds.style.overflow;\r\n\t\t\tds.style.overflow = 'hidden';\r\n\r\n\t\t\tds.innerHTML = html;\r\n\r\n\t\t\t\r\n\r\n\t\t\tbindLabelsToInputs(sns);\r\n\r\n\t\t\tds.style.overflow = backup_overflow;\r\n\r\n\t\t\tthis._init_lightbox_events(this);\r\n\t\t\tlightboxDiv.style.display = \"none\";\r\n\t\t\tlightboxDiv.style.visibility = \"visible\";\r\n\t\t}\r\n\t\treturn this._lightbox;\r\n\t};\r\n\r\n\tgantt._render_sections = function (sns) {\r\n\t\tvar html = \"\";\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar block = this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id = \"area_\" + this.uid();\r\n\r\n\t\t\tvar display = sns[i].hidden ? \" style='display:none'\" : \"\";\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button) {\r\n\t\t\t\tbutton = \"\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"\" +\r\n\t\t\t\t\"\";\r\n\t\t\t}\r\n\t\t\tif (this.config.wide_form) {\r\n\t\t\t\thtml += \"\";\r\n\t\t\t}\r\n\t\t\thtml += \"
\" + button + this.locale.labels[\"section_\" + sns[i].name] + \"
\" + block.render.call(this, sns[i]);\r\n\t\t\thtml += \"
\";\r\n\t\t}\r\n\t\treturn html;\r\n\t};\r\n\r\n\tgantt._center_lightbox = function(box){\r\n\t\tgantt._setLbPosition(box);\r\n\t};\r\n\tgantt._setLbPosition = function(box) {\r\n\t\tif(!box){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst rootElement = gantt._lightbox_root || gantt.$root;\r\n\t\tbox.style.top = Math.max(rootElement.offsetHeight / 2 - box.offsetHeight/2, 0) + \"px\";\r\n\t\tbox.style.left = Math.max(rootElement.offsetWidth / 2 - box.offsetWidth/2, 0) + \"px\";\r\n\t};\r\n\r\n\tgantt.showCover = function (box) {\r\n\t\tif (box){\r\n\t\t\tbox.style.display=\"block\";\r\n\t\r\n\t\t\tthis._setLbPosition(box);\r\n\t\t}\r\n\t\tshow_cover();\r\n\t\tthis._cover.style.display = \"\";\r\n\t};\r\n\tconst show_cover=function(){\r\n\t\tif(gantt._cover) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\tgantt._cover=document.createElement(\"div\");\r\n\t\tgantt._cover.className=\"gantt_cal_cover\";\r\n\t\tgantt._cover.style.display = \"none\";\r\n\t\r\n\t\tgantt.event(gantt._cover, \"mousemove\", gantt._move_while_dnd);\r\n\t\tgantt.event(gantt._cover, \"mouseup\", gantt._finish_dnd);\r\n\t\r\n\t\tconst rootElement = gantt._lightbox_root || gantt.$root;\r\n\t\trootElement.appendChild(gantt._cover);\r\n\t};\r\n\r\n\tgantt._init_lightbox_events = function () {\r\n\t\tgantt.lightbox_events = {};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_save_btn = function () {\r\n\t\t\tgantt._save_lightbox();\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_delete_btn = function () {\r\n\t\t\tgantt._lightbox_current_type = null;\r\n\t\t\tif (!gantt.callEvent(\"onLightboxDelete\", [gantt._lightbox_id]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif (gantt.isTaskExists(gantt._lightbox_id)) {\r\n\t\t\t\tgantt.$click.buttons[\"delete\"](gantt._lightbox_id);\r\n\t\t\t} else {\r\n\t\t\t\tgantt.hideLightbox();\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_cancel_btn = function () {\r\n\t\t\tgantt._cancel_lightbox();\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events[\"default\"] = function (e, src) {\r\n\t\t\tif (src.getAttribute(\"data-dhx-button\")) {\r\n\t\t\t\tgantt.callEvent(\"onLightboxButton\", [src.className, src, e]);\r\n\t\t\t} else {\r\n\t\t\t\tvar index, block, sec;\r\n\r\n\t\t\t\tvar className = domHelpers.getClassName(src);\r\n\t\t\t\tif (className.indexOf(\"gantt_custom_button\") != -1) {\r\n\t\t\t\t\tif (className.indexOf(\"gantt_custom_button_\") != -1) {\r\n\t\t\t\t\t\tindex = src.parentNode.getAttribute(\"data-index\");\r\n\t\t\t\t\t\tsec = src;\r\n\t\t\t\t\t\twhile (sec && domHelpers.getClassName(sec).indexOf(\"gantt_cal_lsection\") == -1) {\r\n\t\t\t\t\t\t\tsec = sec.parentNode;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tindex = src.getAttribute(\"data-index\");\r\n\t\t\t\t\t\tsec = src.parentNode;\r\n\t\t\t\t\t\tsrc = src.firstChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar sections = gantt._get_typed_lightbox_config();\r\n\r\n\t\t\t\tif (index) {\r\n\t\t\t\t\tindex = index * 1;\r\n\t\t\t\t\tblock = gantt.form_blocks[sections[index * 1].type];\r\n\t\t\t\t\tblock.button_click(index, src, sec, sec.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.event(gantt.getLightbox(), \"click\", function (e) {\r\n\t\t\tif(e.target.closest(\".gantt_cal_ltitle_close_btn\")){\r\n\t\t\t\tgantt._cancel_lightbox();\r\n\t\t\t}\r\n\t\t\tvar src = domHelpers.getTargetNode(e);\r\n\r\n\t\t\tvar className = domHelpers.getClassName(src);\r\n\t\t\tif (!className) {\r\n\t\t\t\tsrc = src.previousSibling;\r\n\t\t\t\tclassName = domHelpers.getClassName(src);\r\n\t\t\t}\r\n\t\t\tif (src && className && className.indexOf(\"gantt_btn_set\") === 0) {\r\n\t\t\t\tsrc = src.firstChild;\r\n\t\t\t\tclassName = domHelpers.getClassName(src);\r\n\t\t\t}\r\n\t\t\tif (src && className) {\r\n\t\t\t\tvar func = gantt.defined(gantt.lightbox_events[src.className]) ? gantt.lightbox_events[src.className] : gantt.lightbox_events[\"default\"];\r\n\t\t\t\treturn func(e, src);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\tgantt.getLightbox().onkeydown = function (e) {\r\n\t\t\tvar event = e || window.event;\r\n\t\t\tvar target = e.target || e.srcElement;\r\n\t\t\tvar buttonTarget = domHelpers.getClassName(target).indexOf(\"gantt_btn_set\") > -1;\r\n\r\n\t\t\tswitch ((e || event).keyCode) {\r\n\t\t\t\tcase gantt.constants.KEY_CODES.SPACE: {\r\n\t\t\t\t\tif ((e || event).shiftKey) return;\r\n\t\t\t\t\tif (buttonTarget && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase gantt.keys.edit_save:\r\n\t\t\t\t\tif ((e || event).shiftKey) return;\r\n\t\t\t\t\tif (buttonTarget && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tgantt._save_lightbox();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase gantt.keys.edit_cancel:\r\n\t\t\t\t\tgantt._cancel_lightbox();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\tgantt._cancel_lightbox = function () {\r\n\t\tvar task = this.getLightboxValues();\r\n\t\tgantt._lightbox_current_type = null;\r\n\t\tthis.callEvent(\"onLightboxCancel\", [this._lightbox_id, task.$new]);\r\n\t\tif (gantt.isTaskExists(task.id) && task.$new) {\r\n\t\t\tthis.silent(function () {\r\n\t\t\t\tgantt.$data.tasksStore.removeItem(task.id);\r\n\t\t\t\tgantt._update_flags(task.id, null);\r\n\t\t\t});\r\n\t\t\tthis.refreshData();\r\n\t\t}\r\n\r\n\t\tthis.hideLightbox();\r\n\t};\r\n\r\n\tgantt._save_lightbox = function () {\r\n\t\tvar task = this.getLightboxValues();\r\n\t\tgantt._lightbox_current_type = null;\r\n\t\tif (!this.callEvent(\"onLightboxSave\", [this._lightbox_id, task, !!task.$new]))\r\n\t\t\treturn;\r\n\r\n\t\t// GS-2170. Do not recalculate the indexes and dates of other tasks\r\n\t\t// as they will be recalculated in the `refreshData`\r\n\t\tgantt.$data.tasksStore._skipTaskRecalculation = \"lightbox\";\r\n\t\tif (task.$new) {\r\n\t\t\tdelete task.$new;\r\n\t\t\tthis.addTask(task, task.parent, this.getTaskIndex(task.id));\r\n\t\t} else if (this.isTaskExists(task.id)) {\r\n\t\t\tthis.mixin(this.getTask(task.id), task, true);\r\n\t\t\tthis.refreshTask(task.id);\r\n\t\t\tthis.updateTask(task.id);\r\n\t\t}\r\n\t\tgantt.$data.tasksStore._skipTaskRecalculation = false;\r\n\t\tthis.refreshData();\r\n\r\n\t\t// TODO: do we need any blockable events here to prevent closing lightbox?\r\n\t\tthis.hideLightbox();\r\n\t};\r\n\r\n\tgantt._resolve_default_mapping = function (section) {\r\n\t\tvar mapping = section.map_to;\r\n\t\tvar time_controls = { \"time\": true, \"time_optional\": true, \"duration\": true, \"duration_optional\": true };\r\n\t\tif (time_controls[section.type]) {\r\n\t\t\tif (section.map_to == \"auto\") {\r\n\t\t\t\tmapping = { start_date: \"start_date\", end_date: \"end_date\", duration: \"duration\" };\r\n\t\t\t} else if (typeof (section.map_to) === \"string\") {\r\n\t\t\t\tmapping = { start_date: section.map_to };\r\n\t\t\t}\r\n\t\t} else if (section.type === \"constraint\") {\r\n\t\t\tif (!section.map_to || typeof (section.map_to) === \"string\") {\r\n\t\t\t\tmapping = { constraint_type: \"constraint_type\", constraint_date: \"constraint_date\" };\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn mapping;\r\n\t};\r\n\r\n\tgantt.getLightboxValues = function () {\r\n\t\tvar task = {};\r\n\r\n\t\tif (gantt.isTaskExists(this._lightbox_id)) {\r\n\t\t\ttask = this.mixin({}, this.getTask(this._lightbox_id));\r\n\t\t}\r\n\r\n\t\tvar sns = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar node = gantt._lightbox_root.querySelector(\"#\" + sns[i].id);\r\n\t\t\tnode = (node ? node.nextSibling : node);\r\n\t\t\tvar block = this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue;\r\n\t\t\tvar res = block.get_value.call(this, node, task, sns[i]);\r\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\r\n\t\t\tif (typeof map_to == \"string\" && map_to != \"auto\") {\r\n\t\t\t\ttask[map_to] = res;\r\n\t\t\t} else if (typeof map_to == \"object\") {\r\n\t\t\t\tfor (var property in map_to) {\r\n\t\t\t\t\tif (map_to[property])\r\n\t\t\t\t\t\ttask[map_to[property]] = res[property];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// GS-1282 We need to preserve the task type even if the lightbox doesn't have the typeselect section\r\n\t\t// GS-2460 set the current type from selector\r\n\t\tif (gantt._lightbox_current_type) {\r\n\t\t\ttask.type = gantt._lightbox_current_type;\r\n\t\t}\r\n\r\n\t\treturn task;\r\n\t};\r\n\r\n\r\n\tgantt.hideLightbox = function () {\r\n\t\tvar box = this.getLightbox();\r\n\t\tif (box) box.style.display = \"none\";\r\n\r\n\t\tthis._waiAria.lightboxHiddenAttr(box);\r\n\t\tthis._lightbox_id = null;\r\n\r\n\t\tthis.hideCover(box);\r\n\t\tthis.resetLightbox();\r\n\t\tthis.callEvent(\"onAfterLightbox\", []);\r\n\t};\r\n\tgantt.hideCover = function (box) {\r\n\t\tif(box){\r\n\t\t\tbox.style.display = \"none\";\r\n\t\t}\r\n\t\tif (this._cover)\r\n\t\t\tthis._cover.parentNode.removeChild(this._cover);\r\n\t\tthis._cover = null;\r\n\t};\r\n\r\n\tgantt.resetLightbox = function () {\r\n\t\tif (gantt._lightbox && !gantt._custom_lightbox)\r\n\t\t\tgantt._lightbox.remove();\r\n\t\tgantt._lightbox = null;\r\n\t};\r\n\tgantt._set_lightbox_values = function (data, box) {\r\n\t\tvar task = data;\r\n\t\tvar s = box.getElementsByTagName(\"span\");\r\n\t\tvar lightboxHeader = [];\r\n\t\tif (gantt.templates.lightbox_header) {\r\n\t\t\tlightboxHeader.push(\"\");\r\n\t\t\tlightboxHeader.push(gantt.templates.lightbox_header(task.start_date, task.end_date, task));\r\n\t\t\ts[1].innerHTML = \"\";\r\n\t\t\ts[2].innerHTML = gantt.templates.lightbox_header(task.start_date, task.end_date, task);\r\n\t\t} else {\r\n\t\t\tlightboxHeader.push(this.templates.task_time(task.start_date, task.end_date, task));\r\n\t\t\tlightboxHeader.push(String(this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70)); //IE6 fix\r\n\t\t\ts[1].innerHTML = this.templates.task_time(task.start_date, task.end_date, task);\r\n\t\t\ts[2].innerHTML = String(this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70); //IE6 fix\r\n\t\t}\r\n\t\ts[1].innerHTML = lightboxHeader[0];\r\n\t\ts[2].innerHTML = lightboxHeader[1];\r\n\r\n\t\tgantt._waiAria.lightboxHeader(box, lightboxHeader.join(\" \"));\r\n\r\n\t\tvar sns = this._get_typed_lightbox_config(this.getLightboxType());\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar section = sns[i];\r\n\r\n\t\t\tif (!this.form_blocks[section.type]) {\r\n\t\t\t\tcontinue;//skip incorrect sections, same check is done during rendering\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar node = gantt._lightbox_root.querySelector(\"#\" + section.id).nextSibling;\r\n\t\t\tvar block = this.form_blocks[section.type];\r\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\r\n\t\t\tvar value = this.defined(task[map_to]) ? task[map_to] : section.default_value;\r\n\t\t\tblock.set_value.call(gantt, node, value, task, section);\r\n\r\n\t\t\tif (section.focus)\r\n\t\t\t\tblock.focus.call(gantt, node);\r\n\t\t}\r\n\t\tif (gantt.isTaskExists(data.id)){\r\n\t\t\tgantt._lightbox_id = data.id;\r\n\t\t}\r\n\t};\r\n\tgantt._fill_lightbox = function (id, box) {\r\n\t\tvar task = this.getTask(id);\r\n\t\tthis._set_lightbox_values(task, box);\r\n\t};\r\n\r\n\r\n\tgantt.getLightboxSection = function (name) {\r\n\t\tvar config = this._get_typed_lightbox_config();\r\n\t\tvar i = 0;\r\n\t\tfor (i; i < config.length; i++)\r\n\t\t\tif (config[i].name == name)\r\n\t\t\t\tbreak;\r\n\t\tvar section = config[i];\r\n\t\tif (!section)\r\n\t\t\treturn null;\r\n\r\n\t\tif (!this._lightbox)\r\n\t\t\tthis.getLightbox();\r\n\t\tvar header = gantt._lightbox_root.querySelector(\"#\" + section.id);\r\n\t\tvar node = header.nextSibling;\r\n\r\n\t\tvar result = {\r\n\t\t\tsection: section,\r\n\t\t\theader: header,\r\n\t\t\tnode: node,\r\n\t\t\tgetValue: function (ev) {\r\n\t\t\t\treturn gantt.form_blocks[section.type].get_value.call(gantt, node, (ev || {}), section);\r\n\t\t\t},\r\n\t\t\tsetValue: function (value, ev) {\r\n\t\t\t\treturn gantt.form_blocks[section.type].set_value.call(gantt, node, value, (ev || {}), section);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar handler = this._lightbox_methods[\"get_\" + section.type + \"_control\"];\r\n\t\treturn handler ? handler(result) : result;\r\n\t};\r\n\r\n\tgantt._lightbox_methods.get_template_control = function (result) {\r\n\t\tresult.control = result.node;\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_select_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"select\")[0];\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_textarea_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"textarea\")[0];\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_time_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"select\"); // array\r\n\t\treturn result;\r\n\t};\r\n\r\n\r\n\tgantt._init_dnd_events = function () {\r\n\t\tvar eventElement = gantt._lightbox_root;\r\n\t\tthis.event(eventElement, \"mousemove\", gantt._move_while_dnd);\r\n\t\tthis.event(eventElement, \"mouseup\", gantt._finish_dnd);\r\n\t\tthis.event(eventElement, \"touchmove\", function (e){\r\n\t\t\tgantt._move_while_dnd(e.touches[0]);\r\n\t\t});\r\n\t\tthis.event(eventElement, \"touchend\", function (e){\r\n\t\t\tgantt._finish_dnd(e.touches[0]);\r\n\t\t});\r\n\t\t// GS-1952: In Salesforce environment, the lightbox is attached to the Gantt container. \r\n\t\t// So when Gantt is reinitialized, the events are no longer attached to the Gantt container.\r\n\t\t// gantt._init_dnd_events = function () {\r\n\t\t// };\r\n\t};\r\n\tgantt._move_while_dnd = function (event) {\r\n\t\tif (gantt._dnd_start_lb) {\r\n\t\t\tif (!document.gantt_unselectable) {\r\n\t\t\t\tgantt._lightbox_root.className += \" gantt_unselectable\";\r\n\t\t\t\tdocument.gantt_unselectable = true;\r\n\t\t\t}\r\n\t\t\tvar lb = gantt.getLightbox();\r\n\t\t\tvar now = [event.pageX, event.pageY];\r\n\t\t\tlb.style.top = gantt._lb_start[1] + now[1] - gantt._dnd_start_lb[1] + \"px\";\r\n\t\t\tlb.style.left = gantt._lb_start[0] + now[0] - gantt._dnd_start_lb[0] + \"px\";\r\n\t\t}\r\n\t};\r\n\tgantt._ready_to_dnd = function (event) {\r\n\t\tvar lb = gantt.getLightbox();\r\n\t\tgantt._lb_start = [lb.offsetLeft, lb.offsetTop];\r\n\t\tgantt._dnd_start_lb = [event.pageX, event.pageY];\r\n\t};\r\n\tgantt._finish_dnd = function () {\r\n\t\tif (gantt._lb_start) {\r\n\t\t\tgantt._lb_start = gantt._dnd_start_lb = false;\r\n\t\t\tgantt._lightbox_root.className = gantt._lightbox_root.className.replace(\" gantt_unselectable\", \"\");\r\n\t\t\tdocument.gantt_unselectable = false;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tgantt._focus = function (node, select) {\r\n\t\tif (node && node.focus) {\r\n\t\t\tif (gantt.config.touch) {\r\n\t\t\t\t//do not focus editor, to prevent auto-zoom\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (select && node.select) node.select();\r\n\t\t\t\t\tnode.focus();\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t// silent errors\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tgantt.form_blocks = {\r\n\t\tgetTimePicker: function (sns, hidden) {\r\n\t\t\tvar html = \"\";\r\n\t\t\tvar cfg = this.config;\r\n\t\t\tvar i;\r\n\t\t\tvar options;\r\n\t\t\tvar ariaAttrs;\r\n\t\t\tvar readonly;\r\n\t\t\tvar display;\r\n\t\t\tvar settings = {\r\n\t\t\t\tfirst: 0,\r\n\t\t\t\tlast: 24 * 60,\r\n\t\t\t\tdate: this.date.date_part(new Date(gantt._min_date.valueOf())),\r\n\t\t\t\ttimeFormat: getTimeFormat(sns)\r\n\t\t\t};\r\n\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = { size: 0 };\r\n\r\n\t\t\tif (gantt.config.limit_time_select) {\r\n\t\t\t\tsettings.first = 60 * cfg.first_hour;\r\n\t\t\t\tsettings.last = 60 * cfg.last_hour + 1;\r\n\t\t\t\tsettings.date.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tfor (i = 0; i < settings.timeFormat.length; i++) {\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (i > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions = getHtmlTimePickerOptions(sns, i, settings);\r\n\r\n\t\t\t\tif (options) {\r\n\t\t\t\t\tariaAttrs = gantt._waiAria.lightboxSelectAttrString(settings.timeFormat[i]);\r\n\t\t\t\t\treadonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\tdisplay = hidden ? \" style='display:none' \" : \"\";\r\n\t\t\t\t\thtml += \"\" + options + \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tgetTimePickerValue: function (selects, config, offset) {\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar needSetTime = gantt.defined(map[3]);\r\n\r\n\t\t\tvar time;\r\n\t\t\tvar hours = 0;\r\n\t\t\tvar minutes = 0;\r\n\r\n\t\t\tvar mapOffset = offset || 0;\r\n\r\n\t\t\tif (needSetTime) {\r\n\t\t\t\ttime = parseInt(selects[map[3] + mapOffset].value, 10);\r\n\t\t\t\thours = Math.floor(time / 60);\r\n\t\t\t\tminutes = time % 60;\r\n\t\t\t}\r\n\t\t\treturn new Date(selects[map[2] + mapOffset].value, selects[map[1] + mapOffset].value, selects[map[0] + mapOffset].value, hours, minutes);\r\n\t\t},\r\n\r\n\t\t_fill_lightbox_select: function (s, i, d, map) {\r\n\t\t\ts[i + map[0]].value = d.getDate();\r\n\t\t\ts[i + map[1]].value = d.getMonth();\r\n\t\t\ts[i + map[2]].value = d.getFullYear();\r\n\t\t\tif (gantt.defined(map[3])) {\r\n\t\t\t\tvar v = d.getHours() * 60 + d.getMinutes();\r\n\t\t\t\tv = Math.round(v / gantt._get_timepicker_step()) * gantt._get_timepicker_step();\r\n\t\t\t\tvar input = s[i + map[3]];\r\n\t\t\t\tinput.value = v;\r\n\t\t\t\t//in case option not shown\r\n\t\t\t\tinput.setAttribute(\"data-value\", v);\r\n\t\t\t}\r\n\t\t},\r\n\t\ttemplate: new TemplateControl(),\r\n\t\ttextarea: new TextareaControl(),\r\n\t\tselect: new SelectControl(),\r\n\t\ttime: new TimeControl(),\r\n\t\tduration: new DurationControl(),\r\n\t\tparent: new ParentControl(),\r\n\t\tradio: new RadioControl(),\r\n\t\tcheckbox: new CheckboxControl(),\r\n\t\tresources: new ResourcesControl(),\r\n\t\tconstraint: new ConstraintControl(),\r\n\t\tbaselines: new BaselineControl(),\r\n\t\ttypeselect: new TypeselectControl()\r\n\t};\r\n\r\n\tgantt._is_lightbox_timepicker = function () {\r\n\t\tvar s = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tif (s[i].name == \"time\" && s[i].type == \"time\")\r\n\t\t\t\treturn true;\r\n\t\treturn false;\r\n\t};\r\n\r\n\tgantt._simple_confirm = function (message, title, callback, ok) {\r\n\t\tif (!message)\r\n\t\t\treturn callback();\r\n\t\tvar opts = { text: message };\r\n\t\tif (title)\r\n\t\t\topts.title = title;\r\n\t\tif (ok) {\r\n\t\t\topts.ok = ok;\r\n\t\t}\r\n\t\tif (callback) {\r\n\t\t\topts.callback = function (result) {\r\n\t\t\t\tif (result)\r\n\t\t\t\t\tcallback();\r\n\t\t\t};\r\n\t\t}\r\n\t\tgantt.confirm(opts);\r\n\t};\r\n\r\n\tfunction _get_type_name(type_value) {\r\n\t\tfor (var i in this.config.types) {\r\n\t\t\tif (this.config.types[i] == type_value) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"task\";\r\n\t}\r\n\r\n\tgantt._get_typed_lightbox_config = function (type) {\r\n\t\tif (type === undefined) {\r\n\t\t\ttype = this.getLightboxType();\r\n\t\t}\r\n\r\n\t\tvar field = _get_type_name.call(this, type);\r\n\r\n\t\tif (gantt.config.lightbox[field + \"_sections\"]) {\r\n\t\t\treturn gantt.config.lightbox[field + \"_sections\"];\r\n\t\t} else {\r\n\t\t\treturn gantt.config.lightbox.sections;\r\n\t\t}\r\n\t};\r\n\r\n\tgantt._silent_redraw_lightbox = function (type) {\r\n\t\tvar oldType = this.getLightboxType();\r\n\r\n\t\tif (this.getState().lightbox) {\r\n\t\t\tvar taskId = this.getState().lightbox;\r\n\t\t\tvar formData = this.getLightboxValues(),\r\n\t\t\t\ttask = this.copy(this.getTask(taskId));\r\n\r\n\t\t\tthis.resetLightbox();\r\n\r\n\t\t\tvar updTask = this.mixin(task, formData, true);\r\n\t\t\tvar box = this.getLightbox(type ? type : undefined);\r\n\t\t\tthis._set_lightbox_values(updTask, box);\r\n\t\t\tthis.showCover(box);\r\n\t\t} else {\r\n\t\t\tthis.resetLightbox();\r\n\t\t\tthis.getLightbox(type ? type : undefined);\r\n\t\t}\r\n\t\tthis.callEvent(\"onLightboxChange\", [oldType, this.getLightboxType()]);\r\n\t};\r\n\r\n\tfunction bindLabelsToInputs(sns) {\r\n\t\tvar section;\r\n\t\tvar label;\r\n\t\tvar labelBlock;\r\n\t\tvar inputBlock;\r\n\t\tvar input;\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 0; i < sns.length; i++) {\r\n\t\t\tsection = sns[i];\r\n\t\t\tlabelBlock = gantt._lightbox_root.querySelector(\"#\" + section.id);\r\n\r\n\t\t\tif (!section.id || !labelBlock) continue;\r\n\r\n\t\t\tlabel = labelBlock.querySelector(\"label\");\r\n\t\t\tinputBlock = labelBlock.nextSibling;\r\n\r\n\t\t\tif (!inputBlock) continue;\r\n\r\n\t\t\tinput = inputBlock.querySelector(\"input, select, textarea\");\r\n\t\t\tif (input) {\r\n\t\t\t\tinput.id = input.id || \"input_\" + gantt.uid();\r\n\t\t\t\tsection.inputId = input.id;\r\n\t\t\t\tlabel.setAttribute(\"for\", section.inputId);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getHtmlButtons(buttons, floatRight) {\r\n\t\tvar button;\r\n\t\tvar ariaAttr;\r\n\t\tvar html = \"\";\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 0; i < buttons.length; i++) {\r\n\t\t\t// needed to migrate from 'dhx_something' to 'gantt_something' naming in a lightbox\r\n\t\t\tbutton = gantt.config._migrate_buttons[buttons[i]] ? gantt.config._migrate_buttons[buttons[i]] : buttons[i];\r\n\r\n\t\t\tariaAttr = gantt._waiAria.lightboxButtonAttrString(button);\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\t\treturn html;\r\n\t}\r\n\r\n\tfunction getTimeFormat(sns) {\r\n\t\tvar scale;\r\n\t\tvar unit;\r\n\t\tvar result;\r\n\r\n\t\tif (sns.time_format) return sns.time_format;\r\n\r\n\t\t// default order\r\n\t\tresult = [\"%d\", \"%m\", \"%Y\"];\r\n\t\tscale = gantt.getScale();\r\n\t\tunit = scale ? scale.unit : gantt.config.duration_unit;\r\n\t\tif (helpers.getSecondsInUnit(unit) < helpers.getSecondsInUnit(\"day\")) {\r\n\t\t\tresult.push(\"%H:%i\");\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tfunction getHtmlTimePickerOptions(sns, index, settings) {\r\n\t\tvar range;\r\n\t\tvar offset;\r\n\t\tvar start_year;\r\n\t\tvar end_year;\r\n\t\tvar i;\r\n\t\tvar time;\r\n\t\tvar diff;\r\n\t\tvar tdate;\r\n\t\tvar html = \"\";\r\n\r\n\t\tswitch (settings.timeFormat[index]) {\r\n\t\t\tcase \"%Y\":\r\n\t\t\t\tsns._time_format_order[2] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//year\r\n\r\n\t\t\t\tif (sns.year_range) {\r\n\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t// if\r\n\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trange = range || 10;\r\n\t\t\t\toffset = offset || Math.floor(range / 2);\r\n\t\t\t\tstart_year = start_year || settings.date.getFullYear() - offset;\r\n\t\t\t\tend_year = end_year || gantt.getState().max_date.getFullYear() + offset;\r\n\r\n\t\t\t\tfor (i = start_year; i < end_year; i++)\r\n\t\t\t\t\thtml += \"\" + (i) + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%m\":\r\n\t\t\t\tsns._time_format_order[1] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//month\r\n\t\t\t\tfor (i = 0; i < 12; i++)\r\n\t\t\t\t\thtml += \"\" + gantt.locale.date.month_full[i] + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%d\":\r\n\t\t\t\tsns._time_format_order[0] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//days\r\n\t\t\t\tfor (i = 1; i < 32; i++)\r\n\t\t\t\t\thtml += \"\" + i + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%H:%i\":\r\n\t\t\t\t// var last = 24*60, first = 0;\r\n\t\t\t\tsns._time_format_order[3] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//hours\r\n\t\t\t\ti = settings.first;\r\n\t\t\t\ttdate = settings.date.getDate();\r\n\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\twhile (i < settings.last) {\r\n\t\t\t\t\ttime = gantt.templates.time_picker(settings.date);\r\n\t\t\t\t\thtml += \"\" + time + \" \";\r\n\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\tsettings.date.setTime(settings.date.valueOf() + gantt._get_timepicker_step() * 60 * 1000);\r\n\t\t\t\t\tdiff = (settings.date.getDate() != tdate) ? 1 : 0; // moved or not to the next day\r\n\t\t\t\t\ti = diff * 24 * 60 + settings.date.getHours() * 60 + settings.date.getMinutes();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn html;\r\n\t}\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TemplateControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(TemplateControl, _super);\r\n\r\n\r\n\tTemplateControl.prototype.render = function(sns) {\r\n\t\tlet height = sns.height ? `${sns.height}px` : '';\r\n\t\treturn `
`;\r\n\t};\r\n\r\n\tTemplateControl.prototype.set_value = function(node, value) {\r\n\t\tnode.innerHTML = value || \"\";\r\n\t};\r\n\r\n\tTemplateControl.prototype.get_value = function(node) {\r\n\t\treturn node.innerHTML || \"\";\r\n\t};\r\n\r\n\tTemplateControl.prototype.focus = function() {};\r\n\r\n\treturn TemplateControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TextareaControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(TextareaControl, _super);\r\n\r\n\tTextareaControl.prototype.render = function(sns) {\r\n\t\tconst height = (sns.height || \"130\") + \"px\";\r\n\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\treturn `
`;\r\n\t};\r\n\r\n\tTextareaControl.prototype.set_value = function(node, value) {\r\n\t\tgantt.form_blocks.textarea._get_input(node).value = value || \"\";\r\n\t};\r\n\r\n\tTextareaControl.prototype.get_value = function(node) {\r\n\t\treturn gantt.form_blocks.textarea._get_input(node).value;\r\n\t};\r\n\r\n\tTextareaControl.prototype.focus = function(node) {\r\n\t\tvar a = gantt.form_blocks.textarea._get_input(node);\r\n\t\tgantt._focus(a, true);\r\n\t};\r\n\r\n\tTextareaControl.prototype._get_input = function(node) {\r\n\t\treturn node.querySelector(\"textarea\");\r\n\t};\r\n\r\n\treturn TextareaControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TimeControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TimeControl, _super);\r\n\r\n\tTimeControl.prototype.render = function (sns) {\r\n\t\tvar time = gantt.form_blocks.getTimePicker.call(this, sns);\r\n\t\tlet sectionClassName = \"gantt_section_time\";\r\n\t\tif (sns.name !== \"time\"){\r\n\t\t\tsectionClassName += \" gantt_section_\" + sns.name;\r\n\t\t}\r\n\t\tvar html = \"\";\r\n\t\thtml += time;\r\n\r\n\t\tif (sns.single_date) {\r\n\t\t\ttime = gantt.form_blocks.getTimePicker.call(this, sns, true);\r\n\t\t\thtml += \" \";\r\n\t\t} else {\r\n\t\t\thtml += \" – \";\r\n\t\t}\r\n\r\n\t\thtml += time;\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tTimeControl.prototype.set_value = function (node, value, ev, config) {\r\n\t\tvar cfg = config;\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\r\n\t\tif (cfg.auto_end_date) {\r\n\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\tstart_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, 0, 0);\r\n\t\t\t\tend_date = gantt.calculateEndDate({ start_date: start_date, duration: 1, task: ev });\r\n\t\t\t\tgantt.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\r\n\t\t\t};\r\n\t\t\tfor (var i = 0; i < 4; i++) {\r\n\t\t\t\ts[i].onchange = _update_lightbox_select;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar mapping = gantt._resolve_default_mapping(config);\r\n\r\n\t\tif (typeof (mapping) === \"string\") mapping = { start_date: mapping };\r\n\r\n\t\tvar start_date = ev[mapping.start_date] || new Date();\r\n\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\r\n\t};\r\n\r\n\tTimeControl.prototype.get_value = function (node, ev, config) {\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar startDate;\r\n\t\tvar map = config._time_format_order;\r\n\t\tfunction _getEndDate(selects, map, startDate) {\r\n\t\t\tvar endDate = gantt.form_blocks.getTimePickerValue(selects, config, map.size);\r\n\t\t\t// GS-1010: We need to add a way to obtain exact end_date for validation\r\n\t\t\tif (endDate <= startDate) { // when end date seems wrong\r\n\t\t\t\tif (config.autofix_end !== false || config.single_date) { // auto correct it in two cases - when the auto correction is not disabled, or when we have 'single date' control and the user don't have the UI to specify the end date\r\n\t\t\t\t\treturn gantt.date.add(startDate, gantt._get_timepicker_step(), \"minute\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn endDate;\r\n\t\t}\r\n\r\n\t\tstartDate = gantt.form_blocks.getTimePickerValue(selects, config);\r\n\r\n\t\tif (typeof gantt._resolve_default_mapping(config) === \"string\") {\r\n\t\t\treturn startDate;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: startDate,\r\n\t\t\tend_date: _getEndDate(selects, map, startDate)\r\n\t\t};\r\n\t};\r\n\r\n\tTimeControl.prototype.focus = function (node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\treturn TimeControl;\r\n};","import * as helpers from \"../../../../utils/helpers\";\r\nimport __extends from \"../../../../utils/extends\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction CheckboxControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(CheckboxControl, _super);\r\n\r\n\tCheckboxControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tif (sns.options && sns.options.length) {\r\n\t\t\tfor (var i = 0; i < sns.options.length; i++) {\r\n\t\t\t\thtml += \" \" + sns.options[i].label + \" \";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tsns.single_value = true;\r\n\t\t\thtml += \" \";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tCheckboxControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar checkboxes = Array.prototype.slice.call(node.querySelectorAll(\"input[type=checkbox]\"));\r\n\r\n\t\tif (!node._dhx_onchange && sns.onchange) {\r\n\t\t\tnode.onchange = sns.onchange;\r\n\t\t\tnode._dhx_onchange = true;\r\n\t\t}\r\n\r\n\t\tif(sns.single_value){\r\n\t\t\tvar box = checkboxes[0];\r\n\t\t\tbox.checked = !!value;\r\n\t\t}else{\r\n\t\t\thelpers.forEach(checkboxes, function(entry) {\r\n\t\t\t\tentry.checked = value ? value.indexOf(entry.value) >= 0 : false;\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tCheckboxControl.prototype.get_value = function(node, task, sns) {\r\n\t\tif(sns.single_value){\r\n\t\t\tvar box = node.querySelector(\"input[type=checkbox]\");\r\n\t\t\treturn box.checked;\r\n\t\t}else{\r\n\t\t\treturn helpers.arrayMap(Array.prototype.slice.call(node.querySelectorAll(\"input[type=checkbox]:checked\")), function(entry) {\r\n\t\t\t\treturn entry.value;\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tCheckboxControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.querySelector(\"input[type=checkbox]\"));\r\n\t};\r\n\r\n\treturn CheckboxControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction RadioControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(RadioControl, _super);\r\n\r\n\tRadioControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `${sns.height}px` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tif (sns.options && sns.options.length) {\r\n\t\t\tfor (var i = 0; i < sns.options.length; i++) {\r\n\t\t\t\thtml += \" \" + sns.options[i].label + \" \";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tRadioControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar radio;\r\n\r\n\t\tif (!sns.options || !sns.options.length) return;\r\n\r\n\t\tradio = node.querySelector(\"input[type=radio][value='\" + value + \"']\") ||\r\n\t\t\t\tnode.querySelector(\"input[type=radio][value='\" + sns.default_value + \"']\");\r\n\r\n\t\tif (!radio) return;\r\n\r\n\t\tif (!node._dhx_onchange && sns.onchange) {\r\n\t\t\tnode.onchange = sns.onchange;\r\n\t\t\tnode._dhx_onchange = true;\r\n\t\t}\r\n\r\n\t\tradio.checked = true;\r\n\t};\r\n\r\n\tRadioControl.prototype.get_value = function(node, ev) {\r\n\t\tvar result = node.querySelector(\"input[type=radio]:checked\");\r\n\r\n\t\treturn result ? result.value : \"\";\r\n\t};\r\n\r\n\tRadioControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.querySelector(\"input[type=radio]\"));\r\n\t};\r\n\r\n\treturn RadioControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport DurationFormatterNumeric from \"../../../common/duration_formatter_numeric\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction DurationControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || new DurationFormatterNumeric();\r\n\t}\r\n\r\n\t__extends(DurationControl, _super);\r\n\r\n\tDurationControl.prototype.render = function(sns) {\r\n\t\tvar time = \"\" + gantt.form_blocks.getTimePicker.call(this, sns) + \"
\";\r\n\t\tvar label = \" \"+ gantt.locale.labels[gantt.config.duration_unit + \"s\"] +\" \";\r\n\t\tvar singleDate = sns.single_date ? \" style='display:none'\" : \"\";\r\n\t\tvar readonly = sns.readonly ? \" disabled='disabled'\" : \"\";\r\n\t\tvar ariaAttr = gantt._waiAria.lightboxDurationInputAttrString(sns);\r\n\r\n\t\tvar durationInputClass = \"gantt_duration_value\";\r\n\t\tif(sns.formatter) {\r\n\t\t\tlabel = \"\";\r\n\t\t\tdurationInputClass += \" gantt_duration_value_formatted\" ;\r\n\t\t}\r\n\r\n\t\tvar duration = \"\" +\r\n\t\t\t\"\";\r\n\t\tlet sectionClassName = \"gantt_section_time gantt_section_duration\";\r\n\t\tif (sns.name !== \"time\"){\r\n\t\t\tsectionClassName += \" gantt_section_\" + sns.name;\r\n\t\t}\t\r\n\t\tvar html = \"\" + time + \" \" + duration + \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tDurationControl.prototype.set_value = function(node, value, ev, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar inps = node.getElementsByTagName(\"input\");\r\n\t\tvar duration = inps[1];\r\n\t\tvar btns = [inps[0], inps[2]];\r\n\t\tvar endspan = node.getElementsByTagName(\"span\")[0];\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar mapping;\r\n\t\tvar start_date;\r\n\t\tvar end_date;\r\n\t\tvar duration_val;\r\n\r\n\t\tfunction _calc_date() {\r\n\t\t\tvar start_date = _getStartDate.call(gantt, node, config);\r\n\t\t\tvar duration = _getDuration.call(gantt, node, config);\r\n\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\r\n\r\n\t\t\tvar template = gantt.templates.task_end_date || gantt.templates.task_date;\r\n\t\t\tendspan.innerHTML = template(end_date);\r\n\t\t}\r\n\r\n\t\tfunction _change_duration(step) {\r\n\t\t\tvar value = duration.value;\r\n\r\n\t\t\tvalue = getFormatter(config).parse(value);\r\n\t\t\tif (window.isNaN(value))\r\n\t\t\t\tvalue = 0;\r\n\t\t\tvalue += step;\r\n\t\t\tif (value < 1) value = 1;\r\n\t\t\tduration.value = getFormatter(config).format(value);\r\n\t\t\t_calc_date();\r\n\t\t}\r\n\r\n\t\tbtns[0].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t}, this);\r\n\t\tbtns[1].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t}, this);\r\n\t\ts[0].onchange = _calc_date;\r\n\t\ts[1].onchange = _calc_date;\r\n\t\ts[2].onchange = _calc_date;\r\n\t\tif (s[3]) s[3].onchange = _calc_date;\r\n\r\n\t\tduration.onkeydown = gantt.bind(function(e) {\r\n\t\t\tvar code; \r\n\r\n\t\t\te = e || window.event;\r\n\t\t\tcode = (e.charCode || e.keyCode || e.which);\r\n\t\t\t\r\n\t\t\tif (code == gantt.constants.KEY_CODES.DOWN) {\r\n\t\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (code == gantt.constants.KEY_CODES.UP) {\r\n\t\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\twindow.setTimeout(_calc_date, 1);\r\n\t\t}, this);\r\n\r\n\t\tduration.onchange = gantt.bind(_calc_date, this);\r\n\r\n\t\tmapping = gantt._resolve_default_mapping(config);\r\n\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\r\n\r\n\t\tstart_date = ev[mapping.start_date] || new Date();\r\n\t\tend_date = ev[mapping.end_date] || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\t\tduration_val = Math.round(ev[mapping.duration]) || gantt.calculateDuration({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: end_date,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\t\tduration_val = getFormatter(config).format(duration_val);\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, config);\r\n\t\tduration.value = duration_val;\r\n\t\t_calc_date();\r\n\t};\r\n\r\n\tDurationControl.prototype.get_value = function(node, ev, config) {\r\n\t\tvar startDate = _getStartDate(node, config);\r\n\t\tvar duration = _getDuration(node, config);\r\n\t\tvar endDate = gantt.calculateEndDate({start_date: startDate, duration: duration, task: ev});\r\n\r\n\t\tif (typeof gantt._resolve_default_mapping(config) == \"string\") {\r\n\t\t\treturn startDate;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: startDate,\r\n\t\t\tend_date: endDate,\r\n\t\t\tduration: duration\r\n\t\t};\r\n\t};\r\n\r\n\tDurationControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\r\n\tfunction _getStartDate(node, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar hours = 0;\r\n\t\tvar minutes = 0;\r\n\r\n\t\tif (gantt.defined(map[3])) {\r\n\t\t\tvar input = s[map[3]];\r\n\t\t\tvar time = parseInt(input.value, 10);\r\n\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\r\n\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\r\n\t\t\t}\r\n\r\n\t\t\thours = Math.floor(time / 60);\r\n\t\t\tminutes = time % 60;\r\n\t\t}\r\n\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\r\n\t}\r\n\r\n\tfunction _getDuration(node, config) {\r\n\t\tvar duration = node.getElementsByTagName(\"input\")[1];\r\n\r\n\t\tduration = getFormatter(config).parse(duration.value);\r\n\t\tif (!duration || window.isNaN(duration)) duration = 1;\r\n\t\tif (duration < 0) duration *= -1;\r\n\t\treturn duration;\r\n\t}\r\n\r\n\treturn DurationControl; \r\n};","import __extends from \"../../../../utils/extends\";\r\nimport htmlHelpers from \"../../utils/html_helpers\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction ConstraintControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(ConstraintControl, _super);\r\n\r\n\tfunction isNonTimedConstraint(value) {\r\n\t\tif (!value || value === gantt.config.constraint_types.ASAP || value === gantt.config.constraint_types.ALAP) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction toggleTimeSelect(timeSelects, typeValue) {\r\n\t\tvar isNonTimed = isNonTimedConstraint(typeValue);\r\n\t\tfor (var i = 0; i < timeSelects.length; i++) {\r\n\t\t\ttimeSelects[i].disabled = isNonTimed;\r\n\t\t}\r\n\t}\r\n\r\n\tConstraintControl.prototype.render = function (sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tvar options = [];\r\n\t\tfor (var i in gantt.config.constraint_types) {\r\n\t\t\toptions.push({ key: gantt.config.constraint_types[i], label: gantt.locale.labels[gantt.config.constraint_types[i]] });\r\n\t\t}\r\n\r\n\t\tsns.options = sns.options || options;\r\n\r\n\t\thtml += \"\" + htmlHelpers.getHtmlSelect(sns.options, [{ key: \"data-type\", value: \"constraint-type\" }]) + \" \";\r\n\r\n\t\tvar timeLabel = gantt.locale.labels[\"constraint_date\"] || \"Constraint date\";\r\n\t\thtml += \"\" + timeLabel + \": \" + gantt.form_blocks.getTimePicker.call(this, sns) + \" \";\r\n\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tConstraintControl.prototype.set_value = function (node, value, task, config) {\r\n\t\tvar typeSelect = node.querySelector(\"[data-constraint-type-select] select\");\r\n\t\tvar timeSelects = node.querySelectorAll(\"[data-constraint-time-select] select\");\r\n\t\tvar map = config._time_format_order;\r\n\r\n\t\tvar mapping = gantt._resolve_default_mapping(config);\r\n\r\n\t\tif (!typeSelect._eventsInitialized) {\r\n\t\t\ttypeSelect.addEventListener(\"change\", function (e) {\r\n\t\t\t\ttoggleTimeSelect(timeSelects, e.target.value);\r\n\t\t\t});\r\n\t\t\ttypeSelect._eventsInitialized = true;\r\n\t\t}\r\n\r\n\t\tvar constraintDate = task[mapping.constraint_date] || new Date();\r\n\t\tgantt.form_blocks._fill_lightbox_select(timeSelects, 0, constraintDate, map, config);\r\n\r\n\t\tvar constraintType = task[mapping.constraint_type] || gantt.getConstraintType(task);\r\n\t\ttypeSelect.value = constraintType;\r\n\t\ttoggleTimeSelect(timeSelects, constraintType);\r\n\t};\r\n\r\n\tConstraintControl.prototype.get_value = function (node, task, config) {\r\n\t\tvar typeSelect = node.querySelector(\"[data-constraint-type-select] select\");\r\n\t\tvar timeSelects = node.querySelectorAll(\"[data-constraint-time-select] select\");\r\n\r\n\t\tvar constraintType = typeSelect.value;\r\n\t\tvar constraintDate = null;\r\n\t\tif (!isNonTimedConstraint(constraintType)) {\r\n\t\t\tconstraintDate = gantt.form_blocks.getTimePickerValue(timeSelects, config);\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tconstraint_type: constraintType,\r\n\t\t\tconstraint_date: constraintDate\r\n\t\t};\r\n\t};\r\n\r\n\tConstraintControl.prototype.focus = function (node) {\r\n\t\tgantt._focus(node.querySelector(\"select\"));\r\n\t};\r\n\r\n\treturn ConstraintControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./select_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TypeselectControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TypeselectControl, _super);\r\n\r\n\tTypeselectControl.prototype.render = function(sns) {\r\n\t\tvar types = gantt.config.types,\r\n\t\t\tlocale = gantt.locale.labels,\r\n\t\t\toptions = [];\r\n\r\n\t\tvar filter = sns.filter || function (typeKey, typeValue) {\r\n\t\t\tif (!types.placeholder || typeValue !== types.placeholder) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tfor (var i in types) {\r\n\t\t\tif (!filter(i, types[i]) === false) {\r\n\t\t\t\toptions.push({ key: types[i], label: locale[\"type_\" + i] });\r\n\t\t\t}\r\n\t\t}\r\n\t\tsns.options = options;\r\n\r\n\t\tvar oldOnChange = sns.onchange;\r\n\t\tsns.onchange = function () {\r\n\t\t\tgantt._lightbox_current_type = this.value;\r\n\t\t\tgantt.changeLightboxType(this.value);\r\n\t\t\tif (typeof oldOnChange == 'function') {\r\n\t\t\t\toldOnChange.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn _super.prototype.render.apply(this, arguments);\r\n\t};\r\n\r\n\treturn TypeselectControl;\r\n};\r\n","\r\nimport __extends from \"../../../../utils/extends\";\r\nimport DurationFormatterNumeric from \"../../../common/duration_formatter_numeric\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction DurationControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || new DurationFormatterNumeric();\r\n\t}\r\n\r\n\tfunction _generateBaselineRow (node, baseline, task, config){\r\n\t\tconst time = \"\" + gantt.form_blocks.getTimePicker.call(gantt, config) + \"
\";\r\n\t\tlet durationLabel = \" \"+ gantt.locale.labels[gantt.config.duration_unit + \"s\"] +\" \";\r\n\t\tconst singleDate = config.single_date ? \" style='display:none'\" : \"\";\r\n\t\tconst readonly = config.readonly ? \" disabled='disabled'\" : \"\";\r\n\t\tconst ariaAttr = gantt._waiAria.lightboxDurationInputAttrString(config);\r\n\t\tconst deleteLabel = gantt.locale.labels.baselines_remove_button;\r\n\r\n\t\tlet durationInputClass = \"gantt_duration_value\";\r\n\t\tif(config.formatter) {\r\n\t\t\tdurationLabel = \"\";\r\n\t\t\tdurationInputClass += \" gantt_duration_value_formatted\";\r\n\t\t}\r\n\r\n\t\tconst durationEl = \"\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = ``;\r\n\r\n\t\tconst baselineRow = document.createElement(\"div\");\r\n\t\tbaselineRow.className = \"gantt_section_time gantt_section_duration\";\r\n\t\tbaselineRow.setAttribute(\"data-baseline-id\", baseline.id);\r\n\t\tbaselineRow.innerHTML = time + durationEl + deleteButton + \" \";\r\n\t\tnode.appendChild(baselineRow);\r\n\r\n\t\tvar s = baselineRow.getElementsByTagName(\"select\");\r\n\t\tvar inps = baselineRow.getElementsByTagName(\"input\");\r\n\t\tvar duration = inps[1];\r\n\t\tvar btns = [inps[0], inps[2]];\r\n\t\tvar endspan = baselineRow.getElementsByTagName(\"span\")[0];\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar mapping;\r\n\t\tvar start_date;\r\n\t\tvar end_date;\r\n\t\tvar duration_val;\r\n\r\n\t\tconst deleteEl = baselineRow.querySelector(\".baseline_delete_button\");\r\n\t\tdeleteEl.onclick = function(e){\r\n\t\t\tconst section = baselineRow.parentNode;\r\n\t\t\tbaselineRow.innerHTML = \"\";\r\n\t\t\tbaselineRow.remove();\r\n\t\t\tif (section.innerHTML === \"\"){\r\n\t\t\t\tsection.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\r\n\t\tfunction _calc_date() {\r\n\t\t\tvar start_date = _getStartDate.call(gantt, baselineRow, config);\r\n\t\t\tvar duration = _getDuration.call(gantt, baselineRow, config);\r\n\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: task});\r\n\r\n\t\t\tvar template = gantt.templates.task_end_date || gantt.templates.task_date;\r\n\t\t\tendspan.innerHTML = template(end_date);\r\n\t\t}\r\n\r\n\t\tfunction _change_duration(step) {\r\n\t\t\tvar value = duration.value;\r\n\r\n\t\t\tvalue = getFormatter(config).parse(value);\r\n\t\t\tif (window.isNaN(value))\r\n\t\t\t\tvalue = 0;\r\n\t\t\tvalue += step;\r\n\t\t\tif (value < 1) value = 1;\r\n\t\t\tduration.value = getFormatter(config).format(value);\r\n\t\t\t_calc_date();\r\n\t\t}\r\n\r\n\t\tbtns[0].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t}, gantt);\r\n\t\tbtns[1].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t}, gantt);\r\n\t\ts[0].onchange = _calc_date;\r\n\t\ts[1].onchange = _calc_date;\r\n\t\ts[2].onchange = _calc_date;\r\n\t\tif (s[3]) s[3].onchange = _calc_date;\r\n\r\n\t\tduration.onkeydown = gantt.bind(function(e) {\r\n\t\t\tvar code; \r\n\r\n\t\t\te = e || window.event;\r\n\t\t\tcode = (e.charCode || e.keyCode || e.which);\r\n\t\t\t\r\n\t\t\tif (code == gantt.constants.KEY_CODES.DOWN) {\r\n\t\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (code == gantt.constants.KEY_CODES.UP) {\r\n\t\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\twindow.setTimeout(_calc_date, 1);\r\n\t\t}, gantt);\r\n\r\n\t\tduration.onchange = gantt.bind(_calc_date, gantt);\r\n\r\n\t\tmapping = gantt._resolve_default_mapping(config);\r\n\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\r\n\r\n\t\tstart_date = baseline.start_date || new Date();\r\n\t\tend_date = baseline.end_date || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask\r\n\t\t});\r\n\t\tduration_val = gantt.calculateDuration({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: end_date,\r\n\t\t\ttask\r\n\t\t});\r\n\t\tduration_val = getFormatter(config).format(duration_val);\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, config);\r\n\t\tduration.value = duration_val;\r\n\t\t_calc_date();\r\n\t}\r\n\r\n\t__extends(DurationControl, _super);\r\n\r\n\tDurationControl.prototype.render = function(sns) {\r\n\t\tconst baselineSection = `
`;\r\n\t\treturn baselineSection;\r\n\t};\r\n\r\n\tDurationControl.prototype.set_value = function(node, value, task, config) {\r\n\t\tif (task.baselines){\r\n\t\t\tnode.innerHTML = \"\";\r\n\r\n\t\t\ttask.baselines.forEach((baseline)=>{\r\n\t\t\t\t_generateBaselineRow(node, baseline, task, config);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tnode.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t}\t\t\r\n\r\n\t};\r\n\r\n\tDurationControl.prototype.get_value = function(node, task, config) {\r\n\t\tconst baselines = [];\r\n\t\tconst baselineRows = node.querySelectorAll(`[data-baseline-id]`);\r\n\t\tbaselineRows.forEach((baselineNode)=>{\r\n\t\t\tconst baselineId = baselineNode.dataset.baselineId;\r\n\t\t\tconst baselineStore = gantt.getDatastore(\"baselines\");\r\n\t\t\tlet baseline = baselineStore.getItem(baselineId);\r\n\t\t\tlet updatedBaseline;\r\n\t\t\tif (baseline){\r\n\t\t\t\tupdatedBaseline = gantt.copy(baseline);\r\n\t\t\t} else {\r\n\t\t\t\tupdatedBaseline = {\r\n\t\t\t\t\tid: gantt.uid(),\r\n\t\t\t\t\ttask_id: task.id,\r\n\t\t\t\t\ttext: \"Baseline 1\"\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tupdatedBaseline.start_date = _getStartDate(baselineNode, config);\r\n\t\t\tupdatedBaseline.duration = _getDuration(baselineNode, config);\r\n\t\t\tupdatedBaseline.end_date = gantt.calculateEndDate({start_date: updatedBaseline.start_date, duration: updatedBaseline.duration, task});\r\n\r\n\t\t\tbaselines.push(updatedBaseline);\r\n\t\t});\r\n\r\n\t\treturn baselines;\r\n\t};\r\n\r\n\tDurationControl.prototype.button_click = function (index, el, section, container) {\r\n\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (el.closest(\".gantt_custom_button.gantt_remove_baselines\")){\r\n\t\t\tcontainer.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t}\r\n\t\tif (el.closest(\".gantt_custom_button.gantt_add_baselines\")){\r\n\t\t\tif (container.innerHTML == gantt.locale.labels.baselines_section_placeholder){\r\n\t\t\t\tcontainer.innerHTML = \"\";\r\n\t\t\t}\r\n\t\t\tconst task = gantt.getTask(gantt._lightbox_id);\r\n\t\t\tconst baseline = {\r\n\t\t\t\tid: gantt.uid(),\r\n\t\t\t\ttask_id: task.id,\r\n\t\t\t\ttext: \"Baseline 1\",\r\n\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\tend_date: task.end_date\r\n\t\t\t};\r\n\t\t\tconst config = gantt._get_typed_lightbox_config()[index];\r\n\t\t\t_generateBaselineRow(container, baseline, task, config);\r\n\t\t}\r\n\t};\r\n\r\n\tDurationControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\r\n\tfunction _getStartDate(node, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar hours = 0;\r\n\t\tvar minutes = 0;\r\n\r\n\t\tif (gantt.defined(map[3])) {\r\n\t\t\tvar input = s[map[3]];\r\n\t\t\tvar time = parseInt(input.value, 10);\r\n\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\r\n\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\r\n\t\t\t}\r\n\r\n\t\t\thours = Math.floor(time / 60);\r\n\t\t\tminutes = time % 60;\r\n\t\t}\r\n\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\r\n\t}\r\n\r\n\tfunction _getDuration(node, config) {\r\n\t\tvar duration = node.getElementsByTagName(\"input\")[1];\r\n\r\n\t\tduration = getFormatter(config).parse(duration.value);\r\n\t\tif (!duration || window.isNaN(duration)) duration = 1;\r\n\t\tif (duration < 0) duration *= -1;\r\n\t\treturn duration;\r\n\t}\r\n\r\n\treturn DurationControl; \r\n};","import * as utils from \"../utils/utils\";\r\nimport env from \"../utils/env\";\r\nimport isHeadless from \"../utils/is_headless\";\r\nimport * as domHelpers from \"./ui/utils/dom_helpers\";\r\nimport * as codeHelpers from \"../utils/helpers\";\r\nimport domEventScope from \"./ui/utils/dom_event_scope\";\r\nimport messages from \"./ui/message\";\r\nimport ui from \"./ui/index\";\r\nimport createLayoutFacade from \"./facades/layout\";\r\nimport taskLayers from \"./data_task_layers\";\r\n\r\nimport skin from \"./ui/skin\";\r\nimport skyblue from \"../css/skins/skyblue\";\r\nimport meadow from \"../css/skins/meadow\";\r\nimport terrace from \"../css/skins/terrace\";\r\nimport broadway from \"../css/skins/broadway\";\r\nimport material from \"../css/skins/material\";\r\nimport dark from \"../css/skins/dark\";\r\nimport contrast_black from \"../css/skins/contrast_black\";\r\nimport contrast_white from \"../css/skins/contrast_white\";\r\nimport plugins from \"./ui/plugins\";\r\nimport touch from \"./ui/touch\";\r\nimport lightbox from \"./ui/lightbox\";\r\nimport lightbox_optional_time from \"./ui/lightbox/lightbox_optional_time\";\r\nimport wai_aria from \"./ui/wai_aria\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tif(!env.isNode){\r\n\r\n\t\tgantt.utils = {\r\n\t\t\tarrayFind: codeHelpers.arrayFind,\r\n\t\t\tdom: domHelpers\r\n\t\t};\r\n\r\n\t\tvar domEvents = domEventScope();\r\n\t\tgantt.event = domEvents.attach;\r\n\t\tgantt.eventRemove = domEvents.detach;\r\n\t\tgantt._eventRemoveAll = domEvents.detachAll;\r\n\t\tgantt._createDomEventScope = domEvents.extend;\r\n\r\n\t\tutils.mixin(gantt, messages(gantt));\r\n\t\tvar uiApi = ui.init(gantt);\r\n\t\tgantt.$ui = uiApi.factory;\r\n\t\tgantt.$ui.layers = uiApi.render;\r\n\t\tgantt.$mouseEvents = uiApi.mouseEvents;\r\n\t\tgantt.$services.setService(\"mouseEvents\", function () {\r\n\t\t\treturn gantt.$mouseEvents;\r\n\t\t});\r\n\t\tgantt.mixin(gantt, uiApi.layersApi);\r\n\r\n\t\ttaskLayers(gantt);\r\n\r\n\t\tgantt.$services.setService(\"layers\", function () {\r\n\t\t\treturn uiApi.layersService;\r\n\t\t});\r\n\r\n\t\tgantt.mixin(gantt, createLayoutFacade());\r\n\t\tskin(gantt);\r\n\t\tskyblue(gantt);\r\n\t\tdark(gantt);\r\n\t\tmeadow(gantt);\r\n\t\tterrace(gantt);\r\n\t\tbroadway(gantt);\r\n\t\tmaterial(gantt);\r\n\t\tcontrast_black(gantt);\r\n\t\tcontrast_white(gantt);\r\n\t\tplugins(gantt);\r\n\t\ttouch(gantt);\r\n\t\tlightbox(gantt);\r\n\t\tlightbox_optional_time(gantt);\r\n\t\twai_aria(gantt);\r\n\r\n\t\tgantt.locate = function(e) {\r\n\t\t\tvar trg = domHelpers.getTargetNode(e);\r\n\r\n\t\t\t// ignore empty rows/cells of the timeline\r\n\t\t\tif(domHelpers.closest(trg, \".gantt_task_row\")){\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tvar targetAttribute = arguments[1] || this.config.task_attribute;\r\n\r\n\t\t\tvar node = domHelpers.locateAttribute(trg, targetAttribute);\r\n\t\t\tif(node){\r\n\t\t\t\treturn node.getAttribute(targetAttribute);\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tgantt._locate_css = function(e, classname, strict){\r\n\t\t\treturn domHelpers.locateClassName(e, classname, strict);\r\n\t\t};\r\n\r\n\t\tgantt._locateHTML = function(e, attribute) {\r\n\t\t\treturn domHelpers.locateAttribute(e, attribute || this.config.task_attribute);\r\n\t\t};\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onParse\", function(){\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tgantt.attachEvent(\"onGanttRender\", function(){\r\n\t\t\t\tif(gantt.config.initial_scroll){\r\n\t\t\t\t\tvar firstTask = gantt.getTaskByIndex(0);\r\n\t\t\t\t\tvar id = firstTask ? firstTask.id : gantt.config.root_id;\r\n\t\t\t\t\t// GS-1450. Don't scroll to the task if there is no timeline\r\n\t\t\t\t\tif(gantt.isTaskExists(id) && gantt.$task && gantt.utils.dom.isChildOf(gantt.$task, gantt.$container)){\r\n\t\t\t\t\t\tgantt.showTask(id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\t\tif (!this.config.scroll_size)\r\n\t\t\tthis.config.scroll_size = domHelpers.getScrollSize() || 15;\r\n\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\t// detach listeners before clearing old DOM, possible IE errors when accessing detached nodes\r\n\t\t\tthis._eventRemoveAll();\r\n\t\t\tthis.$mouseEvents.reset();\r\n\r\n\t\t\tthis.resetLightbox();\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t// GS-1261: scroll the views to the right side when RTL is enabled\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(!isHeadless(gantt) && gantt.config.rtl){\r\n\t\t\tgantt.$layout.getCellsByType(\"viewCell\").forEach(function(cell){ \r\n\t\t\t\tvar attachedScrollbar = cell.$config.scrollX;\r\n\t\t\t\tif (!attachedScrollbar) return;\r\n\r\n\t\t\t\tvar scrollbar = gantt.$ui.getView(attachedScrollbar);\r\n\t\t\t\tif (scrollbar) scrollbar.scrollTo(scrollbar.$config.scrollSize,0);\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\t// GS-1649: check if extensions are connected via files\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(!isHeadless(gantt)){\r\n\r\n\t\t\tvar activePlugins = gantt.plugins();\r\n\r\n\t\t\tvar availablePlugins = {\r\n\t\t\t\tauto_scheduling: gantt.autoSchedule,\r\n\t\t\t\tclick_drag: gantt.ext.clickDrag,\r\n\t\t\t\tcritical_path: gantt.isCriticalTask,\r\n\t\t\t\tdrag_timeline: gantt.ext.dragTimeline,\r\n\t\t\t\texport_api: gantt.exportToPDF,\r\n\t\t\t\tfullscreen: gantt.ext.fullscreen,\r\n\t\t\t\tgrouping: gantt.groupBy,\r\n\t\t\t\tkeyboard_navigation: gantt.ext.keyboardNavigation,\r\n\t\t\t\tmarker: gantt.addMarker,\r\n\t\t\t\tmultiselect: gantt.eachSelectedTask,\r\n\t\t\t\toverlay: gantt.ext.overlay,\r\n\t\t\t\tquick_info: gantt.templates.quick_info_content,\r\n\t\t\t\ttooltip: gantt.ext.tooltips,\r\n\t\t\t\tundo: gantt.undo\r\n\t\t\t};\r\n\r\n\t\t\tfor (let plugin in availablePlugins){\r\n\t\t\t\tif (availablePlugins[plugin] && !activePlugins[plugin]){\r\n\t\t\t\t\t// eslint-disable-next-line no-console\r\n\t\t\t\t\tconsole.warn(`You connected the '${plugin}' extension via an obsolete file. \r\nTo fix it, you need to remove the obsolete file and connect the extension via the plugins method: https://docs.dhtmlx.com/gantt/api__gantt_plugins.html`);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n};","export default function(gantt) {\r\n\tdelete gantt.addTaskLayer;\r\n\tdelete gantt.addLinkLayer;\r\n};","function createLayoutFacade(){\r\n\r\n\tfunction getTimeline(gantt){\r\n\t\treturn gantt.$ui.getView(\"timeline\");\r\n\t}\r\n\r\n\tfunction getGrid(gantt){\r\n\t\treturn gantt.$ui.getView(\"grid\");\r\n\t}\r\n\r\n\tfunction getBaseCell(gantt){\r\n\t\tvar timeline = getTimeline(gantt);\r\n\t\tif (timeline && !timeline.$config.hidden){\r\n\t\t\treturn timeline;\r\n\t\t} else{\r\n\t\t\tvar grid = getGrid(gantt);\r\n\t\t\tif (grid && !grid.$config.hidden){\r\n\t\t\t\treturn grid;\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getVerticalScrollbar(gantt){\r\n\t\tvar baseCell = null;\r\n\t\t// GS-1150: if we reorder or resize something in the grid, we should obtain the grid container\r\n\t\tvar gridDrag = false;\r\n\t\tvar gridMarkers = [\r\n\t\t\t\".gantt_drag_marker.gantt_grid_resize_area\",\r\n\t\t\t\".gantt_drag_marker .gantt_row.gantt_row_task\",\r\n\t\t\t\".gantt_drag_marker.gantt_grid_dnd_marker\"\r\n\t\t];\r\n\t\tgridMarkers.forEach(function (selector) {\r\n\t\t\tgridDrag = gridDrag || !!document.querySelector(selector);\r\n\t\t});\r\n\t\tif (gridDrag){\r\n\t\t\tbaseCell = getGrid(gantt);\r\n\t\t} else{\r\n\t\t\tbaseCell = getBaseCell(gantt);\r\n\t\t}\r\n\r\n\t\t// GS-1827. If there is no grid and timeline, there is no scrollbar for them\r\n\t\tif (!baseCell){\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar verticalScrollbar = getAttachedScrollbar(gantt, baseCell, \"scrollY\");\r\n\t\treturn verticalScrollbar;\r\n\t}\r\n\r\n\tfunction getHorizontalScrollbar(gantt){\r\n\t\tvar baseCell = getBaseCell(gantt);\r\n\t\tif (!baseCell || baseCell.id == \"grid\"){\r\n\t\t\treturn null; // if the timeline is not displayed, do not return the scrollbar\r\n\t\t}\r\n\t\tvar horizontalScrollbar = getAttachedScrollbar(gantt, baseCell, \"scrollX\");\r\n\t\treturn horizontalScrollbar;\r\n\t}\r\n\r\n\tfunction getAttachedScrollbar(gantt, cell, type){\r\n\t\tvar attachedScrollbar = cell.$config[type];\r\n\t\tvar scrollbarView = gantt.$ui.getView(attachedScrollbar);\r\n\t\treturn scrollbarView;\r\n\t}\r\n\r\n\tvar DEFAULT_VALUE = \"DEFAULT_VALUE\";\r\n\r\n\tfunction tryCall(getView, method, args, fallback){\r\n\t\tvar view = getView(this);\r\n\t\tif (!(view && view.isVisible())) {\r\n\t\t\tif(fallback){\r\n\t\t\t\treturn fallback();\r\n\t\t\t}else{\r\n\t\t\t\treturn DEFAULT_VALUE;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn view[method].apply(view, args);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\r\n\t\tgetColumnIndex: function(name) {\r\n\t\t\tvar res = tryCall.call(this, getGrid, \"getColumnIndex\", [name]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tdateFromPos: function(x) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"dateFromPos\", Array.prototype.slice.call(arguments));\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn this.getState().min_date;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tposFromDate: function(date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"posFromDate\", [date]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetRowTop: function(index) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getRowTop\", [index],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getRowTop\", [index]);}\r\n\t\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskTop: function(id) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getItemTop\", [id],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemTop\", [id]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tgetTaskPosition: function(task, start_date, end_date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"getItemPosition\", [task, start_date, end_date]);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\tvar top = this.getTaskTop(task.id);\r\n\t\t\t\tvar height = this.getTaskBarHeight(task.id);\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tleft: 0,\r\n\t\t\t\t\ttop: top,\r\n\t\t\t\t\theight: height,\r\n\t\t\t\t\twidth: 0\r\n\t\t\t\t};\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskBarHeight: function(taskId, isMilestoneRender) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getBarHeight\", [taskId, isMilestoneRender],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemHeight\", [taskId]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskHeight: function(taskId) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getItemHeight\", [taskId],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemHeight\", [taskId]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tcolumnIndexByDate: function(date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"columnIndexByDate\", [date]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\troundTaskDates: function() {\r\n\t\t\ttryCall.call(this, getTimeline, \"roundTaskDates\", []);\r\n\t\t},\r\n\r\n\t\tgetScale: function() {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"getScale\", []);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn null;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskNode: function(id) {\r\n\t\t\tvar timeline = getTimeline(this);\r\n\t\t\tif (!timeline || !timeline.isVisible()) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\tvar node = timeline._taskRenderer.rendered[id];\r\n\t\t\t\tif(!node){\r\n\t\t\t\t\tvar domAttr = timeline.$config.item_attribute;\r\n\t\t\t\t\tnode = timeline.$task_bars.querySelector(\"[\" +domAttr+ \"='\"+id+\"']\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn node || null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tgetLinkNode: function(id) {\r\n\t\t\tvar timeline = getTimeline(this);\r\n\t\t\tif (!timeline.isVisible()) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn timeline._linkRenderer.rendered[id];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tscrollTo: function(left, top){\r\n\t\t\tvar vertical = getVerticalScrollbar(this);\r\n\t\t\tvar horizontal = getHorizontalScrollbar(this);\r\n\r\n\t\t\tvar oldH = {position: 0},\r\n\t\t\t\toldV = {position: 0};\r\n\r\n\t\t\tif(vertical){\r\n\t\t\t\toldV = vertical.getScrollState();\r\n\t\t\t}\r\n\t\t\tif(horizontal){\r\n\t\t\t\toldH = horizontal.getScrollState();\r\n\t\t\t}\r\n\r\n\t\t\tvar scrollHorizontal = (horizontal && left*1 == left);\r\n\t\t\tvar scrollVertical = (vertical && top*1 == top);\r\n\t\t\tvar scrollBoth = scrollHorizontal && scrollVertical;\r\n\r\n\t\t\tif(scrollBoth){\r\n\t\t\t\t// some views will be scrolled both horizontally and vertically and smart rendering can be called twice\r\n\t\t\t\t// set flag in order not to invoke smart rendering at the horizontal scroll stage\r\n\t\t\t\t// so it will repaint only once when the scroll is completed\r\n\t\t\t\tvar verticalViews = vertical._getLinkedViews();\r\n\t\t\t\tvar horizontalViews = horizontal._getLinkedViews();\r\n\r\n\t\t\t\tvar commonViews = [];\r\n\t\t\t\tfor(var i = 0; i < verticalViews.length; i++){\r\n\t\t\t\t\tfor(var j = 0; j < horizontalViews.length; j++){\r\n\r\n\t\t\t\t\t\tif(verticalViews[i].$config.id && horizontalViews[j].$config.id && verticalViews[i].$config.id === horizontalViews[j].$config.id){\r\n\t\t\t\t\t\t\tcommonViews.push(verticalViews[i].$config.id);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (scrollHorizontal){\r\n\t\t\t\tif(commonViews){\r\n\t\t\t\t\tcommonViews.forEach((function(viewId){\r\n\t\t\t\t\t\tthis.$ui.getView(viewId).$config.$skipSmartRenderOnScroll = true;\r\n\t\t\t\t\t}).bind(this));\r\n\t\t\t\t}\r\n\r\n\t\t\t\thorizontal.scroll(left);\r\n\t\t\t\tif(commonViews){\r\n\t\t\t\t\tcommonViews.forEach((function(viewId){\r\n\t\t\t\t\t\tthis.$ui.getView(viewId).$config.$skipSmartRenderOnScroll = false;\r\n\t\t\t\t\t}).bind(this));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(scrollVertical){\r\n\t\t\t\tvertical.scroll(top);\r\n\t\t\t}\r\n\r\n\t\t\tvar newV = {position: 0},\r\n\t\t\t\tnewH = {position: 0};\r\n\t\t\tif(vertical){\r\n\t\t\t\tnewV = vertical.getScrollState();\r\n\t\t\t}\r\n\t\t\tif(horizontal){\r\n\t\t\t\tnewH = horizontal.getScrollState();\r\n\t\t\t}\r\n\r\n\t\t\tthis.callEvent(\"onGanttScroll\", [oldH.position, oldV.position, newH.position, newV.position]);\r\n\t\t},\r\n\r\n\t\tshowDate: function(date){\r\n\t\t\tvar date_x = this.posFromDate(date);\r\n\t\t\tvar scroll_to = Math.max(date_x - this.config.task_scroll_offset, 0);\r\n\t\t\tthis.scrollTo(scroll_to);\r\n\t\t},\r\n\t\tshowTask: function(id) {\r\n\t\t\tvar pos = this.getTaskPosition(this.getTask(id));\r\n\r\n\t\t\t// GS-1261: we need to show the start_date even in the RTL mode\r\n\t\t\tvar leftPos = pos.left;\r\n\t\t\tif (this.config.rtl) leftPos = pos.left + pos.width;\r\n\r\n\t\t\tvar left = Math.max(leftPos - this.config.task_scroll_offset, 0);\r\n\r\n\t\t\tvar dataHeight = this._scroll_state().y;\r\n\t\t\tvar top;\r\n\t\t\tif(!dataHeight){\r\n\t\t\t\ttop = pos.top;\r\n\t\t\t}else{\r\n\t\t\t\ttop = pos.top - (dataHeight - this.getTaskBarHeight(id))/2;\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTo(left, top);\r\n\t\t\t// GS-1150: if the grid and timeline have different scrollbars, we need to scroll thegrid to show the task\r\n\t\t\tvar gridCell = getGrid(this);\r\n\t\t\tvar timelineCell = getTimeline(this);\r\n\t\t\tif (gridCell && timelineCell && gridCell.$config.scrollY != timelineCell.$config.scrollY){\r\n\t\t\t\tvar gridScrollbar = getAttachedScrollbar(this, gridCell, \"scrollY\");\r\n\t\t\t\tgridScrollbar.scrollTo(null, top);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_scroll_state: function(){\r\n\t\t\tvar result = {\r\n\t\t\t\tx: false,\r\n\t\t\t\ty: false,\r\n\t\t\t\tx_pos: 0,\r\n\t\t\t\ty_pos: 0,\r\n\t\t\t\tscroll_size: this.config.scroll_size + 1,//1px for inner content\r\n\t\t\t\tx_inner: 0,\r\n\t\t\t\ty_inner: 0\r\n\t\t\t};\r\n\r\n\t\t\tvar scrollVer = getVerticalScrollbar(this),\r\n\t\t\t\tscrollHor = getHorizontalScrollbar(this);\r\n\t\t\tif(scrollHor){\r\n\t\t\t\tvar horState = scrollHor.getScrollState();\r\n\t\t\t\tif(horState.visible){\r\n\t\t\t\t\tresult.x = horState.size;\r\n\t\t\t\t\tresult.x_inner = horState.scrollSize;\r\n\t\t\t\t}\r\n\t\t\t\tresult.x_pos = horState.position || 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(scrollVer){\r\n\t\t\t\tvar verState = scrollVer.getScrollState();\r\n\t\t\t\tif(verState.visible){\r\n\t\t\t\t\tresult.y = verState.size;\r\n\r\n\t\t\t\t\tresult.y_inner = verState.scrollSize;\r\n\t\t\t\t}\r\n\t\t\t\tresult.y_pos = verState.position || 0;\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tgetScrollState: function(){\r\n\t\t\tvar state = this._scroll_state();\r\n\t\t\treturn { x:state.x_pos, y:state.y_pos, inner_width:state.x, inner_height:state.y, width: state.x_inner, height: state.y_inner };\r\n\t\t},\r\n\r\n\t\tgetLayoutView: function(cellName){\r\n\t\t\treturn this.$ui.getView(cellName);\r\n\t\t},\r\n\r\n\t\tscrollLayoutCell: function(cellName, left, top){\r\n\t\t\tconst cell = this.$ui.getView(cellName);\r\n\t\t\tif (!cell){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (left !== null){\r\n\t\t\t\tconst horizontalScroll = this.$ui.getView(cell.$config.scrollX);\r\n\t\t\t\tif (horizontalScroll){\r\n\t\t\t\t\thorizontalScroll.scrollTo(left, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (top !== null){\r\n\t\t\t\tconst verticalScroll = this.$ui.getView(cell.$config.scrollY);\r\n\t\t\t\tif (verticalScroll){\r\n\t\t\t\t\tverticalScroll.scrollTo(null, top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t};\r\n\r\n}\r\n\r\nexport default createLayoutFacade;","export default function(gantt) {\r\ngantt.skins.skyblue = {\r\n\tconfig:{\r\n\t\tgrid_width:370,\r\n\t\trow_height: 27,\r\n\t\tbar_height_padding:4,\r\n\t\tscale_height: 27,\r\n\t\tlink_line_width:1,\r\n\t\tlink_arrow_size:8,\r\n\t\tlink_radius:2,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:95,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.dark = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 36,\r\n\t\tscale_height: 36,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tbar_height_padding:9,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:70\t\t\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.meadow = {\r\n\tconfig:{\r\n\t\tgrid_width:380,\r\n\t\trow_height: 27,\r\n\t\tscale_height: 30,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:10,\r\n\t\tbar_height_padding:4,\r\n\t\tlightbox_additional_height:72\r\n\t},\r\n\t_second_column_width:95,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.terrace = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 36,\r\n\t\tscale_height: 36,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tbar_height_padding:9,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:70\t\t\r\n};\r\n\r\n};","export default function(gantt) {\r\n\tgantt.skins.broadway = {\r\n\t\tconfig: {\r\n\t\t\tgrid_width: 390,\r\n\t\t\trow_height: 35,\r\n\t\t\tscale_height: 35,\r\n\t\t\tlink_line_width: 1,\r\n\t\t\tlink_arrow_size: 9,\r\n\t\t\tbar_height_padding:4,\r\n\t\t\tlightbox_additional_height: 86\r\n\t\t},\r\n\t\t_second_column_width: 100,\r\n\t\t_third_column_width: 80,\r\n\r\n\t\t_lightbox_template: \"
\",\r\n\t\t_config_buttons_left: {},\r\n\t\t_config_buttons_right: {\r\n\t\t\t\"gantt_delete_btn\": \"icon_delete\",\r\n\t\t\t\"gantt_save_btn\": \"icon_save\"\r\n\t\t}\r\n\t};\r\n};","export default function(gantt) {\r\n\tgantt.skins.material = {\r\n\t\tconfig: {\r\n\t\t\tgrid_width: 411,\r\n\t\t\trow_height: 34,\r\n\t\t\tscale_height: 36,\r\n\t\t\tlink_line_width: 2,\r\n\t\t\tlink_arrow_size: 12,\r\n\t\t\tbar_height_padding:9,\r\n\t\t\tlightbox_additional_height: 80\r\n\t\t},\r\n\t\t_second_column_width: 110,\r\n\t\t_third_column_width: 75,\r\n\t\t_redefine_lightbox_buttons: {\r\n\t\t\t\"buttons_left\": [\"dhx_delete_btn\"],\r\n\t\t\t\"buttons_right\": [\"dhx_cancel_btn\", \"dhx_save_btn\"]\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onAfterTaskDrag\", function (id) {\r\n\t\tvar t = gantt.getTaskNode(id);\r\n\t\tif (t) {\r\n\t\t\tt.className += \" gantt_drag_animation\";\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tvar indx = t.className.indexOf(\" gantt_drag_animation\");\r\n\t\t\t\tif (indx > -1) {\r\n\t\t\t\t\tt.className = t.className.slice(0, indx);\r\n\t\t\t\t}\r\n\t\t\t}, 200);\r\n\t\t}\r\n\t});\r\n\r\n};","export default function(gantt) {\r\ngantt.skins[\"contrast_black\"] = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 35,\r\n\t\tscale_height: 35,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins[\"contrast_white\"] = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 35,\r\n\t\tscale_height: 35,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","import autoscroll from \"./autoscroll\";\r\nimport jquery_hooks from \"./jquery_hooks\";\r\nimport dhtmlx_hooks from \"./dhtmlx_hooks\";\r\nimport TimelineZoom from \"./timeline_zoom\";\r\n\r\n\r\nexport default function(gantt){\r\n\tif(!gantt.ext){\r\n\t\tgantt.ext = {};\r\n\t}\r\n\r\n\tvar modules = [\r\n\t\tautoscroll,\r\n\t\tjquery_hooks,\r\n\t\tdhtmlx_hooks\r\n\t];\r\n\r\n\tfor(var i = 0; i < modules.length; i++){\r\n\t\tif(modules[i])\r\n\t\t\tmodules[i](gantt);\r\n\t}\r\n\r\n\tgantt.ext.zoom = new TimelineZoom(gantt);\r\n};","export default function(gantt) {\r\n\r\n\tgantt._extend_to_optional = function (lightbox_block) {\r\n\r\n\t\tvar duration = lightbox_block;\r\n\t\tvar optional_time = {\r\n\t\t\trender: duration.render,\r\n\t\t\tfocus: duration.focus,\r\n\t\t\tset_value: function (node, value, task, section) {\r\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(section);\r\n\t\t\t\tif (!task[mapping.start_date] || (mapping.start_date == \"start_date\" && this._isAllowedUnscheduledTask(task))) {\r\n\t\t\t\t\toptional_time.disable(node, section);\r\n\t\t\t\t\tvar val = {};\r\n\r\n\t\t\t\t\tfor (var i in mapping) {\r\n\t\t\t\t\t\t//take default values from the time control from task start/end dates\r\n\t\t\t\t\t\tval[mapping[i]] = task[i];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, val, section);//set default value\r\n\t\t\t\t} else {\r\n\t\t\t\t\toptional_time.enable(node, section);\r\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, task, section);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget_value: function (node, task, section) {\r\n\t\t\t\tif (section.disabled) {\r\n\t\t\t\t\treturn {start_date: null};\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn duration.get_value.call(gantt, node, task, section);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tupdate_block: function (node, section) {\r\n\t\t\t\tgantt.callEvent(\"onSectionToggle\", [gantt._lightbox_id, section]);\r\n\t\t\t\tnode.style.display = section.disabled ? \"none\" : \"\";\r\n\r\n\t\t\t\tif (section.button) {\r\n\t\t\t\t\tvar button = node.previousSibling.querySelector(\".gantt_custom_button_label\"),\r\n\t\t\t\t\t\tlabels = gantt.locale.labels;\r\n\r\n\t\t\t\t\tvar button_text = section.disabled ? labels[section.name + \"_enable_button\"] : labels[section.name + \"_disable_button\"];\r\n\r\n\t\t\t\t\tbutton.innerHTML = button_text;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdisable: function (node, section) {\r\n\t\t\t\tsection.disabled = true;\r\n\t\t\t\toptional_time.update_block(node, section);\r\n\r\n\t\t\t},\r\n\t\t\tenable: function (node, section) {\r\n\t\t\t\tsection.disabled = false;\r\n\t\t\t\toptional_time.update_block(node, section);\r\n\t\t\t},\r\n\t\t\tbutton_click: function (index, el, section, container) {\r\n\t\t\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar config = gantt._get_typed_lightbox_config()[index];\r\n\t\t\t\tif (config.disabled) {\r\n\t\t\t\t\toptional_time.enable(container, config);\r\n\t\t\t\t} else {\r\n\t\t\t\t\toptional_time.disable(container, config);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn optional_time;\r\n\t};\r\n\r\n\tgantt.form_blocks.duration_optional = gantt._extend_to_optional(gantt.form_blocks.duration);\r\n\tgantt.form_blocks.time_optional = gantt._extend_to_optional(gantt.form_blocks.time);\r\n\r\n};","export default function(gantt){\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tgantt._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\r\n\t\t},\r\n\r\n\t\tgetTimelineCellAttr:function(dateString){\r\n\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\t\t_taskCommonAttr: function(task, div){\r\n\r\n\t\t\tif(!(task.start_date && task.end_date))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(gantt.templates.tooltip_text(task.start_date, task.end_date, task)));\r\n\r\n\t\t\tif(task.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tsetTaskBarAttr: function(task, div){\r\n\t\t\tthis._taskCommonAttr(task, div);\r\n\r\n\t\t\t// task bars are complex elements that should be treated as a single element\r\n\t\t\tdiv.setAttribute(\"role\", \"img\");\r\n\r\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.drag_move){\r\n\t\t\t\tif(task.id != gantt.getState(\"tasksDnd\").drag_id){\r\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttaskRowAttr: function(task, div){\r\n\r\n\t\t\tthis._taskCommonAttr(task, div);\r\n\r\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.order_branch){\r\n\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\r\n\t\t\t}\r\n\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t\t// selected attribute should be added only to the grid because\r\n\t\t\t// other parts don't have the keyboard navigation\r\n\t\t\tdiv.setAttribute(\"aria-selected\", gantt.isSelectedTask(task.id) ? \"true\" : \"false\");\r\n\r\n\t\t\t// allowed values start from 1, set 1 for non-tree datastores\r\n\t\t\tdiv.setAttribute(\"aria-level\", task.$level + 1 || 1);\r\n\r\n\t\t\tif(gantt.hasChild(task.id)){\r\n\t\t\t\tdiv.setAttribute(\"aria-expanded\", task.$open ? \"true\" : \"false\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tlinkAttr: function(link, div){\r\n\r\n\t\t\tvar linkTypes = gantt.config.links;\r\n\r\n\t\t\tvar toStart = link.type == linkTypes.finish_to_start || link.type == linkTypes.start_to_start;\r\n\t\t\tvar fromStart = link.type == linkTypes.start_to_start || link.type == linkTypes.start_to_finish;\r\n\r\n\t\t\tvar content = gantt.locale.labels.link + \" \" + gantt.templates.drag_link(link.source, fromStart, link.target, toStart);\r\n\r\n\t\t\t// links are complex elements that should be treated as a single element\r\n\t\t\tdiv.setAttribute(\"role\", \"img\");\r\n\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(content));\r\n\t\t\tif(gantt.isReadonly(link)){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgridSeparatorAttr: function(div){\r\n\t\t\t// the only valid role for the grid header\r\n\t\t\tdiv.setAttribute(\"role\", \"columnheader\");\r\n\t\t},\r\n\t\trowResizerAttr: function(div){\r\n\t\t\t// the only valid role for the grid header\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t\tdiv.firstChild.setAttribute(\"aria-level\", \"1\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":gantt.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.years;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.months;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.days;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.hours + gantt.locale.labels.minutes;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\tlightboxDurationInputAttrString: function(section){\r\n\t\t\treturn this.getAttributeString({\r\n\t\t\t\t\"aria-label\": gantt.locale.labels.column_duration,\r\n\t\t\t\t\"aria-valuemin\": \"0\",\r\n\t\t\t\t\"role\": \"spinbutton\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tinlineEditorAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t},\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn [\" role='treegrid'\", gantt.config.multiselect ? \"aria-multiselectable='true'\" : \"aria-multiselectable='false'\", \" \"].join(\" \");\r\n\t\t},\r\n\r\n\r\n\t\tgridScaleRowAttrString: function(){\r\n\t\t\treturn \"role='row'\";\r\n\t\t},\r\n\r\n\t\tgridScaleCellAttrString: function(column, label){\r\n\t\t\tvar attrs = \"\";\r\n\t\t\tif(column.name == \"add\"){\r\n\t\t\t\t// a more precise role is button, but it is not valid for the grid header\r\n\t\t\t\tattrs = this.getAttributeString({\"role\":\"columnheader\", \"aria-label\": gantt.locale.labels.new_task});\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar attributes = {\r\n\t\t\t\t\t\"role\":\"columnheader\",\r\n\t\t\t\t\t\"aria-label\": label\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(gantt._sort && gantt._sort.name == column.name){\r\n\t\t\t\t\tif(gantt._sort.direction == \"asc\"){\r\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"ascending\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"descending\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tattrs = this.getAttributeString(attributes);\r\n\t\t\t}\r\n\t\t\treturn attrs;\r\n\t\t},\r\n\r\n\t\tgridDataAttrString: function(){\r\n\t\t\treturn \"role='rowgroup'\";\r\n\t\t},\r\n\r\n\t\treorderMarkerAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"grid\");\r\n\t\t\tdiv.firstChild.removeAttribute(\"aria-level\");\r\n\t\t\tdiv.firstChild.setAttribute(\"aria-grabbed\", \"true\");\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(column, textValue, task){\r\n\t\t\tvar attributes = {\"role\":\"gridcell\", \"aria-label\": textValue};\r\n\t\t\tif(!column.editor || gantt.isReadonly(task)){\r\n\t\t\t\tattributes[\"aria-readonly\"] = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn this.getAttributeString(attributes);\r\n\t\t},\r\n\r\n\t\tgridAddButtonAttrString: function(column){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\r\n\t\t},\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' aria-level='1' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !gantt.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in gantt._waiAria){\r\n\t\tgantt._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \"\";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(gantt._waiAria[i]);\r\n\t}\r\n\r\n\r\n};","import extensions from \"./ext/extensions_gpl\";\r\nimport base from \"./factory/make_instance_web\";\r\nimport scope from \"./utils/global\";\r\nconst gantt = (scope as any).gantt = base(extensions);\r\n\r\nexport default gantt;\r\nexport { gantt };","import \"../css/dhtmlxgantt.less\";\r\n\r\nimport factory from \"./make_instance_common\";\r\nimport ui from \"../core/ui_core\";\r\nimport ajaxLoading from \"../core/loading/ajax_loading\";\r\nimport dynamicLoading from \"../core/loading/dynamic_loading\";\r\n\r\nexport default function(supportedExtensions) {\r\n\tvar gantt = factory(supportedExtensions);\r\n\r\n\tif(!gantt.env.isNode){\r\n\t\tui(gantt);\r\n\t\tajaxLoading(gantt);\r\n\t\tdynamicLoading(gantt);\r\n\t}\r\n\r\n\treturn gantt;\r\n};","export default function(gantt) {\r\n\tgantt.load = function (url, type, callback) {\r\n\t\tthis._load_url = url;\r\n\t\tthis.assert(arguments.length, \"Invalid load arguments\");\r\n\r\n\t\tvar tp = 'json', cl = null;\r\n\t\tif (arguments.length >= 3) {\r\n\t\t\ttp = type;\r\n\t\t\tcl = callback;\r\n\t\t} else {\r\n\t\t\tif (typeof arguments[1] == \"string\")\r\n\t\t\t\ttp = arguments[1];\r\n\t\t\telse if (typeof arguments[1] == \"function\")\r\n\t\t\t\tcl = arguments[1];\r\n\t\t}\r\n\r\n\t\tthis._load_type = tp;\r\n\r\n\t\tthis.callEvent(\"onLoadStart\", [url, tp]);\r\n\r\n\t\treturn this.ajax.get(url, gantt.bind(function (l) {\r\n\t\t\tthis.on_load(l, tp);\r\n\t\t\tthis.callEvent(\"onLoadEnd\", [url, tp]);\r\n\t\t\tif (typeof cl == \"function\")\r\n\t\t\t\tcl.call(this);\r\n\t\t}, this));\r\n\t};\r\n};"],"names":["getNodePosition","elem","top","left","right","bottom","getBoundingClientRect","box","body","document","docElem","documentElement","parentNode","scrollTop","window","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","offsetWidth","offsetHeight","parseInt","offsetTop","offsetLeft","offsetParent","y","Math","round","x","width","height","isVisible","node","display","visibility","getComputedStyle","style","currentStyle","hasNonNegativeTabIndex","isNaN","getAttribute","hasHref","a","area","nodeName","loLowerCase","isEnabled","input","select","textarea","button","object","toLowerCase","hasAttribute","getFocusableNodes","root","nodes","querySelectorAll","join","nodesArray","Array","prototype","slice","call","i","length","$position","sort","b","tabIndex","splice","getScrollSize","div","createElement","cssText","appendChild","clientWidth","removeChild","max","getClassName","className","baseVal","indexOf","_trimString","addClassName","removeClassName","name","split","regEx","RegExp","replace","toNode","getElementById","querySelector","_slave","insertNode","newone","innerHTML","child","firstChild","removeNode","getChildNodes","css","ch","childNodes","len","out","obj","push","getTargetNode","e","trg","tagName","event","target","srcElement","shadowRoot","composedPath","locateAttribute","attribute","str","String","trim","this","apply","locateClassName","classname","strict","ind","charAt","getRelativeEventPosition","ev","d","clientX","clientY","getRelativeNodePosition","parent","childPos","parentPos","isChildOf","closest","element","selector","matches","msMatchesSelector","webkitMatchesSelector","el","contains","parentElement","nodeType","console","error","getClosestSizedElement","isShadowDomSupported","head","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","classList","test","scope","global","EventsManager$1","gantt","_mouseDown","_gantt","_domEvents","_createDomEventScope","selectedRegion","useKey","ignore","_target","getViewPort","_originPosition","_restoreOriginPosition","position","state","$services","getService","registerProvider","autoscroll","scheduledDndCoordinates","startDragAndDrop","setStart","copy","setPosition","setEnd","attach","filterTargets","utils","dom","_getCoordinates","eventElement","domHelpers.getRootNode","$root","coordinates","dragEnd","dragTimeline","ext","clickDrag","dragTimelineUseKey","config","drag_timeline","abs","relative","render","detachAll","unregisterProvider","detach","viewPort","viewPortBounds","absolute","EventHost","_silent_mode","listeners","_silentStart","_silentEnd","createEventStorage","handlers","index","eventStorage","combinedResult","handlerResult","arguments","addEvent","handler","settings","t","handlerId","id","once","originalHandler","removeEvent","clear","makeEventable","eventHost","attachEvent","eventName","thisObject","bind","attachAll","callback","callEvent","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","units","second","minute","hour","day","week","month","quarter","year","getSecondsInUnit","unit","forEach","arr","workArray","arrayFind","find","arrayIncludes","item","includes","isArray","pop","isDate","getFullYear","getMonth","getDate","isValidDate","getTime","delay","timeout","timer","result","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","replaceValidZeroId","rootId","checkZeroId","findBinary","array","prev","low","high","floor","SelectedRegion","view","_el","defaultRender","start","end","min","_singleRow","pos","_getTaskPositionByTop","_startPoint","_view","_viewPort","add","_callback","_endPoint","draw","eventable","singleRow","_useRequestAnimationFrame","useRequestAnimationFrame","requestAnimationFrame","getElement","startPoint","_startDate","dateFromPos","endPoint","_endDate","_positionPoint","positionPoint","getState","max_date","valueOf","tasksByTime","getTaskByTime","tasksByIndex","_getTasksByTop","startValue","endValue","startIndex","endIndex","getTaskByIndex","getItemIndexByTopPosition","task","getItemHeight","getItemTop","dataHeight","getTotalHeight","row_height","getTaskCount","EventsManager","_calculateDirectionVector","_trace","dots","vectors","resultVector","vector","magnitude","sqrt","angleDegrees","atan2","PI","_applyDndReadyStyles","_timeline","$task","_clearDndReadyStyles","remove","_getScrollPosition","timeline","$ui","getView","$config","scrollX","getScrollState","scrollY","_countNewScrollPosition","coords","shiftX","shiftY","_scrollState","_setScrollPosition","scrollLayoutCell","$id","_stopDrag","_originalReadonly","readonly","_originAutoscroll","_startDrag","enabled","clickDragUseKey","click_drag","scrollPosition","modals","modalsStack","isModal","afterPopup","$destroyed","focus","startModal","eventRemove","trapFocus","endModal","currentTarget","$keyboardNavigation","traceLightbox","getLightbox","focusElement","QuickInfo","show","_showForTask","_showAtCoordinates","hide","forced","qi","_quickInfoBox","_quickInfoBoxId","taskId","_quickInfoTask","quick_info_detached","getNode","setContainer","container","_container","setContent","content","defaultContent","header","title","date","buttons","quickinfo_buttons","_createQuickInfoElement","titleBox","titleContent","titleDate","main","controls","_waiAria","quickInfoHeader","html","ariaAttr","quickInfoButtonAttrString","locale","labels","_qiButtonClickHandler","_qiKeyPressHandler","_qi_button_click","code","which","_appendAtCoordinates","show_quick_info","_getContainer","_get_event_counter_part","xViewport","yViewport","_init_quick_info","_prepare_quick_info_classname","_fill_quick_data","_show_quick_info","offset","domEv","getTaskNode","getTaskRowNode","scroll","dx","dy","quickInfoAttr","quickInfoHeaderAttrString","getTask","_quickInfoReadonly","isReadonly","getTaskType","template","templates","quick_info_class","start_date","end_date","allowedButtons","isEditor","icon_delete","icon_edit","quick_info_title","quick_info_date","quick_info_content","popupHeight","scrolls","screenWidth","relativePopupBottom","mask","$click","$task_data","$grid_data","$grid","$layout","seed","plainObjectConstructor","constructor","toString","helpers.isDate","Date","helpers.isArray","Object","create","hasOwnProperty","mixin","source","force","f","undefined","defined","uid","functor","capture","addEventListener","removeEventListener","createScope","utils.event","utils.eventRemove","eventScope","staticArray","extend","Tooltip","_tooltipNode","tooltipAttr","_root","domHelpers.isChildOf","_isLikeMouseEvent","_calculateTooltipPosition","tooltipVisibleAttr","tooltipHiddenAttr","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","domHelpers.getRelativeEventPosition","containerPos","domHelpers.getNodePosition","_getViewPort","TooltipManager","_listeners","domEventsScope","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","domHelpers.getTargetNode","targetNode","domHelpers.closest","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","clone","createEvent","delayShow","helpers.delay","tooltip_timeout","tooltip_hide_timeout","noTrack","onBeforeUndo","onBeforeRedo","batchActions","Monitor","undo","_batchAction","_batchMode","_ignore","_ignoreMoveEvents","_initialTasks","_initialLinks","_nestedTasks","_nestedLinks","_undo","_attachEvents","type","overwrite","undo_types","_storeTask","link","_storeLink","isMoveEventsIgnored","newValue","_timeout","stopBatchAction","action","logAction","_storeTaskCommand","command","update","$local_index","getTaskIndex","oldValue","getInitialTask","getParent","_storeEntityCommand","move","entity","children","childrenLinks","_storeLinkCommand","taskIds","tasks","linkIds","_getLinks","setInitialTask","uniqueLinks","links","setInitialLink","$index","getGlobalTaskIndex","setInitialTaskObject","getLink","deleteCacheCooldown","saveInitialAll","clearInitialTasks","eachTask","clearInitialLinks","getLinks","getMoveObjectByTaskId","startIgnore","stopIgnore","startBatchAction","clearUndoStack","clearRedoStack","onTaskAdded","onTaskUpdated","onTaskDeleted","onLinkAdded","onLinkUpdated","onLinkDeleted","onTaskMoved","toggleIgnoreMoveEvents","store","nested","setNestedTasks","datastore","getDatastore","tindex","dragId","projectDrag","drag_id","isSummaryTask","drag_project","plugins","multiselect","selectedIds","getSelectedTasks","inlineEditors","onBeforeEditStartId","onEditStart","updateConfigs","undoEnabled","commands","old","actionType","entityType","_storeCommand","isTaskExists","getInitialLink","$source","$target","linkId","Undo","maxSteps","redoEnabled","invert","revert","value","inverseCommands","types","assert","_undoStack","_redoStack","getUndoStack","stack","undo_steps","undo_actions","redo","_pop","_reorderCommands","_applyAction","_push","shift","weights","any","actionWeights","weightA","entities","actions","methods","get","isExists","batchUpdate","method","getMethod","check","prop","startsWith","extensions","defaultConfig","eventsManager","destructor","fullscreen","isExpanded","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","isFullscreenAvailable","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","backupBodyPadding","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","backupElementSizes","zIndex","modified","backupPositioning","updateSizes","expandGantt","onFullScreenChange","$container","getFullscreenElement","positions","originalPositioning","setFullScreenSizes","record","cantFullscreen","warning","log","requestArguments","webkitRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","requestExitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","exitFullscreen","collapse","expand","keyboard_navigation","keyboard_navigation_cells","_compose","parts","res","p","shortcuts","createCommand","modifiers","alt","ctrl","meta","keyCode","parse","shortcut","expr","getExpressions","words","getWords","j","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","shiftKey","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","tab","enter","esc","space","up","down","home","pageup","pagedown","delete","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","findHandler","hash","doAction","facade","preventDefault","returnValue","unbind","bindAll","map","initKeys","keys","domHelpers.getFocusableNodes","focusable","currentFocus","domHelpers.getActiveElement","currentIndex","lastItem","firstItem","GanttNode","blur","scrollHorizontal","dir","scale","getScale","step","scrollTo","posFromDate","scrollVertical","KeyNavNode","isValid","fallback","moveTo","dispatcher","setActiveNode","compareTo","canStringifyThis","canStringifyThat","eventFacade","setAttribute","$eventAttached","HeaderCell","show_grid","getVisibleTaskCount","getGridColumns","TaskRow","visibleColumns","fromDomElement","cellElement","domHelpers.locateClassName","previousSibling","$grid_scale","columns","taskRow","rootLevel","getChildren","root_id","TaskCell","click","createTask","globalIndex","splitItem","$split_subtask","parentId","nextIndex","locate","isTaskVisible","task_attribute","keptFocus","getTaskPosition","getTaskHeight","viewWidth","viewHeight","inner_width","inner_height","scroll_on_click","show_chart","task_scroll_offset","grid","scrollPositionX","scrollPositionY","attachedScrollbarHorizontal","scrollable","scrollbarHorizontal","attachedScrollbarVertical","scrollbarVertical","scrollGrid","nextElement","prevTask","getPrev","nextTask","getNext","hasChild","$open","open","close","prevId","getPrevSibling","moveTask","updateTask","isSelectedTask","unselectTask","selectTask","showLightbox","columnIndex","domHelpers.locateAttribute","row","isActive","activeNode","globalNode","enable","getActiveNode","disable","getDefaultNode","setDefaultNode","inputs","focusGlobalNode","blurNode","focusChanged","keyDownHandler","defaultPrevented","ganttNode","awaitsFocus","clearDelay","isTaskFocused","isInlineEditorCell","isNoKeyboardNavigationElement","focusHandler","$preventDefault","reFocusActiveNode","outsideGantt","localName","domElement","mousedownHandler","locateTask","removeAttribute","onReady","$data","tasksStore","currentNode","gridDataTopScroll","gridDataBottomScroll","_smart_render","updateRender","_redrawTasks","renderers","items","focusedItemVisible","createdTaskId","keepFocusOnNewTask","placeholder","nodeConstructor","placeholder_task","focusOnCreate","oldId","newId","interval","setInterval","getScope","mode","scopes","headerCell","taskCell","findVisibleColumnIndex","columnName","clearInterval","keyNavFacade","addShortcut","scopeObject","getShortcutHandler","getCommandHandler","removeShortcut","column","keyboardNavigation","quick_info","quickInfo","text","substr","details","task_time","events","hidingFunction","clearQuickInfo","hideQuickInfo","showQuickInfo","tooltipManager","tooltips","tooltipFor","touch","touch_tooltip","targetTaskId","tooltip_text","hideTooltip","link_source_id","monitor","updTask","changeTaskCommandId","updLink","oldTaskId","newTaskId","changeLinkCommandId","updateTasksIds","entry","updateLinksIds","setUndoStack","getRedoStack","setRedoStack","saveState","getInitialState","marker","render_marker","show_markers","min_date","markerHeight","getRowTop","timeline_placeholder","scrollHeight","initMarkerArea","markerArea","$marker_area","_markers","createDatastore","initItem","renderMarkers","createDataRender","defaultContainer","addLayer","getMarker","getItem","addMarker","addItem","deleteMarker","exists","removeItem","updateMarker","refresh","_getMarkers","getItems","multiselect_one_level","_multiselect","_selected","_one_level","_active","_first_selected_when_shift","getDefaultSelected","selected","getSelected","setFirstSelected","getFirstSelected","updateState","active","select_task","reset","setLastSelected","silent","unselect","getLastSelected","last","getSelectedId","afterSelect","toggle","isSelected","forSelected","isSameLevel","calculateTaskLevel","_quickRefresh","refreshTask","doSelection","_is_icon_open_click","target_ev","defaultLast","isLast","multiSelect","singleSelection","controller","cell","locateCell","inline_editors_multiselect_open","getEditorConfig","startEdit","blockSelection","first_indx","target_indx","last_indx","tmp","old_selectTask","old_unselectTask","toggleTaskSelection","eachSelectedTask","getLastSelectedTask","old_isSelected","new_id","task_id","export_api","_apiUrl","previousDateRage","str_to_date","date_format","data","_serializeHtml","_prepareConfigPDF","_serializeAll","_fixColumns","raw","_preparePDFConfigRaw","version","_sendToExport","_pdfExportRouter","_serializePlain","dates","smartRendering","smart_rendering","visual","convert","_eachTaskTimed","_no_progress_colors","_serializeTimeline","_serializeGrid","rawDates","scales","_serializeScales","worktime","_getWorktimeSettings","formData","File","FormData","append","_sendImportAjaxExcel","_sendImportAjaxMSP","importFromPrimaveraP6","importFromMSProject","skip_circular_links","oldXmlFormat","xml_format","oldFormatDate","format_date","oldXmlDate","xml_date","oldDateFormat","exportServiceDateFormat","date_to_str","_customProjectProperties","_customTaskProperties","_clearRecLinks","_exportConfig","$custom_data","custom","exportToPrimaveraP6","exportToMSProject","label","url","pack","cb","ajax","post","base","$template","server","JSON","stringify","sheet","xhr","XMLHttpRequest","onreadystatechange","readyState","status","onload","info","responseText","setRequestHeader","send","encodeURIComponent","_xdr","loader","xdoc","xmlDoc","col","editor","editor_types","skin","_serializableGanttConfig","_markColumns","_ajaxToExport","form","_createHiddenForm","submit","_hidden_export_form","constraint_date","deadline","key","formatDate","_color_box","_color_hash","color","_getColor","backgroundColor","parsedRanges","minutes","range","startMinute","endMinute","defaultWorkTimes","hours","time","work_time","wTime","_working_time_helper","get_calendar","worktimes","parsed","_getMinutesWorktimeSettings","master","branch","_pull","_originalCopyObject","json","_copyObject","task_text","_copyObjectBase","rgb","match","toISOstring","_copyObjectColumns","_copyObjectPlain","getDayIndex","_day_index_by_date","columnIndexByDate","$start","$end","hiddenCells","scaleCellsWidth","$level","$type","$rendered_type","tmps","$text","$left","leftside_text","$right","rightside_text","_copyObjectTable","$color","ct","val","date_grid","smartScales","smart_scales","_copyObjectAll","_exportSerialize","_getRaw","_scale_helpers","_get_scales","minWidth","min_column_width","autosizeMinWidth","_get_resize_options","autosize_min_width","scale_height","prepareConfigs","availWidth","autosize","_getScales","rtl","$scaleHelper","_copyObjectColors","cellColors","timeline_cell_class","task_cell_class","steps","trace_x","styles","cellCss","_getStyles","Infinity","col_width","format","date_scale","scaleCell","scaleCell_class","scaleCss","exportMode","cols","ccount","xmlFormat","serialize","_lvl","_setLevel","_makeLinksSameLevel","skippedLinks","_clearCircDependencies","_clearLinksSameLevel","_clearLevel","usedTasks","prevLink","sources","$_source","_onCircDependencyFind","targets","curLink","targetTask","_source","targetLvl","linkT","sourceParent","targetParent","$_target","project","projectName","projectDates","getSubtaskDates","start_end","manual","auto_scheduling","durationUnit","projectProperties","taskProperties","exportToPDF","exportToPNG","exportToICal","exportToExcel","exportToJSON","importFromExcel","constants","KEY_CODES","UP","DOWN","LEFT","RIGHT","SPACE","ENTER","DELETE","ESC","TAB","ExtensionsManager","addExtension","_extensions","getExtension","layout","rows","resizer","finish_to_start","start_to_start","finish_to_finish","start_to_finish","milestone","auto_types","duration_unit","correct_work_time","skip_off_time","cascade_delete","autoscroll_speed","deepcopy_on_parse","show_links","show_task_cells","static_background","static_background_cells","branch_loading","branch_loading_property","show_loading","min_duration","start_on_monday","server_utc","show_progress","fit_tasks","preserve_scroll","container_resize_timeout","deadlines","drag_links","drag_progress","drag_resize","drag_move","drag_mode","resize","progress","round_dnd_dates","link_wrapper_width","link_arrow_size","autofit","tree","align","scale_offset_minimal","inherit_scale_class","time_step","duration_step","task_date","time_picker","link_attribute","layer_attribute","buttons_left","_migrate_buttons","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","buttons_right","lightbox","sections","map_to","project_sections","milestone_sections","single_date","drag_lightbox","details_on_create","details_on_dblclick","initial_scroll","order_branch","order_branch_free","task_height","bar_height","bar_height_padding","min_grid_column_width","grid_resizer_column_attribute","keep_grid_width","grid_resize","grid_elastic_columns","show_tasks_outside_timescale","show_unscheduled","resize_rows","task_grid_row_resizer_attribute","min_task_grid_row_height","readonly_property","editable_property","calendar_property","resource_calendars","dynamic_resource_calendars","inherit_calendar","type_renderers","open_tree_initially","optimize_render","prevent_default_scroll","show_errors","wai_aria_attributes","horizontal_scroll_key","drag_multiple","csp","isWindowAwailable","env","isIE","navigator","userAgent","isIE6","isIE7","isIE8","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialized","createConfig","Error","async","headers","fastVersion","utc","dateToStrFn","Function","to_fixed","getISOWeek","getWeek","splt","strToDateFn","dateString","cspVersion","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","getDay","day_full","month_short","month_full","getUTCHours","getHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","set","temp","month_short_hash","month_full_hash","UTC","canUseCsp","useCsp","cspAutoCheck","dateHelper","init","s","date_part","setHours","hour_start","setTime","time_part","getTimezoneOffset","week_start","month_start","setDate","quarter_start","res_month","m","setMonth","year_start","day_start","setMinutes","minute_start","setSeconds","getMilliseconds","setMilliseconds","_add_days","modifiedDate","inc","originalDate","incCondition","getHoursCondition","getDateCondition","ndate","setYear","add_quarter","num","cspCompliantVersion","_getWeekNumber","isoWeek","nday","first_thursday","year_number","ordinal_date","convert_to_utc","parseDate","parse_date","token","_url","_token","_mode","_seed","_queue","api","_events","Accept","credentials","fetch","then","websocket","_wrapper","connect","_socket","onclose","n","location","protocol","o","r","WebSocket","onmessage","fire","onError","_send","_resubscribe","Promise","_uid","resolve","reject","onCall","filter","catch","onResponse","remoteEvents","remote","remote_client.Client","req","_ready","load","back","_remote","ready","on","checkTimeout","updPerSecond","_on_timeout","ceil","StateService","stateProviders","internal","utils.mixin","provider","Promise$1","$powerArray","$create","$removeAt","$remove","$find","$insertAt","$each","$map","$filter","isPlaceholderTask","DataStore","pull","$initItem","visibleOrder","powerArray","fullOrder","_skip_refresh","_filterRule","_searchVisibleOrder","_indexRangeCache","_getItemsCache","_attachDataChange","_parseInner","loaded","copyOnParse","utils.copy","isSilent","_updateOrder","updateItem","utils.defined","_removeItemInner","_addItemInner","order","data_size","getVisibleItems","getIndexRange","utils.uid","_changeIdInner","changeId","_moveInner","sindex","getIdByIndex","clearAll","alreadySilent","arraysEqual","arr1","arr2","quick","skipFilter","_quick_refresh","_mark_recompute","oldOrder","count","countVisible","eachItem","rule","filteredOrder","placeholderIds","_ganttConfig","from","to","cacheKey","ret","getIndexById","_getNullIfUndefined","getFirst","getLast","TreeDataStore","_branches","loadedItem","existingItem","$parentProperty","parentProperty","$getRootId","$openInitially","openInitially","_eachItemMainRangeCache","getConfig","splitParents","splitItems","taskOpenState","taskVisibility","haveSplitItems","_isSplitItem","canOpenSplitTasks","open_split_tasks","$expanded_branch","isHeadless","_buildTree","setParent","_add_branch","calculateItemLevel","getBranchIndex","targetIndex","_move_branch","$rendered_parent","_replace_branch_child","_traverseBranches","itemId","sid","source_pid","tbranch","tid","diff","childId","pid","getSiblings","getNextSibling","siblings","nextSibling","level","eachParent","_setParentInner","new_pid","_eachItemCached","cache","_eachItemIterate","startId","itemsStack","reverse","useCache","buildCache","startItem","parentsHash","old_parent","new_parent","old_id","newbranch","field","desc","criteria","original_criteria","els","renderedParent","actualParent","_skipTaskRecalculation","datastoreRender","itemRepainter","renderer","renders","getLayers","render_item","allData","loadedRanges","layer","layerData","get_visible_range","ids","prepare_data","render_items","update_items","extraDataArr","skipRepaint","batch_update","getDataRender","onUpdateRequest","change_id","getDatastores","storeNames","facadeFactory","$StoreType","self","selectedId","deleteItem","subItem","storeAccessName","dropService","storeList","setService","_getDatastores","refreshData","scrollState","stores","refresh_links","refreshLinks","refreshLink","_bulk_dnd","hasSplitParent","isSplitTask","linksStore","_update_flags","userdata","_clear_data","oldSelectId","_skipResourceRepaint","addTask","deleteTask","utils.bind","startTask","changeTaskId","oldid","newid","getLinkCount","isLinkExists","addLink","newLink","updateLink","deleteLink","changeLinkId","ScaleHelper","services","getSum","sizes","summ","setSumWidth","sum_width","adjustSize","full_width","splitSize","full","share","sortScales","cellSize","_isLegacyMode","scaleConfig","scale_unit","subscales","_prepareScaleObject","primaryScale","legacyMode","initTemplate","scale_cell_class","getSubScales","docLink","warn","min_coll_width","container_width","minDate","maxDate","heights","configs","main_scale","cfg","initScaleConfig","processIgnores","initColSizes","limitVisibleRange","unshift","alineScaleColumns","reverseScale","setPosSettings","indexes","trace_indexes","trace_index_transition","_ignore_time_config","skip","probe","isWorkTime","ignore_x","display_count","min_col_width","line_height","cont_width","column_count","ignores","eachColumn","trace_x_ascending","iterateScales","lower_scale","upper_scale","upper_dates","lower_dates","prevUpper","target_index","upper_start","upper_end","lower_start","lower_end","targetWidth","curr","tzOffset","_correct_dst_change","lastDate","outDate","shared","_init_tasks_range","PrimaryScaleHelper","helper","start_interval","onlyProjectTasks","extendRangeForDates","constraint_type","constraint_types","ASAP","ALAP","baselines","baseline","calculateEndDate","duration","_min_date","_max_date","updateTasksRange","old_min","old_max","copyLinkIdsArray","targetHash","copyLinkIds","treeHelper","getSubtreeLinks","getSubtreeTasks","DataProcessorEvents","dp","$gantt","$dp","_dataProcessorHandlers","cascadeDelete","clientSideDelete","setGanttMode","setUpdated","_sendTaskOrder","deleteAfterConfirmation","needDbDelete","needCascadeDelete","dpMode","updateMode","setUpdateMode","cascade","storeItem","sendAllData","_tSend","_waitMode","itemLinks","_links","_dp","_tMode","_serverProcessor","_ganttMode","substring","serverProcessor","pluralizedMode","urlSeparator","upd","xml","_xmlNodeToJSON","isExist","objData","property","assignmentsStore","handleResourceCRUD","handleResourceAssignmentCRUD","handleBaselineCRUD","updated","updatedRows","clientOnly","getUserData","_in_progress","resources","dataprocessor_assignments","resource_assignment_store","insertedTasks","pendingAssignments","insertResourceAssignment","assignment","dataprocessor_resources","resourcesStore","resource_store","resource","dataprocessor_baselines","baselineStore","helpers.forEach","SimpleStorage","_storage","getStoredItem","_Vt","DataProcessor$1","serverProcessorURL","action_param","autoUpdate","_headers","_payload","_postDelim","_routerParametersFormat","_invalid","messages","inserted","deleted","invalid","invalid_cell","enableUTFencoding","total","payload","_serializeAsJson","_router","router","_utf","escape","getSyncState","dnd","rowId","findRow","existing","set_invalid","setUserData","is_invalid","markRow","sendData","_methods","editStop","pendingUpdateModes","modes","checkBeforeUpdate","_beforeSendData","_getRowData","_serializeAsJSON","serialize_one","security_key","pref","valid","_forEachUpdatedRow","_sendData","_getAllData","pattern","_uActions","btag","ganttMode","correct","originalSid","that","_xml","getGanttMode","reqUrl","filePath","tag","processCallback","afterUpdateCallback","finalizeUpdate","xmltop","cleanUpdate","atag","xpath","_initialized","_dp_init","_setDefaultTransactionMode","delete_confirmation","_change_id","_row_style","$dataprocessor_class","_delete_task","$drop_target","setDp","dataProcessorEvents","user","_user","_needUpdate","_updateBusy","afterAutoUpdate","fullSync","loadUpdate","xml_node","getUpdates","vers","_getXmlNodeValue","updates","newState","dataToSend","processedData","_cleanupArgumentsBeforeSend","_cleanupItemBeforeSend","updatedItem","output","taskState","taskAction","getActionByState","_onResolvedCreateUpdate","actionPromise","errorMsgStart","errorMsgEnd","queryParams","afterUpdate","dhxVersion","urlParams","_applyPayload","preprocessedData","query","setTransactionMode","nodeValue","hasOne","traversedObjects","_prepareDate","helpers.arrayIncludes","_prepareArray","_prepareObject","rawItem","processedItem","dataItem","_prepareDataItem","DataProcessor","DEPRECATED_api","DataProcessor.DataProcessor","createDataProcessor","tMode","createMethod","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","restoreMethods","batchUpdatePayload","noRedraw","dp_mode","call_dp","resetProjects","resetProjectDates","createWbs","_needRecalc","_isRecalcNeeded","_isGroupSort","_getWBSCode","_calcWBS","$virtual","$wbs","_setWBSCode","getWBSCode","getByWBSCode","_isFirst","_prevSibling","_wbs","_parent","wbs","resetCache","getTaskByWBSCode","createResourceMethods","resourceTaskCache","singleResourceCacheBuilt","falsyValuePrefix","random","resourceHashFunction","getCacheKey","resourceIds","typeFilter","getResourceTasks","matchingResources","resourceId","resourceValue","resource_id","selectAssignments","resource_property","owners","getTaskBy","propertyName","propertyValue","getResourceAssignments","assignments","resourcePlugin","renderEditableLabel","editable","$task_id","$resource_id","renderSummaryLabel","sum","reduce","Number","editableResourceCellTemplate","$role","editableResourceCellClass","capacity","getSummaryResourceAssignments","childResource","initEditableDiagram","resource_render_empty_cells","timeoutId","makeEditable","cancelAnimationFrame","contentEditable","getCellsByType","$content","assignmentEditInProcess","strValue","innerText","assignmentId","startDate","endDate","assignmentStore","nextChunk","calculateDuration","updateTaskAssignments","editable_resource_diagram","fetchTasks","lightbox_resources","lightboxOptions","resourceStoreConfig","initItems","storeType","$resourcesStore","lightboxOptionsFnc","options","updateCollection","histogram_cell_class","histogram_cell_label","histogram_cell_allocated","histogram_cell_capacity","defaultResourceCellClass","defaultResourceCellTemplate","resource_cell_value","resource_cell_class","resource_assignments","resourceAssignmentsProperty","process_resource_assignments","resourceAssignmentFormats","auto","singleValue","valueArray","resourceValueArray","assignmentsArray","resourceAssignmentFormat","assignmentModes","fixedDates","fixedDuration","default","initAssignmentFields","initDelay","timing","_assignmentTimeFromTask","resourceAssignmentsStore","_makeAssignmentsFromTask","resourceAssignments","detectFormat","usedIds","defaultMode","_updateTaskBack","_assignAssignments","getTaskAssignments","_loadAssignmentsFromTask","_syncAssignments","storeAssignments","taskValues","assignmentsStoreValues","inBoth","inTaskNotInStore","inStoreNotInTask","taskOwner","ownerId","foundOwnerAssignment","taskSearch","storeSearch","processedIds","inTask","inStore","ignoreFields","_syncOnTaskUpdate","totalAssignments","needUpdate","needUpdateFor","undoBatchCancel","assignmentsHash","unscheduled","idsSearch","deleteIds","resourceAssignmentsCache","resourceTaskAssignmentsCache","taskAssignmentsCache","searchTaskId","resourceTaskCacheKey","getTaskResources","uniqueResources","addPlaceholder","callIfEnabled","insertPlaceholder","placeholders","new_task","afterEdit","newTask","dataProcessor","_silencedPlaceholder","isPlaceholderLink","auto_task_types","checkTaskType","changedTypes","targetType","getTaskTypeToUpdate","$needsUpdate","updateParentTypes","group_mode","delTaskParent","allTypes","hasChildren","taskType","originalRowDndParent","originalMoveTaskParent","isParsingDone","updateAfterRemoveChild","DurationFormatterNumeric","canParse","_ie","LinkFormatterSimple","_linkReg","linkPart","exec","_findSource","lag","pred","reqTemplate","_ne","formatters","durationFormatter","DurationFormatter","linkFormatter","LinkFormatter","empty_state_screen","show_empty_state","emptyStateElement","isGanttEmpty","placeholderContainer","empty_state_text_link","empty_state_text_description","clickEvents","attachAddTaskEvent","domHelpers","getContainer","wrapper","marginTop","oldNodes","detachAddTaskEvents","renderContent","emptyStateElementNode","hasBaselinesBelow","baselinesOnDifferentRow","render_mode","childrenHaveBaselines","hasBaselines","isSplitParent","getMaxParentHeight","heightLimit","maxHeight","shrinkHeight","splitChild","parentHeight","getItemPosition","rowHeight","_adjustSplitParentHeight","maxParentHeight","adjustTaskHeightForBaselines","childHeight","_increaseSplitParentHeight","getLayoutView","getBarHeight","subtaskId","subtask","subtaskHeight","baselineSize","baselineAmount","subrowHeight","newBaseline","existingBaseline","shouldRepaint","iteratedBaselines","taskBaselines","exisingBaselines","getTaskBaselines","exisingBaseline","repaint","parsing","jsonParseError","on_load","resp","responseURL","_process_loading","collections","_load_collections","assignmentsByTasks","collections_loaded","collection","serverList","option","option_key","$ignore","dhx_security","serializeTask","serializeLink","_copyLink","rawLinks","baselineCopy","attrs_only","attributes","_getCollections","opts","itms","attrs","k","attr","_getXML","toptag","getXMLTopNode","skey","evs","oldxml","startdate","est","enddate","predecessortasks","message","IsWorkTimeArgument","calendar","ClosestWorkTimeArgument","CalculateEndDateArgument","GetDurationArgument","calendarArgumentsHelper","getWorkHoursArguments","helpers.isValidDate","setWorkTimeArguments","unsetWorkTimeArguments","isWorkTimeArguments","processedConfig","getClosestWorkTimeArguments","arg","_getStartEndConfig","param","argumentType","getDurationArguments","hasDurationArguments","calculateEndDateArguments","WorkTimeCalendarMerger","_getIntervals","hoursArray","_toHoursArray","intervalsArray","formatHHMM","secondsValue","minutePart","_intersectHourRanges","first","baseArray","overridesArray","current","_mergeAdjacentIntervals","_mergeHoursConfig","firstHours","secondHours","merge","firstConfig","secondConfig","mergedSettings","customWeeks","processCalendar","config1","config2","date1","date2","hours2","WorkUnitsMapCache","timestamp","_cache","has","subCache","rawValue","unitCache","yearCache","Map","WorkUnitsObjectCache","LargerUnitsCache","getMinutesPerWeek","weekStart","_weekCache","_calendar","minutesPerWeek","getHoursPerDay","getMinutesPerMonth","monthStart","_monthCache","minutesPerMonth","nextMonth","DateDurationCache","stepCache","durations","endDates","compute","_getCacheObject","startDateTimestamp","_endDateCacheKey","resultTimestamp","_durationCacheKey","endDateTimestamp","CalendarWorkTimeStrategy","argumentsHelper","_workingUnitsCache","_largeUnitsCache","_dateDurationCache","_worktime","_cached_timestamps","_cached_timestamps_count","_clearCaches","_getUnitOrder","_resetTimestampCache","_timestamp","_checkIfWorkingUnit","hasDuration","_is_work_day","_getWorkHours","_is_work_hour","startHour","endHour","_getTimeOfDayStamp","dayEnd","_is_work_minute","checkTime","_nextDate","_getWorkUnitsBetweenGeneric","stepStart","stepEnd","next","checkFirst","checkLast","isLastStep","_isWorkTime","unitOrder","biggerTimeUnit","_getClosestWorkTimeFuture","_getMinutesPerHour","hourStart","hourEnd","_getMinutesPerDay","durationMinutes","durationHours","_getWorkUnitsForRange","getUnitsPerDay","_getMinutesBetweenSingleDay","_getIntervalTimestamp","minuteFrom","minuteTo","_getMinutesBetween","firstDayStart","firstDayEnd","lastDayStart","lastDayEnd","startPart","endPart","_getHoursBetween","_setConfig","_parseSettings","haveCustomWeeks","customWeeksRangeStart","customWeeksRangeEnd","customWeeksBoundaries","_parseHours","minCustomRangeStart","maxCustomRangeEnd","customTime","rangeStart","rangeEnd","fromReadable","toReadable","currentWeek","_tryChangeCalendarSettings","backup","hasWorkTime","_arraysEqual","_compareSettings","mySettings","thatSettings","myDays","otherDates","myHours","otherHours","equals","myWeek","thatWeek","getWorkHours","dateValue","endHours","timestampRanges","part","timerangeConfig","durationSeconds","setWorkTime","calendarConfig","unsetWorkTime","reset_calendar","dateKey","isWorkUnit","setItem","getDuration","_calculateDuration","sign","mult","getEndDate","_calculateEndDate","_calculateMinuteEndDate","_subtractMinuteDate","_calculateHourEndDate","_addInterval","stopAction","added","dstShift","_addHoursUntilDayEnd","rangeHours","addHours","intervalEnd","durationLeft","hoursPerDay","_addMinutesUntilHourEnd","rangeMinutes","addMinutes","_subtractMinutesUntilHourStart","hourStartTimestamp","initialDateTimestamp","minutePrecision","_isMinutePrecision","addedInterval","calculatedDay","daySchedule","minutesInDay","dayStart","iterateFromDayEnd","isWorkHour","workInterval","prevInterval","minutesInHour","_getClosestWorkTimePast","times","lastInterval","getClosestWorkTime","_getClosestWorkTime","inputDate","direction","closestFuture","closestPast","_getClosestWorkTimeGeneric","_findClosestTimeInDay","resultDate","fromDayEnd","_getClosestWorkMinute","increment","hasRegularHours","_checkWorkHours","dayConfig","legacyResourceCalendarConfig","isLegacyResourceCalendarFormat","resourceCalendarsProperty","getResourceProperty","resourceCalendarsConfig","getCalendarIdFromLegacyConfig","calendarId","dynamicResourceCalendars","dynamicCalendars","getCalendarIdFromMultipleResources","manager","getResourceCalendar","tempCalendar","mergeCalendars","addCalendar","CalendarManager","_calendars","_legacyConfig","_isLegacyConfig","createDefaultCalendars","CalendarDisabledTimeStrategy","TimeCalculator","calendarManager","createArgumentsHelper","$disabledCalendar","NoWorkTimeCalendar","_convertWorkTimeSettings","days","calendars","mergeHelper","CalendarMergeHelper","_createCalendarFromConfig","createCalendar","apiCore","preparedConfig","parentCalendar","defaults","fulltime","getCalendar","getCalendars","_getOwnCalendar","resourceProperty","calendarsConfig","getTaskCalendar","taskObject","groupMode","currentTask","$effective_calendar","isCalendar","deleteCalendar","restoreConfigCalendars","possibleCalendar","every","fixedUnits","_getCalendar","worktimeFacadeFactory","timeCalculator","_hasDuration","isUnscheduledTask","_isAllowedUnscheduledTask","_isTaskInTimelineLimits","taskStart","taskEnd","_getProjectEnd","project_end","_getProjectStart","project_start","getDefaultTaskDate","parent_id","schedule_from_end","_set_default_task_timing","$new","showTask","_lightbox_id","_tasks_dnd","drag","getTaskTimingMode","task_type","$no_start","$no_end","scheduled_summary","updateTaskTiming","assignProjectDates","taskTiming","summaryDateFields","manuallyScheduledSummaryDateFields","dateFields","_init_task_timing","getSubtaskInfo","rollup","isScheduledSummary","task_mode","dirty","$calculate_duration","effectiveCalendar","taskMode","$rollup","getSubtaskDuration","_update_parents","updateAll","has_changed","startDateField","$auto_start_date","endDateField","$auto_end_date","oldStart","oldEnd","roundDate","upper","lower","colIndex","correctTaskWorkTime","listenWindowResize","resizeDelay","resizeTimeout","previousSize","getContainerSize","container_resize_method","lowlevelResizeWatcher","$scrollbarRepaint","currentSize","repaintGantt","previousHeight","previousWidth","gantt_core","expire","invalidContainerMessage","validateNode","cloneNode","_reinit","dropLayout","_clearTaskLayers","_clearLinkLayers","rebuildLayout","calculateScaleRange","createView","getPropertyValue","resizeWatcher","contentWindow","resetLayout","initTemplates","domHelpers.toNode","$mouseEvents","edit","question","confirm_deleting","confirm_deleting_title","_simple_confirm","hideLightbox","visibleDate","_sort","posX","_getHorizontalScrollbar","codeScrollLeft","preserveScroll","new_pos","posY","gridCell","attachedScrollbar","verticalScrollbar","$view","setSizes","changeLightboxType","getLightboxType","_silent_redraw_lightbox","_get_link_type","from_start","to_start","isLinkAllowed","prevOffset","time_unit","helpers.getSecondsInUnit","offsetChanged","domHelpers.getClassName","icon_save","icon_cancel","icon_details","confirm_closing","section_description","section_time","section_type","section_deadline","section_baselines","column_wbs","column_text","column_start_date","column_duration","column_add","confirm_link_deleting","link_start","link_end","type_task","type_project","type_milestone","weeks","months","years","message_ok","message_cancel","section_constraint","asap","alap","snet","snlt","fnet","fnlt","mso","mfo","resources_filter_placeholder","resources_filter_label","baselines_section_placeholder","baselines_add_button","baselines_remove_button","baselines_remove_all_button","deadline_enable_button","deadline_disable_button","LocaleManager","addLocale","_locales","getLocale","DHXGantt","license","edit_save","edit_cancel","factory","supportedExtensions","extensionManager","ExtensionManager","activePlugins","plugin","getter","service","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","responseXML","getElementsByTagName","xpathExp","docObj","selectNodes","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","postSync","isQt","noCache","toUpperCase","RemoteEvents","copyDomEvent","pageX","pageY","DnD","_obj","_settings","inputMethods","getInputMethods","_drag_start_timer","clearDragTimer","eventParams","passive","accessor","timeStamp","original_target","original_element_sizes","domHelpers.getClosestSizedElement","dragStart","touch_drag","traceDragEvents","inputMethod","mousemove","dragMove","dragScroll","limited_mousemove","started","updates_per_second","dndActive","cancelable","mousemoveContainer","mouseup","checkPositionChange","diff_x","diff_y","pow","sensitivity","initDnDMarker","backupEventTarget","getEvent","backup_element","touchEventsSupported","touches","elementFromPoint","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","getPosition","_prevent_touch_scroll","_touch_drag","_touch_feedback","targetTouches","templatesLoader","regTemplates","initial","template_name","gantt_save_btn","gantt_cancel_btn","gantt_delete_btn","c","progress_text","grid_header_class","task_class","task_end_date","grid_row_class","task_row_class","timeline_cell_content","scale_row_class","grid_indent","grid_folder","grid_file","grid_open","grid_blank","task_unscheduled_time","grid_date_format","link_class","link_description","drag_link","drag_link_class","tooltip_date_format","baseline_text","stateService","selected_task","deletedLinks","originalTask","checkLinkedTaskVisibility","sync_link","sourceTask","sync_link_delete","sync_links","mapEvents","conf","mapFrom","mapTo","sourceEvent","targetEvent","taskLinks","existingLink","sourceMatch","targetMatch","typeMatch","changedTask","oldState","sourceVisible","targetVisible","onItemLoading","onBeforeAdd","onAfterAdd","onBeforeUpdate","onAfterUpdate","onBeforeDelete","onAfterDelete","onIdChange","onBeforeItemMove","onAfterItemMove","onFilterItem","onItemOpen","onItemClose","onBeforeSelect","onAfterSelect","onAfterUnselect","modules","new_task_placeholder","getGridColumn","activate","_cached_functions","update_if_changed","critical_path_mode","wrap_methods","_prefetch_originals","prefetch","methodname","original","optimizer","argumentsArray","l","get_arguments_hash","cached_values","has_cached_value","get_cached_value","cache_value","arguments_hash","is_date","values","stringify_argument","deactivate","setup","override_gantt","gantt_methods","highlight_critical_path","deactivTimeout","_eventRemoveAll","resetLightbox","i18n","en","ar","be","ca","cn","cs","da","de","es","fa","fi","fr","he","hr","hu","it","jp","kr","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","setLocale","localeObject","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","messageBox","keyboard","cancelBubble","modality","cover","onkeydown","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","btn","onclick","hidden","innerWidth","innerHeight","alertPopup","confirmPopup","boxPopup","box_params","params","messageInfoAttr","insertBefore","timers","hideAll","popups","alert","confirm","modalbox","extendSettings","parentSettings","own","$extendedConfig","setPrototypeOf","configurable$1","parentView","parentConfig","parentTemplates","$getConfig","$getTemplates","uiFactory$1","views","createdViews","creator","configure","configurable","$parent","initUI","registerView","viewConstructor","createMouseHandler","eventHandlers","doubleclick","contextMenu","addEventTarget","onClick","findEventHandlers","callEventHandlers","onContextMenu","src","delegateHandlers","h","onDoubleClick","onMouseMove","_last_move_event","domEvents","delegate","elementHandlers","callHandler","mouseEvents","genericViewPortChecker","x_end","y_end","isLegacyRender","getRowRectangle","getVisibleTasksRange","indexStart","indexEnd","extraTasksIds","inlineEditorId","layerFactory","renderFactory","task_area_pulls","task_area_renderers","getRenderer","renderMethod","updateMethod","getRectangle","renderCallbackMethod","specializedViewPortChecker","basicGetRectangle","onrender","isInViewPort","layerView","viewConfig","rendererViewPort","useBuffer","remove_item","rendered","clear_container","basicGetRange","getVisibleRange","prepareData","buffer","createDocumentFragment","vis","itemsSearch","renderedItems","newElements","nodesToRemove","renderCalledFor","itemNode","restore","replace_item","item_id","newNode","replaceChild","clearRenderers","createGroup","relativeRoot","defaultFilters","initLayer","renderGroup","tempCollection","filters","_add","getLayer","pending","topmost","rel","mergeFilters","requestUpdate","eachLayer","removeLayer","filter_methods","filter_method","barRectangle","startCoord","endCoord","calculated","clearCache","rec","sourceBox","targetBox","initialized","visibleBoxes","isLinkInViewPort","sourceTop","sourceHeight","targetTop","targetHeight","sourceLeft","sourceRight","targetLeft","targetRight","$skipSmartRenderOnScroll","Cell","headerHeight","$domEvents","$name","$factory","_headerClickHandler","final","$preResize","topCont","topSize","getSize","maxWidth","minHeight","setSize","_hide","cellIndex","moveView","$toHTML","canCollapse","$fill","collapsed","size","gravity","getContentSize","$lastSize","contentX","contentY","_getBorderSizes","borders","horizontal","vertical","_currentBorders","_borders","_sizeHeader","_sizeContent","_setBorders","domHelpers.removeClassName","cssHash","domHelpers.addClassName","xLayout","transform","__extends","__","Layout","_super","_this","_parseConfig","domHelpers.removeNode","$cells","_resizeScrollbars","scrollbars","scrollChanged","visibleScrollbars","hiddenScrollbars","scrollbarsToHide","showScrollbar","scrollbar","hideScrollbar","shouldHide","shouldShow","visibleGroups","group","_syncCellSizes","groupName","newSize","groups","_eachChild","_syncGroupSize","cells","_xLayout","newSizeValue","isGravity","ownSize","resizeSibling","siblingSize","totalGravity","totalSize","mainGrid","grid_width","startStage","mainCall","_resizeInProgress","contentViews","setContentSize","_getAutosizeMode","$originalWidthStored","$originalWidth","$originalHeightStored","$originalHeight","isChild","cellId","sub","getCells","domHelpers.insertNode","domHelpers.getChildNodes","contentWidth","contentHeight","_cleanElSize","_getBoxStyles","computed","properties","boxSizing","clientHeight","MozBoxSizing","horPaddings","borderLeftWidth","borderRightWidth","vertPaddings","borderTopWidth","borderBottomWidth","borderBox","outerWidth","outerHeight","boxSizes","contentSizes","_sizes","margin","_calcFreeSpace","side","_free","_gravity","_calcSize","_configureBorders","borderClass","lastVisibleIndex","lastCell","borderColorClass","_updateCellVisibility","oldVisibleCells","_visibleCells","firstCall","visibleCells","parentVisibility","hide_empty","hideCell","cellView","marginSide","ViewLayout","$cell","byMaxSize","otherCell","ViewCell","childConfig","$initialized","unload","_setContentSize","outerX","outerY","childSize","ScrollbarCell","SCROLL_MODIFIER_KEYS","_scrollHorizontalHandler","_scrollVerticalHandler","_outerScrollVerticalHandler","_outerScrollHorizontalHandler","_mouseWheelHandler","scroll_size","_isHorizontal","eachCell","_isVertical","_initVertical","_initHorizontal","_initMouseWheel","_initLinkedViews","_getRootParent","_eachView","_getLinkedViews","$scroll_hor","$scroll_ver","_updateLinkedViews","scrollHorizontally","_scrolling","oldSize","scrollVertically","_wheel_time","_oldLeft","_getScrollSize","scrollSize","outerSize","isHorizontal","linked","scrollProperty","innerSizeProperty","outerProperty","_getScrollOffset","cellScrollSize","nonScrollableSize","outerScroll","innerScroll","visible","scrollSizes","_setScrollSize","toggleVisibility","_getScaleOffset","parentLayout","_oldTop","_checkWheelTarget","connectedViews","wheelSpeed","wheelSpeedConfig","wheel_scroll_sensitivity","ff","deltaX","wheelDeltaX","deltaY","wheelDelta","multiplier","deltaMode","wx","wy","horizontalScrollModifier","oldLeft","detail","oldTop","createMixin","getItemTopCache","getRowTopCache","getItemHeightCache","totalHeightCache","getItemHeightCacheState","quickPosition","cachedRowHeight","canUseSimpleCalc","_getRowHeight","_refreshState","rowStore","globalRowHeight","canUseSimpleCalculation","_resetTopPositionHeight","_resetHeight","getCacheStateTotalHeight","shouldClearHeightCache","all","itemIndex","_fillHeightCache","defaultHeight","globalHeight","itemHeightCache","sumHeight","getHeight","visibleItems","totalHeight","canvasRender","destroy","Timeline","_posFromDateCache","_timelineDragScroll","topPositionMixin","$task_scale","taskBg","$task_bg","$task_baselines","$task_links","$task_bars","$task_constraints","$task_deadlines","_tasks","linksAttr","bindLinks","item_attribute","layers","_createLayerConfig","linkLayers","_attachLayers","backgroundImage","data_els","scrollWidth","scrolled","_refreshScales","_scales","_getScaleChunkHtml","taskFilter","taskLayers","expose","taskBar","hide_bar","_taskLayers","_linkLayers","_bindStore","taskRenderer","bar_layer","_taskRenderer","_initStaticBackgroundRender","linkStore","linkRenderer","linkLayer","_linkRenderer","staticRender","_staticBgHandler","staticBgContainer","$task_bg_static","staticBackgroundHeight","_clearLayers","_render_tasks_scales","scales_html","outer_width","helpers","cfgs","fromPos","toPos","cssClass","tplClass","_prepareScaleHtml","globalConfig","globalTemplates","helpers.findBinary","cssclass","g","floatConfig","sticky","labelPosition","approxLabelWidth","labelPos","translateValue","getTimelineCellAttr","_getColumnDuration","wholeCells","partCell","roundPos","_getNextVisibleColumn","visibleDateIndex","_getPrevVisibleColumn","_getClosestVisibleColumn","dateIndex","visibleIndex","transition","xLeft","xRight","displayStart","displayEnd","isMilestoneRender","_timelineCacheAttached","_unbindStore","ScrollableGrid","_scrollOrder","getCurrentX","_dnd","_scrollView","attachEvents","isScrollable","gridBoundingRect","maxLeft","minLeft","currentX","autoscrollRight","autoscrollStart","autoscrollLeft","autoscrollStop","scrollStep","COLUMN_ID_ATTR_NAME","ColumnsGridDnd","_targetMarker","calculateCurrentPosition","eventX","DND","_scrollableGrid","_draggedCell","draggedColumn","draggedIndex","_gridConfig","outerHTML","lineHeight","_dragX","columnIndexes","findColumnsIndexes","targetColumn","cleanTargetMarker","setMarkerPosition","drawTargetMarker","reorderColumns","draggedId","xBefore","xAfter","currentColumn","startX","endX","columnRelativePos","compare","relativeX","getCorrection","gridOffset","nextPosition","Grid","$state","gridAriaAttr","gridAttrString","gridDataAriaAttr","gridDataAttrString","reorder_grid_columns","gridScaleRowAttrString","doOnRender","_renderHeaderResizers","_mouseDelegates","mouseEventContainer","resizerrow","_task_grid_row_resize","row_before_start","row_id","row_after_start","row_drag_move","dd","itemHeight","itemTop","pointerPosition","markerStartPosition","marker_height","minPointerPosition","row_drag_end","oldItemHeight","finalHeight","dnd_sensitivity","_addLayers","_initEvents","_columnDND","ColumnDnd","_validateColumnWidth","numericWidth","elasticColumns","_setColumnsWidth","columnProperty","newColumnWidth","columnsWidth","_getGridWidth","_gridCacheAttached","_initSmartRenderingPlaceholder","_calculateGridWidth","_renderGridHeader","getColumnIndex","excludeHidden","hiddenIndexShift","getColumn","gridLine","gridTaskRowResizer","_refreshPlaceholderOnStoreUpdate","$rowsPlaceholder","_getColumnWidth","min_width","new_width","max_width","_checkGridColumnMinWidthLimits","_getGridWidthLimits","min_limit","max_limit","newWidth","start_index","columns_width","final_width","extra_width","start_width","iterator","curExtra","_getColsTotalWidth","cols_width","v","parseFloat","unknown","gridWidth","delta","changed","lineHeigth","colWidth","gridScaleCellAttrString","defaultMapping","isChanged","save","onShow","preventKeyNav","shouldPrevent","editPrevCell","editNextCell","onHide","keyNavMappings","onBlurDelay","keyNav","activeCell","editorState","hasEditor","editorType","anyModifier","BaseFactory","BaseEditor","set_value","get_input","get_value","is_changed","currentValue","is_valid","textEditorFactory","TextEditor","numberEditorFactory","NumberEditor","oninput","selectEditorFactory","SelectEditor","optionsHtml","dateEditorFactory","html5DateFormat","dateToStr","strToDate","DateEditor","minValue","maxValue","predecessorEditorFactory","PredecessorEditor","getFormatter","formatter","parseInputString","predecessors","delimiter","formatPredecessors","formatLinkKey","getLinksDiff","predecessorCodes","selectedLinks","Set","existingLinksSearch","linksToAdd","linkKey","linksToDelete","linksDiff","autoSchedule","inputPredecessors","taskPredecessors","durationEditorFactory","linkedPropertiesProcessor","decreaseStartDate","initConfigs","number","predecessor","keyboardMapping","mapping","setMapping","getMapping","eventBus","inlineEditController","createEditors","_createPlaceholder","inlineEditorAttr","updateTaskDateProperties","ganttHandlers","_itemId","_columnName","_editor","_editorType","_placeholder","setValue","editorConfig","getValue","_getItemValue","inline_editors_date_processing","_findEditableCell","nextColumn","getNextCell","getFirstCell","getLastCell","canChangeRow","moveRow","nextItem","editNextRow","skipReadonly","editPrevRow","isBarInViewport","createTaskRenderer","_task_default_render","controlsMargin","padd","milestoneHeight","milestoneWidth","done","pr","markerPos","basic","link_from_start","link_target_id","isCriticalTask","link_landing_area","from_id","link_to_start","dragClass","progressColor","textColor","u","setProperty","_get_link_crossing_css","marginStyle","_render_side_content","setTaskBarAttr","_render_pair","outer","showLinkPoints","cond","ln","tp","marginLeft","marginRight","defaultRenderer","createBaseBarRender","resourceHistogramRenderer","getVisibleCellsRange","firstCellIndex","lastCellIndex","isColumnVisible","cellLeftCoord","cellRightCoord","bgPlaceholder","placeholderConfig","lastTaskId","placeholderTask","calendar_id","createLinkRender","drawer","current_pos","dirs","path","point","get_lines","line_to","get_path","line","_get_line","get_wrapper_sizes","wrapper_size","get_line_sizes","line_size","link_line_width","render_line","innerPos","render_corner","corner","radius","lineWidth","cornerDiv","borderVertical","borderHorizontal","arrow","get_direction","vect","path_builder","point_to","get_points","get_endpoint","xy","e_y","e_x","lineType","get_line_type","forward","getMilestonePosition","splitParams","milestoneTask","siblingBaselines","shapes","lines","link_radius","arrowSize","nextLine","cornerX","cornerY","lastLine","arrowX","arrowY","shape","render_arrow","cssTemplate","isCriticalLink","linkAttr","createResourceTimelineBuilder","assignmentsPassed","timegrid","scaleUnit","scaleStep","precalculatedTimes","firstColumn","minScaleDate","currDate","cachedTimes","timetable","rowDnd","checkPlaceholderTask","getStore","initial_open_state","$transparent","lastTaskOfLevel","last_item","_getGridPos","gridHeight","maxBottom","_getTargetY","scrollPos","_getTaskByY","dropIndex","gridDataSizes","reorderMarkerAttr","containerSize","targetY","allowedLevel","over","nextId","dropTarget","createDropTargetObject","targetId","prevSibling","nextSiblingTarget","dndTaskId","prevSiblingTarget","firstChildTarget","lastChildTarget","findClosesTarget","targetLevel","findTargetAbove","findTargetBelow","getSameLevelDropPosition","relTargetPos","eventTop","targetAbove","targetBelow","gridToPageCoordinates","gridPos","setWidthWithinContainer","higlighter","removeLineHighlight","markerLine","highlightPosition","ePos","pointerEvents","markerFolder","folderHighlightWidth","linePos","indentNode","indent","iconWidth","childCount","markerLineTop","rowDndMarker","opacity","drop_target","getDropPosition","doctype","minTop","firstVisibleTaskIndex","firstVisibleTaskId","firstVisibleTaskPos","hiddenTaskPart","gridPosition","gridBottom","placeholderRowHeight","lockLevel","getLockedLevelTarget","initializer","onCreated","extendGantt","_inlineEditors","onInitialized","initEvents","extendDom","onDestroyed","clearEvents","showDate","sorting_method","totalWidth","taskDnD","createTaskDND","roundTaskDates","round_task_dates","dragMultiple","before_start","before_finish","after_finish","clear_drag_state","set_actions","drag_from_start","stage","_move","_resize","_resize_progress","on_mouse_move","on_mouse_down","on_mouse_up","start_x","start_y","coords_x","_drag_task_coords","minDurationInUnits","_calculateMinDuration","diffValue","_find_max_shift","dragItems","correctShift","minX","maxX","maxShift","minShift","multipleDragShift","new_start","new_end","obj_s_x","obj_e_x","_mouse_position_change","oldPos","newPos","_is_number","isFinite","start_drag","sX","sY","now","_start_dnd","_update_on_move","_update_item_on_move","curr_date","dragHash","_isMultiselect","dragProject","initialDrag","childDrag","_get_drag_mode","_fix_dnd_scale_time","fixStart","_fix_working_times","_finalize_mouse_up","_fireEvent","_dhx_changed","finalizingBulkMove","moveCount","doFinalize","dragProperty","selectedTasksIds","selectedTask","_addSubtasksToDragMultiple","trigger","drag_state","summaryId","initLinksDND","_link_landing","_link_target_task","_link_target_task_start","_link_source_task","_link_source_task_start","getDndState","link_edge_marker","link_landing_hover_area","markerSize","viewportSize","ganttOffsetY","updateMarkedHtml","resetDndState","showDirectingLine","s_x","s_y","_direction","link_direction_class","dist","tan","angle","atan","coordinateCircleQuarter","sin","cos","shiftLeft","shiftTop","eX","eY","_dir_start","landing","prevTarget","prevLanding","prevToStart","targ","absCoords","domHelpers.getRelativeNodePosition","_dir_end","targetChanged","linkDnD","_linksDnD","_tasksDnD","MouseDelegates","_attachDomEvents","_attachStateProvider","_clearDomEvents","_clearStateProvider","_delete_link_handler","coll","coll_date","scale_step","getVerticalScrollbar","getHorizontalScrollbar","_legacyGridResizerClass","resizers","gridResizer","mainTimeline","colsWidth","hideGrid","grid_limits","ganttContainerWidth","verticalScrollbarWidth","gridOverflow","original_grid_width","skinSettings","skins","_initScrollStateEvents","_getVerticalScrollbar","_findGridResizer","gridFirst","_getSiblings","_behind","_front","resizeInfo","initialWidth","prevCellWidth","nextCellWidth","viewCell","limits","newBehindSize","newFrontSize","oldBackSize","oldFrontSize","newBackSize","ui$1","attachInitializer","uiFactory","Scrollbar","mainLayoutInitializer","mainTimelineInitializer","mainGridInitializer","ResourceGrid","ResourceTimeline","ResourceHistogram","layersEngine","createLayerFactory","previusSiblingContainer","defaultContainerSibling","addTaskLayer","rangeFunction","getVisibleTaskRange","_getTaskLayers","removeTaskLayer","addLinkLayer","getVisibleLinksRangeFactory","isLinkInViewport","_getLinkLayers","removeLinkLayer","gridEditorsFactory","layersApi","textValue","aria","gridAddButtonAttrString","justifyContent","center","gridCellAttrString","css_template","taskRowAttr","rowNode","cellNode","external_render","adapter","isElement","renderElement","renderedCells","isRendered","detachRenderedCell","getCellClassTemplate","getCellContentTemplate","renderOneCell","contentTemplate","cssTemplateContent","htmlTemplateContent","customCell","cellCssTemplate","cellHtmlTemplate","odd","placeholderTop","placeholderHeight","renderTaskBar","timedProjectBar","renderTimedProjectBar","taskRollupBar","renderedNodes","checkVisibility","generateChildElement","childCopy","$rendered_at","getKey","renderParentId","rollupKey","taskSplitBar","renderSplitTaskBar","taskConstraints","renderConstraints","taskDeadline","renderDeadline","renderBaselines","renderLink","resourceRow","getResourceLoad","resourceTimetable","renderedResourceLines","renderResourceLineCell","detachRenderedResourceLine","checkedColumns","resourceHistogram","resize_el","rowResizerAttr","layersService","_get_skin","themeVar","themeName","isCssVarTheme","href","_theme_info","theme","cssVarTheme","skinset","_second_column_width","_third_column_width","_lightbox_template","_redefine_lightbox_buttons","scrollRange","scrollDelay","scrollSpeed","isMove","delayTimeout","startPos","eventPos","isDisplayed","isScrollState","dragMarker","isResize","isLink","isClickDrag","defineDelayTimeout","speed","tick","autoscroll_delay","defineScrollInterval","autoscrollInterval","isScroll","gridDrag","need_scroll","currentScrollTop","scrollOuterHeight","scrollInnerHeight","currentScrollLeft","scrollOuterWidth","scrollInnerWidth","autoscroll_step","boxSize","$","jQuery","fn","dhx_gantt","each","newgantt","Gantt","getGanttInstance","jquery_hooks","dhtmlx","attaches","attachGantt","cmp","attachObject","dataType","dataObj","vs","av","border","gridId","gridObj","dhtmlXCellObject","dhtmlx_hooks","USE_KEY","_defaultScales","TimelineZoom","zoomIn","getCurrentLevel","setLevel","zoomOut","_levels","_activeLevelIndex","getLevels","zoomLevel","_getZoomIndexByName","levelName","_getVisibleDate","_visibleDate","cursorOffset","nextConfig","chartConfig","cursorDate","newPosition","middleDate","_attachWheelEvent","_useKey","_handler","_defaultHandler","timelineOffset","wheelUp","stopPropagation","_setScaleSettings","_setScaleDates","_initialStartDate","_initialEndDate","activeLevelIndex","_mapScales","levels","_minColumnWidth","minColumnWidth","_maxColumnWidth","maxColumnWidth","_widthStep","widthStep","_stepUp","_stepDown","nextLevel","addTouchEvents","platform","maxTouchPoints","_touch_events","getTaskDND","tasksDnD","touch_feedback","touch_feedback_duration","vibrate","touchHandlers","names","dblclicktime","actionMode","scrollMode","actionStart","longTapTimer","currentDndId","dndNodes","targetView","multiTouchEvents","newScrollState","block_action","allViews","_locate_css","taskNode","dummy","BaseControl","BaseConstrutor","htmlHelpers","getHtmlSelect","_attributes","getHtmlOption","_getHtmlContainer","getHtmlButton","getHtmlDiv","getHtmlLabel","getHtmlInput","_getHtmlAttributes","ResourcesControlConstructor","Super","SelectControl","sns","_dhx_onchange","onchange","_focus","ParentControlConstructor","ParentControl","_display","allow_root","root_label","form_blocks","tmpDom","newOptions","onselect","TemplateControl","TextareaControl","_get_input","TimeControl","getTimePicker","sectionClassName","_time_format_order","auto_end_date","_update_lightbox_select","_fill_lightbox_select","_resolve_default_mapping","selects","getTimePickerValue","autofix_end","_get_timepicker_step","SelectControlConstructor","CheckboxControl","single_value","checkboxes","checked","resArray","RadioControl","radio","default_value","DurationControl","_getStartDate","_getDuration","singleDate","lightboxDurationInputAttrString","durationInputClass","duration_val","inps","btns","endspan","_calc_date","_change_duration","charCode","ResourcesControl","ConstraintControl","isNonTimedConstraint","toggleTimeSelect","timeSelects","typeValue","isNonTimed","disabled","typeSelect","_eventsInitialized","constraintDate","constraintType","getConstraintType","TypeselectControl","typeKey","oldOnChange","_lightbox_current_type","BaselineControl","_generateBaselineRow","durationLabel","deleteLabel","durationEl","deleteButton","baselineRow","section","baselineNode","baselineId","dataset","updatedBaseline","button_click","_get_typed_lightbox_config","_lightbox_methods","_lightbox_root","showCover","_fill_lightbox","_setLbPosition","lightboxVisibleAttr","getLabel","list_name","_lightbox_type","lightboxDiv","fullWidth","ds","classNames","cspEnvironment","salesforceEnvironment","_lightbox","_is_lightbox_timepicker","wide_form","getHtmlButtons","lightboxAttr","onmousedown","_ready_to_dnd","ontouchstart","onselectstart","cursor","_init_dnd_events","show_cover","_cover","_render_sections","backup_overflow","labelBlock","inputBlock","inputId","_init_lightbox_events","block","_center_lightbox","rootElement","_move_while_dnd","_finish_dnd","_get_type_name","type_value","floatRight","lightboxButtonAttrString","getTimeFormat","time_format","getHtmlTimePickerOptions","start_year","end_year","tdate","timeFormat","year_range","_time_values","lightbox_events","_save_lightbox","_cancel_lightbox","sec","buttonTarget","getLightboxValues","time_optional","duration_optional","lightboxHiddenAttr","hideCover","_custom_lightbox","_set_lightbox_values","lightboxHeader","lightbox_header","getLightboxSection","get_template_control","control","get_select_control","get_textarea_control","get_time_control","_dnd_start_lb","gantt_unselectable","lb","_lb_start","ariaAttrs","limit_time_select","first_hour","last_hour","lightboxSelectAttrString","mapOffset","checkbox","constraint","typeselect","oldType","ui","codeHelpers.arrayFind","domEventScope","uiApi","getTimeline","getGrid","getBaseCell","baseCell","getAttachedScrollbar","DEFAULT_VALUE","tryCall","getTaskTop","getTaskBarHeight","domAttr","getLinkNode","oldH","oldV","verticalViews","horizontalViews","commonViews","viewId","newV","newH","date_x","scroll_to","leftPos","_scroll_state","timelineCell","x_pos","y_pos","x_inner","y_inner","scrollVer","scrollHor","horState","verState","cellName","horizontalScroll","verticalScroll","createLayoutFacade","resetSkin","monitorThemeChange","_addThemeClass","setSkin","monitorIntervalId","csstheme","skyblue","lightbox_additional_height","dark","meadow","terrace","broadway","_config_buttons_left","_config_buttons_right","material","indx","zoom","_extend_to_optional","lightbox_block","optional_time","update_block","button_text","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","_taskCommonAttr","linkTypes","toStart","fromStart","gridSeparatorAttr","buttonName","role","tabindex","headerText","time_option","buttonLabel","targetAttribute","_locateHTML","firstTask","domHelpers.getScrollSize","availablePlugins","critical_path","grouping","groupBy","overlay","_load_url","cl","_load_type"],"mappings":";;;;;;;;;;;AACA,SAASA,EAAgBC,GACxB;AAAA,MAAIC,IAAI,GAAGC,IAAK,GAAGC,IAAM,GAAGC,IAAO;AACnC,MAAIJ,EAAKK,uBAAuB;AAC/B,QAAIC,IAAMN,EAAKK,yBACXE,IAAOC,SAASD,MAChBE,IAAWD,SAASE,mBACvBF,SAASD,KAAKI,cACdH,SAASD,MAENK,IAAYC,OAAOC,eAAeL,EAAQG,aAAaL,EAAKK,WAC5DG,IAAaF,OAAOG,eAAeP,EAAQM,cAAcR,EAAKQ,YAC9DE,IAAYR,EAAQQ,aAAaV,EAAKU,aAAa,GACnDC,IAAaT,EAAQS,cAAcX,EAAKW,cAAc;AAC1DjB,QAAOK,EAAIL,MAAOW,IAAYK,GAC9Bf,IAAOI,EAAIJ,OAAOa,IAAaG,GAE/Bf,IAAQK,SAASD,KAAKY,cAAcb,EAAIH,OACxCC,IAASI,SAASD,KAAKa,eAAed,EAAIF;AAAAA,EAC5C,OAAQ;AACN,WAAMJ,IACLC,MAAYoB,SAASrB,EAAKsB,WAAU,EAAA,GACpC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AM,cAChBA,EAAGn/I,KAAK4D,IAAAA;AAAAA,MACZ,GAAKA,IACL,CAAA;AAAA,IAAA;AAAA,EACA,EDfc8C,CAAAA,IAINA;AACR,EDd0C2hB;","x_google_ignoreList":[44]}
\ No newline at end of file
+{"version":3,"file":"dhtmlxgantt.es.js","sources":["../sources/core/ui/utils/dom_helpers.js","../sources/utils/global.js","../sources/ext/click_drag/eventsManager.ts","../sources/utils/eventable.js","../sources/utils/helpers.js","../sources/ext/click_drag/selectedRegion.ts","../sources/ext/drag_timeline/eventsManager.ts","../sources/ext/keyboard_navigation/modals.js","../sources/ext/quick_info/quickInfo.ts","../sources/utils/utils.js","../sources/core/ui/utils/dom_event_scope.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/undo/monitor.ts","../sources/ext/undo/undo.ts","../sources/ext/extensions_gpl.ts","../sources/ext/click_drag/index.ts","../sources/ext/drag_timeline/index.ts","../sources/ext/fullscreen/index.ts","../sources/ext/keyboard_navigation.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/elements/gantt_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/task_row.js","../sources/ext/keyboard_navigation/elements/task_cell.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/quick_info/index.ts","../sources/ext/tooltip/index.ts","../sources/ext/undo/index.ts","../sources/ext/marker.js","../sources/ext/multiselect.js","../sources/ext/export_api/index.ts","../sources/constants/index.js","../sources/ext/extension_manager.ts","../sources/core/common/config.ts","../sources/utils/env.js","../sources/core/common/serialize.ts","../sources/core/common/ajax.js","../sources/core/common/date_parsers/fast_version.ts","../sources/core/common/date_parsers/csp_compliant_version.ts","../sources/core/common/date.js","../node_modules/remote-client/dist/remote.es6.js","../sources/core/remote/remote_events.js","../sources/utils/timeout.js","../sources/core/common/state.js","../sources/utils/promise.js","../sources/core/facades/datastore_tasks.js","../sources/core/datastore/power_array.js","../sources/utils/placeholder_task.js","../sources/core/datastore/datastore.js","../sources/core/datastore/treedatastore.js","../sources/utils/is_headless.js","../sources/core/datastore/datastore_render.js","../sources/core/facades/datastore.js","../sources/core/datastore/select.js","../sources/core/facades/datastore_links.js","../sources/core/ui/timeline/scales.js","../sources/core/gantt_data_range.js","../sources/utils/task_tree_helpers.js","../sources/core/dataprocessor/data_processor_events.ts","../sources/core/dataprocessor/simple_storage.ts","../sources/core/dataprocessor/data_processor.ts","../sources/core/dataprocessor/extend_gantt.ts","../sources/core/dataprocessor/index.js","../sources/core/plugins/batch_update.js","../sources/core/plugins/wbs.js","../sources/core/plugins/resources.js","../sources/core/plugins/resource_assignments.js","../sources/core/plugins/new_task_placeholder.js","../sources/core/plugins/auto_task_types.js","../sources/core/common/duration_formatter_numeric.ts","../sources/core/common/link_formatter_simple.ts","../sources/core/plugins/formatters.js","../sources/core/plugins/empty_state_screen.ts","../sources/core/ui/render/baseline_helper.js","../sources/core/plugins/baselines.js","../sources/core/loading/parsing.js","../sources/core/worktime/calendar_arguments_helper.js","../sources/core/worktime/strategy/work_calendar_merger.js","../sources/core/worktime/strategy/work_unit_cache/workunit_map_cache.ts","../sources/core/worktime/strategy/work_unit_cache/workunit_object_cache.ts","../sources/core/worktime/strategy/work_unit_cache/larger_units_helper.ts","../sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts","../sources/core/worktime/strategy/calendar_strategy.js","../sources/core/worktime/strategy/work_unit_cache/index.ts","../sources/core/worktime/legacy_resource_config.js","../sources/core/worktime/calendar_manager.js","../sources/core/worktime/dynamic_resource_calendars.js","../sources/core/worktime/strategy/no_work_time.js","../sources/core/worktime/time_calculator.js","../sources/core/facades/worktime_calendars.js","../sources/core/data.js","../sources/core/ui/resize_listener.js","../sources/core/gantt_core.js","../sources/core/common/assert.js","../sources/locale/locale_ar.ts","../sources/locale/locale_be.ts","../sources/locale/locale_ca.ts","../sources/locale/locale_cn.ts","../sources/locale/locale_cs.ts","../sources/locale/locale_da.ts","../sources/locale/locale_de.ts","../sources/locale/locale_el.ts","../sources/locale/locale_en.ts","../sources/locale/locale_es.ts","../sources/locale/locale_fa.ts","../sources/locale/locale_fi.ts","../sources/locale/locale_fr.ts","../sources/locale/locale_he.ts","../sources/locale/locale_hr.ts","../sources/locale/locale_hu.ts","../sources/locale/locale_id.ts","../sources/locale/locale_it.ts","../sources/locale/locale_jp.ts","../sources/locale/locale_kr.ts","../sources/locale/locale_manager.ts","../sources/locale/locale_nb.ts","../sources/locale/locale_nl.ts","../sources/locale/locale_no.ts","../sources/locale/locale_pl.ts","../sources/locale/locale_pt.ts","../sources/locale/locale_ro.ts","../sources/locale/locale_ru.ts","../sources/locale/locale_si.ts","../sources/locale/locale_sk.ts","../sources/locale/locale_sv.ts","../sources/locale/locale_tr.ts","../sources/locale/locale_ua.ts","../sources/factory/make_instance_common.js","../sources/core/common/services.js","../sources/core/common/dnd.js","../sources/core/common/templates.js","../sources/core/datastore/datastore_hooks.js","../sources/core/plugins/index.js","../sources/core/grid_column_api.gpl.js","../sources/core/tasks.js","../sources/core/worktime/work_time.js","../sources/core/data_task_types.gpl.js","../sources/core/cached_functions.js","../sources/core/destructor.js","../sources/locale/index.ts","../sources/core/ui/message.js","../sources/core/ui/configurable.js","../sources/core/ui/ui_factory.js","../sources/core/ui/mouse.js","../sources/core/ui/render/viewport/is_in_viewport.js","../sources/core/ui/render/is_legacy_smart_render.js","../sources/core/ui/render/viewport/get_grid_row_rectangle.js","../sources/core/ui/render/viewport/get_visible_bars_range.js","../sources/core/ui/render/render_factory.js","../sources/core/ui/render/layer_engine.js","../sources/core/ui/render/viewport/get_bar_rectangle.js","../sources/core/ui/render/viewport/factory/get_visible_link_range.js","../sources/core/ui/render/viewport/get_link_rectangle.js","../sources/core/ui/render/viewport/is_link_in_viewport.js","../sources/core/ui/gantt_layers.js","../sources/core/ui/layout/cell.js","../sources/utils/extends.js","../sources/core/ui/layout/layout.js","../sources/core/ui/layout/view_layout.js","../sources/core/ui/layout/view_cell.js","../sources/core/ui/layout/scrollbar_cell.js","../sources/core/ui/row_position_mixin.js","../sources/core/ui/row_position_fixed_height.js","../sources/core/ui/timeline/tasks_canvas_render.gpl.js","../sources/core/ui/timeline/timeline.js","../sources/core/ui/timeline/timeline_layers_gpl.js","../sources/core/ui/plugins/column_grid_dnd/scrollable_grid.ts","../sources/core/ui/plugins/column_grid_dnd/column_grid_dnd.ts","../sources/core/ui/mouse_event_container.js","../sources/core/ui/grid/grid.js","../sources/core/ui/grid/grid_resize.gpl.js","../sources/core/ui/grid/task_grid_row_resize.js","../sources/core/ui/grid/editors/keyboard_mappings/default.js","../sources/core/ui/grid/editors/keyboard_mappings/keyboard_navigation.js","../sources/core/ui/grid/editors/editors/base.js","../sources/core/ui/grid/editors/editors/text.js","../sources/core/ui/grid/editors/editors/number.js","../sources/core/ui/grid/editors/editors/select.js","../sources/core/ui/grid/editors/editors/date.js","../sources/core/ui/grid/editors/editors/predecessor.js","../sources/core/ui/grid/editors/editors/duration.js","../sources/core/ui/grid/editors/linked_properties.js","../sources/core/ui/grid/editors/controller.js","../sources/core/ui/grid/editors/keyboard_mappings.js","../sources/core/ui/render/viewport/is_bar_in_viewport.js","../sources/core/ui/render/task_bar_render.js","../sources/core/ui/render/task_bar_smart_render.js","../sources/core/ui/render/dummy_layer.js","../sources/core/ui/render/viewport/get_bg_row_rectangle.js","../sources/core/ui/render/viewport/get_visible_cells_range.js","../sources/core/ui/render/viewport/is_column_visible.js","../sources/core/ui/render/prerender/task_bg_placeholder.js","../sources/core/ui/render/link_render.js","../sources/core/ui/render/viewport/is_grid_row_in_viewport.js","../sources/core/resource_timetable_builder.js","../sources/core/ui/grid/tasks_grid_dnd.js","../sources/core/ui/grid/tasks_grid_dnd_marker_helpers/drop_target.js","../sources/core/ui/grid/tasks_grid_dnd_marker_helpers/locked_level.js","../sources/core/ui/grid/tasks_grid_dnd_marker_helpers/highlight.js","../sources/core/ui/grid/tasks_grid_dnd_marker.js","../sources/core/ui/grid/tasks_grid_dnd_marker_helpers/multi_level.js","../sources/core/ui/grid/main_grid_initializer.js","../sources/core/ui/timeline/tasks_dnd.js","../sources/core/ui/timeline/links_dnd.js","../sources/core/ui/timeline/main_timeline_initializer.js","../sources/core/ui/main_layout_initializer.js","../sources/core/ui/index.js","../sources/core/ui/layout/resizer_cell.gpl.js","../sources/core/ui/render/task_grid_line_render.js","../sources/core/ui/render/task_bg_render.js","../sources/core/ui/render/task_rollup_render.js","../sources/core/ui/render/resource_matrix_render.js","../sources/core/ui/render/task_grid_row_resize_render.js","../sources/core/ui/skin.js","../sources/core/ui/plugins/autoscroll.js","../sources/core/ui/plugins/jquery_hooks.js","../sources/core/ui/plugins/dhtmlx_hooks.js","../sources/core/ui/plugins/timeline_zoom.ts","../sources/core/ui/touch.js","../sources/core/ui/lightbox/controls/base_control.js","../sources/core/ui/utils/html_helpers.js","../sources/core/ui/lightbox/controls/select_control.js","../sources/core/ui/lightbox/controls/parent_control.js","../sources/core/ui/lightbox/index.js","../sources/core/ui/lightbox/controls/template_control.js","../sources/core/ui/lightbox/controls/textarea_control.js","../sources/core/ui/lightbox/controls/time_control.js","../sources/core/ui/lightbox/controls/checkbox_control.js","../sources/core/ui/lightbox/controls/radio_control.js","../sources/core/ui/lightbox/controls/duration_control.js","../sources/core/ui/lightbox/controls/constraint_control.js","../sources/core/ui/lightbox/controls/typeselect_control.js","../sources/core/ui/lightbox/controls/baseline_control.js","../sources/core/ui_core.js","../sources/core/data_task_layers.gpl.js","../sources/core/facades/layout.js","../sources/css/skins/skyblue.js","../sources/css/skins/dark.js","../sources/css/skins/meadow.js","../sources/css/skins/terrace.js","../sources/css/skins/broadway.js","../sources/css/skins/material.js","../sources/css/skins/contrast_black.js","../sources/css/skins/contrast_white.js","../sources/core/ui/plugins/index.js","../sources/core/ui/lightbox/lightbox_optional_time.js","../sources/core/ui/wai_aria.js","../sources/dhtmlxgantt.gpl.ts","../sources/factory/make_instance_web.js","../sources/core/loading/ajax_loading.js"],"sourcesContent":["//returns position of html element on the page\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\treturn (display != \"none\" && visibility != \"hidden\");\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\t// use tabindex to sort focusable nodes\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\nfunction getScrollSize(){\r\n\tvar div = document.createElement(\"div\");\r\n\tdiv.style.cssText=\"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\tdocument.body.appendChild(div);\r\n\tvar width = div.offsetWidth-div.clientWidth;\r\n\tdocument.body.removeChild(div);\r\n\r\n\treturn Math.max(width, 15);\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = \"\";\r\n\r\n\treturn _trimString(className);\r\n}\r\n\r\nfunction addClassName(node, className){\r\n\tif (className && node.className.indexOf(className) === -1) {\r\n\t\tnode.className += \" \" + className;\r\n\t}\r\n}\r\n\r\nfunction removeClassName(node, name) {\r\n\tname = name.split(\" \");\r\n\tfor (var i = 0; i < name.length; i++) {\r\n\t\tvar regEx = new RegExp(\"\\\\s?\\\\b\" + name[i] + \"\\\\b(?![-_.])\", \"\");\r\n\t\tnode.className = node.className.replace(regEx, \"\");\r\n\t}\r\n}\r\n\r\nfunction hasClass(element, className){\r\n\tif ('classList' in element) {\r\n\t\treturn element.classList.contains(className);\r\n\t} else { \r\n\t\treturn new RegExp(\"\\\\b\" + className + \"\\\\b\").test(element.className);\r\n\t}\r\n}\r\n\r\nfunction toNode(node) {\r\n\tif (typeof node === \"string\") {\r\n\t\treturn (document.getElementById(node) || document.querySelector(node) || document.body);\r\n\t}\r\n\treturn node || document.body;\r\n}\r\n\r\nvar _slave;\r\nfunction insertNode(node, newone) {\r\n\tif(!_slave){\r\n\t\t_slave = document.createElement(\"div\");\r\n\t}\r\n\t_slave.innerHTML = newone;\r\n\tvar child = _slave.firstChild;\r\n\tnode.appendChild(child);\r\n\treturn child;\r\n}\r\n\r\nfunction removeNode(node) {\r\n\tif (node && node.parentNode) {\r\n\t\tnode.parentNode.removeChild(node);\r\n\t}\r\n}\r\n\r\nfunction getChildNodes(node, css) {\r\n\tvar ch = node.childNodes;\r\n\tvar len = ch.length;\r\n\tvar out = [];\r\n\tfor (var i = 0; i < len; i++) {\r\n\t\tvar obj = ch[i];\r\n\t\tif (obj.className && obj.className.indexOf(css) !== -1) {\r\n\t\t\tout.push(obj);\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateAttribute(e, attribute) {\r\n\tif(!attribute) return;\r\n\r\n\tvar trg = getTargetNode(e);\r\n\r\n\twhile (trg){\r\n\t\tif (trg.getAttribute){\t//text nodes has not getAttribute\r\n\t\t\tvar test = trg.getAttribute(attribute);\r\n\t\t\tif (test) return trg;\r\n\t\t}\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction _trimString(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n}\r\n\r\nfunction locateClassName(e, classname, strict){\r\n\tvar trg = getTargetNode(e);\r\n\tvar css = \"\";\r\n\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!_trimString(css.charAt(ind - 1)));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!_trimString(css.charAt(ind + classname.length)));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = getNodePosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX + d.scrollLeft - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY + d.scrollTop - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getRelativeNodePosition(child, parent){\r\n\tconst childPos = getNodePosition(child);\r\n\tconst parentPos = getNodePosition(parent);\r\n\treturn {\r\n\t\tx: childPos.x - parentPos.x,\r\n\t\ty: childPos.y - parentPos.y\r\n\t};\r\n}\r\n\r\nfunction isChildOf(child, parent){\r\n\tif(!child || !parent){\r\n\t\treturn false;\r\n\t}\r\n\r\n\twhile(child && child != parent) {\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn child === parent;\r\n}\r\n\r\nfunction closest(element, selector){\r\n\tif(element.closest){\r\n\t\treturn element.closest(selector);\r\n\t}else if(element.matches || element.msMatchesSelector || element.webkitMatchesSelector){\r\n\t\tvar el = element;\r\n\t\tif (!document.documentElement.contains(el)) return null;\r\n\t\tdo {\r\n\t\t\tvar method = el.matches || el.msMatchesSelector || el.webkitMatchesSelector;\r\n\r\n\t\t\tif (method.call(el, selector)) return el;\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1); \r\n\t\treturn null;\r\n\t}else{\r\n\t\t// eslint-disable-next-line no-console\r\n\t\tconsole.error(\"Your browser is not supported\");\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nfunction getClosestSizedElement(element) {\r\n\twhile (element) {\r\n\t\tif (element.offsetWidth > 0 && element.offsetHeight > 0) {\r\n\t\t\treturn element;\r\n\t\t}\r\n\t\telement = element.parentElement;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport {\r\n\tgetNodePosition,\r\n\tgetFocusableNodes,\r\n\tgetScrollSize,\r\n\tgetClassName,\r\n\taddClassName,\r\n\tremoveClassName,\r\n\tinsertNode,\r\n\tremoveNode,\r\n\tgetChildNodes,\r\n\ttoNode,\r\n\tlocateClassName,\r\n\tlocateAttribute,\r\n\tgetTargetNode,\r\n\tgetRelativeEventPosition,\r\n\tisChildOf,\r\n\thasClass,\r\n\tclosest,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeNodePosition,\r\n\tgetClosestSizedElement\r\n};","\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","import * as domHelpers from \"../../core/ui/utils/dom_helpers\";\r\nimport global from \"../../utils/global\";\r\nimport { SelectedRegion } from \"./selectedRegion\";\r\n\r\nexport class EventsManager {\r\n\tprivate _mouseDown: boolean = false;\r\n\tprivate _domEvents: any;\r\n\tprivate _originPosition: string;\r\n\tprivate _gantt: any;\r\n\tprivate _restoreOriginPosition: () => void;\r\n\tconstructor(gantt: any) {\r\n\t\tthis._gantt = gantt;\r\n\t\tthis._domEvents = gantt._createDomEventScope();\r\n\t}\r\n\r\n\tattach(selectedRegion: SelectedRegion, useKey?: \"shiftKey\" | \"ctrlKey\" | \"altKey\", ignore?: any): void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst _target = selectedRegion.getViewPort();\r\n\t\tthis._originPosition = global.getComputedStyle(_target).display;\r\n\t\tthis._restoreOriginPosition = () => {\r\n\t\t\t_target.style.position = this._originPosition;\r\n\t\t};\r\n\t\tif (this._originPosition === \"static\") {\r\n\t\t\t_target.style.position = \"relative\";\r\n\t\t}\r\n\t\tconst state = gantt.$services.getService(\"state\");\r\n\t\tstate.registerProvider(\"clickDrag\", () => {\r\n\t\t\tconst result = { autoscroll: false };\r\n\t\t\treturn result;\r\n\t\t});\r\n\r\n\r\n\t\tlet scheduledDndCoordinates = null;\r\n\t\tconst startDragAndDrop = () => {\r\n\t\t\tif (!scheduledDndCoordinates) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis._mouseDown = true;\r\n\t\t\tselectedRegion.setStart(gantt.copy(scheduledDndCoordinates));\r\n\t\t\tselectedRegion.setPosition(gantt.copy(scheduledDndCoordinates));\r\n\t\t\tselectedRegion.setEnd(gantt.copy(scheduledDndCoordinates));\r\n\t\t\tscheduledDndCoordinates = null;\r\n\t\t};\r\n\r\n\t\tthis._domEvents.attach(_target, \"mousedown\", (event) => {\r\n\t\t\tscheduledDndCoordinates = null;\r\n\t\t\tlet filterTargets = \".gantt_task_line, .gantt_task_link\";\r\n\t\t\tif (ignore !== undefined) {\r\n\t\t\t\tif (ignore instanceof Array) {\r\n\t\t\t\t\tfilterTargets = ignore.join(\", \");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfilterTargets = ignore;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (filterTargets) {\r\n\t\t\t\tif (gantt.utils.dom.closest(event.target, filterTargets)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tstate.registerProvider(\"clickDrag\", () => {\r\n\t\t\t\tconst result = { autoscroll: this._mouseDown };\r\n\t\t\t\treturn result;\r\n\t\t\t});\r\n\r\n\t\t\tif (useKey && event[useKey] !== true) { return; }\r\n\t\t\tscheduledDndCoordinates = this._getCoordinates(event, selectedRegion);\r\n\t\t});\r\n\t\tconst eventElement = domHelpers.getRootNode(gantt.$root) || document.body;\r\n\t\tthis._domEvents.attach(eventElement, \"mouseup\", (event) => {\r\n\t\t\tscheduledDndCoordinates = null;\r\n\t\t\tif (useKey && event[useKey] !== true) { return; }\r\n\t\t\tif (this._mouseDown === true) {\r\n\t\t\t\tthis._mouseDown = false;\r\n\t\t\t\tconst coordinates = this._getCoordinates(event, selectedRegion);\r\n\t\t\t\tselectedRegion.dragEnd(coordinates);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis._domEvents.attach(_target, \"mousemove\", (event) => {\r\n\t\t\tif (useKey && event[useKey] !== true) { return; }\r\n\t\t\t// GS-854. If we don't have useKey for the click_drag extension,\r\n\t\t\t// check the drag_timeline to not simultaneously use both extensions\r\n\t\t\tconst dragTimeline = this._gantt.ext.clickDrag;\r\n\t\t\tconst dragTimelineUseKey = (this._gantt.config.drag_timeline || {}).useKey;\r\n\t\t\tif (dragTimeline && dragTimelineUseKey) {\r\n\t\t\t\tif (!useKey && event[dragTimelineUseKey]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet coordinates = null;\r\n\t\t\tif(!this._mouseDown && scheduledDndCoordinates){\r\n\t\t\t\tcoordinates = this._getCoordinates(event, selectedRegion);\r\n\t\t\t\tif(Math.abs(scheduledDndCoordinates.relative.left - coordinates.relative.left) > 5){\r\n\t\t\t\t\t// add small threshold not to start dnd on simple click\r\n\t\t\t\t\tstartDragAndDrop();\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (this._mouseDown === true) {\r\n\t\t\t\tcoordinates = this._getCoordinates(event, selectedRegion);\r\n\t\t\t\tselectedRegion.setEnd(coordinates);\r\n\t\t\t\tselectedRegion.render();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdetach(): void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._domEvents.detachAll();\r\n\t\tif(this._restoreOriginPosition){\r\n\t\t\tthis._restoreOriginPosition();\r\n\t\t}\r\n\r\n\t\tconst state = gantt.$services.getService(\"state\");\r\n\t\tstate.unregisterProvider(\"clickDrag\");\r\n\t}\r\n\r\n\tdestructor(): void {\r\n\t\tthis.detach();\r\n\t}\r\n\r\n\tprivate _getCoordinates(event: MouseEvent, selectedRegion: SelectedRegion) {\r\n\t\tconst viewPort = selectedRegion.getViewPort();\r\n\t\tconst viewPortBounds = viewPort.getBoundingClientRect();\r\n\t\tconst { clientX, clientY } = event;\r\n\t\tconst result = {\r\n\t\t\tabsolute: {\r\n\t\t\t\tleft: clientX,\r\n\t\t\t\ttop: clientY\r\n\t\t\t},\r\n\t\t\trelative: {\r\n\t\t\t\tleft: clientX - viewPortBounds.left + viewPort.scrollLeft,\r\n\t\t\t\ttop: clientY - viewPortBounds.top + viewPort.scrollTop\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn result;\r\n\t}\r\n}","var EventHost = function(){\r\n\tthis._silent_mode = false;\r\n\tthis.listeners = {};\r\n};\r\n\r\nEventHost.prototype = {\r\n\t_silentStart: function() {\r\n\t\tthis._silent_mode = true;\r\n\t},\r\n\t_silentEnd: function() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n};\r\n\r\nvar\tcreateEventStorage = function(obj) {\r\n\tvar handlers = {};\r\n\tvar index = 0;\r\n\tvar eventStorage = function(){\r\n\t\tvar combinedResult = true;\r\n\t\tfor(var i in handlers){\r\n\t\t\tvar handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tvar handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tvar originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tvar eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tvar innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tvar handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tvar handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tvar listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tvar listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tvar listeners = eventHost.listeners;\r\n\t\t\tfor(var i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tvar list = id.split(':');//get EventName and ID\r\n\t\t\tvar listeners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tvar eventName = list[0];\r\n\t\t\t\tvar eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (var name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","var units = {\r\n\t\"second\": 1,\r\n\t\"minute\": 60,\r\n\t\"hour\": 60 * 60,\r\n\t\"day\": 60 * 60 * 24,\r\n\t\"week\": 60 * 60 * 24 * 7,\r\n\t\"month\": 60 * 60 * 24 * 30,\r\n\t\"quarter\": 60 * 60 * 24 * 30 * 3,\r\n\t\"year\": 60 * 60 * 24 * 365\r\n};\r\nfunction getSecondsInUnit(unit){\r\n\treturn units[unit] || units.hour;\r\n}\r\n\r\nfunction forEach(arr, callback) {\r\n\tif (arr.forEach) {\r\n\t\tarr.forEach(callback);\r\n\t} else {\r\n\t\tvar workArray = arr.slice();\r\n\t\tfor (var i = 0; i < workArray.length; i++) {\r\n\t\t\tcallback(workArray[i], i);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction arrayMap(arr, callback) {\r\n\tif (arr.map) {\r\n\t\treturn arr.map(callback);\r\n\t} else {\r\n\t\tvar workArray = arr.slice();\r\n\t\tvar resArray = [];\r\n\r\n\t\tfor (var i = 0; i < workArray.length; i++) {\r\n\t\t\tresArray.push(callback(workArray[i], i));\r\n\t\t}\r\n\t\treturn resArray;\r\n\t}\r\n}\r\n\r\n\r\nfunction arrayFind(arr, callback) {\r\n\tif (arr.find) {\r\n\t\treturn arr.find(callback);\r\n\t} else {\r\n\t\tfor (var i = 0; i < arr.length; i++) {\r\n\t\t\tif (callback(arr[i], i)) {\r\n\t\t\t\treturn arr[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction arrayIncludes(arr, item) {\r\n\tif(arr.includes){\r\n\t\treturn arr.includes(item);\r\n\t}else{\r\n\t\tfor (var i = 0; i < arr.length; i++) {\r\n\t\t\tif (arr[i] === item) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\"\r\n\t\t&& Function.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\"\r\n\t\t&& Function.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\"\r\n\t\t&& Function.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction isValidDate(obj){\r\n\treturn isDate(obj) && !isNaN(obj.getTime());\r\n}\r\n\r\nfunction arrayFilter(arr, callback) {\r\n\tvar result = [];\r\n\r\n\tif (arr.filter) {\r\n\t\treturn arr.filter(callback);\r\n\t} else {\r\n\t\tfor (var i = 0; i < arr.length; i++) {\r\n\t\t\tif (callback(arr[i], i)) {\r\n\t\t\t\tresult[result.length] = arr[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n}\r\n\r\nfunction hashToArray(hash) {\r\n\tvar result = [];\r\n\r\n\tfor (var key in hash) {\r\n\t\tif (hash.hasOwnProperty(key)) {\r\n\t\t\tresult.push(hash[key]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction arraySome(arr, callback) {\r\n\tif (arr.length === 0) return false;\r\n\r\n\tfor (var i = 0; i < arr.length; i++) {\r\n\t\tif (callback(arr[i], i, arr)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction arrayDifference(arr, callback) {\r\n\treturn arrayFilter(arr, function(item, i) {\r\n\t\treturn !callback(item, i);\r\n\t});\r\n}\r\n\r\nfunction throttle (callback, timeout) {\r\n\tvar wait = false;\r\n\r\n\treturn function () {\r\n\t\tif (!wait) {\r\n\t\t\tcallback.apply(null, arguments);\r\n\t\t\twait = true;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\twait = false;\r\n\t\t\t}, timeout);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction sortArrayOfHash(arr, field, desc) {\r\n\tvar compare = function(a, b) {\r\n\t\treturn a < b;\r\n\t};\r\n\r\n\tarr.sort(function(a, b) {\r\n\t\tif (a[field] === b[field]) return 0;\r\n\r\n\t\treturn desc ? compare(a[field], b[field]) : compare(b[field], a[field]);\r\n\t});\r\n}\r\n\r\nfunction objectKeys(obj) {\r\n\tif (Object.keys) {\r\n\t\treturn Object.keys(obj);\r\n\t}\r\n\tvar result = [];\r\n\tvar key;\r\n\tfor (key in obj) {\r\n\t\tif (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n\t\t\tresult.push(key);\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nfunction isEventable(obj) {\r\n\treturn obj.attachEvent && obj.detachEvent;\r\n}\r\n\r\n//GS-1090: A task should be able to have the id = 0\r\nfunction replaceValidZeroId(id, rootId) {\r\n\tif (checkZeroId(id) && !checkZeroId(rootId)){\r\n\t\tid = \"0\";\r\n\t}\r\n\treturn id;\r\n}\r\n\r\nfunction checkZeroId(id) {\r\n\tif (id === 0){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction findBinary(array, target) {\r\n\t// modified binary search, target value not exactly match array elements, looking for closest one\r\n\r\n\tvar low = 0, high = array.length - 1, i, item, prev;\r\n\twhile (low <= high) {\r\n\r\n\t\ti = Math.floor((low + high) / 2);\r\n\t\titem = +array[i];\r\n\t\tprev = +array[i - 1];\r\n\t\tif (item < target) {\r\n\t\t\tlow = i + 1;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (item > target) {\r\n\t\t\tif (!(!isNaN(prev) && prev < target)) {\r\n\t\t\t\thigh = i - 1;\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\t// if target is between 'i' and 'i-1' return 'i - 1'\r\n\t\t\t\treturn i - 1;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\twhile (+array[i] == +array[i + 1]) i++;\r\n\r\n\t\treturn i;\r\n\t}\r\n\treturn array.length - 1;\r\n}\r\n\r\nexport {\r\n\tgetSecondsInUnit,\r\n\tforEach,\r\n\tarrayMap,\r\n\tarrayIncludes,\r\n\tarrayFind,\r\n\tarrayFilter,\r\n\tarrayDifference,\r\n\tarraySome,\r\n\thashToArray,\r\n\tsortArrayOfHash,\r\n\tthrottle,\r\n\tisArray,\r\n\tisDate,\r\n\tisValidDate,\r\n\tisStringObject,\r\n\tisNumberObject,\r\n\tisBooleanObject,\r\n\tdelay,\r\n\tobjectKeys,\r\n\tisEventable,\r\n\treplaceValidZeroId,\r\n\tcheckZeroId,\r\n\tfindBinary\r\n};","import eventable from \"../../utils/eventable\";\r\nimport { isEventable } from \"../../utils/helpers\";\r\n\r\nexport interface ISelectedRegionConfig {\r\n\tclassName?: string;\r\n\trender?: (startPoint: IPoint, endPoint: IPoint) => HTMLElement;\r\n\tviewPort?: HTMLElement;\r\n\tuseRequestAnimationFrame: boolean;\r\n\tcallback?: (startPoint: IPoint, endPoint: IPoint, startDate: Date, endDate: Date, tasksByDate: any[], tasksByIndex: any[]) => void;\r\n\tsingleRow: boolean;\r\n}\r\n\r\ninterface ICoordinates {\r\n\tleft: number;\r\n\ttop: number;\r\n}\r\n\r\nexport interface IPoint {\r\n\tabsolute: ICoordinates;\r\n\trelative: ICoordinates;\r\n}\r\n\r\nexport class SelectedRegion {\r\n\trender: () => void;\r\n\tprivate _viewPort: HTMLElement & eventable;\r\n\tprivate _el: HTMLElement = document.createElement(\"div\");\r\n\tprivate _callback: (startPoint: IPoint, endPoint: IPoint, startDate: Date, endDate: Date, tasksByDate: any[], tasksByIndex: any[]) => void;\r\n\tprivate _startPoint: IPoint;\r\n\tprivate _endPoint: IPoint;\r\n\tprivate _positionPoint: IPoint;\r\n\tprivate _useRequestAnimationFrame: boolean;\r\n\tprivate _startDate: Date;\r\n\tprivate _endDate: Date;\r\n\tprivate _singleRow: boolean;\r\n\tprivate _gantt: any;\r\n\tprivate _view: any;\r\n\r\n\tconstructor(config: ISelectedRegionConfig, gantt: any, view: any) {\r\n\t\tthis._gantt = gantt;\r\n\t\tthis._view = view;\r\n\t\tthis._viewPort = config.viewPort;\r\n\t\tthis._el.classList.add(config.className);\r\n\t\tif (typeof config.callback === \"function\") {\r\n\t\t\tthis._callback = config.callback;\r\n\t\t}\r\n\r\n\t\tthis.render = () => {\r\n\t\t\tlet node;\r\n\t\t\tif(config.render){\r\n\t\t\t\tnode = config.render(this._startPoint, this._endPoint);\r\n\t\t\t}else{\r\n\t\t\t\tnode = this.defaultRender(this._startPoint, this._endPoint);\r\n\t\t\t}\r\n\r\n\t\t\tif(node !== this._el){\r\n\t\t\t\tif(this._el && this._el.parentNode){\r\n\t\t\t\t\tthis._el.parentNode.removeChild(this._el);\r\n\t\t\t\t}\r\n\t\t\t\tthis._el = node;\r\n\t\t\t}\r\n\r\n\t\t\tif (config.className !== \"\") {\r\n\t\t\t\tthis._el.classList.add(config.className);\r\n\t\t\t}\r\n\t\t\tthis.draw();\r\n\t\t};\r\n\r\n\t\tif (!isEventable(this._viewPort)) {\r\n\t\t\teventable(this._viewPort);\r\n\t\t}\r\n\t\tthis._singleRow = config.singleRow;\r\n\t\tthis._useRequestAnimationFrame = config.useRequestAnimationFrame;\r\n\t}\r\n\r\n\tdefaultRender = (start: IPoint, end: IPoint) => {\r\n\t\tif(!this._el){\r\n\t\t\tthis._el = document.createElement(\"div\");\r\n\t\t}\r\n\t\tconst node = this._el;\r\n\t\t// const gantt = this._gantt;\r\n\r\n\t\tconst top = Math.min(start.relative.top, end.relative.top);\r\n\t\tconst bottom = Math.max(start.relative.top, end.relative.top);\r\n\t\tconst left = Math.min(start.relative.left, end.relative.left);\r\n\t\tconst right = Math.max(start.relative.left, end.relative.left);\r\n\r\n\t\tif (this._singleRow) {\r\n\t\t\tconst pos = this._getTaskPositionByTop(this._startPoint.relative.top);\r\n\t\t\tnode.style.height = pos.height + \"px\";\r\n\t\t\tnode.style.top = pos.top + \"px\";\r\n\t\t} else {\r\n\t\t\tnode.style.height = Math.abs(bottom - top) + \"px\";\r\n\t\t\tnode.style.top = top + \"px\";\r\n\t\t}\r\n\t\tnode.style.width = Math.abs(right - left) + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\t\treturn node;\r\n\t};\r\n\r\n\tdraw() {\r\n\t\tif (this._useRequestAnimationFrame) {\r\n\t\t\treturn requestAnimationFrame(() => {\r\n\t\t\t\tthis._viewPort.appendChild(this.getElement());\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis._viewPort.appendChild(this.getElement());\r\n\t\t}\r\n\t}\r\n\r\n\tclear() {\r\n\t\tif (this._useRequestAnimationFrame) {\r\n\t\t\treturn requestAnimationFrame(() => {\r\n\t\t\t\tif (!this._el.parentNode) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis._viewPort.removeChild(this._el);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tif (!this._el.parentNode) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis._viewPort.removeChild(this._el);\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement() {\r\n\t\treturn this._el;\r\n\t}\r\n\r\n\tgetViewPort() {\r\n\t\treturn this._viewPort;\r\n\t}\r\n\r\n\tsetStart(startPoint: IPoint) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._startPoint = startPoint;\r\n\t\tthis._startDate = gantt.dateFromPos(this._startPoint.relative.left);\r\n\t\tthis._viewPort.callEvent(\"onBeforeDrag\", [this._startPoint]);\r\n\t}\r\n\r\n\tsetEnd(endPoint: IPoint) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._endPoint = endPoint;\r\n\t\tif (this._singleRow) {\r\n\t\t\tconst pos = this._getTaskPositionByTop(this._startPoint.relative.top);\r\n\t\t\tthis._endPoint.relative.top = pos.top;\r\n\t\t}\r\n\t\tthis._endDate = gantt.dateFromPos(this._endPoint.relative.left);\r\n\t\tif (this._startPoint.relative.left > this._endPoint.relative.left) {\r\n\t\t\tthis._positionPoint = {\r\n\t\t\t\trelative: { left: this._endPoint.relative.left, top: this._positionPoint.relative.top },\r\n\t\t\t\tabsolute: { left: this._endPoint.absolute.left, top: this._positionPoint.absolute.top }\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (this._startPoint.relative.top > this._endPoint.relative.top) {\r\n\t\t\tthis._positionPoint = {\r\n\t\t\t\trelative: { left: this._positionPoint.relative.left, top: this._endPoint.relative.top },\r\n\t\t\t\tabsolute: { left: this._positionPoint.absolute.left, top: this._endPoint.absolute.top }\r\n\t\t\t};\r\n\t\t}\r\n\r\n\r\n\t\tthis._viewPort.callEvent(\"onDrag\", [this._startPoint, this._endPoint]);\r\n\t}\r\n\r\n\tsetPosition(positionPoint: IPoint) {\r\n\t\tthis._positionPoint = positionPoint;\r\n\t}\r\n\r\n\tdragEnd(endPoint: IPoint) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tif(endPoint.relative.left < 0){\r\n\t\t\tendPoint.relative.left = 0;\r\n\t\t}\r\n\t\tthis._viewPort.callEvent(\"onBeforeDragEnd\", [this._startPoint, endPoint]);\r\n\t\tthis.setEnd(endPoint);\r\n\t\t// GS-1422. The endDate can be null if we drag the mouse outside the Gantt container\r\n\t\tthis._endDate = this._endDate || gantt.getState().max_date;\r\n\r\n\t\tif (this._startDate.valueOf() > this._endDate.valueOf()) {\r\n\t\t\t[ this._startDate, this._endDate ] = [ this._endDate, this._startDate ];\r\n\t\t}\r\n\t\tthis.clear();\r\n\t\tconst tasksByTime = gantt.getTaskByTime(this._startDate, this._endDate);\r\n\t\tconst tasksByIndex = this._getTasksByTop(this._startPoint.relative.top, this._endPoint.relative.top);\r\n\r\n\t\tthis._viewPort.callEvent(\"onDragEnd\", [this._startPoint, this._endPoint]);\r\n\t\tif (this._callback) {\r\n\t\t\tthis._callback(this._startPoint, this._endPoint, this._startDate, this._endDate, tasksByTime, tasksByIndex);\r\n\t\t}\r\n\t}\r\n\r\n\tgetInBounds() {\r\n\t\treturn this._singleRow;\r\n\t}\r\n\r\n\tprivate _getTasksByTop(start: number, end:number) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tlet startValue = start;\r\n\t\tlet endValue = end;\r\n\t\tif (start > end) {\r\n\t\t\tstartValue = end;\r\n\t\t\tendValue = start;\r\n\t\t}\r\n\t\tconst startIndex = this._getTaskPositionByTop(startValue).index;\r\n\t\tconst endIndex = this._getTaskPositionByTop(endValue).index;\r\n\t\tconst result = [];\r\n\t\tfor (let i = startIndex; i <= endIndex; i++) {\r\n\t\t\tconst task = gantt.getTaskByIndex(i);\r\n\t\t\tif (task) {\r\n\t\t\t\tresult.push(gantt.getTaskByIndex(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate _getTaskPositionByTop(top: number){\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst view = this._view;\r\n\t\tconst index = view.getItemIndexByTopPosition(top);\r\n\t\tconst task = gantt.getTaskByIndex(index);\r\n\t\tif(task){\r\n\t\t\tconst height = view.getItemHeight(task.id);\r\n\t\t\tconst itemTop = view.getItemTop(task.id);\r\n\t\t\treturn {\r\n\t\t\t\ttop: itemTop || 0,\r\n\t\t\t\theight: height || 0,\r\n\t\t\t\tindex\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tconst dataHeight = view.getTotalHeight();\r\n\t\t\treturn {\r\n\t\t\t\ttop: top > dataHeight ? dataHeight : 0,\r\n\t\t\t\theight: gantt.config.row_height,\r\n\t\t\t\tindex: top > dataHeight ? gantt.getTaskCount() : 0\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n}","interface IPoint {\r\n\tx: number;\r\n\ty: number;\r\n}\r\n\r\nexport class EventsManager {\r\n\tstatic create(gantt: any) {\r\n\t\treturn new EventsManager(gantt);\r\n\t}\r\n\tprivate _mouseDown: boolean = false;\r\n\tprivate _startPoint: IPoint;\r\n\tprivate _scrollState: IPoint;\r\n\tprivate _originAutoscroll: boolean;\r\n\tprivate _domEvents: any;\r\n\tprivate _timeline: any;\r\n\tprivate _gantt: any;\r\n\tprivate _trace: IPoint[];\r\n\tprivate _originalReadonly: boolean;\r\n\r\n\tconstructor(gantt: any) {\r\n\t\tthis._gantt = gantt;\r\n\t\tthis._domEvents = gantt._createDomEventScope();\r\n\t\tthis._trace = [];\r\n\t}\r\n\r\n\tdestructor() {\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\r\n\tattach(timeline: any): void {\r\n\t\tthis._timeline = timeline;\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._domEvents.attach(timeline.$task, \"mousedown\", (event) => {\r\n\t\t\tif (!gantt.config.drag_timeline) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst { useKey,ignore, enabled } = gantt.config.drag_timeline;\r\n\t\t\tif(enabled === false) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet filterTargets = \".gantt_task_line, .gantt_task_link\";\r\n\t\t\tif(ignore !== undefined) {\r\n\t\t\t\tif(ignore instanceof Array){\r\n\t\t\t\t\tfilterTargets = ignore.join(\", \");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfilterTargets = ignore;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (filterTargets) {\r\n\t\t\t\tif (gantt.utils.dom.closest(event.target, filterTargets)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (useKey && event[useKey] !== true) { return; }\r\n\r\n\t\t\tthis._startDrag(event);\r\n\t\t});\r\n\r\n\t\tthis._domEvents.attach(document, \"keydown\", (event) => {\r\n\t\t\tif (!gantt.config.drag_timeline) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst { useKey } = gantt.config.drag_timeline;\r\n\t\t\tif (useKey && event[useKey] === true) {\r\n\t\t\t\tthis._applyDndReadyStyles();\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis._domEvents.attach(document, \"keyup\", (event) => {\r\n\t\t\tif (!gantt.config.drag_timeline) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst { useKey } = gantt.config.drag_timeline;\r\n\t\t\tif (useKey && event[useKey] === false) {\r\n\t\t\t\tthis._clearDndReadyStyles();\r\n\t\t\t\tthis._stopDrag(event);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._domEvents.attach(document, \"mouseup\", (event) => {\r\n\t\t\tthis._stopDrag(event);\r\n\t\t});\r\n\t\tthis._domEvents.attach(gantt.$root, \"mouseup\", (event) => {\r\n\t\t\tthis._stopDrag(event);\r\n\t\t});\r\n\t\tthis._domEvents.attach(document, \"mouseleave\", (event) => {\r\n\t\t\tthis._stopDrag(event);\r\n\t\t});\r\n\t\tthis._domEvents.attach(gantt.$root, \"mouseleave\", (event) => {\r\n\t\t\tthis._stopDrag(event);\r\n\t\t});\r\n\r\n\t\tthis._domEvents.attach(gantt.$root, \"mousemove\", (event) => {\r\n\t\t\tif (!gantt.config.drag_timeline) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst { useKey } = gantt.config.drag_timeline;\r\n\t\t\tif (useKey && event[useKey] !== true) { return; }\r\n\t\t\t// GS-854. If we don't have useKey for the drag_timeline extension,\r\n\t\t\t// check the click_drag to not simultaneously use both extensions\r\n\t\t\tconst clickDrag = this._gantt.ext.clickDrag;\r\n\t\t\tconst clickDragUseKey = (this._gantt.config.click_drag || {}).useKey;\r\n\t\t\tif (clickDrag && clickDragUseKey) {\r\n\t\t\t\tif (!useKey && event[clickDragUseKey]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this._mouseDown === true) {\r\n\t\t\t\tthis._trace.push({ x: event.clientX, y: event.clientY });\r\n\t\t\t\tconst scrollPosition: IPoint = this._countNewScrollPosition({ x: event.clientX, y: event.clientY });\r\n\t\t\t\tthis._setScrollPosition(timeline, scrollPosition);\r\n\t\t\t\tthis._scrollState = scrollPosition;\r\n\t\t\t\tthis._startPoint = { x: event.clientX, y: event.clientY };\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _calculateDirectionVector = () => {\r\n\t\tconst traceSteps = 10;\r\n\t\tif(this._trace.length >= traceSteps) {\r\n\t\t\tconst dots = this._trace.slice(this._trace.length - traceSteps);\r\n\r\n\t\t\tconst vectors = [];\r\n\t\t\tfor(let i = 1; i < dots.length; i++) {\r\n\t\t\t\tvectors.push({\r\n\t\t\t\t\tx: dots[i].x - dots[i - 1].x,\r\n\t\t\t\t\ty: dots[i].y - dots[i - 1].y\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tconst resultVector = {x:0, y:0};\r\n\r\n\t\t\tvectors.forEach((vector) => {\r\n\t\t\t\tresultVector.x += vector.x;\r\n\t\t\t\tresultVector.y += vector.y;\r\n\t\t\t});\r\n\r\n\t\t\tconst magnitude = Math.sqrt(resultVector.x*resultVector.x + resultVector.y*resultVector.y);\r\n\t\t\tconst angleDegrees = Math.atan2(Math.abs(resultVector.y), Math.abs(resultVector.x)) * 180 / Math.PI;\r\n\r\n\t\t\treturn {\r\n\t\t\t\tmagnitude,\r\n\t\t\t\tangleDegrees\r\n\t\t\t};\r\n\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tprivate _applyDndReadyStyles = (): void => {\r\n\t\tthis._timeline.$task.classList.add(\"gantt_timeline_move_available\");\r\n\t};\r\n\r\n\tprivate _clearDndReadyStyles = (): void => {\r\n\t\tthis._timeline.$task.classList.remove(\"gantt_timeline_move_available\");\r\n\t};\r\n\r\n\tprivate _getScrollPosition = (timeline: any): IPoint => {\r\n\t\tconst gantt = this._gantt;\r\n\t\treturn {\r\n\t\t\tx: gantt.$ui.getView(timeline.$config.scrollX).getScrollState().position,\r\n\t\t\ty: gantt.$ui.getView(timeline.$config.scrollY).getScrollState().position\r\n\t\t};\r\n\t};\r\n\tprivate _countNewScrollPosition = (coords: IPoint): IPoint => {\r\n\t\tconst vector = this._calculateDirectionVector();\r\n\t\tlet shiftX = this._startPoint.x - coords.x;\r\n\t\tlet shiftY = this._startPoint.y - coords.y;\r\n\t\tif(vector){\r\n\t\t\tif(vector.angleDegrees < 15){\r\n\t\t\t\tshiftY = 0;\r\n\t\t\t} else if(vector.angleDegrees > 75){\r\n\t\t\t\tshiftX = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst result = {\r\n\t\t\tx: this._scrollState.x + shiftX,\r\n\t\t\ty: this._scrollState.y + shiftY\r\n\t\t};\r\n\t\treturn result;\r\n\t};\r\n\tprivate _setScrollPosition = (timeline: any, coords: IPoint): void => {\r\n\t\tconst gantt = this._gantt;\r\n\t\trequestAnimationFrame(() => {\r\n\t\t\tgantt.scrollLayoutCell(timeline.$id, coords.x, coords.y);\r\n\t\t});\r\n\t};\r\n\tprivate _stopDrag = (event: Event): void => {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._trace = [];\r\n\t\tgantt.$root.classList.remove(\"gantt_noselect\");\r\n\r\n\t\tif(this._originalReadonly !== undefined){\r\n\t\t\tgantt.config.readonly = this._originalReadonly;\r\n\t\t\tif(this._mouseDown && gantt.config.drag_timeline && gantt.config.drag_timeline.render){\r\n\t\t\t\tgantt.render();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this._originAutoscroll !== undefined){\r\n\t\t\tgantt.config.autoscroll = this._originAutoscroll;\r\n\t\t}\r\n\r\n\t\tif(gantt.config.drag_timeline){\r\n\t\t\tconst { useKey } = gantt.config.drag_timeline;\r\n\t\t\tif (useKey && event[useKey] !== true) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._mouseDown = false;\r\n\t};\r\n\r\n\tprivate _startDrag = (event: any) : void => {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis._originAutoscroll = gantt.config.autoscroll;\r\n\t\tgantt.config.autoscroll = false;\r\n\r\n\t\tgantt.$root.classList.add(\"gantt_noselect\");\r\n\t\tthis._originalReadonly = gantt.config.readonly;\r\n\t\tgantt.config.readonly = true;\r\n\r\n\t\tif(gantt.config.drag_timeline && gantt.config.drag_timeline.render){\r\n\t\t\tgantt.render();\r\n\t\t}\r\n\r\n\t\tthis._trace = [];\r\n\t\tthis._mouseDown = true;\r\n\t\tconst { x, y } = this._getScrollPosition(this._timeline);\r\n\t\tthis._scrollState = { x, y };\r\n\t\tthis._startPoint = { x: event.clientX, y: event.clientY };\r\n\t\tthis._trace.push(this._startPoint);\r\n\t};\r\n}","export default function(gantt) {\r\n\r\n\t(function () {\r\n\t\tvar modalsStack = [];\r\n\r\n\t\tfunction isModal() {\r\n\t\t\treturn !!modalsStack.length;\r\n\t\t}\r\n\r\n\t\tfunction afterPopup(box) {\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (!isModal()){\r\n\t\t\t\t\tif(!gantt.$destroyed){\r\n\t\t\t\t\t\tgantt.focus();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tfunction startModal(box) {\r\n\t\t\tgantt.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tgantt.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t\t//gantt.$keyboardNavigation.dispatcher.disable();\r\n\t\t}\r\n\r\n\t\tfunction endModal() {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif (box) {\r\n\t\t\t\tgantt.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tafterPopup(box);\r\n\r\n\t\t}\r\n\r\n\r\n\t\tfunction isTopModal(box) {\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t\t}\r\n\r\n\t\tfunction trapFocus(event) {\r\n\t\t\tvar target = event.currentTarget;\r\n\t\t\tif (!isTopModal(target)) return;\r\n\r\n\t\t\tgantt.$keyboardNavigation.trapFocus(target, event);\r\n\t\t}\r\n\r\n\t\tfunction traceLightbox() {\r\n\t\t\tstartModal(gantt.getLightbox());\r\n\t\t}\r\n\r\n\t\tgantt.attachEvent(\"onLightbox\", traceLightbox);\r\n\t\tgantt.attachEvent(\"onAfterLightbox\", endModal);\r\n\t\tgantt.attachEvent(\"onLightboxChange\", function () {\r\n\t\t\tendModal();\r\n\t\t\ttraceLightbox();\r\n\t\t});\r\n\r\n\r\n\t\tgantt.attachEvent(\"onAfterQuickInfo\", function () {\r\n\t\t\tafterPopup();\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onMessagePopup\", function (box) {\r\n\t\t\tsaveFocus();\r\n\t\t\tstartModal(box);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tendModal();\r\n\t\t\trestoreFocus();\r\n\t\t});\r\n\r\n\t\tvar focusElement = null;\r\n\r\n\t\tfunction saveFocus() {\r\n\t\t\tfocusElement = gantt.utils.dom.getActiveElement();\r\n\t\t}\r\n\r\n\t\tfunction restoreFocus() {\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (focusElement) {\r\n\t\t\t\t\tfocusElement.focus();\r\n\t\t\t\t\tfocusElement = null;\r\n\t\t\t\t}\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tgantt.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n\t})();\r\n\r\n};","\r\ninterface IQuickInfoContainer{\r\n\tparent: HTMLElement;\r\n\txViewport: HTMLElement;\r\n\tyViewport: HTMLElement;\r\n}\r\n\r\nexport class QuickInfo {\r\n\tprivate _quickInfoTask: TaskID;\r\n\tprivate _quickInfoBoxId: number | string;\r\n\tprivate _quickInfoBox: HTMLElement;\r\n\tprivate _quickInfoReadonly: boolean | null;\r\n\tprivate _container: HTMLElement;\r\n\tprivate _gantt: any;\r\n\r\n\tconstructor(gantt: any) {\r\n\t\tthis._gantt = gantt;\r\n\t}\r\n\r\n\t// show at coordinates:\r\n\t// show(x: number, y: number)\r\n\t// show for a task:\r\n\t// show(id: TaskID)\r\n\tshow : {\r\n\t\t(x: number, y: number) : void;\r\n\t\t(id: TaskID) : void;\r\n\t} = (id: TaskID | number, y? : number) : void => {\r\n\t\tif (y === undefined) {\r\n\t\t\tthis._showForTask(id);\r\n\t\t} else {\r\n\t\t\tthis._showAtCoordinates(id as number, y);\r\n\t\t}\r\n\t};\r\n\r\n\thide = (forced?: boolean) : any => {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst qi = this._quickInfoBox;\r\n\t\tthis._quickInfoBoxId = 0;\r\n\t\tconst taskId = this._quickInfoTask;\r\n\t\tthis._quickInfoTask = null;\r\n\r\n\t\tif (qi && qi.parentNode){\r\n\r\n\t\t\tif (gantt.config.quick_info_detached) {\r\n\t\t\t\tgantt.callEvent(\"onAfterQuickInfo\", [taskId]);\r\n\t\t\t\treturn qi.parentNode.removeChild(qi);\r\n\t\t\t}\r\n\r\n\t\t\tqi.className += \" gantt_qi_hidden\";\r\n\t\t\tif (qi.style.right === \"auto\"){\r\n\t\t\t\tqi.style.left = \"-350px\";\r\n\t\t\t} else {\r\n\t\t\t\tqi.style.right = \"-350px\";\r\n\t\t\t}\r\n\r\n\t\t\tif (forced) {\r\n\t\t\t\tqi.style.left = qi.style.right = \"\";\r\n\t\t\t\tqi.parentNode.removeChild(qi);\r\n\t\t\t}\r\n\t\t\tgantt.callEvent(\"onAfterQuickInfo\", [taskId]);\r\n\t\t}\r\n\t};\r\n\r\n\tgetNode = (): HTMLElement => {\r\n\t\tif(this._quickInfoBox) {\r\n\t\t\treturn this._quickInfoBox;\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tsetContainer = (container: string|HTMLElement): void => {\r\n\t\tif(container){\r\n\t\t\tthis._container = typeof container === \"string\" ? document.getElementById(container) : container;\r\n\t\t}\r\n\t};\r\n\r\n\tsetContent = (content?: IQuickInfoContent) => {\r\n\t\tconst gantt = this._gantt;\r\n\r\n\t\tconst defaultContent = {\r\n\t\t\ttaskId: null,\r\n\t\t\theader: {\r\n\t\t\t\ttitle: \"\",\r\n\t\t\t\tdate: \"\"\r\n\t\t\t},\r\n\t\t\tcontent: \"\",\r\n\t\t\tbuttons: gantt.config.quickinfo_buttons\r\n\t\t};\r\n\r\n\t\tif(!content){\r\n\t\t\tcontent = defaultContent;\r\n\t\t}\r\n\r\n\t\tif(!content.taskId){\r\n\t\t\tcontent.taskId = defaultContent.taskId;\r\n\t\t}\r\n\r\n\t\tif(!content.header){\r\n\t\t\tcontent.header = defaultContent.header;\r\n\t\t}\r\n\r\n\t\tif(!content.header.title){\r\n\t\t\tcontent.header.title = defaultContent.header.title;\r\n\t\t}\r\n\t\tif(!content.header.date){\r\n\t\t\tcontent.header.date = defaultContent.header.date;\r\n\t\t}\r\n\t\tif(!content.content){\r\n\t\t\tcontent.content = defaultContent.content;\r\n\t\t}\r\n\t\tif(!content.buttons){\r\n\t\t\tcontent.buttons = defaultContent.buttons;\r\n\t\t}\r\n\r\n\r\n\t\tlet qi = this.getNode();\r\n\t\tif(!qi){\r\n\t\t\tqi = this._createQuickInfoElement();\r\n\t\t}\r\n\r\n\t\tif(content.taskId){\r\n\t\t\tthis._quickInfoBoxId = content.taskId;\r\n\t\t}\r\n\r\n\t\tconst titleBox = qi.querySelector(\".gantt_cal_qi_title\") as HTMLElement;\r\n\t\tconst titleContent = titleBox.querySelector(\".gantt_cal_qi_tcontent\");\r\n\t\tconst titleDate = titleBox.querySelector(\".gantt_cal_qi_tdate\");\r\n\t\tconst main = qi.querySelector(\".gantt_cal_qi_content\");\r\n\t\tconst controls = qi.querySelector(\".gantt_cal_qi_controls\") as HTMLElement;\r\n\r\n\t\tgantt._waiAria.quickInfoHeader(qi, [content.header.title, content.header.date].join(\" \"));\r\n\r\n\t\ttitleContent.innerHTML = content.header.title;\r\n\t\ttitleDate.innerHTML = content.header.date;\r\n\r\n\t\tif(!content.header.title && !content.header.date){\r\n\t\t\ttitleBox.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\ttitleBox.style.display = \"\";\r\n\t\t}\r\n\t\tmain.innerHTML = content.content;\r\n\r\n\t\tconst buttons = content.buttons;\r\n\t\tif(!buttons.length){\r\n\t\t\tcontrols.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tcontrols.style.display = \"\";\r\n\t\t}\r\n\t\tlet html = \"\";\r\n\t\tfor (let i = 0; i < buttons.length; i++){\r\n\r\n\t\t\tconst ariaAttr = gantt._waiAria.quickInfoButtonAttrString(gantt.locale.labels[buttons[i]]);\r\n\r\n\t\t\thtml += `\r\n \r\n
${gantt.locale.labels[buttons[i]]}
\r\n
`;\r\n\t\t}\r\n\t\tcontrols.innerHTML = html;\r\n\r\n\t\tgantt.eventRemove(qi, \"click\", this._qiButtonClickHandler);\r\n\t\tgantt.eventRemove(qi, \"keypress\", this._qiKeyPressHandler);\r\n\r\n\t\tgantt.event(qi, \"click\", this._qiButtonClickHandler);\r\n\t\tgantt.event(qi, \"keypress\", this._qiKeyPressHandler);\r\n\t};\r\n\r\n\tprivate _qiButtonClickHandler = (ev) => {\r\n\t\tthis._qi_button_click(ev.target);\r\n\t};\r\n\r\n\tprivate _qiKeyPressHandler = (e) => {\r\n\r\n\t\tconst code = e.which;\r\n\t\tif (code === 13 || code === 32){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._qi_button_click(e.target);\r\n\t\t\t},1);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _showAtCoordinates(x: number, y: number) : void {\r\n\t\tthis.hide(true);\r\n\t\tthis._quickInfoBoxId = 0;\r\n\t\tthis._quickInfoTask = null;\r\n\t\tif(!this._quickInfoBox){\r\n\t\t\tthis._createQuickInfoElement();\r\n\t\t\tthis.setContent();\r\n\t\t}\r\n\r\n\t\tthis._appendAtCoordinates(x, y);\r\n\t\tthis._gantt.callEvent(\"onQuickInfo\", [null]);\r\n\t}\r\n\r\n\tprivate _showForTask(id: TaskID) : void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tif ((\r\n\t\t\tid === this._quickInfoBoxId &&\r\n\t\t\tgantt.utils.dom.isChildOf(this._quickInfoBox, document.body)\r\n\t\t) || !gantt.config.show_quick_info) {\r\n\t\t\t// not show if the quick info is already displayed for this task, or if it shouldn't be displayed\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.hide(true);\r\n\t\tconst offset = 6; // offset TASK <> QI-BOX in 'px'\r\n\t\tconst container = this._getContainer();\r\n\t\tconst pos = this._get_event_counter_part(id, offset, container.xViewport, container.yViewport);\r\n\r\n\t\tif (pos){\r\n\t\t\tthis._quickInfoBox = this._init_quick_info(id);\r\n\t\t\tthis._quickInfoTask = id;\r\n\t\t\tthis._quickInfoBox.className = this._prepare_quick_info_classname(id);\r\n\r\n\t\t\tthis._fill_quick_data(id);\r\n\t\t\tthis._show_quick_info(pos, offset);\r\n\t\t\tgantt.callEvent(\"onQuickInfo\", [id]);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _get_event_counter_part(id: TaskID, offset: number, xViewport: HTMLElement, yViewport: HTMLElement) : any {\r\n\t\tconst gantt = this._gantt;\r\n\t\tlet domEv = gantt.getTaskNode(id);\r\n\t\tif (!domEv) {\r\n\t\t\tdomEv = gantt.getTaskRowNode(id);\r\n\t\t\tif (!domEv) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tlet left = 0;\r\n\t\tconst top = offset + domEv.offsetTop + domEv.offsetHeight;\r\n\r\n\t\tlet node = domEv;\r\n\r\n\t\tif (gantt.utils.dom.isChildOf(node, xViewport)) {\r\n\t\t\twhile (node && node !== xViewport){\r\n\t\t\t\tleft += node.offsetLeft;\r\n\t\t\t\tnode = node.offsetParent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst scroll = gantt.getScrollState();\r\n\r\n\t\tif(node){\r\n\t\t\tconst dx = (left + domEv.offsetWidth/2) - scroll.x > (xViewport.offsetWidth/2) ? 1 : 0;\r\n\t\t\tconst dy = (top + domEv.offsetHeight/2) - scroll.y > (yViewport.offsetHeight/2) ? 1 : 0;\r\n\r\n\t\t\treturn { left, top, dx, dy, width:domEv.offsetWidth, height:domEv.offsetHeight };\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate _createQuickInfoElement() : HTMLElement {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst qi = document.createElement(\"div\");\r\n\t\tqi.className += \"gantt_cal_quick_info\";\r\n\t\tgantt._waiAria.quickInfoAttr(qi);\r\n\r\n\t\t// title\r\n\t\tconst ariaAttr = gantt._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t\t//buttons\r\n\t\thtml += \"\";\r\n\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\r\n\r\n\t\tif (gantt.config.quick_info_detached) {\r\n\t\t\tconst container = this._getContainer();\r\n\t\t\tgantt.event(container.parent, \"scroll\", () => { this.hide(); });\r\n\t\t}\r\n\r\n\t\tthis._quickInfoBox = qi;\r\n\t\treturn qi;\r\n\t}\r\n\r\n\tprivate _init_quick_info(id: TaskID) : HTMLElement {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst task = gantt.getTask(id);\r\n\t\t\r\n\r\n\t\tif(typeof this._quickInfoReadonly === \"boolean\"){\r\n\t\t\tif(gantt.isReadonly(task) !== this._quickInfoReadonly){\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t\tthis._quickInfoBox = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._quickInfoReadonly = gantt.isReadonly(task);\r\n\r\n\t\tif (!this._quickInfoBox){\r\n\t\t\tthis._quickInfoBox = this._createQuickInfoElement();\r\n\t\t}\r\n\r\n\t\treturn this._quickInfoBox;\r\n\t}\r\n\r\n\tprivate _prepare_quick_info_classname(id: TaskID) : string {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst task = gantt.getTask(id);\r\n\t\tconst taskType = gantt.getTaskType(task);\r\n\r\n\t\tlet css = `gantt_cal_quick_info gantt_${taskType}`;\r\n\t\tconst template = gantt.templates.quick_info_class(task.start_date, task.end_date, task);\r\n\r\n\t\tif(template){\r\n\t\t\tcss += \" \" + template;\r\n\t\t}\r\n\t\treturn css;\r\n\t}\r\n\r\n\tprivate _fill_quick_data(id: TaskID) : void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst ev = gantt.getTask(id);\r\n\r\n\t\tthis._quickInfoBoxId = id;\r\n\r\n\t\tlet allowedButtons = [];\r\n\t\tif (this._quickInfoReadonly){\r\n\t\t\tconst buttons = gantt.config.quickinfo_buttons;\r\n\t\t\tconst isEditor = {icon_delete: true, icon_edit: true};\r\n\t\t\tfor (let i = 0; i < buttons.length; i++){\r\n\t\t\t\tif(this._quickInfoReadonly && isEditor[buttons[i]]){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tallowedButtons.push(buttons[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tallowedButtons = gantt.config.quickinfo_buttons;\r\n\t\t}\r\n\r\n\t\tthis.setContent({\r\n\t\t\theader: {\r\n\t\t\t\ttitle: gantt.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\t\t\tdate: gantt.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t\t\t},\r\n\t\t\tcontent: gantt.templates.quick_info_content(ev.start_date, ev.end_date, ev),\r\n\t\t\tbuttons: allowedButtons\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _appendAtCoordinates(x: number, y: number): void {\r\n\t\tconst qi = this._quickInfoBox;\r\n\t\tconst container = this._getContainer();\r\n\t\tif (!qi.parentNode ||\r\n\t\t\tqi.parentNode.nodeName.toLowerCase() === \"#document-fragment\"){ // IE8\r\n\t\t\tcontainer.parent.appendChild(qi);\r\n\t\t}\r\n\r\n\t\tqi.style.left = x + \"px\";\r\n\t\tqi.style.top = y + \"px\";\r\n\t}\r\n\r\n\tprivate _show_quick_info(pos: any, offset: number) : void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst qi = this._quickInfoBox;\r\n\t\tif (gantt.config.quick_info_detached) {\r\n\t\t\tconst container = this._getContainer();\r\n\t\t\tif (!qi.parentNode ||\r\n\t\t\t\tqi.parentNode.nodeName.toLowerCase() === \"#document-fragment\"){ // IE8\r\n\t\t\t\tcontainer.parent.appendChild(qi);\r\n\t\t\t}\r\n\t\t\tconst width = qi.offsetWidth;\r\n\t\t\tconst popupHeight = qi.offsetHeight;\r\n\r\n\t\t\tconst scrolls = gantt.getScrollState();\r\n\t\t\tconst xViewport = container.xViewport;\r\n\t\t\tconst yViewport = container.yViewport;\r\n\t\t\tconst screenWidth = xViewport.offsetWidth + scrolls.x - width;\r\n\r\n\t\t\tconst relativePopupTop = pos.top - scrolls.y;\r\n\t\t\tconst relativePopupBottom = relativePopupTop + popupHeight;\r\n\r\n\t\t\tlet top = pos.top;\r\n\t\t\tif(relativePopupBottom > yViewport.offsetHeight / 2){\r\n\t\t\t\ttop = pos.top - (popupHeight + pos.height + 2*offset);\r\n\t\t\t\tif(top < scrolls.y && relativePopupBottom <= yViewport.offsetHeight){\r\n\t\t\t\t\ttop = pos.top;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (top < scrolls.y) {\r\n\t\t\t\ttop = scrolls.y;\r\n\t\t\t}\r\n\r\n\t\t\tconst x = Math.min(Math.max(scrolls.x, pos.left - pos.dx*(width - pos.width)), screenWidth);\r\n\t\t\tconst y = top;\r\n\r\n\t\t\tthis._appendAtCoordinates(x, y);\r\n\t\t} else {\r\n\t\t\tqi.style.top = 20 + \"px\";\r\n\t\t\tif (pos.dx === 1){\r\n\t\t\t\tqi.style.right = \"auto\";\r\n\t\t\t\tqi.style.left = \"-300px\";\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tqi.style.left = \"10px\";\r\n\t\t\t\t},1);\r\n\t\t\t} else {\r\n\t\t\t\tqi.style.left = \"auto\";\r\n\t\t\t\tqi.style.right = \"-300px\";\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tqi.style.right = \"10px\";\r\n\t\t\t\t},1);\r\n\t\t\t}\r\n\t\t\tqi.className += \" gantt_qi_\"+(pos.dx === 1 ? \"left\" : \"right\");\r\n\t\t\tgantt.$root.appendChild(qi);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _qi_button_click(node: any) : void {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst box = this._quickInfoBox;\r\n\t\tif (!node || node === box){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(node.closest(\".gantt_cal_qi_close_btn\")){\r\n\t\t\tthis.hide();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst mask = node.className;\r\n\t\tif (mask.indexOf(\"_icon\") !== -1){\r\n\t\t\tconst id = this._quickInfoBoxId;\r\n\t\t\tgantt.$click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else {\r\n\t\t\tthis._qi_button_click(node.parentNode);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _getContainer(): IQuickInfoContainer{\r\n\t\tconst gantt = this._gantt;\r\n\t\tlet container = this._container ? this._container : gantt.$task_data;\r\n\t\tif (container && container.offsetHeight && container.offsetWidth) {\r\n\t\t\treturn {\r\n\t\t\t\tparent: container,\r\n\t\t\t\txViewport: gantt.$task,\r\n\t\t\t\tyViewport: gantt.$task_data\r\n\t\t\t};\r\n\t\t}\r\n\t\tcontainer = this._container ? this._container : gantt.$grid_data;\r\n\t\tif (container && container.offsetHeight && container.offsetWidth) {\r\n\t\t\treturn {\r\n\t\t\t\tparent: container,\r\n\t\t\t\txViewport: gantt.$grid,\r\n\t\t\t\tyViewport: gantt.$grid_data\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tparent: this._container ? this._container : gantt.$layout,\r\n\t\t\txViewport: gantt.$layout,\r\n\t\t\tyViewport: gantt.$layout\r\n\t\t};\r\n\t}\r\n}\r\n","import * as helpers from \"./helpers\";\r\n\r\nvar plainObjectConstructor = ({}).constructor.toString();\r\nfunction isCustomType(object){\r\n\tvar constructorString = object.constructor.toString();\r\n\r\n\treturn constructorString !== plainObjectConstructor;\r\n}\r\n\r\nfunction copy(object) {\r\n\tvar i, result; // iterator, types array, result\r\n\r\n\tif (object && typeof object == \"object\") {\r\n\r\n\t\tswitch (true){\r\n\t\t\tcase (helpers.isDate(object)):\r\n\t\t\t\tresult = new Date(object);\r\n\t\t\t\tbreak;\r\n\t\t\tcase (helpers.isArray(object)):\r\n\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t/*\t\tcase (helpers.isStringObject(object)):\r\n\t\t\t\tresult = new String(object);\r\n\t\t\t\tbreak;\r\n\t\t\tcase (helpers.isNumberObject(object)):\r\n\t\t\t\tresult = new Number(object);\r\n\t\t\t\tbreak;\r\n\t\t\tcase (helpers.isBooleanObject(object)):\r\n\t\t\t\tresult = new Boolean(object);\r\n\t\t\t\tbreak;*/\r\n\t\t\tdefault:\r\n\t\t\t\tif(isCustomType(object)){\r\n\t\t\t\t\tresult = Object.create(object);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (i in object) {\r\n\t\t\t\t\tif (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn result || object;\r\n}\r\n\r\nfunction mixin (target, source, force){\r\n\tfor (var f in source)\r\n\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\treturn target;\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nvar seed;\r\nfunction uid() {\r\n\tif (!seed)\r\n\t\tseed = (new Date()).valueOf();\r\n\r\n\tseed++;\r\n\treturn seed;\r\n}\r\n\r\n//creates function with specified \"this\" pointer\r\nfunction bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n}\r\n\r\nfunction event(el, event, handler, capture){\r\n\tif (el.addEventListener)\r\n\t\tel.addEventListener(event, handler, capture === undefined ? false : capture);\r\n\r\n\telse if (el.attachEvent)\r\n\t\tel.attachEvent(\"on\"+event, handler);\r\n}\r\n\r\nfunction eventRemove(el, event, handler, capture){\r\n\tif (el.removeEventListener)\r\n\t\tel.removeEventListener(event, handler, capture === undefined ? false : capture);\r\n\r\n\telse if (el.detachEvent)\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n}\r\n\r\nexport {\r\n\tcopy,\r\n\tdefined,\r\n\tmixin,\r\n\tuid,\r\n\tbind,\r\n\tevent,\r\n\teventRemove\r\n};","import * as utils from \"../../../utils/utils\";\r\n\r\nfunction createScope(addEvent, removeEvent) {\r\n\taddEvent = addEvent || utils.event;\r\n\tremoveEvent = removeEvent || utils.eventRemove;\r\n\r\n\tvar handlers = [];\r\n\r\n\tvar eventScope = {\r\n\t\tattach: function(el, event, callback, capture){\r\n\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\taddEvent(el, event, callback, capture);\r\n\t\t},\r\n\t\tdetach: function(el, event, callback, capture){\r\n\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tdetachAll: function () {\r\n\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t}\r\n\t\t\thandlers.splice(0, handlers.length);\r\n\t\t},\r\n\t\textend: function(){\r\n\t\t\treturn createScope(this.event, this.eventRemove);\r\n\t\t}\r\n\t};\r\n\r\n\treturn eventScope;\r\n}\r\n\r\nexport default createScope;","import * as domHelpers from \"../../core/ui/utils/dom_helpers\";\r\n\r\n/* eslint-disable no-restricted-globals */\r\n\r\ninterface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement;\r\n\tprivate _gantt: any;\r\n\r\n\tconstructor(gantt: any){\r\n\t\tthis._gantt = gantt;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst gantt = this._gantt;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"gantt_tooltip\";\r\n\t\t\tgantt._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\t// GS-2463. Don't put the node beyond the body coordinates\r\n\t\t\t// as it may trigger the resize event\r\n\t\t\tnode.style.top = node.style.top || \"0px\";\r\n\t\t\tnode.style.left = node.style.left || \"0px\";\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tgantt._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tgantt._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst gantt = this._gantt;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = gantt.config.tooltip_offset_x;\r\n\t\tconst offsetY = gantt.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of gantt\r\n\t\tif(container === gantt.$task_data){\r\n\t\t\tviewport = gantt.$task;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(gantt.$task);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import domEventsScope from \"../../core/ui/utils/dom_event_scope\";\r\nimport * as domHelpers from \"../../core/ui/utils/dom_helpers\";\r\nimport * as helpers from \"../../utils/helpers\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _gantt: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(gantt: any) {\r\n\t\tthis.tooltip = new Tooltip(gantt);\r\n\t\tthis._gantt = gantt;\r\n\t\tthis._domEvents = domEventsScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst gantt = this._gantt;\r\n\t\tif(!config.global){\r\n\t\t\troot = gantt.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst gantt = this._gantt;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\r\n\t\tthis.delayShow = helpers.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(gantt.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, gantt.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = helpers.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, gantt.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import { IInlineEditState, IMonitor, IUndo, IUndoCommand, TActionType, TEntityType, TUndoValue } from \"./types\";\r\n\r\nconst noTrack = {\r\n\tonBeforeUndo: \"onAfterUndo\",\r\n\tonBeforeRedo: \"onAfterRedo\"\r\n};\r\n\r\nconst batchActions = [\r\n\t\"onTaskDragStart\",\r\n\t\"onAfterTaskUpdate\",\r\n\t\"onAfterTaskDelete\",\r\n\t\"onBeforeBatchUpdate\"\r\n];\r\n\r\nexport class Monitor implements IMonitor {\r\n\tprivate _batchAction = null;\r\n\tprivate _batchMode = false;\r\n\tprivate _ignore = false;\r\n\tprivate _ignoreMoveEvents = false;\r\n\tprivate _initialTasks = {};\r\n\tprivate _initialLinks = {};\r\n\tprivate _nestedTasks = {};\r\n\tprivate _nestedLinks = {};\r\n\tprivate _timeout;\r\n\tprivate _gantt: any;\r\n\tprivate _undo: IUndo;\r\n\r\n\tconstructor(undo: IUndo, gantt: any) {\r\n\t\tthis._undo = undo;\r\n\t\tthis._gantt = gantt;\r\n\t\tthis._attachEvents();\r\n\t}\r\n\r\n\tstore(id: TaskID | LinkID, type: TEntityType, overwrite: boolean = false) {\r\n\t\tif (type === this._gantt.config.undo_types.task) {\r\n\t\t\treturn this._storeTask(id, overwrite);\r\n\t\t}\r\n\t\tif (type === this._gantt.config.undo_types.link) {\r\n\t\t\treturn this._storeLink(id, overwrite);\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tisMoveEventsIgnored() {\r\n\t\treturn this._ignoreMoveEvents;\r\n\t}\r\n\ttoggleIgnoreMoveEvents(newValue?: boolean) {\r\n\t\tthis._ignoreMoveEvents = newValue || false;\r\n\t}\r\n\tstartIgnore() {\r\n\t\tthis._ignore = true;\r\n\t}\r\n\tstopIgnore() {\r\n\t\tthis._ignore = false;\r\n\t}\r\n\tstartBatchAction() {\r\n\t\t// try catching updates made from event handlers using timeout\r\n\t\tif (!this._timeout){\r\n\t\t\tthis._timeout = setTimeout(() => {\r\n\t\t\t\tthis.stopBatchAction();\r\n\t\t\t\tthis._timeout = null;\r\n\t\t\t}, 10);\r\n\t\t}\r\n\r\n\r\n\t\tif (this._ignore || this._batchMode) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._batchMode = true;\r\n\t\tthis._batchAction = this._undo.action.create();\r\n\t}\r\n\tstopBatchAction() {\r\n\t\tif (this._ignore) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst undo = this._undo;\r\n\t\tif (this._batchAction) {\r\n\t\t\tundo.logAction(this._batchAction);\r\n\t\t}\r\n\t\tthis._batchMode = false;\r\n\t\tthis._batchAction = null;\r\n\t}\r\n\tonTaskAdded(task: ITask) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeTaskCommand(task, this._undo.command.type.add);\r\n\t\t}\r\n\t}\r\n\tonTaskUpdated(task: ITask) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeTaskCommand(task, this._undo.command.type.update);\r\n\t\t}\r\n\t}\r\n\tonTaskMoved(task: ITask) {\r\n\t\tif (!this._ignore) {\r\n\t\t\t(task as any).$local_index = this._gantt.getTaskIndex(task.id);\r\n\t\t\tconst oldValue = this.getInitialTask(task.id);\r\n\t\t\tif((task as any).$local_index === oldValue.$local_index &&\r\n\t\t\t\tthis._gantt.getParent(task) === this._gantt.getParent(oldValue)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\tthis._storeEntityCommand(\r\n\t\t\t\ttask,\r\n\t\t\t\tthis.getInitialTask(task.id),\r\n\t\t\t\tthis._undo.command.type.move,\r\n\t\t\t\tthis._undo.command.entity.task\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\tonTaskDeleted(task: ITask) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeTaskCommand(task, this._undo.command.type.remove);\r\n\t\t\tif (this._nestedTasks[task.id]) {\r\n\t\t\t\tconst children = this._nestedTasks[task.id];\r\n\t\t\t\tfor (let i = 0; i < children.length; i++) {\r\n\t\t\t\t\tthis._storeTaskCommand(children[i], this._undo.command.type.remove);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this._nestedLinks[task.id]) {\r\n\t\t\t\tconst childrenLinks = this._nestedLinks[task.id];\r\n\t\t\t\tfor (let i = 0; i < childrenLinks.length; i++) {\r\n\t\t\t\t\tthis._storeLinkCommand(childrenLinks[i], this._undo.command.type.remove);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tonLinkAdded(link: ILink) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeLinkCommand(link, this._undo.command.type.add);\r\n\t\t}\r\n\t}\r\n\tonLinkUpdated(link: ILink) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeLinkCommand(link, this._undo.command.type.update);\r\n\t\t}\r\n\t}\r\n\tonLinkDeleted(link: ILink) {\r\n\t\tif (!this._ignore) {\r\n\t\t\tthis._storeLinkCommand(link, this._undo.command.type.remove);\r\n\t\t}\r\n\t}\r\n\tsetNestedTasks(id: TaskID, taskIds: TaskID[]) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tlet task = null;\r\n\t\tconst tasks = [];\r\n\t\tlet\tlinkIds = this._getLinks(gantt.getTask(id));\r\n\r\n\t\tfor (let i = 0; i < taskIds.length; i++) {\r\n\t\t\ttask = this.setInitialTask(taskIds[i]);\r\n\t\t\tlinkIds = linkIds.concat(this._getLinks(task));\r\n\t\t\ttasks.push(task);\r\n\t\t}\r\n\r\n\t\tconst uniqueLinks = {};\r\n\t\tfor (let i = 0; i < linkIds.length; i++) {\r\n\t\t\tuniqueLinks[linkIds[i]] = true;\r\n\t\t}\r\n\t\tconst links = [];\r\n\t\tfor (const i in uniqueLinks) {\r\n\t\t\tlinks.push(this.setInitialLink(i));\r\n\t\t}\r\n\t\tthis._nestedTasks[id] = tasks;\r\n\t\tthis._nestedLinks[id] = links;\r\n\t}\r\n\tsetInitialTask(id: TaskID, overwrite?: boolean) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tif (overwrite || (!this._initialTasks[id] || !this._batchMode)) {\r\n\t\t\tconst task = gantt.copy(gantt.getTask(id));\r\n\t\t\ttask.$index = gantt.getGlobalTaskIndex(id);\r\n\t\t\ttask.$local_index = gantt.getTaskIndex(id);\r\n\t\t\tthis.setInitialTaskObject(id, task);\r\n\t\t}\r\n\t\treturn this._initialTasks[id];\r\n\t}\r\n\tgetInitialTask(id: TaskID) {\r\n\t\treturn this._initialTasks[id];\r\n\t}\r\n\tclearInitialTasks() {\r\n\t\tthis._initialTasks = {};\r\n\t}\r\n\tsetInitialTaskObject(id: TaskID, object: ITask) {\r\n\t\tthis._initialTasks[id] = object;\r\n\t}\r\n\tsetInitialLink(id: LinkID, overwrite?: boolean) {\r\n\t\tif (!this._initialLinks[id] || !this._batchMode) {\r\n\t\t\tthis._initialLinks[id] = this._gantt.copy(this._gantt.getLink(id));\r\n\t\t}\r\n\t\treturn this._initialLinks[id];\r\n\t}\r\n\tgetInitialLink(id: LinkID) {\r\n\t\treturn this._initialLinks[id];\r\n\t}\r\n\tclearInitialLinks() {\r\n\t\tthis._initialLinks = {};\r\n\t}\r\n\tprivate _attachEvents() {\r\n\t\tlet deleteCacheCooldown = null;\r\n\t\tconst gantt = this._gantt;\r\n\r\n\t\tconst saveInitialAll = () => {\r\n\t\t\tif (!deleteCacheCooldown) {\r\n\t\t\t\tdeleteCacheCooldown = setTimeout(() => {\r\n\t\t\t\t\tdeleteCacheCooldown = null;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.clearInitialTasks();\r\n\t\t\t\tgantt.eachTask((task: ITask) => {\r\n\t\t\t\t\tthis.setInitialTask(task.id);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.clearInitialLinks();\r\n\t\t\t\tgantt.getLinks().forEach((link: ILink) => {\r\n\t\t\t\t\tthis.setInitialLink(link.id);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t\tconst getMoveObjectByTaskId = (id: TaskID) => {\r\n\t\t\treturn gantt.copy(gantt.getTask(id));\r\n\t\t};\r\n\r\n\t\tfor (const i in noTrack) {\r\n\t\t\tgantt.attachEvent(i, () => {\r\n\t\t\t\tthis.startIgnore();\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(noTrack[i], () => {\r\n\t\t\t\tthis.stopIgnore();\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < batchActions.length; i++) {\r\n\t\t\tgantt.attachEvent(batchActions[i], () => {\r\n\t\t\t\tthis.startBatchAction();\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tgantt.attachEvent(\"onParse\", () => {\r\n\t\t\tthis._undo.clearUndoStack();\r\n\t\t\tthis._undo.clearRedoStack();\r\n\t\t\tsaveInitialAll();\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterTaskAdd\", (id: TaskID, task: ITask) => {\r\n\t\t\tthis.setInitialTask(id, true);\r\n\t\t\tthis.onTaskAdded(task);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterTaskUpdate\", (id: TaskID, task: ITask) => {\r\n\t\t\tthis.onTaskUpdated(task);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterTaskDelete\", (id: TaskID, task: ITask) => {\r\n\t\t\tthis.onTaskDeleted(task);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterLinkAdd\", (id: LinkID, link: ILink) => {\r\n\t\t\tthis.setInitialLink(id, true);\r\n\t\t\tthis.onLinkAdded(link);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterLinkUpdate\", (id: LinkID, link: ILink) => {\r\n\t\t\tthis.onLinkUpdated(link);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onAfterLinkDelete\", (id: LinkID, link: ILink) => {\r\n\t\t\tthis.onLinkDeleted(link);\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onRowDragEnd\", (id: TaskID, target: TaskID) => {\r\n\t\t\tthis.onTaskMoved(getMoveObjectByTaskId(id));\r\n\t\t\tthis.toggleIgnoreMoveEvents();\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onBeforeTaskDelete\", (id: TaskID) => {\r\n\t\t\tthis.store(id, gantt.config.undo_types.task);\r\n\t\t\tconst nested = [];\r\n\r\n\t\t\t// remember task indexes in case their being deleted in a loop, so they could be restored in the correct order\r\n\t\t\tsaveInitialAll();\r\n\r\n\t\t\tgantt.eachTask((task: ITask) => {\r\n\t\t\t\tnested.push(task.id);\r\n\t\t\t}, id);\r\n\t\t\tthis.setNestedTasks(id, nested);\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tconst datastore = gantt.getDatastore(\"task\");\r\n\r\n\t\tdatastore.attachEvent(\"onBeforeItemMove\", (id: TaskID, parent: TaskID, tindex: number) => {\r\n\t\t\tif (!this.isMoveEventsIgnored()) {\r\n\t\t\t\tsaveInitialAll();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tdatastore.attachEvent(\"onAfterItemMove\", (id: TaskID, parent: TaskID, tindex: number) => {\r\n\t\t\tif (!this.isMoveEventsIgnored()) {\r\n\t\t\t\tthis.onTaskMoved(getMoveObjectByTaskId(id));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onRowDragStart\", (id: TaskID, target: TaskID, e: Event) => {\r\n\t\t\tthis.toggleIgnoreMoveEvents(true);\r\n\t\t\tsaveInitialAll();\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tlet dragId = null;\r\n\t\tlet projectDrag = false;\r\n\t\tgantt.attachEvent(\"onBeforeTaskDrag\", (taskId: TaskID) => {\r\n\t\t\tdragId = gantt.getState().drag_id;\r\n\t\t\tif (dragId === taskId){\r\n\t\t\t\tconst task = gantt.getTask(taskId);\r\n\t\t\t\tif (gantt.isSummaryTask(task) && gantt.config.drag_project){\r\n\t\t\t\t\tprojectDrag = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// GS-99. Store the initial task dates before multiple drag\r\n\t\t\tif (gantt.plugins().multiselect){\r\n\t\t\t\tconst selectedIds = gantt.getSelectedTasks();\r\n\t\t\t\tif (selectedIds.length > 1){\r\n\t\t\t\t\tselectedIds.forEach((id)=>{\r\n\t\t\t\t\t\tthis.store(id, gantt.config.undo_types.task, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this.store(taskId, gantt.config.undo_types.task);\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onAfterTaskDrag\", (taskId: TaskID) => {\r\n\t\t\t// if we drag multiple tasks and other tasks move to another date after that,\r\n\t\t\t// auto-scheduling/correct work time should occur in anoher command.\r\n\t\t\t// otherwise, when we undo the changes, the task constraint is not restored correctly\r\n\t\t\tconst multipleDrag = projectDrag || (gantt.plugins().multiselect && gantt.getSelectedTasks().length > 1);\r\n\t\t\tif (multipleDrag && dragId === taskId){\r\n\t\t\t\tprojectDrag = false;\r\n\t\t\t\tdragId = null;\r\n\t\t\t\tthis.stopBatchAction();\r\n\t\t\t}\r\n\t\t\t// GS-99. When dragging multiple tasks, we need to store the initial tasks\r\n\t\t\tthis.store(taskId, gantt.config.undo_types.task, true);\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onLightbox\", (taskId: TaskID) => this.store(taskId, gantt.config.undo_types.task));\r\n\r\n\t\tgantt.attachEvent(\"onBeforeTaskAutoSchedule\", (task: ITask) => {\r\n\t\t\tthis.store(task.id, gantt.config.undo_types.task, true);\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tif (gantt.ext.inlineEditors) {\r\n\t\t\t// remove the onGanttLayoutReady wrapper when GS-1288 is merged\r\n\t\t\tlet onBeforeEditStartId = null;\r\n\t\t\tlet onEditStart = null;\r\n\t\t\tgantt.attachEvent(\"onGanttLayoutReady\", () => {\r\n\t\t\t\tif (onBeforeEditStartId) {\r\n\t\t\t\t\tgantt.ext.inlineEditors.detachEvent(onBeforeEditStartId);\r\n\t\t\t\t}\r\n\t\t\t\tif (onEditStart) {\r\n\t\t\t\t\tgantt.ext.inlineEditors.detachEvent(onEditStart);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tonEditStart = gantt.ext.inlineEditors.attachEvent(\"onEditStart\", (state: IInlineEditState) => {\r\n\t\t\t\t\tthis.store(state.id, gantt.config.undo_types.task);\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// GS-99. If another inline editor is opened and we open a new inline editor,\r\n\t\t\t\t// we shouldn't use the batchAction\r\n\t\t\t\tonBeforeEditStartId = gantt.ext.inlineEditors.attachEvent(\"onBeforeEditStart\", (state: IInlineEditState) => {\r\n\t\t\t\t\tthis.stopBatchAction();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _storeCommand(command: IUndoCommand) {\r\n\t\tconst undo = this._undo;\r\n\t\tundo.updateConfigs();\r\n\r\n\t\tif (!undo.undoEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this._batchMode) {\r\n\t\t\tthis._batchAction.commands.push(command);\r\n\t\t} else {\r\n\t\t\tconst action = undo.action.create([command]);\r\n\t\t\tundo.logAction(action);\r\n\t\t}\r\n\t}\r\n\tprivate _storeEntityCommand(obj: TUndoValue, old: TUndoValue, actionType: TActionType, entityType: TEntityType) {\r\n\t\tconst undo = this._undo;\r\n\t\tconst command = undo.command.create(obj, old, actionType, entityType);\r\n\t\tthis._storeCommand(command);\r\n\t}\r\n\tprivate _storeTaskCommand(obj: ITask, type: TActionType) {\r\n\t\tif(this._gantt.isTaskExists(obj.id)){\r\n\t\t\t(obj as any).$local_index = this._gantt.getTaskIndex(obj.id);\r\n\t\t}\r\n\r\n\t\tthis._storeEntityCommand(obj, this.getInitialTask(obj.id), type, this._undo.command.entity.task);\r\n\t}\r\n\tprivate _storeLinkCommand(obj: ILink, type: TActionType) {\r\n\t\tthis._storeEntityCommand(obj, this.getInitialLink(obj.id), type, this._undo.command.entity.link);\r\n\t}\r\n\tprivate _getLinks(task: ITask) {\r\n\t\treturn task.$source.concat(task.$target);\r\n\t}\r\n\tprivate _storeTask(taskId: TaskID, overwrite: boolean = false) {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis.setInitialTask(taskId, overwrite);\r\n\t\tgantt.eachTask((child: ITask) => {\r\n\t\t\tthis.setInitialTask(child.id);\r\n\t\t}, taskId);\r\n\t\treturn true;\r\n\t}\r\n\tprivate _storeLink(linkId: LinkID, overwrite: boolean = false) {\r\n\t\tthis.setInitialLink(linkId, overwrite);\r\n\t\treturn true;\r\n\t}\r\n}","import { IUndo, IUndoCommand, IUndoCommands, IUndoPropAction, IUndoPropCommand, TActionType, TEntityType, TUndoStack, TUndoValue } from \"./types\";\r\n\r\nconst MAX_UNDO_STEPS = 100;\r\n\r\nexport class Undo implements IUndo {\r\n\r\n\tmaxSteps = MAX_UNDO_STEPS;\r\n\tundoEnabled = true;\r\n\tredoEnabled = true;\r\n\taction: IUndoPropAction = {\r\n\t\tcreate: (commands?: IUndoCommand[]): IUndoCommands => {\r\n\t\t\treturn { commands: (commands ? commands.slice() : []) };\r\n\t\t},\r\n\t\tinvert: (action: IUndoCommands): IUndoCommands => {\r\n\t\t\tconst gantt = this._gantt;\r\n\t\t\tconst revert = gantt.copy(action);\r\n\t\t\tconst commands = this.command;\r\n\t\t\tfor (let i = 0; i < action.commands.length; i++) {\r\n\t\t\t\tconst command = revert.commands[i] = commands.invert(revert.commands[i]);\r\n\t\t\t\tif (command.type === commands.type.update || command.type === commands.type.move) {\r\n\t\t\t\t\t[command.value, command.oldValue] = [command.oldValue, command.value];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn revert as IUndoCommands;\r\n\t\t}\r\n\t};\r\n\tcommand: IUndoPropCommand = {\r\n\t\t// entities that require different processing for undoing-redoing changes (gantt.config.undo_types)\r\n\t\tentity: null,\r\n\r\n\t\t// types of traced actions (gantt.config.undo_actions)\r\n\t\ttype: null,\r\n\r\n\t\tcreate: (value: TUndoValue, oldValue: TUndoValue, type: TActionType, entity: TEntityType): IUndoCommand => {\r\n\t\t\tconst gantt = this._gantt;\r\n\t\t\treturn {\r\n\t\t\t\tentity,\r\n\t\t\t\ttype,\r\n\t\t\t\tvalue: gantt.copy(value),\r\n\t\t\t\toldValue: gantt.copy(oldValue || value)\r\n\t\t\t};\r\n\t\t},\r\n\t\tinvert: (command: IUndoCommand): IUndoCommand => {\r\n\t\t\tconst gantt = this._gantt;\r\n\t\t\tconst revert = gantt.copy(command);\r\n\t\t\trevert.type = this.command.inverseCommands(command.type);\r\n\t\t\treturn revert;\r\n\t\t},\r\n\t\tinverseCommands: (command: TActionType): TActionType => {\r\n\t\t\tconst gantt = this._gantt;\r\n\t\t\tconst types = this.command.type;\r\n\t\t\tswitch (command) {\r\n\t\t\t\tcase types.update:\r\n\t\t\t\t\treturn types.update;\r\n\t\t\t\tcase types.remove:\r\n\t\t\t\t\treturn types.add;\r\n\t\t\t\tcase types.add:\r\n\t\t\t\t\treturn types.remove;\r\n\t\t\t\tcase types.move:\r\n\t\t\t\t\treturn types.move;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tgantt.assert(false, \"Invalid command \"+ command);\r\n\t\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _undoStack = [];\r\n\tprivate _redoStack = [];\r\n\tprivate _gantt: any;\r\n\r\n\tconstructor(gantt: any){\r\n\t\tthis._gantt = gantt;\r\n\t}\r\n\tgetUndoStack() {\r\n\t\treturn this._undoStack;\r\n\t}\r\n\tsetUndoStack(stack: []) {\r\n\t\tthis._undoStack = stack;\r\n\t}\r\n\r\n\tgetRedoStack() {\r\n\t\treturn this._redoStack;\r\n\t}\r\n\tsetRedoStack(stack: []) {\r\n\t\tthis._redoStack = stack;\r\n\t}\r\n\r\n\tclearUndoStack() {\r\n\t\tthis._undoStack = [];\r\n\t}\r\n\r\n\tclearRedoStack() {\r\n\t\tthis._redoStack = [];\r\n\t}\r\n\r\n\tupdateConfigs() {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis.maxSteps = gantt.config.undo_steps || MAX_UNDO_STEPS;\r\n\t\tthis.command.entity = gantt.config.undo_types;\r\n\t\tthis.command.type = gantt.config.undo_actions;\r\n\t\tthis.undoEnabled = !!gantt.config.undo;\r\n\t\tthis.redoEnabled = !!gantt.config.redo; // GS-873, Redo should work even when the `gantt.config.undo` is disabled.\r\n\t}\r\n\r\n\tundo() {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis.updateConfigs();\r\n\t\tif (!this.undoEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst action = this._pop(this._undoStack);\r\n\t\tif (action) {\r\n\t\t\tthis._reorderCommands(action);\r\n\t\t}\r\n\t\tif (gantt.callEvent(\"onBeforeUndo\", [action]) !== false) {\r\n\t\t\tif (action) {\r\n\t\t\t\tthis._applyAction(this.action.invert(action));\r\n\t\t\t\tthis._push(this._redoStack, gantt.copy(action));\r\n\t\t\t\tgantt.callEvent(\"onAfterUndo\", [action]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgantt.callEvent(\"onAfterUndo\", [null]);\r\n\t}\r\n\r\n\tredo() {\r\n\t\tconst gantt = this._gantt;\r\n\t\tthis.updateConfigs();\r\n\t\tif (!this.redoEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst action = this._pop(this._redoStack);\r\n\t\tif (action) {\r\n\t\t\tthis._reorderCommands(action);\r\n\t\t}\r\n\r\n\t\tif (gantt.callEvent(\"onBeforeRedo\", [action]) !== false) {\r\n\t\t\tif (action) {\r\n\t\t\t\tthis._applyAction(action);\r\n\t\t\t\tthis._push(this._undoStack, gantt.copy(action));\r\n\t\t\t\tgantt.callEvent(\"onAfterRedo\", [action]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgantt.callEvent(\"onAfterRedo\", [null]);\r\n\t}\r\n\r\n\t// storeUndo:\r\n\tlogAction(action: IUndoCommands) {\r\n\t\tthis._push(this._undoStack, action);\r\n\t\tthis._redoStack = [];\r\n\t}\r\n\r\n\tprivate _push(stack: TUndoStack, action: IUndoCommands): IUndoCommands {\r\n\t\tconst gantt = this._gantt;\r\n\t\tif (!action.commands.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst event = stack === this._undoStack ? \"onBeforeUndoStack\" : \"onBeforeRedoStack\";\r\n\t\tif (gantt.callEvent(event, [action]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// commands can be removed from event handler\r\n\t\tif (!action.commands.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tstack.push(action);\r\n\t\twhile (stack.length > this.maxSteps) {\r\n\t\t\tstack.shift();\r\n\t\t}\r\n\t\treturn action;\r\n\t}\r\n\r\n\tprivate _pop(stack: TUndoStack): IUndoCommands {\r\n\t\treturn stack.pop();\r\n\t}\r\n\r\n\tprivate _reorderCommands(action) {\r\n\t\t// firstly process tasks and only then links\r\n\t\t// in order to ensure links are added not earlier than their tasks\r\n\t\t// firstly to 'move' actions and only then updates\r\n\t\tconst weights = { any: 0, link:1, task:2 };\r\n\t\tconst actionWeights = { move: 1, any:0 };\r\n\t\taction.commands.sort(function(a, b) {\r\n\t\t\tif (a.entity === \"task\" && b.entity === \"task\") {\r\n\t\t\t\tif (a.type !== b.type) {\r\n\t\t\t\t\treturn (actionWeights[b.type] || 0) - (actionWeights[a.type] || 0);\r\n\t\t\t\t} else if (a.type === \"move\" && a.oldValue && b.oldValue && b.oldValue.parent === a.oldValue.parent) {\r\n\t\t\t\t\treturn a.oldValue.$index - b.oldValue.$index;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst weightA = weights[a.entity] || weights.any;\r\n\t\t\t\tconst weightB = weights[b.entity] || weights.any;\r\n\t\t\t\treturn weightB - weightA;\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _applyAction(action: IUndoCommands) {\r\n\t\tlet command = null;\r\n\t\tconst entities = this.command.entity;\r\n\t\tconst actions = this.command.type;\r\n\t\tconst gantt = this._gantt;\r\n\t\tconst methods = {};\r\n\t\tmethods[entities.task] = {\r\n\t\t\tadd: \"addTask\",\r\n\t\t\tget: \"getTask\",\r\n\t\t\tupdate: \"updateTask\",\r\n\t\t\tremove: \"deleteTask\",\r\n\t\t\tmove: \"moveTask\",\r\n\t\t\tisExists: \"isTaskExists\"\r\n\t\t};\r\n\t\tmethods[entities.link] = {\r\n\t\t\tadd: \"addLink\",\r\n\t\t\tget: \"getLink\",\r\n\t\t\tupdate: \"updateLink\",\r\n\t\t\tremove: \"deleteLink\",\r\n\t\t\tisExists: \"isLinkExists\"\r\n\t\t};\r\n\r\n\t\tgantt.batchUpdate(function() {\r\n\t\t\t// it is logical to undo actions from the last one to the first one\r\n\t\t\t// but we have to do it from the first one because the order\r\n\t\t\t// of tasks ($index and $local_index) depends on the existing tasks\r\n\t\t\tfor (let i = 0; i < action.commands.length; i++) {\r\n\t\t\t\tcommand = action.commands[i];\r\n\t\t\t\tconst method = methods[command.entity][command.type];\r\n\t\t\t\tconst getMethod = methods[command.entity].get;\r\n\t\t\t\tconst check = methods[command.entity].isExists;\r\n\r\n\t\t\t\tif (command.type === actions.add) {\r\n\t\t\t\t\tgantt[method](command.oldValue, command.oldValue.parent, command.oldValue.$local_index);\r\n\t\t\t\t} else if (command.type === actions.remove) {\r\n\t\t\t\t\tif (gantt[check](command.value.id)) {\r\n\t\t\t\t\t\tgantt[method](command.value.id);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (command.type === actions.update) {\r\n\t\t\t\t\tconst item = gantt[getMethod](command.value.id);\r\n\t\t\t\t\tfor(const prop in command.value){\r\n\t\t\t\t\t\tif(!prop.startsWith(\"$\") && !prop.startsWith(\"_\")){\r\n\t\t\t\t\t\t\titem[prop] = command.value[prop];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tgantt[method](command.value.id);\r\n\t\t\t\t} else if (command.type === actions.move) {\r\n\t\t\t\t\tgantt[method](command.value.id, command.value.$local_index, command.value.parent);\r\n\t\t\t\t\t// GS-680: We should send the changes to the server after we undo vertical reorder\r\n\t\t\t\t\tgantt.callEvent(\"onRowDragEnd\", [command.value.id]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","\r\nimport click_drag from \"./click_drag\";\r\nimport drag_timeline from \"./drag_timeline\";\r\nimport export_api from \"./export_api\";\r\nimport fullscreen from \"./fullscreen\";\r\nimport keyboard_navigation from \"./keyboard_navigation\";\r\nimport marker from \"./marker\";\r\nimport multiselect from \"./multiselect\";\r\nimport quick_info from \"./quick_info\";\r\nimport tooltip from \"./tooltip\";\r\nimport undo from \"./undo\";\r\n\r\nexport default {\r\n\tclick_drag,\r\n\tdrag_timeline,\r\n\tfullscreen,\r\n\tkeyboard_navigation,\r\n\tquick_info,\r\n\ttooltip,\r\n\tundo,\r\n\tmarker,\r\n\tmultiselect,\r\n\texport_api\r\n};","import { EventsManager } from \"./eventsManager\";\r\nimport { ISelectedRegionConfig, SelectedRegion } from \"./selectedRegion\";\r\n\r\nexport default function(gantt: any){\r\n\tif (!gantt.ext) {\r\n\t\tgantt.ext = {};\r\n\t}\r\n\r\n\tconst defaultConfig: ISelectedRegionConfig = {\r\n\t\tclassName: \"gantt_click_drag_rect\",\r\n\t\tuseRequestAnimationFrame: true,\r\n\t\tcallback: undefined,\r\n\t\tsingleRow: false\r\n\t};\r\n\r\n\tconst eventsManager = new EventsManager(gantt);\r\n\r\n\tgantt.ext.clickDrag = eventsManager;\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", () => {\r\n\t\tconst config: ISelectedRegionConfig = { viewPort: gantt.$task_data, ...defaultConfig };\r\n\t\tif (gantt.config.click_drag){\r\n\t\t\tconst clickDrag = gantt.config.click_drag;\r\n\t\t\tconfig.render = clickDrag.render || defaultConfig.render;\r\n\t\t\tconfig.className = clickDrag.className || defaultConfig.className;\r\n\t\t\tconfig.callback = clickDrag.callback || defaultConfig.callback;\r\n\t\t\tconfig.viewPort = clickDrag.viewPort || gantt.$task_data;\r\n\t\t\tconfig.useRequestAnimationFrame = clickDrag.useRequestAnimationFrame === undefined ?\r\n\t\t\t\tdefaultConfig.useRequestAnimationFrame : clickDrag.useRequestAnimationFrame;\r\n\r\n\t\t\tconfig.singleRow = clickDrag.singleRow === undefined ? defaultConfig.singleRow : clickDrag.singleRow;\r\n\t\t\tconst timeline = gantt.$ui.getView(\"timeline\");\r\n\t\t\tconst selectedRegion = new SelectedRegion(config, gantt, timeline);\r\n\t\t\tgantt.ext.clickDrag.attach(selectedRegion, clickDrag.useKey, clickDrag.ignore);\r\n\t\t}\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onDestroy\", () => {\r\n\t\teventsManager.destructor();\r\n\t});\r\n\r\n}","import { EventsManager } from \"./eventsManager\";\r\nexport default function(gantt: any){\r\n\tif (!gantt.ext){\r\n\t\tgantt.ext = {};\r\n\t}\r\n\r\n\tgantt.ext.dragTimeline = {\r\n\t\tcreate: () => EventsManager.create(gantt)\r\n\t};\r\n\r\n\tgantt.config.drag_timeline = {\r\n\t\tenabled: true,\r\n\t\trender: false\r\n\t};\r\n}","export default function(gantt: any){\r\n\r\ninterface IBody extends HTMLElement {\r\n\tmsRequestFullscreen?: () => void;\r\n\tmozRequestFullScreen?: () => void;\r\n\twebkitRequestFullscreen?: (ALLOW_KEYBOARD_INPUT: any) => void;\r\n}\r\n\r\n\r\ninterface IConsole extends Console {\r\n\twarning?: (str: string) => void;\r\n}\r\n\r\ninterface IDocument extends Document {\r\n\tfullscreenElement: Element;\r\n\tmozFullScreenElement?: Element;\r\n\twebkitFullscreenElement?: Element;\r\n\tmsFullscreenElement?: Element;\r\n\twebkitFullscreenEnabled?: boolean;\r\n\tmozFullScreenEnabled?: boolean;\r\n\tmsFullscreenEnabled?: boolean;\r\n\tmsExitFullscreen?: () => void;\r\n\tmozCancelFullScreen?: () => void;\r\n\twebkitExitFullscreen?: () => void;\r\n}\r\n\r\ninterface IElement extends Element {\r\n\tALLOW_KEYBOARD_INPUT?: boolean;\r\n}\r\n\r\ninterface IElementSizes extends ISizes {\r\n\tmodified: boolean;\r\n}\r\n\r\ninterface ISizes {\r\n\twidth: null | string;\r\n\theight: null | string;\r\n\ttop: null | string;\r\n\tleft: null | string;\r\n\tposition: null | string;\r\n\tzIndex: null | number;\r\n}\r\n\r\nfunction isExpanded() {\r\n\tconst element = ((document as IDocument).fullscreenElement ||\r\n\t\t(document as IDocument).mozFullScreenElement ||\r\n\t\t(document as IDocument).webkitFullscreenElement ||\r\n\t\t(document as IDocument).msFullscreenElement);\r\n\treturn !!(element && element === document.body);\r\n}\r\n\r\nfunction isFullscreenAvailable() {\r\n\ttry {\r\n\t\treturn (document as IDocument).fullscreenEnabled ||\r\n\t\t\t(document as IDocument).webkitFullscreenEnabled ||\r\n\t\t\t(document as IDocument).mozFullScreenEnabled ||\r\n\t\t\t(document as IDocument).msFullscreenEnabled;\r\n\t} catch (e) {\r\n\t\t// eslint-disable-next-line no-console\r\n\t\tconsole.error(\"Fullscreen is not available:\", e); \r\n\t}\r\n}\r\n\r\nconst state = gantt.$services.getService(\"state\");\r\nstate.registerProvider(\"fullscreen\", () => {\r\n\tif (isFullscreenAvailable()){\r\n\t\treturn { fullscreen: isExpanded() };\r\n\t} else {\r\n\t\treturn undefined;\r\n\t}\r\n});\r\n\r\nlet backupBodyPadding = {\r\n\toverflow: null,\r\n\tpadding: null,\r\n\tpaddingTop: null,\r\n\tpaddingRight: null,\r\n\tpaddingBottom: null,\r\n\tpaddingLeft: null\r\n};\r\n\r\nconst backupElementSizes: IElementSizes = {\r\n\twidth: null,\r\n\theight: null,\r\n\ttop: null,\r\n\tleft: null,\r\n\tposition: null,\r\n\tzIndex: null,\r\n\tmodified: false\r\n};\r\n\r\nlet backupPositioning = null;\r\nfunction resetParentPositioning(root){\r\n\tlet parent = root.parentNode;\r\n\tconst positions = [];\r\n\twhile(parent && parent.style){\r\n\t\tpositions.push({\r\n\t\t\telement: parent,\r\n\t\t\toriginalPositioning: parent.style.position\r\n\t\t});\r\n\t\tparent.style.position = \"static\";\r\n\t\tparent = parent.parentNode;\r\n\t}\r\n\treturn positions;\r\n}\r\n\r\nfunction restoreParentPositioning(positions: any[]){\r\n\tpositions.forEach(record => {\r\n\t\trecord.element.style.position = record.originalPositioning;\r\n\t});\r\n}\r\n\r\n// expand gantt root element to fullscreen automatically\r\nfunction setFullScreenSizes() {\r\n\tconst root = gantt.ext.fullscreen.getFullscreenElement();\r\n\tconst body = document.body;\r\n\tupdateSizes(root.style, backupElementSizes);\r\n\tbackupBodyPadding = {\r\n\t\toverflow: body.style.overflow,\r\n\t\tpadding: body.style.padding ? body.style.padding : null,\r\n\t\tpaddingTop: body.style.paddingTop ? body.style.paddingTop : null,\r\n\t\tpaddingRight: body.style.paddingRight ? body.style.paddingRight : null,\r\n\t\tpaddingBottom: body.style.paddingBottom ? body.style.paddingBottom : null,\r\n\t\tpaddingLeft: body.style.paddingLeft ? body.style.paddingLeft : null\r\n\t};\r\n\r\n\tif (body.style.padding) {\r\n\t\tbody.style.padding = \"0\";\r\n\t}\r\n\tif (body.style.paddingTop) {\r\n\t\tbody.style.paddingTop = \"0\";\r\n\t}\r\n\tif (body.style.paddingRight) {\r\n\t\tbody.style.paddingRight = \"0\";\r\n\t}\r\n\tif (body.style.paddingBottom) {\r\n\t\tbody.style.paddingBottom = \"0\";\r\n\t}\r\n\tif (body.style.paddingLeft) {\r\n\t\tbody.style.paddingLeft = \"0\";\r\n\t}\r\n\r\n\tbody.style.overflow = \"hidden\";\r\n\r\n\troot.style.width = \"100vw\";\r\n\troot.style.height = \"100vh\";\r\n\troot.style.top = \"0px\";\r\n\troot.style.left = \"0px\";\r\n\troot.style.position = \"absolute\";\r\n\troot.style.zIndex = 1;\r\n\tbackupElementSizes.modified = true;\r\n\tbackupPositioning = resetParentPositioning(root);\r\n}\r\n\r\nfunction restoreSizes() {\r\n\tconst root = gantt.ext.fullscreen.getFullscreenElement();\r\n\tconst body = document.body;\r\n\tif (backupElementSizes.modified) {\r\n\t\tif (backupBodyPadding.padding) {\r\n\t\t\tbody.style.padding = backupBodyPadding.padding;\r\n\t\t}\r\n\t\tif (backupBodyPadding.paddingTop) {\r\n\t\t\tbody.style.paddingTop = backupBodyPadding.paddingTop;\r\n\t\t}\r\n\t\tif (backupBodyPadding.paddingRight) {\r\n\t\t\tbody.style.paddingRight = backupBodyPadding.paddingRight;\r\n\t\t}\r\n\t\tif (backupBodyPadding.paddingBottom) {\r\n\t\t\tbody.style.paddingBottom = backupBodyPadding.paddingBottom;\r\n\t\t}\r\n\t\tif (backupBodyPadding.paddingLeft) {\r\n\t\t\tbody.style.paddingLeft = backupBodyPadding.paddingLeft;\r\n\t\t}\r\n\r\n\t\tbody.style.overflow = backupBodyPadding.overflow;\r\n\t\tbackupBodyPadding = {\r\n\t\t\toverflow: null,\r\n\t\t\tpadding: null,\r\n\t\t\tpaddingTop: null,\r\n\t\t\tpaddingRight: null,\r\n\t\t\tpaddingBottom: null,\r\n\t\t\tpaddingLeft: null\r\n\t\t};\r\n\t\tupdateSizes(backupElementSizes, root.style);\r\n\t\tbackupElementSizes.modified = false;\r\n\t}\r\n\trestoreParentPositioning(backupPositioning);\r\n\tbackupPositioning = null;\r\n}\r\n\r\nfunction updateSizes(source: ISizes, target: ISizes) {\r\n\ttarget.width = source.width;\r\n\ttarget.height = source.height;\r\n\ttarget.top = source.top;\r\n\ttarget.left = source.left;\r\n\ttarget.position = source.position;\r\n\ttarget.zIndex = source.zIndex;\r\n}\r\n\r\nfunction addDOMEvents() {\r\n\tgantt.event(document, \"webkitfullscreenchange\", onFullScreenChange);\r\n\tgantt.event(document, \"mozfullscreenchange\", onFullScreenChange);\r\n\tgantt.event(document, \"MSFullscreenChange\", onFullScreenChange);\r\n\t// For IE on Win 10\r\n\tgantt.event(document, \"fullscreenChange\", onFullScreenChange);\r\n\tgantt.event(document, \"fullscreenchange\", onFullScreenChange);\r\n}\r\n\r\nlet expandGantt = false;\r\nfunction onFullScreenChange() {\r\n\tif (!gantt.$container) {\r\n\t\t// do nothing if gantt is not yet initialized\r\n\t\treturn;\r\n\t}\r\n\tlet event: \"onExpand\" | \"onCollapse\";\r\n\tconst isBodyExpanded = isExpanded();\r\n\r\n\tif (isBodyExpanded) {\r\n\t\tif (expandGantt) {\r\n\t\t\tevent = \"onExpand\";\r\n\t\t\tsetFullScreenSizes();\r\n\t\t}\r\n\t} else if (expandGantt) {\r\n\t\texpandGantt = false;\r\n\t\tevent = \"onCollapse\";\r\n\t\trestoreSizes();\r\n\t}\r\n\tsetTimeout(() => {\r\n\t\tgantt.render();\r\n\t});\r\n\tsetTimeout(() => {\r\n\t\tgantt.callEvent(event, [gantt.ext.fullscreen.getFullscreenElement()]);\r\n\t});\r\n}\r\n\r\nfunction cantFullscreen() {\r\n\tif (!gantt.$container) { // check is gantt initialized or not\r\n\t\treturn true;\r\n\t}\r\n\tif (!gantt.ext.fullscreen.getFullscreenElement()) {\r\n\t\treturn true;\r\n\t}\r\n\tif (!isFullscreenAvailable()) {\r\n\t\t// eslint-disable-next-line no-console\r\n\t\tconst method = (console as IConsole).warning || console.log;\r\n\t\tmethod(\"The `fullscreen` feature not being allowed, or full-screen mode not being supported\");\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\ngantt.ext.fullscreen = {\r\n\texpand(): void {\r\n\t\tif (cantFullscreen()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (isExpanded()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!gantt.callEvent(\"onBeforeExpand\", [this.getFullscreenElement()])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\texpandGantt = true;\r\n\r\n\t\t// we switch body to fullscreen and then expand fullscreen element to viewport\r\n\t\t// we do it to correct display common elements: lightboxes, tooltip etc.\r\n\t\tconst element = document.body as IBody;\r\n\t\tconst requestArguments = element.webkitRequestFullscreen ?\r\n\t\t\t[(Element as unknown as IElement).ALLOW_KEYBOARD_INPUT] : [];\r\n\r\n\t\tconst requestFullscreen = element.msRequestFullscreen ||\r\n\t\t\telement.mozRequestFullScreen ||\r\n\t\t\telement.webkitRequestFullscreen ||\r\n\t\t\telement.requestFullscreen;\r\n\r\n\t\tif (requestFullscreen) {\r\n\t\t\trequestFullscreen.apply(element, requestArguments);\r\n\t\t}\r\n\t},\r\n\tcollapse(): void {\r\n\t\tif (cantFullscreen()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!isExpanded()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!gantt.callEvent(\"onBeforeCollapse\", [this.getFullscreenElement()])) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst requestExitFullscreen = (document as IDocument).msExitFullscreen ||\r\n\t\t\t(document as IDocument).mozCancelFullScreen ||\r\n\t\t\t(document as IDocument).webkitExitFullscreen ||\r\n\t\t\t(document as IDocument).exitFullscreen;\r\n\r\n\t\tif (requestExitFullscreen) {\r\n\t\t\trequestExitFullscreen.apply(document);\r\n\t\t}\r\n\t},\r\n\ttoggle(): void {\r\n\t\tif (cantFullscreen()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!isExpanded()) {\r\n\t\t\tthis.expand();\r\n\t\t} else {\r\n\t\t\tthis.collapse();\r\n\t\t}\r\n\r\n\t},\r\n\tgetFullscreenElement(): HTMLElement {\r\n\t\treturn gantt.$root;\r\n\t}\r\n};\r\n\r\ngantt.expand = function() {\r\n\tgantt.ext.fullscreen.expand();\r\n};\r\n\r\ngantt.collapse = function(){\r\n\tgantt.ext.fullscreen.collapse();\r\n};\r\n\r\ngantt.attachEvent(\"onGanttReady\", addDOMEvents);\r\n\r\n}","import eventable from \"../utils/eventable\";\r\nimport * as domHelpers from \"../core/ui/utils/dom_helpers\";\r\n\r\nimport keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport gantt_node from \"./keyboard_navigation/elements/gantt_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport task_row from \"./keyboard_navigation/elements/task_row\";\r\nimport task_cell from \"./keyboard_navigation/elements/task_cell\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\n\r\n\r\n\r\nexport default function(gantt){\r\n\tfunction setupKeyNav(gantt){\r\n\t\tgantt.config.keyboard_navigation = true;\r\n\t\tgantt.config.keyboard_navigation_cells = false;\r\n\r\n\t\tgantt.$keyboardNavigation = {};\r\n\r\n\t\tgantt._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(gantt);\r\n\t\teventhandler(gantt);\r\n\t\ttrap_modal_focus(gantt);\r\n\t\tgantt_node(gantt);\r\n\t\tnav_node(gantt);\r\n\t\theader_cell(gantt);\r\n\t\ttask_row(gantt);\r\n\t\ttask_cell(gantt);\r\n\t\tmodals(gantt);\r\n\t\tcore(gantt);\r\n\r\n\r\n\t\t(function(){\r\n\t\t\tvar dispatcher = gantt.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tdispatcher.isTaskFocused = function(id){\r\n\t\t\t\tvar node = dispatcher.activeNode;\r\n\t\t\t\tif(node instanceof gantt.$keyboardNavigation.TaskRow || node instanceof gantt.$keyboardNavigation.TaskCell) {\r\n\t\t\t\t\tif (node.taskId == id) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t};\r\n\r\n\t\t\tvar keyDownHandler = function(e){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return;\r\n\t\t\t\t// GS-734 & GS-1078: we don't need keyboard navigation inside inline editors\r\n\t\t\t\tif(!gantt.config.keyboard_navigation_cells && isInlineEditorCell(e)) return;\r\n\r\n\t\t\t\tif (isNoKeyboardNavigationElement(e) || isLightboxElement(e)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn dispatcher.keyDownHandler(e);\r\n\t\t\t};\r\n\r\n\t\t\tvar focusHandler = function(e){\r\n\t\t\t\tif(dispatcher.$preventDefault){\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tgantt.$container.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t// do nothing if key-nav focus is already planned\r\n\t\t\t\t} else if (!dispatcher.awaitsFocus()) {\r\n\t\t\t\t\t// otherwise - re-focus key-nav element on gantt focus\r\n\t\t\t\t\tdispatcher.focusGlobalNode();\r\n\t\t\t\t}\r\n\r\n\t\t\t};\r\n\r\n\t\t\tvar reFocusActiveNode = function(){\r\n\t\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tconst outsideGantt = !domHelpers.isChildOf(document.activeElement, gantt.$container) && document.activeElement.localName != \"body\";\r\n\t\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\t\tif(!activeNode || outsideGantt)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar domElement = activeNode.getNode();\r\n\t\t\t\tvar top, left;\r\n\t\t\t\tif(domElement && domElement.parentNode){\r\n\t\t\t\t\ttop = domElement.parentNode.scrollTop;\r\n\t\t\t\t\tleft = domElement.parentNode.scrollLeft;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tactiveNode.focus(true);\r\n\r\n\t\t\t\tif(domElement && domElement.parentNode){\r\n\t\t\t\t\tdomElement.parentNode.scrollTop = top;\r\n\t\t\t\t\tdomElement.parentNode.scrollLeft = left;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\r\n\t\t\tgantt.attachEvent(\"onDataRender\", function(){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return;\r\n\t\t\t\treFocusActiveNode();\r\n\t\t\t});\r\n\r\n\t\t\tgantt.attachEvent(\"onGanttRender\", function(){\r\n\t\t\t\tgantt.eventRemove(gantt.$root, \"keydown\", keyDownHandler);\r\n\t\t\t\tgantt.eventRemove(gantt.$container, \"focus\", focusHandler);\r\n\t\t\t\tgantt.eventRemove(gantt.$container, \"mousedown\", mousedownHandler);\r\n\r\n\t\t\t\tif(gantt.config.keyboard_navigation){\r\n\r\n\t\t\t\t\tgantt.event(gantt.$root, \"keydown\", keyDownHandler);\r\n\t\t\t\t\tgantt.event(gantt.$container, \"focus\", focusHandler);\r\n\t\t\t\t\tgantt.event(gantt.$container, \"mousedown\", mousedownHandler);\r\n\t\t\t\t\tgantt.$container.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tgantt.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfunction getTaskNodeConstructor(){\r\n\t\t\t\tif (gantt.config.keyboard_navigation_cells) {\r\n\t\t\t\t\treturn gantt.$keyboardNavigation.TaskCell;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn gantt.$keyboardNavigation.TaskRow;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction isInlineEditorCell(e){\r\n\t\t\t\treturn !!domHelpers.closest(e.target, \".gantt_grid_editor_placeholder\");\r\n\t\t\t}\r\n\t\t\t// GS-1445. Cancel keyboard navigation within custom elements\r\n\t\t\tfunction isNoKeyboardNavigationElement(e){\r\n\t\t\t\treturn !!domHelpers.closest(e.target, \".no_keyboard_navigation\");\r\n\t\t\t}\r\n\t\t\tfunction isLightboxElement(e){\r\n\t\t\t\treturn !!domHelpers.closest(e.target, \".gantt_cal_light\");\r\n\t\t\t}\r\n\r\n\t\t\tfunction mousedownHandler(e){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return true;\r\n\t\t\t\t// GS-734 & GS-1078: we don't need keyboard navigation inside inline editors\r\n\t\t\t\tif(!gantt.config.keyboard_navigation_cells && isInlineEditorCell(e)) return true;\r\n\r\n\t\t\t\tif (isNoKeyboardNavigationElement(e)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar focusNode;\r\n\t\t\t\tvar locateTask = dispatcher.fromDomElement(e);\r\n\t\t\t\tif(locateTask){\r\n\t\t\t\t\t//var node = getTaskNodeConstructor();\r\n\t\t\t\t\tif(dispatcher.activeNode instanceof gantt.$keyboardNavigation.TaskCell && domHelpers.isChildOf(e.target, gantt.$task)){\r\n\t\t\t\t\t\tlocateTask = new gantt.$keyboardNavigation.TaskCell(locateTask.taskId, dispatcher.activeNode.columnIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfocusNode = locateTask;\r\n\t\t\t\t}\r\n\t\t\t\tif (focusNode) {\r\n\t\t\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\t\t\tdispatcher.activeNode = focusNode;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// empty click should drop focus from gantt, insert of reselecting default node\r\n\t\t\t\t\tdispatcher.$preventDefault = true;\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tdispatcher.$preventDefault = false;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar onReady = gantt.attachEvent(\"onGanttReady\", function(){\r\n\t\t\t\t// restore focus on repainted tasks\r\n\t\t\t\tgantt.detachEvent(onReady);\r\n\r\n\t\t\t\tgantt.$data.tasksStore.attachEvent(\"onStoreUpdated\", function(id){\r\n\t\t\t\t\tif (gantt.config.keyboard_navigation && dispatcher.isEnabled()) {\r\n\t\t\t\t\t\tconst currentNode = dispatcher.getActiveNode();\r\n\t\t\t\t\t\tconst grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tconst top = grid.getItemTop(id);\r\n\t\t\t\t\t\tconst gridDataTopScroll = grid.$grid_data.scrollTop;\r\n\t\t\t\t\t\tconst gridDataBottomScroll = gridDataTopScroll + grid.$grid_data.getBoundingClientRect().height;\r\n\t\t\t\t\t\tif(currentNode && currentNode.taskId == id){\r\n\t\t\t\t\t\t\t// GS-2539: Don't refocus the node if it is selected and outside the visible range in the grid\r\n\t\t\t\t\t\t\tif(gridDataTopScroll <= top && gridDataBottomScroll >= top){\r\n\t\t\t\t\t\t\t\treFocusActiveNode();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(gantt._smart_render){\r\n\t\t\t\t\tvar updateRender = gantt._smart_render._redrawTasks;\r\n\t\t\t\t\tgantt._smart_render._redrawTasks = function(renderers, items){\r\n\t\t\t\t\t\tif(gantt.config.keyboard_navigation && dispatcher.isEnabled()){\r\n\t\t\t\t\t\t\tvar currentNode = dispatcher.getActiveNode();\r\n\t\t\t\t\t\t\tif(currentNode && currentNode.taskId !== undefined){\r\n\t\t\t\t\t\t\t\tvar focusedItemVisible = false;\r\n\t\t\t\t\t\t\t\tfor(var i = 0; i < items.length; i++){\r\n\t\t\t\t\t\t\t\t\tif(items[i].id == currentNode.taskId && items[i].start_date){\r\n\t\t\t\t\t\t\t\t\t\tfocusedItemVisible = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(!focusedItemVisible){\r\n\t\t\t\t\t\t\t\t\titems.push(gantt.getTask(currentNode.taskId));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar res = updateRender.apply(this, arguments);\r\n\r\n\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\r\n\t\t\tlet createdTaskId = null;\r\n\t\t\tlet keepFocusOnNewTask = false;\r\n\t\t\tgantt.attachEvent(\"onTaskCreated\", function (task) {\r\n\t\t\t\tcreatedTaskId = task.id;\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\r\n\t\t\tgantt.attachEvent(\"onAfterTaskAdd\", function(id,item){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return true;\r\n\t\t\t\tif(dispatcher.isEnabled()){\r\n\r\n\t\t\t\t\t// GS-1394. After adding a new task, the focus shouldn't change to the placeholder task\r\n\t\t\t\t\tif (id == createdTaskId) {\r\n\t\t\t\t\t\tkeepFocusOnNewTask = true;\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tkeepFocusOnNewTask = false;\r\n\t\t\t\t\t\t\tcreatedTaskId = null;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (keepFocusOnNewTask && item.type == gantt.config.types.placeholder) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar columnIndex = 0;\r\n\t\t\t\t\tvar node = dispatcher.activeNode;\r\n\t\t\t\t\tif(node instanceof gantt.$keyboardNavigation.TaskCell){\r\n\t\t\t\t\t\tcolumnIndex = node.columnIndex;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar nodeConstructor = getTaskNodeConstructor();\r\n\r\n\t\t\t\t\tif (item.type == gantt.config.types.placeholder && gantt.config.placeholder_task.focusOnCreate === false) {\r\n\t\t\t\t\t\t// do not focus on the placeholder task\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(new nodeConstructor(id, columnIndex));\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgantt.attachEvent(\"onTaskIdChange\", function(oldId, newId){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return true;\r\n\r\n\t\t\t\tvar node = dispatcher.activeNode;\r\n\t\t\t\tif(dispatcher.isTaskFocused(oldId)){\r\n\t\t\t\t\tnode.taskId = newId;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\r\n\t\t\tvar interval = setInterval(function(){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation) return;\r\n\t\t\t\tif(!dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}, 500);\r\n\r\n\t\t\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(interval);\r\n\t\t\t});\r\n\r\n\t\t\tfunction getScopeName(obj){\r\n\t\t\t\tif(obj instanceof gantt.$keyboardNavigation.GanttNode){\r\n\t\t\t\t\treturn \"gantt\";\r\n\t\t\t\t}else if(obj instanceof gantt.$keyboardNavigation.HeaderCell){\r\n\t\t\t\t\treturn \"headerCell\";\r\n\t\t\t\t}else if(obj instanceof gantt.$keyboardNavigation.TaskRow){\r\n\t\t\t\t\treturn \"taskRow\";\r\n\t\t\t\t}else if(obj instanceof gantt.$keyboardNavigation.TaskCell){\r\n\t\t\t\t\treturn \"taskCell\";\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tfunction getScope(mode){\r\n\t\t\t\tvar scopes = {\r\n\t\t\t\t\t\"gantt\":gantt.$keyboardNavigation.GanttNode,\r\n\t\t\t\t\t\"headerCell\": gantt.$keyboardNavigation.HeaderCell,\r\n\t\t\t\t\t\"taskRow\": gantt.$keyboardNavigation.TaskRow,\r\n\t\t\t\t\t\"taskCell\": gantt.$keyboardNavigation.TaskCell\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn scopes[mode] || scopes.gantt;\r\n\t\t\t}\r\n\r\n\t\t\tfunction findVisibleColumnIndex(columnName) {\r\n\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\tfor (var i = 0; i < columns.length; i++){\r\n\t\t\t\t\tif(columns[i].name == columnName){\r\n\t\t\t\t\t\treturn i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\r\n\t\t\tvar keyNavFacade = {};\r\n\t\t\teventable(keyNavFacade);\r\n\t\t\tgantt.mixin(keyNavFacade, {\r\n\t\t\t\taddShortcut: function(shortcut, handler, scope){\r\n\t\t\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\t\t\tif(scopeObject){\r\n\t\t\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tgetShortcutHandler: function(shortcut, scope){\r\n\t\t\t\t\tvar commands = gantt.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\t\tif(commands.length){\r\n\t\t\t\t\t\treturn keyNavFacade.getCommandHandler(commands[0], scope);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tgetCommandHandler: function(command, scope){\r\n\t\t\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\t\t\tif(scopeObject){\r\n\t\t\t\t\t\tif(command){\r\n\t\t\t\t\t\t\treturn scopeObject.prototype.findHandler(command);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tremoveShortcut: function(shortcut, scope){\r\n\t\t\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\t\t\tif(scopeObject){\r\n\t\t\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tfocus: function(config){\r\n\t\t\t\t\tvar type = config ? config.type : null;\r\n\t\t\t\t\tvar constructor = getScope(type);\r\n\t\t\t\t\tvar node;\r\n\t\t\t\t\tswitch (type){\r\n\t\t\t\t\t\tcase \"taskCell\":\r\n\t\t\t\t\t\t\tnode = new constructor(config.id, findVisibleColumnIndex(config.column));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"taskRow\":\r\n\t\t\t\t\t\t\tnode = new constructor(config.id);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"headerCell\":\r\n\t\t\t\t\t\t\tnode = new constructor(findVisibleColumnIndex(config.column));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdispatcher.delay(function(){\r\n\t\t\t\t\t\tif(node){\r\n\t\t\t\t\t\t\tdispatcher.setActiveNode(node);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\t\t\tif(!dispatcher.getActiveNode()){\r\n\r\n\t\t\t\t\t\t\t\tdispatcher.setDefaultNode();\r\n\t\t\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\t\t\tif(!dispatcher.awaitsFocus()){\r\n\t\t\t\t\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t});\r\n\t\t\t\t},\r\n\r\n\t\t\t\tgetActiveNode: function(){\r\n\t\t\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\t\t\tvar scope = getScopeName(node);\r\n\t\t\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\t\t\tswitch (scope){\r\n\t\t\t\t\t\t\tcase \"taskCell\":\r\n\t\t\t\t\t\t\t\treturn {type:\"taskCell\", id:node.taskId, column:columns[node.columnIndex].name};\r\n\t\t\t\t\t\t\tcase \"taskRow\":\r\n\t\t\t\t\t\t\t\treturn {type:\"taskRow\", id:node.taskId};\r\n\t\t\t\t\t\t\tcase \"headerCell\":\r\n\t\t\t\t\t\t\t\treturn {type:\"headerCell\", column:columns[node.index].name};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgantt.$keyboardNavigation.facade = keyNavFacade;\r\n\r\n\t\t\tgantt.ext.keyboardNavigation = keyNavFacade;\r\n\t\t\tgantt.focus = function(){\r\n\t\t\t\tkeyNavFacade.focus();\r\n\t\t\t};\r\n\t\t\tgantt.addShortcut = keyNavFacade.addShortcut;\r\n\t\t\tgantt.getShortcutHandler = keyNavFacade.getShortcutHandler;\r\n\t\t\tgantt.removeShortcut = keyNavFacade.removeShortcut;\r\n\t\t})();\r\n\r\n\r\n\t}\r\n\r\n\tsetupKeyNav(gantt);\r\n\r\n\r\n\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.shortcuts = {\r\n\t\tcreateCommand: function () {\r\n\t\t\treturn {\r\n\t\t\t\tmodifiers: {\r\n\t\t\t\t\t\"shift\": false,\r\n\t\t\t\t\t\"alt\": false,\r\n\t\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\t\"meta\": false\r\n\t\t\t\t},\r\n\t\t\t\tkeyCode: null\r\n\t\t\t};\r\n\t\t},\r\n\t\tparse: function (shortcut) {\r\n\t\t\tvar commands = [];\r\n\r\n\t\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\t\tfor (var i = 0; i < expr.length; i++) {\r\n\t\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\t\tfor (var j = 0; j < words.length; j++) {\r\n\t\t\t\t\tif (this.commandKeys[words[j]]) {\r\n\t\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t\t} else if (this.specialKeys[words[j]]) {\r\n\t\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcommands.push(command);\r\n\t\t\t}\r\n\t\t\treturn commands;\r\n\t\t},\r\n\r\n\t\tgetCommandFromEvent: function (domEvent) {\r\n\t\t\tvar command = this.createCommand();\r\n\t\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t\t}\r\n\r\n\t\t\tvar printableKey = String.fromCharCode(command.keyCode);\r\n\t\t\tif (printableKey) {\r\n\t\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t\t}\r\n\t\t\treturn command;\r\n\t\t},\r\n\r\n\t\tgetHashFromEvent: function (domEvent) {\r\n\t\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t\t},\r\n\r\n\t\tgetHash: function (command) {\r\n\t\t\tvar parts = [];\r\n\t\t\tfor (var i in command.modifiers) {\r\n\t\t\t\tif (command.modifiers[i]) {\r\n\t\t\t\t\tparts.push(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tparts.push(command.keyCode);\r\n\r\n\t\t\treturn parts.join(this.junctionChar);\r\n\t\t},\r\n\r\n\t\tgetExpressions: function (shortcut) {\r\n\t\t\treturn shortcut.split(this.junctionChar);\r\n\t\t},\r\n\t\tgetWords: function (term) {\r\n\t\t\treturn term.split(this.combinationChar);\r\n\t\t},\r\n\t\ttrim: function (shortcut) {\r\n\t\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t\t},\r\n\t\tjunctionChar: \",\",\r\n\t\tcombinationChar: \"+\",\r\n\t\tcommandKeys: {\r\n\t\t\t\"shift\": 16,\r\n\t\t\t\"alt\": 18,\r\n\t\t\t\"ctrl\": 17,\r\n\t\t\t\"meta\": true\r\n\t\t},\r\n\t\tspecialKeys: {\r\n\t\t\t\"backspace\": 8,\r\n\t\t\t\"tab\": 9,\r\n\t\t\t\"enter\": 13,\r\n\t\t\t\"esc\": 27,\r\n\t\t\t\"space\": 32,\r\n\t\t\t\"up\": 38,\r\n\t\t\t\"down\": 40,\r\n\t\t\t\"left\": 37,\r\n\t\t\t\"right\": 39,\r\n\t\t\t\"home\": 36,\r\n\t\t\t\"end\": 35,\r\n\t\t\t\"pageup\": 33,\r\n\t\t\t\"pagedown\": 34,\r\n\t\t\t\"delete\": 46,\r\n\t\t\t\"insert\": 45,\r\n\t\t\t\"plus\": 107,\r\n\t\t\t\"f1\": 112,\r\n\t\t\t\"f2\": 113,\r\n\t\t\t\"f3\": 114,\r\n\t\t\t\"f4\": 115,\r\n\t\t\t\"f5\": 116,\r\n\t\t\t\"f6\": 117,\r\n\t\t\t\"f7\": 118,\r\n\t\t\t\"f8\": 119,\r\n\t\t\t\"f9\": 120,\r\n\t\t\t\"f10\": 121,\r\n\t\t\t\"f11\": 122,\r\n\t\t\t\"f12\": 123\r\n\t\t}\r\n\t};\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.EventHandler = {\r\n\t\t_handlers: null,\r\n\t\tfindHandler: function (command) {\r\n\t\t\tif (!this._handlers) this._handlers = {};\r\n\t\t\tvar shortcuts = gantt.$keyboardNavigation.shortcuts;\r\n\t\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\t\treturn this._handlers[hash];\r\n\t\t},\r\n\r\n\t\tdoAction: function (command, e) {\r\n\t\t\tvar handler = this.findHandler(command);\r\n\t\t\tif (handler) {\r\n\t\t\t\tvar eventFacade = gantt.$keyboardNavigation.facade;\r\n\r\n\t\t\t\tif(eventFacade.callEvent(\"onBeforeAction\", [command, e]) === false){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\thandler.call(this, e);\r\n\r\n\t\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\t\telse e.returnValue = false;\r\n\r\n\t\t\t}\r\n\t\t},\r\n\t\tbind: function (shortcut, handler) {\r\n\t\t\tif (!this._handlers) this._handlers = {};\r\n\r\n\t\t\tvar shortcuts = gantt.$keyboardNavigation.shortcuts;\r\n\r\n\t\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\t\tfor (var i = 0; i < commands.length; i++) {\r\n\t\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t\t}\r\n\t\t},\r\n\t\tunbind: function (shortcut) {\r\n\t\t\tvar shortcuts = gantt.$keyboardNavigation.shortcuts;\r\n\r\n\t\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\t\tfor (var i = 0; i < commands.length; i++) {\r\n\t\t\t\tif (this._handlers[shortcuts.getHash(commands[i])]) {\r\n\t\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tbindAll: function (map) {\r\n\t\t\tfor (var i in map) {\r\n\t\t\t\tthis.bind(i, map[i]);\r\n\t\t\t}\r\n\t\t},\r\n\t\tinitKeys: function () {\r\n\t\t\tif (!this._handlers)\r\n\t\t\t\tthis._handlers = {};\r\n\t\t\tif (this.keys) {\r\n\t\t\t\tthis.bindAll(this.keys);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n};","import * as domHelpers from \"../../../core/ui/utils/dom_helpers\";\r\n\r\nexport default function(gantt) {\r\n\r\n\t(function () {\r\n\t\t\r\n\t\tgantt.$keyboardNavigation.getFocusableNodes = domHelpers.getFocusableNodes;\r\n\r\n\t\tgantt.$keyboardNavigation.trapFocus = function trapFocus(root, e) {\r\n\t\t\tif (e.keyCode != 9) return false;\r\n\r\n\t\t\tvar focusable = gantt.$keyboardNavigation.getFocusableNodes(root);\r\n\t\t\tvar currentFocus = domHelpers.getActiveElement();\r\n\t\t\tvar currentIndex = -1;\r\n\t\t\tfor (var i = 0; i < focusable.length; i++) {\r\n\t\t\t\tif (focusable[i] == currentFocus) {\r\n\t\t\t\t\tcurrentIndex = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (e.shiftKey) {\r\n\t\t\t\t// back tab\r\n\t\t\t\tif (currentIndex <= 0) {\r\n\t\t\t\t\t// go to the last element if we focused on the first\r\n\t\t\t\t\tvar lastItem = focusable[focusable.length - 1];\r\n\t\t\t\t\tif (lastItem) {\r\n\t\t\t\t\t\tlastItem.focus();\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// forward tab\r\n\t\t\t\tif (currentIndex >= focusable.length - 1) {\r\n\t\t\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\t\t\tvar firstItem = focusable[0];\r\n\t\t\t\t\tif (firstItem) {\r\n\t\t\t\t\t\tfirstItem.focus();\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t};\r\n\t})();\r\n\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.GanttNode = function () {\r\n\t};\r\n\r\n\tgantt.$keyboardNavigation.GanttNode.prototype = gantt._compose(\r\n\t\tgantt.$keyboardNavigation.EventHandler,\r\n\t\t{\r\n\r\n\t\t\tfocus: function () {\r\n\t\t\t\tgantt.focus();\r\n\t\t\t},\r\n\r\n\t\t\tblur: function () {\r\n\r\n\t\t\t},\r\n\r\n\t\t\tisEnabled: function () {\r\n\t\t\t\treturn gantt.$container.hasAttribute(\"tabindex\");\r\n\t\t\t},\r\n\r\n\t\t\tscrollHorizontal: function scrollHorizontal(dir) {\r\n\t\t\t\tvar date = gantt.dateFromPos(gantt.getScrollState().x);\r\n\t\t\t\tvar scale = gantt.getScale();\r\n\t\t\t\tvar step = dir < 0 ? -scale.step : scale.step;\r\n\t\t\t\tdate = gantt.date.add(date, step, scale.unit);\r\n\t\t\t\tgantt.scrollTo(gantt.posFromDate(date));\r\n\t\t\t},\r\n\r\n\t\t\tscrollVertical: function scrollVertical(dir) {\r\n\t\t\t\tvar top = gantt.getScrollState().y;\r\n\t\t\t\tvar step = gantt.config.row_height;\r\n\t\t\t\tgantt.scrollTo(null, top + (dir < 0 ? -1 : 1) * step);\r\n\t\t\t},\r\n\r\n\t\t\tkeys: {\r\n\t\t\t\t\"alt+left\": function (e) {\r\n\t\t\t\t\tthis.scrollHorizontal(-1);\r\n\t\t\t\t},\r\n\t\t\t\t\"alt+right\": function (e) {\r\n\t\t\t\t\tthis.scrollHorizontal(1);\r\n\t\t\t\t},\r\n\t\t\t\t\"alt+up\": function (e) {\r\n\t\t\t\t\tthis.scrollVertical(-1);\r\n\t\t\t\t},\r\n\t\t\t\t\"alt+down\": function (e) {\r\n\t\t\t\t\tthis.scrollVertical(1);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// undo\r\n\t\t\t\t\"ctrl+z\": function () {\r\n\t\t\t\t\tif (gantt.undo) gantt.undo();\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// redo\r\n\t\t\t\t\"ctrl+r\": function () {\r\n\t\t\t\t\tif (gantt.redo) gantt.redo();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n\tgantt.$keyboardNavigation.GanttNode.prototype.bindAll(gantt.$keyboardNavigation.GanttNode.prototype.keys);\r\n\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.KeyNavNode = function () {\r\n\t};\r\n\r\n\tgantt.$keyboardNavigation.KeyNavNode.prototype = gantt._compose(\r\n\t\tgantt.$keyboardNavigation.EventHandler,\r\n\t\t{\r\n\t\t\tisValid: function () {\r\n\t\t\t\treturn true;\r\n\t\t\t},\r\n\t\t\tfallback: function () {\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\r\n\t\t\tmoveTo: function (element) {\r\n\t\t\t\tgantt.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t\t},\r\n\r\n\t\t\tcompareTo: function (b) {\r\n\t\t\t\t// good enough comparison of two random objects\r\n\t\t\t\tif (!b) return false;\r\n\t\t\t\tfor (var i in this) {\r\n\t\t\t\t\tif (!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\t\tif (canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\t\tif (!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\t\tif (b[i] != this[i]) return false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t},\r\n\r\n\t\t\tgetNode: function () {\r\n\t\t\t},\r\n\t\t\tfocus: function () {\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(!node)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar eventFacade = gantt.$keyboardNavigation.facade;\r\n\r\n\t\t\t\tif(eventFacade.callEvent(\"onBeforeFocus\", [node]) === false){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node) {\r\n\t\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t\tif(!node.$eventAttached){\r\n\t\t\t\t\t\tnode.$eventAttached = true;\r\n\t\t\t\t\t\tgantt.event(node, \"focus\",function(e){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//node.className += \" gantt_focused\";\r\n\t\t\t\t\tif (gantt.utils.dom.isChildOf(document.activeElement, node)){\r\n\t\t\t\t\t\tnode = document.activeElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (node.focus) node.focus();\r\n\r\n\t\t\t\t\teventFacade.callEvent(\"onFocus\", [this.getNode()]);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\tblur: function () {\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif (node) {\r\n\t\t\t\t\tvar eventFacade = gantt.$keyboardNavigation.facade;\r\n\t\t\t\t\teventFacade.callEvent(\"onBlur\", [node]);\r\n\t\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t\t//node.className = (node.className || \"\").replace(/ ?gantt_focused/g, \"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n};","import * as domHelpers from \"../../../core/ui/utils/dom_helpers\";\r\n\r\nexport default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.HeaderCell = function (index) {\r\n\t\tthis.index = index || 0;\r\n\t};\r\n\r\n\tgantt.$keyboardNavigation.HeaderCell.prototype = gantt._compose(\r\n\t\tgantt.$keyboardNavigation.KeyNavNode,\r\n\t\t{\r\n\t\t\t_handlers: null,\r\n\r\n\t\t\tisValid: function () {\r\n\t\t\t\tif (!gantt.config.show_grid) {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn !!gantt.getGridColumns()[this.index] || !gantt.getVisibleTaskCount();\r\n\t\t\t},\r\n\t\t\tfallback: function () {\r\n\t\t\t\tif (!gantt.config.show_grid) {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\t\treturn new gantt.$keyboardNavigation.TaskRow();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t\tvar visibleColumns = gantt.getGridColumns();\r\n\t\t\t\tvar index = this.index;\r\n\t\t\t\twhile (index >= 0) {\r\n\t\t\t\t\tif (visibleColumns[index])\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tindex--;\r\n\t\t\t\t}\r\n\t\t\t\tif (visibleColumns[index]) {\r\n\t\t\t\t\treturn new gantt.$keyboardNavigation.HeaderCell(index);\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tfromDomElement: function(el){\r\n\t\t\t\tvar cellElement = domHelpers.locateClassName(el, \"gantt_grid_head_cell\");\r\n\t\t\t\tif(cellElement){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\twhile(cellElement && cellElement.previousSibling){\r\n\t\t\t\t\t\tcellElement = cellElement.previousSibling;\r\n\t\t\t\t\t\tindex += 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn new gantt.$keyboardNavigation.HeaderCell(index);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tgetNode: function () {\r\n\t\t\t\tvar cells = gantt.$grid_scale.childNodes;\r\n\t\t\t\treturn cells[this.index];\r\n\t\t\t},\r\n\r\n\r\n\t\t\tkeys: {\r\n\r\n\t\t\t\t\"left\": function () {\r\n\t\t\t\t\tif (this.index > 0) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.HeaderCell(this.index - 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"right\": function () {\r\n\t\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\t\tif (this.index < columns.length - 1) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.HeaderCell(this.index + 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"down\": function () {\r\n\t\t\t\t\tvar taskRow;\r\n\t\t\t\t\tvar rootLevel = gantt.getChildren(gantt.config.root_id);\r\n\t\t\t\t\tif (gantt.isTaskExists(rootLevel[0])) {\r\n\t\t\t\t\t\ttaskRow = rootLevel[0];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (taskRow) {\r\n\t\t\t\t\t\tif (gantt.config.keyboard_navigation_cells) {\r\n\t\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(taskRow, this.index));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskRow(taskRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t\"end\": function () {\r\n\t\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.HeaderCell(columns.length - 1));\r\n\t\t\t\t},\r\n\t\t\t\t\"home\": function () {\r\n\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.HeaderCell(0));\r\n\t\t\t\t},\r\n\r\n\r\n\t\t\t\t// press header button\r\n\t\t\t\t\"enter, space\": function () {\r\n\t\t\t\t\tvar node = domHelpers.getActiveElement();\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// add new task\r\n\t\t\t\t\"ctrl+enter\": function () {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt.createTask({}, this.taskId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n\tgantt.$keyboardNavigation.HeaderCell.prototype.bindAll(gantt.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.TaskRow = function (taskId) {\r\n\t\tif (!taskId) {\r\n\t\t\tvar rootLevel = gantt.getChildren(gantt.config.root_id);\r\n\t\t\tif (rootLevel[0]) {\r\n\t\t\t\ttaskId = rootLevel[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.taskId = taskId;\r\n\t\tif (gantt.isTaskExists(this.taskId)) {\r\n\t\t\tthis.index = gantt.getTaskIndex(this.taskId);\r\n\t\t\tthis.globalIndex = gantt.getGlobalTaskIndex(this.taskId);\r\n\t\t\tthis.splitItem = !!gantt.getTask(this.taskId).$split_subtask;\r\n\t\t\tthis.parentId = gantt.getParent(this.taskId);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.$keyboardNavigation.TaskRow.prototype = gantt._compose(\r\n\t\tgantt.$keyboardNavigation.KeyNavNode,\r\n\t\t{\r\n\t\t\t_handlers: null,\r\n\t\t\tisValid: function () {\r\n\t\t\t\treturn gantt.isTaskExists(this.taskId) && (gantt.getTaskIndex(this.taskId) > -1);\r\n\t\t\t},\r\n\t\t\tfallback: function () {\r\n\t\t\t\tif (!gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\tvar header = new gantt.$keyboardNavigation.HeaderCell();\r\n\t\t\t\t\tif (!header.isValid()) return null;\r\n\t\t\t\t\telse return header;\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(!this.splitItem){\r\n\t\t\t\t\t\tvar nextIndex = -1;\r\n\t\t\t\t\t\t// GS-1393. When Gantt tries to restore the focus, it should rely on the global index\r\n\t\t\t\t\t\tif (gantt.getTaskByIndex(this.globalIndex - 1)) {\r\n\t\t\t\t\t\t\tnextIndex = this.globalIndex - 1;\r\n\t\t\t\t\t\t} else if (gantt.getTaskByIndex(this.globalIndex + 1)) {\r\n\t\t\t\t\t\t\tnextIndex = this.globalIndex + 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvar globalIndex = this.globalIndex;\r\n\t\t\t\t\t\t\twhile (globalIndex >= 0) {\r\n\t\t\t\t\t\t\t\tif (gantt.getTaskByIndex(globalIndex)) {\r\n\t\t\t\t\t\t\t\t\tnextIndex = globalIndex;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tglobalIndex--;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (nextIndex > -1) {\r\n\t\t\t\t\t\t\treturn new gantt.$keyboardNavigation.TaskRow(gantt.getTaskByIndex(nextIndex).id);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\treturn new gantt.$keyboardNavigation.TaskRow(this.parentId);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tfromDomElement: function(el){\r\n\t\t\t\tif(gantt.config.keyboard_navigation_cells){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar taskId = gantt.locate(el);\r\n\t\t\t\tif(gantt.isTaskExists(taskId)){\r\n\t\t\t\t\treturn new gantt.$keyboardNavigation.TaskRow(taskId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tgetNode: function () {\r\n\t\t\t\tif (gantt.isTaskExists(this.taskId) && gantt.isTaskVisible(this.taskId)) {\r\n\t\t\t\t\tif (gantt.config.show_grid) {\r\n\t\t\t\t\t\treturn gantt.$grid.querySelector(\".gantt_row[\" + gantt.config.task_attribute + \"='\" + this.taskId + \"']\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn gantt.getTaskNode(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tfocus: function (keptFocus) {\r\n\t\t\t\tif(!keptFocus) {\r\n\t\t\t\t\tconst pos = gantt.getTaskPosition(gantt.getTask(this.taskId));\r\n\t\t\t\t\tconst height = gantt.getTaskHeight(this.taskId);\r\n\t\t\t\t\tconst scroll = gantt.getScrollState();\r\n\r\n\t\t\t\t\tlet viewWidth;\r\n\t\t\t\t\tif(gantt.$task){\r\n\t\t\t\t\t\tviewWidth = gantt.$task.offsetWidth;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tviewWidth = scroll.inner_width;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet viewHeight;\r\n\t\t\t\t\tif(gantt.$grid_data || gantt.$task_data){\r\n\t\t\t\t\t\tviewHeight = (gantt.$grid_data || gantt.$task_data).offsetHeight;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tviewHeight = scroll.inner_height;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (pos.top < scroll.y || pos.top + height > (scroll.y + viewHeight)) {\r\n\t\t\t\t\t\t// GS-2346: additional scrolling to be sure that the task will be in the required range\r\n\t\t\t\t\t\tgantt.scrollTo(null, pos.top - 20);\r\n\t\t\t\t\t} else if (gantt.config.scroll_on_click && gantt.config.show_chart) {\r\n\t\t\t\t\t\t// horizontal scroll activated\r\n\t\t\t\t\t\tif (pos.left > (scroll.x + viewWidth)) { // scroll forward to the start of the task\r\n\t\t\t\t\t\t\tgantt.scrollTo(pos.left - gantt.config.task_scroll_offset);\r\n\t\t\t\t\t\t} else if (pos.left + pos.width < scroll.x) { // scroll back to the end of the task\r\n\t\t\t\t\t\t\tgantt.scrollTo(pos.left + pos.width - gantt.config.task_scroll_offset);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgantt.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this, [keptFocus]);\r\n\r\n\t\t\t\t// GS-152 if there are scrollbars with custom names, change their scroll position\r\n\t\t\t\tscrollGrid();\r\n\r\n\t\t\t\tfunction scrollGrid() {\r\n\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\tvar scrollPositionX = parseInt(grid.$grid.scrollLeft);\r\n\t\t\t\t\tvar scrollPositionY = parseInt(grid.$grid_data.scrollTop);\r\n\r\n\t\t\t\t\tvar attachedScrollbarHorizontal = grid.$config.scrollX;\r\n\r\n\t\t\t\t\tif (attachedScrollbarHorizontal && grid.$config.scrollable) {\r\n\t\t\t\t\t\tvar scrollbarHorizontal = gantt.$ui.getView(attachedScrollbarHorizontal);\r\n\t\t\t\t\t\tif (scrollbarHorizontal) {\r\n\t\t\t\t\t\t\tscrollbarHorizontal.scrollTo(scrollPositionX, scrollPositionY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar attachedScrollbarVertical = grid.$config.scrollY;\r\n\r\n\t\t\t\t\tif (attachedScrollbarVertical) {\r\n\t\t\t\t\t\tvar scrollbarVertical = gantt.$ui.getView(attachedScrollbarVertical);\r\n\t\t\t\t\t\tif (scrollbarVertical) {\r\n\t\t\t\t\t\t\tscrollbarVertical.scrollTo(scrollPositionX, scrollPositionY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\tkeys: {\r\n\t\t\t\t\"pagedown\": function () {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskRow(gantt.getTaskByIndex(gantt.getVisibleTaskCount() - 1).id));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"pageup\": function () {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskRow(gantt.getTaskByIndex(0).id));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"up\": function () {\r\n\t\t\t\t\tvar nextElement = null;\r\n\t\t\t\t\tvar prevTask = gantt.getPrev(this.taskId);\r\n\t\t\t\t\tif (!gantt.isTaskExists(prevTask)) {\r\n\t\t\t\t\t\tnextElement = new gantt.$keyboardNavigation.HeaderCell();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnextElement = new gantt.$keyboardNavigation.TaskRow(prevTask);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(nextElement);\r\n\t\t\t\t},\r\n\t\t\t\t\"down\": function () {\r\n\t\t\t\t\tvar nextTask = gantt.getNext(this.taskId);\r\n\t\t\t\t\tif (gantt.isTaskExists(nextTask)) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskRow(nextTask));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t\"shift+down\": function(){\r\n\t\t\t\t\tif(gantt.hasChild(this.taskId) && !gantt.getTask(this.taskId).$open){\r\n\t\t\t\t\t\tgantt.open(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"shift+up\": function(){\r\n\t\t\t\t\tif(gantt.hasChild(this.taskId) && gantt.getTask(this.taskId).$open){\r\n\t\t\t\t\t\tgantt.close(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"shift+right\": function() {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar prevId = gantt.getPrevSibling(this.taskId);\r\n\t\t\t\t\tif(gantt.isTaskExists(prevId) && !gantt.isChildOf(this.taskId, prevId)){\r\n\t\t\t\t\t\tvar parent = gantt.getTask(prevId);\r\n\t\t\t\t\t\tparent.$open = true;\r\n\t\t\t\t\t\tvar result = gantt.moveTask(this.taskId, -1, prevId);\r\n\t\t\t\t\t\tif(result !== false)\r\n\t\t\t\t\t\t\tgantt.updateTask(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"shift+left\": function() {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar parent = gantt.getParent(this.taskId);\r\n\t\t\t\t\tif(gantt.isTaskExists(parent)){\r\n\t\t\t\t\t\tvar result = gantt.moveTask(this.taskId, gantt.getTaskIndex(parent) + 1, gantt.getParent(parent));\r\n\t\t\t\t\t\tif(result !== false)\r\n\t\t\t\t\t\t\tgantt.updateTask(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// select\r\n\t\t\t\t\"space\": function (e) {\r\n\t\t\t\t\tif (!gantt.isSelectedTask(this.taskId)) {\r\n\t\t\t\t\t\tgantt.selectTask(this.taskId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tgantt.unselectTask(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// collapse\r\n\t\t\t\t\"ctrl+left\": function (e) {\r\n\t\t\t\t\tgantt.close(this.taskId);\r\n\t\t\t\t},\r\n\t\t\t\t// expand\r\n\t\t\t\t\"ctrl+right\": function (e) {\r\n\t\t\t\t\tgantt.open(this.taskId);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// delete task\r\n\t\t\t\t\"delete\": function (e) {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt.$click.buttons[\"delete\"](this.taskId);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// open lightbox\r\n\t\t\t\t\"enter\": function () {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt.showLightbox(this.taskId);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t// add subtask\r\n\t\t\t\t\"ctrl+enter\": function () {\r\n\t\t\t\t\tif (gantt.isReadonly(this)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt.createTask({}, this.taskId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\tgantt.$keyboardNavigation.TaskRow.prototype.bindAll(gantt.$keyboardNavigation.TaskRow.prototype.keys);\r\n\r\n};","import * as domHelpers from \"../../../core/ui/utils/dom_helpers\";\r\nimport {replaceValidZeroId} from \"../../../utils/helpers\";\r\n\r\nexport default function(gantt) {\r\n\r\n\r\n\tgantt.$keyboardNavigation.TaskCell = function (taskId, index) {\r\n\t\ttaskId = replaceValidZeroId(taskId, gantt.config.root_id);\r\n\t\tif (!taskId) {\r\n\t\t\tvar rootLevel = gantt.getChildren(gantt.config.root_id);\r\n\t\t\tif (rootLevel[0]) {\r\n\t\t\t\ttaskId = rootLevel[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.taskId = taskId;\r\n\t\tthis.columnIndex = index || 0;\r\n\t\t// provided task may not exist, in this case node will be detectes as invalid\r\n\t\tif (gantt.isTaskExists(this.taskId)) {\r\n\t\t\tthis.index = gantt.getTaskIndex(this.taskId);\r\n\t\t\tthis.globalIndex = gantt.getGlobalTaskIndex(this.taskId);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.$keyboardNavigation.TaskCell.prototype = gantt._compose(\r\n\t\tgantt.$keyboardNavigation.TaskRow,\r\n\t\t{\r\n\t\t\t_handlers: null,\r\n\t\t\tisValid: function () {\r\n\r\n\t\t\t\treturn gantt.$keyboardNavigation.TaskRow.prototype.isValid.call(this) && !!gantt.getGridColumns()[this.columnIndex];\r\n\t\t\t},\r\n\t\t\tfallback: function () {\r\n\r\n\t\t\t\tvar node = gantt.$keyboardNavigation.TaskRow.prototype.fallback.call(this);\r\n\t\t\t\tvar result = node;\r\n\t\t\t\tif (node instanceof gantt.$keyboardNavigation.TaskRow) {\r\n\t\t\t\t\tvar visibleColumns = gantt.getGridColumns();\r\n\t\t\t\t\tvar index = this.columnIndex;\r\n\t\t\t\t\twhile (index >= 0) {\r\n\t\t\t\t\t\tif (visibleColumns[index])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (visibleColumns[index]) {\r\n\t\t\t\t\t\tresult = new gantt.$keyboardNavigation.TaskCell(node.taskId, index);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t},\r\n\r\n\t\t\tfromDomElement: function(el){\r\n\t\t\t\tif(!gantt.config.keyboard_navigation_cells){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar taskId = gantt.locate(el);\r\n\t\t\t\tif(gantt.isTaskExists(taskId)){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tvar cellElement = domHelpers.locateAttribute(el, \"data-column-index\");\r\n\r\n\t\t\t\t\tif(cellElement){\r\n\t\t\t\t\t\tindex = cellElement.getAttribute(\"data-column-index\")*1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn new gantt.$keyboardNavigation.TaskCell(taskId, index);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tgetNode: function () {\r\n\t\t\t\tif (gantt.isTaskExists(this.taskId) && gantt.isTaskVisible(this.taskId)) {\r\n\t\t\t\t\tif (gantt.config.show_grid) {\r\n\t\t\t\t\t\tvar row = gantt.$grid.querySelector(\".gantt_row[\" + gantt.config.task_attribute + \"='\" + this.taskId + \"']\");\r\n\t\t\t\t\t\tif(!row)\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\treturn row.querySelector(\"[data-column-index='\"+this.columnIndex+\"']\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn gantt.getTaskNode(this.taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tkeys: {\r\n\t\t\t\t\"up\": function () {\r\n\r\n\t\t\t\t\tvar nextElement = null;\r\n\t\t\t\t\tvar prevTask = gantt.getPrev(this.taskId);\r\n\t\t\t\t\tif (!gantt.isTaskExists(prevTask)) {\r\n\t\t\t\t\t\tnextElement = new gantt.$keyboardNavigation.HeaderCell(this.columnIndex);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnextElement = new gantt.$keyboardNavigation.TaskCell(prevTask, this.columnIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(nextElement);\r\n\t\t\t\t},\r\n\t\t\t\t\"down\": function () {\r\n\t\t\t\t\tvar nextTask = gantt.getNext(this.taskId);\r\n\t\t\t\t\tif (gantt.isTaskExists(nextTask)) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(nextTask, this.columnIndex));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"left\": function () {\r\n\t\t\t\t\tif (this.columnIndex > 0) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(this.taskId, this.columnIndex - 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"right\": function () {\r\n\t\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\t\tif (this.columnIndex < columns.length - 1) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(this.taskId, this.columnIndex + 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\t\"end\": function () {\r\n\t\t\t\t\tvar columns = gantt.getGridColumns();\r\n\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(this.taskId, columns.length - 1));\r\n\t\t\t\t},\r\n\t\t\t\t\"home\": function () {\r\n\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(this.taskId, 0));\r\n\t\t\t\t},\r\n\t\t\t\t\"pagedown\": function () {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(gantt.getTaskByIndex(gantt.getVisibleTaskCount() - 1).id, this.columnIndex));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"pageup\": function () {\r\n\t\t\t\t\tif (gantt.getVisibleTaskCount()) {\r\n\t\t\t\t\t\tthis.moveTo(new gantt.$keyboardNavigation.TaskCell(gantt.getTaskByIndex(0).id, this.columnIndex));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\r\n\r\n\tgantt.$keyboardNavigation.TaskCell.prototype.bindAll(gantt.$keyboardNavigation.TaskRow.prototype.keys);\r\n\tgantt.$keyboardNavigation.TaskCell.prototype.bindAll(gantt.$keyboardNavigation.TaskCell.prototype.keys);\r\n\r\n};","export default function(gantt) {\r\n\r\n\tgantt.$keyboardNavigation.dispatcher = {\r\n\t\tisActive: false,\r\n\t\tactiveNode: null,\r\n\t\tglobalNode: new gantt.$keyboardNavigation.GanttNode(),\r\n\r\n\t\tenable: function () {\r\n\t\t\tthis.isActive = true;\r\n\t\t\tthis.setActiveNode(this.getActiveNode());\r\n\t\t},\r\n\r\n\t\tdisable: function () {\r\n\t\t\tthis.isActive = false;\r\n\t\t},\r\n\r\n\t\tisEnabled: function () {\r\n\t\t\treturn !!this.isActive;\r\n\t\t},\r\n\r\n\t\tgetDefaultNode: function () {\r\n\t\t\tvar node;\r\n\t\t\tif (gantt.config.keyboard_navigation_cells) {\r\n\t\t\t\tnode = new gantt.$keyboardNavigation.TaskCell();\r\n\t\t\t} else {\r\n\t\t\t\tnode = new gantt.$keyboardNavigation.TaskRow();\r\n\t\t\t}\r\n\r\n\t\t\tif (!node.isValid()) {\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\tsetDefaultNode: function () {\r\n\t\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t\t},\r\n\r\n\t\tgetActiveNode: function () {\r\n\t\t\tvar node = this.activeNode;\r\n\t\t\tif (node && !node.isValid()) {\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\tfromDomElement: function(e){\r\n\t\t\tvar inputs = [\r\n\t\t\t\tgantt.$keyboardNavigation.TaskRow,\r\n\t\t\t\tgantt.$keyboardNavigation.TaskCell,\r\n\t\t\t\tgantt.$keyboardNavigation.HeaderCell\r\n\t\t\t];\r\n\t\t\tfor(var i = 0; i < inputs.length; i++){\r\n\t\t\t\tif(inputs[i].prototype.fromDomElement){\r\n\t\t\t\t\tvar node = inputs[i].prototype.fromDomElement(e);\r\n\t\t\t\t\tif(node) return node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tfocusGlobalNode: function () {\r\n\t\t\tthis.blurNode(this.globalNode);\r\n\t\t\tthis.focusNode(this.globalNode);\r\n\t\t},\r\n\r\n\t\tsetActiveNode: function (el) {\r\n\t\t\t//console.trace()\r\n\t\t\tvar focusChanged = true;\r\n\t\t\tif (this.activeNode) {\r\n\t\t\t\tif (this.activeNode.compareTo(el)) {\r\n\t\t\t\t\tfocusChanged = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.isEnabled()) {\r\n\t\t\t\tif(focusChanged)\r\n\t\t\t\t\tthis.blurNode(this.activeNode);\r\n\r\n\t\t\t\tthis.activeNode = el;\r\n\t\t\t\tthis.focusNode(this.activeNode, !focusChanged);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocusNode: function (el, keptFocus) {\r\n\t\t\tif (el && el.focus) {\r\n\t\t\t\tel.focus(keptFocus);\r\n\t\t\t}\r\n\t\t},\r\n\t\tblurNode: function (el) {\r\n\t\t\tif (el && el.blur) {\r\n\t\t\t\tel.blur();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeyDownHandler: function (e) {\r\n\r\n\t\t\tif (gantt.$keyboardNavigation.isModal())\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif (!this.isEnabled())\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif(e.defaultPrevented){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar ganttNode = this.globalNode;\r\n\r\n\t\t\tvar command = gantt.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\t\tvar activeElement = this.getActiveNode();\r\n\t\t\tvar eventFacade = gantt.$keyboardNavigation.facade;\r\n\t\t\tif(eventFacade.callEvent(\"onKeyDown\", [command, e]) === false){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!activeElement) {\r\n\t\t\t\tthis.setDefaultNode();\r\n\t\t\t} else if (activeElement.findHandler(command)) {\r\n\t\t\t\tactiveElement.doAction(command, e);\r\n\t\t\t} else if (ganttNode.findHandler(command)) {\r\n\t\t\t\tganttNode.doAction(command, e);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\t_timeout: null,\r\n\t\tawaitsFocus: function(){\r\n\t\t\treturn this._timeout !== null;\r\n\t\t},\r\n\t\tdelay: function(callback, delay){\r\n\r\n\t\t\tclearTimeout(this._timeout);\r\n\t\t\tthis._timeout = setTimeout(gantt.bind(function(){\r\n\t\t\t\tthis._timeout = null;\r\n\t\t\t\tcallback();\r\n\t\t\t}, this) , delay || 1);\r\n\r\n\t\t},\r\n\t\tclearDelay: function(){\r\n\t\t\tclearTimeout(this._timeout);\r\n\t\t}\r\n\t};\r\n\r\n};","import { QuickInfo } from \"./quickInfo\";\r\n\r\nexport default function(gantt: any){\r\n\r\nif (!gantt.ext) {\r\n\tgantt.ext = {};\r\n}\r\ngantt.ext.quickInfo = new QuickInfo(gantt);\r\n\r\ngantt.config.quickinfo_buttons = [\"icon_edit\", \"icon_delete\"];\r\ngantt.config.quick_info_detached = true;\r\ngantt.config.show_quick_info = true;\r\n\r\ngantt.templates.quick_info_title = function(start, end, ev){ return ev.text.substr(0,50); };\r\ngantt.templates.quick_info_content = function(start, end, ev){ return ev.details || ev.text; };\r\ngantt.templates.quick_info_date = function(start, end, ev){\r\n\treturn gantt.templates.task_time(start, end, ev);\r\n};\r\ngantt.templates.quick_info_class = function(start, end, task){ return \"\"; };\r\n\r\ngantt.attachEvent(\"onTaskClick\", function(id,e){\r\n\t// GS-1460 Don't show Quick Info when clicking on the \"+\" button\r\n\tif (!gantt.utils.dom.closest(e.target, \".gantt_add\")){\r\n\t\tsetTimeout(function() {\r\n\t\t\tgantt.ext.quickInfo.show(id);\r\n\t\t}, 0);\r\n\t}\r\n\r\n\treturn true;\r\n});\r\n\r\nconst events = [\"onViewChange\", \"onLightbox\", \"onBeforeTaskDelete\", \"onBeforeDrag\"];\r\nconst hidingFunction = function(){\r\n\tgantt.ext.quickInfo.hide();\r\n\treturn true;\r\n};\r\nfor (let i=0; i {\r\n\t\t\tif (gantt.config.touch && !gantt.config.touch_tooltip) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst targetTaskId = gantt.locate(event);\r\n\t\t\tif(gantt.isTaskExists(targetTaskId)){\r\n\t\t\t\tconst task = gantt.getTask(targetTaskId);\r\n\t\t\t\treturn gantt.templates.tooltip_text(task.start_date, task.end_date, task);\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tglobal: false\r\n\t});\r\n});\r\n\r\ngantt.attachEvent(\"onDestroy\", function() {\r\n\ttooltipManager.destructor();\r\n});\r\n\r\ngantt.attachEvent(\"onLightbox\", function() {\r\n\ttooltipManager.hideTooltip();\r\n});\r\nconst isLinkCreate = () => {\r\n\tconst state = gantt.getState();\r\n\treturn !!state.link_source_id;\r\n};\r\ngantt.attachEvent(\"onBeforeTooltip\", function() {\r\n\tif (isLinkCreate()){\r\n\t\treturn false;\r\n\t}\r\n});\r\n\r\ngantt.attachEvent(\"onGanttScroll\", function(){\r\n\ttooltipManager.hideTooltip();\r\n});\r\n\r\n}","import { Monitor } from \"./monitor\";\r\nimport { IMonitor, IUndoCommand, TEntityType, TUndoStack } from \"./types\";\r\nimport { Undo } from \"./undo\";\r\n\r\nexport default function(gantt: any){\r\n\r\nconst _undo = new Undo(gantt);\r\nconst monitor: IMonitor = new Monitor(_undo, gantt);\r\n\r\ngantt.config.undo = true;\r\ngantt.config.redo = true;\r\n\r\n/**\r\n * entities that require different processing for undoing-redoing changes\r\n * @type {{link: string, task: string}}\r\n */\r\ngantt.config.undo_types = {\r\n\tlink: \"link\",\r\n\ttask: \"task\"\r\n};\r\n\r\n/**\r\n * types of traced actions\r\n * @type {{update: string, remove: string, add: string}}\r\n */\r\ngantt.config.undo_actions = {\r\n\tupdate: \"update\",\r\n\tremove: \"remove\", // remove item from datastore\r\n\tadd: \"add\",\r\n\tmove: \"move\" // move task in grid\r\n};\r\n\r\nif (!gantt.ext) {\r\n\tgantt.ext = {};\r\n}\r\n\r\ngantt.ext.undo = {\r\n\tundo: () => _undo.undo(),\r\n\tredo: () => _undo.redo(),\r\n\tgetUndoStack: () => _undo.getUndoStack(),\r\n\tsetUndoStack: (stack:[]) => _undo.setUndoStack(stack),\r\n\tgetRedoStack: () => _undo.getRedoStack(),\r\n\tsetRedoStack: (stack:[]) => _undo.setRedoStack(stack),\r\n\tclearUndoStack: () => _undo.clearUndoStack(),\r\n\tclearRedoStack: () => _undo.clearRedoStack(),\r\n\tsaveState: (id: TaskID | LinkID, type: TEntityType) => monitor.store(id, type, true),\r\n\tgetInitialState: (id: TaskID | LinkID, type: TEntityType) => {\r\n\t\tif(type === gantt.config.undo_types.link){\r\n\t\t\treturn monitor.getInitialLink(id);\r\n\t\t}else{\r\n\t\t\treturn monitor.getInitialTask(id);\r\n\t\t}\r\n\t}\r\n};\r\n\r\ngantt.undo = gantt.ext.undo.undo;\r\ngantt.redo = gantt.ext.undo.redo;\r\ngantt.getUndoStack = gantt.ext.undo.getUndoStack;\r\ngantt.getRedoStack = gantt.ext.undo.getRedoStack;\r\ngantt.clearUndoStack = gantt.ext.undo.clearUndoStack;\r\ngantt.clearRedoStack = gantt.ext.undo.clearRedoStack;\r\n\r\nfunction updTask(task: ITask, oldId: TaskID, newId: TaskID) {\r\n\tif (!task) { return; }\r\n\r\n\tif (task.id === oldId) {\r\n\t\ttask.id = newId;\r\n\t}\r\n\r\n\tif (task.parent === oldId) {\r\n\t\ttask.parent = newId;\r\n\t}\r\n}\r\n\r\nfunction changeTaskCommandId(command: IUndoCommand, oldId: TaskID, newId: TaskID) {\r\n\tupdTask(command.value, oldId, newId);\r\n\tupdTask(command.oldValue, oldId, newId);\r\n}\r\n\r\nfunction updLink(link: ILink, oldTaskId: TaskID, newTaskId: TaskID) {\r\n\tif (!link) { return; }\r\n\tif (link.source === oldTaskId) {\r\n\t\tlink.source = newTaskId;\r\n\t}\r\n\tif (link.target === oldTaskId) {\r\n\t\tlink.target = newTaskId;\r\n\t}\r\n}\r\n\r\nfunction changeLinkCommandId(command: IUndoCommand, oldId: LinkID, newId: LinkID) {\r\n\tupdLink(command.value, oldId, newId);\r\n\tupdLink(command.oldValue, oldId, newId);\r\n}\r\n\r\nfunction updateTasksIds(log: TUndoStack, oldId: TaskID, newId: TaskID) {\r\n\tconst undo = _undo;\r\n\r\n\tfor (let i = 0; i < log.length; i++) {\r\n\t\tconst entry = log[i];\r\n\t\tfor (let j = 0; j < entry.commands.length; j++) {\r\n\t\t\tif (entry.commands[j].entity === undo.command.entity.task) {\r\n\t\t\t\tchangeTaskCommandId(entry.commands[j], oldId, newId);\r\n\t\t\t} else if (entry.commands[j].entity === undo.command.entity.link) {\r\n\t\t\t\tchangeLinkCommandId(entry.commands[j], oldId, newId);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction updateLinksIds(log: TUndoStack, oldId: LinkID, newId: LinkID) {\r\n\tconst undo = _undo;\r\n\r\n\tfor (let i = 0; i < log.length; i++) {\r\n\t\tconst entry = log[i];\r\n\t\tfor (let j = 0; j < entry.commands.length; j++) {\r\n\t\t\tconst command = entry.commands[j];\r\n\t\t\tif (command.entity === undo.command.entity.link) {\r\n\t\t\t\tif (command.value && command.value.id === oldId) {\r\n\t\t\t\t\tcommand.value.id = newId;\r\n\t\t\t\t}\r\n\t\t\t\tif (command.oldValue && command.oldValue.id === oldId) {\r\n\t\t\t\t\tcommand.oldValue.id = newId;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ngantt.attachEvent(\"onTaskIdChange\", (oldId: TaskID, newId: TaskID) => {\r\n\tconst undo = _undo;\r\n\tupdateTasksIds(undo.getUndoStack(), oldId, newId);\r\n\tupdateTasksIds(undo.getRedoStack(), oldId, newId);\r\n});\r\n\r\ngantt.attachEvent(\"onLinkIdChange\", (oldId: LinkID, newId: LinkID) => {\r\n\tconst undo = _undo;\r\n\tupdateLinksIds(undo.getUndoStack(), oldId, newId);\r\n\tupdateLinksIds(undo.getRedoStack(), oldId, newId);\r\n});\r\n\r\ngantt.attachEvent(\"onGanttReady\", () => {\r\n\t_undo.updateConfigs();\r\n});\r\n\r\n}","\r\nexport default function(gantt){\r\n\r\nif(!gantt._markers) {\r\n\tgantt._markers = gantt.createDatastore({\r\n\t\tname: \"marker\",\r\n\t\tinitItem: function (marker) {\r\n\t\t\tmarker.id = marker.id || gantt.uid();\r\n\t\t\treturn marker;\r\n\t\t}\r\n\t});\r\n}\r\n\r\ngantt.config.show_markers = true;\r\n\r\nfunction render_marker(marker){\r\n\tif(!gantt.config.show_markers)\r\n\t\treturn false;\r\n\r\n\tif(!marker.start_date)\r\n\t\treturn false;\r\n\r\n\tvar state = gantt.getState();\r\n\tif(+marker.start_date > +state.max_date)\r\n\t\treturn;\r\n\tif((!marker.end_date || +marker.end_date < +state.min_date) && +marker.start_date < +state.min_date)\r\n\t\treturn;\r\n\r\n\tvar div = document.createElement(\"div\");\r\n\r\n\tdiv.setAttribute(\"data-marker-id\", marker.id);\r\n\r\n\tvar css = \"gantt_marker\";\r\n\tif(gantt.templates.marker_class)\r\n\t\tcss += \" \" + gantt.templates.marker_class(marker);\r\n\r\n\tif(marker.css){\r\n\t\tcss += \" \" + marker.css;\r\n\t}\r\n\r\n\tif(gantt.templates.marker_class)\r\n\t\tcss += \" \" + gantt.templates.marker_class(marker);\r\n\r\n\tif(marker.title){\r\n\t\tdiv.title = marker.title;\r\n\t}\r\n\tdiv.className = css;\r\n\r\n\tvar start = gantt.posFromDate(marker.start_date);\r\n\tdiv.style.left = start + \"px\";\r\n\tlet markerHeight = Math.max(gantt.getRowTop(gantt.getVisibleTaskCount()), 0) + \"px\";\r\n\tif (gantt.config.timeline_placeholder && gantt.$task_data){\r\n\t\tmarkerHeight = gantt.$task_data.scrollHeight + \"px\";\r\n\t}\r\n\tdiv.style.height = markerHeight;\r\n\tif(marker.end_date){\r\n\t\tvar end = gantt.posFromDate(marker.end_date);\r\n\t\tdiv.style.width = Math.max((end - start), 0) + \"px\";\r\n\r\n\t}\r\n\r\n\tif(marker.text){\r\n\t\tdiv.innerHTML = \"\" + marker.text + \"
\";\r\n\t}\r\n\r\n\treturn div;\r\n}\r\n\r\nfunction initMarkerArea(){\r\n\tif(!gantt.$task_data)\r\n\t\treturn;\r\n\r\n\tvar markerArea = document.createElement(\"div\");\r\n\tmarkerArea.className = \"gantt_marker_area\";\r\n\tgantt.$task_data.appendChild(markerArea);\r\n\tgantt.$marker_area = markerArea;\r\n}\r\n\r\ngantt.attachEvent(\"onBeforeGanttRender\", function(){\r\n\tif(!gantt.$marker_area)\r\n\t\tinitMarkerArea();\r\n});\r\n\r\ngantt.attachEvent(\"onDataRender\", function(){\r\n\tif(!gantt.$marker_area){\r\n\t\tinitMarkerArea();\r\n\t\tgantt.renderMarkers();\r\n\t}\r\n});\r\n\r\ngantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t// GS-1304 - markers should attach when layout is initialized, both on gantt.init and gantt.resetLayout\r\n\t// wait for \"onBeforeGanttRender\", so all layout elements will be in DOM\r\n\tgantt.attachEvent(\"onBeforeGanttRender\", function(){\r\n\t\tinitMarkerArea();\r\n\r\n\t\tvar layers = gantt.$services.getService(\"layers\");\r\n\t\tvar markerRenderer = layers.createDataRender({\r\n\t\t\tname: \"marker\",\r\n\t\t\tdefaultContainer: function(){ return gantt.$marker_area;}\r\n\t\t});\r\n\t\tmarkerRenderer.addLayer(render_marker);\r\n\t}, {once: true});\r\n});\r\n\r\ngantt.getMarker = function(id){\r\n\tif(!this._markers) return null;\r\n\r\n\treturn this._markers.getItem(id);\r\n};\r\n\r\ngantt.addMarker = function(marker){\r\n\treturn this._markers.addItem(marker);\r\n};\r\n\r\ngantt.deleteMarker = function(id){\r\n\tif(!this._markers.exists(id))\r\n\t\treturn false;\r\n\r\n\tthis._markers.removeItem(id);\r\n\treturn true;\r\n};\r\ngantt.updateMarker = function(id){\r\n\tthis._markers.refresh(id);\r\n};\r\n\r\ngantt._getMarkers = function(){\r\n\treturn this._markers.getItems();\r\n};\r\n\r\ngantt.renderMarkers = function () {\r\n\tthis._markers.refresh();\r\n};\r\n\r\n};","import {replaceValidZeroId} from \"../utils/helpers\";\r\n\r\nexport default function(gantt){\r\n\r\ngantt.config.multiselect = true;\r\ngantt.config.multiselect_one_level = false;\r\n\r\ngantt._multiselect = {\r\n\t_selected: {},\r\n\t_one_level: false,\r\n\t_active: true,\r\n\t_first_selected_when_shift: null,\r\n\tgetDefaultSelected: function() {\r\n\t\tvar selected = this.getSelected();\r\n\t\treturn selected.length ? selected[selected.length - 1] : null;\r\n\t},\r\n\tsetFirstSelected: function(id) {\r\n\t\tthis._first_selected_when_shift = id;\r\n\t},\r\n\tgetFirstSelected: function() {\r\n\t\treturn this._first_selected_when_shift;\r\n\t},\r\n\tisActive: function() {\r\n\t\tthis.updateState();\r\n\t\treturn this._active;\r\n\t},\r\n\tupdateState: function() {\r\n\t\tthis._one_level = gantt.config.multiselect_one_level;\r\n\t\tvar active = this._active;\r\n\t\tthis._active = gantt.config.select_task;\r\n\t\tif (this._active != active) {\r\n\t\t\tthis.reset();\r\n\t\t}\r\n\t},\r\n\treset: function () {\r\n\t\tthis._selected = {};\r\n\t},\r\n\tsetLastSelected: function (id) {\r\n\t\tgantt.$data.tasksStore.silent(function(){\r\n\t\t\tvar store = gantt.$data.tasksStore;\r\n\t\t\tif (id)\r\n\t\t\t\tstore.select(id+\"\");\r\n\t\t\telse\r\n\t\t\t\tstore.unselect(null);\r\n\t\t});\r\n\t},\r\n\tgetLastSelected: function () {\r\n\t\tvar last = gantt.$data.tasksStore.getSelectedId();\r\n\t\tif (last && gantt.isTaskExists(last))\r\n\t\t\treturn last;\r\n\t\treturn null;\r\n\t},\r\n\tselect: function (id, e) {\r\n\t\tif (id && gantt.callEvent(\"onBeforeTaskMultiSelect\", [id, true, e]) && gantt.callEvent(\"onBeforeTaskSelected\", [id])) {\r\n\t\t\tthis._selected[id] = true;\r\n\t\t\tthis.setLastSelected(id);\r\n\t\t\tthis.afterSelect(id);\r\n\t\t\tgantt.callEvent(\"onTaskMultiSelect\", [id, true, e]);\r\n\t\t\tgantt.callEvent(\"onTaskSelected\", [id]);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\ttoggle: function (id, e) {\r\n\t\tif (this._selected[id]) {\r\n\t\t\tthis.unselect(id, e);\r\n\t\t} else {\r\n\t\t\tthis.select(id, e);\r\n\t\t}\r\n\t},\r\n\tunselect: function (id, e) {\r\n\t\tif (id && gantt.callEvent(\"onBeforeTaskMultiSelect\", [id, false, e])) {\r\n\t\t\tthis._selected[id] = false;\r\n\t\t\tif (this.getLastSelected() == id)\r\n\t\t\t\tthis.setLastSelected(this.getDefaultSelected());\r\n\t\t\tthis.afterSelect(id);\r\n\t\t\tgantt.callEvent(\"onTaskMultiSelect\", [id, false, e]);\r\n\t\t\tgantt.callEvent(\"onTaskUnselected\", [id]);\r\n\t\t}\r\n\t},\r\n\tisSelected: function (id) {\r\n\t\treturn !!(gantt.isTaskExists(id) && this._selected[id]);\r\n\t},\r\n\tgetSelected: function () {\r\n\t\tvar res = [];\r\n\t\tfor (var i in this._selected) {\r\n\t\t\tif (this._selected[i] && gantt.isTaskExists(i)) {\r\n\t\t\t\tres.push(i);\r\n\t\t\t} else {\r\n\t\t\t\tthis._selected[i] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tres.sort(function(a, b) {\r\n\t\t\treturn gantt.getGlobalTaskIndex(a) > gantt.getGlobalTaskIndex(b) ? 1 : -1;\r\n\t\t});\r\n\t\treturn res;\r\n\t},\r\n\tforSelected: function (callback) {\r\n\t\tvar selected = this.getSelected();\r\n\t\tfor (var i = 0; i < selected.length; i++) {\r\n\t\t\tcallback(selected[i]);\r\n\t\t}\r\n\t},\r\n\tisSameLevel: function(id) {\r\n\t\tif (!this._one_level)\r\n\t\t\treturn true;\r\n\t\tvar last = this.getLastSelected();\r\n\t\tif (!last)\r\n\t\t\treturn true;\r\n\t\tif (!(gantt.isTaskExists(last) && gantt.isTaskExists(id)))\r\n\t\t\treturn true;\r\n\t\treturn !!(gantt.calculateTaskLevel(gantt.getTask(last)) == gantt.calculateTaskLevel(gantt.getTask(id)));\r\n\t},\r\n\tafterSelect: function(id) {\r\n\t\tif (gantt.isTaskExists(id)){\r\n\t\t\t// FIXME: quick workaround to prevent re-filtering inside refresh on multiselect\r\n\t\t\tgantt._quickRefresh(function(){\r\n\t\t\t\tgantt.refreshTask(id);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tdoSelection: function(e) {\r\n\t\tif (!this.isActive())\r\n\t\t\treturn false;\r\n\r\n\t\t// deny selection when click on 'expand' or 'collapse' icons\r\n\t\tif (gantt._is_icon_open_click(e))\r\n\t\t\treturn false;\r\n\r\n\t\tvar target_ev = gantt.locate(e);\r\n\t\tif (!target_ev)\r\n\t\t\treturn false;\r\n\r\n\t\tif (!gantt.callEvent(\"onBeforeMultiSelect\", [e]))\r\n\t\t\treturn false;\r\n\r\n\t\tvar selected = this.getSelected();\r\n\t\tvar defaultLast = this.getFirstSelected();\r\n\t\tvar isLast = false;\r\n\t\tvar last = this.getLastSelected();\r\n\t\tvar multiSelect = gantt.config.multiselect;\r\n\r\n\r\n\t\tvar singleSelection = (function () {\r\n\t\t\t// GS-719: If the multiselect extension is added we still need a way\r\n\t\t\t// to open the inline editors after clicking on the cells in the grid\r\n\t\t\tvar controller = gantt.ext.inlineEditors;\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar cell = controller.locateCell(e.target);\r\n\r\n\t\t\tif (gantt.config.inline_editors_multiselect_open && cell && controller.getEditorConfig(cell.columnName)) {\r\n\t\t\t\tif (controller.isVisible() && state.id == cell.id && state.columnName == cell.columnName) {\r\n\t\t\t\t\t// do nothing if editor is already active in this cell\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontroller.startEdit(cell.id, cell.columnName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.setFirstSelected(target_ev);\r\n\r\n\t\t\tif (!this.isSelected(target_ev)) {\r\n\t\t\t\tthis.select(target_ev, e);\r\n\t\t\t}\r\n\t\t\tselected = this.getSelected();\r\n\t\t\tfor (var i = 0; i < selected.length; i++) {\r\n\t\t\t\tif (selected[i] !== target_ev) {\r\n\t\t\t\t\tthis.unselect(selected[i], e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}).bind(this);\r\n\r\n\t\tvar blockSelection = (function(){\r\n\t\t\tif (!last)\r\n\t\t\t\tlast = target_ev;\r\n\t\t\telse if (target_ev) {\r\n\t\t\t\tvar first_indx = gantt.getGlobalTaskIndex(this.getFirstSelected());\r\n\t\t\t\tvar target_indx = gantt.getGlobalTaskIndex(target_ev);\r\n\t\t\t\tvar last_indx = gantt.getGlobalTaskIndex(last);\r\n\t\t\t\t// GS-1969: if the selected tasks are collapsed, need to remove them\r\n\t\t\t\tif(first_indx == -1 || last_indx == -1){\r\n\t\t\t\t\tfirst_indx = target_indx;\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t\t// clear prev selection\r\n\t\t\t\tvar tmp = last;\r\n\t\t\t\twhile (gantt.getGlobalTaskIndex(tmp) !== first_indx) {\r\n\t\t\t\t\tthis.unselect(tmp, e);\r\n\t\t\t\t\ttmp = (first_indx > last_indx) ? gantt.getNext(tmp) : gantt.getPrev(tmp);\r\n\t\t\t\t}\r\n\t\t\t\ttmp = target_ev;\r\n\t\t\t\twhile (gantt.getGlobalTaskIndex(tmp) !== first_indx) {\r\n\t\t\t\t\tif (this.select(tmp, e) && !isLast) {\r\n\t\t\t\t\t\tisLast = true;\r\n\t\t\t\t\t\tdefaultLast = tmp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttmp = (first_indx > target_indx) ? gantt.getNext(tmp) : gantt.getPrev(tmp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}).bind(this);\r\n\r\n\r\n\t\tif (multiSelect && (e.ctrlKey || e.metaKey)) {\r\n\t\t\tif (!this.isSelected(target_ev))\r\n\t\t\t\tthis.setFirstSelected(target_ev);\r\n\r\n\t\t\tif (target_ev) {\r\n\t\t\t\tthis.toggle(target_ev, e);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (multiSelect && e.shiftKey) {\r\n\t\t\tif (!gantt.isTaskExists(this.getFirstSelected()) || this.getFirstSelected() === null) {\r\n\t\t\t\tthis.setFirstSelected(target_ev);\r\n\t\t\t}\r\n\r\n\t\t\tif (selected.length) { // select a group of tasks\r\n\t\t\t\tblockSelection();\r\n\t\t\t}\r\n\t\t\telse { // select a task when no task is selected and Shift is pressed\r\n\t\t\t\tsingleSelection();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse { // no key press or no multiple selection on the mouse click\r\n\t\t\tsingleSelection();\r\n\t\t}\r\n\r\n\r\n\t\tif (this.isSelected(target_ev)) {\r\n\t\t\tthis.setLastSelected(target_ev);\r\n\t\t} else if (defaultLast) {\r\n\t\t\tif (target_ev == last)\r\n\t\t\t\tthis.setLastSelected(e.shiftKey ? defaultLast : this.getDefaultSelected());\r\n\t\t} else {\r\n\t\t\tthis.setLastSelected(null);\r\n\t\t}\r\n\r\n\t\tif (!this.getSelected().length)\r\n\t\t\tthis.setLastSelected(null);\r\n\r\n\t\tif (!this.getLastSelected() || !this.isSelected(this.getFirstSelected()))\r\n\t\t\tthis.setFirstSelected(this.getLastSelected());\r\n\r\n\t\treturn true;\r\n\t}\r\n};\r\n\r\n(function(){\r\n\tvar old_selectTask = gantt.selectTask;\r\n\tgantt.selectTask = function(id) {\r\n\t\tid = replaceValidZeroId(id, this.config.root_id);\r\n\t\tif (!id)\r\n\t\t\treturn false;\r\n\t\tvar multiselect = gantt._multiselect;\r\n\t\tvar res = id;\r\n\t\tif (multiselect.isActive()) {\r\n\t\t\tif (multiselect.select(id, null)) {\r\n\t\t\t\tmultiselect.setLastSelected(id);\r\n\t\t\t}\r\n\t\t\tmultiselect.setFirstSelected(multiselect.getLastSelected());\r\n\t\t} else {\r\n\t\t\tres = old_selectTask.call(this, id);\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar old_unselectTask = gantt.unselectTask;\r\n\tgantt.unselectTask = function(id) {\r\n\t\tvar multiselect = gantt._multiselect;\r\n\t\tvar isActive = multiselect.isActive();\r\n\t\tid = id || multiselect.getLastSelected();\r\n\t\tif(id && isActive) {\r\n\t\t\tmultiselect.unselect(id, null);\r\n\t\t\tif (id == multiselect.getLastSelected())\r\n\t\t\t\tmultiselect.setLastSelected(null);\r\n\t\t\tgantt.refreshTask(id);\r\n\t\t\tmultiselect.setFirstSelected(multiselect.getLastSelected());\r\n\t\t}\r\n\t\tvar res = id;\r\n\t\tif (!isActive)\r\n\t\t\tres = old_unselectTask.call(this, id);\r\n\t\treturn res;\r\n\t};\r\n\r\n\tgantt.toggleTaskSelection = function(id) {\r\n\t\tvar multiselect = gantt._multiselect;\r\n\t\tif (id && multiselect.isActive()) {\r\n\t\t\tmultiselect.toggle(id);\r\n\t\t\tmultiselect.setFirstSelected(multiselect.getLastSelected());\r\n\t\t}\r\n\t};\r\n\tgantt.getSelectedTasks = function() {\r\n\t\tvar multiselect = gantt._multiselect;\r\n\t\tmultiselect.isActive();\r\n\t\treturn multiselect.getSelected();\r\n\t};\r\n\tgantt.eachSelectedTask = function(callback){\r\n\t\treturn this._multiselect.forSelected(callback);\r\n\t};\r\n\tgantt.isSelectedTask = function(id){\r\n\t\treturn this._multiselect.isSelected(id);\r\n\t};\r\n\tgantt.getLastSelectedTask = function(){\r\n\t\treturn this._multiselect.getLastSelected();\r\n\t};\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tvar old_isSelected = gantt.$data.tasksStore.isSelected;\r\n\t\tgantt.$data.tasksStore.isSelected = function(id){\r\n\t\t\tif (gantt._multiselect.isActive()) {\r\n\t\t\t\treturn gantt._multiselect.isSelected(id);\r\n\t\t\t}\r\n\t\t\treturn old_isSelected.call(this, id);\r\n\t\t};\r\n\t});\r\n})();\r\n\r\ngantt.attachEvent(\"onTaskIdChange\", function (id, new_id) {\r\n\tvar multiselect = gantt._multiselect;\r\n\tif (!multiselect.isActive())\r\n\t\treturn true;\r\n\tif (gantt.isSelectedTask(id)) {\r\n\t\tmultiselect.unselect(id, null);\r\n\t\tmultiselect.select(new_id, null);\r\n\t}\r\n});\r\n\r\ngantt.attachEvent(\"onAfterTaskDelete\", function (id, item) {\r\n\tvar multiselect = gantt._multiselect;\r\n\tif (!multiselect.isActive())\r\n\t\treturn true;\r\n\r\n\tif (multiselect._selected[id]) {\r\n\t\t// GS-1057: don't unselect the task here because the task is already unselected \r\n\t\t// it was in the select.js file before it was deleted\r\n\t\t// multiselect.unselect(id, null);\r\n\t\tmultiselect._selected[id] = false;\r\n\t\tmultiselect.setLastSelected(multiselect.getDefaultSelected());\r\n\t}\r\n\r\n\tmultiselect.forSelected(function (task_id) {\r\n\t\tif (!gantt.isTaskExists(task_id))\r\n\t\t\tmultiselect.unselect(task_id, null);\r\n\t});\r\n});\r\n\r\ngantt.attachEvent(\"onBeforeTaskMultiSelect\", function(id, state, e){\r\n\tconst multiselect = gantt._multiselect;\r\n\tif (state && multiselect.isActive()) {\r\n\t\t//GS-1321: prevent unselecting task\r\n\t\tlet oldSelectedId = gantt.getSelectedId();\r\n\t\tlet oldSelectedTask = null;\r\n\t\tif (oldSelectedId) {\r\n\t\t\toldSelectedTask = gantt.getTask(oldSelectedId);\r\n\t\t}\r\n\t\tlet newSelectedTask = gantt.getTask(id);\r\n\t\tlet differentTreeLevel = false;\r\n\t\tif (oldSelectedTask && oldSelectedTask.$level != newSelectedTask.$level){\r\n\t\t\tdifferentTreeLevel = true;\r\n\t\t}\r\n\r\n\t\tif (gantt.config.multiselect_one_level && differentTreeLevel && !e.ctrlKey && !e.shiftKey) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (multiselect._one_level) {\r\n\t\t\treturn multiselect.isSameLevel(id);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\n\r\ngantt.attachEvent(\"onTaskClick\", function(id, e) {\r\n\tif (gantt._multiselect.doSelection(e))\r\n\t\tgantt.callEvent(\"onMultiSelect\", [e]);\r\n\treturn true;\r\n});\r\n\r\n};","/* eslint-disable */\r\n\r\nexport default function(gantt: any) {\r\n\r\n\tgantt.ext = gantt.ext || {};\r\n\r\n\tgantt.ext.export_api = gantt.ext.export_api || {\r\n\r\n\t\t_apiUrl: \"https://export.dhtmlx.com/gantt\",\r\n\r\n\t\t_preparePDFConfigRaw(config, type){\r\n\t\t\tlet previousDateRage:any = null;\r\n\t\t\tif (config.start && config.end){\r\n\t\t\t\tpreviousDateRage = {\r\n\t\t\t\t\tstart_date: gantt.config.start_date,\r\n\t\t\t\t\tend_date: gantt.config.end_date,\r\n\t\t\t\t};\r\n\t\t\t\tgantt.config.start_date = gantt.date.str_to_date(gantt.config.date_format)(config.start);\r\n\t\t\t\tgantt.config.end_date = gantt.date.str_to_date(gantt.config.date_format)(config.end);\r\n\t\t\t}\r\n\r\n\t\t\tconfig = gantt.mixin(config, {\r\n\t\t\t\tname: \"gantt.\" + type, data: gantt.ext.export_api._serializeHtml()\r\n\t\t\t});\r\n\r\n\t\t\tif (previousDateRage){\r\n\t\t\t\tgantt.config.start_date = previousDateRage.start_date;\r\n\t\t\t\tgantt.config.end_date = previousDateRage.end_date;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_prepareConfigPDF(config, type){\r\n\t\t\tconfig = gantt.mixin((config || {}), {\r\n\t\t\t\tname: \"gantt.\" + type,\r\n\t\t\t\tdata: gantt.ext.export_api._serializeAll(),\r\n\t\t\t\tconfig: gantt.config\r\n\t\t\t});\r\n\t\t\tgantt.ext.export_api._fixColumns(config.config.columns);\r\n\t\t\treturn config;\r\n\t\t},\r\n\r\n\t\t_pdfExportRouter(config, type){\r\n\t\t\tif (config && config.raw) {\r\n\t\t\t\tgantt.ext.export_api._preparePDFConfigRaw(config, type);\r\n\t\t\t} else {\r\n\t\t\t\tconfig = gantt.ext.export_api._prepareConfigPDF(config, type);\r\n\t\t\t}\r\n\t\t\tconfig.version = gantt.version;\r\n\t\t\tgantt.ext.export_api._sendToExport(config, type);\r\n\t\t},\r\n\r\n\t\texportToPDF(config) {\r\n\t\t\tgantt.ext.export_api._pdfExportRouter(config, \"pdf\");\r\n\t\t},\r\n\r\n\t\texportToPNG(config) {\r\n\t\t\tgantt.ext.export_api._pdfExportRouter(config, \"png\");\r\n\t\t},\r\n\r\n\r\n\t\texportToICal(config) {\r\n\t\t\tconfig = gantt.mixin((config || {}), {\r\n\t\t\t\tname: \"gantt.ical\",\r\n\t\t\t\tdata: gantt.ext.export_api._serializePlain().data,\r\n\t\t\t\tversion: gantt.version\r\n\t\t\t});\r\n\t\t\tgantt.ext.export_api._sendToExport(config, \"ical\");\r\n\t\t},\r\n\r\n\t\texportToExcel(config) {\r\n\t\t\tconfig = config || {};\r\n\r\n\t\t\tlet tasks;\r\n\t\t\tlet dates;\r\n\t\t\tlet state;\r\n\t\t\tlet scroll;\r\n\t\t\t// GS-2124, we need to get all task nodes to correctly obtain the colors\r\n\t\t\tconst smartRendering = gantt.config.smart_rendering;\r\n\t\t\tif (config.visual === \"base-colors\"){\r\n\t\t\t\tgantt.config.smart_rendering = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (config.start || config.end) {\r\n\t\t\t\tstate = gantt.getState();\r\n\t\t\t\tdates = [gantt.config.start_date, gantt.config.end_date];\r\n\t\t\t\tscroll = gantt.getScrollState();\r\n\t\t\t\tconst convert = gantt.date.str_to_date(gantt.config.date_format);\r\n\t\t\t\ttasks = gantt.eachTask;\r\n\r\n\t\t\t\tif (config.start){\r\n\t\t\t\t\tgantt.config.start_date = convert(config.start);\r\n\t\t\t\t}\r\n\t\t\t\tif (config.end){\r\n\t\t\t\t\tgantt.config.end_date = convert(config.end);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgantt.render();\r\n\t\t\t\tgantt.config.smart_rendering = smartRendering;\r\n\r\n\t\t\t\tgantt.eachTask = gantt.ext.export_api._eachTaskTimed(gantt.config.start_date, gantt.config.end_date);\r\n\t\t\t} else if (config.visual === \"base-colors\"){\r\n\t\t\t\tgantt.render();\r\n\t\t\t\tgantt.config.smart_rendering = smartRendering;\r\n\t\t\t}\r\n\r\n\t\t\tgantt._no_progress_colors = config.visual === \"base-colors\";\r\n\r\n\t\t\tconfig = gantt.mixin(config, {\r\n\t\t\t\tname: \"gantt.xlsx\",\r\n\t\t\t\ttitle: \"Tasks\",\r\n\t\t\t\tdata: gantt.ext.export_api._serializeTimeline(config).data,\r\n\t\t\t\tcolumns: gantt.ext.export_api._serializeGrid({ rawDates: true }),\r\n\t\t\t\tversion: gantt.version\r\n\t\t\t});\r\n\r\n\t\t\tif (config.visual){\r\n\t\t\t\tconfig.scales = gantt.ext.export_api._serializeScales(config);\r\n\t\t\t}\r\n\r\n\t\t\tgantt.ext.export_api._sendToExport(config, \"excel\");\r\n\r\n\t\t\tif (config.start || config.end) {\r\n\t\t\t\tgantt.config.start_date = state.min_date;\r\n\t\t\t\tgantt.config.end_date = state.max_date;\r\n\t\t\t\tgantt.eachTask = tasks;\r\n\r\n\t\t\t\tgantt.render();\r\n\t\t\t\tgantt.scrollTo(scroll.x, scroll.y);\r\n\r\n\t\t\t\tgantt.config.start_date = dates[0];\r\n\t\t\t\tgantt.config.end_date = dates[1];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\texportToJSON(config) {\r\n\t\t\tconfig = gantt.mixin((config || {}), {\r\n\t\t\t\tname: \"gantt.json\",\r\n\t\t\t\tdata: gantt.ext.export_api._serializeAll(),\r\n\t\t\t\tconfig: gantt.config,\r\n\t\t\t\tcolumns: gantt.ext.export_api._serializeGrid(),\r\n\t\t\t\tworktime: gantt.ext.export_api._getWorktimeSettings(),\r\n\t\t\t\tversion: gantt.version\r\n\t\t\t});\r\n\t\t\tgantt.ext.export_api._sendToExport(config, \"json\");\r\n\t\t},\r\n\r\n\r\n\t\timportFromExcel(config) {\r\n\t\t\ttry {\r\n\t\t\t\tconst formData = config.data;\r\n\t\t\t\tif (formData instanceof File) {\r\n\t\t\t\t\tconst data = new FormData();\r\n\t\t\t\t\tdata.append(\"file\", formData);\r\n\t\t\t\t\tconfig.data = data;\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {}\r\n\t\t\tgantt.ext.export_api._sendImportAjaxExcel(config);\r\n\t\t},\r\n\r\n\t\timportFromMSProject(config) {\r\n\t\t\tconst formData = config.data;\r\n\t\t\ttry {\r\n\t\t\t\tif (formData instanceof File) {\r\n\t\t\t\t\tconst data = new FormData();\r\n\t\t\t\t\tdata.append(\"file\", formData);\r\n\t\t\t\t\tconfig.data = data;\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {}\r\n\t\t\tgantt.ext.export_api._sendImportAjaxMSP(config);\r\n\t\t},\r\n\r\n\t\timportFromPrimaveraP6(config) {\r\n\t\t\tconfig.type = \"primaveraP6-parse\";\r\n\t\t\treturn gantt.importFromMSProject(config);\r\n\t\t},\r\n\r\n\t\texportToMSProject(config) {\r\n\t\t\tconfig = config || {};\r\n\t\t\tconfig.skip_circular_links = config.skip_circular_links === undefined ? true : !!config.skip_circular_links;\r\n\r\n\t\t\tconst oldXmlFormat = gantt.templates.xml_format;\r\n\t\t\tconst oldFormatDate = gantt.templates.format_date;\r\n\t\t\tconst oldXmlDate = gantt.config.xml_date;\r\n\t\t\tconst oldDateFormat = gantt.config.date_format;\r\n\r\n\t\t\tconst exportServiceDateFormat = \"%d-%m-%Y %H:%i:%s\";\r\n\r\n\t\t\tgantt.config.xml_date = exportServiceDateFormat;\r\n\t\t\tgantt.config.date_format = exportServiceDateFormat;\r\n\t\t\tgantt.templates.xml_format = gantt.date.date_to_str(exportServiceDateFormat);\r\n\t\t\tgantt.templates.format_date = gantt.date.date_to_str(exportServiceDateFormat);\r\n\t\t\tconst data = gantt.ext.export_api._serializeAll();\r\n\r\n\t\t\tgantt.ext.export_api._customProjectProperties(data, config);\r\n\r\n\t\t\tgantt.ext.export_api._customTaskProperties(data, config);\r\n\r\n\t\t\tif (config.skip_circular_links) {\r\n\t\t\t\tgantt.ext.export_api._clearRecLinks(data);\r\n\t\t\t}\r\n\r\n\t\t\tconfig = gantt.ext.export_api._exportConfig(data, config);\r\n\r\n\t\t\tgantt.ext.export_api._sendToExport(config, config.type || \"msproject\");\r\n\t\t\tgantt.config.xml_date = oldXmlDate;\r\n\t\t\tgantt.config.date_format = oldDateFormat;\r\n\t\t\tgantt.templates.xml_format = oldXmlFormat;\r\n\t\t\tgantt.templates.format_date = oldFormatDate;\r\n\r\n\t\t\tgantt.config.$custom_data = null;\r\n\t\t\tgantt.config.custom = null;\r\n\t\t},\r\n\r\n\t\texportToPrimaveraP6(config) {\r\n\t\t\tconfig = config || {};\r\n\t\t\tconfig.type = \"primaveraP6\";\r\n\t\t\treturn gantt.exportToMSProject(config);\r\n\t\t},\r\n\r\n\t\t_fixColumns(columns) {\r\n\t\t\tfor (let i = 0; i < columns.length; i++) {\r\n\t\t\t\tcolumns[i].label = columns[i].label || gantt.locale.labels[\"column_\" + columns[i].name];\r\n\t\t\t\tif (typeof columns[i].width === \"string\") {\r\n\t\t\t\t\tcolumns[i].width = columns[i].width * 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_xdr(url, pack, cb) {\r\n\t\t\tgantt.ajax.post(url, pack, cb);\r\n\t\t},\r\n\r\n\t\t_markColumns(base) {\r\n\t\t\tconst columns = base.config.columns;\r\n\t\t\tif (columns){\r\n\t\t\t\tfor (let i = 0; i < columns.length; i++) {\r\n\t\t\t\t\tif (columns[i].template){\r\n\t\t\t\t\t\tcolumns[i].$template = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\t_sendImportAjaxExcel(config) {\r\n\t\t\tconst url = config.server || gantt.ext.export_api._apiUrl;\r\n\t\t\tconst store = config.store || 0;\r\n\t\t\tconst formData = config.data;\r\n\t\t\tconst callback = config.callback;\r\n\r\n\t\t\tformData.append(\"type\", \"excel-parse\");\r\n\t\t\tformData.append(\"data\", JSON.stringify({\r\n\t\t\t\tsheet: config.sheet || 0\r\n\t\t\t}));\r\n\r\n\t\t\tif (store){\r\n\t\t\t\tformData.append(\"store\", store);\r\n\t\t\t}\r\n\r\n\t\t\tconst xhr = new XMLHttpRequest();\r\n\t\t\txhr.onreadystatechange = function(e) {\r\n\t\t\t\tif (xhr.readyState === 4 && xhr.status === 0) {// network error\r\n\t\t\t\t\tif (callback) {\r\n\t\t\t\t\t\tcallback(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\txhr.onload = function() {\r\n\t\t\t\tconst fail = xhr.status > 400;\r\n\t\t\t\tlet info = null;\r\n\r\n\t\t\t\tif (!fail) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tinfo = JSON.parse(xhr.responseText);\r\n\t\t\t\t\t} catch (e) { }\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (callback) {\r\n\t\t\t\t\tcallback(info);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\txhr.open(\"POST\", url, true);\r\n\t\t\txhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\t\t\txhr.send(formData);\r\n\t\t},\r\n\r\n\r\n\t\t_ajaxToExport(data, type, callback) {\r\n\t\t\tdelete data.callback;\r\n\r\n\t\t\tconst url = data.server || gantt.ext.export_api._apiUrl;\r\n\t\t\tconst pack = \"type=\" + type + \"&store=1&data=\" + encodeURIComponent(JSON.stringify(data));\r\n\r\n\t\t\tconst cb = function(loader) {\r\n\t\t\t\tconst xdoc = loader.xmlDoc || loader;\r\n\t\t\t\tconst fail = xdoc.status > 400;\r\n\t\t\t\tlet info = null;\r\n\r\n\t\t\t\tif (!fail) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tinfo = JSON.parse(xdoc.responseText);\r\n\t\t\t\t\t} catch (e) { }\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t};\r\n\r\n\t\t\tgantt.ext.export_api._xdr(url, pack, cb);\r\n\t\t},\r\n\t\t_serializableGanttConfig(config) {\r\n\t\t\tconst result = gantt.mixin({}, config);\r\n\r\n\t\t\tif (result.columns) {\r\n\t\t\t\tresult.columns = result.columns.map(function(col) {\r\n\t\t\t\t\tconst copy = gantt.mixin({}, col);\r\n\t\t\t\t\tdelete copy.editor;\r\n\t\t\t\t\treturn copy;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdelete result.editor_types;\r\n\t\t\treturn result;\r\n\t\t},\r\n\r\n\t\t_sendToExport(data, type) {\r\n\t\t\tconst convert = gantt.date.date_to_str(gantt.config.date_format || gantt.config.xml_date);\r\n\t\t\tif(!data.skin){\r\n\t\t\t\tdata.skin = gantt.skin;\r\n\t\t\t}\r\n\t\t\tif (data.config) {\r\n\t\t\t\tdata.config = gantt.copy(gantt.ext.export_api._serializableGanttConfig(data.config));\r\n\t\t\t\tgantt.ext.export_api._markColumns(data, type);\r\n\r\n\t\t\t\tif (data.config.start_date && data.config.end_date) {\r\n\t\t\t\t\tif (data.config.start_date instanceof Date) {\r\n\t\t\t\t\t\tdata.config.start_date = convert(data.config.start_date);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (data.config.end_date instanceof Date) {\r\n\t\t\t\t\t\tdata.config.end_date = convert(data.config.end_date);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (data.callback) {\r\n\t\t\t\treturn gantt.ext.export_api._ajaxToExport(data, type, data.callback);\r\n\t\t\t}\r\n\r\n\t\t\tconst form = gantt.ext.export_api._createHiddenForm();\r\n\t\t\tform.firstChild.action = data.server || gantt.ext.export_api._apiUrl;\r\n\t\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\t\tform.firstChild.childNodes[1].value = type;\r\n\t\t\tform.firstChild.submit();\r\n\t\t},\r\n\r\n\t\t_createHiddenForm() {\r\n\t\t\tif (!gantt.ext.export_api._hidden_export_form) {\r\n\t\t\t\tconst t = gantt.ext.export_api._hidden_export_form = document.createElement(\"div\");\r\n\t\t\t\tt.style.display = \"none\";\r\n\t\t\t\tt.innerHTML = \"\";\r\n\t\t\t\tdocument.body.appendChild(t);\r\n\t\t\t}\r\n\t\t\treturn gantt.ext.export_api._hidden_export_form;\r\n\t\t},\r\n\r\n\r\n\t\t_copyObjectBase(obj) {\r\n\t\t\tconst copy = {\r\n\t\t\t\tstart_date: undefined,\r\n\t\t\t\tend_date: undefined,\r\n\t\t\t\tconstraint_date: undefined,\r\n\t\t\t\tdeadline: undefined\r\n\t\t\t};\r\n\t\t\tfor (const key in obj) {\r\n\t\t\t\tif (key.charAt(0) === \"$\" || key === \"baselines\"){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcopy[key] = obj[key];\r\n\t\t\t}\r\n\t\t\tconst formatDate = gantt.templates.xml_format || gantt.templates.format_date;\r\n\r\n\t\t\tcopy.start_date = formatDate(copy.start_date);\r\n\t\t\tif (copy.end_date){\r\n\t\t\t\tcopy.end_date = formatDate(copy.end_date);\r\n\t\t\t}\r\n\t\t\tif (copy.constraint_date){\r\n\t\t\t\tcopy.constraint_date = formatDate(copy.constraint_date);\r\n\t\t\t}\r\n\t\t\tif (copy.deadline){\r\n\t\t\t\tcopy.deadline = formatDate(copy.deadline);\r\n\t\t\t}\r\n\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\r\n\t\t_color_box: null,\r\n\t\t_color_hash: {},\r\n\r\n\t\t_getStyles(css) {\r\n\t\t\tif (!gantt.ext.export_api._color_box) {\r\n\t\t\t\tgantt.ext.export_api._color_box = document.createElement(\"DIV\");\r\n\t\t\t\tgantt.ext.export_api._color_box.style.cssText = \"position:absolute; display:none;\";\r\n\t\t\t\tdocument.body.appendChild(gantt.ext.export_api._color_box);\r\n\t\t\t}\r\n\t\t\tif (gantt.ext.export_api._color_hash[css]){\r\n\t\t\t\treturn gantt.ext.export_api._color_hash[css];\r\n\t\t\t}\r\n\r\n\t\t\tgantt.ext.export_api._color_box.className = css;\r\n\t\t\tconst color = gantt.ext.export_api._getColor(gantt.ext.export_api._color_box, \"color\");\r\n\t\t\tconst backgroundColor = gantt.ext.export_api._getColor(gantt.ext.export_api._color_box, \"backgroundColor\");\r\n\t\t\treturn (gantt.ext.export_api._color_hash[css] = color + \";\" + backgroundColor);\r\n\t\t},\r\n\r\n\r\n\t\t_getMinutesWorktimeSettings(parsedRanges) {\r\n\t\t\tconst minutes:any = [];\r\n\t\t\tparsedRanges.forEach(function(range) {\r\n\t\t\t\tminutes.push(range.startMinute);\r\n\t\t\t\tminutes.push(range.endMinute);\r\n\t\t\t});\r\n\t\t\treturn minutes;\r\n\t\t},\r\n\r\n\t\t_getWorktimeSettings() {\r\n\r\n\t\t\tconst defaultWorkTimes = {\r\n\t\t\t\thours: [0, 24],\r\n\t\t\t\tminutes: null,\r\n\t\t\t\tdates: { 0: true, 1: true, 2: true, 3: true, 4: true, 5: true, 6: true }\r\n\t\t\t};\r\n\r\n\t\t\tlet time;\r\n\t\t\tif (!gantt.config.work_time) {\r\n\t\t\t\ttime = defaultWorkTimes;\r\n\t\t\t} else {\r\n\t\t\t\tconst wTime = gantt._working_time_helper;\r\n\t\t\t\tif (wTime && wTime.get_calendar) {\r\n\t\t\t\t\ttime = wTime.get_calendar();\r\n\t\t\t\t} else if (wTime) {\r\n\t\t\t\t\ttime = {\r\n\t\t\t\t\t\thours: wTime.hours,\r\n\t\t\t\t\t\tminutes: null,\r\n\t\t\t\t\t\tdates: wTime.dates\r\n\t\t\t\t\t};\r\n\t\t\t\t} else if (gantt.config.worktimes && gantt.config.worktimes.global) {\r\n\t\t\t\t\tconst settings = gantt.config.worktimes.global;\r\n\r\n\t\t\t\t\tif (settings.parsed) {\r\n\t\t\t\t\t\tconst minutes = gantt.ext.export_api._getMinutesWorktimeSettings(settings.parsed.hours);\r\n\t\t\t\t\t\ttime = {\r\n\t\t\t\t\t\t\thours: null,\r\n\t\t\t\t\t\t\tminutes,\r\n\t\t\t\t\t\t\tdates: {}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tfor (const i in settings.parsed.dates) {\r\n\t\t\t\t\t\t\tif (Array.isArray(settings.parsed.dates[i])) {\r\n\t\t\t\t\t\t\t\ttime.dates[i] = gantt.ext.export_api._getMinutesWorktimeSettings(settings.parsed.dates[i]);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ttime.dates[i] = settings.parsed.dates[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttime = {\r\n\t\t\t\t\t\t\thours: settings.hours,\r\n\t\t\t\t\t\t\tminutes: null,\r\n\t\t\t\t\t\t\tdates: settings.dates\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttime = defaultWorkTimes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn time;\r\n\t\t},\r\n\r\n\r\n\t\t_eachTaskTimed(start, end) {\r\n\t\t\treturn function(code, parent, master) {\r\n\t\t\t\tparent = parent || gantt.config.root_id;\r\n\t\t\t\tmaster = master || gantt;\r\n\r\n\t\t\t\tconst branch = gantt.getChildren(parent);\r\n\t\t\t\tif (branch){\r\n\t\t\t\t\tfor (let i = 0; i < branch.length; i++) {\r\n\t\t\t\t\t\tconst item = gantt._pull[branch[i]];\r\n\t\t\t\t\t\tif ((!start || item.end_date > start) && (!end || item.start_date < end)){\r\n\t\t\t\t\t\t\tcode.call(master, item);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (gantt.hasChild(item.id)){\r\n\t\t\t\t\t\t\tgantt.eachTask(code, item.id, master);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\r\n\r\n\t\t// patch broken json serialization in gantt 2.1\r\n\t\t_originalCopyObject: gantt.json._copyObject,\r\n\r\n\r\n\t\t_copyObjectPlain(obj) {\r\n\t\t\tconst text = gantt.templates.task_text(obj.start_date, obj.end_date, obj);\r\n\r\n\t\t\tconst copy = gantt.ext.export_api._copyObjectBase(obj);\r\n\t\t\tcopy.text = text || copy.text;\r\n\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\t\t_getColor(node, style) {\r\n\t\t\tconst value = node.currentStyle ? node.currentStyle[style] : getComputedStyle(node, null)[style];\r\n\t\t\tconst rgb = value.replace(/\\s/g, \"\").match(/^rgba?\\((\\d+),(\\d+),(\\d+)/i);\r\n\t\t\treturn ((rgb && rgb.length === 4) ?\r\n\t\t\t\t(\"0\" + parseInt(rgb[1], 10).toString(16)).slice(-2) +\r\n\t\t\t\t(\"0\" + parseInt(rgb[2], 10).toString(16)).slice(-2) +\r\n\t\t\t\t(\"0\" + parseInt(rgb[3], 10).toString(16)).slice(-2) : value).replace(\"#\", \"\");\r\n\t\t},\r\n\r\n\r\n\t\t// excel serialization\r\n\t\t_copyObjectTable(obj) {\r\n\t\t\t// Excel interprets UTC time as local time in every timezone, send local time instead of actual UTC time.\r\n\t\t\t// https://github.com/SheetJS/js-xlsx/issues/126#issuecomment-60531614\r\n\t\t\tconst toISOstring = gantt.date.date_to_str(\"%Y-%m-%dT%H:%i:%s.000Z\");\r\n\r\n\t\t\tconst copy = gantt.ext.export_api._copyObjectColumns(obj, gantt.ext.export_api._copyObjectPlain(obj));\r\n\t\t\tif (copy.start_date){\r\n\t\t\t\tcopy.start_date = toISOstring(obj.start_date);\r\n\t\t\t}\r\n\t\t\tif (copy.end_date){\r\n\t\t\t\tcopy.end_date = toISOstring(obj.end_date);\r\n\t\t\t}\r\n\r\n\t\t\t// private gantt._day_index_by_date was replaced by public gantt.columnIndexByDate in gantt 5.0\r\n\t\t\tconst getDayIndex = gantt._day_index_by_date ? gantt._day_index_by_date : gantt.columnIndexByDate;\r\n\r\n\t\t\tcopy.$start = getDayIndex.call(gantt, obj.start_date);\r\n\t\t\tcopy.$end = getDayIndex.call(gantt, obj.end_date);\r\n\r\n\t\t\t// GS-2100. Correct bar position considering hidden cells\r\n\t\t\tlet hiddenCells = 0;\r\n\t\t\tconst scaleCellsWidth = gantt.getScale().width;\r\n\t\t\tif (scaleCellsWidth.indexOf(0) > -1) {\r\n\t\t\t\tlet i = 0;\r\n\t\t\t\tfor (i; i < copy.$start; i++) {\r\n\t\t\t\t\tif (!scaleCellsWidth[i]) {\r\n\t\t\t\t\t\thiddenCells++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcopy.$start -= hiddenCells;\r\n\r\n\t\t\t\tfor (i; i < copy.$end; i++) {\r\n\t\t\t\t\tif (!scaleCellsWidth[i]) {\r\n\t\t\t\t\t\thiddenCells++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcopy.$end -= hiddenCells;\r\n\t\t\t}\r\n\r\n\t\t\tcopy.$level = obj.$level;\r\n\t\t\tcopy.$type = obj.$rendered_type;\r\n\r\n\t\t\tconst tmps = gantt.templates;\r\n\t\t\tcopy.$text = tmps.task_text(obj.start, obj.end_date, obj);\r\n\t\t\tcopy.$left = tmps.leftside_text ? tmps.leftside_text(obj.start, obj.end_date, obj) : \"\";\r\n\t\t\tcopy.$right = tmps.rightside_text ? tmps.rightside_text(obj.start, obj.end_date, obj) : \"\";\r\n\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\t\t_copyObjectColors(obj) {\r\n\t\t\tconst copy = gantt.ext.export_api._copyObjectTable(obj);\r\n\r\n\t\t\tconst node = gantt.getTaskNode(obj.id);\r\n\t\t\tif (node && node.firstChild) {\r\n\t\t\t\tlet color = gantt.ext.export_api._getColor((gantt._no_progress_colors ? node : node.firstChild), \"backgroundColor\");\r\n\t\t\t\tif (color === \"363636\"){\r\n\t\t\t\t\tcolor = gantt.ext.export_api._getColor(node, \"backgroundColor\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcopy.$color = color;\r\n\t\t\t} else if (obj.color){\r\n\t\t\t\tcopy.$color = obj.color;\r\n\t\t\t}\r\n\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\t\t_copyObjectColumns(obj, copy) {\r\n\t\t\tfor (let i = 0; i < gantt.config.columns.length; i++) {\r\n\t\t\t\tconst ct = gantt.config.columns[i].template;\r\n\t\t\t\tif (ct) {\r\n\t\t\t\t\tlet val = ct(obj);\r\n\t\t\t\t\tif (val instanceof Date){\r\n\t\t\t\t\t\tval = gantt.templates.date_grid(val, obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcopy[\"_\" + i] = val;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\t\t_copyObjectAll(obj) {\r\n\t\t\tconst copy = gantt.ext.export_api._copyObjectBase(obj);\r\n\r\n\t\t\tconst templates = [\r\n\t\t\t\t\"leftside_text\",\r\n\t\t\t\t\"rightside_text\",\r\n\t\t\t\t\"task_text\",\r\n\t\t\t\t\"progress_text\",\r\n\t\t\t\t\"task_class\"\r\n\t\t\t];\r\n\r\n\t\t\t// serialize all text templates\r\n\t\t\tfor (let i = 0; i < templates.length; i++) {\r\n\t\t\t\tconst template = gantt.templates[templates[i]];\r\n\t\t\t\tif (template){\r\n\t\t\t\t\tcopy[\"$\" + i] = template(obj.start_date, obj.end_date, obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tgantt.ext.export_api._copyObjectColumns(obj, copy);\r\n\t\t\tcopy.open = obj.$open;\r\n\t\t\treturn copy;\r\n\t\t},\r\n\r\n\r\n\t\t_serializeHtml() {\r\n\t\t\tconst smartScales = gantt.config.smart_scales;\r\n\t\t\tconst smartRendering = gantt.config.smart_rendering;\r\n\t\t\tif (smartScales || smartRendering) {\r\n\t\t\t\tgantt.config.smart_rendering = false;\r\n\t\t\t\tgantt.config.smart_scales = false;\r\n\t\t\t\tgantt.render();\r\n\t\t\t}\r\n\r\n\t\t\tconst html = gantt.$container.parentNode.innerHTML;\r\n\r\n\t\t\tif (smartScales || smartRendering) {\r\n\t\t\t\tgantt.config.smart_scales = smartScales;\r\n\t\t\t\tgantt.config.smart_rendering = smartRendering;\r\n\t\t\t\tgantt.render();\r\n\t\t\t}\r\n\r\n\t\t\treturn html;\r\n\t\t},\r\n\r\n\t\t_serializeAll() {\r\n\t\t\tgantt.json._copyObject = gantt.ext.export_api._copyObjectAll;\r\n\t\t\tconst data = gantt.ext.export_api._exportSerialize();\r\n\t\t\tgantt.json._copyObject = gantt.ext.export_api._originalCopyObject;\r\n\t\t\treturn data;\r\n\t\t},\r\n\r\n\t\t_serializePlain() {\r\n\t\t\tconst oldXmlFormat = gantt.templates.xml_format;\r\n\t\t\tconst oldFormatDate = gantt.templates.format_date;\r\n\t\t\tgantt.templates.xml_format = gantt.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\t\t\tgantt.templates.format_date = gantt.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\t\t\tgantt.json._copyObject = gantt.ext.export_api._copyObjectPlain;\r\n\r\n\t\t\tconst data = gantt.ext.export_api._exportSerialize();\r\n\r\n\t\t\tgantt.templates.xml_format = oldXmlFormat;\r\n\t\t\tgantt.templates.format_date = oldFormatDate;\r\n\t\t\tgantt.json._copyObject = gantt.ext.export_api._originalCopyObject;\r\n\r\n\t\t\tdelete data.links;\r\n\t\t\treturn data;\r\n\t\t},\r\n\r\n\t\t_getRaw() {\r\n\t\t\t// support Gantt < 5.0\r\n\t\t\tif (gantt._scale_helpers) {\r\n\t\t\t\tconst scales = gantt._get_scales();\r\n\t\t\t\tconst\tminWidth = gantt.config.min_column_width;\r\n\t\t\t\tconst\tautosizeMinWidth = gantt._get_resize_options().x ? Math.max(gantt.config.autosize_min_width, 0) : gantt.config.$task.offsetWidth;\r\n\t\t\t\tconst\theight = gantt.config.config.scale_height - 1;\r\n\t\t\t\treturn gantt._scale_helpers.prepareConfigs(scales, minWidth, autosizeMinWidth, height);\r\n\t\t\t} else { // Gantt >= 5.0\r\n\t\t\t\tconst timeline = gantt.$ui.getView(\"timeline\");\r\n\t\t\t\tif (timeline) {\r\n\t\t\t\t\tlet availWidth = timeline.$config.width;\r\n\t\t\t\t\tif (gantt.config.autosize === \"x\" || gantt.config.autosize === \"xy\") {\r\n\t\t\t\t\t\tavailWidth = Math.max(gantt.config.autosize_min_width, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst state = gantt.getState();\r\n\t\t\t\t\tconst\tscales = timeline._getScales();\r\n\t\t\t\t\tconst\tminWidth = gantt.config.min_column_width;\r\n\t\t\t\t\tconst\theight = gantt.config.scale_height - 1;\r\n\t\t\t\t\tconst\trtl = gantt.config.rtl;\r\n\t\t\t\t\treturn timeline.$scaleHelper.prepareConfigs(scales, minWidth, availWidth, height, state.min_date, state.max_date, rtl);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_serializeTimeline(config) {\r\n\t\t\tgantt.json._copyObject = config.visual ? gantt.ext.export_api._copyObjectColors : gantt.ext.export_api._copyObjectTable;\r\n\t\t\tconst data = gantt.ext.export_api._exportSerialize();\r\n\t\t\tgantt.json._copyObject = gantt.ext.export_api._originalCopyObject;\r\n\r\n\t\t\tdelete data.links;\r\n\r\n\t\t\tif (config.cellColors) {\r\n\t\t\t\tconst css = gantt.templates.timeline_cell_class || gantt.templates.task_cell_class;\r\n\t\t\t\tif (css) {\r\n\t\t\t\t\tconst raw = gantt.ext.export_api._getRaw();\r\n\t\t\t\t\tlet steps = raw[0].trace_x;\r\n\t\t\t\t\tfor (let i = 1; i < raw.length; i++){\r\n\t\t\t\t\t\tif (raw[i].trace_x.length > steps.length){\r\n\t\t\t\t\t\t\tsteps = raw[i].trace_x;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (let i = 0; i < data.data.length; i++) {\r\n\t\t\t\t\t\tdata.data[i].styles = [];\r\n\t\t\t\t\t\tconst task = gantt.getTask(data.data[i].id);\r\n\t\t\t\t\t\tfor (let j = 0; j < steps.length; j++) {\r\n\t\t\t\t\t\t\tconst date = steps[j];\r\n\t\t\t\t\t\t\tconst cellCss = css(task, date);\r\n\t\t\t\t\t\t\tif (cellCss){\r\n\t\t\t\t\t\t\t\tdata.data[i].styles.push({ index: j, styles: gantt.ext.export_api._getStyles(cellCss) });\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t},\r\n\r\n\t\t_serializeScales(config) {\r\n\t\t\tconst scales:any = [];\r\n\t\t\tconst raw = gantt.ext.export_api._getRaw();\r\n\r\n\t\t\tlet min = Infinity;\r\n\t\t\tlet max = 0;\r\n\t\t\tfor (let i = 0; i < raw.length; i++) {\r\n\t\t\t\tmin = Math.min(min, raw[i].col_width);\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = 0; i < raw.length; i++) {\r\n\t\t\t\tlet start = 0;\r\n\t\t\t\tlet end = 0;\r\n\t\t\t\tconst row:any = [];\r\n\r\n\t\t\t\tscales.push(row);\r\n\t\t\t\tconst step = raw[i];\r\n\t\t\t\tmax = Math.max(max, step.trace_x.length);\r\n\t\t\t\tconst template = step.format || step.template || (step.date ? gantt.date.date_to_str(step.date) : gantt.config.date_scale);\r\n\r\n\t\t\t\tfor (let j = 0; j < step.trace_x.length; j++) {\r\n\t\t\t\t\tconst date = step.trace_x[j];\r\n\t\t\t\t\tend = start + Math.round(step.width[j] / min);\r\n\r\n\t\t\t\t\tconst scaleCell = { text: template(date), start, end, styles: \"\" };\r\n\r\n\t\t\t\t\tif (config.cellColors) {\r\n\t\t\t\t\t\tconst css = step.css || gantt.templates.scaleCell_class;\r\n\t\t\t\t\t\tif (css) {\r\n\t\t\t\t\t\t\tconst scaleCss = css(date);\r\n\t\t\t\t\t\t\tif (scaleCss){\r\n\t\t\t\t\t\t\t\tscaleCell.styles = gantt.ext.export_api._getStyles(scaleCss);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.push(scaleCell);\r\n\t\t\t\t\tstart = end;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { width: max, height: scales.length, data: scales };\r\n\t\t},\r\n\r\n\t\t_serializeGrid(config) {\r\n\t\t\tgantt.exportMode = true;\r\n\r\n\t\t\tconst columns:any = [];\r\n\t\t\tconst cols = gantt.config.columns;\r\n\r\n\t\t\tlet ccount = 0;\r\n\t\t\tfor (let i = 0; i < cols.length; i++) {\r\n\t\t\t\tif (cols[i].name === \"add\" || cols[i].name === \"buttons\") {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumns[ccount] = {\r\n\t\t\t\t\tid: ((cols[i].template) ? (\"_\" + i) : cols[i].name),\r\n\t\t\t\t\theader: cols[i].label || gantt.locale.labels[\"column_\" + cols[i].name],\r\n\t\t\t\t\twidth: (cols[i].width ? Math.floor(cols[i].width / 4) : \"\"),\r\n\t\t\t\t\ttree: cols[i].tree || false\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (cols[i].name === \"duration\"){\r\n\t\t\t\t\tcolumns[ccount].type = \"number\";\r\n\t\t\t\t}\r\n\t\t\t\tif (cols[i].name === \"start_date\" || cols[i].name === \"end_date\") {\r\n\t\t\t\t\tcolumns[ccount].type = \"date\";\r\n\t\t\t\t\tif (config && config.rawDates){\r\n\t\t\t\t\t\tcolumns[ccount].id = cols[i].name;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tccount++;\r\n\t\t\t}\r\n\r\n\t\t\tgantt.exportMode = false;\r\n\t\t\treturn columns;\r\n\t\t},\r\n\r\n\t\t_exportSerialize() {\r\n\t\t\tgantt.exportMode = true;\r\n\r\n\t\t\tconst xmlFormat = gantt.templates.xml_format;\r\n\t\t\tconst formatDate = gantt.templates.format_date;\r\n\r\n\t\t\t// use configuration date format for serialization so date could be parsed on the export\r\n\t\t\t// required when custom format date function is defined\r\n\t\t\tgantt.templates.xml_format =\r\n\t\t\t\tgantt.templates.format_date =\r\n\t\t\t\tgantt.date.date_to_str(gantt.config.date_format || gantt.config.xml_date);\r\n\r\n\t\t\tconst data = gantt.serialize();\r\n\r\n\t\t\tgantt.templates.xml_format = xmlFormat;\r\n\t\t\tgantt.templates.format_date = formatDate;\r\n\t\t\tgantt.exportMode = false;\r\n\t\t\treturn data;\r\n\t\t},\r\n\r\n\r\n\t\t_setLevel(data) {\r\n\t\t\tfor (let i = 0; i < data.length; i++) {\r\n\t\t\t\t// tslint:disable-next-line triple-equals\r\n\t\t\t\tif (data[i].parent == 0) {\r\n\t\t\t\t\tdata[i]._lvl = 1;\r\n\t\t\t\t}\r\n\t\t\t\tfor (let j = i + 1; j < data.length; j++) {\r\n\t\t\t\t\t// tslint:disable-next-line triple-equals\r\n\t\t\t\t\tif (data[i].id == data[j].parent) {\r\n\t\t\t\t\t\tdata[j]._lvl = data[i]._lvl + 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_clearLevel(data) {\r\n\t\t\tfor (let i = 0; i < data.length; i++) {\r\n\t\t\t\tdelete data[i]._lvl;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_clearRecLinks(data) {\r\n\t\t\tgantt.ext.export_api._setLevel(data.data);\r\n\t\t\tconst tasks = {};\r\n\t\t\tfor (let i = 0; i < data.data.length; i++) {\r\n\t\t\t\ttasks[data.data[i].id] = data.data[i];\r\n\t\t\t}\r\n\r\n\t\t\tconst links = {};\r\n\r\n\t\t\tfor (let i = 0; i < data.links.length; i++) {\r\n\t\t\t\tconst link = data.links[i];\r\n\t\t\t\tif (gantt.isTaskExists(link.source) && gantt.isTaskExists(link.target) &&\r\n\t\t\t\t\ttasks[link.source] && tasks[link.target]) {\r\n\t\t\t\t\tlinks[link.id] = link;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (const j in links) {\r\n\t\t\t\tgantt.ext.export_api._makeLinksSameLevel(links[j], tasks);\r\n\t\t\t}\r\n\r\n\t\t\tconst skippedLinks = {};\r\n\t\t\tfor (const j in tasks) {\r\n\t\t\t\tgantt.ext.export_api._clearCircDependencies(tasks[j], links, tasks, {}, skippedLinks, null);\r\n\t\t\t}\r\n\r\n\t\t\tif (Object.keys(links)) {\r\n\t\t\t\tgantt.ext.export_api._clearLinksSameLevel(links, tasks);\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = 0; i < data.links.length; i++) {\r\n\t\t\t\tif (!links[data.links[i].id]) {\r\n\t\t\t\t\tdata.links.splice(i, 1);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tgantt.ext.export_api._clearLevel(data.data);\r\n\t\t},\r\n\r\n\t\t_clearCircDependencies(task, links, tasks, usedTasks, skippedLinks, prevLink) {\r\n\t\t\tconst sources = task.$_source;\r\n\t\t\tif (!sources) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (usedTasks[task.id]) {\r\n\t\t\t\tgantt.ext.export_api._onCircDependencyFind(prevLink, links, usedTasks, skippedLinks);\r\n\t\t\t}\r\n\r\n\t\t\tusedTasks[task.id] = true;\r\n\r\n\t\t\tconst targets = {};\r\n\r\n\t\t\tfor (let i = 0; i < sources.length; i++) {\r\n\t\t\t\tif (skippedLinks[sources[i]]) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tconst curLink = links[sources[i]];\r\n\t\t\t\tconst targetTask = tasks[curLink._target];\r\n\t\t\t\tif (targets[targetTask.id]) { // two link from one task to another\r\n\t\t\t\t\tgantt.ext.export_api._onCircDependencyFind(curLink, links, usedTasks, skippedLinks);\r\n\t\t\t\t}\r\n\t\t\t\ttargets[targetTask.id] = true;\r\n\t\t\t\tgantt.ext.export_api._clearCircDependencies(targetTask, links, tasks, usedTasks, skippedLinks, curLink);\r\n\t\t\t}\r\n\t\t\tusedTasks[task.id] = false;\r\n\t\t},\r\n\r\n\t\t_onCircDependencyFind(link, links, usedTasks, skippedLinks) {\r\n\t\t\tif (link) {\r\n\t\t\t\tif (gantt.callEvent(\"onExportCircularDependency\", [link.id, link])) {\r\n\t\t\t\t\tdelete links[link.id];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdelete usedTasks[link._source];\r\n\t\t\t\tdelete usedTasks[link._target];\r\n\t\t\t\tskippedLinks[link.id] = true;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_makeLinksSameLevel(link, tasks) {\r\n\t\t\tlet task;\r\n\t\t\tlet targetLvl;\r\n\t\t\tconst linkT = {\r\n\t\t\t\ttarget: tasks[link.target],\r\n\t\t\t\tsource: tasks[link.source]\r\n\t\t\t};\r\n\t\t\t// tslint:disable-next-line triple-equals\r\n\t\t\tif (linkT.target._lvl != linkT.source._lvl) {\r\n\t\t\t\tif (linkT.target._lvl < linkT.source._lvl) {\r\n\t\t\t\t\ttask = \"source\";\r\n\t\t\t\t\ttargetLvl = linkT.target._lvl;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttask = \"target\";\r\n\t\t\t\t\ttargetLvl = linkT.source._lvl;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdo {\r\n\t\t\t\t\tconst parent = tasks[linkT[task].parent];\r\n\t\t\t\t\tif (!parent) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlinkT[task] = parent;\r\n\t\t\t\t} while (linkT[task]._lvl < targetLvl);\r\n\r\n\t\t\t\tlet sourceParent = tasks[linkT.source.parent];\r\n\t\t\t\tlet\ttargetParent = tasks[linkT.target.parent];\r\n\t\t\t\t// tslint:disable-next-line triple-equals\r\n\t\t\t\twhile (sourceParent && targetParent && sourceParent.id != targetParent.id) {\r\n\t\t\t\t\tlinkT.source = sourceParent;\r\n\t\t\t\t\tlinkT.target = targetParent;\r\n\t\t\t\t\tsourceParent = tasks[linkT.source.parent];\r\n\t\t\t\t\ttargetParent = tasks[linkT.target.parent];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlink._target = linkT.target.id;\r\n\t\t\tlink._source = linkT.source.id;\r\n\r\n\t\t\tif (!linkT.target.$_target){\r\n\t\t\t\tlinkT.target.$_target = [];\r\n\t\t\t}\r\n\t\t\tlinkT.target.$_target.push(link.id);\r\n\r\n\t\t\tif (!linkT.source.$_source){\r\n\t\t\t\tlinkT.source.$_source = [];\r\n\t\t\t}\r\n\t\t\tlinkT.source.$_source.push(link.id);\r\n\t\t},\r\n\r\n\t\t_clearLinksSameLevel(links, tasks) {\r\n\t\t\tfor (const link in links) {\r\n\t\t\t\tdelete links[link]._target;\r\n\t\t\t\tdelete links[link]._source;\r\n\t\t\t}\r\n\r\n\t\t\tfor (const task in tasks) {\r\n\t\t\t\tdelete tasks[task].$_source;\r\n\t\t\t\tdelete tasks[task].$_target;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\t_customProjectProperties(data, config) {\r\n\t\t\tif (config && config.project) {\r\n\t\t\t\tfor (const i in config.project) {\r\n\t\t\t\t\tif (!gantt.config.$custom_data){\r\n\t\t\t\t\t\tgantt.config.$custom_data = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt.config.$custom_data[i] = typeof config.project[i] === \"function\" ? config.project[i](gantt.config) : config.project[i];\r\n\t\t\t\t}\r\n\t\t\t\tdelete config.project;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_customTaskProperties(data, config) {\r\n\t\t\tif (config && config.tasks) {\r\n\t\t\t\tdata.data.forEach(function(el) {\r\n\t\t\t\t\tfor (const i in config.tasks) {\r\n\t\t\t\t\t\tif (!el.$custom_data){\r\n\t\t\t\t\t\t\tel.$custom_data = {};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tel.$custom_data[i] = typeof config.tasks[i] === \"function\" ? config.tasks[i](el, gantt.config) : config.tasks[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tdelete config.tasks;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_exportConfig(data, config) {\r\n\t\t\tconst projectName = config.name || \"gantt.xml\";\r\n\t\t\tdelete config.name;\r\n\r\n\t\t\tgantt.config.custom = config;\r\n\r\n\t\t\tconst time = gantt.ext.export_api._getWorktimeSettings();\r\n\r\n\t\t\tconst projectDates = gantt.getSubtaskDates();\r\n\t\t\tif (projectDates.start_date && projectDates.end_date) {\r\n\t\t\t\tconst formatDate = gantt.templates.format_date || gantt.templates.xml_format;\r\n\t\t\t\tgantt.config.start_end = {\r\n\t\t\t\t\tstart_date: formatDate(projectDates.start_date),\r\n\t\t\t\t\tend_date: formatDate(projectDates.end_date)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tconst manual = config.auto_scheduling === undefined ? false : !!config.auto_scheduling;\r\n\r\n\t\t\tconst res = {\r\n\t\t\t\tcallback: config.callback || null,\r\n\t\t\t\tconfig: gantt.config,\r\n\t\t\t\tdata,\r\n\t\t\t\tmanual,\r\n\t\t\t\tname: projectName,\r\n\t\t\t\tworktime: time\r\n\t\t\t};\r\n\t\t\tfor (const i in config) {\r\n\t\t\t\tres[i] = config[i];\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\r\n\t\t_sendImportAjaxMSP(config) {\r\n\t\t\tconst url = config.server || gantt.ext.export_api._apiUrl;\r\n\t\t\tconst store = config.store || 0;\r\n\t\t\tconst formData = config.data;\r\n\t\t\tconst callback = config.callback;\r\n\r\n\t\t\tconst settings = {\r\n\t\t\t\tdurationUnit: config.durationUnit || undefined,\r\n\t\t\t\tprojectProperties: config.projectProperties || undefined,\r\n\t\t\t\ttaskProperties: config.taskProperties || undefined\r\n\t\t\t};\r\n\r\n\t\t\tformData.append(\"type\", config.type || \"msproject-parse\");\r\n\t\t\tformData.append(\"data\", JSON.stringify(settings));\r\n\r\n\t\t\tif (store){\r\n\t\t\t\tformData.append(\"store\", store);\r\n\t\t\t}\r\n\r\n\t\t\tconst xhr = new XMLHttpRequest();\r\n\t\t\txhr.onreadystatechange = function(e) {\r\n\t\t\t\tif (xhr.readyState === 4 && xhr.status === 0) {// network error\r\n\t\t\t\t\tif (callback) {\r\n\t\t\t\t\t\tcallback(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\txhr.onload = function(){\r\n\t\t\t\tconst fail = xhr.status > 400;\r\n\t\t\t\tlet info = null;\r\n\r\n\t\t\t\tif (!fail) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tinfo = JSON.parse(xhr.responseText);\r\n\t\t\t\t\t} catch (e) { }\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (callback) {\r\n\t\t\t\t\tcallback(info);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\txhr.open(\"POST\", url, true);\r\n\t\t\txhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\t\t\txhr.send(formData);\r\n\t\t}\r\n\r\n\t};\r\n\r\n\r\n\tgantt.exportToPDF = gantt.ext.export_api.exportToPDF;\r\n\tgantt.exportToPNG = gantt.ext.export_api.exportToPNG;\r\n\tgantt.exportToICal = gantt.ext.export_api.exportToICal;\r\n\tgantt.exportToExcel = gantt.ext.export_api.exportToExcel;\r\n\tgantt.exportToJSON = gantt.ext.export_api.exportToJSON;\r\n\tgantt.importFromExcel = gantt.ext.export_api.importFromExcel;\r\n\tgantt.importFromMSProject = gantt.ext.export_api.importFromMSProject;\r\n\tgantt.exportToMSProject = gantt.ext.export_api.exportToMSProject;\r\n\tgantt.importFromPrimaveraP6 = gantt.ext.export_api.importFromPrimaveraP6;\r\n\tgantt.exportToPrimaveraP6 = gantt.ext.export_api.exportToPrimaveraP6;\r\n\r\n\r\n\treturn gantt.ext.export_api;\r\n}\r\n","export default {\r\n\tKEY_CODES: {\r\n\t\tUP: 38,\r\n\t\tDOWN: 40,\r\n\t\tLEFT: 37,\r\n\t\tRIGHT: 39,\r\n\t\tSPACE: 32,\r\n\t\tENTER: 13,\r\n\t\tDELETE: 46,\r\n\t\tESC: 27,\r\n\t\tTAB: 9\r\n\t}\r\n};","export default class ExtensionsManager{\r\n\tprivate _extensions:{[key:string]: GanttPlugin };\r\n\r\n\tconstructor(config: {[key:string]: GanttPlugin }){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension = (name: string, ext: GanttPlugin) => {\r\n\t\tthis._extensions[name] = ext;\r\n\t};\r\n\r\n\tgetExtension = (name: string): GanttPlugin => {\r\n\t\treturn this._extensions[name];\r\n\t};\r\n}","type DurationUnits = \"minute\" | \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\r\ntype Align = \"left\" | \"center\" | \"right\";\r\ntype SectionType = \"textarea\"\r\n\t\t\t\t\t| \"time\"\r\n\t\t\t\t\t| \"duration\"\r\n\t\t\t\t\t| \"select\"\r\n\t\t\t\t\t| \"typeselect\"\r\n\t\t\t\t\t| \"parent\"\r\n\t\t\t\t\t| \"template\"\r\n\t\t\t\t\t| \"checkbox\"\r\n\t\t\t\t\t| \"radio\"\r\n\t\t\t\t\t| \"resources\"\r\n\t\t\t\t\t| \"constraint\";\r\n\r\ntype LightboxSection = Array;\r\n\r\ntype LayoutView = \"grid\"\r\n\t| \"timeline\"\r\n\t| \"resizer\"\r\n\t| \"scrollbar\"\r\n\t| \"resourceGrid\"\r\n\t| \"resourceTimeline\";\r\n\r\ninterface IColumnItem {\r\n\tname: string;\r\n\tlabel?: string;\r\n\ttree?: boolean;\r\n\talign?: Align;\r\n\thide?: boolean;\r\n\tmax_width?: number;\r\n\tmin_width?: number;\r\n\tresize?: boolean;\r\n\ttemplate?: (obj: any) => string;\r\n\twidth?: number | \"*\";\r\n}\r\n\r\nexport type TModifierKeys = \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\" | false | undefined;\r\n\r\nexport interface IScale {\r\n\tcss?: () => string;\r\n\tdate?: string;\r\n\tstep: number;\r\n\ttemplate?: (date: Date) => string;\r\n\tunit: DurationUnits;\r\n}\r\n\r\ninterface ILightboxSection {\r\n\tname: string;\r\n\tmap_to: string;\r\n\ttype: SectionType;\r\n\theight?: number;\r\n\tfocus?: boolean;\r\n}\r\n\r\ninterface ILightboxTimeAndDurationSection extends ILightboxSection {\r\n\treadonly: boolean;\r\n\tyear_range: number[] | number;\r\n\tsingle_date: boolean;\r\n\ttime_format: string;\r\n}\r\n\r\ninterface ILightboxInputControl extends ILightboxSection {\r\n\tdefault_value?: any;\r\n\toptions?: Array<{key: string, label: string}>;\r\n}\r\n\r\ninterface ILightboxSelectControl extends ILightboxInputControl {\r\n\tonchange: () => boolean | undefined;\r\n}\r\n\r\ninterface ILightboxParentControl extends ILightboxSection {\r\n\tallow_root: boolean;\r\n\troot_label: string;\r\n\tsort?: (a: any, b: any) => -1 | 0 | 1;\r\n\tfilter?: (task: string | number | object) => boolean;\r\n\ttemplate?: (start: Date, end: Date, ev: object) => string;\r\n}\r\n\r\ninterface ILightboxTypeselectControl extends ILightboxSection {\r\n\tfilter?: (typeName: string) => boolean;\r\n}\r\n\r\n\r\ninterface ILayoutScrollbar {\r\n\tview: \"scrollbar\";\r\n\tscroll?: \"x\" | \"y\";\r\n\tid: string;\r\n\theight?: number;\r\n\twidth?: number;\r\n}\r\n\r\ninterface ILayoutView {\r\n\tview: LayoutView;\r\n\tid?: string;\r\n\tscrollX?: string;\r\n\tscrollY?: string;\r\n\tconfig?: object;\r\n}\r\n\r\ninterface ILayoutGrid extends ILayoutView {\r\n\tview: \"grid\";\r\n\tbind?: string;\r\n}\r\n\r\ninterface ILayoutTimeline extends ILayoutView {\r\n\tview: \"timeline\";\r\n\tbindLinks?: string;\r\n\tlayers?: any[];\r\n}\r\n\r\ninterface ILayoutResizer {\r\n\tview?: undefined;\r\n\tresizer: boolean;\r\n\twidth: number;\r\n}\r\n\r\ninterface ILayoutResourceGrid extends ILayoutView {\r\n\tview: \"resourceGrid\";\r\n\twidth: number;\r\n\tgroup: \"string\";\r\n}\r\n\r\ninterface ILayoutResourceTimeline extends ILayoutView {\r\n\tview: \"resourceTimeline\";\r\n\twidth: number;\r\n\tgroup: \"string\";\r\n}\r\n\r\ninterface ILayoutHtml {\r\n\thtml: string;\r\n\tcss: string;\r\n\twidth: number;\r\n}\r\n\r\ntype LayoutRow = ILayoutGrid\r\n\t| ILayoutTimeline\r\n\t| ILayoutResizer\r\n\t| ILayoutResourceGrid\r\n\t| ILayoutResourceTimeline\r\n\t| ILayoutHtml\r\n\t| ILayoutScrollbar\r\n\t| { cols: LayoutCol[] };\r\n\r\ntype LayoutCol = ILayoutGrid\r\n\t| ILayoutTimeline\r\n\t| ILayoutResizer\r\n\t| ILayoutResourceGrid\r\n\t| ILayoutResourceTimeline\r\n\t| ILayoutHtml\r\n\t| ILayoutScrollbar\r\n\t| { rows: LayoutRow[] };\r\n\r\ninterface ILayout {\r\n\tcss: string;\r\n\trows?: LayoutRow[];\r\n\tcols?: LayoutCol[];\r\n}\r\n\r\ntype TCsp = boolean | \"auto\";\r\n\r\ninterface IResourceConfig {\r\n\tdataprocessor_assignments?: boolean;\r\n\tdataprocessor_resources?: boolean;\r\n\teditable_resource_diagram?: boolean;\r\n\tresource_store?: {\r\n\t\ttype?: \"treeDataStore\"|\"dataStore\"|string;\r\n\t\tfetchTasks?: boolean;\r\n\t\tinitItem?: (item: any) => any;\r\n\t};\r\n\tlightbox_resources?: (resources: any[]) => any[];\r\n\r\n}\r\n\r\ninterface IGanttConfig {\r\n\tlayout: ILayout;\r\n\tlinks: {\r\n\t\tfinish_to_start: \"0\";\r\n\t\tstart_to_start: \"1\";\r\n\t\tfinish_to_finish: \"2\";\r\n\t\tstart_to_finish: \"3\";\r\n\t};\r\n\ttypes: {\r\n\t\ttask: string;\r\n\t\tproject: string;\r\n\t\tmilestone: string;\r\n\t};\r\n\tauto_types: boolean;\r\n\tduration_unit: DurationUnits;\r\n\twork_time: boolean;\r\n\tcorrect_work_time: boolean;\r\n\tdeadlines: boolean;\r\n\tskip_off_time: boolean;\r\n\tcascade_delete: boolean;\r\n\tautosize: boolean | string;\r\n\tautoscroll: boolean;\r\n\tshow_links: boolean;\r\n\tshow_task_cells: boolean;\r\n\tautosize_min_width: number;\r\n\tautoscroll_speed: number;\r\n\tdeepcopy_on_parse: boolean;\r\n\tstatic_background: boolean;\r\n\tstatic_background_cells: boolean;\r\n\tbranch_loading: boolean;\r\n\tbranch_loading_property: string;\r\n\tshow_loading: boolean;\r\n\tshow_chart: boolean;\r\n\tshow_grid: boolean;\r\n\tmin_duration: number;\r\n\tdate_format: string; // use instead xml_date\r\n\txml_date?: string; // deprecated\r\n\tstart_on_monday: boolean;\r\n\tserver_utc: boolean;\r\n\tshow_progress: boolean;\r\n\tfit_tasks: boolean;\r\n\tselect_task: boolean;\r\n\tscroll_on_click: boolean;\r\n\tsmart_rendering: boolean;\r\n\tpreserve_scroll: boolean;\r\n\treadonly: boolean;\r\n\tcontainer_resize_timeout: number;\r\n\r\n\t/*grid */\r\n\tdate_grid: string;\r\n\r\n\tdrag_links: boolean;\r\n\tdrag_progress: boolean;\r\n\tdrag_resize: boolean;\r\n\tdrag_project: boolean;\r\n\tdrag_move: boolean;\r\n\tdrag_mode: {\r\n\t\tresize: \"resize\",\r\n\t\tprogress: \"progress\",\r\n\t\tmove: \"move\",\r\n\t\tignore: \"ignore\"\r\n\t};\r\n\tround_dnd_dates: boolean;\r\n\tlink_wrapper_width: number;\r\n\troot_id: string | number;\r\n\r\n\tlink_arrow_size:number;\r\n\r\n\tautofit: boolean;\r\n\tcolumns: IColumnItem[];\r\n\r\n\t/* scale*/\r\n\t/* it will be deprecated */\r\n\tdate_scale?: string;\r\n\tstep?: number;\r\n\tscale_unit?: DurationUnits;\r\n\tsubscales?: IScale[];\r\n\t/* it will be deprecated end */\r\n\r\n\tscales: IScale[];\r\n\r\n\tscale_offset_minimal: boolean;\r\n\r\n\tinherit_scale_class: boolean;\r\n\r\n\r\n\ttime_step: number;\r\n\tduration_step: number;\r\n\r\n\r\n\ttask_date: string;\r\n\ttime_picker: string;\r\n\ttask_attribute: string;\r\n\tlink_attribute: string;\r\n\tlayer_attribute: string;\r\n\tbuttons_left: string[];\r\n\t_migrate_buttons: {\r\n\t\tdhx_save_btn: \"gantt_save_btn\",\r\n\t\tdhx_cancel_btn: \"gantt_cancel_btn\",\r\n\t\tdhx_delete_btn: \"gantt_delete_btn\"\r\n\t};\r\n\r\n\tbuttons_right: string[];\r\n\r\n\r\n\tlightbox: {\r\n\t\tsections?: LightboxSection,\r\n\t\tproject_sections?: LightboxSection,\r\n\t\tmilestone_sections?: LightboxSection\r\n\t};\r\n\tdrag_lightbox: boolean;\r\n\tsort: boolean;\r\n\tdetails_on_create: boolean;\r\n\tdetails_on_dblclick: boolean;\r\n\tinitial_scroll: boolean;\r\n\ttask_scroll_offset: number;\r\n\r\n\torder_branch: boolean;\r\n\torder_branch_free: boolean;\r\n\r\n\t// task_height is deprecated, use 'bar_height` instead\r\n\ttask_height: number | \"full\" | undefined;\r\n\tbar_height: number | \"full\";\r\n\tmin_column_width: number;\r\n\tbar_height_padding: number,\r\n\trow_height: number,\r\n\r\n\t// min width for grid column (when resizing)\r\n\tmin_grid_column_width: number;\r\n\t// name of the attribute with column index for resize element\r\n\tgrid_resizer_column_attribute: string;\r\n\t// name of the attribute with column index for resize element\r\n\t// grid_resizer_attribute: string; // usage of this parameter is not found\r\n\r\n\t// grid width can be increased after the column has been resized\r\n\tkeep_grid_width: boolean;\r\n\r\n\t// grid width can be adjusted\r\n\tgrid_resize: boolean;\r\n\tgrid_elastic_columns: boolean;\r\n\tshow_tasks_outside_timescale: boolean;\r\n\tshow_unscheduled: boolean;\r\n\treadonly_property: string;\r\n\teditable_property: string;\r\n\tcalendar_property: string;\r\n\tresource_calendars: object;\r\n\tdynamic_resource_calendars: boolean;\r\n\tinherit_calendar: boolean;\r\n\ttype_renderers: object;\r\n\r\n\tresize_rows: boolean;\r\n\t// name of the attribute with row index for resize element\r\n\ttask_grid_row_resizer_attribute: string;\r\n\t// min height for row (when resizing)\r\n\tmin_task_grid_row_height: number;\r\n\r\n\topen_tree_initially: boolean;\r\n\toptimize_render: boolean;\r\n\tprevent_default_scroll: boolean;\r\n\tshow_errors: boolean;\r\n\twai_aria_attributes: boolean;\r\n\tsmart_scales: boolean;\r\n\trtl: boolean;\r\n\tplaceholder_task: boolean | object;\r\n\thorizontal_scroll_key: TModifierKeys;\r\n\tdrag_timeline: {\r\n\t\tuseKey: TModifierKeys;\r\n\t\tignore: string;\r\n\t\trender?: boolean;\r\n\t};\r\n\tdrag_multiple: boolean;\r\n\tcsp: TCsp;\r\n\r\n\tresources?: IResourceConfig;\r\n}\r\n\r\nexport default () => {\r\n\tconst result: IGanttConfig = {\r\n\t\tlayout: {\r\n\t\t\tcss: \"gantt_container\",\r\n\t\t\trows: [\r\n\t\t\t\t{\r\n\t\t\t\t\tcols: [\r\n\t\t\t\t\t\t{view: \"grid\", scrollX: \"scrollHor\", scrollY: \"scrollVer\"},\r\n\t\t\t\t\t\t{resizer: true, width: 1},\r\n\t\t\t\t\t\t{view: \"timeline\", scrollX: \"scrollHor\", scrollY: \"scrollVer\"},\r\n\t\t\t\t\t\t{view: \"scrollbar\", id: \"scrollVer\"}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{view: \"scrollbar\", id: \"scrollHor\", height: 20}\r\n\t\t\t]\r\n\t\t},\r\n\t\tlinks: {\r\n\t\t\tfinish_to_start: \"0\",\r\n\t\t\tstart_to_start: \"1\",\r\n\t\t\tfinish_to_finish: \"2\",\r\n\t\t\tstart_to_finish: \"3\"\r\n\t\t},\r\n\t\ttypes: {\r\n\t\t\ttask: \"task\",\r\n\t\t\tproject: \"project\",\r\n\t\t\tmilestone: \"milestone\"\r\n\t\t},\r\n\t\tauto_types: false,\r\n\t\tduration_unit: \"day\",\r\n\t\twork_time: false,\r\n\t\tcorrect_work_time: false,\r\n\t\tskip_off_time: false,\r\n\r\n\t\tcascade_delete: true,\r\n\r\n\t\tautosize: false,\r\n\t\tautosize_min_width: 0,\r\n\t\tautoscroll: true,\r\n\t\tautoscroll_speed: 30,\r\n\t\tdeepcopy_on_parse: false,\r\n\t\tshow_links: true,\r\n\t\tshow_task_cells: true,\r\n\t\t// replace backgroung of the task area with a canvas img\r\n\t\tstatic_background: false,\r\n\t\tstatic_background_cells: true,\r\n\t\tbranch_loading: false,\r\n\t\tbranch_loading_property: \"$has_child\",\r\n\t\tshow_loading: false,\r\n\t\tshow_chart: true,\r\n\t\tshow_grid: true,\r\n\t\tmin_duration: 60 * 60 * 1000,\r\n\t\tdate_format: \"%d-%m-%Y %H:%i\", // use instead xml_date\r\n\t\txml_date: undefined, // \"%d-%m-%Y %H:%i\", // deprecated\r\n\t\tstart_on_monday: true,\r\n\t\tserver_utc: false,\r\n\t\tshow_progress: true,\r\n\t\tfit_tasks: false,\r\n\t\tselect_task: true,\r\n\t\tscroll_on_click: true,\r\n\t\tsmart_rendering: true,\r\n\t\tpreserve_scroll: true,\r\n\t\treadonly: false,\r\n\t\tcontainer_resize_timeout: 20,\r\n\t\tdeadlines: true,\r\n\r\n\t\t/*grid */\r\n\t\tdate_grid: \"%Y-%m-%d\",\r\n\r\n\t\tdrag_links: true,\r\n\t\tdrag_progress: true,\r\n\t\tdrag_resize: true,\r\n\t\tdrag_project: false,\r\n\t\tdrag_move: true,\r\n\t\tdrag_mode: {\r\n\t\t\tresize: \"resize\",\r\n\t\t\tprogress: \"progress\",\r\n\t\t\tmove: \"move\",\r\n\t\t\tignore: \"ignore\"\r\n\t\t},\r\n\t\tround_dnd_dates: true,\r\n\t\tlink_wrapper_width: 20,\r\n\t\tlink_arrow_size:12,\r\n\t\troot_id: 0,\r\n\r\n\t\tautofit: false, // grid column automatic fit grid_width config\r\n\t\tcolumns: [\r\n\t\t\t{name: \"text\", tree: true, width: \"*\", resize: true},\r\n\t\t\t{name: \"start_date\", align: \"center\", resize: true},\r\n\t\t\t{name: \"duration\", align: \"center\"},\r\n\t\t\t{name: \"add\", width: 44}\r\n\t\t],\r\n\r\n\t\t/*scale*/\r\n\r\n\t\tscale_offset_minimal: true,\r\n\t\tinherit_scale_class: false,\r\n\r\n\t\tscales: [\r\n\t\t\t{\r\n\t\t\t\tunit: \"day\",\r\n\t\t\t\tstep: 1,\r\n\t\t\t\tdate: \"%d %M\"\r\n\t\t\t}\r\n\t\t],\r\n// \t\tdate_scale: \"%d %M\",\r\n\r\n\t\ttime_step: 60,\r\n\t\tduration_step: 1,\r\n\t\ttask_date: \"%d %F %Y\",\r\n\t\ttime_picker: \"%H:%i\",\r\n\t\ttask_attribute: \"data-task-id\",\r\n\t\tlink_attribute: \"data-link-id\",\r\n\t\tlayer_attribute: \"data-layer\",\r\n\t\tbuttons_left: [\r\n\t\t\t\"gantt_save_btn\",\r\n\t\t\t\"gantt_cancel_btn\"\r\n\t\t],\r\n\t\t_migrate_buttons: {\r\n\t\t\tdhx_save_btn: \"gantt_save_btn\",\r\n\t\t\tdhx_cancel_btn: \"gantt_cancel_btn\",\r\n\t\t\tdhx_delete_btn: \"gantt_delete_btn\"\r\n\t\t},\r\n\t\tbuttons_right: [\r\n\t\t\t\"gantt_delete_btn\"\r\n\t\t],\r\n\t\tlightbox: {\r\n\t\t\tsections: [\r\n\t\t\t\t{name: \"description\", height: 70, map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t\t{name: \"time\", type: \"duration\", map_to: \"auto\"}\r\n\t\t\t],\r\n\t\t\tproject_sections: [\r\n\t\t\t\t{name: \"description\", height: 70, map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t\t{name: \"type\", type: \"typeselect\", map_to: \"type\"},\r\n\t\t\t\t{name: \"time\", type: \"duration\", readonly: true, map_to: \"auto\"}\r\n\t\t\t],\r\n\t\t\tmilestone_sections: [\r\n\t\t\t\t{name: \"description\", height: 70, map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t\t{name: \"type\", type: \"typeselect\", map_to: \"type\"},\r\n\t\t\t\t{name: \"time\", type: \"duration\", single_date: true, map_to: \"auto\"}\r\n\t\t\t]\r\n\t\t},\r\n\t\tdrag_lightbox: true,\r\n\t\tsort: false,\r\n\t\tdetails_on_create: true,\r\n\t\tdetails_on_dblclick: true,\r\n\t\tinitial_scroll: true,\r\n\t\ttask_scroll_offset: 100,\r\n\r\n\t\torder_branch: false,\r\n\t\torder_branch_free: false,\r\n\r\n\t\t// task height is deprecated, use 'bar_height' instead\r\n\t\ttask_height: undefined,// number px of 'full' for row height\r\n\t\tbar_height: \"full\",\r\n\t\tbar_height_padding:9,\r\n\t\tmin_column_width: 70,\r\n\r\n\t\t// min width for grid column (when resizing)\r\n\t\tmin_grid_column_width: 70,\r\n\t\t// name of the attribute with column index for resize element\r\n\t\tgrid_resizer_column_attribute: \"data-column-index\",\r\n\t\t// name of the attribute with column index for resize element\r\n\t\t// grid_resizer_attribute: \"grid_resizer\", // - usage of this parameter is not found in code\r\n\r\n\t\t// grid width can be increased after the column has been resized\r\n\t\tkeep_grid_width: false,\r\n\r\n\t\t// grid width can be adjusted\r\n\t\tgrid_resize: false,\r\n\t\tgrid_elastic_columns: false,\r\n\t\tshow_tasks_outside_timescale: false,\r\n\t\tshow_unscheduled: true,\r\n\r\n\t\tresize_rows: false,\r\n\t\t// name of the attribute with row index for resize element\r\n\t\ttask_grid_row_resizer_attribute: \"data-row-index\",\r\n\t\t// min height for row (when resizing)\r\n\t\tmin_task_grid_row_height: 30,\r\n\t\trow_height: 36,\r\n\r\n\t\t//\r\n\t\treadonly_property: \"readonly\",\r\n\t\teditable_property: \"editable\",\r\n\t\tcalendar_property: \"calendar_id\",\r\n\t\tresource_calendars: {},\r\n\t\tdynamic_resource_calendars: false,\r\n\t\tinherit_calendar: false,\r\n\t\ttype_renderers: {},\r\n\r\n\t\topen_tree_initially: false,\r\n\t\toptimize_render: true,\r\n\t\tprevent_default_scroll: false,\r\n\t\tshow_errors: true,\r\n\t\twai_aria_attributes: true,\r\n\t\tsmart_scales: true,\r\n\t\trtl:false,\r\n\t\tplaceholder_task: false,\r\n\t\thorizontal_scroll_key: \"shiftKey\",\r\n\t\tdrag_timeline: {\r\n\t\t\tuseKey: undefined,\r\n\t\t\tignore: \".gantt_task_line, .gantt_task_link\",\r\n\t\t\trender: false\r\n\t\t},\r\n\t\tdrag_multiple: true,\r\n\t\tcsp: \"auto\"\r\n\t};\r\n\treturn result;\r\n};\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisIE6: isWindowAwailable && (!XMLHttpRequest && navigator.userAgent.indexOf(\"MSIE\") >= 0),\r\n\tisIE7: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE 7.0\") >= 0 && navigator.userAgent.indexOf(\"Trident\") < 0),\r\n\tisIE8: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE 8.0\") >= 0 && navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\" || (typeof PRODUCTION !== \"undefined\" && PRODUCTION === \"test\"))\r\n};\r\n","export default function serialize(data: object | string) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\r\n\tlet result = \"\";\r\n\r\n\tfor (const key in data) {\r\n\t\tlet serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = String(data[key]);\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n","import env from \"../../utils/env\";\r\nimport global from \"../../utils/global\";\r\nimport serialize from \"./serialize\";\r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nexport default function(gantt) {\r\n\treturn {\r\n\r\n\t\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t\t// if true - do not add extra params\r\n\t\tcache: true,\r\n\r\n\t\t// default method for load/loadStruct, post/get allowed\r\n\t\t// get - since 4.1.1, this should fix 412 error for macos safari\r\n\t\tmethod: \"get\",\r\n\r\n\t\tparse: function(data) {\r\n\t\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\t\tvar obj;\r\n\t\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\t\tif (typeof DOMParser !== \"undefined\" && !env.isIE) { // ff,ie9\r\n\t\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t\t} else if (typeof global.ActiveXObject !== \"undefined\") {\r\n\t\t\t\tobj = new global.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\t\tobj.async = \"false\";\r\n\t\t\t\tobj.loadXML(data);\r\n\t\t\t}\r\n\t\t\treturn obj;\r\n\t\t},\r\n\t\txmltop: function(tagname, xhr, obj) {\r\n\t\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (obj !== -1) gantt.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\t\treturn document.createElement(\"DIV\");\r\n\t\t},\r\n\t\txpath: function(xpathExp, docObj) {\r\n\t\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\t\tif (env.isIE) {\r\n\t\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t\t} else {\r\n\t\t\t\tvar rows = [];\r\n\t\t\t\tvar first;\r\n\t\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\t\twhile (true){\r\n\t\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\t\tif(first){\r\n\t\t\t\t\t\trows.push(first);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn rows;\r\n\t\t\t}\r\n\t\t},\r\n\t\tquery: function(config) {\r\n\t\t\treturn this._call(\r\n\t\t\t\t(config.method || \"GET\"),\r\n\t\t\t\tconfig.url,\r\n\t\t\t\tconfig.data || \"\",\r\n\t\t\t\t(config.async || true),\r\n\t\t\t\tconfig.callback,\r\n\t\t\t\tconfig.headers\r\n\t\t\t);\r\n\t\t},\r\n\t\tget: function(url, onLoad, headers) {\r\n\t\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\tgetSync: function(url, headers) {\r\n\t\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\t\tconfig.async = false;\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\tput: function(url, postData, onLoad, headers) {\r\n\t\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\tdel: function(url, onLoad, headers) {\r\n\t\t\t/**\r\n\t\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t\t * implementations to reject the request.\r\n\t\t\t */\r\n\t\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\tpost: function(url, postData, onLoad, headers) {\r\n\t\t\tif (arguments.length == 1) {\r\n\t\t\t\tpostData = \"\";\r\n\t\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\t\tonLoad = postData;\r\n\t\t\t\tpostData = \"\";\r\n\t\t\t}\r\n\t\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\tpostSync: function(url, postData, headers) {\r\n\t\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\t\tconfig.async = false;\r\n\t\t\treturn this.query(config);\r\n\t\t},\r\n\t\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\t\treturn new gantt.Promise(function(resolve, reject) {\r\n\t\t\t\tvar t = (typeof XMLHttpRequest !== undefined ? new XMLHttpRequest() : new global.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\t\tif (!!async) {\r\n\t\t\t\t\tt.onreadystatechange = function() {\r\n\t\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\t\tif (!gantt.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\t\tonLoad.apply(global, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar noCache = !this || !this.cache;\r\n\t\t\t\tif (method == \"GET\" && noCache) {\r\n\t\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tt.open(method, url, async);\r\n\r\n\t\t\t\tif (headers){\r\n\t\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\t\tpostData = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\t\tt.send(postData);\r\n\r\n\t\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t});\r\n\t\t},\r\n\t\turlSeparator: function(str){\r\n\t\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\t\treturn \"&\";\r\n\t\t\telse\r\n\t\t\t\treturn \"?\";\r\n\t\t}\r\n\t};\r\n};\r\n","const dateToStr = (format: string, utc: boolean, gantt) => {\r\n\tformat = format.replace(/%[a-zA-Z]/g, (a) => {\r\n\t\tswitch (a) {\r\n\t\t\tcase \"%d\":\r\n\t\t\t\treturn `\"+to_fixed(date.get${utc?\"UTC\":\"\"}Date())+\"`;\r\n\t\t\tcase \"%m\":\r\n\t\t\t\treturn `\"+to_fixed((date.get${utc?\"UTC\":\"\"}Month()+1))+\"`;\r\n\t\t\tcase \"%j\":\r\n\t\t\t\treturn `\"+date.get${utc?\"UTC\":\"\"}Date()+\"`;\r\n\t\t\tcase \"%n\":\r\n\t\t\t\treturn `\"+(date.get${utc?\"UTC\":\"\"}Month()+1)+\"`;\r\n\t\t\tcase \"%y\":\r\n\t\t\t\treturn `\"+to_fixed(date.get${utc?\"UTC\":\"\"}FullYear()%100)+\"`;\r\n\t\t\tcase \"%Y\":\r\n\t\t\t\treturn `\"+date.get${utc?\"UTC\":\"\"}FullYear()+\"`;\r\n\t\t\tcase \"%D\":\r\n\t\t\t\treturn `\"+locale.date.day_short[date.get${utc?\"UTC\":\"\"}Day()]+\"`;\r\n\t\t\tcase \"%l\":\r\n\t\t\t\treturn `\"+locale.date.day_full[date.get${utc?\"UTC\":\"\"}Day()]+\"`;\r\n\t\t\tcase \"%M\":\r\n\t\t\t\treturn `\"+locale.date.month_short[date.get${utc?\"UTC\":\"\"}Month()]+\"`;\r\n\t\t\tcase \"%F\":\r\n\t\t\t\treturn `\"+locale.date.month_full[date.get${utc?\"UTC\":\"\"}Month()]+\"`;\r\n\t\t\tcase \"%h\":\r\n\t\t\t\treturn `\"+to_fixed((date.get${utc?\"UTC\":\"\"}Hours()+11)%12+1)+\"`;\r\n\t\t\tcase \"%g\":\r\n\t\t\t\treturn `\"+((date.get${utc?\"UTC\":\"\"}Hours()+11)%12+1)+\"`;\r\n\t\t\tcase \"%G\":\r\n\t\t\t\treturn `\"+date.get${utc?\"UTC\":\"\"}Hours()+\"`;\r\n\t\t\tcase \"%H\":\r\n\t\t\t\treturn `\"+to_fixed(date.get${utc?\"UTC\":\"\"}Hours())+\"`;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\treturn `\"+to_fixed(date.get${utc?\"UTC\":\"\"}Minutes())+\"`;\r\n\t\t\tcase \"%a\":\r\n\t\t\t\treturn `\"+(date.get${utc?\"UTC\":\"\"}Hours()>11?\"pm\":\"am\")+\"`;\r\n\t\t\tcase \"%A\":\r\n\t\t\t\treturn `\"+(date.get${utc?\"UTC\":\"\"}Hours()>11?\"PM\":\"AM\")+\"`;\r\n\t\t\tcase \"%s\":\r\n\t\t\t\treturn `\"+to_fixed(date.get${utc?\"UTC\":\"\"}Seconds())+\"`;\r\n\t\t\tcase \"%W\":\r\n\t\t\t\treturn `\"+to_fixed(getISOWeek(date))+\"`;\r\n\t\t\tcase \"%w\":\r\n\t\t\t\treturn `\"+to_fixed(getWeek(date))+\"`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn a;\r\n\t\t}\r\n\t});\r\n\r\n\t// tslint:disable-next-line: function-constructor\r\n\tconst dateToStrFn = new Function(\"date\", \"to_fixed\", \"locale\", \"getISOWeek\", \"getWeek\", `return \"${format}\";`);\r\n\r\n\treturn (date: Date) => {\r\n\t\treturn dateToStrFn(date, gantt.date.to_fixed, gantt.locale, gantt.date.getISOWeek, gantt.date.getWeek);\r\n\t};\r\n};\r\n\r\n\r\nconst strToDate = (format: string, utc: boolean, gantt:any) => {\r\n\tlet splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (let i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\":\r\n\t\t\t\tsplt += `set[2]=temp[${i}]||1;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\":\r\n\t\t\t\tsplt += `set[1]=(temp[${i}]||1)-1;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\":\r\n\t\t\t\tsplt += `set[0]=temp[${i}]*1+(temp[${i}]>50?1900:2000);`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += `set[3]=temp[${i}]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += `set[4]=temp[${i}]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\":\r\n\t\t\t\tsplt += `set[0]=temp[${i}]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\":\r\n\t\t\t\tsplt += `set[3]=set[3]%12+((temp[${i}]||'').toLowerCase()=='am'?0:12);`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\":\r\n\t\t\t\tsplt += `set[5]=temp[${i}]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\":\r\n\t\t\t\tsplt += `set[1]=locale.date.month_short_hash[temp[${i}]]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\":\r\n\t\t\t\tsplt += `set[1]=locale.date.month_full_hash[temp[${i}]]||0;`;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tlet code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) { code = ` Date.UTC(${code})`; }\r\n\t// tslint:disable-next-line: function-constructor\r\n\tconst strToDateFn = new Function(\"date\", \"locale\", `var set=[0,0,1,0,0,0]; ${splt} return new Date(${code});`);\r\n\r\n\treturn (dateString) => {\r\n\t\treturn strToDateFn(dateString, gantt.locale);\r\n\t};\r\n};\r\n\r\nconst fastVersion = {\r\n\tdate_to_str: dateToStr,\r\n\tstr_to_date: strToDate\r\n};\r\n\r\nexport default fastVersion;","const dateToStr = (format: string, utc: boolean, gantt) => {\r\n\treturn (date) => {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, (a) => {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? gantt.date.to_fixed(date.getUTCDate()) : gantt.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? gantt.date.to_fixed((date.getUTCMonth() + 1)) : gantt.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? gantt.date.to_fixed(date.getUTCFullYear() % 100) : gantt.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? gantt.locale.date.day_short[date.getUTCDay()] : gantt.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? gantt.locale.date.day_full[date.getUTCDay()] : gantt.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? gantt.locale.date.month_short[date.getUTCMonth()] : gantt.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? gantt.locale.date.month_full[date.getUTCMonth()] : gantt.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? gantt.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : gantt.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? gantt.date.to_fixed(date.getUTCHours()) : gantt.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? gantt.date.to_fixed(date.getUTCMinutes()) : gantt.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? gantt.date.to_fixed(date.getUTCSeconds()) : gantt.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? gantt.date.to_fixed(gantt.date.getUTCISOWeek(date)) : gantt.date.to_fixed(gantt.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nconst strToDate = (format: string, utc: boolean, gantt:any) => {\r\n\treturn (date: string) => {\r\n\t\tconst set: Array = [0, 0, 1, 0, 0, 0];\r\n\t\tconst temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\t\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\r\n\t\tfor (let i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] as unknown as number || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] as unknown as number || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] as unknown as number * 1 + ((temp[i] as unknown as number) > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] as unknown as number || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] as unknown as number || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] as unknown as number || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] as number % 12 + ((temp[i] || \"\").toLowerCase() === \"am\" ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = gantt.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = gantt.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(\r\n\t\t\t\tset[0] as number,\r\n\t\t\t\tset[1] as number,\r\n\t\t\t\tset[2] as number,\r\n\t\t\t\tset[3] as number,\r\n\t\t\t\tset[4] as number,\r\n\t\t\t\tset[5] as number\r\n\t\t\t));\r\n\t\t}\r\n\t\treturn new Date(\r\n\t\t\tset[0] as number,\r\n\t\t\tset[1] as number,\r\n\t\t\tset[2] as number,\r\n\t\t\tset[3] as number,\r\n\t\t\tset[4] as number,\r\n\t\t\tset[5] as number\r\n\t\t);\r\n\t};\r\n\r\n};\r\n\r\n\r\nconst cspVersion = {\r\n\tdate_to_str: dateToStr,\r\n\tstr_to_date: strToDate\r\n};\r\n\r\nexport default cspVersion;","/*\r\n %d - the day as a number with a leading zero ( 01 to 31 );\r\n %j - the day as a number without a leading zero ( 1 to 31 );\r\n %D - the day as an abbreviation ( Sun to Sat );\r\n %l - the day as a full name ( Sunday to Saturday );\r\n %W - the ISO-8601 week number of the year. Weeks start on Monday; 1)\r\n %m - the month as a number without a leading zero ( 1 to 12 );\r\n %n - the month as a number with a leading zero ( 01 to 12);\r\n %M - the month as an abbreviation ( Jan to Dec );\r\n %F - the month as a full name ( January to December );\r\n %y - the year as a two-digit number ( 00 to 99 );\r\n %Y - the year as a four-digit number ( 1900–9999 );\r\n %h - the hour based on the 12-hour clock ( 00 to 11 );\r\n %H - the hour based on the 24-hour clock ( 00 to 23 );\r\n %i - the minute as a number with a leading zero ( 00 to 59 );\r\n %s - the second as a number without a leading zero ( 00 to 59 ); 2)\r\n %a - displays am (for times from midnight until noon) and pm (for times from noon until midnight);\r\n %A - displays AM (for times from midnight until noon) and PM (for times from noon until midnight).\r\n*/\r\n\r\nimport fastVersion from \"./date_parsers/fast_version\";\r\nimport cspCompliantVersion from \"./date_parsers/csp_compliant_version\";\r\n\r\nexport default function(gantt) {\r\n\tvar canUseCsp = null;\r\n\tfunction cspAutoCheck() {\r\n\t\ttry {\r\n\t\t\tnew Function(\"canUseCsp = false;\");\r\n\t\t} catch(e) {\r\n\t\t\tcanUseCsp = true;\r\n\t\t}\r\n\t}\r\n\tfunction useCsp() {\r\n\t\tvar result = false;\r\n\t\tif (gantt.config.csp === \"auto\") {\r\n\t\t\tif(canUseCsp === null) {\r\n\t\t\t\tcspAutoCheck();\r\n\t\t\t}\r\n\t\t\tresult = canUseCsp;\r\n\t\t} else {\r\n\t\t\tresult = gantt.config.csp;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tvar dateHelper = {\r\n\t\tinit: function () {\r\n\t\t\tvar locale = gantt.locale;\r\n\r\n\t\t\tvar s = locale.date.month_short;\r\n\t\t\tvar t = locale.date.month_short_hash = {};\r\n\t\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\t\tt[s[i]] = i;\r\n\r\n\t\t\tvar s = locale.date.month_full;\r\n\t\t\tvar t = locale.date.month_full_hash = {};\r\n\t\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\t\tt[s[i]] = i;\r\n\t\t},\r\n\t\tdate_part: function (date) {\r\n\t\t\tvar old = new Date(date);\r\n\t\t\tdate.setHours(0);\r\n\t\t\tthis.hour_start(date);\r\n\t\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()))\r\n\t\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\t\treturn date;\r\n\t\t},\r\n\t\ttime_part: function (date) {\r\n\t\t\treturn (date.valueOf() / 1000 - date.getTimezoneOffset() * 60) % 86400;\r\n\t\t},\r\n\t\tweek_start: function (date) {\r\n\t\t\tvar shift = date.getDay();\r\n\t\t\tif (gantt.config.start_on_monday) {\r\n\t\t\t\tif (shift === 0) shift = 6;\r\n\t\t\t\telse shift--;\r\n\t\t\t}\r\n\t\t\treturn this.date_part(this.add(date, -1 * shift, \"day\"));\r\n\t\t},\r\n\t\tmonth_start: function (date) {\r\n\t\t\tdate.setDate(1);\r\n\t\t\treturn this.date_part(date);\r\n\t\t},\r\n\t\tquarter_start: function (date) {\r\n\t\t\tthis.month_start(date);\r\n\t\t\tvar m = date.getMonth(),\r\n\t\t\t\tres_month;\r\n\r\n\t\t\tif (m >= 9) {\r\n\t\t\t\tres_month = 9;\r\n\t\t\t} else if (m >= 6) {\r\n\t\t\t\tres_month = 6;\r\n\t\t\t} else if (m >= 3) {\r\n\t\t\t\tres_month = 3;\r\n\t\t\t} else {\r\n\t\t\t\tres_month = 0;\r\n\t\t\t}\r\n\r\n\t\t\tdate.setMonth(res_month);\r\n\t\t\treturn date;\r\n\t\t},\r\n\t\tyear_start: function (date) {\r\n\t\t\tdate.setMonth(0);\r\n\t\t\treturn this.month_start(date);\r\n\t\t},\r\n\t\tday_start: function (date) {\r\n\t\t\treturn this.date_part(date);\r\n\t\t},\r\n\t\thour_start: function (date) {\r\n\t\t\tif (date.getMinutes())\r\n\t\t\t\tdate.setMinutes(0);\r\n\t\t\tthis.minute_start(date);\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\t\tminute_start: function (date) {\r\n\t\t\tif (date.getSeconds())\r\n\t\t\t\tdate.setSeconds(0);\r\n\t\t\tif (date.getMilliseconds())\r\n\t\t\t\tdate.setMilliseconds(0);\r\n\t\t\treturn date;\r\n\t\t},\r\n\t\t_add_days: function (modifiedDate, inc, originalDate) {\r\n\r\n\t\t\tmodifiedDate.setDate(modifiedDate.getDate() + inc);\r\n\t\t\tvar incCondition = inc >= 0;\r\n\t\t\tvar getHoursCondition = !originalDate.getHours() && modifiedDate.getHours(); //shift to yesterday on dst\r\n\t\t\tvar getDateCondition = (modifiedDate.getDate() <= originalDate.getDate() || modifiedDate.getMonth() < originalDate.getMonth() || modifiedDate.getFullYear() < originalDate.getFullYear());\r\n\t\t\tif (incCondition && getHoursCondition && getDateCondition){\r\n\t\t\t\tmodifiedDate.setTime(modifiedDate.getTime() + 60 * 60 * 1000 * (24 - modifiedDate.getHours()));\r\n\t\t\t}\r\n\t\t\tvar worktimeCalculation = inc > 1;\r\n\t\t\tif (worktimeCalculation && getHoursCondition){\r\n\t\t\t\t// try to shift the modified Date to 00:00\r\n\t\t\t\tmodifiedDate.setHours(0);\r\n\t\t\t}\r\n\t\t\treturn modifiedDate;\r\n\t\t},\r\n\r\n\t\tadd: function (date, inc, mode) {\r\n\t\t\t/*jsl:ignore*/\r\n\t\t\tvar ndate = new Date(date.valueOf());\r\n\t\t\tswitch (mode) {\r\n\t\t\t\tcase \"day\":\r\n\t\t\t\t\tndate = this._add_days(ndate, inc, date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"week\":\r\n\t\t\t\t\tndate = this._add_days(ndate, inc * 7, date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"month\":\r\n\t\t\t\t\tndate.setMonth(ndate.getMonth() + inc);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"year\":\r\n\t\t\t\t\tndate.setYear(ndate.getFullYear() + inc);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"hour\":\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t\tadding hours/minutes via setHour(getHour() + inc) gives weird result when\r\n\t\t\t\t\t\tadding one hour to the time before switch to a Daylight Saving time\r\n\r\n\t\t\t\t\t\texample: //Sun Mar 30 2014 01:00:00 GMT+0100 (W. Europe Standard Time)\r\n\t\t\t\t\t\tnew Date(2014, 02, 30, 1).setHours(2)\r\n\t\t\t\t\t\t>>Sun Mar 30 2014 01:00:00 GMT+0100 (W. Europe Standard Time)\r\n\r\n\t\t\t\t\t\tsetTime seems working as expected\r\n\t\t\t\t\t */\r\n\t\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"minute\":\r\n\r\n\t\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn this[\"add_\" + mode](date, inc, mode);\r\n\t\t\t}\r\n\t\t\treturn ndate;\r\n\t\t\t/*jsl:end*/\r\n\t\t},\r\n\t\tadd_quarter: function (date, inc) {\r\n\t\t\treturn this.add(date, inc * 3, \"month\");\r\n\t\t},\r\n\r\n\t\tto_fixed: function (num) {\r\n\t\t\tif (num < 10) return \"0\" + num;\r\n\t\t\treturn num;\r\n\t\t},\r\n\t\tcopy: function (date) {\r\n\t\t\treturn new Date(date.valueOf());\r\n\t\t},\r\n\t\tdate_to_str: function (format, utc) {\r\n\t\t\tvar result = fastVersion;\r\n\t\t\tif (useCsp()) {\r\n\t\t\t\tresult = cspCompliantVersion;\r\n\t\t\t}\r\n\t\t\treturn result.date_to_str(format, utc, gantt);\r\n\t\t},\r\n\t\tstr_to_date: function (format, utc) {\r\n\t\t\tvar result = fastVersion;\r\n\t\t\tif (useCsp()) {\r\n\t\t\t\tresult = cspCompliantVersion;\r\n\t\t\t}\r\n\t\t\treturn result.str_to_date(format, utc, gantt);\r\n\t\t},\r\n\t\tgetISOWeek: function (ndate) {\r\n\t\t\treturn gantt.date._getWeekNumber(ndate, true);\r\n\t\t},\r\n\t\t_getWeekNumber: function(ndate, isoWeek){\r\n\t\t\tif (!ndate) return false;\r\n\t\t\tvar nday = ndate.getDay();\r\n\t\t\tif(isoWeek){\r\n\t\t\t\tif (nday === 0) {\r\n\t\t\t\t\tnday = 7;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\t\tvar ordinal_date = Math.round((first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\t\tvar week_number = 1 + Math.floor(ordinal_date / 7);\r\n\t\t\treturn week_number;\r\n\t\t},\r\n\r\n\t\tgetWeek: function(ndate){\r\n\t\t\treturn gantt.date._getWeekNumber(ndate, gantt.config.start_on_monday);\r\n\t\t},\r\n\t\tgetUTCISOWeek: function (ndate) {\r\n\t\t\treturn gantt.date.getISOWeek(ndate);\r\n\t\t},\r\n\t\tconvert_to_utc: function (date) {\r\n\t\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t\t},\r\n\t\tparseDate: function (date, format) {\r\n\t\t\t// raw date may be of type string, number (timestamp) or something else\r\n\t\t\t// do not check for instanceof Date explicitly, since we may swap native date with different date implementation at some point\r\n\t\t\tif (date && !date.getFullYear) {\r\n\t\t\t\tif (typeof(format) !== \"function\") {\r\n\t\t\t\t\tif (typeof(format) === \"string\") {\r\n\t\t\t\t\t\tif (format === \"parse_date\" || format === \"xml_date\") {\r\n\t\t\t\t\t\t\tformat = gantt.defined(gantt.templates.xml_date) ? gantt.templates.xml_date : gantt.templates.parse_date;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tformat = gantt.defined(gantt.templates[format]) ? gantt.templates[format] : gantt.date.str_to_date(format);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tformat = gantt.defined(gantt.templates.xml_date) ? gantt.templates.xml_date : gantt.templates.parse_date;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (date) {\r\n\t\t\t\t\tdate = format(date);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdate = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn date;\r\n\t\t}\r\n\t};\r\n\treturn dateHelper;\r\n};","class t{constructor(t){const{url:e,token:s}=t;this._url=e,this._token=s,this._mode=1,this._seed=1,this._queue=[],this.data={},this.api={},this._events={}}headers(){return{Accept:\"application/json\",\"Content-Type\":\"application/json\",\"Remote-Token\":this._token}}fetch(t,e){const s={credentials:\"include\",headers:this.headers()};return e&&(s.method=\"POST\",s.body=e),fetch(t,s).then(t=>t.json())}load(t){return t&&(this._url=t),this.fetch(this._url).then(t=>this.parse(t))}parse(t){const{key:e,websocket:s}=t;e&&(this._token=t.key);for(const e in t.data)this.data[e]=t.data[e];for(const e in t.api){const s=this.api[e]={},i=t.api[e];for(const t in i)s[t]=this._wrapper(e+\".\"+t)}return s&&this.connect(),this}connect(){const t=this._socket;t&&(this._socket=null,t.onclose=function(){},t.close()),this._mode=2,this._socket=function(t,e,s,i){let n=e;\"/\"===n[0]&&(n=document.location.protocol+\"//\"+document.location.host+e);n=n.replace(/^http(s|):/,\"ws$1:\");const o=-1!=n.indexOf(\"?\")?\"&\":\"?\";n=`${n}${o}token=${s}&ws=1`;const r=new WebSocket(n);return r.onclose=()=>setTimeout(()=>t.connect(),2e3),r.onmessage=e=>{const s=JSON.parse(e.data);switch(s.action){case\"result\":t.result(s.body,[]);break;case\"event\":t.fire(s.body.name,s.body.value);break;case\"start\":i();break;default:t.onError(s.data)}},r}(this,this._url,this._token,()=>(this._mode=3,this._send(),this._resubscribe(),this))}_wrapper(t){return function(){const e=[].slice.call(arguments);let s=null;const i=new Promise((i,n)=>{s={data:{id:this._uid(),name:t,args:e},status:1,resolve:i,reject:n},this._queue.push(s)});return this.onCall(s,i),3===this._mode?this._send(s):setTimeout(()=>this._send(),1),i}.bind(this)}_uid(){return(this._seed++).toString()}_send(t){if(2==this._mode)return void setTimeout(()=>this._send(),100);const e=t?[t]:this._queue.filter(t=>1===t.status);if(!e.length)return;const s=e.map(t=>(t.status=2,t.data));3!==this._mode?this.fetch(this._url,JSON.stringify(s)).catch(t=>this.onError(t)).then(t=>this.result(t,s)):this._socket.send(JSON.stringify({action:\"call\",body:s}))}result(t,e){const s={};if(t)for(let e=0;e=0;t--){const e=this._queue[t],i=s[e.data.id];i&&(this.onResponse(e,i),i.error?e.reject(i.error):e.resolve(i.data),this._queue.splice(t,1))}}on(t,e){const s=this._uid();let i=this._events[t];const n=!!i;return n||(i=this._events[t]=[]),i.push({id:s,handler:e}),n||3!=this._mode||this._socket.send(JSON.stringify({action:\"subscribe\",name:t})),{name:t,id:s}}_resubscribe(){if(3==this._mode)for(const t in this._events)this._socket.send(JSON.stringify({action:\"subscribe\",name:t}))}detach(t){if(!t){if(3==this._mode)for(const t in this._events)this._socket.send(JSON.stringify({action:\"unsubscribe\",key:t}));return void(this._events={})}const{id:e,name:s}=t,i=this._events[s];if(i){const t=i.filter(t=>t.id!=e);t.length?this._events[s]=t:(delete this._events[s],3==this._mode&&this._socket.send(JSON.stringify({action:\"unsubscribe\",name:s})))}}fire(t,e){const s=this._events[t];if(s)for(let t=0;t res.json());\r\n };\r\n\r\n this._ready = remote.load().then((back) => (this._remote = back));\r\n\r\n function ready() {\r\n return this._ready;\r\n }\r\n \r\n function on(name, handler) {\r\n this.ready().then((back) => {\r\n if (typeof name === \"string\") back.on(name, handler);\r\n else {\r\n for (const key in name) {\r\n back.on(key, name[key]);\r\n }\r\n }\r\n });\r\n }\r\n\r\n this.ready = ready;\r\n this.on = on;\r\n };\r\n\r\n","function checkTimeout(host, updPerSecond){\r\n\tif (!updPerSecond)\r\n\t\treturn true;\r\n\t\r\n\tif (host._on_timeout)\r\n\t\treturn false;\r\n\t\r\n\tvar timeout = Math.ceil(1000/updPerSecond);\r\n\tif (timeout < 2) return true;\r\n\r\n\tsetTimeout(function(){\r\n\t\tdelete host._on_timeout;\r\n\t}, timeout);\r\n\r\n\thost._on_timeout = true;\r\n\treturn true;\r\n}\r\n\r\nexport default checkTimeout;","import * as utils from \"../../utils/utils\";\r\n\r\nvar StateService = (function(){\r\n\tvar stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tvar provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","// eslint-disable-next-line no-restricted-globals\r\nexport default Promise;","import * as utils from \"../../utils/utils\";\r\nimport {replaceValidZeroId} from \"../../utils/helpers\";\r\n\r\nvar createTasksDatastoreFacade = function(){\r\n\treturn {\r\n\tgetTask: function (id) {\r\n\t\tid = replaceValidZeroId(id, this.config.root_id);\r\n\t\tthis.assert(id, \"Invalid argument for gantt.getTask\");\r\n\t\tvar task = this.$data.tasksStore.getItem(id);\r\n\t\tthis.assert(task, \"Task not found id=\" + id);\r\n\t\treturn task;\r\n\t},\r\n\tgetTaskByTime: function (from, to) {\r\n\t\tvar p = this.$data.tasksStore.getItems();\r\n\r\n\t\tvar res = [];\r\n\r\n\t\tif (!(from || to)) {\r\n\t\t\tres = p;\r\n\t\t} else {\r\n\t\t\tfrom = +from || -Infinity;\r\n\t\t\tto = +to || Infinity;\r\n\t\t\tfor (var t = 0; t < p.length; t++){\r\n\t\t\t\tvar task = p[t];\r\n\t\t\t\tif (+task.start_date < to && +task.end_date > from)\r\n\t\t\t\t\tres.push(task);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\tisTaskExists: function (id) {\r\n\t\tif(!this.$data || !this.$data.tasksStore){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn this.$data.tasksStore.exists(id);\r\n\t},\r\n\tupdateTask: function (id, item) {\r\n\t\tif (!utils.defined(item)) item = this.getTask(id);\r\n\t\tthis.$data.tasksStore.updateItem(id, item);\r\n\t\tif(this.isTaskExists(id))\r\n\t\t\tthis.refreshTask(id);\r\n\t},\r\n\taddTask: function (item, parent, index) {\r\n\t\tif (!utils.defined(item.id))\r\n\t\t\titem.id = utils.uid();\r\n\r\n\t\t//GS-761: assert unique ID\r\n\t\tif (this.isTaskExists(item.id)){\r\n\t\t\tvar task = this.getTask(item.id);\r\n\t\t\tif (task.$index != item.$index) {\r\n\t\t\t\t// Someone may try to mistakenly add a task with the same ID, and most likely\r\n\t\t\t\t// use the string format for the dates. Gantt shouldn't break in this scenario\r\n\t\t\t\tif (item.start_date && typeof item.start_date === \"string\"){\r\n\t\t\t\t\titem.start_date = this.date.parseDate(item.start_date, \"parse_date\");\r\n\t\t\t\t}\r\n\t\t\t\tif (item.end_date && typeof item.end_date === \"string\"){\r\n\t\t\t\t\titem.end_date = this.date.parseDate(item.end_date, \"parse_date\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.$data.tasksStore.updateItem(item.id, item);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif (!utils.defined(parent)) parent = this.getParent(item) || 0;\r\n\t\tif (!this.isTaskExists(parent)) parent = this.config.root_id;\r\n\t\tthis.setParent(item, parent);\r\n\t\treturn this.$data.tasksStore.addItem(item, index, parent);\r\n\t},\r\n\tdeleteTask: function (id) {\r\n\t\tid = replaceValidZeroId(id, this.config.root_id);\r\n\t\treturn this.$data.tasksStore.removeItem(id);\r\n\t},\r\n\tgetTaskCount: function () {\r\n\t\treturn this.$data.tasksStore.count();\r\n\t},\r\n\tgetVisibleTaskCount: function () {\r\n\t\treturn this.$data.tasksStore.countVisible();\r\n\t},\r\n\tgetTaskIndex: function (id) {\r\n\t\treturn this.$data.tasksStore.getBranchIndex(id);\r\n\t},\r\n\tgetGlobalTaskIndex: function (id) {\r\n\t\tid = replaceValidZeroId(id, this.config.root_id);\r\n\t\tthis.assert(id, \"Invalid argument\");\r\n\t\treturn this.$data.tasksStore.getIndexById(id);\r\n\t},\r\n\teachTask: function (code, parent, master) {\r\n\t\treturn this.$data.tasksStore.eachItem(utils.bind(code, master||this), parent);\r\n\t},\r\n\teachParent: function (callback, startTask, master) {\r\n\t\treturn this.$data.tasksStore.eachParent(utils.bind(callback, master || this), startTask);\r\n\t},\r\n\tchangeTaskId: function (oldid, newid) {\r\n\t\tthis.$data.tasksStore.changeId(oldid, newid);\r\n\t\tvar task = this.$data.tasksStore.getItem(newid);\r\n\r\n\t\tvar links = [];\r\n\r\n\t\tif (task.$source) {\r\n\t\t\tlinks = links.concat(task.$source);\r\n\t\t}\r\n\t\tif (task.$target) {\r\n\t\t\tlinks = links.concat(task.$target);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < links.length; i++) {\r\n\t\t\tvar link = this.getLink(links[i]);\r\n\t\t\tif (link.source == oldid) {\r\n\t\t\t\tlink.source = newid;\r\n\t\t\t}\r\n\t\t\tif (link.target == oldid) {\r\n\t\t\t\tlink.target = newid;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tcalculateTaskLevel: function (item) {\r\n\t\treturn this.$data.tasksStore.calculateItemLevel(item);\r\n\t},\r\n\tgetNext: function (id) {\r\n\t\treturn this.$data.tasksStore.getNext(id);\r\n\t},\r\n\tgetPrev: function (id) {\r\n\t\treturn this.$data.tasksStore.getPrev(id);\r\n\t},\r\n\tgetParent: function (id) {\r\n\t\treturn this.$data.tasksStore.getParent(id);\r\n\t},\r\n\tsetParent: function (task, new_pid, silent) {\r\n\t\treturn this.$data.tasksStore.setParent(task, new_pid, silent);\r\n\t},\r\n\tgetSiblings: function (id) {\r\n\t\treturn this.$data.tasksStore.getSiblings(id).slice();\r\n\t},\r\n\tgetNextSibling: function (id) {\r\n\t\treturn this.$data.tasksStore.getNextSibling(id);\r\n\t},\r\n\tgetPrevSibling: function (id) {\r\n\t\treturn this.$data.tasksStore.getPrevSibling(id);\r\n\t},\r\n\tgetTaskByIndex: function(index){\r\n\t\tvar id = this.$data.tasksStore.getIdByIndex(index);\r\n\t\tif(this.isTaskExists(id)){\r\n\t\t\treturn this.getTask(id);\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tgetChildren: function (id) {\r\n\t\tif(!this.hasChild(id)){\r\n\t\t\treturn [];\r\n\t\t}else{\r\n\t\t\treturn this.$data.tasksStore.getChildren(id).slice();\r\n\t\t}\r\n\t},\r\n\thasChild: function (id) {\r\n\t\treturn this.$data.tasksStore.hasChild(id);\r\n\t},\r\n\topen: function (id) {\r\n\t\tthis.$data.tasksStore.open(id);\r\n\t},\r\n\tclose: function (id) {\r\n\t\tthis.$data.tasksStore.close(id);\r\n\t},\r\n\tmoveTask: function (sid, tindex, parent) {\r\n\t\tparent = replaceValidZeroId(parent, this.config.root_id);\r\n\t\treturn this.$data.tasksStore.move.apply(this.$data.tasksStore, arguments);\r\n\t},\r\n\tsort: function(field, desc, parent, silent) {\r\n\t\tvar render = !silent;//4th argument to cancel redraw after sorting\r\n\r\n\t\tthis.$data.tasksStore.sort(field, desc, parent);\r\n\t\tthis.callEvent(\"onAfterSort\", [field, desc, parent]);\r\n\r\n\t\tif (render) {\r\n\t\t\tthis.render();\r\n\t\t}\r\n\t}\r\n};\r\n};\r\n\r\nexport default createTasksDatastoreFacade;\r\n\r\n\r\n","import * as utils from \"../../utils/utils\";\r\n\r\nvar $powerArray = {\r\n\t$create: function(array){\r\n\t\treturn utils.mixin(array || [], this);\r\n\t},\r\n\t//remove element at specified position\r\n\t$removeAt:function(pos,len){\r\n\t\tif (pos>=0) this.splice(pos,(len||1));\r\n\t},\r\n\t//find element in collection and remove it\r\n\t$remove:function(value){\r\n\t\tthis.$removeAt(this.$find(value));\r\n\t},\r\n\t//add element to collection at specific position\r\n\t$insertAt:function(data,pos){\r\n\t\tif (!pos && pos!==0) \t//add to the end by default\r\n\t\t\tthis.push(data);\r\n\t\telse {\r\n\t\t\tvar b = this.splice(pos,(this.length-pos));\r\n\t\t\tthis[pos] = data;\r\n\t\t\tthis.push.apply(this,b); //reconstruct array without loosing this pointer\r\n\t\t}\r\n\t},\r\n\t//return index of element, -1 if it doesn't exists\r\n\t$find:function(data){\r\n\t\tfor (var i=0; i data_size){\r\n\t\t\t\t//dhx.log(\"Warning\",\"DataStore:add\",\"Index of out of bounds\");\r\n\t\t\t\tindex = Math.min(order.length,index);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t//gantt.assert(!this.exists(id), \"Not unique ID\");\r\n\r\n\t\tthis.pull[item.id]=item;\r\n\t\tif (!this.isSilent()){\r\n\t\t\tthis._updateOrder(function(){\r\n\t\t\t\tif(this.$find(item.id) === -1)\r\n\t\t\t\t\tthis.$insertAt(item.id,index);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.filter();\r\n\t\t//order.$insertAt(item.id,index);\r\n\t},\r\n\r\n\r\n\tisVisible: function(id){\r\n\t\treturn this.visibleOrder.$find(id) > -1;\r\n\t},\r\n\tgetVisibleItems: function(){\r\n\t\treturn this.getIndexRange();\r\n\t},\r\n\r\n\taddItem: function(item, index){\r\n\t\tif (!utils.defined(item.id))\r\n\t\t\titem.id = utils.uid();\r\n\r\n\t\tif(this.$initItem){\r\n\t\t\titem = this.$initItem(item);\r\n\t\t}\r\n\r\n\t\tif (!this.isSilent()){\r\n\t\t\tif (this.callEvent(\"onBeforeAdd\", [item.id, item]) === false) return false;\r\n\t\t}\r\n\r\n\r\n\t\tthis._addItemInner(item, index);\r\n\r\n\t\tif (!this.isSilent()){\r\n\t\t\tthis.callEvent(\"onAfterAdd\",[item.id, item]);\r\n\t\t\t//repaint signal\r\n\t\t\tthis.callEvent(\"onStoreUpdated\",[item.id,item,\"add\"]);\r\n\t\t}\r\n\t\treturn item.id;\r\n\t},\r\n\r\n\t_changeIdInner: function(oldId, newId){\r\n\t\tif(this.pull[oldId])\r\n\t\t\tthis.pull[newId] = this.pull[oldId];\r\n\r\n\t\tvar visibleOrder = this._searchVisibleOrder[oldId];\r\n\t\tthis.pull[newId].id = newId;\r\n\t\tthis._updateOrder(function(){\r\n\t\t\tthis[this.$find(oldId)] = newId;\r\n\t\t});\r\n\t\tthis._searchVisibleOrder[newId] = visibleOrder;\r\n\t\tdelete this._searchVisibleOrder[oldId];\r\n\r\n\t\t//this.visibleOrder[this.visibleOrder.$find(oldId)]=newId;\r\n\t\tdelete this.pull[oldId];\r\n\t},\r\n\tchangeId: function(oldId, newId){\r\n\t\tthis._changeIdInner(oldId, newId);\r\n\r\n\t\tthis.callEvent(\"onIdChange\", [oldId, newId]);\r\n\r\n\t},\r\n\texists: function(id){\r\n\t\treturn !!(this.pull[id]);\r\n\t},\r\n\r\n\t_moveInner: function(sindex, tindex){\r\n\t\tvar id = this.getIdByIndex(sindex);\r\n\r\n\t\tthis._updateOrder(function(){\r\n\t\t\tthis.$removeAt(sindex);\r\n\t\t\tthis.$insertAt(id,Math.min(this.length, tindex));\r\n\t\t});\r\n\t\t//this.visibleOrder.$removeAt(sindex);\t//remove at old position\r\n\t\t//if (sindex=0 && tindex>=0, \"DataStore::move\",\"Incorrect indexes\");\r\n\r\n\t\tvar id = this.getIdByIndex(sindex);\r\n\t\tvar obj = this.getItem(id);\r\n\t\tthis._moveInner(sindex, tindex);\r\n\r\n\t\tif (!this.isSilent()) {\r\n\t\t\t//repaint signal\r\n\t\t\tthis.callEvent(\"onStoreUpdated\", [obj.id, obj, \"move\"]);\r\n\t\t}\r\n\t},\r\n\tclearAll: function(){\r\n\t\tif(this.$destroyed){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// GS-956 We need to unselect the resource as its ID is cached\r\n\t\tthis.silent(function(){\r\n\t\t\tthis.unselect();\r\n\t\t});\r\n\t\tthis.pull = {};\r\n\t\tthis.visibleOrder = powerArray.$create();\r\n\t\tthis.fullOrder = powerArray.$create();\r\n\t\tif (this.isSilent()) return;\r\n\t\tthis.callEvent(\"onClearAll\",[]);\r\n\t\tthis.refresh();\r\n\t},\r\n\r\n\tsilent:function(code, master){\r\n\t\tvar alreadySilent = false;\r\n\t\tif(this.isSilent()) {\r\n\t\t\talreadySilent = true;\r\n\t\t}\r\n\t\tthis._skip_refresh = true;\r\n\t\tcode.call(master||this);\r\n\t\t\r\n\t\tif (!alreadySilent) {\r\n\t\t\tthis._skip_refresh = false;\r\n\t\t}\r\n\t},\r\n\tisSilent: function(){\r\n\t\treturn !!this._skip_refresh;\r\n\t},\r\n\r\n\tarraysEqual: function (arr1, arr2) {\r\n\t\tif(arr1.length !== arr2.length)\r\n\t\t\treturn false;\r\n\t\tfor(var i = 0; i < arr1.length; i++) {\r\n\t\t\tif(arr1[i] !== arr2[i])\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\trefresh: function(id, quick){\r\n\t\tif (this.isSilent()) return;\r\n\r\n\t\tvar item;\r\n\t\tif(id){\r\n\t\t\titem = this.getItem(id);\r\n\t\t}\r\n\r\n\t\tvar args;\r\n\t\tif (id){\r\n\t\t\targs = [id, item, \"paint\"];\r\n\t\t}else{\r\n\t\t\targs = [null,null,null];\r\n\t\t}\r\n\r\n\t\tif(this.callEvent(\"onBeforeStoreUpdate\", args) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar skipFilter = this._quick_refresh && !this._mark_recompute;\r\n\t\tthis._mark_recompute = false;\r\n\t\tif(id){\r\n\t\t\t// if item changes visible order (e.g. expand-collapse branch) - do a complete repaint\r\n\t\t\tif(!quick && !skipFilter){\r\n\t\t\t\tvar oldOrder = this.visibleOrder;\r\n\t\t\t\tthis.filter();\r\n\t\t\t\tif(!this.arraysEqual(oldOrder, this.visibleOrder)){\r\n\t\t\t\t\tid = undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if(!skipFilter){\r\n\t\t\tthis.filter();\r\n\t\t}\r\n\r\n\t\tif (id){\r\n\t\t\targs = [id, item, \"paint\"];\r\n\t\t}else{\r\n\t\t\targs = [null,null,null];\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onStoreUpdated\",args);\r\n\t},\r\n\r\n\tcount: function(){\r\n\t\treturn this.fullOrder.length;\r\n\t},\r\n\tcountVisible: function(){\r\n\t\treturn this.visibleOrder.length;\r\n\t},\r\n\r\n\tsort: function(sort){},\r\n\r\n\tserialize: function(){},\r\n\r\n\teachItem: function(code){\r\n\t\tfor (var i=0; i= item.$level){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\twhile (item && this.exists(pid)) {\r\n\t\t\t\titem = this.getItem(pid);\r\n\r\n\t\t\t\tif (item && item.id == parentId)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\tpid = this.getParent(item);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tgetSiblings: function(id){\r\n\t\t\tif(!this.exists(id)){\r\n\t\t\t\treturn powerArray.$create();\r\n\t\t\t}\r\n\t\t\tvar parent = this.getParent(id);\r\n\t\t\treturn this.getChildren(parent);\r\n\r\n\t\t},\r\n\t\tgetNextSibling: function(id){\r\n\t\t\tvar siblings = this.getSiblings(id);\r\n\t\t\tfor(var i= 0, len = siblings.length; i < len; i++){\r\n\t\t\t\tif(siblings[i] == id){\r\n\t\t\t\t\tvar nextSibling = siblings[i+1];\r\n\t\t\t\t\tif (nextSibling === 0 && i > 0){\r\n\t\t\t\t\t\tnextSibling = \"0\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nextSibling || null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tgetPrevSibling: function(id){\r\n\t\t\tvar siblings = this.getSiblings(id);\r\n\t\t\tfor(var i= 0, len = siblings.length; i < len; i++){\r\n\t\t\t\tif(siblings[i] == id){\r\n\t\t\t\t\tvar previousSibling = siblings[i-1];\r\n\t\t\t\t\tif (previousSibling === 0 && i > 0){\r\n\t\t\t\t\t\tpreviousSibling = \"0\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn previousSibling || null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tgetParent: function(id){\r\n\t\t\tvar item = null;\r\n\t\t\tif(id.id !== undefined){\r\n\t\t\t\titem = id;\r\n\t\t\t}else{\r\n\t\t\t\titem = this.getItem(id);\r\n\t\t\t}\r\n\r\n\t\t\tvar parent;\r\n\t\t\tif(item){\r\n\t\t\t\tparent = item[this.$parentProperty];\r\n\t\t\t}else{\r\n\t\t\t\tparent = this.$getRootId();\r\n\t\t\t}\r\n\t\t\treturn parent;\r\n\r\n\t\t},\r\n\r\n\t\tclearAll: function(){\r\n\t\t\tthis._branches = {};\r\n\t\t\tDataStore.prototype.clearAll.call(this);\r\n\t\t},\r\n\r\n\t\tcalculateItemLevel: function(item){\r\n\t\t\tvar level = 0;\r\n\t\t\tthis.eachParent(function(){\r\n\t\t\t\tlevel++;\r\n\t\t\t}, item);\r\n\t\t\treturn level;\r\n\t\t},\r\n\r\n\t\t_setParentInner: function(item, new_pid, silent){\r\n\t\t\tif(!silent){\r\n\t\t\t\tif(item.hasOwnProperty(\"$rendered_parent\")){\r\n\t\t\t\t\tthis._move_branch(item, item.$rendered_parent, new_pid);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._move_branch(item, item[this.$parentProperty], new_pid);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tsetParent: function(item, new_pid, silent){\r\n\t\t\tthis._setParentInner(item, new_pid, silent);\r\n\r\n\t\t\titem[this.$parentProperty] = new_pid;\r\n\t\t},\r\n\r\n\t\t_eachItemCached: function(code, cache){\r\n\t\t\tfor(var i = 0, len = cache.length; i < len; i++){\r\n\t\t\t\tcode.call(this, cache[i]);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_eachItemIterate: function(code, startId, cache){\r\n\t\t\tvar itemsStack = this.getChildren(startId);\r\n\t\t\tif(itemsStack.length){\r\n\t\t\t\titemsStack = itemsStack.slice().reverse();\r\n\t\t\t}\r\n\t\t\twhile(itemsStack.length){\r\n\t\t\t\tvar itemId = itemsStack.pop();\r\n\t\t\t\tvar item = this.getItem(itemId);\r\n\t\t\t\tcode.call(this, item);\r\n\t\t\t\tif(cache){\r\n\t\t\t\t\tcache.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.hasChild(item.id)){\r\n\t\t\t\t\tvar children = this.getChildren(item.id);\r\n\t\t\t\t\tvar len = children.length;\r\n\t\t\t\t\tfor(var i = len - 1; i >= 0; i--){\r\n\t\t\t\t\t\titemsStack.push(children[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\teachItem: function(code, parent){\r\n\t\t\tvar rootId = this.$getRootId();\r\n\t\t\tif (!utils.defined(parent)) {\r\n\t\t\t\tparent = rootId;\r\n\t\t\t}\r\n\t\t\tvar startId = replaceValidZeroId(parent, rootId) || rootId;\r\n\r\n\t\t\tvar useCache = false;\r\n\t\t\tvar buildCache = false;\r\n\t\t\tvar cache = null;\r\n\t\t\tif(startId === rootId){\r\n\t\t\t\tif(this._eachItemMainRangeCache){\r\n\t\t\t\t\tuseCache = true;\r\n\t\t\t\t\tcache = this._eachItemMainRangeCache;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbuildCache = true;\r\n\t\t\t\t\tcache = this._eachItemMainRangeCache = [];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(useCache){\r\n\t\t\t\tthis._eachItemCached(code, cache);\r\n\t\t\t}else{\r\n\t\t\t\tthis._eachItemIterate(code, startId, buildCache ? cache : null);\r\n\t\t\t}\r\n\t\t},\r\n\t\teachParent: function(code, startItem) {\r\n\t\t\tvar parentsHash = {};\r\n\t\t\tvar item = startItem;\r\n\t\t\tvar parent = this.getParent(item);\r\n\r\n\t\t\twhile (this.exists(parent)) {\r\n\t\t\t\tif (parentsHash[parent]) {\r\n\t\t\t\t\tthrow new Error(\"Invalid tasks tree. Cyclic reference has been detected on task \" + parent);\r\n\t\t\t\t}\r\n\t\t\t\tparentsHash[parent] = true;\r\n\t\t\t\titem = this.getItem(parent);\r\n\t\t\t\tcode.call(this, item);\r\n\t\t\t\tparent = this.getParent(item);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_add_branch: function(item, index, parent){\r\n\t\t\tvar pid = parent === undefined ? this.getParent(item) : parent;\r\n\t\t\tif (!this.hasChild(pid))\r\n\t\t\t\tthis._branches[pid] = powerArray.$create();\r\n\t\t\tvar branch = this.getChildren(pid);\r\n\t\t\tvar added_already = branch.indexOf(item.id + \"\") > -1 || branch.indexOf(+item.id) > -1;\r\n\t\t\tif(!added_already){\r\n\t\t\t\tif(index*1 == index){\r\n\r\n\t\t\t\t\tbranch.splice(index, 0, item.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbranch.push(item.id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\titem.$rendered_parent = pid;\r\n\t\t\t}\r\n\t\t},\r\n\t\t_move_branch: function(item, old_parent, new_parent){\r\n\t\t\tthis._eachItemMainRangeCache = null;\r\n\t\t\t//this.setParent(item, new_parent);\r\n\t\t\t//this._sync_parent(task);\r\n\t\t\tthis._replace_branch_child(old_parent, item.id);\r\n\t\t\tif(this.exists(new_parent) || new_parent == this.$getRootId()){\r\n\r\n\t\t\t\tthis._add_branch(item, undefined, new_parent);\r\n\t\t\t}else{\r\n\t\t\t\tdelete this._branches[item.id];\r\n\t\t\t}\r\n\t\t\titem.$level = this.calculateItemLevel(item);\r\n\t\t\tthis.eachItem(function(child){\r\n\t\t\t\tchild.$level = this.calculateItemLevel(child);\r\n\t\t\t}, item.id);\r\n\t\t},\r\n\r\n\t\t_replace_branch_child: function(node, old_id, new_id){\r\n\t\t\tvar branch = this.getChildren(node);\r\n\t\t\tif (branch && node !== undefined){\r\n\t\t\t\tvar newbranch = powerArray.$create();\r\n\r\n\t\t\t\tlet index = branch.indexOf(old_id + \"\");\r\n\t\t\t\tif (index == -1 && !isNaN(+old_id)){\r\n\t\t\t\t\tindex = branch.indexOf(+old_id);\r\n\t\t\t\t} \r\n\r\n\t\t\t\tif (index > -1){\r\n\t\t\t\t\tif (new_id){\r\n\t\t\t\t\t\tbranch.splice(index, 1, new_id);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbranch.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tnewbranch = branch;\r\n\r\n\t\t\t\tthis._branches[node] = newbranch;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tsort: function(field, desc, parent){\r\n\t\t\tif (!this.exists(parent)) {\r\n\t\t\t\tparent = this.$getRootId();\r\n\t\t\t}\r\n\r\n\t\t\tif (!field) field = \"order\";\r\n\t\t\tvar criteria = (typeof(field) == \"string\") ? (function(a, b) {\r\n\t\t\t\tif (a[field] == b[field] ||\r\n\t\t\t\t\t(helpers.isDate(a[field]) && helpers.isDate(b[field]) && a[field].valueOf() == b[field].valueOf()))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar result = a[field] > b[field];\r\n\t\t\t\treturn result ? 1 : -1;\r\n\t\t\t}) : field;\r\n\r\n\t\t\tif (desc) {\r\n\t\t\t\tvar original_criteria = criteria;\r\n\t\t\t\tcriteria = function (a, b) {\r\n\t\t\t\t\treturn original_criteria(b, a);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar els = this.getChildren(parent);\r\n\r\n\t\t\tif (els){\r\n\t\t\t\tvar temp = [];\r\n\t\t\t\tfor (var i = els.length - 1; i >= 0; i--)\r\n\t\t\t\t\ttemp[i] = this.getItem(els[i]);\r\n\r\n\t\t\t\ttemp.sort(criteria);\r\n\r\n\t\t\t\tfor (var i = 0; i < temp.length; i++) {\r\n\t\t\t\t\tels[i] = temp[i].id;\r\n\t\t\t\t\tthis.sort(field, desc, els[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfilter: function(rule){\r\n\t\t\tfor(let i in this.pull){\r\n\t\t\t\tconst renderedParent = this.pull[i].$rendered_parent;\r\n\t\t\t\tconst actualParent = this.getParent(this.pull[i]);\r\n\t\t\t\tif(renderedParent !== actualParent){\r\n\t\t\t\t\tthis._move_branch(this.pull[i], renderedParent, actualParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn DataStore.prototype.filter.apply(this, arguments);\r\n\t\t},\r\n\r\n\t\topen: function(id){\r\n\t\t\tif(this.exists(id)){\r\n\t\t\t\tthis.getItem(id).$open = true;\r\n\t\t\t\t// GS-2170. Do not recalculate the indexes and dates as they will be recalculated later\r\n\t\t\t\tthis._skipTaskRecalculation = true;\r\n\t\t\t\tthis.callEvent(\"onItemOpen\", [id]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tclose: function(id){\r\n\t\t\tif(this.exists(id)){\r\n\t\t\t\tthis.getItem(id).$open = false;\r\n\t\t\t\t// GS-2170. Do not recalculate the indexes and dates as they will be recalculated later\r\n\t\t\t\tthis._skipTaskRecalculation = true;\r\n\t\t\t\tthis.callEvent(\"onItemClose\", [id]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tdestructor: function(){\r\n\t\t\tDataStore.prototype.destructor.call(this);\r\n\t\t\tthis._branches = null;\r\n\t\t\tthis._indexRangeCache = {};\r\n\t\t\tthis._eachItemMainRangeCache = null;\r\n\t\t}\r\n\t},\r\n\tDataStore.prototype\r\n);\r\n\r\nexport default TreeDataStore;","import env from \"./env\";\r\n\r\nexport default function(gantt){\r\n\treturn env.isNode || !gantt.$root;\r\n};","import isHeadless from \"../../utils/is_headless\";\r\n\r\nconst storeRenderCreator = function(name, gantt){\r\n\r\n\tconst store = gantt.getDatastore(name);\r\n\r\n\tconst itemRepainter = {\r\n\t\trenderItem: function(id, renderer){\r\n\r\n\t\t\tconst renders = renderer.getLayers();\r\n\r\n\t\t\tconst item = store.getItem(id);\r\n\t\t\tif(item && store.isVisible(id)) {\r\n\t\t\t\tfor (let i = 0; i < renders.length; i++)\r\n\t\t\t\t\trenders[i].render_item(item);\r\n\t\t\t}\r\n\t\t},\r\n\t\trenderItems: function(renderer){\r\n\t\t\tconst renderers = renderer.getLayers();\r\n\t\t\tfor (let i = 0; i < renderers.length; i++) {\r\n\t\t\t\trenderers[i].clear();\r\n\t\t\t}\r\n\r\n\t\t\tlet allData = null;\r\n\r\n\t\t\tconst loadedRanges = {};\r\n\t\t\tfor (let i = 0; i < renderers.length; i++) {\r\n\t\t\t\tconst layer = renderers[i];\r\n\t\t\t\tlet layerData;\r\n\t\t\t\tif(layer.get_visible_range){\r\n\r\n\t\t\t\t\tvar range = layer.get_visible_range(store);\r\n\t\t\t\t\tif(range.start !== undefined && range.end !== undefined){\r\n\t\t\t\t\t\tvar key = range.start + \" - \" + range.end;\r\n\t\t\t\t\t\tif(loadedRanges[key]){\r\n\t\t\t\t\t\t\tlayerData = loadedRanges[key];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tlayerData = store.getIndexRange(range.start, range.end);\r\n\t\t\t\t\t\t\tloadedRanges[key] = layerData;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else if(range.ids !== undefined){\r\n\t\t\t\t\t\tlayerData = range.ids.map(function(id){\r\n\t\t\t\t\t\t\treturn store.getItem(id);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthrow new Error(\"Invalid range returned from 'getVisibleRange' of the layer\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(!allData){\r\n\t\t\t\t\t\tallData = store.getVisibleItems();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlayerData = allData;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (layer.prepare_data) {\r\n\t\t\t\t\t// GS-1605. Highlight timeline cells below tasks and in an empty chart\r\n\t\t\t\t\tlayer.prepare_data(layerData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trenderers[i].render_items(layerData);\r\n\t\t\t}\r\n\t\t},\r\n\t\tupdateItems: function(layer) {\r\n\t\t\tif(layer.update_items){\r\n\t\t\t\tlet data = [];\r\n\t\t\t\tif(layer.get_visible_range){\r\n\r\n\t\t\t\t\tvar range = layer.get_visible_range(store);\r\n\t\t\t\t\tif(range.start !== undefined && range.end !== undefined){\r\n\t\t\t\t\t\tdata = store.getIndexRange(range.start, range.end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(range.ids !== undefined){\r\n\t\t\t\t\t\tlet extraDataArr = range.ids.map(function(id){\r\n\t\t\t\t\t\t\treturn store.getItem(id);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t// GS-2502: range.ids might not exist in other datastores\r\n\t\t\t\t\t\tif(extraDataArr.length > 0){\r\n\t\t\t\t\t\t\textraDataArr = extraDataArr.filter(element => element !== undefined);\r\n\t\t\t\t\t\t\tdata = data.concat(extraDataArr);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif((range.start == undefined || range.end == undefined) && range.ids == undefined) {\r\n\t\t\t\t\t\tthrow new Error(\"Invalid range returned from 'getVisibleRange' of the layer\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdata = store.getVisibleItems();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (layer.prepare_data) {\r\n\t\t\t\t\t// GS-1605. Highlight timeline cells below tasks and in an empty chart\r\n\t\t\t\t\tlayer.prepare_data(data, layer);\r\n\t\t\t\t}\r\n\t\t\t\tlayer.update_items(data);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tstore.attachEvent(\"onStoreUpdated\", function(id, item, action){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst renderer = gantt.$services.getService(\"layers\").getDataRender(name);\r\n\t\tif(renderer){\r\n\t\t\trenderer.onUpdateRequest = function(layer){\r\n\t\t\t\titemRepainter.updateItems(layer);\r\n\t\t\t};\r\n\t\t}\r\n\t});\r\n\r\n\tfunction skipRepaint(gantt){\r\n\t\tconst state = gantt.$services.getService(\"state\");\r\n\t\tif(state.getState(\"batchUpdate\").batch_update){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tstore.attachEvent(\"onStoreUpdated\", function(id, item, action){\r\n\t\tif(skipRepaint(gantt)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(!id || action == \"move\" || action == \"delete\"){\r\n\t\t\tstore.callEvent(\"onBeforeRefreshAll\", []);\r\n\t\t\tstore.callEvent(\"onAfterRefreshAll\", []);\r\n\t\t}else{\r\n\t\t\tstore.callEvent(\"onBeforeRefreshItem\", [item.id]);\r\n\t\t\tstore.callEvent(\"onAfterRefreshItem\", [item.id]);\r\n\t\t}\r\n\t});\r\n\r\n\tstore.attachEvent(\"onAfterRefreshAll\", function(){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst renderer = gantt.$services.getService(\"layers\").getDataRender(name);\r\n\t\tif(renderer && !skipRepaint(gantt)){\r\n\t\t\titemRepainter.renderItems(renderer);\r\n\t\t}\r\n\t});\r\n\tstore.attachEvent(\"onAfterRefreshItem\", function(id){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst renderer = gantt.$services.getService(\"layers\").getDataRender(name);\r\n\t\tif(renderer){\r\n\t\t\titemRepainter.renderItem(id, renderer);\r\n\t\t}\r\n\t});\r\n\r\n\t// TODO: probably can be done more in a more efficient way\r\n\tstore.attachEvent(\"onItemOpen\", function(){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tgantt.render();\r\n\t});\r\n\r\n\tstore.attachEvent(\"onItemClose\", function(){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tgantt.render();\r\n\t});\r\n\r\n\tfunction refreshId(renders, oldId, newId, item) {\r\n\t\tfor (let i = 0; i < renders.length; i++) {\r\n\t\t\trenders[i].change_id(oldId, newId);\r\n\t\t}\r\n\t}\r\n\r\n\tstore.attachEvent(\"onIdChange\", function(oldId, newId){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// in case of linked datastores (tasks <-> links), id change should recalculate something in linked datastore before any repaint\r\n\t\t// use onBeforeIdChange for this hook.\r\n\t\t// TODO: use something more reasonable instead\r\n\t\tstore.callEvent(\"onBeforeIdChange\", [oldId, newId]);\r\n\r\n\t\tif(skipRepaint(gantt)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(!store.isSilent()){\r\n\t\t\tconst renderer = gantt.$services.getService(\"layers\").getDataRender(name);\r\n\t\t\tif(renderer){ // missing check for renderer GS-1814\r\n\t\t\t\trefreshId(renderer.getLayers(), oldId, newId, store.getItem(newId));\r\n\t\t\t\titemRepainter.renderItem(newId, renderer);\r\n\t\t\t}else{\r\n\t\t\t\t// GS-1814 repaint ui to apply new id when the datastore don't have own renderer\r\n\t\t\t\tgantt.render();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\nexport default {\r\n\tbindDataStore: storeRenderCreator\r\n};","import * as utils from \"../../utils/utils\";\r\nimport createTasksFacade from \"./datastore_tasks\";\r\nimport createLinksFacade from \"./datastore_links\";\r\nimport DataStore from \"../datastore/datastore\";\r\nimport TreeDataStore from \"../datastore/treedatastore\";\r\nimport createDatastoreSelect from \"../datastore/select\";\r\nimport datastoreRender from \"../datastore/datastore_render\";\r\nimport isHeadless from \"../../utils/is_headless\";\r\nimport {replaceValidZeroId} from \"../../utils/helpers\";\r\n\r\nfunction getDatastores(){\r\n\tvar storeNames = this.$services.getService(\"datastores\");\r\n\tvar res = [];\r\n\tfor(var i = 0; i < storeNames.length; i++){\r\n\t\tvar store = this.getDatastore(storeNames[i]);\r\n\t\tif(!store.$destroyed){\r\n\t\t\tres.push(store);\r\n\t\t}\r\n\t}\r\n\treturn res;\r\n}\r\n\r\nvar createDatastoreFacade = function(){\r\n\treturn {\r\n\tcreateDatastore: function(config){\r\n\r\n\t\tvar $StoreType = (config.type || \"\").toLowerCase() == \"treedatastore\" ? TreeDataStore : DataStore;\r\n\r\n\t\tif (config) {\r\n\t\t\tvar self = this;\r\n\t\t\tconfig.openInitially = function(){ return self.config.open_tree_initially; };\r\n\t\t\tconfig.copyOnParse = function(){ return self.config.deepcopy_on_parse; };\r\n\t\t}\r\n\r\n\t\tvar store = new $StoreType(config);\r\n\t\tthis.mixin(store, createDatastoreSelect(store));\r\n\r\n\t\tif (config.name) {\r\n\t\t\tvar servicePrefix = \"datastore:\";\r\n\t\t\tvar storeAccessName = servicePrefix + config.name;\r\n\r\n\t\t\tstore.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tthis.$services.dropService(storeAccessName);\r\n\t\t\t\tvar storeList = this.$services.getService(\"datastores\");\r\n\t\t\t\tfor(var i = 0; i < storeList.length; i++){\r\n\t\t\t\t\tif(storeList[i] === config.name){\r\n\t\t\t\t\t\tstoreList.splice(i, 1);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(this));\r\n\r\n\t\t\tthis.$services.dropService(storeAccessName);\r\n\t\t\tthis.$services.setService(storeAccessName, function() { return store; } );\r\n\r\n\t\t\tvar storeList = this.$services.getService(\"datastores\");\r\n\t\t\tif (!storeList) {\r\n\t\t\t\tstoreList = [];\r\n\t\t\t\tthis.$services.setService(\"datastores\", function() { return storeList; });\r\n\t\t\t\tstoreList.push(config.name);\r\n\t\t\t} else if (storeList.indexOf(config.name) < 0) {\r\n\t\t\t\tstoreList.push(config.name);\r\n\t\t\t}\r\n\r\n\t\t\tdatastoreRender.bindDataStore(config.name, this);\r\n\r\n\t\t}\r\n\r\n\t\treturn store;\r\n\t},\r\n\tgetDatastore: function(name){\r\n\t\treturn this.$services.getService(\"datastore:\" + name);\r\n\t},\r\n\t_getDatastores: getDatastores,\r\n\r\n\trefreshData: function () {\r\n\t\tvar scrollState;\r\n\t\tif(!isHeadless(this)){\r\n\t\t\tscrollState = this.getScrollState();\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onBeforeDataRender\", []);\r\n\r\n\t\tvar stores = getDatastores.call(this);\r\n\t\tfor(var i = 0; i < stores.length; i++){\r\n\t\t\tstores[i].refresh();\r\n\t\t}\r\n\r\n\t\tif(this.config.preserve_scroll && !isHeadless(this) && (scrollState.x || scrollState.y)){\r\n\t\t\tthis.scrollTo(scrollState.x, scrollState.y);\r\n\t\t}\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\r\n\t},\r\n\r\n\tisChildOf: function(childId, parentId){\r\n\t\treturn this.$data.tasksStore.isChildOf(childId, parentId);\r\n\t},\r\n\r\n\trefreshTask: function (taskId, refresh_links) {\r\n\t\tvar task = this.getTask(taskId);\r\n\t\tvar self = this;\r\n\t\tfunction refreshLinks(){\r\n\t\t\tif (refresh_links !== undefined && !refresh_links)\r\n\t\t\t\treturn;\r\n\t\t\tfor (var i = 0; i < task.$source.length; i++) {\r\n\t\t\t\tself.refreshLink(task.$source[i]);\r\n\t\t\t}\r\n\t\t\tfor (var i = 0; i < task.$target.length; i++) {\r\n\t\t\t\tself.refreshLink(task.$target[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (task && this.isTaskVisible(taskId)) {\r\n\t\t\tthis.$data.tasksStore.refresh(taskId, !!this.getState(\"tasksDnd\").drag_id || refresh_links === false);// do quick refresh during drag and drop\r\n\t\t\trefreshLinks();\r\n\t\t}else if(this.isTaskExists(taskId) && this.isTaskExists(this.getParent(taskId)) && !this._bulk_dnd){\r\n\t\t\tthis.refreshTask(this.getParent(taskId));\r\n\r\n\t\t\tvar hasSplitParent = false;\r\n\t\t\tthis.eachParent(function(parent){\r\n\t\t\t\tif(hasSplitParent || this.isSplitTask(parent)){\r\n\t\t\t\t\thasSplitParent = true;\r\n\t\t\t\t}\r\n\t\t\t}, taskId);\r\n\t\t\tif(hasSplitParent){\r\n\t\t\t\trefreshLinks();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\trefreshLink: function (linkId) {\r\n\t\tthis.$data.linksStore.refresh(linkId, !!this.getState(\"tasksDnd\").drag_id);// do quick refresh during drag and drop\r\n\t},\r\n\r\n\tsilent: function(code){\r\n\t\tvar gantt = this;\r\n\t\tgantt.$data.tasksStore.silent(function(){\r\n\t\t\tgantt.$data.linksStore.silent(function(){\r\n\t\t\t\tcode();\r\n\t\t\t});\r\n\t\t});\r\n\t},\r\n\r\n\tclearAll: function () {\r\n\t\tvar stores = getDatastores.call(this);\r\n\t\t\r\n\t\t// clear all stores without invoking clearAll event\r\n\t\t// in order to prevent calling handlers when only some stores are cleared\r\n\t\tfor(var i = 0; i < stores.length; i++){\r\n\t\t\tstores[i].silent(function(){\r\n\t\t\t\tstores[i].clearAll();\t\r\n\t\t\t});\r\n\t\t}\r\n\t\t// run clearAll again to invoke events\r\n\t\tfor(var i = 0; i < stores.length; i++){\r\n\t\t\tstores[i].clearAll();\t\r\n\t\t}\r\n\r\n\t\tthis._update_flags();\r\n\t\tthis.userdata = {};\r\n\t\tthis.callEvent(\"onClear\", []);\r\n\t\tthis.render();\r\n\t},\r\n\t_clear_data: function () {\r\n\t\tthis.$data.tasksStore.clearAll();\r\n\t\tthis.$data.linksStore.clearAll();\r\n\t\tthis._update_flags();\r\n\t\tthis.userdata = {};\r\n\t},\r\n\r\n\tselectTask: function(id){\r\n\t\tvar store = this.$data.tasksStore;\r\n\t\tif(!this.config.select_task)\r\n\t\t\treturn false;\r\n\t\tid = replaceValidZeroId(id, this.config.root_id);\r\n\t\tif (id){\r\n\t\t\tlet oldSelectId = this.getSelectedId();\r\n\t\t\t// Don't repaint the resource panel as the data didn't change\r\n\t\t\tstore._skipResourceRepaint = true;\r\n\t\t\tstore.select(id);\r\n\t\t\tstore._skipResourceRepaint = false;\r\n\t\t\t// GS-730. Split task is not included in the tree, \r\n\t\t\t// so the datastore renderer will think that the task is not visible\r\n\t\t\tif (oldSelectId && store.pull[oldSelectId].$split_subtask && oldSelectId != id) {\r\n\t\t\t\tthis.refreshTask(oldSelectId);\r\n\t\t\t}\r\n\t\t\tif (store.pull[id].$split_subtask && oldSelectId != id) {// GS-1850. Do not repaint split task after double click\r\n\t\t\t\tthis.refreshTask(id);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn store.getSelectedId();\r\n\t},\r\n\tunselectTask: function(id){\r\n\t\tvar store = this.$data.tasksStore;\r\n\t\tstore.unselect(id);\r\n\t\t// GS-730. Split task is not included in the tree, \r\n\t\t// so the datastore renderer will think that the task is not visible\r\n\t\tif (id && store.pull[id].$split_subtask) {\r\n\t\t\tthis.refreshTask(id);\r\n\t\t}\r\n\t},\r\n\tisSelectedTask: function(id){\r\n\t\treturn this.$data.tasksStore.isSelected(id);\r\n\t},\r\n\tgetSelectedId: function() {\r\n\t\treturn this.$data.tasksStore.getSelectedId();\r\n\t}\r\n};\r\n};\r\n\r\nfunction createFacade(){\r\n\tvar res = utils.mixin({}, createDatastoreFacade());\r\n\tutils.mixin(res, createTasksFacade());\r\n\tutils.mixin(res, createLinksFacade());\r\n\treturn res;\r\n}\r\n\r\n\r\n\r\n\r\nexport default {create: createFacade};","function createDataStoreSelectMixin(store){\r\n\tvar selectedId = null;\r\n\r\n\tvar deleteItem = store._removeItemInner;\r\n\t\r\n\tfunction unselect(id){\r\n\t\tselectedId = null;\r\n\t\tthis.callEvent(\"onAfterUnselect\", [id]);\r\n\t}\r\n\r\n\tstore._removeItemInner = function(id){\r\n\t\tif(selectedId == id){\r\n\t\t\tunselect.call(this, id);\r\n\t\t}\r\n\r\n\t\tif(selectedId && this.eachItem){\r\n\t\t\tthis.eachItem(function(subItem){\r\n\t\t\t\tif(subItem.id == selectedId){\r\n\t\t\t\t\tunselect.call(this, subItem.id);\r\n\t\t\t\t}\r\n\t\t\t}, id);\r\n\t\t}\r\n\r\n\t\treturn deleteItem.apply(this, arguments);\r\n\t};\r\n\r\n\tstore.attachEvent(\"onIdChange\", function(oldId, newId) {\r\n\t\tif (store.getSelectedId() == oldId) {\r\n\t\t\tstore.silent(function () {\r\n\t\t\t\tstore.unselect(oldId);\r\n\t\t\t\tstore.select(newId);\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\treturn {\r\n\t\tselect: function(id){\r\n\t\t\tif (id){\r\n\r\n\t\t\t\tif(selectedId == id)\r\n\t\t\t\t\treturn selectedId;\r\n\r\n\t\t\t\tif(!this._skip_refresh) {\r\n\t\t\t\t\tif (!this.callEvent(\"onBeforeSelect\", [id])) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.unselect();\r\n\r\n\t\t\t\tselectedId = id;\r\n\r\n\t\t\t\tif(!this._skip_refresh) {\r\n\t\t\t\t\tthis.refresh(id);\r\n\t\t\t\t\tthis.callEvent(\"onAfterSelect\", [id]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn selectedId;\r\n\t\t},\r\n\t\tgetSelectedId: function(){\r\n\t\t\treturn selectedId;\r\n\t\t},\r\n\t\tisSelected: function(id){\r\n\t\t\treturn id == selectedId;\r\n\t\t},\r\n\t\tunselect: function(id){\r\n\t\t\tvar id = id || selectedId;\r\n\t\t\tif(!id)\r\n\t\t\t\treturn;\r\n\t\t\tselectedId = null;\r\n\t\t\tif(!this._skip_refresh){\r\n\t\t\t\tthis.refresh(id);\r\n\t\t\t\tunselect.call(this, id);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default createDataStoreSelectMixin;","import * as utils from \"../../utils/utils\";\r\n\r\n\r\nvar createLinksStoreFacade = function(){\r\n\treturn {\r\n\tgetLinkCount: function () {\r\n\t\treturn this.$data.linksStore.count();\r\n\t},\r\n\r\n\tgetLink : function (id) {\r\n\t\treturn this.$data.linksStore.getItem(id);\r\n\t},\r\n\r\n\tgetLinks : function () {\r\n\t\treturn this.$data.linksStore.getItems();\r\n\t},\r\n\r\n\tisLinkExists : function (id) {\r\n\t\treturn this.$data.linksStore.exists(id);\r\n\t},\r\n\r\n\taddLink : function (link) {\r\n\t\tconst newLink = this.$data.linksStore.addItem(link);\r\n\t\t// GS-1222. Update fullOrder otherwise the link won't appear after render\r\n\t\tif (this.$data.linksStore.isSilent()){\r\n\t\t\tthis.$data.linksStore.fullOrder.push(newLink);\r\n\t\t}\r\n\t\treturn newLink;\r\n\t},\r\n\r\n\tupdateLink : function (id, data) {\r\n\t\tif (!utils.defined(data))\r\n\t\t\tdata = this.getLink(id);\r\n\t\tthis.$data.linksStore.updateItem(id, data);\r\n\t},\r\n\r\n\tdeleteLink : function (id) {\r\n\t\treturn this.$data.linksStore.removeItem(id);\r\n\t},\r\n\r\n\tchangeLinkId : function (oldid, newid) {\r\n\t\treturn this.$data.linksStore.changeId(oldid, newid);\r\n\t}\r\n};\r\n};\r\n\r\nexport default createLinksStoreFacade;","import * as utils from \"../../../utils/utils\";\r\n\r\nfunction ScaleHelper(gantt){\r\n\tvar dateHelper = gantt.date;\r\n\tvar services = gantt.$services;\r\n\r\n\treturn {\r\n\t\tgetSum: function (sizes, from, to) {\r\n\t\t\tif (to === undefined)\r\n\t\t\t\tto = sizes.length - 1;\r\n\t\t\tif (from === undefined)\r\n\t\t\t\tfrom = 0;\r\n\r\n\t\t\tvar summ = 0;\r\n\t\t\tfor (var i = from; i <= to; i++)\r\n\t\t\t\tsumm += sizes[i];\r\n\r\n\t\t\treturn summ;\r\n\t\t},\r\n\t\tsetSumWidth: function (sum_width, scale, from, to) {\r\n\t\t\tvar parts = scale.width;\r\n\r\n\t\t\tif (to === undefined)\r\n\t\t\t\tto = parts.length - 1;\r\n\t\t\tif (from === undefined)\r\n\t\t\t\tfrom = 0;\r\n\t\t\tvar length = to - from + 1;\r\n\r\n\t\t\tif (from > parts.length - 1 || length <= 0 || to > parts.length - 1)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar oldWidth = this.getSum(parts, from, to);\r\n\r\n\t\t\tvar diff = sum_width - oldWidth;\r\n\r\n\t\t\tthis.adjustSize(diff, parts, from, to);\r\n\t\t\tthis.adjustSize(-diff, parts, to + 1);\r\n\r\n\t\t\tscale.full_width = this.getSum(parts);\r\n\t\t},\r\n\t\tsplitSize: function (width, count) {\r\n\t\t\tvar arr = [];\r\n\t\t\tfor (var i = 0; i < count; i++) arr[i] = 0;\r\n\r\n\t\t\tthis.adjustSize(width, arr);\r\n\t\t\treturn arr;\r\n\r\n\t\t},\r\n\t\tadjustSize: function (width, parts, from, to) {\r\n\t\t\tif (!from)\r\n\t\t\t\tfrom = 0;\r\n\t\t\tif (to === undefined)\r\n\t\t\t\tto = parts.length - 1;\r\n\r\n\t\t\tvar length = to - from + 1;\r\n\r\n\t\t\tvar full = this.getSum(parts, from, to);\r\n\r\n\t\t\tfor (var i = from; i <= to; i++) {\r\n\t\t\t\tvar share = Math.floor(width * (full ? (parts[i] / full) : (1 / length)));\r\n\r\n\t\t\t\tfull -= parts[i];\r\n\t\t\t\twidth -= share;\r\n\t\t\t\tlength--;\r\n\r\n\t\t\t\tparts[i] += share;\r\n\t\t\t}\r\n\t\t\tparts[parts.length - 1] += width;\r\n\t\t},\r\n\t\tsortScales: function (scales) {\r\n\t\t\tfunction cellSize(unit, step) {\r\n\t\t\t\tvar d = new Date(1970, 0, 1);\r\n\t\t\t\treturn dateHelper.add(d, step, unit) - d;\r\n\t\t\t}\r\n\r\n\t\t\tscales.sort(function (a, b) {\r\n\t\t\t\tif (cellSize(a.unit, a.step) < cellSize(b.unit, b.step)) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else if (cellSize(a.unit, a.step) > cellSize(b.unit, b.step)) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tfor (var i = 0; i < scales.length; i++) {\r\n\t\t\t\tscales[i].index = i;\r\n\t\t\t}\r\n\t\t},\r\n\t\t_isLegacyMode: function(config){\r\n\t\t\tvar scaleConfig = config || gantt.config;\r\n\t\t\treturn scaleConfig.scale_unit || scaleConfig.date_scale || scaleConfig.subscales;\r\n\t\t},\r\n\t\t_prepareScaleObject: function(scale){\r\n\t\t\tvar format = scale.format;\r\n\t\t\tif(!format){\r\n\t\t\t\tformat = scale.template || scale.date || \"%d %M\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof format === \"string\"){\r\n\t\t\t\tformat = gantt.date.date_to_str(format);\r\n\t\t\t}\r\n\t\t\treturn {\r\n\t\t\t\tunit: scale.unit || \"day\",\r\n\t\t\t\tstep: scale.step || 1,\r\n\t\t\t\tformat: format,\r\n\t\t\t\tcss: scale.css\r\n\t\t\t};\r\n\t\t},\r\n\t\tprimaryScale: function(config) {\r\n\t\t\tvar templates = services.getService(\"templateLoader\");\r\n\t\t\tvar legacyMode = this._isLegacyMode(config);\r\n\r\n\t\t\tvar scaleConfig = config || gantt.config;\r\n\r\n\t\t\tvar result;\r\n\t\t\tif(legacyMode){\r\n\t\t\t\ttemplates.initTemplate(\"date_scale\", undefined, undefined, scaleConfig, gantt.config.templates);\r\n\t\t\t\tresult = {\r\n\t\t\t\t\tunit: gantt.config.scale_unit,\r\n\t\t\t\t\tstep: gantt.config.step,\r\n\t\t\t\t\ttemplate: gantt.templates.date_scale,\r\n\t\t\t\t\tdate: gantt.config.date_scale,\r\n\t\t\t\t\tcss: gantt.templates.scale_cell_class\r\n\t\t\t\t};\r\n\t\t\t}else{\r\n\t\t\t\tvar primaryScale = scaleConfig.scales[0];\r\n\t\t\t\tresult = {\r\n\t\t\t\t\tunit: primaryScale.unit,\r\n\t\t\t\t\tstep: primaryScale.step,\r\n\t\t\t\t\ttemplate: primaryScale.template,\r\n\t\t\t\t\tformat: primaryScale.format,\r\n\t\t\t\t\tdate: primaryScale.date,\r\n\t\t\t\t\tcss: primaryScale.css || gantt.templates.scale_cell_class\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn this._prepareScaleObject(result);\r\n\t\t},\r\n\t\tgetSubScales: function(config) {\r\n\t\t\tvar legacyMode = this._isLegacyMode(config);\r\n\t\t\tvar scaleConfig = config || gantt.config;\r\n\t\t\tvar scales;\r\n\t\t\tif(legacyMode){\r\n\t\t\t\tlet docLink = \"https://docs.dhtmlx.com/gantt/migrating.html#:~:text=%3D%20false%3B-,Time%20scale%20settings,-Configuration%20of%20time\";\r\n\t\t\t\tif (gantt.env.isFF){\r\n\t\t\t\t\tdocLink = \"https://docs.dhtmlx.com/gantt/migrating.html#6162\";\r\n\t\t\t\t}\r\n\t\t\t\t// eslint-disable-next-line no-console\r\n\t\t\t\tconsole.warn(`You are using the obsolete scale configuration.\r\nIt will stop working in the future versions.\r\nPlease migrate the configuration to the newer version:\r\n${docLink}`);\r\n\t\t\t\tscales = scaleConfig.subscales || [];\r\n\t\t\t}else{\r\n\t\t\t\tscales = scaleConfig.scales.slice(1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn scales.map(function(scale){\r\n\t\t\t\treturn this._prepareScaleObject(scale);\r\n\t\t\t}.bind(this));\r\n\t\t},\r\n\r\n\t\tprepareConfigs: function (scales, min_coll_width, container_width, scale_height, minDate, maxDate, rtl) {\r\n\t\t\tvar heights = this.splitSize(scale_height, scales.length);\r\n\t\t\tvar full_width = container_width;\r\n\r\n\t\t\tvar configs = [];\r\n\t\t\tfor (var i = scales.length - 1; i >= 0; i--) {\r\n\t\t\t\tvar main_scale = (i == scales.length - 1);\r\n\t\t\t\tvar cfg = this.initScaleConfig(scales[i], minDate, maxDate);\r\n\t\t\t\tif (main_scale) {\r\n\t\t\t\t\tthis.processIgnores(cfg);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.initColSizes(cfg, min_coll_width, full_width, heights[i]);\r\n\t\t\t\tthis.limitVisibleRange(cfg);\r\n\r\n\t\t\t\tif (main_scale) {\r\n\t\t\t\t\tfull_width = cfg.full_width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfigs.unshift(cfg);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfor (var i = 0; i < configs.length - 1; i++) {\r\n\t\t\t\tthis.alineScaleColumns(configs[configs.length - 1], configs[i]);\r\n\t\t\t}\r\n\t\t\tfor (var i = 0; i < configs.length; i++) {\r\n\r\n\t\t\t\tif(rtl){\r\n\t\t\t\t\tthis.reverseScale(configs[i]);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setPosSettings(configs[i]);\r\n\t\t\t}\r\n\t\t\treturn configs;\r\n\r\n\t\t},\r\n\r\n\t\treverseScale: function(scale){\r\n\t\t\tscale.width = scale.width.reverse();\r\n\t\t\tscale.trace_x = scale.trace_x.reverse();\r\n\r\n\t\t\tvar indexes = scale.trace_indexes;\r\n\t\t\tscale.trace_indexes = {};\r\n\t\t\tscale.trace_index_transition = {};\r\n\t\t\tscale.rtl = true;\r\n\t\t\tfor(var i = 0; i < scale.trace_x.length; i++){\r\n\t\t\t\tscale.trace_indexes[scale.trace_x[i].valueOf()] = i;\r\n\t\t\t\tscale.trace_index_transition[indexes[scale.trace_x[i].valueOf()]] = i;\r\n\t\t\t}\r\n\t\t\treturn scale;\r\n\t\t},\r\n\r\n\t\tsetPosSettings: function (config) {\r\n\t\t\tfor (var i = 0, len = config.trace_x.length; i < len; i++) {\r\n\t\t\t\tconfig.left.push((config.width[i - 1] || 0) + (config.left[i - 1] || 0));\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_ignore_time_config: function (date, scale) {\r\n\r\n\t\t\tif (gantt.config.skip_off_time) {\r\n\t\t\t\tvar skip = true;\r\n\t\t\t\tvar probe = date;\r\n\r\n\t\t\t\t// check dates in case custom scale unit, e.g. {unit: \"month\", step: 3}\r\n\t\t\t\tfor (var i = 0; i < scale.step; i++) {\r\n\t\t\t\t\tif (i) {\r\n\t\t\t\t\t\tprobe = dateHelper.add(date, i, scale.unit);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tskip = skip && !this.isWorkTime(probe, scale.unit);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn skip;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\t//defined in an extension\r\n\t\tprocessIgnores: function (config) {\r\n\t\t\tconfig.ignore_x = {};\r\n\t\t\tconfig.display_count = config.count;\r\n\t\t},\r\n\t\tinitColSizes: function (config, min_col_width, full_width, line_height) {\r\n\t\t\tvar cont_width = full_width;\r\n\r\n\t\t\tconfig.height = line_height;\r\n\r\n\t\t\tvar column_count = config.display_count === undefined ? config.count : config.display_count;\r\n\r\n\t\t\tif (!column_count)\r\n\t\t\t\tcolumn_count = 1;\r\n\r\n\t\t\tconfig.col_width = Math.floor(cont_width / column_count);\r\n\r\n\t\t\tif (min_col_width) {\r\n\t\t\t\tif (config.col_width < min_col_width) {\r\n\t\t\t\t\tconfig.col_width = min_col_width;\r\n\t\t\t\t\tcont_width = config.col_width * column_count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconfig.width = [];\r\n\t\t\tvar ignores = config.ignore_x || {};\r\n\t\t\tfor (var i = 0; i < config.trace_x.length; i++) {\r\n\t\t\t\tif (ignores[config.trace_x[i].valueOf()] || (config.display_count == config.count)) {\r\n\t\t\t\t\tconfig.width[i] = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// width of month columns should be proportional month duration\r\n\t\t\t\t\tvar width = 1;\r\n\t\t\t\t\tif (config.unit == \"month\") {\r\n\t\t\t\t\t\tvar days = Math.round((dateHelper.add(config.trace_x[i], config.step, config.unit) - config.trace_x[i]) / (1000 * 60 * 60 * 24));\r\n\t\t\t\t\t\twidth = days;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconfig.width[i] = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.adjustSize(cont_width - this.getSum(config.width)/* 1 width per column from the code above */, config.width);\r\n\t\t\tconfig.full_width = this.getSum(config.width);\r\n\t\t},\r\n\t\tinitScaleConfig: function (config, min_date, max_date) {\r\n\t\t\tvar cfg = utils.mixin({\r\n\t\t\t\tcount: 0,\r\n\t\t\t\tcol_width: 0,\r\n\t\t\t\tfull_width: 0,\r\n\t\t\t\theight: 0,\r\n\t\t\t\twidth: [],\r\n\t\t\t\tleft: [],\r\n\t\t\t\ttrace_x: [],\r\n\t\t\t\ttrace_indexes: {},\r\n\t\t\t\tmin_date: new Date(min_date),\r\n\t\t\t\tmax_date: new Date(max_date)\r\n\t\t\t}, config);\r\n\r\n\t\t\tthis.eachColumn(config.unit, config.step, min_date, max_date, function (date) {\r\n\t\t\t\tcfg.count++;\r\n\t\t\t\tcfg.trace_x.push(new Date(date));\r\n\t\t\t\tcfg.trace_indexes[date.valueOf()] = cfg.trace_x.length - 1;\r\n\t\t\t});\r\n\r\n\t\t\tcfg.trace_x_ascending = cfg.trace_x.slice();\r\n\t\t\treturn cfg;\r\n\t\t},\r\n\t\titerateScales: function (lower_scale, upper_scale, from, to, callback) {\r\n\t\t\tvar upper_dates = upper_scale.trace_x;\r\n\t\t\tvar lower_dates = lower_scale.trace_x;\r\n\r\n\t\t\tvar prev = from || 0;\r\n\t\t\tvar end = to || (lower_dates.length - 1);\r\n\t\t\tvar prevUpper = 0;\r\n\r\n\r\n\t\t\tfor (var up = 1; up < upper_dates.length; up++) {\r\n\t\t\t\tvar target_index = (lower_scale.trace_indexes[+upper_dates[up]]);\r\n\t\t\t\tif (target_index !== undefined && target_index <= end) {\r\n\t\t\t\t\tif (callback) {\r\n\t\t\t\t\t\tcallback.apply(this, [prevUpper, up, prev, target_index]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tprev = target_index;\r\n\t\t\t\t\tprevUpper = up;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\talineScaleColumns: function (lower_scale, upper_scale, from, to) {\r\n\t\t\tthis.iterateScales(lower_scale, upper_scale, from, to, function (upper_start, upper_end, lower_start, lower_end) {\r\n\t\t\t\tvar targetWidth = this.getSum(lower_scale.width, lower_start, lower_end - 1);\r\n\t\t\t\tvar actualWidth = this.getSum(upper_scale.width, upper_start, upper_end - 1);\r\n\t\t\t\tif (actualWidth != targetWidth) {\r\n\t\t\t\t\tthis.setSumWidth(targetWidth, upper_scale, upper_start, upper_end - 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\teachColumn: function (unit, step, min_date, max_date, callback) {\r\n\t\t\tvar start = new Date(min_date),\r\n\t\t\t\tend = new Date(max_date);\r\n\t\t\tif (dateHelper[unit + \"_start\"]) {\r\n\t\t\t\tstart = dateHelper[unit + \"_start\"](start);\r\n\t\t\t}\r\n\r\n\t\t\tvar curr = new Date(start);\r\n\t\t\tif (+curr >= +end) {\r\n\t\t\t\tend = dateHelper.add(curr, step, unit);\r\n\t\t\t}\r\n\t\t\twhile (+curr < +end) {\r\n\t\t\t\tcallback.call(this, new Date(curr));\r\n\t\t\t\tvar tzOffset = curr.getTimezoneOffset();\r\n\t\t\t\tcurr = dateHelper.add(curr, step, unit);\r\n\t\t\t\tcurr = gantt._correct_dst_change(curr, tzOffset, step, unit);\r\n\t\t\t\tif (dateHelper[unit + '_start'])\r\n\t\t\t\t\tcurr = dateHelper[unit + \"_start\"](curr);\r\n\t\t\t}\r\n\t\t},\r\n\t\tlimitVisibleRange: function (cfg) {\r\n\t\t\tvar dates = cfg.trace_x;\r\n\r\n\t\t\tvar left = 0, right = cfg.width.length - 1;\r\n\t\t\tvar diff = 0;\r\n\t\t\tif (+dates[0] < +cfg.min_date && left != right) {\r\n\t\t\t\tvar width = Math.floor(cfg.width[0] * ((dates[1] - cfg.min_date) / (dates[1] - dates[0])));\r\n\t\t\t\tdiff += cfg.width[0] - width;\r\n\t\t\t\tcfg.width[0] = width;\r\n\r\n\t\t\t\tdates[0] = new Date(cfg.min_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar last = dates.length - 1;\r\n\t\t\tvar lastDate = dates[last];\r\n\t\t\tvar outDate = dateHelper.add(lastDate, cfg.step, cfg.unit);\r\n\t\t\tif (+outDate > +cfg.max_date && last > 0) {\r\n\t\t\t\tvar width = cfg.width[last] - Math.floor(cfg.width[last] * ((outDate - cfg.max_date) / (outDate - lastDate)));\r\n\t\t\t\tdiff += cfg.width[last] - width;\r\n\t\t\t\tcfg.width[last] = width;\r\n\t\t\t}\r\n\r\n\t\t\tif (diff) {\r\n\t\t\t\tvar full = this.getSum(cfg.width);\r\n\t\t\t\tvar shared = 0;\r\n\t\t\t\tfor (var i = 0; i < cfg.width.length; i++) {\r\n\t\t\t\t\tvar share = Math.floor(diff * (cfg.width[i] / full));\r\n\t\t\t\t\tcfg.width[i] += share;\r\n\t\t\t\t\tshared += share;\r\n\t\t\t\t}\r\n\t\t\t\tthis.adjustSize(diff - shared, cfg.width);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default ScaleHelper;\r\n","import ScaleHelper from \"./ui/timeline/scales_ignore\";\r\nimport PrimaryScaleHelper from \"./ui/timeline/scales\";\r\n\r\nfunction resolveConfigRange(unit, gantt){\r\n\tvar range = {\r\n\t\tstart_date:null,\r\n\t\tend_date:null\r\n\t};\r\n\r\n\tif (gantt.config.start_date && gantt.config.end_date) {\r\n\t\trange.start_date = gantt.date[unit + \"_start\"](new Date(gantt.config.start_date));\r\n\r\n\t\tvar end = new Date(gantt.config.end_date);\r\n\t\tvar start_interval = gantt.date[unit + \"_start\"](new Date(end));\r\n\t\tif (+end != +start_interval) {\r\n\t\t\tend = gantt.date.add(start_interval, 1, unit);\r\n\t\t} else {\r\n\t\t\tend = start_interval;\r\n\t\t}\r\n\r\n\t\trange.end_date = end;\r\n\t}\r\n\treturn range;\r\n}\r\n\r\nfunction _scale_range_unit(gantt) {\r\n\tvar primaryScale = (new PrimaryScaleHelper(gantt)).primaryScale();\r\n\tvar unit = primaryScale.unit;\r\n\tvar step = primaryScale.step;\r\n\tif (gantt.config.scale_offset_minimal) {\r\n\r\n\t\tvar helper = new ScaleHelper(gantt);\r\n\t\tvar scales = [helper.primaryScale()].concat(helper.getSubScales());\r\n\r\n\t\thelper.sortScales(scales);\r\n\t\tunit = scales[scales.length - 1].unit;\r\n\t\tstep = scales[scales.length - 1].step || 1;\r\n\t}\r\n\treturn { unit:unit, step:step };\r\n}\r\n\r\nfunction _init_tasks_range(gantt) {\r\n\tvar cfg = _scale_range_unit(gantt);\r\n\tvar unit = cfg.unit,\r\n\t\tstep = cfg.step;\r\n\tvar range = resolveConfigRange(unit, gantt);\r\n\r\n\t// GS-1544: Show correct date range if we have tasks or only projects\r\n\tif(!(range.start_date && range.end_date)){\r\n\t\tvar onlyProjectTasks = true;\r\n\t\tvar tasks = gantt.getTaskByTime();\r\n\t\tfor (var i = 0; i < tasks.length; i++) {\r\n\t\t\tvar task = tasks[i];\r\n\t\t\tif (task.type !== gantt.config.types.project){\r\n\t\t\t\tonlyProjectTasks = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (tasks.length && onlyProjectTasks){\r\n\t\t\tvar start_date = tasks[0].start_date;\r\n\t\t\tvar end_date = gantt.date.add(start_date, 1, gantt.config.duration_unit);\r\n\t\t\trange = {\r\n\t\t\t\tstart_date: new Date(start_date),\r\n\t\t\t\tend_date: new Date(end_date)\r\n\t\t\t};\r\n\t\t} else{\r\n\t\t\trange = gantt.getSubtaskDates();\r\n\t\t}\r\n\r\n\t\tif(!range.start_date || !range.end_date){\r\n\t\t\trange = {\r\n\t\t\t\tstart_date: new Date(),\r\n\t\t\t\tend_date: new Date()\r\n\t\t\t};\r\n\t\t}\r\n\t\t// extend the displayed date range including the constraints, deadlines and baselines\r\n\t\tgantt.eachTask(function(task){\r\n\t\t\tif (gantt.config.deadlines !== false && task.deadline){\r\n\t\t\t\textendRangeForDates(range, task.deadline, task.deadline);\r\n\t\t\t}\r\n\t\t\tif (task.constraint_date && task.constraint_type){\r\n\t\t\t\tif (gantt.config.constraint_types && task.constraint_type !== gantt.config.constraint_types.ASAP && task.constraint_type !== gantt.config.constraint_types.ALAP){\r\n\t\t\t\t\textendRangeForDates(range, task.constraint_date, task.constraint_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (gantt.config.baselines !== false && task.baselines){\r\n\t\t\t\ttask.baselines.forEach(function(baseline){\r\n\t\t\t\t\textendRangeForDates(range, baseline.start_date, baseline.end_date);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trange.start_date = gantt.date[unit + \"_start\"](range.start_date);\r\n\t\trange.start_date = gantt.calculateEndDate({\r\n\t\t\tstart_date: gantt.date[unit + \"_start\"](range.start_date),\r\n\t\t\tduration: -1,\r\n\t\t\tunit: unit,\r\n\t\t\tstep:step\r\n\t\t});//one free column before first task\r\n\r\n\t\trange.end_date = gantt.date[unit + \"_start\"](range.end_date);\r\n\t\trange.end_date = gantt.calculateEndDate({start_date: range.end_date, duration: 2, unit: unit, step:step});//one free column after last task\r\n\t}\r\n\r\n\tgantt._min_date = range.start_date;\r\n\tgantt._max_date = range.end_date;\r\n}\r\n\r\nfunction extendRangeForDates(range, start_date, end_date){\r\n\tif (start_date < range.start_date){\r\n\t\trange.start_date = new Date(start_date);\r\n\t}\r\n\tif (end_date > range.end_date){\r\n\t\trange.end_date = new Date(end_date);\r\n\t}\r\n}\r\n\r\nfunction _adjust_scales(gantt) {\r\n\tif (gantt.config.fit_tasks) {\r\n\t\tvar old_min = +gantt._min_date,\r\n\t\t\told_max = +gantt._max_date;\r\n\t\t//this._init_tasks_range();\r\n\t\tif (+gantt._min_date != old_min || +gantt._max_date != old_max) {\r\n\t\t\tgantt.render();\r\n\r\n\t\t\tgantt.callEvent(\"onScaleAdjusted\", []);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nexport default function updateTasksRange(gantt){\r\n\t_init_tasks_range(gantt);\r\n\t_adjust_scales(gantt);\r\n};\r\n","function copyLinkIdsArray(gantt, linkIds, targetHash){\r\n\tfor(var i = 0; i < linkIds.length; i++) {\r\n\t\tif(gantt.isLinkExists(linkIds[i])){\r\n\t\t\ttargetHash[linkIds[i]] = gantt.getLink(linkIds[i]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction copyLinkIds(gantt, task, targetHash){\r\n\tcopyLinkIdsArray(gantt, task.$source, targetHash);\r\n\tcopyLinkIdsArray(gantt, task.$target, targetHash);\r\n}\r\n\r\nfunction getSubtreeLinks(gantt, rootId){\r\n\tvar res = {};\r\n\r\n\tif(gantt.isTaskExists(rootId)){\r\n\t\tcopyLinkIds(gantt, gantt.getTask(rootId), res);\r\n\t}\r\n\r\n\tgantt.eachTask(function(child){\r\n\t\tcopyLinkIds(gantt, child, res);\r\n\t}, rootId);\r\n\r\n\treturn res;\r\n}\r\n\r\nfunction getSubtreeTasks(gantt, rootId){\r\n\tvar res = {};\r\n\r\n\tgantt.eachTask(function(child){\r\n\t\tres[child.id] = child;\r\n\t}, rootId);\r\n\r\n\treturn res;\r\n}\r\n\r\nexport default {\r\n\tgetSubtreeLinks: getSubtreeLinks,\r\n\tgetSubtreeTasks: getSubtreeTasks\r\n};","import * as helpers from \"../../utils/helpers\";\r\nimport treeHelper from \"../../utils/task_tree_helpers\";\r\n\r\n\r\nexport default class DataProcessorEvents {\r\n\tprotected _dataProcessorHandlers: any[];\r\n\tprotected $gantt: any;\r\n\tprotected $dp: any;\r\n\r\n\tconstructor(gantt: any, dp: any) {\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis.$dp = dp;\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t}\r\n\r\n\tattach() {\r\n\t\tconst dp = this.$dp;\r\n\t\tconst gantt = this.$gantt;\r\n\t\tconst cascadeDelete = {};\r\n\r\n\t\tconst clientSideDelete = (id) => {\r\n\t\t\treturn this.clientSideDelete(id, dp, gantt);\r\n\t\t};\r\n\r\n\t\tfunction getTaskLinks(task) {\r\n\t\t\tlet _links = [];\r\n\r\n\t\t\tif (task.$source) {\r\n\t\t\t\t_links = _links.concat(task.$source);\r\n\t\t\t}\r\n\t\t\tif (task.$target) {\r\n\t\t\t\t_links = _links.concat(task.$target);\r\n\t\t\t}\r\n\r\n\t\t\treturn _links;\r\n\t\t}\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterTaskAdd\", function(id, item) { // tslint:disable-line\r\n\t\t\tif (gantt.isTaskExists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"tasks\");\r\n\t\t\t\tdp.setUpdated(id, true, \"inserted\");\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterTaskUpdate\", function(id, item) { // tslint:disable-line\r\n\t\t\tif (gantt.isTaskExists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"tasks\");\r\n\t\t\t\tdp.setUpdated(id, true);\r\n\r\n\t\t\t\t// gantt can be destroyed/reinitialized after dp.setUpdated\r\n\t\t\t\tif(gantt._sendTaskOrder){\r\n\t\t\t\t\tgantt._sendTaskOrder(id, item);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onBeforeTaskDelete\", function(id, item) { // tslint:disable-line\r\n\t\t\tif (gantt.config.cascade_delete) {\r\n\t\t\t\tcascadeDelete[id] = {\r\n\t\t\t\t\ttasks: treeHelper.getSubtreeTasks(gantt, id),\r\n\t\t\t\t\tlinks: treeHelper.getSubtreeLinks(gantt, id)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t// GS-631. Keep the deleted item in Gantt until we receive the successful response from the server\r\n\t\t\tif (dp.deleteAfterConfirmation) {\r\n\t\t\t\tdp.setGanttMode(\"tasks\");\r\n\t\t\t\tdp.setUpdated(id, true, \"deleted\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterTaskDelete\", function(id, item) { // tslint:disable-line\r\n\t\t\tdp.setGanttMode(\"tasks\");\r\n\r\n\t\t\t// not send delete request if item is not inserted into the db - just remove it from the client\r\n\t\t\tconst needDbDelete = !clientSideDelete(id);\r\n\t\t\tconst needCascadeDelete = gantt.config.cascade_delete && cascadeDelete[id];\r\n\t\t\tif (!needDbDelete && !needCascadeDelete) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (needCascadeDelete) {\r\n\t\t\t\tconst dpMode = dp.updateMode;\r\n\t\t\t\tdp.setUpdateMode(\"off\");\r\n\r\n\t\t\t\tconst cascade = cascadeDelete[id];\r\n\t\t\t\tfor (const i in cascade.tasks) {\r\n\t\t\t\t\tif (!clientSideDelete(i)) {\r\n\t\t\t\t\t\tdp.storeItem(cascade.tasks[i]);\r\n\t\t\t\t\t\tdp.setUpdated(i, true, \"deleted\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdp.setGanttMode(\"links\");\r\n\t\t\t\tfor (const i in cascade.links) {\r\n\t\t\t\t\tif (!clientSideDelete(i)) {\r\n\t\t\t\t\t\tdp.storeItem(cascade.links[i]);\r\n\t\t\t\t\t\tdp.setUpdated(i, true, \"deleted\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcascadeDelete[id] = null;\r\n\r\n\t\t\t\tif (dpMode !== \"off\") {\r\n\t\t\t\t\tdp.sendAllData();\r\n\t\t\t\t}\r\n\t\t\t\tdp.setGanttMode(\"tasks\");\r\n\t\t\t\tdp.setUpdateMode(dpMode);\r\n\t\t\t}\r\n\r\n\t\t\tif (needDbDelete){\r\n\t\t\t\tdp.storeItem(item);\r\n\t\t\t\tif (!dp.deleteAfterConfirmation){\r\n\t\t\t\t\tdp.setUpdated(id, true, \"deleted\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (dp.updateMode !== \"off\" && !dp._tSend) {\r\n\t\t\t\tdp.sendAllData();\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterLinkUpdate\", function(id, item) { // tslint:disable-line\r\n\t\t\tif (gantt.isLinkExists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"links\");\r\n\t\t\t\tdp.setUpdated(id, true);\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterLinkAdd\", function(id, item) { // tslint:disable-line\r\n\t\t\tif (gantt.isLinkExists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"links\");\r\n\t\t\t\tdp.setUpdated(id, true,\"inserted\");\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onAfterLinkDelete\", function(id, item) { // tslint:disable-line\r\n\t\t\tdp.setGanttMode(\"links\");\r\n\r\n\t\t\tconst needDbDelete = !clientSideDelete(id);\r\n\t\t\tif (!needDbDelete) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdp.storeItem(item);\r\n\t\t\tdp.setUpdated(id, true,\"deleted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onRowDragEnd\", function(id, target) { // tslint:disable-line\r\n\t\t\tgantt._sendTaskOrder(id, gantt.getTask(id));\r\n\t\t}));\r\n\r\n\t\tlet tasks = null;\r\n\t\tlet links = null;\r\n\r\n\t\tthis._dataProcessorHandlers.push(gantt.attachEvent(\"onTaskIdChange\", function(oldId, newId) { // tslint:disable-line\r\n\t\t\tif (!dp._waitMode) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst children = gantt.getChildren(newId);\r\n\t\t\tif (children.length) {\r\n\t\t\t\ttasks = tasks || {};\r\n\r\n\t\t\t\tfor (let i = 0; i < children.length; i++) {\r\n\t\t\t\t\tconst ch = this.getTask(children[i]);\r\n\t\t\t\t\ttasks[ch.id] = ch;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst item = this.getTask(newId);\r\n\t\t\tconst itemLinks = getTaskLinks(item);\r\n\r\n\t\t\tif (itemLinks.length) {\r\n\t\t\t\tlinks = links || {};\r\n\r\n\t\t\t\tfor (let i = 0; i < itemLinks.length; i++) {\r\n\t\t\t\t\tconst link = this.getLink(itemLinks[i]);\r\n\t\t\t\t\tlinks[link.id] = link;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"onAfterUpdateFinish\", function() {\r\n\t\t\tif (tasks || links) {\r\n\t\t\t\tgantt.batchUpdate(function() {\r\n\t\t\t\t\tfor (const id in tasks) {\r\n\t\t\t\t\t\tgantt.updateTask(tasks[id].id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (const id in links) {\r\n\t\t\t\t\t\tgantt.updateLink(links[id].id);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttasks = null;\r\n\t\t\t\t\tlinks = null;\r\n\t\t\t\t});\r\n\t\t\t\tif (tasks) {\r\n\t\t\t\t\tgantt._dp.setGanttMode(\"tasks\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgantt._dp.setGanttMode(\"links\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tdp.attachEvent(\"onBeforeDataSending\", function() {\r\n\t\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet url = this._serverProcessor;\r\n\t\t\tif (this._tMode === \"REST-JSON\" || this._tMode === \"REST\") {\r\n\t\t\t\tconst mode = this._ganttMode;\r\n\r\n\t\t\t\turl = url.substring(0, url.indexOf(\"?\") > -1 ? url.indexOf(\"?\") : url.length);\r\n\t\t\t\t// editing=true&\r\n\t\t\t\tthis.serverProcessor = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + mode;\r\n\t\t\t} else {\r\n\t\t\t\tconst pluralizedMode = this._ganttMode + \"s\";\r\n\t\t\t\tthis.serverProcessor = url + gantt.ajax.urlSeparator(url) + \"gantt_mode=\" + pluralizedMode;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", function insertCallback(upd, id, parent, mode) { // tslint:disable-line\r\n\t\t\tconst data = upd.data || gantt.xml._xmlNodeToJSON(upd.firstChild);\r\n\t\t\tconst methods = {\r\n\t\t\t\tadd: gantt.addTask,\r\n\t\t\t\tisExist: gantt.isTaskExists\r\n\t\t\t};\r\n\t\t\tif (mode === \"links\") {\r\n\t\t\t\tmethods.add = gantt.addLink;\r\n\t\t\t\tmethods.isExist = gantt.isLinkExists;\r\n\t\t\t}\r\n\t\t\tif (methods.isExist.call(gantt, id)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdata.id = id;\r\n\t\t\tmethods.add.call(gantt, data);\r\n\t\t});\r\n\r\n\t\tdp.attachEvent(\"updateCallback\", function updateCallback(upd, id) {\r\n\t\t\tconst data = upd.data || gantt.xml._xmlNodeToJSON(upd.firstChild);\r\n\t\t\tif (!gantt.isTaskExists(id)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst objData = gantt.getTask(id);\r\n\t\t\tfor (const key in data) {\r\n\t\t\t\tlet property = data[key];\r\n\t\t\t\tswitch (key) {\r\n\t\t\t\t\tcase \"id\":\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tcase \"start_date\":\r\n\t\t\t\t\tcase \"end_date\":\r\n\t\t\t\t\t\tproperty = gantt.defined(gantt.templates.xml_date) ? gantt.templates.xml_date(property) : gantt.templates.parse_date(property);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"duration\":\r\n\t\t\t\t\t\tobjData.end_date = gantt.calculateEndDate({start_date: objData.start_date, duration: property, task:objData});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tobjData[key] = property;\r\n\t\t\t}\r\n\t\t\tgantt.updateTask(id);\r\n\t\t\tgantt.refreshData();\r\n\t\t});\r\n\t\tdp.attachEvent(\"deleteCallback\", function deleteCallback(upd, id, parent, mode) { // tslint:disable-line\r\n\t\t\tconst methods = {\r\n\t\t\t\tdelete: gantt.deleteTask,\r\n\t\t\t\tisExist: gantt.isTaskExists\r\n\t\t\t};\r\n\t\t\tif (mode === \"links\") {\r\n\t\t\t\tmethods.delete = gantt.deleteLink;\r\n\t\t\t\tmethods.isExist = gantt.isLinkExists;\r\n\t\t\t} else if(mode === \"assignment\") {\r\n\t\t\t\tmethods.delete = function(val) {\r\n\t\t\t\t\tgantt.$data.assignmentsStore.remove(val);\r\n\t\t\t\t};\r\n\t\t\t\tmethods.isExist = function(val){\r\n\t\t\t\t\treturn gantt.$data.assignmentsStore.exists(val);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tif (methods.isExist.call(gantt, id)) {\r\n\t\t\t\tmethods.delete.call(gantt, id);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.handleResourceCRUD(dp, gantt);\r\n\t\tthis.handleResourceAssignmentCRUD(dp, gantt);\r\n\t\tthis.handleBaselineCRUD(dp, gantt);\r\n\t}\r\n\r\n\tclientSideDelete(id, dp, gantt){\r\n\t\tconst updated = dp.updatedRows.slice();\r\n\t\tlet clientOnly = false;\r\n\r\n\t\tif(gantt.getUserData(id, \"!nativeeditor_status\", dp._ganttMode) === \"true_deleted\"){\r\n\t\t\tclientOnly = true;\r\n\t\t\tdp.setUpdated(id,false);\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < updated.length && !dp._in_progress[id]; i++) {\r\n\t\t\tif (updated[i] === id) {\r\n\t\t\t\tif (gantt.getUserData(id, \"!nativeeditor_status\", dp._ganttMode) === \"inserted\") {\r\n\t\t\t\t\tclientOnly = true;\r\n\t\t\t\t}\r\n\t\t\t\tdp.setUpdated(id,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn clientOnly;\r\n\t}\r\n\r\n\thandleResourceAssignmentCRUD(dp, gantt){\r\n\t\tif(!gantt.config.resources || gantt.config.resources.dataprocessor_assignments !== true){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst assignmentsStore = gantt.getDatastore(gantt.config.resource_assignment_store);\r\n\t\tconst insertedTasks = {};\r\n\t\tconst pendingAssignments = {};\r\n\r\n\t\tgantt.attachEvent(\"onBeforeTaskAdd\", function(id, task){\r\n\t\t\tinsertedTasks[id] = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tfunction putAssignmentToQueue(item){\r\n\t\t\tpendingAssignments[item.id] = item;\r\n\t\t\tinsertedTasks[item.task_id] = true;\r\n\t\t}\r\n\r\n\t\tfunction insertResourceAssignment(assignment){\r\n\t\t\tconst id = assignment.id;\r\n\t\t\tif (assignmentsStore.exists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"assignment\");\r\n\t\t\t\tdp.setUpdated(id, true,\"inserted\");\r\n\t\t\t}\r\n\t\t\tdelete pendingAssignments[id];\r\n\t\t}\r\n\r\n\t\tgantt.attachEvent(\"onTaskIdChange\", function(id, newId){\r\n\t\t\tdelete insertedTasks[id];\r\n\t\t});\r\n\r\n\t\tassignmentsStore.attachEvent(\"onAfterAdd\", (id, item) => {\r\n\t\t\tif(insertedTasks[item.task_id]){\r\n\t\t\t\t// inserting assignment of new task\r\n\t\t\t\t// task is not saved yet, need to wait till it gets permanent id and save assigmnents after that\r\n\t\t\t\tputAssignmentToQueue(item);\r\n\t\t\t}else{\r\n\t\t\t\tinsertResourceAssignment(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tassignmentsStore.attachEvent(\"onAfterUpdate\", (id, item) => {\r\n\t\t\tif (assignmentsStore.exists(id)) {\r\n\t\t\t\tif(pendingAssignments[id]){\r\n\t\t\t\t\tinsertResourceAssignment(item);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdp.setGanttMode(\"assignment\");\r\n\t\t\t\t\tdp.setUpdated(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tassignmentsStore.attachEvent(\"onAfterDelete\", (id, item) => {\r\n\t\t\tdp.setGanttMode(\"assignment\");\r\n\r\n\t\t\tconst needDbDelete = !this.clientSideDelete(id, dp, gantt);\r\n\t\t\tif (!needDbDelete) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdp.storeItem(item);\r\n\t\t\tdp.setUpdated(id, true,\"deleted\");\r\n\t\t});\r\n\r\n\t}\r\n\r\n\thandleResourceCRUD(dp, gantt){\r\n\t\tif(!gantt.config.resources || gantt.config.resources.dataprocessor_resources !== true){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst resourcesStore = gantt.getDatastore(gantt.config.resource_store);\r\n\r\n\t\tfunction insertResource(resource){\r\n\t\t\tconst id = resource.id;\r\n\t\t\tif (resourcesStore.exists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"resource\");\r\n\t\t\t\tdp.setUpdated(id, true,\"inserted\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tresourcesStore.attachEvent(\"onAfterAdd\", (id, item) => {\r\n\t\t\tinsertResource(item);\r\n\t\t});\r\n\r\n\t\tresourcesStore.attachEvent(\"onAfterUpdate\", (id, item) => {\r\n\t\t\tif (resourcesStore.exists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"resource\");\r\n\t\t\t\tdp.setUpdated(id, true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tresourcesStore.attachEvent(\"onAfterDelete\", (id, item) => {\r\n\t\t\tdp.setGanttMode(\"resource\");\r\n\r\n\t\t\tconst needDbDelete = !this.clientSideDelete(id, dp, gantt);\r\n\t\t\tif (!needDbDelete) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdp.storeItem(item);\r\n\t\t\tdp.setUpdated(id, true,\"deleted\");\r\n\t\t});\r\n\r\n\t}\r\n\r\n\thandleBaselineCRUD(dp, gantt){\r\n\t\tif(!gantt.config.baselines || gantt.config.baselines.dataprocessor_baselines !== true){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst baselineStore = gantt.getDatastore(gantt.config.baselines.datastore);\r\n\r\n\t\tfunction insertResource(resource){\r\n\t\t\tconst id = resource.id;\r\n\t\t\tif (baselineStore.exists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"baseline\");\r\n\t\t\t\tdp.setUpdated(id, true,\"inserted\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbaselineStore.attachEvent(\"onAfterAdd\", (id, item) => {\r\n\t\t\tinsertResource(item);\r\n\t\t});\r\n\r\n\t\tbaselineStore.attachEvent(\"onAfterUpdate\", (id, item) => {\r\n\t\t\tif (baselineStore.exists(id)) {\r\n\t\t\t\tdp.setGanttMode(\"baseline\");\r\n\t\t\t\tdp.setUpdated(id, true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbaselineStore.attachEvent(\"onAfterDelete\", (id, item) => {\r\n\t\t\tdp.setGanttMode(\"baseline\");\r\n\r\n\t\t\tconst needDbDelete = !this.clientSideDelete(id, dp, gantt);\r\n\t\t\tif (!needDbDelete) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdp.storeItem(item);\r\n\t\t\tdp.setUpdated(id, true,\"deleted\");\r\n\t\t});\r\n\t}\r\n\r\n\tdetach() {\r\n\t\thelpers.forEach(this._dataProcessorHandlers, (e) => {\r\n\t\t\tthis.$gantt.detachEvent(e);\r\n\t\t});\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t}\r\n}\r\n","import * as utils from \"../../utils/utils\";\r\n\r\nexport default class SimpleStorage {\r\n\tpublic static create = () : SimpleStorage => {\r\n\t\treturn new SimpleStorage();\r\n\t};\r\n\r\n\tprotected _storage: { [id: string]: any; };\r\n\r\n\tprotected constructor() {\r\n\t\tthis._storage = {};\r\n\t}\r\n\r\n\tpublic clear = (): void => {\r\n\t\tthis._storage = {};\r\n\t};\r\n\r\n\tpublic storeItem = (item: any): void => {\r\n\t\tthis._storage[item.id] = utils.copy(item);\r\n\t};\r\n\r\n\tpublic getStoredItem = (id: string): any => {\r\n\t\treturn this._storage[id] || null;\r\n\t};\r\n}","import eventable from \"../../utils/eventable\";\r\nimport * as helpers from \"../../utils/helpers\";\r\nimport * as utils from \"../../utils/utils\";\r\nimport DataProcessorEvents from \"./data_processor_events\";\r\nimport extendGantt from \"./extend_gantt\";\r\nimport SimpleStorage from \"./simple_storage\";\r\nimport global from \"../../utils/global\";\r\n\r\nexport interface DataProcessor { // tslint:disable-line\r\n\t$gantt: any;\r\n\tdetachAllEvents: any;\r\n\tattachEvent: any;\r\n\tcallEvent: any;\r\n\r\n\tserverProcessor: string;\r\n\taction_param: string;\r\n\tupdatedRows: any[];\r\n\tautoUpdate: boolean;\r\n\tupdateMode: string;\r\n\tmessages: any[];\r\n\tstyles: object;\r\n\tdnd: any;\r\n\tdeleteAfterConfirmation?: any;\r\n}\r\n\r\nexport function createDataProcessor(config: any) {\r\n\tlet router;\r\n\tlet tMode;\r\n\tlet headers;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if (config.hasOwnProperty(\"assignment\") || config.hasOwnProperty(\"baseline\") || config.hasOwnProperty(\"link\") || config.hasOwnProperty(\"task\")) {\r\n\t\trouter = config;\r\n\t} else if(config.hasOwnProperty(\"headers\")){\r\n\t\t// GS-2312 for custom headers\r\n\t\theaders = config.headers;\r\n\t}\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\tconst gantt = this; // tslint:disable-line\r\n\tconst dp = new DataProcessor(config.url);\r\n\r\n\r\n\tdp.init(gantt);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter,\r\n\t\theaders\r\n\t}, config.batchUpdate);\r\n\tif(config.deleteAfterConfirmation){\r\n\t\tdp.deleteAfterConfirmation = config.deleteAfterConfirmation;\r\n\t}\r\n\treturn dp;\r\n}\r\n\r\nexport class DataProcessor {\r\n\tpublic modes: object;\r\n\tpublic serverProcessor: string;\r\n\tpublic action_param: string; // tslint:disable-line\r\n\tpublic updatedRows: any[];\r\n\tpublic autoUpdate: boolean;\r\n\tpublic updateMode: string;\r\n\tpublic messages: any[];\r\n\tpublic styles: object;\r\n\tpublic dnd: any;\r\n\r\n\tprotected _tMode: string;\r\n\tprotected _headers: any;\r\n\tprotected _payload: any;\r\n\tprotected _postDelim: string;\r\n\tprotected _waitMode: number;\r\n\tprotected _in_progress: object; // tslint:disable-line\r\n\tprotected _invalid: object;\r\n\tprotected _storage: SimpleStorage;\r\n\tprotected _tSend: boolean;\r\n\tprotected _serializeAsJson: boolean;\r\n\tprotected _router: any;\r\n\tprotected _utf: boolean;\r\n\tprotected _methods: any[];\r\n\tprotected _user: any;\r\n\tprotected _uActions: object;\r\n\tprotected _needUpdate: boolean;\r\n\tprotected _ganttMode: \"task\"|\"link\";\r\n\tprotected _routerParametersFormat: \"parameters\"|\"object\";\r\n\r\n\tprotected _silent_mode: any; // tslint:disable-line\r\n\tprotected _updateBusy: any;\r\n\tprotected _serverProcessor: any;\r\n\tprotected _initialized: boolean;\r\n\r\n\tconstructor(serverProcessorURL?) {\r\n\t\tthis.serverProcessor = serverProcessorURL;\r\n\t\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\t\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\t\tthis.autoUpdate = true;\r\n\t\tthis.updateMode = \"cell\";\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tthis._postDelim = \"_\";\r\n\t\tthis._routerParametersFormat = \"parameters\";\r\n\r\n\t\tthis._waitMode = 0;\r\n\t\tthis._in_progress = {}; // ?\r\n\t\tthis._storage = SimpleStorage.create();\r\n\t\tthis._invalid = {};\r\n\t\tthis.messages = [];\r\n\r\n\t\tthis.styles = {\r\n\t\t\tupdated: \"font-weight:bold;\",\r\n\t\t\tinserted: \"font-weight:bold;\",\r\n\t\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\t\terror: \"color:red;\",\r\n\t\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t\t};\r\n\t\tthis.enableUTFencoding(true);\r\n\t\teventable(this);\r\n\t}\r\n\r\n\tsetTransactionMode(mode:any, total?:any) {\r\n\t\tif (typeof mode === \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (utils.defined(mode.headers)) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (utils.defined(mode.payload)) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t}\r\n\r\n\tescape(data:any) {\r\n\t\tif (this._utf) {\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\t} else {\r\n\t\t\treturn escape(data);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: allows to set escaping mode\r\n\t * @param: true - utf based escaping, simple - use current page encoding\r\n\t * @type: public\r\n\t */\r\n\tenableUTFencoding(mode:boolean) {\r\n\t\tthis._utf = !!mode;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: get state of updating\r\n\t * @returns: true - all in sync with server, false - some items not updated yet.\r\n\t * @type: public\r\n\t */\r\n\tgetSyncState() {\r\n\t\treturn !this.updatedRows.length;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: set if rows should be send to server automatically\r\n\t * @param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t * @type: public\r\n\t */\r\n\tsetUpdateMode(mode: string, dnd: any) {\r\n\t\tthis.autoUpdate = (mode === \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t}\r\n\r\n\tignore(code: any, master: any) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || global);\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: mark row as updated/normal. check mandatory fields, initiate autoupdate (if turned on)\r\n\t * @param: rowId - id of row to set update-status for\r\n\t * @param: state - true for \"updated\", false for \"not updated\"\r\n\t * @param: mode - update mode name\r\n\t * @type: public\r\n\t */\r\n\tsetUpdated(rowId:number|string, state: boolean, mode?: string) {\r\n\t\tif (this._silent_mode) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tconst existing = this.$gantt.getUserData(rowId, this.action_param, this._ganttMode);\r\n\t\tif (existing && mode === \"updated\") {\r\n\t\t\tmode = existing;\r\n\t\t}\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); // clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$gantt.setUserData(rowId, this.action_param, mode, this._ganttMode);\r\n\t\t\tif (this._in_progress[rowId]) {\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$gantt.setUserData(rowId, this.action_param, \"\", this._ganttMode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) {\r\n\t\t\tthis.sendData(rowId);\r\n\t\t}\r\n\t}\r\n\r\n\tmarkRow(id: number | string, state: boolean, mode: string) {\r\n\t\tlet str = \"\";\r\n\t\tconst invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t// default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + \" \" + str;\r\n\r\n\t\t\tthis.$gantt[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (let i = 0; i < invalid.details.length; i++) {\r\n\t\t\t\t\tif (invalid.details[i]) {\r\n\t\t\t\t\t\tthis.$gantt[this._methods[1]](id, i, str);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetActionByState(state: string):string {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\r\n\t\t// reorder\r\n\t\treturn \"update\";\r\n\t}\r\n\r\n\tgetState(id: number | string) {\r\n\t\treturn this.$gantt.getUserData(id, this.action_param, this._ganttMode);\r\n\t}\r\n\r\n\tis_invalid(id: number | string) {\r\n\t\treturn this._invalid[id];\r\n\t}\r\n\r\n\tset_invalid(id: number | string, mode: any, details?) {\r\n\t\tif (details) {\r\n\t\t\tmode = {\r\n\t\t\t\tvalue: mode,\r\n\t\t\t\tdetails,\r\n\t\t\t\ttoString: function() { // tslint:disable-line\r\n\t\t\t\t\treturn this.value.toString();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t\tthis._invalid[id] = mode;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: check mandatory fields and verify values of cells, initiate update (if specified). Can be redefined in order to provide custom validation\r\n\t * @param: rowId - id of row to set update-status for\r\n\t * @type: public\r\n\t */\r\n\t// tslint:disable-next-line\r\n\tcheckBeforeUpdate(rowId: number | string) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: send row(s) values to server\r\n\t * @param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t * @type: public\r\n\t */\r\n\tsendData(rowId?: any) {\r\n\t\tif (this.$gantt.editStop) {\r\n\t\t\tthis.$gantt.editStop();\r\n\t\t}\r\n\r\n\t\tif (typeof rowId === \"undefined\" || this._tSend) {\r\n\r\n\t\t\tconst pendingUpdateModes = [];\r\n\t\t\tif(this.modes){\r\n\t\t\t\tconst knownModes = [\"task\", \"link\", \"assignment\", \"baseline\"];\r\n\t\t\t\tknownModes.forEach((mode) => {\r\n\t\t\t\t\tif(this.modes[mode] && this.modes[mode].updatedRows.length){\r\n\t\t\t\t\t\tpendingUpdateModes.push(mode);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (pendingUpdateModes.length){\r\n\t\t\t\tfor(let i = 0; i < pendingUpdateModes.length; i++){\r\n\t\t\t\t\tthis.setGanttMode(pendingUpdateModes[i]);\r\n\t\t\t\t\tthis.sendAllData();\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\treturn this.sendAllData();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (this._in_progress[rowId]) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t}\r\n\r\n\tserialize(data: any, id: any) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\t\tif (typeof id !== \"undefined\") {\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\t} else {\r\n\t\t\tconst stack = [];\r\n\t\t\tconst keys = [];\r\n\t\t\tfor (const key in data) {\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this._postDelim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$gantt.security_key) {\r\n\t\t\t\tstack.push(\"dhx_security=\" + this.$gantt.security_key);\r\n\t\t\t}\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t}\r\n\r\n\tserialize_one(data: any, pref: string) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\t\tconst stack = [];\r\n\t\tlet serialized = \"\";\r\n\t\tfor (const key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key === \"id\" ||\r\n\t\t\t\t\tkey == this.action_param) && // tslint:disable-line\r\n\t\t\t\t\tthis._tMode === \"REST\") {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = String(data[key]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t}\r\n\r\n\tsendAllData() {\r\n\t\tif (!this.updatedRows.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tlet valid: any = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\t// this.updatedRows can be spliced from onBeforeUpdate via dp.setUpdated false\r\n\t\t\t// use an iterator instead of for(var i = 0; i < this.updatedRows; i++) then\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfindRow(pattern: any) {\r\n\t\tlet i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++) {\r\n\t\t\tif (pattern == this.updatedRows[i]) { // tslint:disable-line\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn i;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: define custom actions\r\n\t * @param: name - name of action, same as value of action attribute\r\n\t * @param: handler - custom function, which receives a XMl response content for action\r\n\t * @type: private\r\n\t */\r\n\tdefineAction(name: string, handler: any) {\r\n\t\tif (!this._uActions) {\r\n\t\t\tthis._uActions = {};\r\n\t\t}\r\n\t\tthis._uActions[name] = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t * @param: sid - id of item before update\r\n\t * @param: tid - id of item after up0ate\r\n\t * @param: action - action name\r\n\t * @type: public\r\n\t * @topic: 0\r\n\t */\r\n\tafterUpdateCallback(sid: number | string, tid: number | string, action: string, btag: any, ganttMode: string) {\r\n\t\tif(!this.$gantt){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.setGanttMode(ganttMode);\r\n\r\n\t\tconst marker = sid;\r\n\t\tconst correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tconst originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) { // tslint:disable-line\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$gantt[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tif(!this.deleteAfterConfirmation || this._ganttMode !== \"task\"){\r\n\t\t\t\t\tthis.$gantt.setUserData(sid, this.action_param, \"true_deleted\", this._ganttMode);\r\n\t\t\t\t\tthis.$gantt[this._methods[3]](sid);\r\n\t\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (this._ganttMode === \"task\" && this.$gantt.isTaskExists(sid)) {\r\n\t\t\t\t\t\tthis.$gantt.setUserData(sid, this.action_param, \"true_deleted\", this._ganttMode);\r\n\t\t\t\t\t\tconst task = this.$gantt.getTask(sid);\r\n\t\t\t\t\t\tthis.$gantt.silent(() => {\r\n\t\t\t\t\t\t\tthis.$gantt.deleteTask(sid);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.$gantt.callEvent(\"onAfterTaskDelete\", [sid, task]);\r\n\t\t\t\t\t\tthis.$gantt.render();\r\n\t\t\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$gantt.setUserData(sid, this.action_param, \"\", this._ganttMode);\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$gantt.getUserData(sid, this.action_param, this._ganttMode));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: response from server\r\n\t * @param: xml - XMLLoader object with response XML\r\n\t * @type: private\r\n\t */\r\n\tafterUpdate(that: any, xml: any, id?:any) {\r\n\t\tlet _xml;\r\n\t\tif (arguments.length === 3) {\r\n\t\t\t_xml = arguments[1];\r\n\t\t} else {\r\n\t\t\t// old dataprocessor\r\n\t\t\t_xml = arguments[4];\r\n\t\t}\r\n\t\tlet mode = this.getGanttMode();\r\n\t\tconst reqUrl = _xml.filePath || _xml.url;\r\n\r\n\t\tif (this._tMode !== \"REST\" && this._tMode !== \"REST-JSON\") {\r\n\t\t\tif (reqUrl.indexOf(\"gantt_mode=links\") !== -1) {\r\n\t\t\t\tmode = \"link\";\r\n\t\t\t} else if (reqUrl.indexOf(\"gantt_mode=assignments\") !== -1) {\r\n\t\t\t\tmode = \"assignment\";\r\n\t\t\t} else if (reqUrl.indexOf(\"gantt_mode=baselines\") !== -1) {\r\n\t\t\t\tmode = \"baseline\";\r\n\t\t\t} else {\r\n\t\t\t\tmode = \"task\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (reqUrl.indexOf(\"/link\") >= 0) {\r\n\t\t\t\tmode = \"link\";\r\n\t\t\t} else if(reqUrl.indexOf(\"/assignment\") >= 0){\r\n\t\t\t\tmode = \"assignment\";\r\n\t\t\t} else if(reqUrl.indexOf(\"/baseline\") >= 0){\r\n\t\t\t\tmode = \"baseline\";\r\n\t\t\t} else {\r\n\t\t\t\tmode = \"task\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.setGanttMode(mode);\r\n\r\n\t\tconst ajax = this.$gantt.ajax;\r\n\t\t// try to use json first\r\n\t\tlet tag;\r\n\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst processCallback = (itemId: any) => {\r\n\t\t\tconst action = tag.action || this.getState(itemId) || \"updated\";\r\n\t\t\tconst sid = tag.sid || itemId[0];\r\n\t\t\tconst tid = tag.tid || itemId[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag, mode);\r\n\t\t};\r\n\t\tif (tag) {\r\n\t\t\t// GS-753. When multiple tasks are updated, unhighlight all of them\r\n\t\t\tif (Array.isArray(id) && id.length > 1) {\r\n\t\t\t\tid.forEach((taskId) => processCallback(taskId));\r\n\t\t\t} else {\r\n\t\t\t\tprocessCallback(id);\r\n\t\t\t}\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\tthis.setGanttMode(mode);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tconst top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this.cleanUpdate(id);\r\n\t\t}\r\n\t\tconst atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this.cleanUpdate(id);\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < atag.length; i++) {\r\n\t\t\tconst btag = atag[i];\r\n\t\t\tconst action = btag.getAttribute(\"type\");\r\n\t\t\tconst sid = btag.getAttribute(\"sid\");\r\n\t\t\tconst tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag, mode);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t}\r\n\r\n\tcleanUpdate(id: any[]) {\r\n\t\tif (id) {\r\n\t\t\tfor (let i = 0; i < id.length; i++) {\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfinalizeUpdate() {\r\n\t\tif (this._waitMode) {\r\n\t\t\tthis._waitMode--;\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length) {\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @desc: initializes data-processor\r\n\t * @param: gantt - dhtmlxGantt object to attach this data-processor to\r\n\t * @type: public\r\n\t */\r\n\tinit(gantt: any) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$gantt = gantt;\r\n\t\tif (this.$gantt._dp_init) {\r\n\t\t\tthis.$gantt._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis.styles = {\r\n\t\t\tupdated:\"gantt_updated\",\r\n\t\t\torder:\"gantt_updated\",\r\n\t\t\tinserted:\"gantt_inserted\",\r\n\t\t\tdeleted:\"gantt_deleted\",\r\n\t\t\tdelete_confirmation:\"gantt_deleted\",\r\n\t\t\tinvalid:\"gantt_invalid\",\r\n\t\t\terror:\"gantt_error\",\r\n\t\t\tclear:\"\"\r\n\t\t};\r\n\r\n\t\tthis._methods=[\"_row_style\",\"setCellTextStyle\",\"_change_id\",\"_delete_task\"];\r\n\t\textendGantt(this.$gantt, this);\r\n\t\tconst dataProcessorEvents = new DataProcessorEvents(this.$gantt, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this.setGanttMode;\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$gantt._dp;\r\n\t\t\tdelete this.$gantt._change_id;\r\n\t\t\tdelete this.$gantt._row_style;\r\n\t\t\tdelete this.$gantt._delete_task;\r\n\t\t\tdelete this.$gantt._sendTaskOrder;\r\n\t\t\tdelete this.$gantt;\r\n\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$gantt.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\t}\r\n\r\n\tsetOnAfterUpdate(handler) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", handler);\r\n\t}\r\n\r\n\tsetOnBeforeUpdateHandler(handler) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", handler);\r\n\t}\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate(interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._needUpdate = false;\r\n\r\n\t\tthis._updateBusy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", this.afterAutoUpdate); // arguments sid, action, tid, xml_node;\r\n\r\n\t\tthis.attachEvent(\"onFullSync\", this.fullSync);\r\n\r\n\t\tsetInterval(() => {\r\n\t\t\tthis.loadUpdate();\r\n\t\t}, interval);\r\n\t}\r\n\r\n\t/* process updating request response\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate(sid, action, tid, xml_node) { // tslint:disable-line\r\n\t\tif (action === \"collision\") {\r\n\t\t\tthis._needUpdate = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync() {\r\n\t\tif (this._needUpdate) {\r\n\t\t\tthis._needUpdate = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates(url, callback) {\r\n\t\tconst ajax = this.$gantt.ajax;\r\n\t\tif (this._updateBusy) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tthis._updateBusy = true;\r\n\t\t}\r\n\r\n\t\tajax.get(url, callback);\r\n\r\n\t}\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate() {\r\n\t\tconst ajax = this.$gantt.ajax;\r\n\t\tconst version = this.$gantt.getUserData(0, \"version\", this._ganttMode);\r\n\t\tlet url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, (xml) => {\r\n\t\t\tconst vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tthis.$gantt.setUserData(0, \"version\", this._getXmlNodeValue(vers[0]), this._ganttMode);\r\n\r\n\t\t\tconst updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tthis._silent_mode = true;\r\n\r\n\t\t\t\tfor (let i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tconst status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tconst id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tconst parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._silent_mode = false;\r\n\t\t\t}\r\n\r\n\t\t\tthis._updateBusy = false;\r\n\t\t});\r\n\t}\r\n\r\n\tdestructor() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {}; // ?\r\n\t\tthis._invalid = {};\r\n\t\tthis._storage.clear();\r\n\t\tthis._storage = null;\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t}\r\n\r\n\tsetGanttMode(mode) {\r\n\t\tif (mode === \"tasks\") {\r\n\t\t\tmode = \"task\";\r\n\t\t} else if (mode === \"links\") {\r\n\t\t\tmode = \"link\";\r\n\t\t}\r\n\r\n\t\tconst modes = this.modes || {};\r\n\t\tconst ganttMode = this.getGanttMode();\r\n\t\tif (ganttMode) {\r\n\t\t\tmodes[ganttMode] = {\r\n\t\t\t\t_in_progress : this._in_progress,\r\n\t\t\t\t_invalid: this._invalid,\r\n\t\t\t\t_storage: this._storage,\r\n\t\t\t\tupdatedRows : this.updatedRows\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tlet newState = modes[mode];\r\n\t\tif (!newState) {\r\n\t\t\tnewState = modes[mode] = {\r\n\t\t\t\t_in_progress : {},\r\n\t\t\t\t_invalid : {},\r\n\t\t\t\t_storage : SimpleStorage.create(),\r\n\t\t\t\tupdatedRows : []\r\n\t\t\t};\r\n\t\t}\r\n\t\tthis._in_progress = newState._in_progress;\r\n\t\tthis._invalid = newState._invalid;\r\n\t\tthis._storage = newState._storage;\r\n\t\tthis.updatedRows = newState.updatedRows;\r\n\t\tthis.modes = modes;\r\n\t\tthis._ganttMode = mode;\r\n\t}\r\n\tgetGanttMode():string {\r\n\t\treturn this._ganttMode;\r\n\t}\r\n\r\n\tstoreItem(item) {\r\n\t\tthis._storage.storeItem(item);\r\n\t}\r\n\r\n\turl(url: string) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t}\r\n\r\n\tprotected _beforeSendData(data: any, rowId: any) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis._sendData(data, rowId);\r\n\t}\r\n\r\n\tprotected _serializeAsJSON(data: any) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tconst copy = utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t}\r\n\r\n\tprotected _applyPayload(url: string) {\r\n\t\tconst ajax = this.$gantt.ajax;\r\n\t\tif (this._payload) {\r\n\t\t\tfor (const key in this._payload) {\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn url;\r\n\t}\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\tprotected _cleanupArgumentsBeforeSend(dataToSend: any) {\r\n\t\tlet processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(const i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t}\r\n\tprotected _cleanupItemBeforeSend(updatedItem: any) {\r\n\t\tlet output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprotected _sendData(dataToSend: any, rowId?: any) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tconst ajax = this.$gantt.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tconst taskState = this.getState(rowId);\r\n\t\t\tconst taskAction = this.getActionByState(taskState);\r\n\t\t\tconst ganttMode = this.getGanttMode();\r\n\t\t\tconst _onResolvedCreateUpdate = (tag) => {\r\n\t\t\t\tlet action = taskState || \"updated\";\r\n\t\t\t\tlet sid = rowId;\r\n\t\t\t\tlet tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\taction = tag.action || taskState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tthis.afterUpdateCallback(sid, tid, action, tag, ganttMode);\r\n\t\t\t};\r\n\r\n\t\t\tlet actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tif(this._routerParametersFormat === \"object\"){\r\n\t\t\t\t\tconst obj = {\r\n\t\t\t\t\t\tentity: ganttMode,\r\n\t\t\t\t\t\taction: taskAction,\r\n\t\t\t\t\t\tdata: dataToSend,\r\n\t\t\t\t\t\tid: rowId\r\n\t\t\t\t\t};\r\n\t\t\t\t\tactionPromise = this._router(obj);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tactionPromise = this._router(ganttMode, taskAction, dataToSend, rowId);\r\n\t\t\t\t}\r\n\t\t\t} else if (this._router[ganttMode] instanceof Function) {\r\n\t\t\t\tactionPromise = this._router[ganttMode](taskAction, dataToSend, rowId);\r\n\t\t\t} else {\r\n\r\n\t\t\t\tconst errorMsgStart = \"Incorrect configuration of gantt.createDataProcessor\";\r\n\t\t\t\tconst errorMsgEnd = `\r\nYou need to either add missing properties to the dataProcessor router object or to use a router function.\r\nSee https://docs.dhtmlx.com/gantt/desktop__server_side.html#customrouting and https://docs.dhtmlx.com/gantt/api__gantt_createdataprocessor.html for details.`;\r\n\r\n\t\t\t\tif(!this._router[ganttMode]){\r\n\t\t\t\t\tthrow new Error(`${errorMsgStart}: router for the **${ganttMode}** entity is not defined. ${errorMsgEnd}`);\r\n\t\t\t\t}\r\n\t\t\t\tswitch (taskState) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tif(!this._router[ganttMode].create){\r\n\t\t\t\t\t\t\tthrow new Error(`${errorMsgStart}: **create** action for the **${ganttMode}** entity is not defined. ${errorMsgEnd}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactionPromise = this._router[ganttMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tif(!this._router[ganttMode].delete){\r\n\t\t\t\t\t\t\tthrow new Error(`${errorMsgStart}: **delete** action for the **${ganttMode}** entity is not defined. ${errorMsgEnd}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactionPromise = this._router[ganttMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!this._router[ganttMode].update){\r\n\t\t\t\t\t\t\tthrow new Error(`${errorMsgStart}: **update**\" action for the **${ganttMode}** entity is not defined. ${errorMsgEnd}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactionPromise = this._router[ganttMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch((error) => {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet queryParams: any;\r\n\t\tqueryParams = {\r\n\t\t\tcallback: (xml) => {\r\n\t\t\t\tconst ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (const key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.afterUpdate(this, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: this._headers\r\n\t\t};\r\n\r\n\t\tconst dhxVersion = \"dhx_version=\" + this.$gantt.getUserData(0, \"version\", this._ganttMode);\r\n\t\tconst urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, dhxVersion].join(\"&\")) : \"\");\r\n\t\tlet url: any = this._applyPayload(urlParams);\r\n\t\tlet data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tconst preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (const key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t}\r\n\r\n\tprotected _forEachUpdatedRow(code: any) {\r\n\t\tconst updatedRows = this.updatedRows.slice();\r\n\t\tfor (let i = 0; i < updatedRows.length; i++) {\r\n\t\t\tconst rowId = updatedRows[i];\r\n\t\t\tif (this.$gantt.getUserData(rowId, this.action_param, this._ganttMode)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _setDefaultTransactionMode() {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t}\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\tprotected _getXmlNodeValue(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tprotected _getAllData() {\r\n\t\tconst out = {};\r\n\t\tlet hasOne = false;\r\n\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thasOne = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\r\n\t\treturn hasOne ? out : null;\r\n\t}\r\n\r\n\tprotected _prepareDate(value: Date) : string {\r\n\t\treturn this.$gantt.defined(this.$gantt.templates.xml_format) ? this.$gantt.templates.xml_format(value) : this.$gantt.templates.format_date(value);\r\n\t}\r\n\r\n\tprotected _prepareArray(value: any[], traversedObjects: object[]) : any[] {\r\n\t\ttraversedObjects.push(value);\r\n\r\n\t\treturn value.map((item) => {\r\n\t\t\tif(helpers.isDate(item)){\r\n\t\t\t\treturn this._prepareDate(item);\r\n\t\t\t} else if (Array.isArray(item) && !helpers.arrayIncludes(traversedObjects, item)){\r\n\t\t\t\treturn this._prepareArray(item, traversedObjects);\r\n\t\t\t} else if (item && typeof item === \"object\" && !helpers.arrayIncludes(traversedObjects, item)) {\r\n\t\t\t\treturn this._prepareObject(item, traversedObjects);\r\n\t\t\t} else {\r\n\t\t\t\treturn item;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprotected _prepareObject(rawItem: any, traversedObjects: object[]) : any {\r\n\t\tconst processedItem = {};\r\n\t\ttraversedObjects.push(rawItem);\r\n\r\n\t\tfor (const key in rawItem) {\r\n\t\t\tif (key.substr(0, 1) === \"$\") {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst value = rawItem[key];\r\n\t\t\tif (helpers.isDate(value)) {\r\n\t\t\t\tprocessedItem[key] = this._prepareDate(value);\r\n\t\t\t} else if(value === null) {\r\n\t\t\t\tprocessedItem[key] = \"\";\r\n\t\t\t} else if (Array.isArray(value) && !helpers.arrayIncludes(traversedObjects, value)){\r\n\t\t\t\tprocessedItem[key] = this._prepareArray(value, traversedObjects);\r\n\t\t\t} else if (value && typeof value === \"object\" && !helpers.arrayIncludes(traversedObjects, value)) {\r\n\t\t\t\tprocessedItem[key] = this._prepareObject(value, traversedObjects);\r\n\t\t\t} else {\r\n\t\t\t\tprocessedItem[key] = value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn processedItem;\r\n\t}\r\n\r\n\tprotected _prepareDataItem(rawItem: any): any {\r\n\t\tconst processedItem = this._prepareObject(rawItem, []);\r\n\r\n\t\tprocessedItem[this.action_param] = this.$gantt.getUserData(rawItem.id, this.action_param, this._ganttMode);\r\n\t\treturn processedItem;\r\n\t}\r\n\r\n\tprotected getStoredItem(id){\r\n\t\treturn this._storage.getStoredItem(id);\r\n\t}\r\n\r\n\tprotected _getRowData(id) {\r\n\t\tlet dataItem;\r\n\t\tconst gantt = this.$gantt;\r\n\t\tif (this.getGanttMode() === \"task\") {\r\n\t\t\tif(gantt.isTaskExists(id)){\r\n\t\t\t\tdataItem =this.$gantt.getTask(id);\r\n\t\t\t}\r\n\t\t} else if (this.getGanttMode() === \"assignment\") {\r\n\t\t\tif(this.$gantt.$data.assignmentsStore.exists(id)){\r\n\t\t\t\tdataItem =this.$gantt.$data.assignmentsStore.getItem(id);\r\n\t\t\t}\r\n\t\t} else if (this.getGanttMode() === \"baseline\") {\r\n\t\t\tif(this.$gantt.$data.baselineStore.exists(id)){\r\n\t\t\t\tdataItem =this.$gantt.$data.baselineStore.getItem(id);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(gantt.isLinkExists(id)){\r\n\t\t\t\tdataItem =this.$gantt.getLink(id);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = this.getStoredItem(id);\r\n\t\t}\r\n\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id };\r\n\t\t}\r\n\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n}","\r\nexport default function extendGantt(gantt: any, dp: any) {\r\n\tgantt.getUserData = function(id, name, store) {\r\n\t\tif (!this.userdata) {\r\n\t\t\tthis.userdata = {};\r\n\t\t}\r\n\t\tthis.userdata[store] = this.userdata[store] || {};\r\n\t\tif (this.userdata[store][id] && this.userdata[store][id][name]) {\r\n\t\t\treturn this.userdata[store][id][name];\r\n\t\t}\r\n\t\treturn \"\";\r\n\t};\r\n\tgantt.setUserData = function(id, name, value, store) {\r\n\t\tif (!this.userdata) {\r\n\t\t\tthis.userdata = {};\r\n\t\t}\r\n\t\tthis.userdata[store] = this.userdata[store] || {};\r\n\t\tthis.userdata[store][id] = this.userdata[store][id] || {};\r\n\t\tthis.userdata[store][id][name] = value;\r\n\t};\r\n\r\n\tgantt._change_id = function(oldId, newId) {\r\n\t\tswitch (this._dp._ganttMode) {\r\n\t\t\tcase \"task\":\r\n\t\t\t\tthis.changeTaskId(oldId, newId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"link\":\r\n\t\t\t\tthis.changeLinkId(oldId, newId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"assignment\":\r\n\t\t\t\tthis.$data.assignmentsStore.changeId(oldId, newId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"resource\":\r\n\t\t\t\tthis.$data.resourcesStore.changeId(oldId, newId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"baseline\":\r\n\t\t\t\tthis.$data.baselineStore.changeId(oldId, newId);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error(`Invalid mode of the dataProcessor after database id is received: ${this._dp._ganttMode}, new id: ${newId}`);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt._row_style = function(rowId, classname){\r\n\t\tif (this._dp._ganttMode !== \"task\") {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!gantt.isTaskExists(rowId)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst task = gantt.getTask(rowId);\r\n\t\ttask.$dataprocessor_class = classname;\r\n\t\tgantt.refreshTask(rowId);\r\n\t};\r\n\r\n\t// fake method for dataprocessor\r\n\tgantt._delete_task = function(rowId, node) {}; // tslint:disable-line\r\n\r\n\tgantt._sendTaskOrder = function(id, item){\r\n\t\tif (item.$drop_target) {\r\n\t\t\tthis._dp.setGanttMode(\"task\");\r\n\t\t\tthis.getTask(id).target = item.$drop_target;\r\n\t\t\tthis._dp.setUpdated(id, true,\"order\");\r\n\t\t\tdelete this.getTask(id).$drop_target;\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\r\n\tgantt.setDp();\r\n}","import * as DataProcessor from \"./data_processor\";\r\nexport default {\r\n\tDEPRECATED_api: function(server) {\r\n\t\treturn new (DataProcessor.DataProcessor)(server);\r\n\t},\r\n\tcreateDataProcessor: DataProcessor.createDataProcessor\r\n};","import global from \"../../utils/global\";\r\n\r\nfunction createMethod(gantt){\r\n\tvar methods = {};\r\n\tvar isActive = false;\r\n\tfunction disableMethod(methodName, dummyMethod){\r\n\t\tdummyMethod = typeof dummyMethod == \"function\" ? dummyMethod : function(){};\r\n\r\n\t\tif(!methods[methodName]){\r\n\t\t\tmethods[methodName] = this[methodName];\r\n\t\t\tthis[methodName] = dummyMethod;\r\n\t\t}\r\n\t}\r\n\tfunction restoreMethod(methodName){\r\n\t\tif(methods[methodName]){\r\n\t\t\tthis[methodName] = methods[methodName];\r\n\t\t\tmethods[methodName] = null;\r\n\t\t}\r\n\t}\r\n\tfunction disableMethods(methodsHash){\r\n\t\tfor(var i in methodsHash){\r\n\t\t\tdisableMethod.call(this, i, methodsHash[i]);\r\n\t\t}\r\n\t}\r\n\tfunction restoreMethods(){\r\n\t\tfor(var i in methods){\r\n\t\t\trestoreMethod.call(this, i);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction batchUpdatePayload(callback){\r\n\t\ttry{\r\n\t\t\tcallback();\r\n\t\t}catch(e){\r\n\t\t\tglobal.console.error(e);\r\n\t\t}\r\n\t}\r\n\r\n\tvar state = gantt.$services.getService(\"state\");\r\n\tstate.registerProvider(\"batchUpdate\", function(){\r\n\t\treturn {\r\n\t\t\tbatch_update: isActive\r\n\t\t};\r\n\t}, false);\r\n\r\n\treturn function batchUpdate(callback, noRedraw) {\r\n\t\tif(isActive){\r\n\t\t\t// batch mode is already active\r\n\t\t\tbatchUpdatePayload(callback);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar call_dp = (this._dp && this._dp.updateMode != \"off\");\r\n\t\tvar dp_mode;\r\n\t\tif (call_dp){\r\n\t\t\tdp_mode = this._dp.updateMode;\r\n\t\t\tthis._dp.setUpdateMode(\"off\");\r\n\t\t}\r\n\r\n\t\t// temporary disable some methods while updating multiple tasks\r\n\t\tvar resetProjects = {};\r\n\t\tvar methods = {\r\n\t\t\t\"render\":true,\r\n\t\t\t\"refreshData\":true,\r\n\t\t\t\"refreshTask\":true,\r\n\t\t\t\"refreshLink\":true,\r\n\t\t\t\"resetProjectDates\":function(task){\r\n\t\t\t\tresetProjects[task.id] = task;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\t// do required updates after changes applied\r\n\t\tfor(var i in resetProjects){\r\n\t\t\tthis.resetProjectDates(resetProjects[i]);\r\n\t\t}\r\n\r\n\t\tisActive = false;\r\n\r\n\t\tif(!noRedraw){\r\n\t\t\tthis.render();\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.setGanttMode(\"task\");\r\n\t\t\tthis._dp.sendData();\r\n\t\t\tthis._dp.setGanttMode(\"link\");\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n}\r\n\r\nexport default function(gantt){\r\n\tgantt.batchUpdate = createMethod(gantt);\r\n};","var createWbs = (function(gantt){\r\n\treturn {\r\n\t_needRecalc: true,\r\n\treset: function(){\r\n\t\tthis._needRecalc = true;\r\n\t},\r\n\t_isRecalcNeeded: function(){\r\n\t\treturn (!this._isGroupSort() && this._needRecalc);\r\n\t},\r\n\t_isGroupSort: function() {\r\n\t\treturn !!(gantt.getState().group_mode);\r\n\t},\r\n\t_getWBSCode: function(task) {\r\n\t\tif(!task) return \"\";\r\n\r\n\t\tif(this._isRecalcNeeded()){\r\n\t\t\tthis._calcWBS();\r\n\t\t}\r\n\r\n\t\tif(task.$virtual) return \"\";\r\n\t\tif(this._isGroupSort()) return task.$wbs || \"\";\r\n\r\n\t\tif(!task.$wbs) {\r\n\t\t\tthis.reset();\r\n\t\t\tthis._calcWBS();\r\n\t\t}\r\n\t\treturn task.$wbs;\r\n\t},\r\n\t_setWBSCode: function(task, value) {\r\n\t\ttask.$wbs = value;\r\n\t},\r\n\tgetWBSCode: function(task) {\r\n\t\treturn this._getWBSCode(task);\r\n\t},\r\n\tgetByWBSCode: function(code){\r\n\t\tvar parts = code.split(\".\");\r\n\t\tvar currentNode = gantt.config.root_id;\r\n\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\tvar children = gantt.getChildren(currentNode);\r\n\t\t\tvar index = parts[i]*1 - 1;\r\n\t\t\tif(gantt.isTaskExists(children[index])){\r\n\t\t\t\tcurrentNode = children[index];\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(gantt.isTaskExists(currentNode)){\r\n\t\t\treturn gantt.getTask(currentNode);\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\t_calcWBS: function() {\r\n\t\tif(!this._isRecalcNeeded()) return;\r\n\r\n\t\tvar _isFirst = true;\r\n\t\tgantt.eachTask(function(ch) {\r\n\t\t\tif(_isFirst) {\r\n\t\t\t\t_isFirst = false;\r\n\t\t\t\tthis._setWBSCode(ch, \"1\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar _prevSibling = gantt.getPrevSibling(ch.id);\r\n\t\t\tif (_prevSibling !== null) {\r\n\t\t\t\tvar _wbs = gantt.getTask(_prevSibling).$wbs;\r\n\t\t\t\tif(_wbs) {\r\n\t\t\t\t\t_wbs = _wbs.split(\".\");\r\n\t\t\t\t\t_wbs[_wbs.length-1]++;\r\n\t\t\t\t\tthis._setWBSCode(ch, _wbs.join(\".\"));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvar _parent = gantt.getParent(ch.id);\r\n\t\t\t\tthis._setWBSCode(ch, gantt.getTask(_parent).$wbs + \".1\");\r\n\t\t\t}\r\n\t\t}, gantt.config.root_id, this);\r\n\r\n\t\tthis._needRecalc = false;\r\n\t}\r\n};\r\n});\r\n\r\nexport default function(gantt){\r\n\tvar wbs = createWbs(gantt);\r\n\tgantt.getWBSCode = function getWBSCode(task) {\r\n\t\treturn wbs.getWBSCode(task);\r\n\t};\r\n\r\n\tgantt.getTaskByWBSCode = function(code) {\r\n\t\treturn wbs.getByWBSCode(code);\r\n\t};\r\n\r\n\tfunction resetCache(){\r\n\t\twbs.reset();\r\n\t\treturn true;\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onAfterTaskMove\", resetCache);\r\n\tgantt.attachEvent(\"onBeforeParse\", resetCache);\r\n\tgantt.attachEvent(\"onAfterTaskDelete\", resetCache);\r\n\tgantt.attachEvent(\"onAfterTaskAdd\", resetCache);\r\n\tgantt.attachEvent(\"onAfterSort\", resetCache);\r\n\r\n};\r\n","import * as helpers from \"../../utils/helpers\";\r\n\r\nfunction createResourceMethods(gantt){\r\n\r\n\tvar resourceTaskCache = {};\r\n\tvar singleResourceCacheBuilt = false;\r\n\r\n\tgantt.$data.tasksStore.attachEvent(\"onStoreUpdated\", function(){\r\n\t\tresourceTaskCache = {};\r\n\t\tsingleResourceCacheBuilt = false;\r\n\t});\r\n\tgantt.attachEvent(\"onBeforeGanttRender\", function(){\r\n\t\tresourceTaskCache = {};\r\n\t});\r\n\r\n\tfunction getTaskBy(propertyName, propertyValue, typeFilter) {\r\n\t\tif (typeof propertyName == \"function\") {\r\n\t\t\treturn filterResourceTasks(propertyName);\r\n\t\t} else {\r\n\t\t\tif (helpers.isArray(propertyValue)) {\r\n\t\t\t\treturn getResourceTasks(propertyName, propertyValue, typeFilter);\r\n\t\t\t} else {\r\n\t\t\t\treturn getResourceTasks(propertyName, [propertyValue], typeFilter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction filterResourceTasks(filter) {\r\n\t\tvar res = [];\r\n\t\tgantt.eachTask(function (task) {\r\n\t\t\tif (filter(task)) {\r\n\t\t\t\tres.push(task);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn res;\r\n\t}\r\n\r\n\tvar falsyValuePrefix = String(Math.random());\r\n\tfunction resourceHashFunction(value){\r\n\t\tif (value === null){\r\n\t\t\treturn falsyValuePrefix + String(value);\r\n\t\t}\r\n\t\treturn String(value);\r\n\t}\r\n\r\n\tfunction getCacheKey(resourceIds, property, typeFilter) {\r\n\t\tif (Array.isArray(resourceIds)) {\r\n\t\t\treturn resourceIds.map(function (value) {\r\n\t\t\t\treturn resourceHashFunction(value);\r\n\t\t\t}).join(\"_\") + `_${property}_${typeFilter}`;\r\n\t\t} else {\r\n\t\t\treturn resourceHashFunction(resourceIds) + `_${property}_${typeFilter}`;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getResourceTasks(property, resourceIds, typeFilter) {\r\n\t\tvar res;\r\n\t\tvar cacheKey = getCacheKey(resourceIds, property, JSON.stringify(typeFilter));\r\n\t\tvar matchingResources = {};\r\n\t\thelpers.forEach(resourceIds, function(resourceId) {\r\n\t\t\tmatchingResources[resourceHashFunction(resourceId)] = true;\r\n\t\t});\r\n\r\n\t\tif (!resourceTaskCache[cacheKey]) {\r\n\t\t\tres = resourceTaskCache[cacheKey] = [];\r\n\t\t\tgantt.eachTask(function (task) {\r\n\t\t\t\tif (typeFilter) {\r\n\t\t\t\t\tif (!typeFilter[gantt.getTaskType(task)]) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (task.type == gantt.config.types.project) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (property in task) {\r\n\t\t\t\t\tvar resourceValue;\r\n\t\t\t\t\tif (!helpers.isArray(task[property])) {\r\n\t\t\t\t\t\tresourceValue = [task[property]];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tresourceValue = task[property];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\thelpers.forEach(resourceValue, function(value) {\r\n\t\t\t\t\t\tvar resourceValue = (value && value.resource_id) ? value.resource_id : value;\r\n\r\n\t\t\t\t\t\tif (matchingResources[resourceHashFunction(resourceValue)]) {\r\n\t\t\t\t\t\t\tres.push(task);\r\n\t\t\t\t\t\t}else if(!singleResourceCacheBuilt){\r\n\r\n\t\t\t\t\t\t\tvar key = getCacheKey(value, property);\r\n\t\t\t\t\t\t\tif(!resourceTaskCache[key]){\r\n\t\t\t\t\t\t\t\tresourceTaskCache[key] = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresourceTaskCache[key].push(task);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tsingleResourceCacheBuilt = true;\r\n\t\t} else {\r\n\t\t\tres = resourceTaskCache[cacheKey];\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\tfunction selectAssignments(resourceId, taskId, result){\r\n\t\tvar property = gantt.config.resource_property;\r\n\t\tvar owners = [];\r\n\t\tif (gantt.getDatastore(\"task\").exists(taskId)) {\r\n\t\t\tvar task = gantt.getTask(taskId);\r\n\t\t\towners = task[property] || [];\r\n\t\t}\r\n\r\n\t\tif (!Array.isArray(owners)) {\r\n\t\t\towners = [owners];\r\n\t\t}\r\n\t\tfor (var i = 0; i < owners.length; i++) {\r\n\t\t\tif (owners[i].resource_id == resourceId) {\r\n\t\t\t\tresult.push({task_id: task.id, resource_id:owners[i].resource_id, value:owners[i].value});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getResourceAssignments(resourceId, taskId){\r\n\t\t// resource assignment as an independent module:\r\n\t\t// {taskId:, resourceId, value}\r\n\t\t// TODO: probably should add a separate datastore for these\r\n\t\tvar assignments = [];\r\n\t\tvar property = gantt.config.resource_property;\r\n\t\tif(taskId !== undefined){\r\n\t\t\tselectAssignments(resourceId, taskId, assignments);\r\n\t\t}else{\r\n\t\t\tvar tasks = gantt.getTaskBy(property, resourceId);\r\n\t\t\ttasks.forEach(function(task){\r\n\t\t\t\tselectAssignments(resourceId, task.id, assignments);\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn assignments;\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetTaskBy: getTaskBy,\r\n\t\tgetResourceAssignments: getResourceAssignments\r\n\t};\r\n}\r\n\r\nfunction createHelper(gantt){\r\n\tconst resourcePlugin = {\r\n\t\trenderEditableLabel: function(start_date, end_date, resource, tasks, assignments){\r\n\t\t\tconst editable = gantt.config.readonly ? \"\" : \"contenteditable\";\r\n\t\t\tif(start_date < resource.end_date && end_date > resource.start_date){\r\n\t\t\t\tfor(let i = 0; i < assignments.length; i++){\r\n\t\t\t\t\tconst a = assignments[i];\r\n\t\t\t\t\t\treturn \"\" + a.value + \"
\";\r\n\t\t\t\t}\r\n\t\t\t\treturn \"-
\";\r\n\t\t\t}\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\trenderSummaryLabel: function(start_date, end_date, resource, tasks, assignments){\r\n\t\t\tlet sum = assignments.reduce(function(total, assignment){ \r\n\t\t\t\treturn total + Number(assignment.value);\r\n\t\t\t}, 0);\r\n\r\n\t\t\tif(sum % 1){\r\n\t\t\t\tsum = Math.round(sum * 10)/10;\r\n\t\t\t}\r\n\r\n\t\t\tif(sum){\r\n\t\t\t\treturn \"\" + sum + \"
\";\r\n\t\t\t}\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\teditableResourceCellTemplate: function(start_date, end_date, resource, tasks, assignments){\r\n\t\t\tif(resource.$role === \"task\"){\r\n\t\t\t\treturn resourcePlugin.renderEditableLabel(start_date, end_date, resource, tasks, assignments);\r\n\t\t\t}else{\r\n\t\t\t\treturn resourcePlugin.renderSummaryLabel(start_date, end_date, resource, tasks, assignments);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\t\r\n\t\teditableResourceCellClass: function(start_date, end_date, resource, tasks, assignments){\r\n\t\t\tconst css = [];\r\n\t\t\tcss.push(\"resource_marker\");\r\n\r\n\t\t\tif(resource.$role === \"task\"){\r\n\t\t\t\tcss.push(\"task_cell\");\r\n\t\t\t}else{\r\n\t\t\t\tcss.push(\"resource_cell\");\r\n\t\t\t}\r\n\r\n\t\t\tconst sum = assignments.reduce(function(total, assignment){ \r\n\t\t\t\treturn total + Number(assignment.value);\r\n\t\t\t}, 0);\r\n\r\n\t\t\tlet capacity = Number(resource.capacity);\r\n\t\t\tif(isNaN(capacity)){\r\n\t\t\t\tcapacity = 8;\r\n\t\t\t}\r\n\t\t\tif (sum <= capacity) {\r\n\t\t\t\tcss.push(\"workday_ok\");\r\n\t\t\t} else {\r\n\t\t\t\tcss.push(\"workday_over\");\r\n\t\t\t}\r\n\t\t\treturn css.join(\" \");\r\n\t\t},\r\n\t\tgetSummaryResourceAssignments: function getResourceAssignments(resourceId) {\r\n\t\t\tlet assignments;\r\n\t\t\tconst store = gantt.getDatastore(gantt.config.resource_store);\r\n\t\t\tconst resource = store.getItem(resourceId);\r\n\r\n\t\t\tif(resource.$role === \"task\"){\r\n\t\t\t\tassignments = gantt.getResourceAssignments(resource.$resource_id, resource.$task_id);\r\n\t\t\t}else{\r\n\t\t\t\tassignments = gantt.getResourceAssignments(resourceId);\r\n\t\t\t\tif(store.eachItem){\r\n\t\t\t\t\tstore.eachItem(function(childResource){\r\n\t\t\t\t\t\tif(childResource.$role !== \"task\"){\r\n\t\t\t\t\t\t\tassignments = assignments.concat(gantt.getResourceAssignments(childResource.id));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, resourceId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn assignments;\r\n\t\t},\r\n\t\t\r\n\t\tinitEditableDiagram: function(){\r\n\t\t\tgantt.config.resource_render_empty_cells = true;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t(function(){\r\n\t\t\t\t/// salesforce locker workaround\r\n\t\t\t\t// SF removes 'contenteditable' attribute from cells\r\n\t\t\t\t// restore it on render\r\n\t\t\t\tlet timeoutId = null;\r\n\t\t\t\tfunction makeEditable() {\r\n\t\t\t\t\tif (timeoutId) {\r\n\t\t\t\t\t\tcancelAnimationFrame(timeoutId);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttimeoutId = requestAnimationFrame(function () {\r\n\t\t\t\t\t\tif (gantt.$container){\r\n\t\t\t\t\t\t\tvar cells = Array.prototype.slice.call(gantt.$container.querySelectorAll(\".resourceTimeline_cell [data-assignment-cell]\"));\r\n\t\t\t\t\t\t\tcells.forEach(function (cell) {\r\n\t\t\t\t\t\t\t\tcell.contentEditable = true;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\t\t\t\tgantt.getDatastore(gantt.config.resource_assignment_store).attachEvent(\"onStoreUpdated\", makeEditable);\r\n\t\t\t\t\tgantt.getDatastore(gantt.config.resource_store).attachEvent(\"onStoreUpdated\", makeEditable);\r\n\t\t\t\t}, {once: true});\r\n\t\t\t\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t\t\t\t\tconst ganttViews = gantt.$layout.getCellsByType(\"viewCell\");\r\n\t\t\t\t\tganttViews.forEach(function(view){\r\n\t\t\t\t\t\tif(view.$config && view.$config.view === \"resourceTimeline\" && view.$content){\r\n\t\t\t\t\t\t\tview.$content.attachEvent(\"onScroll\", makeEditable);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t})();\r\n\r\n\r\n\t\t\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\t\t\tlet assignmentEditInProcess = false;\r\n\t\t\t\tgantt.event(gantt.$container, \"keypress\", function(e){\r\n\t\t\t\t\tvar target = e.target.closest(\".resourceTimeline_cell [data-assignment-cell]\");\r\n\t\t\t\t\tif(target){\r\n\t\t\t\t\t\tif (e.keyCode === 13 || e.keyCode === 27) {\r\n\t\t\t\t\t\t\ttarget.blur();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tgantt.event(gantt.$container, \"focusout\", function(e){\r\n\t\t\t\t\tif (assignmentEditInProcess){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tassignmentEditInProcess = true;\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tassignmentEditInProcess = false;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t\tvar target = e.target.closest(\".resourceTimeline_cell [data-assignment-cell]\");\r\n\t\t\t\t\tif(target){\r\n\t\t\t\t\t\tvar strValue = (target.innerText || \"\").trim();\r\n\t\t\t\t\t\tif(strValue == \"-\"){\r\n\t\t\t\t\t\t\tstrValue = \"0\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar value = Number(strValue);\r\n\t\t\t\t\t\tvar rowId = target.getAttribute(\"data-row-id\");\r\n\t\t\t\t\t\tvar assignmentId = target.getAttribute(\"data-assignment-id\");\r\n\t\t\t\t\t\tvar taskId = target.getAttribute(\"data-task\");\r\n\t\t\t\t\t\tvar resourceId = target.getAttribute(\"data-resource-id\");\r\n\t\t\t\t\t\tvar startDate = gantt.templates.parse_date(target.getAttribute(\"data-start-date\"));\r\n\t\t\t\t\t\tvar endDate = gantt.templates.parse_date(target.getAttribute(\"data-end-date\"));\r\n\r\n\t\t\t\t\t\tvar assignmentStore = gantt.getDatastore(gantt.config.resource_assignment_store);\r\n\t\t\t\t\t\tif(isNaN(value)){\r\n\t\t\t\t\t\t\tgantt.getDatastore(gantt.config.resource_store).refresh(rowId);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tvar task = gantt.getTask(taskId);\r\n\t\t\t\t\t\t\t// GS-2141. Track the changes by the Undo extension\r\n\t\t\t\t\t\t\tif (gantt.plugins().undo){\r\n\t\t\t\t\t\t\t\tgantt.ext.undo.saveState(taskId, \"task\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(assignmentId){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar assignment = assignmentStore.getItem(assignmentId);\r\n\t\t\t\t\t\t\t\tif(value === assignment.value){\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(assignment.start_date.valueOf() === startDate.valueOf() && assignment.end_date.valueOf() === endDate.valueOf()){\r\n\t\t\t\t\t\t\t\t\tassignment.value = value;\r\n\t\t\t\t\t\t\t\t\tif(!value){\r\n\t\t\t\t\t\t\t\t\t\tassignmentStore.removeItem(assignment.id);\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tassignmentStore.updateItem(assignment.id);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif(assignment.end_date.valueOf() > endDate.valueOf()){\r\n\t\t\t\t\t\t\t\t\t\tvar nextChunk = gantt.copy(assignment);\r\n\t\t\t\t\t\t\t\t\t\tnextChunk.id = gantt.uid();\r\n\t\t\t\t\t\t\t\t\t\tnextChunk.start_date = endDate;\r\n\t\t\t\t\t\t\t\t\t\tnextChunk.duration = gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\t\tstart_date: nextChunk.start_date,\r\n\t\t\t\t\t\t\t\t\t\t\tend_date: nextChunk.end_date,\r\n\t\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\tnextChunk.delay = gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\t\t\t\t\t\t\t\tend_date: nextChunk.start_date,\r\n\t\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\tnextChunk.mode = assignment.mode || \"default\";\r\n\t\t\t\t\t\t\t\t\t\tif(nextChunk.duration !== 0){\r\n\t\t\t\t\t\t\t\t\t\t\tassignmentStore.addItem(nextChunk);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif(assignment.start_date.valueOf() < startDate.valueOf()){\r\n\t\t\t\t\t\t\t\t\t\tassignment.end_date = startDate;\r\n\t\t\t\t\t\t\t\t\t\tassignment.duration = gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\t\tstart_date: assignment.start_date,\r\n\t\t\t\t\t\t\t\t\t\t\tend_date: assignment.end_date,\r\n\t\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\tassignment.mode = \"fixedDuration\";\r\n\r\n\t\t\t\t\t\t\t\t\t\tif(assignment.duration === 0){\r\n\t\t\t\t\t\t\t\t\t\t\tassignmentStore.removeItem(assignment.id);\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\tassignmentStore.updateItem(assignment.id);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tassignmentStore.removeItem(assignment.id);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif(value){\r\n\t\t\t\t\t\t\t\t\t\tassignmentStore.addItem({\r\n\t\t\t\t\t\t\t\t\t\t\ttask_id: assignment.task_id,\r\n\t\t\t\t\t\t\t\t\t\t\tresource_id: assignment.resource_id,\r\n\t\t\t\t\t\t\t\t\t\t\tvalue: value,\r\n\t\t\t\t\t\t\t\t\t\t\tstart_date: startDate,\r\n\t\t\t\t\t\t\t\t\t\t\tend_date: endDate,\r\n\t\t\t\t\t\t\t\t\t\t\tduration: gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\t\t\tstart_date: startDate,\r\n\t\t\t\t\t\t\t\t\t\t\t\tend_date: endDate,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t\t\t\tdelay: gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\t\t\t\t\t\t\t\t\tend_date: startDate,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t\t\t\tmode: \"fixedDuration\"\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tgantt.updateTaskAssignments(task.id);\r\n\t\t\t\t\t\t\t\tgantt.updateTask(task.id);\r\n\t\t\t\t\t\t\t}else if(value){\r\n\t\t\t\t\t\t\t\tvar assignment = {\r\n\t\t\t\t\t\t\t\t\ttask_id: taskId,\r\n\t\t\t\t\t\t\t\t\tresource_id: resourceId,\r\n\t\t\t\t\t\t\t\t\tvalue: value,\r\n\t\t\t\t\t\t\t\t\tstart_date: startDate,\r\n\t\t\t\t\t\t\t\t\tend_date: endDate,\r\n\t\t\t\t\t\t\t\t\tduration: gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\tstart_date: startDate,\r\n\t\t\t\t\t\t\t\t\t\tend_date: endDate,\r\n\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t\tdelay: gantt.calculateDuration({\r\n\t\t\t\t\t\t\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\t\t\t\t\t\t\tend_date: startDate,\r\n\t\t\t\t\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t\tmode: \"fixedDuration\"\r\n\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\tassignmentStore.addItem(assignment);\r\n\t\t\t\t\t\t\t\tgantt.updateTaskAssignments(task.id);\r\n\t\t\t\t\t\t\t\tgantt.updateTask(task.id);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t};\r\n\treturn resourcePlugin;\r\n}\r\n\r\nexport default function(gantt){\r\n\tvar methods = createResourceMethods(gantt);\r\n\t\r\n\tgantt.ext.resources = createHelper(gantt);\r\n\r\n\tgantt.config.resources = {\r\n\t\tdataprocessor_assignments: false,\r\n\t\tdataprocessor_resources: false,\r\n\t\teditable_resource_diagram: false,\r\n\t\tresource_store: {\r\n\t\t\ttype: \"treeDataStore\",\r\n\t\t\tfetchTasks: false,\r\n\t\t\tinitItem: function(item) {\r\n\t\t\t\titem.parent = item.parent || gantt.config.root_id;\r\n\t\t\t\titem[gantt.config.resource_property] = item.parent;\r\n\t\t\t\titem.open = true;\r\n\t\t\t\treturn item;\r\n\t\t\t}\r\n\t\t},\r\n\t\tlightbox_resources: function selectResourceControlOptions(resources){\r\n\t\t\tconst lightboxOptions = [];\r\n\t\t\tconst store = gantt.getDatastore(gantt.config.resource_store);\r\n\t\t\tresources.forEach(function(res) {\r\n\t\t\t\tif (!store.hasChild(res.id)) {\r\n\t\t\t\t\tconst copy = gantt.copy(res);\r\n\t\t\t\t\tcopy.key = res.id;\r\n\t\t\t\t\tcopy.label = res.text;\r\n\t\t\t\t\tlightboxOptions.push(copy);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn lightboxOptions;\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\t\tif(gantt.getDatastore(gantt.config.resource_store)){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst resourceStoreConfig = gantt.config.resources ? gantt.config.resources.resource_store : undefined;\r\n\t\tlet fetchTasks = resourceStoreConfig ? resourceStoreConfig.fetchTasks : undefined;\r\n\t\tif(gantt.config.resources && gantt.config.resources.editable_resource_diagram){\r\n\t\t\tfetchTasks = true;\r\n\t\t}\r\n\r\n\t\tlet initItems = function(item) {\r\n\t\t\titem.parent = item.parent || gantt.config.root_id;\r\n\t\t\titem[gantt.config.resource_property] = item.parent;\r\n\t\t\titem.open = true;\r\n\t\t\treturn item;\r\n\t\t};\r\n\r\n\t\tif(resourceStoreConfig && resourceStoreConfig.initItem){\r\n\t\t\tinitItems = resourceStoreConfig.initItem;\r\n\t\t}\r\n\r\n\t\tconst storeType = resourceStoreConfig && resourceStoreConfig.type ? resourceStoreConfig.type : \"treeDatastore\";\r\n\r\n\t\tgantt.$resourcesStore = gantt.createDatastore({\r\n\t\t\tname: gantt.config.resource_store,\r\n\t\t\ttype: storeType,\r\n\t\t\tfetchTasks: fetchTasks !== undefined ? fetchTasks : false,\r\n\t\t\tinitItem: initItems\r\n\t\t});\r\n\r\n\t\tgantt.$data.resourcesStore = gantt.$resourcesStore;\r\n\r\n\t\tgantt.$resourcesStore.attachEvent(\"onParse\", function() {\r\n\t\t\tfunction selectResourceControlOptions(resources){\r\n\t\t\t\tconst lightboxOptions = [];\r\n\t\t\t\tresources.forEach(function(res) {\r\n\t\t\t\t\tif (!gantt.$resourcesStore.hasChild(res.id)) {\r\n\t\t\t\t\t\tvar copy = gantt.copy(res);\r\n\t\t\t\t\t\tcopy.key = res.id;\r\n\t\t\t\t\t\tcopy.label = res.text;\r\n\t\t\t\t\t\tlightboxOptions.push(copy);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\treturn lightboxOptions;\r\n\t\t\t}\r\n\r\n\t\t\tlet lightboxOptionsFnc = selectResourceControlOptions;\r\n\t\t\tif(gantt.config.resources && gantt.config.resources.lightbox_resources){\r\n\t\t\t\tlightboxOptionsFnc = gantt.config.resources.lightbox_resources;\r\n\t\t\t}\r\n\r\n\t\t\tconst options = lightboxOptionsFnc(gantt.$resourcesStore.getItems());\r\n\r\n\t\t\tgantt.updateCollection(\"resourceOptions\", options);\r\n\t\t});\r\n\t});\r\n\r\n\tgantt.getTaskBy = methods.getTaskBy;\r\n\tgantt.getResourceAssignments = methods.getResourceAssignments;\r\n\tgantt.config.resource_property = \"owner_id\";\r\n\tgantt.config.resource_store = \"resource\";\r\n\tgantt.config.resource_render_empty_cells = false;\r\n\r\n\t/**\r\n\t * these are placeholder functions that should be redefined by the user\r\n\t*/\r\n\tgantt.templates.histogram_cell_class = function(start_date, end_date, resource, tasks, assignments) {};\r\n\tgantt.templates.histogram_cell_label = function(start_date, end_date, resource, tasks, assignments) {\r\n\t\treturn tasks.length + \"/3\";\r\n\t};\r\n\tgantt.templates.histogram_cell_allocated = function(start_date, end_date, resource, tasks, assignments) {\r\n\t\treturn tasks.length / 3;\r\n\t};\r\n\tgantt.templates.histogram_cell_capacity = function(start_date, end_date, resource, tasks, assignments) {\r\n\t\treturn 0;\r\n\t};\r\n\r\n\r\n\tconst defaultResourceCellClass = function(start, end, resource, tasks, assignments) {\r\n\t\tvar css = \"\";\r\n\t\tif (tasks.length <= 1) {\r\n\t\t\tcss = \"gantt_resource_marker_ok\";\r\n\t\t} else {\r\n\t\t\tcss = \"gantt_resource_marker_overtime\";\r\n\t\t}\r\n\t\treturn css;\r\n\t};\r\n\r\n\tconst defaultResourceCellTemplate = function(start, end, resource, tasks, assignments) {\r\n\t\treturn tasks.length * 8;\r\n\t};\r\n\r\n\tgantt.templates.resource_cell_value = defaultResourceCellTemplate;\r\n\tgantt.templates.resource_cell_class = defaultResourceCellClass;\r\n\r\n\t//editable_resource_diagram\r\n\tgantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\t\tif(gantt.config.resources && gantt.config.resources.editable_resource_diagram){\r\n\r\n\t\t\tgantt.config.resource_render_empty_cells = true;\r\n\t\t\tif(gantt.templates.resource_cell_value === defaultResourceCellTemplate){\r\n\t\t\t\tgantt.templates.resource_cell_value = gantt.ext.resources.editableResourceCellTemplate;\r\n\t\t\t}\r\n\t\t\tif(gantt.templates.resource_cell_class === defaultResourceCellClass){\r\n\t\t\t\tgantt.templates.resource_cell_class = gantt.ext.resources.editableResourceCellClass;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgantt.ext.resources.initEditableDiagram(gantt);\r\n\t\t}\r\n\t});\r\n};\r\n\r\n\r\n","export default function (gantt) {\r\n\tvar resourceAssignmentsProperty = \"$resourceAssignments\";\r\n\tgantt.config.resource_assignment_store = \"resourceAssignments\";\r\n\tgantt.config.process_resource_assignments = true;\r\n\r\n\tvar resourceAssignmentFormats = {\r\n\t\tauto: \"auto\",\r\n\t\tsingleValue: \"singleValue\",\r\n\t\tvalueArray: \"valueArray\",\r\n\t\tresourceValueArray: \"resourceValueArray\",\r\n\t\tassignmentsArray: \"assignmentsArray\"\r\n\t};\r\n\tvar resourceAssignmentFormat = resourceAssignmentFormats.auto;//\"primitiveSingle\";//\"primitive\";//\"object\"|\"assignment\"\r\n\r\n\tvar assignmentModes = {\r\n\t\tfixedDates: \"fixedDates\",\r\n\t\tfixedDuration: \"fixedDuration\",\r\n\t\tdefault: \"default\"\r\n\t};\r\n\r\n\r\n\tfunction initAssignmentFields(item, task){\r\n\t\tif (item.start_date) {\r\n\t\t\titem.start_date = gantt.date.parseDate(item.start_date, \"parse_date\");\r\n\t\t} else {\r\n\t\t\titem.start_date = null;\r\n\t\t}\r\n\r\n\t\tif (item.end_date) {\r\n\t\t\titem.end_date = gantt.date.parseDate(item.end_date, \"parse_date\");\r\n\t\t} else {\r\n\t\t\titem.end_date = null;\r\n\t\t}\r\n\r\n\t\tvar delay = Number(item.delay);\r\n\t\tvar initDelay = false;\r\n\t\tif (!isNaN(delay)) {\r\n\t\t\titem.delay = delay;\r\n\t\t} else {\r\n\t\t\titem.delay = 0;\r\n\t\t\tinitDelay = true;\r\n\t\t}\r\n\r\n\t\tif (!gantt.defined(item.value)) {\r\n\t\t\titem.value = null;\r\n\t\t}\r\n\r\n\t\tif (!item.task_id || !item.resource_id) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\titem.mode = item.mode || assignmentModes.default;\r\n\r\n\t\tif(item.mode === assignmentModes.fixedDuration){\r\n\t\t\tif(isNaN(Number(item.duration))){\r\n\t\t\t\ttask = task || gantt.getTask(item.task_id);\r\n\t\t\t\titem.duration = gantt.calculateDuration({\r\n\t\t\t\t\tstart_date: item.start_date,\r\n\t\t\t\t\tend_date: item.end_date,\r\n\t\t\t\t\tid: task\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif(initDelay){\r\n\t\t\t\ttask = task || gantt.getTask(item.task_id);\r\n\t\t\t\titem.delay = gantt.calculateDuration({\r\n\t\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\t\tend_date: item.start_date,\r\n\t\t\t\t\tid: task\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (item.mode !== assignmentModes.fixedDates && (task || gantt.isTaskExists(item.task_id))) {\r\n\t\t\ttask = task || gantt.getTask(item.task_id);\r\n\t\t\tvar timing = _assignmentTimeFromTask(item, task);\r\n\t\t\titem.start_date = timing.start_date;\r\n\t\t\titem.end_date = timing.end_date;\r\n\t\t\titem.duration = timing.duration;\r\n\t\t}\r\n\t}\r\n\t// gantt init\r\n\tvar resourceAssignmentsStore = gantt.createDatastore({\r\n\t\tname: gantt.config.resource_assignment_store,\r\n\t\tinitItem: function (item) {\r\n\t\t\tif (!item.id) {\r\n\t\t\t\titem.id = gantt.uid();\r\n\t\t\t}\r\n\r\n\t\t\tinitAssignmentFields(item);\r\n\r\n\t\t\treturn item;\r\n\t\t}\r\n\t});\r\n\t\r\n\tgantt.$data.assignmentsStore = resourceAssignmentsStore;\r\n\r\n\tfunction _assignmentTimeFromTask(assignment, task) {\r\n\r\n\t\tif (assignment.mode === assignmentModes.fixedDates) {\r\n\t\t\treturn {\r\n\t\t\t\tstart_date: assignment.start_date,\r\n\t\t\t\tend_date: assignment.end_date,\r\n\t\t\t\tduration: assignment.duration\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tvar start = assignment.delay ? gantt.calculateEndDate({\r\n\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\tduration: assignment.delay,\r\n\t\t\t\ttask: task\r\n\t\t\t}) : new Date(task.start_date);\r\n\r\n\t\t\tvar end;\r\n\t\t\tvar duration;\r\n\t\t\tif (assignment.mode === assignmentModes.fixedDuration) {\r\n\t\t\t\tend = gantt.calculateEndDate({\r\n\t\t\t\t\tstart_date: start,\r\n\t\t\t\t\tduration: assignment.duration,\r\n\t\t\t\t\ttask: task\r\n\t\t\t\t});\r\n\t\t\t\tduration = assignment.duration;\r\n\t\t\t} else {\r\n\t\t\t\tend = new Date(task.end_date);\r\n\t\t\t\tduration = task.duration - assignment.delay;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: start,\r\n\t\t\tend_date: end,\r\n\t\t\tduration: duration\r\n\t\t};\r\n\t}\r\n\r\n\t// data loading\r\n\r\n\tfunction _makeAssignmentsFromTask(task) {\r\n\t\tconst property = gantt.config.resource_property;\r\n\t\tlet assignments = task[property];\r\n\t\tconst resourceAssignments = [];\r\n\t\tlet detectFormat = resourceAssignmentFormat === resourceAssignmentFormats.auto;\r\n\r\n\t\tif (gantt.defined(assignments) && assignments) {\r\n\t\t\tif (!Array.isArray(assignments)) {\r\n\t\t\t\tassignments = [assignments];\r\n\t\t\t\tif (detectFormat) {\r\n\t\t\t\t\tresourceAssignmentFormat = resourceAssignmentFormats.singleValue;\r\n\t\t\t\t\tdetectFormat = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst usedIds = {};\r\n\t\t\tassignments.forEach(function (res) {\r\n\t\t\t\tif (!res.resource_id) { // when resource is a string/number\r\n\t\t\t\t\tres = { resource_id: res };\r\n\t\t\t\t\tif (detectFormat) {\r\n\t\t\t\t\t\tresourceAssignmentFormat = resourceAssignmentFormats.valueArray;\r\n\t\t\t\t\t\tdetectFormat = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//\tisSimpleArray = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (detectFormat) {\r\n\t\t\t\t\tif (res.id && res.resource_id) {\r\n\t\t\t\t\t\tresourceAssignmentFormat = resourceAssignmentFormats.assignmentsArray;\r\n\t\t\t\t\t\tdetectFormat = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tresourceAssignmentFormat = resourceAssignmentFormats.resourceValueArray;\r\n\t\t\t\t\t\tdetectFormat = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet defaultMode = assignmentModes.default;\r\n\t\t\t\tif(!res.mode){\r\n\t\t\t\t\tif((res.start_date && res.end_date) || (res.start_date && res.duration)){\r\n\t\t\t\t\t\tdefaultMode = assignmentModes.fixedDuration;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet id;\r\n\t\t\t\tif(!res.id && res.$id && !usedIds[res.$id]){\r\n\t\t\t\t\tid = res.$id;\r\n\t\t\t\t} else if(res.id && !usedIds[res.id]){\r\n\t\t\t\t\tid = res.id;\r\n\t\t\t\t} else{\r\n\t\t\t\t\tid = gantt.uid();\r\n\t\t\t\t}\r\n\t\t\t\tusedIds[id] = true;\r\n\r\n\t\t\t\tconst assignment = {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\tstart_date: res.start_date,\r\n\t\t\t\t\tduration: res.duration,\r\n\t\t\t\t\tend_date: res.end_date,\r\n\t\t\t\t\tdelay: res.delay,\r\n\t\t\t\t\ttask_id: task.id,\r\n\t\t\t\t\tresource_id: res.resource_id,\r\n\t\t\t\t\tvalue: res.value,\r\n\t\t\t\t\tmode: res.mode || defaultMode\r\n\t\t\t\t};\r\n\t\t\t\t// GS-2490: to add custom properties to assignment\r\n\t\t\t\t// need to exclude $id which incfluences on render \r\n\t\t\t\tObject.keys(res).forEach(key => {\r\n\t\t\t\t\tif(key != \"$id\") {\r\n\t\t\t\t\t\tassignment[key] = res[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!(assignment.start_date && assignment.start_date.getMonth \r\n\t\t\t\t\t&& assignment.end_date && assignment.end_date.getMonth && typeof assignment.duration === \"number\")){\r\n\t\t\t\t\tinitAssignmentFields(assignment, task);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresourceAssignments.push(assignment);\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn resourceAssignments;\r\n\t}\r\n\r\n\tfunction _updateTaskBack(taskId) {\r\n\t\t// GS-1493. In some cases, the resource assignment store has the tasks that no longer exist\r\n\t\tif (!gantt.isTaskExists(taskId)){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar task = gantt.getTask(taskId);\r\n\t\tvar assignments = gantt.getTaskAssignments(task.id);\r\n\t\t_assignAssignments(task, assignments);\r\n\t}\r\n\r\n\tfunction _assignAssignments(task, assignments){\r\n\t\tassignments.sort(function(a, b){\r\n\t\t\tif(a.start_date && b.start_date && a.start_date.valueOf() != b.start_date.valueOf()){\r\n\t\t\t\treturn a.start_date - b.start_date;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (resourceAssignmentFormat == resourceAssignmentFormats.assignmentsArray) {\r\n\t\t\ttask[gantt.config.resource_property] = assignments;\r\n\t\t} else if (resourceAssignmentFormat == resourceAssignmentFormats.resourceValueArray) {\r\n\t\t\ttask[gantt.config.resource_property] = assignments.map(function (a) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t$id: a.id,\r\n\t\t\t\t\tstart_date: a.start_date,\r\n\t\t\t\t\tduration: a.duration,\r\n\t\t\t\t\tend_date: a.end_date,\r\n\t\t\t\t\tdelay: a.delay,\r\n\t\t\t\t\tresource_id: a.resource_id,\r\n\t\t\t\t\tvalue: a.value,\r\n\t\t\t\t\tmode: a.mode\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\ttask[resourceAssignmentsProperty] = assignments;\r\n\t}\r\n\r\n\tfunction _loadAssignmentsFromTask(task) {\r\n\t\tvar assignments = _makeAssignmentsFromTask(task);\r\n\t\tvar taskAssignments = [];\r\n\t\tassignments.forEach(function (a) {\r\n\t\t\ta.id = a.id || gantt.uid();\r\n\t\t\t//var newId = resourceAssignmentsStore.addItem(a);\r\n\t\t\ttaskAssignments.push(a);\r\n\t\t});\r\n\r\n\t\treturn assignments;\r\n\t}\r\n\r\n\tfunction diffAssignments(taskValues, assignmentsStoreValues) {\r\n\t\tvar result = {\r\n\t\t\tinBoth: [],\r\n\t\t\tinTaskNotInStore: [],\r\n\t\t\tinStoreNotInTask: []\r\n\t\t};\r\n\r\n\t\tif (resourceAssignmentFormat == resourceAssignmentFormats.singleValue) {\r\n\t\t\tvar taskOwner = taskValues[0];\r\n\t\t\tvar ownerId = taskOwner ? taskOwner.resource_id : null;\r\n\t\t\tvar foundOwnerAssignment = false;\r\n\t\t\tassignmentsStoreValues.forEach(function (a) {\r\n\t\t\t\tif (a.resource_id != ownerId) {\r\n\t\t\t\t\tresult.inStoreNotInTask.push(a);\r\n\t\t\t\t} else if (a.resource_id == ownerId) {\r\n\t\t\t\t\tresult.inBoth.push({ store: a, task: taskOwner });\r\n\t\t\t\t\tfoundOwnerAssignment = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tif (!foundOwnerAssignment && taskOwner) {\r\n\t\t\t\tresult.inTaskNotInStore.push(taskOwner);\r\n\t\t\t}\r\n\r\n\r\n\t\t} else if (resourceAssignmentFormat == resourceAssignmentFormats.valueArray){\r\n\r\n\t\t\tvar taskSearch = {};\r\n\t\t\tvar storeSearch = {};\r\n\t\t\tvar processedIds = {};\r\n\t\t\ttaskValues.forEach(function (a) {\r\n\t\t\t\ttaskSearch[a.resource_id] = a;\r\n\t\t\t});\r\n\t\t\tassignmentsStoreValues.forEach(function (a) {\r\n\t\t\t\tstoreSearch[a.resource_id] = a;\r\n\t\t\t});\r\n\t\t\ttaskValues.concat(assignmentsStoreValues).forEach(function (a) {\r\n\t\t\t\tif (processedIds[a.resource_id]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tprocessedIds[a.resource_id] = true;\r\n\t\t\t\tvar inTask = taskSearch[a.resource_id];\r\n\t\t\t\tvar inStore = storeSearch[a.resource_id];\r\n\r\n\t\t\t\tif (inTask && inStore) {\r\n\t\t\t\t\tresult.inBoth.push({ store: inStore, task: inTask });\r\n\t\t\t\t} else if (inTask && !inStore) {\r\n\t\t\t\t\tresult.inTaskNotInStore.push(inTask);\r\n\t\t\t\t} else if (!inTask && inStore) {\r\n\t\t\t\t\tresult.inStoreNotInTask.push(inStore);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else if ((resourceAssignmentFormat == resourceAssignmentFormats.assignmentsArray)\r\n\t\t\t|| (resourceAssignmentFormat == resourceAssignmentFormats.resourceValueArray)) {\r\n\t\t\tvar taskSearch = {};\r\n\t\t\tvar storeSearch = {};\r\n\t\t\tvar processedIds = {};\r\n\t\t\ttaskValues.forEach(function (a) {\r\n\t\t\t\ttaskSearch[a.id || a.$id] = a;\r\n\t\t\t});\r\n\t\t\tassignmentsStoreValues.forEach(function (a) {\r\n\t\t\t\tstoreSearch[a.id] = a;\r\n\t\t\t});\r\n\t\t\ttaskValues.concat(assignmentsStoreValues).forEach(function (a) {\r\n\t\t\t\tvar id = a.id || a.$id;\r\n\t\t\t\tif (processedIds[id]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tprocessedIds[id] = true;\r\n\t\t\t\tvar inTask = taskSearch[id];\r\n\t\t\t\tvar inStore = storeSearch[id];\r\n\r\n\t\t\t\tif (inTask && inStore) {\r\n\t\t\t\t\tresult.inBoth.push({ store: inStore, task: inTask });\r\n\t\t\t\t} else if (inTask && !inStore) {\r\n\t\t\t\t\tresult.inTaskNotInStore.push(inTask);\r\n\t\t\t\t} else if (!inTask && inStore) {\r\n\t\t\t\t\tresult.inStoreNotInTask.push(inStore);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tfunction assignmentHasChanged(source, target) {\r\n\t\tvar ignoreFields = {\r\n\t\t\tid: true\r\n\t\t};\r\n\r\n\t\tfor (var i in source) {\r\n\t\t\tif (!ignoreFields[i]) {\r\n\t\t\t\tif (String(source[i]) !== String(target[i])) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tfunction updateAssignment(source, target) {\r\n\t\tvar ignoreFields = {\r\n\t\t\tid: true\r\n\t\t};\r\n\r\n\t\tfor (var i in source) {\r\n\t\t\tif (!ignoreFields[i]) {\r\n\t\t\t\ttarget[i] = source[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _syncAssignments(task, storeAssignments){\r\n\t\tvar tasksAssignments = _makeAssignmentsFromTask(task);\r\n\r\n\t\tvar diff = diffAssignments(tasksAssignments, storeAssignments);\r\n\t\tdiff.inStoreNotInTask.forEach(function (a) {\r\n\t\t\tresourceAssignmentsStore.removeItem(a.id);\r\n\t\t});\r\n\t\tdiff.inTaskNotInStore.forEach(function (a) {\r\n\t\t\tresourceAssignmentsStore.addItem(a);\r\n\t\t});\r\n\r\n\t\tdiff.inBoth.forEach(function (a) {\r\n\t\t\tif (assignmentHasChanged(a.task, a.store)) {\r\n\t\t\t\tupdateAssignment(a.task, a.store);\r\n\t\t\t\tresourceAssignmentsStore.updateItem(a.store.id);\r\n\t\t\t} else {\r\n\t\t\t\tif (a.task.start_date && a.task.end_date && a.task.mode !== assignmentModes.fixedDates) {\r\n\t\t\t\t\tvar timing = _assignmentTimeFromTask(a.store, task);\r\n\t\t\t\t\tif (a.store.start_date.valueOf() != timing.start_date.valueOf() || a.store.end_date.valueOf() != timing.end_date.valueOf()) {\r\n\t\t\t\t\t\ta.store.start_date = timing.start_date;\r\n\t\t\t\t\t\ta.store.end_date = timing.end_date;\r\n\t\t\t\t\t\ta.store.duration = timing.duration;\r\n\t\t\t\t\t\tresourceAssignmentsStore.updateItem(a.store.id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t_updateTaskBack(task.id);\r\n\t}\r\n\r\n\tfunction _syncOnTaskUpdate(task) {\r\n\t\tvar storeAssignments = task[resourceAssignmentsProperty] || resourceAssignmentsStore.find(function (a) {\r\n\t\t\treturn a.task_id == task.id;\r\n\t\t});\r\n\r\n\t\t_syncAssignments(task, storeAssignments);\r\n\t}\r\n\r\n\tfunction _syncOnTaskDelete(ids) {\r\n\t\tvar idsSearch = {};\r\n\t\tids.forEach(function (id) {\r\n\t\t\tidsSearch[id] = true;\r\n\t\t});\r\n\t\tvar taskResources = resourceAssignmentsStore.find(function (a) {\r\n\t\t\treturn idsSearch[a.task_id];\r\n\t\t});\r\n\t\ttaskResources.forEach(function (a) {\r\n\t\t\tresourceAssignmentsStore.removeItem(a.id);\r\n\t\t});\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\r\n\t\tif (gantt.config.process_resource_assignments) {\r\n\t\t\tgantt.attachEvent(\"onParse\", function () {\r\n\t\t\t\tgantt.silent(function () {\r\n\t\t\t\t\tresourceAssignmentsStore.clearAll();\r\n\t\t\t\t\tvar totalAssignments = [];\r\n\t\t\t\t\tgantt.eachTask(function (task) {\r\n\t\t\t\t\t\tif (task.type === gantt.config.types.project) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar assignments = _loadAssignmentsFromTask(task);\r\n\t\t\t\t\t\t_assignAssignments(task, assignments);\r\n\r\n\t\t\t\t\t\tassignments.forEach(function (a) {\r\n\t\t\t\t\t\t\ttotalAssignments.push(a);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\tresourceAssignmentsStore.parse(totalAssignments);\r\n\t\t\t\t});\r\n\r\n\t\t\t});\r\n\r\n\t\t\tvar batchUpdate = false;\r\n\t\t\tvar needUpdate = false;\r\n\t\t\tvar needUpdateFor = {};\r\n\t\t\tvar undoBatchCancel = false;\r\n\t\t\tgantt.attachEvent(\"onBeforeBatchUpdate\", function(){\r\n\t\t\t\tbatchUpdate = true;\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(\"onAfterBatchUpdate\", function(){\r\n\t\t\t\t\r\n\t\t\t\tif(needUpdate){\r\n\t\t\t\t\tvar assignmentsHash = {};\r\n\t\t\t\t\tfor(var i in needUpdateFor){\r\n\t\t\t\t\t\tassignmentsHash[i] = gantt.getTaskAssignments(needUpdateFor[i].id);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor(var i in needUpdateFor){\r\n\t\t\t\t\t\t_syncAssignments(needUpdateFor[i], assignmentsHash[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedUpdate = false;\r\n\t\t\t\tbatchUpdate = false;\r\n\t\t\t\tneedUpdateFor = {};\r\n\t\t\t});\r\n\r\n\t\t\tgantt.attachEvent(\"onTaskCreated\", function (item) {\r\n\t\t\t\tvar assignments = _loadAssignmentsFromTask(item);\r\n\t\t\t\tresourceAssignmentsStore.parse(assignments);\r\n\t\t\t\t_assignAssignments(item, assignments);\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(\"onAfterTaskUpdate\", function (id, item) {\r\n\t\t\t\tif(batchUpdate){\r\n\t\t\t\t\tneedUpdate = true;\r\n\t\t\t\t\tneedUpdateFor[id] = item;\r\n\t\t\t\t}else if (!item.unscheduled){\r\n\t\t\t\t\t_syncOnTaskUpdate(item);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(\"onAfterTaskAdd\", function (id, item) {\r\n\t\t\t\tif(batchUpdate){\r\n\t\t\t\t\tneedUpdate = true;\r\n\t\t\t\t\tneedUpdateFor[id] = item;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t_syncOnTaskUpdate(item);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t/*\tgantt.attachEvent(\"onRowDragMove\", function (id) {\r\n\t\t\t\t_syncOnTaskUpdate(gantt.getTask(id));\r\n\t\t\t});*/\r\n\t\t\tgantt.attachEvent(\"onRowDragEnd\", function (id) {\r\n\t\t\t\t_syncOnTaskUpdate(gantt.getTask(id));\r\n\t\t\t});\r\n\t\t\tgantt.$data.tasksStore.attachEvent(\"onAfterDeleteConfirmed\", function (id, item) {\r\n\t\t\t\tvar deleteIds = [id];\r\n\t\t\t\tgantt.eachTask(function (task) {\r\n\t\t\t\t\tdeleteIds.push(task.id);\r\n\t\t\t\t}, id);\r\n\t\t\t\t_syncOnTaskDelete(deleteIds);\r\n\t\t\t});\r\n\t\t\tgantt.$data.tasksStore.attachEvent(\"onClearAll\", function () {\r\n\t\t\t\tresourceAssignmentsCache = null;\r\n\t\t\t\tresourceTaskAssignmentsCache = null;\r\n\t\t\t\ttaskAssignmentsCache = null;\r\n\t\t\t\tresourceAssignmentsStore.clearAll();\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(\"onTaskIdChange\", function (id, new_id) {\r\n\t\t\t\tvar taskResources = resourceAssignmentsStore.find(function (a) {\r\n\t\t\t\t\treturn a.task_id == id;\r\n\t\t\t\t});\r\n\t\t\t\ttaskResources.forEach(function (a) {\r\n\t\t\t\t\ta.task_id = new_id;\r\n\t\t\t\t\tresourceAssignmentsStore.updateItem(a.id);\r\n\t\t\t\t});\r\n\t\t\t\t_updateTaskBack(new_id);\r\n\t\t\t\t//any custom logic here\r\n\t\t\t});\r\n\t\t\t// GS-2144. When we Undo something, the cache should be reset\r\n\t\t\t// during the `onStoreUpdated` event to properly update the assignments\r\n\t\t\tgantt.attachEvent(\"onBeforeUndo\", function (action) {\r\n\t\t\t\tundoBatchCancel = true;\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\tgantt.attachEvent(\"onAfterUndo\", function (action) {\r\n\t\t\t\tundoBatchCancel = true;\r\n\t\t\t});\r\n\r\n\r\n\t\t\tvar resourceAssignmentsCache = null;\r\n\t\t\tvar resourceTaskAssignmentsCache = null;\r\n\t\t\tvar taskAssignmentsCache = null;\r\n\r\n\t\t\tresourceAssignmentsStore.attachEvent(\"onStoreUpdated\", function resetCache(){\r\n\t\t\t\tif(batchUpdate && !undoBatchCancel){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tresourceAssignmentsCache = null;\r\n\t\t\t\tresourceTaskAssignmentsCache = null;\r\n\t\t\t\ttaskAssignmentsCache = null;\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\r\n\t\t\tgantt.getResourceAssignments = function (resourceId, taskId) {\r\n\t\t\t\tvar searchTaskId = gantt.defined(taskId) && taskId !== null;\r\n\r\n\t\t\t\tif(resourceAssignmentsCache === null){\r\n\t\t\t\t\tresourceAssignmentsCache = {};\r\n\t\t\t\t\tresourceTaskAssignmentsCache = {};\r\n\r\n\t\t\t\t\tresourceAssignmentsStore.eachItem(function (a) {\r\n\t\t\t\t\t\tif(!resourceAssignmentsCache[a.resource_id]){\r\n\t\t\t\t\t\t\tresourceAssignmentsCache[a.resource_id] = [];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tresourceAssignmentsCache[a.resource_id].push(a);\r\n\r\n\t\t\t\t\t\tvar resourceTaskCacheKey = a.resource_id + \"-\" + a.task_id;\r\n\t\t\t\t\t\tif(!resourceTaskAssignmentsCache[resourceTaskCacheKey]){\r\n\t\t\t\t\t\t\tresourceTaskAssignmentsCache[resourceTaskCacheKey] = [];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tresourceTaskAssignmentsCache[resourceTaskCacheKey].push(a);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tif(searchTaskId){\r\n\t\t\t\t\treturn (resourceTaskAssignmentsCache[resourceId + \"-\" + taskId] || []).slice();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn (resourceAssignmentsCache[resourceId] || []).slice();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t\r\n\t\t\tgantt.getTaskAssignments = function (taskId) {\r\n\t\t\t\tif(taskAssignmentsCache === null){\r\n\t\t\t\t\tvar result = [];\r\n\t\t\t\t\ttaskAssignmentsCache = {};\r\n\t\t\t\t\tresourceAssignmentsStore.eachItem(function (a) {\r\n\t\t\t\t\t\tif(!taskAssignmentsCache[a.task_id]){\r\n\t\t\t\t\t\t\ttaskAssignmentsCache[a.task_id] = [];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttaskAssignmentsCache[a.task_id].push(a);\r\n\t\t\t\t\t\tif (a.task_id == taskId) {\r\n\t\t\t\t\t\t\tresult.push(a);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn (taskAssignmentsCache[taskId] || []).slice();\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tgantt.getTaskResources = function (taskId) {\r\n\t\t\t\tconst store = gantt.getDatastore(\"resource\");\r\n\t\t\t\tconst assignments = gantt.getTaskAssignments(taskId);\r\n\t\r\n\t\t\t\tconst uniqueResources = {};\r\n\t\t\t\tassignments.forEach(function(a){\r\n\t\t\t\t\tif(!uniqueResources[a.resource_id]){\r\n\t\t\t\t\t\tuniqueResources[a.resource_id] = a.resource_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tconst resources = [];\r\n\t\t\t\tfor(const i in uniqueResources){\r\n\t\t\t\t\tconst res = store.getItem(uniqueResources[i]);\r\n\t\t\t\t\tif(res){\r\n\t\t\t\t\t\tresources.push(res);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn resources;\r\n\t\t\t};\r\n\r\n\t\t\tgantt.updateTaskAssignments = _updateTaskBack;\r\n\t\t}\r\n\t}, {once: true});\r\n};","export default function addPlaceholder(gantt){\r\n\tfunction isEnabled(){\r\n\t\treturn gantt.config.placeholder_task;\r\n\t}\r\n\r\n\tfunction callIfEnabled(callback){\r\n\t\treturn function(){\r\n\t\t\tif(!isEnabled()){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn callback.apply(this, arguments);\r\n\t\t};\r\n\t}\r\n\r\n\tfunction silenceDataProcessor(dataProcessor){\r\n\t\tif(dataProcessor && !dataProcessor._silencedPlaceholder){\r\n\t\t\tdataProcessor._silencedPlaceholder = true;\r\n\t\t\tdataProcessor.attachEvent(\"onBeforeUpdate\", callIfEnabled(function(id, state, data){\r\n\t\t\t\tif(data.type == gantt.config.types.placeholder){\r\n\t\t\t\t\tdataProcessor.setUpdated(id, false);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}));\r\n\t\t}\r\n\t}\r\n\r\n\tfunction insertPlaceholder(){\r\n\t\tvar placeholders = gantt.getTaskBy(\"type\", gantt.config.types.placeholder);\r\n\t\tif(!placeholders.length || !gantt.isTaskExists(placeholders[0].id)){\r\n\t\t\tvar placeholder = {\r\n\t\t\t\tunscheduled: true,\r\n\t\t\t\ttype: gantt.config.types.placeholder,\r\n\t\t\t\tduration:0,\r\n\t\t\t\ttext: gantt.locale.labels.new_task\r\n\t\t\t};\r\n\t\t\tif(gantt.callEvent(\"onTaskCreated\", [placeholder]) === false){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tgantt.addTask(placeholder);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\tfunction afterEdit(id){\r\n\t\tvar item = gantt.getTask(id);\r\n\t\tif(item.type == gantt.config.types.placeholder) {\r\n\t\t\tif(item.start_date && item.end_date && item.unscheduled){\r\n\t\t\t\titem.unscheduled = false;\r\n\t\t\t}\r\n\r\n\t\t\tgantt.batchUpdate(function(){\r\n\t\t\t\tvar newTask = gantt.copy(item);\r\n\t\t\t\tgantt.silent(function(){\r\n\t\t\t\t\tgantt.deleteTask(item.id);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tdelete newTask[\"!nativeeditor_status\"];\r\n\t\t\t\tnewTask.type = gantt.config.types.task;\r\n\t\t\t\tnewTask.id = gantt.uid();\r\n\t\t\t\tgantt.addTask(newTask);\r\n\r\n\t\t\t\t//insertPlaceholder();\r\n\t\t\t});\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tgantt.config.types.placeholder = \"placeholder\";\r\n\tgantt.attachEvent(\"onDataProcessorReady\", callIfEnabled(silenceDataProcessor));\r\n\r\n\tvar ready = false;\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(ready){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tready = true;\r\n\t\tgantt.attachEvent(\"onAfterTaskUpdate\", callIfEnabled(afterEdit));\r\n\t\tgantt.attachEvent(\"onAfterTaskAdd\", callIfEnabled(function(id, task){\r\n\t\t\tif(task.type != gantt.config.types.placeholder){\r\n\t\t\t\tvar placeholders = gantt.getTaskBy(\"type\", gantt.config.types.placeholder);\r\n\t\t\t\tplaceholders.forEach(function(p){\r\n\t\t\t\t\tgantt.silent(function(){\r\n\t\t\t\t\t\tif(gantt.isTaskExists(p.id))\r\n\t\t\t\t\t\t\tgantt.deleteTask(p.id);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tinsertPlaceholder();\r\n\t\t\t}\r\n\t\t}));\r\n\t\tgantt.attachEvent(\"onParse\", callIfEnabled(insertPlaceholder));\r\n\t});\r\n\r\n\tfunction isPlaceholderTask(taskId){\r\n\t\tif(gantt.config.types.placeholder && gantt.isTaskExists(taskId)){\r\n\t\t\tvar task = gantt.getTask(taskId);\r\n\t\t\tif(task.type == gantt.config.types.placeholder){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tfunction isPlaceholderLink(link){\r\n\t\tif(isPlaceholderTask(link.source) || isPlaceholderTask(link.target)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tgantt.attachEvent(\"onLinkValidation\", function(link){\r\n\t\tif(isPlaceholderLink(link)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tgantt.attachEvent(\"onBeforeLinkAdd\", function(id,link){\r\n\t\tif(isPlaceholderLink(link)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onBeforeUndoStack\", function(action){\r\n\t\tfor(var i = 0; i < action.commands.length; i++){\r\n\t\t\tvar command = action.commands[i];\r\n\t\t\tif(command.entity === \"task\" && command.value.type === gantt.config.types.placeholder){\r\n\t\t\t\taction.commands.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n};","export default function(gantt) {\r\n\tfunction isEnabled() {\r\n\t\treturn gantt.config.auto_types && // if enabled\r\n\t\t\t(gantt.getTaskType(gantt.config.types.project) == gantt.config.types.project);// and supported\r\n\t}\r\n\r\n\tfunction callIfEnabled(callback) {\r\n\t\treturn function() {\r\n\t\t\tif (!isEnabled()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn callback.apply(this, arguments);\r\n\t\t};\r\n\t}\r\n\r\n\tfunction checkTaskType(id, changedTypes) {\r\n\t\tvar task = gantt.getTask(id);\r\n\t\tvar targetType = getTaskTypeToUpdate(task);\r\n\t\tif (targetType !== false && gantt.getTaskType(task) !== targetType) {\r\n\t\t\tchangedTypes.$needsUpdate = true;\r\n\t\t\tchangedTypes[task.id] = {task: task, type: targetType};\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getUpdatedTypes(id, changedTypes) {\r\n\t\tchangedTypes = changedTypes || {};\r\n\t\t\r\n\t\tcheckTaskType(id, changedTypes);\r\n\t\tgantt.eachParent(function(parent) {\r\n\t\t\tcheckTaskType(parent.id, changedTypes);\r\n\t\t}, id);\r\n\r\n\t\treturn changedTypes;\r\n\t}\r\n\r\n\tfunction applyChanges(changedTypes) {\r\n\t\tfor (var i in changedTypes) {\r\n\t\t\tif(changedTypes[i] && changedTypes[i].task){\r\n\t\t\t\tvar task = changedTypes[i].task;\r\n\t\t\t\ttask.type = changedTypes[i].type;\r\n\t\t\t\tgantt.updateTask(task.id);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateParentTypes(startId) {\r\n\t\tif (gantt.getState().group_mode) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tvar changedTypes = getUpdatedTypes(startId);\r\n\t\tif (changedTypes.$needsUpdate) {\r\n\t\t\tgantt.batchUpdate(function() {\r\n\t\t\t\tapplyChanges(changedTypes);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tvar delTaskParent;\r\n\r\n\tfunction updateTaskType(task, targetType) {\r\n\t\tif(!gantt.getState().group_mode){\r\n\t\t\ttask.type = targetType;\r\n\t\t\tgantt.updateTask(task.id);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getTaskTypeToUpdate(task) {\r\n\t\tvar allTypes = gantt.config.types;\r\n\t\tvar hasChildren = gantt.hasChild(task.id);\r\n\t\tvar taskType = gantt.getTaskType(task.type);\r\n\r\n\t\tif (hasChildren && taskType === allTypes.task) {\r\n\t\t\treturn allTypes.project;\r\n\t\t}\r\n\r\n\t\tif (!hasChildren && taskType === allTypes.project) {\r\n\t\t\treturn allTypes.task;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar isParsingDone = true;\r\n\r\n\tgantt.attachEvent(\"onParse\", callIfEnabled(function() {\r\n\t\tisParsingDone = false;\r\n\t\tif(gantt.getState().group_mode){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tgantt.batchUpdate(function() {\r\n\t\t\tgantt.eachTask(function(task) {\r\n\t\t\t\tvar targetType = getTaskTypeToUpdate(task);\r\n\t\t\t\tif (targetType !== false) {\r\n\t\t\t\t\tupdateTaskType(task, targetType);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tisParsingDone = true;\r\n\t}));\r\n\r\n\tgantt.attachEvent(\"onAfterTaskAdd\", callIfEnabled(function(id) {\r\n\t\tif (isParsingDone) {\r\n\t\t\tupdateParentTypes(id);\r\n\t\t}\r\n\t}));\r\n\r\n\tgantt.attachEvent(\"onAfterTaskUpdate\", callIfEnabled(function(id) {\r\n\t\tif (isParsingDone) {\r\n\t\t\tupdateParentTypes(id);\r\n\t\t}\r\n\t}));\r\n\r\n\tfunction updateAfterRemoveChild(id){\r\n\t\tif (id != gantt.config.root_id && gantt.isTaskExists(id)) {\r\n\t\t\tupdateParentTypes(id);\r\n\t\t}\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onBeforeTaskDelete\", callIfEnabled(function(id, task) {\r\n\t\tdelTaskParent = gantt.getParent(id);\r\n\t\treturn true;\r\n\t}));\r\n\r\n\tgantt.attachEvent(\"onAfterTaskDelete\", callIfEnabled(function(id, task) {\r\n\t\tupdateAfterRemoveChild(delTaskParent);\r\n\t}));\r\n\r\n\r\n\tvar originalRowDndParent;\r\n\r\n\tgantt.attachEvent(\"onRowDragStart\", callIfEnabled(function(id, target, e) {\r\n\t\toriginalRowDndParent = gantt.getParent(id);\r\n\t\treturn true;\r\n\t}));\r\n\r\n\tgantt.attachEvent(\"onRowDragEnd\", callIfEnabled(function(id, target) {\r\n\t\tupdateAfterRemoveChild(originalRowDndParent);\r\n\t\tupdateParentTypes(id);\r\n\t}));\r\n\r\n\tvar originalMoveTaskParent;\r\n\r\n\tgantt.attachEvent(\"onBeforeTaskMove\", callIfEnabled(function(sid, parent, tindex) {\r\n\t\toriginalMoveTaskParent = gantt.getParent(sid);\r\n\t\treturn true;\r\n\t}));\r\n\r\n\tgantt.attachEvent(\"onAfterTaskMove\", callIfEnabled(function(id, parent, tindex) {\r\n\t\tif (document.querySelector(\".gantt_drag_marker\")) {\r\n\t\t\t// vertical dnd in progress\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tupdateAfterRemoveChild(originalMoveTaskParent);\r\n\t\tupdateParentTypes(id);\r\n\t}));\r\n};","export default class DurationFormatterNumeric implements IDurationFormatter {\r\n\tstatic create = (settings: IDurationFormatterConfig = null): IDurationFormatter => {\r\n\t\treturn new DurationFormatterNumeric();\r\n\t};\r\n\tcanParse = (value: string) : boolean => {\r\n\t\treturn !isNaN(this.parse(value));\r\n\t};\r\n\tformat = (value: number) : string => {\r\n\t\treturn String(value);\r\n\t};\r\n\tparse = (value: string) : number => {\r\n\t\treturn parseInt(value, 10);\r\n\t};\r\n}","export default class LinkFormatterSimple implements ILinkFormatter {\r\n\tstatic create = (settings: ILinkFormatterConfig = null, gantt: any): LinkFormatterSimple => {\r\n\t\treturn new LinkFormatterSimple(gantt);\r\n\t};\r\n\tprotected _linkReg: RegExp;\r\n\tprotected _gantt: any;\r\n\r\n\tconstructor(gantt: any) {\r\n\t\tthis._linkReg = /^[0-9\\.]+/;\r\n\t\tthis._gantt = gantt;\r\n\t}\r\n\r\n\tformat = (link: ILink) : string => {\r\n\t\tconst wbs = this._getWBSCode(link.source);\r\n\t\treturn wbs;\r\n\t};\r\n\r\n\tcanParse = (value: string) : boolean => {\r\n\t\treturn this._linkReg.test(value);\r\n\t};\r\n\tparse = (value: string) : ILink => {\r\n\t\tif(!this.canParse(value)){\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst linkPart = this._linkReg.exec(value)[0].trim();\r\n\r\n\t\tconst source = this._findSource(linkPart) || null;\r\n\r\n\t\treturn {\r\n\t\t\tid: undefined,\r\n\t\t\tsource,\r\n\t\t\ttarget: null,\r\n\t\t\ttype: this._gantt.config.links.finish_to_start,\r\n\t\t\tlag: 0\r\n\t\t};\r\n\t};\r\n\r\n\tprotected _getWBSCode = (source: number | string) => {\r\n\t\tconst pred = this._gantt.getTask(source);\r\n\t\treturn this._gantt.getWBSCode(pred);\r\n\t};\r\n\r\n\tprotected _findSource = (value: string) => {\r\n\t\tconst reqTemplate = new RegExp(\"^[0-9\\.]+\", \"i\");\r\n\t\tif(reqTemplate.exec(value)){\r\n\t\t\tconst wbs = reqTemplate.exec(value)[0];\r\n\t\t\tconst task = this._gantt.getTaskByWBSCode(wbs);\r\n\t\t\tif(task){\r\n\t\t\t\treturn task.id;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n}","\r\nimport DurationFormatter from \"../common/duration_formatter\";\r\nimport LinkFormatter from \"../common/link_formatter\";\r\n\r\nexport default function(gantt){\r\n\tgantt.ext.formatters = {\r\n\t\tdurationFormatter: function(settings){\r\n\t\t\tif(!settings){\r\n\t\t\t\tsettings = {};\r\n\t\t\t}\r\n\t\t\tif(!settings.store){\r\n\t\t\t\tsettings.store = gantt.config.duration_unit;\r\n\t\t\t}\r\n\t\t\tif(!settings.enter){\r\n\t\t\t\tsettings.enter = gantt.config.duration_unit;\r\n\t\t\t}\r\n\t\t\treturn DurationFormatter.create(settings, gantt);\r\n\t\t},\r\n\t\tlinkFormatter: function(settings){\r\n\t\t\treturn LinkFormatter.create(settings, gantt);\r\n\t\t}\r\n\t};\r\n};","export default function(gantt: any){\r\n\r\n\tgantt.ext = gantt.ext || {};\r\n\tgantt.config.show_empty_state = false;\r\n\r\n\tgantt.ext.emptyStateElement = gantt.ext.emptyStateElement || {\r\n\t\tisEnabled() {\r\n\t\t\treturn gantt.config.show_empty_state === true;\r\n\t\t},\r\n\t\tisGanttEmpty(){\r\n\t\t\treturn !gantt.getTaskByTime().length;\r\n\t\t},\r\n\t\trenderContent(container){\r\n\t\t\tconst placeholderTextElement = `\r\n
${gantt.locale.labels.empty_state_text_link}
\r\n
${gantt.locale.labels.empty_state_text_description}
\r\n
`;\r\n\t\t\tconst placeholderImageElement = \"
\";\r\n\r\n\t\t\tconst placeholderContainer = `${placeholderImageElement}${placeholderTextElement}
`;\r\n\t\t\tcontainer.innerHTML = placeholderContainer;\r\n\t\t},\r\n\r\n\t\tclickEvents: [],\r\n\t\tattachAddTaskEvent(){\r\n\t\t\tconst id = gantt.attachEvent(\"onEmptyClick\", function(e){\r\n\t\t\t\tconst domHelpers = gantt.utils.dom;\r\n\t\t\t\tconst gridPlaceholder = domHelpers.closest(e.target, \"[data-empty-state-create-task]\");\r\n\t\t\t\tif (gridPlaceholder){\r\n\t\t\t\t\tgantt.createTask({\r\n\t\t\t\t\t\tid: gantt.uid(),\r\n\t\t\t\t\t\ttext: \"New Task\"\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthis.clickEvents.push(id);\r\n\t\t},\r\n\t\tdetachAddTaskEvents(){\r\n\t\t\tthis.clickEvents.forEach(function(event){\r\n\t\t\t\tgantt.detachEvent(event);\r\n\t\t\t});\r\n\t\t\tthis.clickEvents = [];\r\n\t\t},\r\n\r\n\t\tgetContainer(){\r\n\t\t\tif (gantt.$container) {\r\n\t\t\t\tconst domHelpers = gantt.utils.dom;\r\n\t\t\t\tif (gantt.$container.contains(gantt.$grid_data)) {\r\n\t\t\t\t\treturn domHelpers.closest(gantt.$grid_data, \".gantt_layout_content\");\r\n\t\t\t\t}\r\n\t\t\t\tif (gantt.$container.contains(gantt.$task_data)){\r\n\t\t\t\t\treturn domHelpers.closest(gantt.$task_data, \".gantt_layout_content\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tgetNode(){\r\n\t\t\tconst container = this.getContainer();\r\n\t\t\tif (!container){\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tconst emptyStateElementNode = container.querySelector(\".gantt_empty_state_wrapper\");\r\n\t\t\treturn emptyStateElementNode;\r\n\t\t},\r\n\r\n\t\tshow(){\r\n\t\t\tconst container = this.getContainer();\r\n\t\t\tif (!container && this.isGanttEmpty()){\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tconst wrapper = document.createElement(\"div\");\r\n\t\t\twrapper.className = \"gantt_empty_state_wrapper\";\r\n\t\t\twrapper.style.marginTop = (gantt.config.scale_height - container.offsetHeight) + \"px\";\r\n\t\t\tconst oldNodes = gantt.$container.querySelectorAll(\".gantt_empty_state_wrapper\");\r\n\t\t\t// for IE11\r\n\t\t\tArray.prototype.forEach.call(oldNodes, function(node){\r\n\t\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\t});\r\n\r\n\t\t\tthis.detachAddTaskEvents();\r\n\t\t\tthis.attachAddTaskEvent();\r\n\r\n\t\t\tcontainer.appendChild(wrapper);\r\n\t\t\tthis.renderContent(wrapper);\r\n\t\t},\r\n\t\thide(){\r\n\t\t\tconst emptyStateElementNode = this.getNode();\r\n\t\t\tif (emptyStateElementNode){\r\n\t\t\t\temptyStateElementNode.parentNode.removeChild(emptyStateElementNode);\r\n\t\t\t} else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tinit(){ }\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onDataRender\", function() {\r\n\t\tconst emptyStateElement = gantt.ext.emptyStateElement;\r\n\t\tif (emptyStateElement.isEnabled() && emptyStateElement.isGanttEmpty()) {\r\n\t\t\temptyStateElement.show();\r\n\t\t} else {\r\n\t\t\temptyStateElement.hide();\r\n\t\t}\r\n\t});\r\n\r\n\r\n\r\n\r\n}\r\n","export const hasBaselinesBelow = function (gantt, task) {\r\n const baselines = task.baselines && task.baselines.length;\r\n const baselinesOnDifferentRow = gantt.config.baselines.render_mode == \"separateRow\" || gantt.config.baselines.render_mode == \"individualRow\";\r\n if (baselines && baselinesOnDifferentRow) {\r\n return true;\r\n }\r\n};\r\n\r\nexport const childrenHaveBaselines = function (gantt, taskId) {\r\n let hasBaselines = false;\r\n gantt.eachTask(function (child) {\r\n if (hasBaselines) {\r\n return;\r\n }\r\n hasBaselines = hasBaselinesBelow(gantt, child);\r\n }, taskId);\r\n return hasBaselines;\r\n};\r\n\r\nexport const isSplitChild = function (gantt, id) {\r\n let splitChild = false;\r\n gantt.eachParent(function (parent) {\r\n if (isSplitParent(parent)) {\r\n splitChild = true;\r\n }\r\n }, id);\r\n return splitChild;\r\n};\r\n\r\nexport const isSplitParent = function (task) {\r\n return task.render && task.render == \"split\" && !task.$open;\r\n};\r\n\r\nexport const getMaxParentHeight = function (gantt, view, task, heightLimit) {\r\n let maxHeight = heightLimit || view.$task_data.scrollHeight;\r\n let shrinkHeight = false;\r\n let splitChild = false;\r\n\r\n gantt.eachParent(function (parent) {\r\n if (isSplitParent(parent)) {\r\n splitChild = true;\r\n const parentSizes = view.getItemPosition(parent);\r\n const parentHeight = parentSizes.rowHeight;\r\n if (parentHeight < maxHeight) {\r\n maxHeight = parentHeight;\r\n shrinkHeight = true;\r\n }\r\n }\r\n }, task.id);\r\n\r\n return { maxHeight, shrinkHeight, splitChild };\r\n};\r\n\r\nexport const getMilestoneHeight = function (height) {\r\n return Math.sqrt(2 * height * height);\r\n};\r\n\r\nexport const getInvertedMilestoneHeight = function (height) {\r\n return Math.round(height / Math.sqrt(2));\r\n};\r\n\r\nexport const getAdjustedPosition = function (gantt, timeline, sizes, heightLimit, task, childBaselines) {\r\n const baselines = hasBaselinesBelow(gantt, task);\r\n\r\n const splitParams = getMaxParentHeight(gantt, timeline, task);\r\n let maxHeight = splitParams.maxHeight;\r\n\r\n let height = sizes.height;\r\n let largerHeight = height > heightLimit;\r\n let noNeedToShrink = sizes.rowHeight >= heightLimit && !splitParams.splitChild && !baselines;\r\n if (largerHeight || noNeedToShrink) {\r\n height = heightLimit;\r\n }\r\n\r\n if (maxHeight < height) {\r\n height = maxHeight;\r\n }\r\n\r\n let marginTop = Math.floor((sizes.rowHeight - height) / 2);\r\n\r\n if (splitParams.splitChild) {\r\n marginTop = Math.floor((maxHeight - height) / 2);\r\n }\r\n if (childBaselines || baselines) {\r\n let heightDiff = Math.min(sizes.height, maxHeight) - height;\r\n\r\n let additionalMargin = 2;\r\n let exceedBarHeight = baselines && task.bar_height >= task.row_height;\r\n let exceedParentHeight = splitParams.splitChild && sizes.height >= maxHeight;\r\n if (exceedBarHeight || exceedParentHeight){\r\n additionalMargin = 0;\r\n }\r\n\r\n marginTop = Math.floor(heightDiff / 2) + additionalMargin;\r\n const bottom = height + marginTop;\r\n if (bottom > sizes.rowHeight || bottom > maxHeight) {\r\n // marginTop = 0;\r\n }\r\n }\r\n\r\n return { height, marginTop };\r\n};\r\n\r\nexport default {\r\n hasBaselinesBelow,\r\n childrenHaveBaselines,\r\n isSplitChild,\r\n isSplitParent,\r\n getMaxParentHeight,\r\n getMilestoneHeight,\r\n getInvertedMilestoneHeight,\r\n getAdjustedPosition\r\n};\r\n","import { hasBaselinesBelow, isSplitParent } from \"../ui/render/baseline_helper\";\r\n\r\nexport default function (gantt) {\r\n gantt.config.baselines = {\r\n datastore: \"baselines\",\r\n render_mode: false,\r\n dataprocessor_baselines: false,\r\n row_height: 16,\r\n bar_height: 8\r\n };\r\n\r\n function initBaselineFields(item, task) {\r\n // don't add baseline if it doesn't belong to any task\r\n // or if doesn't have the dates\r\n if (!item.task_id || (!item.start_date && !item.end_date)) {\r\n return false;\r\n }\r\n\r\n if (item.start_date) {\r\n item.start_date = gantt.date.parseDate(item.start_date, \"parse_date\");\r\n } else {\r\n item.start_date = null;\r\n }\r\n\r\n if (item.end_date) {\r\n item.end_date = gantt.date.parseDate(item.end_date, \"parse_date\");\r\n } else {\r\n item.end_date = null;\r\n }\r\n\r\n // set min baseline duration\r\n item.duration = item.duration || 1;\r\n\r\n // GS-2636. Calculate the 3rd date parameter basing on existing date parameters\r\n if (item.start_date && !item.end_date){\r\n item.end_date = gantt.calculateEndDate(item.start_date, item.duration);\r\n } else if (item.end_date && !item.start_date){\r\n item.start_date = gantt.calculateEndDate(item.end_date, -item.duration);\r\n } \r\n }\r\n // gantt init\r\n const baselineStore = gantt.createDatastore({\r\n name: gantt.config.baselines.datastore,\r\n initItem: function (item) {\r\n if (!item.id) {\r\n item.id = gantt.uid();\r\n }\r\n\r\n initBaselineFields(item);\r\n\r\n return item;\r\n }\r\n });\r\n\r\n gantt.$data.baselineStore = baselineStore;\r\n\r\n function _syncBaselines(task) {\r\n let shouldRepaint = false;\r\n const iteratedBaselines = {};\r\n\r\n const taskBaselines = task.baselines || [];\r\n const exisingBaselines = gantt.getTaskBaselines(task.id);\r\n\r\n if (taskBaselines.length != exisingBaselines.length) {\r\n shouldRepaint = true;\r\n }\r\n\r\n taskBaselines.forEach(function (baseline) {\r\n iteratedBaselines[baseline.id] = true;\r\n const exisingBaseline = baselineStore.getItem(baseline.id);\r\n if (exisingBaseline) {\r\n const start = +exisingBaseline.start_date !== +baseline.start_date;\r\n const end = +exisingBaseline.end_date !== +baseline.end_date;\r\n if (start || end) {\r\n baselineStore.updateItem(baseline.id, baseline);\r\n }\r\n } else {\r\n baselineStore.addItem(baseline);\r\n }\r\n });\r\n\r\n exisingBaselines.forEach(function (baseline) {\r\n if (!iteratedBaselines[baseline.id]) {\r\n baselineStore.removeItem(baseline.id);\r\n }\r\n });\r\n\r\n if (shouldRepaint) {\r\n if (isSplitParent(task)){\r\n // here we adjust the parent height, then adjust it with the total child height\r\n _adjustSplitParentHeight (task);\r\n } else {\r\n gantt.adjustTaskHeightForBaselines(task);\r\n }\r\n gantt.render();\r\n }\r\n }\r\n\r\n function _deleteOrphanBaselines() {\r\n baselineStore.eachItem(function (baseline) {\r\n if (!gantt.isTaskExists(baseline.task_id)) {\r\n baselineStore.removeItem(baseline.id);\r\n }\r\n });\r\n }\r\n\r\n function _adjustSplitParentHeight (task){\r\n let maxParentHeight = 0;\r\n\r\n gantt.adjustTaskHeightForBaselines(task);\r\n\r\n gantt.eachTask(function(child){\r\n let childHeight = child.row_height || gantt.config.row_height;\r\n\r\n maxParentHeight = maxParentHeight || childHeight;\r\n if (childHeight > maxParentHeight){\r\n maxParentHeight = childHeight;\r\n }\r\n }, task.id);\r\n\r\n if (task.row_height < maxParentHeight){\r\n task.row_height = maxParentHeight;\r\n }\r\n }\r\n\r\n gantt.adjustTaskHeightForBaselines = function (task) {\r\n let height, baselineSize, betweenBaselines;\r\n let margins = 2;\r\n let baselineAmount = task.baselines && task.baselines.length || 0;\r\n const subrowHeight = gantt.config.baselines.row_height;\r\n //const baselineBarHeight = task?.baselines.bar_height\r\n\r\n switch (gantt.config.baselines.render_mode) {\r\n case \"taskRow\":\r\n task.row_height = task.bar_height + 4;\r\n break;\r\n\r\n case \"separateRow\":\r\n height = gantt.getLayoutView(\"timeline\").getBarHeight(task.id);\r\n if (baselineAmount) {\r\n task.bar_height = task.bar_height || height;\r\n\r\n if (task.bar_height > height){\r\n height = task.bar_height;\r\n }\r\n\r\n task.row_height = height + subrowHeight;\r\n } else if (task.bar_height) {\r\n task.row_height = task.bar_height + 4;\r\n }\r\n\r\n _increaseSplitParentHeight(task);\r\n break;\r\n\r\n case \"individualRow\":\r\n height = gantt.getLayoutView(\"timeline\").getBarHeight(task.id);\r\n\r\n if (baselineAmount) {\r\n task.bar_height = task.bar_height || height;\r\n\r\n if (task.bar_height > height){\r\n height = task.bar_height;\r\n }\r\n\r\n baselineSize = subrowHeight * baselineAmount;\r\n // betweenBaselines = 3 * (baselineAmount + 1);\r\n\r\n task.row_height = height + baselineSize + margins;\r\n } else if (task.bar_height){\r\n task.row_height = task.bar_height + 4;\r\n }\r\n\r\n _increaseSplitParentHeight(task);\r\n }\r\n };\r\n\r\n function _increaseSplitParentHeight(task) {\r\n gantt.eachParent(function (parent) {\r\n if (isSplitParent(parent)) {\r\n const parentHeight = parent.row_height || gantt.getLayoutView(\"timeline\").getBarHeight(parent.id);\r\n let maxHeight = task.row_height;\r\n\r\n // iterate only direct children\r\n const subtasks = gantt.getChildren(parent.id);\r\n subtasks.forEach(function (subtaskId) {\r\n const subtask = gantt.getTask(subtaskId);\r\n if (subtask.id == task.id) {\r\n return;\r\n }\r\n const subtaskHeight = subtask.row_height || gantt.getLayoutView(\"timeline\").getBarHeight(subtask.id);\r\n maxHeight = maxHeight || subtaskHeight;\r\n if (subtaskHeight > maxHeight) {\r\n maxHeight = subtaskHeight;\r\n }\r\n });\r\n\r\n parent.row_height = maxHeight;\r\n parent.bar_height = parent.bar_height || parentHeight;\r\n }\r\n }, task.id);\r\n }\r\n\r\n gantt.attachEvent(\r\n \"onGanttReady\",\r\n function () {\r\n\r\n if(gantt.config.baselines === false){\r\n return;\r\n }\r\n\r\n gantt.attachEvent(\"onParse\", function () {\r\n baselineStore.eachItem(function (baseline) {\r\n const taskId = baseline.task_id;\r\n if (gantt.isTaskExists(taskId)) {\r\n const task = gantt.getTask(taskId);\r\n\r\n task.baselines = task.baselines || [];\r\n\r\n let newBaseline = true;\r\n for (let i = 0; i < task.baselines.length; i++) {\r\n let existingBaseline = task.baselines[i];\r\n if (existingBaseline.id == baseline.id){\r\n newBaseline = false;\r\n gantt.mixin(existingBaseline, baseline, true);\r\n break;\r\n }\r\n }\r\n if (newBaseline){\r\n task.baselines.push(baseline);\r\n }\r\n\r\n if (isSplitParent(task)){\r\n _adjustSplitParentHeight (task);\r\n } else {\r\n gantt.adjustTaskHeightForBaselines(task);\r\n }\r\n }\r\n });\r\n });\r\n\r\n gantt.attachEvent(\"onBeforeTaskUpdate\", function (id, task) {\r\n _syncBaselines(task);\r\n return true;\r\n });\r\n\r\n gantt.attachEvent(\"onAfterUndo\", function(action){\r\n const baselinesRenderedBelow = gantt.config.baselines.render_mode == \"separateRow\" || gantt.config.baselines.render_mode == \"individualRow\";\r\n if (baselinesRenderedBelow && action){\r\n let repaint = false;\r\n action.commands.forEach(function(command){\r\n if (command.entity == \"task\"){\r\n const taskId = command.value.id;\r\n if (gantt.isTaskExists(taskId)){\r\n const task = gantt.getTask(taskId);\r\n if (task.parent && gantt.isTaskExists(task.parent)){\r\n const parent = gantt.getTask(task.parent);\r\n if (isSplitParent(parent)){\r\n _adjustSplitParentHeight (parent);\r\n repaint = true;\r\n }\r\n }\r\n } \r\n }\r\n });\r\n if (repaint){\r\n gantt.render();\r\n }\r\n }\r\n });\r\n\r\n gantt.attachEvent(\"onAfterTaskDelete\", function (id, task) {\r\n if (hasBaselinesBelow){\r\n if (task.parent && gantt.isTaskExists(task.parent)){\r\n const parent = gantt.getTask(task.parent);\r\n if (isSplitParent(parent)){\r\n _adjustSplitParentHeight (parent);\r\n }\r\n }\r\n }\r\n _deleteOrphanBaselines();\r\n });\r\n\r\n gantt.getTaskBaselines = function (taskId) {\r\n const baselines = [];\r\n baselineStore.eachItem(function (baseline) {\r\n if (baseline.task_id == taskId) {\r\n baselines.push(baseline);\r\n }\r\n });\r\n return baselines;\r\n };\r\n gantt.$data.baselineStore.attachEvent(\"onClearAll\", function () {\r\n gantt.eachTask(function(task){\r\n if (task.baselines){\r\n delete task.baselines;\r\n }\r\n });\r\n // The data should not be repainted as otherwise it causes issues when we have resource \r\n // assignments and group tasks. It should be fixed when we add a repaint stack\r\n // gantt.refreshData();\r\n return true;\r\n });\r\n\r\n gantt.$data.tasksStore.attachEvent(\"onClearAll\", function () {\r\n baselineStore.clearAll();\r\n return true;\r\n });\r\n gantt.attachEvent(\"onTaskIdChange\", function (id, new_id) {\r\n const baselines = baselineStore.find(function (a) {\r\n return a.task_id == id;\r\n });\r\n baselines.forEach(function (a) {\r\n a.task_id = new_id;\r\n baselineStore.updateItem(a.id);\r\n });\r\n });\r\n },\r\n { once: true }\r\n );\r\n};\r\n","import * as helpers from \"../../utils/helpers\";\r\n\r\nexport default function(gantt) {\r\n\tgantt.load = function(){\r\n\t\tthrow new Error(\"gantt.load() method is not available in the node.js, use gantt.parse() instead\");\r\n\t};\r\n\tgantt.parse = function (data, type) {\r\n\t\tthis.on_load({xmlDoc: {responseText: data}}, type);\r\n\t};\r\n\r\n\tgantt.serialize = function (type) {\r\n\t\ttype = type || \"json\";\r\n\t\treturn this[type].serialize();\r\n\t};\r\n\r\n\t/*\r\n\ttasks and relations\r\n\t{\r\n\tdata:[\r\n\t\t{\r\n\t\t\t\"id\":\"string\",\r\n\t\t\t\"text\":\"...\",\r\n\t\t\t\"start_date\":\"Date or string\",\r\n\t\t\t\"end_date\":\"Date or string\",\r\n\t\t\t\"duration\":\"number\",\r\n\t\t\t\"progress\":\"0..1\",\r\n\t\t\t\"parent_id\":\"string\",\r\n\t\t\t\"order\":\"number\"\r\n\t\t},...],\r\n\tlinks:[\r\n\t\t{\r\n\t\t\tid:\"string\",\r\n\t\t\tsource:\"string\",\r\n\t\t\ttarget:\"string\",\r\n\t\t\ttype:\"string\"\r\n\t\t},...],\r\n\tcollections:{\r\n\t\t\tcollectionName:[\r\n\t\t\t\t{key:, label:, optional:...},...\r\n\t\t\t],...\r\n\t\t}\r\n\t}\r\n\r\n\t* */\r\n\r\n\tgantt.on_load = function (resp, type) {\r\n\t\tif(resp.xmlDoc && resp.xmlDoc.status === 404){ // work if we don't have a file at current url\r\n\t\t\tthis.assert(false, \"Failed to load the data from \" \r\n\t\t\t\t+ resp.xmlDoc.responseURL + \" , server returns 404\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(gantt.$destroyed){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.callEvent(\"onBeforeParse\", []);\r\n\t\tif (!type)\r\n\t\t\ttype = \"json\";\r\n\t\tthis.assert(this[type], \"Invalid data type:'\" + type + \"'\");\r\n\r\n\t\tvar raw = resp.xmlDoc.responseText;\r\n\r\n\t\tvar data = this[type].parse(raw, resp);\r\n\t\tthis._process_loading(data);\r\n\t};\r\n\r\n\tfunction attachAssignmentsToTasks(tasks, assignments) {\r\n\t\tconst assignmentsByTasks = {};\r\n\t\tassignments.forEach((a)=>{\r\n\t\t\tif(!assignmentsByTasks[a.task_id]) {\r\n\t\t\t\tassignmentsByTasks[a.task_id] = [];\r\n\t\t\t}\r\n\t\t\tassignmentsByTasks[a.task_id].push(a);\r\n\t\t});\r\n\t\ttasks.forEach((t) => {\r\n\t\t\tt[gantt.config.resource_property] = assignmentsByTasks[t.id] || [];\r\n\t\t});\t\r\n\t}\r\n\t\r\n\tgantt._process_loading = function (data) {\r\n\t\tif(data.collections)\r\n\t\t\tthis._load_collections(data.collections);\r\n\r\n\t\tif(data.resources && this.$data.resourcesStore){\r\n\t\t\tthis.$data.resourcesStore.parse(data.resources);\r\n\t\t}\r\n\t\tif(gantt.config.baselines !== false && data.baselines && this.$data.baselineStore){\r\n\t\t\tthis.$data.baselineStore.parse(data.baselines);\r\n\t\t}\r\n\t\t\r\n\t\tconst tasks = data.data || data.tasks;\r\n\t\tif(data.assignments){\r\n\t\t\tattachAssignmentsToTasks(tasks, data.assignments);\r\n\t\t}\r\n\r\n\t\tthis.$data.tasksStore.parse(tasks);\r\n\t\tvar links = data.links || (data.collections ? data.collections.links : []);\r\n\t\tthis.$data.linksStore.parse(links);\r\n\r\n\t\t//this._sync_links();\r\n\t\tthis.callEvent(\"onParse\", []);\r\n\t\tthis.render();\r\n\t};\r\n\r\n\tgantt._load_collections = function (collections) {\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\t// GS-1728. Create an empty serverList if it doesn't exist\r\n\t\t\t\tthis.serverList[key] = this.serverList[key] || [];\r\n\t\t\t\tvar arr = this.serverList[key];\r\n\t\t\t\tif (!arr) continue;\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = this.copy(option);\r\n\t\t\t\t\tobj.key = obj.value;// resulting option object\r\n\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tthis.callEvent(\"onOptionsLoad\", []);\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onBeforeTaskDisplay\", function (id, task) {\r\n\t\treturn !task.$ignore;\r\n\t});\r\n\r\n\tfunction jsonParseError(data){\r\n\t\tgantt.assert(false, \"Can't parse data: incorrect value of gantt.parse or gantt.load method. \"\r\n\t\t\t+ \"Actual argument value: \" + JSON.stringify(data));\r\n\t\tthrow new Error(\"Invalid argument for gantt.parse or gantt.load. An object or a JSON string of format https://docs.dhtmlx.com/gantt/desktop__supported_data_formats.html#json is expected. Actual argument value: \"\r\n\t\t\t+ JSON.stringify(data));\r\n\t}\r\n\r\n\tgantt.json = {\r\n\t\tparse: function (data) {\r\n\t\t\tif(!data){\r\n\t\t\t\tjsonParseError(data);\r\n\t\t\t}\r\n\r\n\t\t\tif (typeof data == \"string\") {\r\n\t\t\t\tif (typeof JSON != undefined){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(e) {\r\n\t\t\t\t\t\tjsonParseError(data);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgantt.assert(false, \"JSON is not supported\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!data.data && !data.tasks){\r\n\t\t\t\tjsonParseError(data);\r\n\t\t\t}\r\n\r\n\t\t\tif (data.dhx_security)\r\n\t\t\t\tgantt.security_key = data.dhx_security;\r\n\t\t\treturn data;\r\n\t\t},\r\n\t\tserializeTask: function (task) {\r\n\t\t\treturn this._copyObject(task);\r\n\t\t},\r\n\t\tserializeLink: function (link) {\r\n\t\t\treturn this._copyLink(link);\r\n\t\t},\r\n\t\t_copyLink: function (obj) {\r\n\t\t\tvar copy = {};\r\n\t\t\tfor (var key in obj)\r\n\t\t\t\tcopy[key] = obj[key];\r\n\t\t\treturn copy;\r\n\t\t},\r\n\t\t_copyObject: function (obj) {\r\n\t\t\tvar copy = {};\r\n\t\t\tfor (var key in obj) {\r\n\t\t\t\tif (key.charAt(0) == \"$\")\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tcopy[key] = obj[key];\r\n\r\n\t\t\t\tif (helpers.isDate(copy[key])) {\r\n\t\t\t\t\tcopy[key] = gantt.defined(gantt.templates.xml_format) ? gantt.templates.xml_format(copy[key]) : gantt.templates.format_date(copy[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn copy;\r\n\t\t},\r\n\t\tserialize: function () {\r\n\t\t\tvar tasks = [];\r\n\t\t\tvar links = [];\r\n\t\t\tlet baselines = [];\r\n\r\n\t\t\tgantt.eachTask(function (obj) {\r\n\t\t\t\tgantt.resetProjectDates(obj);\r\n\t\t\t\ttasks.push(this.serializeTask(obj));\r\n\t\t\t}, gantt.config.root_id, this);\r\n\r\n\t\t\tvar rawLinks = gantt.getLinks();\r\n\t\t\tfor (var i = 0; i < rawLinks.length; i++) {\r\n\t\t\t\tlinks.push(this.serializeLink(rawLinks[i]));\r\n\t\t\t}\r\n\r\n\t\t\tconst baselineStore = gantt.getDatastore(\"baselines\");\r\n\t\t\tbaselineStore.eachItem(function(baseline){\r\n\t\t\t\tconst baselineCopy = gantt.json.serializeTask(baseline);\r\n\t\t\t\tbaselines.push(baselineCopy);\r\n\t\t\t});\r\n\r\n\t\t\treturn {\r\n\t\t\t\tdata: tasks,\r\n\t\t\t\tlinks,\r\n\t\t\t\tbaselines\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\t/*\r\n\t\r\n\t\t\r\n\t\t\tMy task 1 \r\n\t\t\t16.08.2013 \r\n\t\t\t22.08.2013 \r\n\t\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t\t \r\n\t\t\t \r\n\t\t \r\n\t \r\n\t*/\r\n\r\n\tfunction xmlParseError(data){\r\n\t\tgantt.assert(false, \"Can't parse data: incorrect value of gantt.parse or gantt.load method. \"\r\n\t\t\t+ \"Actual argument value: \" + JSON.stringify(data));\r\n\t\tthrow new Error(\"Invalid argument for gantt.parse or gantt.load. An XML of format https://docs.dhtmlx.com/gantt/desktop__supported_data_formats.html#xmldhtmlxgantt20 is expected. Actual argument value: \"\r\n\t\t\t+ JSON.stringify(data));\r\n\t}\r\n\r\n\tgantt.xml = {\r\n\t\t_xmlNodeToJSON: function (node, attrs_only) {\r\n\t\t\tvar t = {};\r\n\t\t\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\t\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\t\t\tif (!attrs_only) {\r\n\t\t\t\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\t\t\t\tvar child = node.childNodes[i];\r\n\t\t\t\t\tif (child.nodeType == 1)\r\n\t\t\t\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\t\t\t}\r\n\r\n\t\t\treturn t;\r\n\t\t},\r\n\t\t_getCollections: function (loader) {\r\n\t\t\tvar collection = {};\r\n\t\t\tvar opts = gantt.ajax.xpath(\"//coll_options\", loader);\r\n\t\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\t\tvar arr = collection[bind] = [];\r\n\t\t\t\tvar itms = gantt.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\t\tvar itm = itms[j];\r\n\t\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\t\tvar obj = {key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn collection;\r\n\t\t},\r\n\t\t_getXML: function (text, loader, toptag) {\r\n\t\t\ttoptag = toptag || \"data\";\r\n\t\t\tif (!loader.getXMLTopNode) {\r\n\t\t\t\tloader = gantt.ajax.parse(loader);\r\n\t\t\t}\r\n\r\n\t\t\tvar xml = gantt.ajax.xmltop(toptag, loader.xmlDoc);\r\n\t\t\tif (!xml || xml.tagName != toptag) {\r\n\t\t\t\txmlParseError(text);\r\n\t\t\t}\r\n\r\n\t\t\tvar skey = xml.getAttribute(\"dhx_security\");\r\n\t\t\tif (skey)\r\n\t\t\t\tgantt.security_key = skey;\r\n\r\n\t\t\treturn xml;\r\n\t\t},\r\n\t\tparse: function (text, loader) {\r\n\t\t\tloader = this._getXML(text, loader);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tvar evs = data.data = [];\r\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\r\n\r\n\t\t\tfor (var i = 0; i < xml.length; i++)\r\n\t\t\t\tevs[i] = this._xmlNodeToJSON(xml[i]);\r\n\r\n\t\t\tdata.collections = this._getCollections(loader);\r\n\t\t\treturn data;\r\n\t\t},\r\n\t\t_copyLink: function (obj) {\r\n\t\t\treturn \" \";\r\n\t\t},\r\n\t\t_copyObject: function (obj) {\r\n\t\t\treturn \" \";\r\n\t\t},\r\n\t\tserialize: function () {\r\n\t\t\tvar tasks = [];\r\n\t\t\tvar links = [];\r\n\r\n\t\t\tvar json = gantt.json.serialize();\r\n\t\t\tfor (var i = 0, len = json.data.length; i < len; i++) {\r\n\t\t\t\ttasks.push(this._copyObject(json.data[i]));\r\n\t\t\t}\r\n\t\t\tfor (var i = 0, len = json.links.length; i < len; i++) {\r\n\t\t\t\tlinks.push(this._copyLink(json.links[i]));\r\n\t\t\t}\r\n\t\t\treturn \"\" + tasks.join(\"\") + \"\" + links.join(\"\") + \" \";\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tgantt.oldxml = {\r\n\t\tparse: function (text, loader) {\r\n\t\t\tloader = gantt.xml._getXML(text, loader, \"projects\");\r\n\t\t\tvar data = {collections: {links: []}};\r\n\r\n\t\t\tvar evs = data.data = [];\r\n\t\t\tvar xml = gantt.ajax.xpath(\"//task\", loader);\r\n\r\n\t\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\t\tevs[i] = gantt.xml._xmlNodeToJSON(xml[i]);\r\n\t\t\t\tvar parent = xml[i].parentNode;\r\n\r\n\t\t\t\tif (parent.tagName == \"project\")\r\n\t\t\t\t\tevs[i].parent = \"project-\" + parent.getAttribute(\"id\");\r\n\t\t\t\telse\r\n\t\t\t\t\tevs[i].parent = parent.parentNode.getAttribute(\"id\");\r\n\t\t\t}\r\n\r\n\t\t\txml = gantt.ajax.xpath(\"//project\", loader);\r\n\t\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\t\tvar ev = gantt.xml._xmlNodeToJSON(xml[i], true);\r\n\t\t\t\tev.id = \"project-\" + ev.id;\r\n\t\t\t\tevs.push(ev);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar ev = evs[i];\r\n\t\t\t\tev.start_date = ev.startdate || ev.est;\r\n\t\t\t\tev.end_date = ev.enddate;\r\n\t\t\t\tev.text = ev.name;\r\n\t\t\t\tev.duration = ev.duration / 8;\r\n\t\t\t\tev.open = 1;\r\n\t\t\t\tif (!ev.duration && !ev.end_date) ev.duration = 1;\r\n\t\t\t\tif (ev.predecessortasks)\r\n\t\t\t\t\tdata.collections.links.push({\r\n\t\t\t\t\t\ttarget: ev.id,\r\n\t\t\t\t\t\tsource: ev.predecessortasks,\r\n\t\t\t\t\t\ttype: gantt.config.links.finish_to_start\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t},\r\n\t\tserialize: function () {\r\n\t\t\tgantt.message(\"Serialization to 'old XML' is not implemented\");\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.serverList = function (name, array) {\r\n\t\tif (array) {\r\n\t\t\tthis.serverList[name] = array.slice(0);\r\n\t\t} else if (!this.serverList[name]) {\r\n\t\t\tthis.serverList[name] = [];\r\n\t\t}\r\n\t\treturn this.serverList[name];\r\n\t};\r\n\r\n};","import * as utils from \"../../utils/utils\";\r\nimport * as helpers from \"../../utils/helpers\";\r\n\r\n\r\nfunction IsWorkTimeArgument(date, unit, task, id, calendar){\r\n\tthis.date = date;\r\n\tthis.unit = unit;\r\n\tthis.task = task;\r\n\tthis.id = id;\r\n\tthis.calendar = calendar;\r\n\treturn this;\r\n}\r\n\r\nfunction ClosestWorkTimeArgument(date, dir, unit, task, id, calendar){\r\n\tthis.date = date;\r\n\tthis.dir = dir;\r\n\tthis.unit = unit;\r\n\tthis.task = task;\r\n\tthis.id = id;\r\n\tthis.calendar = calendar;\r\n\treturn this;\r\n}\r\n\r\nfunction CalculateEndDateArgument(start_date, duration, unit, step, task, id, calendar){\r\n\tthis.start_date = start_date;\r\n\tthis.duration = duration;\r\n\tthis.unit = unit;\r\n\tthis.step = step;\r\n\tthis.task = task;\r\n\tthis.id = id;\r\n\tthis.calendar = calendar;\r\n\treturn this;\r\n}\r\n\r\nfunction GetDurationArgument(start, end, task, calendar) {\r\n\tthis.start_date = start;\r\n\tthis.end_date = end;\r\n\tthis.task = task;\r\n\tthis.calendar = calendar;\r\n\tthis.unit = null;\r\n\tthis.step = null;\r\n\treturn this;\r\n}\r\n\r\nvar calendarArgumentsHelper = function(gantt){\r\n\treturn {\r\n\t\tgetWorkHoursArguments: function () {\r\n\t\t\tvar config = arguments[0];\r\n\t\t\tif (helpers.isDate(config)) {\r\n\t\t\t\tconfig = {\r\n\t\t\t\t\tdate: config\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tconfig = utils.mixin({}, config);\r\n\t\t\t}\r\n\r\n\t\t\tif(!helpers.isValidDate(config.date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid date argument for getWorkHours method\");\r\n\t\t\t\tthrow new Error(\"Invalid date argument for getWorkHours method\");\r\n\t\t\t}\r\n\r\n\t\t\treturn config;\r\n\t\t},\r\n\t\tsetWorkTimeArguments: function () {\r\n\t\t\treturn arguments[0];\r\n\t\t},\r\n\t\tunsetWorkTimeArguments: function () {\r\n\t\t\treturn arguments[0];\r\n\t\t},\r\n\t\tisWorkTimeArguments: function () {\r\n\t\t\tvar config = arguments[0];\r\n\t\t\tif(config instanceof IsWorkTimeArgument){\r\n\t\t\t\treturn config;\r\n\t\t\t}\r\n\r\n\t\t\tvar processedConfig;\r\n\t\t\tif (!config.date) {\r\n\t\t\t\t//IsWorkTimeArgument(date, unit, task, id, calendar)\r\n\t\t\t\tprocessedConfig = new IsWorkTimeArgument(arguments[0], arguments[1], arguments[2], null, arguments[3]);\r\n\t\t\t} else {\r\n\t\t\t\tprocessedConfig = new IsWorkTimeArgument(config.date, config.unit, config.task, null, config.calendar);\r\n\t\t\t}\r\n\r\n\t\t\tprocessedConfig.unit = processedConfig.unit || gantt.config.duration_unit;\r\n\r\n\t\t\tif(!helpers.isValidDate(processedConfig.date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid date argument for isWorkTime method\");\r\n\t\t\t\tthrow new Error(\"Invalid date argument for isWorkTime method\");\r\n\t\t\t}\r\n\r\n\t\t\treturn processedConfig;\r\n\t\t},\r\n\t\tgetClosestWorkTimeArguments: function (arg) {\r\n\t\t\tvar config = arguments[0];\r\n\t\t\tif (config instanceof ClosestWorkTimeArgument)\r\n\t\t\t\treturn config;\r\n\r\n\t\t\tvar processedConfig;\r\n\t\t\tif (helpers.isDate(config)) {\r\n\t\t\t\tprocessedConfig = new ClosestWorkTimeArgument(config);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tprocessedConfig = new ClosestWorkTimeArgument(\r\n\t\t\t\t\tconfig.date,\r\n\t\t\t\t\tconfig.dir,\r\n\t\t\t\t\tconfig.unit,\r\n\t\t\t\t\tconfig.task,\r\n\t\t\t\t\tnull,//config.id,\r\n\t\t\t\t\tconfig.calendar\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(config.id){\r\n\t\t\t\tprocessedConfig.task = config;\r\n\t\t\t}\r\n\t\t\tprocessedConfig.dir = config.dir || 'any';\r\n\t\t\tprocessedConfig.unit = config.unit || gantt.config.duration_unit;\r\n\r\n\t\t\tif(!helpers.isValidDate(processedConfig.date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid date argument for getClosestWorkTime method\");\r\n\t\t\t\tthrow new Error(\"Invalid date argument for getClosestWorkTime method\");\r\n\t\t\t}\r\n\t\t\treturn processedConfig;\r\n\t\t},\r\n\r\n\t\t_getStartEndConfig: function (param) {\r\n\t\t\tvar argumentType = GetDurationArgument;\r\n\t\t\tvar config;\r\n\t\t\tif (param instanceof argumentType)\r\n\t\t\t\treturn param;\r\n\r\n\t\t\tif (helpers.isDate(param)) {\r\n\t\t\t\tconfig = new argumentType(arguments[0], arguments[1], arguments[2], arguments[3]);\r\n\t\t\t} else {\r\n\t\t\t\tconfig = new argumentType(param.start_date, param.end_date, param.task);\r\n\t\t\t\tif (param.id !== null && param.id !== undefined) {\r\n\t\t\t\t\tconfig.task = param;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconfig.unit = config.unit || gantt.config.duration_unit;\r\n\t\t\tconfig.step = config.step || gantt.config.duration_step;\r\n\t\t\tconfig.start_date = config.start_date || config.start || config.date;\r\n\r\n\t\t\tif(!helpers.isValidDate(config.start_date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid start_date argument for getDuration method\");\r\n\t\t\t\tthrow new Error(\"Invalid start_date argument for getDuration method\");\r\n\t\t\t}\r\n\r\n\t\t\tif(!helpers.isValidDate(config.end_date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid end_date argument for getDuration method\");\r\n\t\t\t\tthrow new Error(\"Invalid end_date argument for getDuration method\");\r\n\t\t\t}\r\n\r\n\t\t\treturn config;\r\n\t\t},\r\n\r\n\t\tgetDurationArguments: function (start, end, unit, step) {\r\n\t\t\treturn this._getStartEndConfig.apply(this, arguments);\r\n\t\t},\r\n\r\n\t\thasDurationArguments: function (start, end, unit, step) {\r\n\t\t\treturn this._getStartEndConfig.apply(this, arguments);\r\n\t\t},\r\n\r\n\t\tcalculateEndDateArguments: function (start, duration, unit, step) {\r\n\t\t\tvar config = arguments[0];\r\n\t\t\tif (config instanceof CalculateEndDateArgument)\r\n\t\t\t\treturn config;\r\n\r\n\t\t\tvar processedConfig;\r\n\t\t\t//CalculateEndDateArgument(start_date, duration, unit, step, task, id, calendar)\r\n\t\t\tif (helpers.isDate(config)) {\r\n\t\t\t\tprocessedConfig = new CalculateEndDateArgument(\r\n\t\t\t\t\targuments[0],\r\n\t\t\t\t\targuments[1],\r\n\t\t\t\t\targuments[2],\r\n\t\t\t\t\tundefined,\r\n\t\t\t\t\targuments[3],\r\n\t\t\t\t\tundefined,\r\n\t\t\t\t\targuments[4]\r\n\t\t\t\t);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tprocessedConfig = new CalculateEndDateArgument(\r\n\t\t\t\t\tconfig.start_date,\r\n\t\t\t\t\tconfig.duration,\r\n\t\t\t\t\tconfig.unit,\r\n\t\t\t\t\tconfig.step,\r\n\t\t\t\t\tconfig.task,\r\n\t\t\t\t\tnull,//config.id,\r\n\t\t\t\t\tconfig.calendar\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(config.id !== null && config.id !== undefined){\r\n\t\t\t\tprocessedConfig.task = config;\r\n\r\n\t\t\t\t// received a task object as an argument\r\n\t\t\t\t// ignore 'unit' and 'step' properties in this case, since it's likely a part of data model of a task\r\n\t\t\t\tprocessedConfig.unit = null;\r\n\t\t\t\tprocessedConfig.step = null;\r\n\t\t\t}\r\n\r\n\t\t\tprocessedConfig.unit = processedConfig.unit || gantt.config.duration_unit;\r\n\t\t\tprocessedConfig.step = processedConfig.step || gantt.config.duration_step;\r\n\r\n\t\t\tif(!helpers.isValidDate(processedConfig.start_date)){\r\n\t\t\t\tgantt.assert(false, \"Invalid start_date argument for calculateEndDate method\");\r\n\t\t\t\tthrow new Error(\"Invalid start_date argument for calculateEndDate method\");\r\n\t\t\t}\r\n\r\n\t\t\treturn processedConfig;\r\n\t\t}\r\n\t};\r\n};\r\n\r\n\r\nexport default calendarArgumentsHelper;","import * as utils from \"../../../utils/utils\";\r\nfunction WorkTimeCalendarMerger(){\r\n}\r\n\r\nWorkTimeCalendarMerger.prototype = {\r\n\r\n\r\n\t/**\r\n\t * convert hours array items into objects, e.g. [8, 12, 17, 18] -> [{start: 8, end: 12}, {start:17, end:18}]\r\n\t * @param {Array} hoursArray\r\n\t */\r\n\t_getIntervals: function(hoursArray){\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < hoursArray.length; i += 2){\r\n\r\n\t\t\tresult.push({\r\n\t\t\t\tstart: hoursArray[i],\r\n\t\t\t\tend: hoursArray[i+1]\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t/**\r\n\t * Convert ranges config into hours array\r\n\t * [{start: 8, end: 12}, {start:17, end:18}] --> [8, 12, 17, 18]\r\n\t * @param {*} intervalsArray\r\n\t */\r\n\t_toHoursArray: function(intervalsArray){\r\n\t\tvar result = [];\r\n\r\n\t\tfunction toFixed(value){\r\n\t\t\tvar str = String(value);\r\n\t\t\tif(str.length < 2){\r\n\t\t\t\tstr = \"0\" + str;\r\n\t\t\t}\r\n\t\t\treturn str;\r\n\t\t}\r\n\t\tfunction formatHHMM(secondsValue){\r\n\t\t\tvar hours = Math.floor(secondsValue / (60*60));\r\n\t\t\tvar minutePart = secondsValue - hours * 60 * 60;\r\n\r\n\t\t\tvar minutes = Math.floor(minutePart / (60));\r\n\t\t\treturn hours + \":\" + toFixed(minutes);\r\n\t\t}\r\n\t\tfor(var i = 0; i < intervalsArray.length; i++){\r\n\t\t\tresult.push(\r\n\t\t\t\tformatHHMM(intervalsArray[i].start) +\r\n\t\t\t\t\"-\" +\r\n\t\t\t\tformatHHMM(intervalsArray[i].end)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t/**\r\n\t * Build intersection of hour intervals. e.g.\r\n\t * first: [{start: 8, end: 12}, {start:13, end:18}]\r\n\t * second: [{start: 10, end: 15}]\r\n\t * result: [{start: 10, end: 12}, {start: 13, end: 15}]\r\n\t * @param {Array} first\r\n\t * @param {Array} second\r\n\t */\r\n\t_intersectHourRanges: function(first, second){\r\n\t\tvar result = [];\r\n\r\n\t\tvar baseArray = first.length > second.length ? first : second;\r\n\t\tvar overridesArray = first === baseArray ? second: first;\r\n\t\tbaseArray = baseArray.slice();\r\n\t\toverridesArray = overridesArray.slice();\r\n\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < baseArray.length; i++){\r\n\t\t\tvar base = baseArray[i];\r\n\r\n\t\t\tfor(var j = 0; j < overridesArray.length; j++){\r\n\t\t\t\tvar current = overridesArray[j];\r\n\t\t\t\tif(current.start < base.end && current.end > base.start){\r\n\t\t\t\t\tresult.push({\r\n\t\t\t\t\t\tstart: Math.max(base.start, current.start),\r\n\t\t\t\t\t\tend: Math.min(base.end, current.end)\r\n\t\t\t\t\t});\r\n\t\t\t\t\tif(base.end > current.end){\r\n\t\t\t\t\t\toverridesArray.splice(j, 1);\r\n\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t/**\r\n\t * Reduce the number of ranges in config when possible,\r\n\t * joins ranges that can be merged\r\n\t * parts: [{start: 8, end: 12}, {start:12, end:13}, {start: 15, end: 17}]\r\n\t * result: [{start: 8, end: 13}, {start: 15, end: 17}]\r\n\t * @param {Array} parts\r\n\t */\r\n\t_mergeAdjacentIntervals: function(parts){\r\n\t\tvar result = parts.slice();\r\n\t\tresult.sort(function(a, b){\r\n\t\t\treturn a.start - b.start;\r\n\t\t});\r\n\t\tvar base = result[0];\r\n\t\tfor(var i = 1; i < result.length; i++){\r\n\t\t\tvar current = result[i];\r\n\t\t\tif(current.start <= base.end){\r\n\t\t\t\tif(current.end > base.end){\r\n\t\t\t\t\tbase.end = current.end;\r\n\t\t\t\t}\r\n\t\t\t\tresult.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}else{\r\n\t\t\t\tbase = current;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t_mergeHoursConfig: function(firstHours, secondHours){\r\n\t\t//var firstIntervals = this._getIntervals(firstHours);\r\n\t\t//var secondIntervals = this._getIntervals(secondHours);\r\n\r\n\t\treturn this._mergeAdjacentIntervals(\r\n\t\t\tthis._intersectHourRanges(firstHours, secondHours)\r\n\t\t);\r\n\t},\r\n\r\n\tmerge: function(first, second){\r\n\t\tvar firstConfig = utils.copy(first.getConfig().parsed);\r\n\r\n\t\tvar secondConfig = utils.copy(second.getConfig().parsed);\r\n\r\n\t\tvar mergedSettings = {\r\n\t\t\thours: this._toHoursArray(this._mergeHoursConfig(firstConfig.hours, secondConfig.hours)),\r\n\t\t\tdates: {},\r\n\t\t\tcustomWeeks: {}\r\n\t\t};\r\n\r\n\t\tconst processCalendar = (config1, config2) => {\r\n\t\t\tfor (let i in config1.dates) {\r\n\t\t\t\tconst date1 = config1.dates[i];\r\n\t\r\n\t\t\t\t// dates contain day-of-week rules [0-7] and rules for specific dates (js date timestamps) - set false date rules initially\r\n\t\t\t\tif (+i > 1000) {\r\n\t\t\t\t\tmergedSettings.dates[i] = false;\r\n\t\t\t\t}\r\n\t\t\t\t// Check if the key exists in the fisrt calendar object\r\n\t\t\t\tfor (const key in config2.dates) {\r\n\t\t\t\t\tconst date2 = config2.dates[key];\r\n\t\r\n\t\t\t\t\t// Logical AND for week days\r\n\t\t\t\t\tif (key == i) {\r\n\t\t\t\t\t\tmergedSettings.dates[i] = !!(date1 && date2);\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t// Handle case where dates are arrays\r\n\t\t\t\t\tif (Array.isArray(date1)) {\r\n\t\t\t\t\t\tconst hours2 = Array.isArray(date2) ? date2 : config2.hours;\r\n\t\t\t\t\t\tmergedSettings.dates[i] = this._toHoursArray(this._mergeHoursConfig(date1, hours2));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\t// Check both calendars\r\n\t\tprocessCalendar(firstConfig, secondConfig);\r\n\t\tprocessCalendar(secondConfig, firstConfig);\r\n\r\n\t\t// transfer and overwrite custom week calendars\r\n\t\tif(firstConfig.customWeeks){\r\n\t\t\tfor(var i in firstConfig.customWeeks){\r\n\t\t\t\tmergedSettings.customWeeks[i] = firstConfig.customWeeks[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(secondConfig.customWeeks){\r\n\t\t\tfor(var i in secondConfig.customWeeks){\r\n\t\t\t\tmergedSettings.customWeeks[i] = secondConfig.customWeeks[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn mergedSettings;\r\n\r\n\t}\r\n\r\n};\r\n\r\nexport default WorkTimeCalendarMerger;","\r\n\r\nimport { IWorkUnitCache } from \"./workunit_cache_interface\";\r\n\r\nexport class WorkUnitsMapCache implements IWorkUnitCache {\r\n\tprivate _cache: Map>>;\r\n\tconstructor() {\r\n\t\tthis.clear();\r\n\t}\r\n\r\n\tgetItem(unit: string, timestamp: string, value: Date): number|boolean {\r\n\t\tif (this._cache.has(unit)) {\r\n\t\t\tconst unitCache = this._cache.get(unit);\r\n\r\n\t\t\tconst subCache = unitCache[value.getFullYear()];\r\n\t\t\tif (subCache && subCache.has(timestamp)) {\r\n\t\t\t\treturn subCache.get(timestamp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}\r\n\tsetItem(unit: string, timestamp: string, value: boolean, rawValue: Date): void {\r\n\t\tif (!unit || !timestamp) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst cache = this._cache;\r\n\t\tconst year = rawValue.getFullYear();\r\n\r\n\t\tlet unitCache;\r\n\t\tif (!cache.has(unit)) {\r\n\t\t\tunitCache = [];\r\n\t\t\tcache.set(unit, unitCache);\r\n\t\t} else {\r\n\t\t\tunitCache = cache.get(unit);\r\n\t\t}\r\n\r\n\t\tlet yearCache = unitCache[year];\r\n\t\tif(!yearCache){\r\n\t\t\tyearCache = unitCache[year] = new Map();\r\n\t\t}\r\n\r\n\r\n\t\tyearCache.set(timestamp, value);\r\n\t}\r\n\tclear(): void{\r\n\t\tthis._cache = new Map>>();\r\n\t}\r\n}","import { IWorkUnitCache } from \"./workunit_cache_interface\";\r\n\r\nexport class WorkUnitsObjectCache implements IWorkUnitCache {\r\n\tprivate _cache: any;\r\n\tconstructor() {\r\n\t\tthis.clear();\r\n\t}\r\n\r\n\tgetItem(unit: string, timestamp: string, value: Date): number|boolean {\r\n\t\tconst cache = this._cache;\r\n\t\tif (cache && cache[unit]) {\r\n\t\t\tconst units = cache[unit];\r\n\t\t\tif(units === undefined){\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\tconst subCache = units[value.getFullYear()];\r\n\t\t\tif (subCache && subCache[timestamp] !== undefined) {\r\n\t\t\t\treturn subCache[timestamp];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}\r\n\tsetItem(unit: string, timestamp: string, value: boolean, rawValue: Date): void {\r\n\t\tif (!unit || !timestamp) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst cache = this._cache;\r\n\r\n\t\tif (!cache) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!cache[unit]) {\r\n\t\t\tcache[unit] = [];\r\n\t\t}\r\n\t\tconst unitCache = cache[unit];\r\n\r\n\t\tconst year = rawValue.getFullYear();\r\n\t\tlet yearCache = unitCache[year];\r\n\t\tif(!yearCache){\r\n\t\t\tyearCache = unitCache[year] = {};\r\n\t\t}\r\n\t\tyearCache[timestamp] = value;\r\n\t}\r\n\tclear(): void{\r\n\t\tthis._cache = {};\r\n\t}\r\n}","\r\n\r\nexport class LargerUnitsCache {\r\n\tprivate _weekCache: Map;\r\n\tprivate _monthCache: Map;\r\n\tprivate _calendar: any;\r\n\tconstructor(calendar) {\r\n\t\tthis.clear();\r\n\t\tthis._calendar = calendar;\r\n\t}\r\n\r\n\tgetMinutesPerWeek = (weekStart: Date) => {\r\n\t\tconst key = weekStart.valueOf();\r\n\r\n\t\tif(this._weekCache.has(key)){\r\n\t\t\treturn this._weekCache.get(key);\r\n\t\t}\r\n\r\n\t\tconst calendar = this._calendar;\r\n\t\tconst gantt = this._calendar.$gantt;\r\n\r\n\t\tlet minutesPerWeek = 0;\r\n\t\tlet start = gantt.date.week_start(new Date(weekStart));\r\n\t\tfor(let i = 0; i < 7; i++){\r\n\t\t\tminutesPerWeek += calendar.getHoursPerDay(start) * 60;\r\n\t\t\tstart = gantt.date.add(start, 1, \"day\");\r\n\t\t}\r\n\r\n\t\tthis._weekCache.set(key, minutesPerWeek);\r\n\t\treturn minutesPerWeek;\r\n\t};\r\n\r\n\tgetMinutesPerMonth = (monthStart: Date) => {\r\n\t\tconst key = monthStart.valueOf();\r\n\r\n\t\tif(this._monthCache.has(key)){\r\n\t\t\treturn this._monthCache.get(key);\r\n\t\t}\r\n\r\n\t\tconst calendar = this._calendar;\r\n\t\tconst gantt = this._calendar.$gantt;\r\n\r\n\t\tlet minutesPerMonth = 0;\r\n\t\tlet start = gantt.date.week_start(new Date(monthStart));\r\n\t\tconst nextMonth = gantt.date.add(start, 1, \"month\").valueOf();\r\n\t\twhile(start.valueOf() < nextMonth){\r\n\t\t\tminutesPerMonth += calendar.getHoursPerDay(start) * 60;\r\n\t\t\tstart = gantt.date.add(start, 1, \"day\");\r\n\t\t}\r\n\r\n\t\tthis._monthCache.set(key, minutesPerMonth);\r\n\t\treturn minutesPerMonth;\r\n\t};\r\n\r\n\tclear = (): void => {\r\n\t\tthis._weekCache = new Map();\r\n\t\tthis._monthCache = new Map();\r\n\t};\r\n}","export class DateDurationCache {\r\n\tprivate _cache: any;\r\n\tconstructor() {\r\n\t\tthis.clear();\r\n\t}\r\n\r\n\t_getCacheObject(startDate: Date, unit: string, step:number){\r\n\t\tconst cache = this._cache;\r\n\t\tif (!cache[unit]) {\r\n\t\t\tcache[unit] = [];\r\n\t\t}\r\n\t\tlet unitCache = cache[unit];\r\n\t\tif(!unitCache) {\r\n\t\t\tunitCache = cache[unit] = {};\r\n\t\t}\r\n\r\n\t\tlet stepCache = unitCache[step];\r\n\t\tif(!stepCache) {\r\n\t\t\tstepCache = unitCache[step] = {};\r\n\t\t}\r\n\r\n\t\tconst year = startDate.getFullYear();\r\n\t\tlet yearCache = stepCache[year];\r\n\t\tif(!yearCache){\r\n\t\t\tyearCache = stepCache[year] = {durations: {}, endDates: {}};\r\n\t\t}\r\n\r\n\t\treturn yearCache;\r\n\t}\r\n\t_endDateCacheKey(startDate: number, duration: number){\r\n\t\treturn String(startDate) + \"-\" + String(duration);\r\n\t}\r\n\t_durationCacheKey(startDate: number, endDate: number){\r\n\t\treturn String(startDate) + \"-\" + String(endDate);\r\n\t}\r\n\tgetEndDate(startDate: Date, duration: number, unit: string, step: number, compute: () => Date): number|null{\r\n\t\tconst cache = this._getCacheObject(startDate, unit, step);\r\n\r\n\t\tconst startDateTimestamp = startDate.valueOf();\r\n\t\tconst key = this._endDateCacheKey(startDateTimestamp, duration);\r\n\t\tlet endDate;\r\n\t\tif(cache.endDates[key] === undefined){\r\n\t\t\tconst result = compute();\r\n\t\t\tconst resultTimestamp = result.valueOf();\r\n\t\t\tcache.endDates[key] = resultTimestamp;\r\n\t\t\tcache.durations[this._durationCacheKey(startDateTimestamp, resultTimestamp)] = duration;\r\n\t\t\tendDate = result;\r\n\t\t}else{\r\n\t\t\tendDate = new Date(cache.endDates[key]);\r\n\t\t}\r\n\r\n\t\treturn endDate;\r\n\t}\r\n\r\n\tgetDuration(startDate: Date, endDate: Date, unit: string, step: number, compute: () => number): number|null{\r\n\t\tconst cache = this._getCacheObject(startDate, unit, step);\r\n\r\n\t\tconst startDateTimestamp = startDate.valueOf();\r\n\t\tconst endDateTimestamp = endDate.valueOf();\r\n\t\tconst key = this._durationCacheKey(startDateTimestamp, endDateTimestamp);\r\n\t\tlet duration;\r\n\t\tif(cache.durations[key] === undefined){\r\n\t\t\tconst result = compute();\r\n\t\t\tcache.durations[key] = result.valueOf();\r\n\r\n\t\t\t// can't populate end date due to logic of end date calculation, current unit tests capture it\r\n\t\t\t// cache.endDates[this._endDateCacheKey(startDateTimestamp, result)] = endDateTimestamp;\r\n\t\t\tduration = result;\r\n\t\t}else{\r\n\t\t\tduration = cache.durations[key];\r\n\t\t}\r\n\r\n\t\treturn duration;\r\n\t}\r\n\r\n\tclear(): void{\r\n\t\tthis._cache = {};\r\n\t}\r\n}","import {createCacheObject} from \"./work_unit_cache\";\r\nimport {LargerUnitsCache} from \"./work_unit_cache\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport {DateDurationCache} from \"./work_unit_cache/date_duration_cache\";\r\n\r\nfunction CalendarWorkTimeStrategy(gantt, argumentsHelper) {\r\n\tthis.argumentsHelper = argumentsHelper;\r\n\tthis.$gantt = gantt;\r\n\tthis._workingUnitsCache = createCacheObject();\r\n\tthis._largeUnitsCache = new LargerUnitsCache(this);\r\n\tthis._dateDurationCache = new DateDurationCache();\r\n\tthis._worktime = null;\r\n\tthis._cached_timestamps = {};\r\n\tthis._cached_timestamps_count = 0;\r\n}\r\n\r\nCalendarWorkTimeStrategy.prototype = {\r\n\tunits: [\r\n\t\t\"year\",\r\n\t\t\"month\",\r\n\t\t\"week\",\r\n\t\t\"day\",\r\n\t\t\"hour\",\r\n\t\t\"minute\"\r\n\t],\r\n\t_clearCaches: function(){\r\n\t\tthis._workingUnitsCache.clear();\r\n\t\tthis._largeUnitsCache.clear();\r\n\t\tthis._dateDurationCache.clear();\r\n\t},\r\n\t// cache previously calculated worktime\r\n\t_getUnitOrder: function (unit) {\r\n\t\tfor (var i = 0, len = this.units.length; i < len; i++) {\r\n\t\t\tif (this.units[i] == unit)\r\n\t\t\t\treturn i;\r\n\t\t}\r\n\t},\r\n\t_resetTimestampCache: function(){\r\n\t\tthis._cached_timestamps = {};\r\n\t\tthis._cached_timestamps_count = 0;\r\n\t},\r\n\t_timestamp: function (settings) {\r\n\t\t// minor optimization, store calculated timestamps to reduce computations\r\n\t\t// reset cache when number of keys exceeds large number where key lookup may became more expensive than the recalculation\r\n\t\tif(this._cached_timestamps_count > 1000000){\r\n\t\t\tthis._resetTimestampCache();\r\n\t\t}\r\n\r\n\t\tvar timestamp = null;\r\n\t\tif ((settings.day || settings.day === 0)) {\r\n\t\t\ttimestamp = settings.day;\r\n\t\t} else if (settings.date) {\r\n\t\t\tvar value = String(settings.date.valueOf());\r\n\t\t\tif(this._cached_timestamps[value]){\r\n\t\t\t\ttimestamp = this._cached_timestamps[value];\r\n\t\t\t}else{\r\n\t\t\t\t// store worktime datestamp in utc so it could be recognized in different timezones (e.g. opened locally and sent to the export service in different timezone)\r\n\t\t\t\ttimestamp = Date.UTC(settings.date.getFullYear(), settings.date.getMonth(), settings.date.getDate());\r\n\t\t\t\tthis._cached_timestamps[value] = timestamp;\r\n\t\t\t\tthis._cached_timestamps_count++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn timestamp;\r\n\t},\r\n\t_checkIfWorkingUnit: function (date, unit) {\r\n\t\t// GS-596: If unit is larger than day or has a custom logic\r\n\t\tif (!this[\"_is_work_\" + unit]) {\r\n\t\t\tconst from = this.$gantt.date[`${unit}_start`](new Date(date));\r\n\t\t\tconst to = this.$gantt.date.add(from, 1, unit);\r\n\t\t\treturn this.hasDuration(from, to);\r\n\t\t}\r\n\t\treturn this[\"_is_work_\" + unit](date);\r\n\t},\r\n\t//checkings for particular time units\r\n\t//methods for month-year-week can be defined, otherwise always return 'true'\r\n\t_is_work_day: function (date) {\r\n\t\tvar val = this._getWorkHours(date);\r\n\r\n\t\tif (Array.isArray(val)) {\r\n\t\t\treturn val.length > 0;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\t_is_work_hour: function (date) {\r\n\t\tvar hours = this._getWorkHours(date); // [{start: 8*60*60, end: 12*60*60}, {start: 13*60*60, end: 17*60*60}]\r\n\t\tvar value = date.getHours();\r\n\t\tfor (var i = 0; i < hours.length; i++) {\r\n\t\t\tif(value >= hours[i].startHour && value < hours[i].endHour){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t_getTimeOfDayStamp: function(date, dayEnd) {\r\n\t\tvar hours = date.getHours();\r\n\t\tif(!date.getHours() && !date.getMinutes() && dayEnd){\r\n\t\t\thours = 24;\r\n\t\t}\r\n\t\treturn hours * 60 * 60 + date.getMinutes() * 60;\r\n\t},\r\n\r\n\t_is_work_minute: function(date){\r\n\t\tvar hours = this._getWorkHours(date); // [{start: 8*60*60, end: 12*60*60}, {start: 13*60*60, end: 17*60*60}]\r\n\t\tvar checkTime = this._getTimeOfDayStamp(date);\r\n\t\tfor (var i = 0; i < hours.length; i++) {\r\n\t\t\tif(checkTime >= hours[i].start && checkTime < hours[i].end){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t_nextDate: function (start, unit, step) {\r\n\t\treturn this.$gantt.date.add(start, step, unit);\r\n\t},\r\n\t_getWorkUnitsBetweenGeneric: function (from, to, unit, step) {\r\n\t\tvar dateHelper = this.$gantt.date;\r\n\t\tvar start = new Date(from),\r\n\t\t\tend = new Date(to);\r\n\t\tstep = step || 1;\r\n\t\tvar units = 0;\r\n\r\n\r\n\t\tvar next = null;\r\n\t\tvar stepStart,\r\n\t\t\tstepEnd;\r\n\r\n\t\t// calculating decimal durations, i.e. 2016-09-20 00:05:00 - 2016-09-20 01:00:00 ~ 0.95 instead of 1\r\n\t\t// and also 2016-09-20 00:00:00 - 2016-09-20 00:05:00 ~ 0.05 instead of 1\r\n\t\t// durations must be rounded later\r\n\t\tvar checkFirst = false;\r\n\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\r\n\t\tif (stepStart.valueOf() != start.valueOf()) {\r\n\t\t\tcheckFirst = true;\r\n\t\t}\r\n\t\tvar checkLast = false;\r\n\t\tstepEnd = dateHelper[unit + \"_start\"](new Date(to));\r\n\t\tif (stepEnd.valueOf() != to.valueOf()) {\r\n\t\t\tcheckLast = true;\r\n\t\t}\r\n\r\n\t\tvar isLastStep = false;\r\n\t\twhile (start.valueOf() < end.valueOf()) {\r\n\t\t\tnext = this._nextDate(start, unit, step);\r\n\t\t\tisLastStep = (next.valueOf() > end.valueOf());\r\n\r\n\t\t\tif (this._isWorkTime(start, unit)) {\r\n\t\t\t\tif (checkFirst || (checkLast && isLastStep)) {\r\n\t\t\t\t\tstepStart = dateHelper[unit + \"_start\"](new Date(start));\r\n\t\t\t\t\tstepEnd = dateHelper.add(stepStart, step, unit);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (checkFirst) {\r\n\t\t\t\t\tcheckFirst = false;\r\n\t\t\t\t\tnext = this._nextDate(stepStart, unit, step);\r\n\t\t\t\t\tunits += ((stepEnd.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\r\n\t\t\t\t} else if (checkLast && isLastStep) {\r\n\t\t\t\t\tcheckLast = false;\r\n\t\t\t\t\tunits += ((end.valueOf() - start.valueOf()) / (stepEnd.valueOf() - stepStart.valueOf()));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunits++;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvar unitOrder = this._getUnitOrder(unit);\r\n\t\t\t\tvar biggerTimeUnit = this.units[unitOrder - 1];\r\n\t\t\t\tif(biggerTimeUnit && !this._isWorkTime(start, biggerTimeUnit)){\r\n\t\t\t\t\tnext = this._getClosestWorkTimeFuture(start, biggerTimeUnit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tstart = next;\r\n\t\t}\r\n\t\treturn units;\r\n\t},\r\n\r\n\t_getMinutesPerHour: function (date) {\r\n\t\tvar hourStart = this._getTimeOfDayStamp(date);\r\n\t\tvar hourEnd = this._getTimeOfDayStamp(this._nextDate(date, \"hour\", 1));\r\n\t\tif (hourEnd === 0){\r\n\t\t\thourEnd = 24 * 60 * 60;\r\n\t\t}\r\n\t\tvar worktimes = this._getWorkHours(date);\r\n\r\n\t\tfor(var i = 0; i < worktimes.length; i++){\r\n\t\t\tvar interval = worktimes[i];\r\n\t\t\tif(hourStart >= interval.start && hourEnd <= interval.end){\r\n\t\t\t\treturn 60;// hour inside a working interval, all hour is a work hour\r\n\t\t\t}else if(hourStart < interval.end && hourEnd > interval.start){\r\n\t\t\t\t// hour is partially work time\r\n\t\t\t\tvar duration = Math.min(hourEnd, interval.end) - Math.max(hourStart, interval.start);\r\n\t\t\t\treturn duration / 60;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t},\r\n\r\n\t_getMinutesPerDay: function (date) {\r\n\t\tvar hours = this._getWorkHours(date);\r\n\t\tvar res = 0;\r\n\t\thours.forEach(function(interval){\r\n\t\t\tres+= interval.durationMinutes;\r\n\t\t});\r\n\t\treturn res;\r\n\t},\r\n\tgetHoursPerDay: function (date) {\r\n\t\tvar hours = this._getWorkHours(date);\r\n\t\tvar res = 0;\r\n\t\thours.forEach(function(interval){\r\n\t\t\tres+= interval.durationHours;\r\n\t\t});\r\n\t\treturn res;\r\n\t},\r\n\t_getWorkUnitsForRange: function (from, to, unit, step) {\r\n\t\tvar total = 0;\r\n\t\tvar start = new Date(from),\r\n\t\t\tend = new Date(to);\r\n\r\n\t\tvar getUnitsPerDay;\r\n\t\tif (unit == \"minute\") {\r\n\t\t\tgetUnitsPerDay = utils.bind(this._getMinutesPerDay, this);\r\n\t\t} else {\r\n\t\t\tgetUnitsPerDay = utils.bind(this.getHoursPerDay, this);\r\n\t\t}\r\n\r\n\t\twhile (start.valueOf() < end.valueOf()) {\r\n\t\t\tif(end - start > 1000*60*60*24*32 && start.getDate() === 0) {\r\n\t\t\t\tvar units = this._largeUnitsCache.getMinutesPerMonth(start);\r\n\t\t\t\tif(unit == \"hour\"){\r\n\t\t\t\t\tunits = units / 60;\r\n\t\t\t\t}\r\n\t\t\t\ttotal += units;\r\n\t\t\t\tstart = this.$gantt.date.add(start, 1, \"month\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}else if(end - start > 1000*60*60*24*16) {\r\n\t\t\t\tvar weekStart = this.$gantt.date.week_start(new Date(start));\r\n\t\t\t\tif(start.valueOf() === weekStart.valueOf()){\r\n\t\t\t\t\tvar units = this._largeUnitsCache.getMinutesPerWeek(start);\r\n\t\t\t\t\tif(unit == \"hour\"){\r\n\t\t\t\t\t\tunits = units / 60;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttotal += units;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, 7, \"day\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t//\tif (this._isWorkTime(start, \"day\")) {\r\n\t\t\ttotal += getUnitsPerDay(start);\r\n\t\t//\t}\r\n\t\t\tstart = this._nextDate(start, \"day\", 1);\r\n\t\t}\r\n\r\n\t\treturn total / step;\r\n\t},\r\n\r\n\r\n\t_getMinutesBetweenSingleDay: function(from, to){\r\n\t\tvar range = this._getIntervalTimestamp(from, to);\r\n\t\tvar worktimes = this._getWorkHours(from);\r\n\t\tvar result = 0;\r\n\r\n\t\tfor(var i = 0; i < worktimes.length; i++){\r\n\t\t\tvar interval = worktimes[i];\r\n\t\t\tif(range.end >= interval.start && range.start <= interval.end){\r\n\t\t\t\tvar minuteFrom = Math.max(interval.start, range.start);\r\n\t\t\t\tvar minuteTo = Math.min(interval.end, range.end);\r\n\r\n\t\t\t\tresult += (minuteTo - minuteFrom) / 60;\r\n\t\t\t\trange.start = minuteTo;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Math.floor(result);\r\n\t},\r\n\r\n\t_getMinutesBetween: function(from, to, unit, step){\r\n\t\tvar start = new Date(from),\r\n\t\t\tend = new Date(to);\r\n\t\tstep = step || 1;\r\n\r\n\t\tvar firstDayStart = new Date(start);\r\n\t\tvar firstDayEnd = this.$gantt.date.add(this.$gantt.date.day_start(new Date(start)), 1, \"day\");\r\n\r\n\t\tif (end.valueOf() <= firstDayEnd.valueOf()) {\r\n\t\t\treturn this._getMinutesBetweenSingleDay(from, to);\r\n\t\t} else {\r\n\r\n\t\t\tvar lastDayStart = this.$gantt.date.day_start(new Date(end));\r\n\t\t\tvar lastDayEnd = end;\r\n\r\n\t\t\tvar startPart = this._getMinutesBetweenSingleDay(firstDayStart, firstDayEnd);\r\n\t\t\tvar endPart = this._getMinutesBetweenSingleDay(lastDayStart, lastDayEnd);\r\n\r\n\t\t\tvar rangePart = this._getWorkUnitsForRange(firstDayEnd, lastDayStart, unit, step);\r\n\t\t\tvar total = startPart + rangePart + endPart;\r\n\r\n\t\t\treturn total;\r\n\t\t}\r\n\t},\r\n\t// optimized method for calculating work units duration of large time spans\r\n\t// implemented for hours and minutes units, bigger time units don't benefit from the optimization so much\r\n\t_getHoursBetween: function (from, to, unit, step) {\r\n\t\tvar start = new Date(from),\r\n\t\t\tend = new Date(to);\r\n\t\tstep = step || 1;\r\n\r\n\t\tvar firstDayStart = new Date(start);\r\n\t\tvar firstDayEnd = this.$gantt.date.add(this.$gantt.date.day_start(new Date(start)), 1, \"day\");\r\n\r\n\t\tif (end.valueOf() <= firstDayEnd.valueOf()) {\r\n\t\t\treturn Math.round(this._getMinutesBetweenSingleDay(from, to) / 60);\r\n\t\t} else {\r\n\r\n\t\t\tvar lastDayStart = this.$gantt.date.day_start(new Date(end));\r\n\t\t\tvar lastDayEnd = end;\r\n\r\n\t\t\tvar startPart = this._getMinutesBetweenSingleDay(firstDayStart, firstDayEnd, unit, step) / 60;\r\n\t\t\tvar endPart = this._getMinutesBetweenSingleDay(lastDayStart, lastDayEnd, unit, step) / 60;\r\n\r\n\t\t\tvar rangePart = this._getWorkUnitsForRange(firstDayEnd, lastDayStart, unit, step);\r\n\t\t\tvar total = startPart + rangePart + endPart;\r\n\r\n\t\t\treturn Math.round(total);\r\n\t\t}\r\n\t},\r\n\r\n\tgetConfig: function () {\r\n\t\treturn this._worktime;\r\n\t},\r\n\t_setConfig: function (settings) {\r\n\t\tthis._worktime = settings;\r\n\t\tthis._parseSettings();\r\n\t\tthis._clearCaches();\r\n\t},\r\n\t_parseSettings: function() {\r\n\t\tvar settings = this.getConfig();\r\n\t\tsettings.parsed = {\r\n\t\t\tdates: {},\r\n\t\t\thours: null,\r\n\t\t\thaveCustomWeeks: false,\r\n\t\t\tcustomWeeks: {},\r\n\t\t\tcustomWeeksRangeStart: null,\r\n\t\t\tcustomWeeksRangeEnd: null,\r\n\t\t\tcustomWeeksBoundaries: []\r\n\t\t};\r\n\r\n\t\tsettings.parsed.hours = this._parseHours(settings.hours);\r\n\t\tfor(var i in settings.dates){\r\n\t\t\tsettings.parsed.dates[i] = this._parseHours(settings.dates[i]);\r\n\t\t}\r\n\r\n\t\tif(settings.customWeeks) {\r\n\t\t\tvar minCustomRangeStart = null;\r\n\t\t\tvar maxCustomRangeEnd = null;\r\n\t\t\tfor(var i in settings.customWeeks){\r\n\t\t\t\tvar customTime = settings.customWeeks[i];\r\n\r\n\t\t\t\tif(customTime.from && customTime.to){\r\n\t\t\t\t\tvar rangeStart = customTime.from;\r\n\t\t\t\t\tvar rangeEnd = customTime.to;\r\n\t\t\t\t\tif(!minCustomRangeStart || minCustomRangeStart > rangeStart.valueOf()){\r\n\t\t\t\t\t\tminCustomRangeStart = rangeStart.valueOf();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!maxCustomRangeEnd || maxCustomRangeEnd < rangeEnd.valueOf()){\r\n\t\t\t\t\t\tmaxCustomRangeEnd = rangeEnd.valueOf();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsettings.parsed.customWeeksBoundaries.push({\r\n\t\t\t\t\t\tfrom: rangeStart.valueOf(),\r\n\t\t\t\t\t\tfromReadable: new Date(rangeStart),\r\n\t\t\t\t\t\tto: rangeEnd.valueOf(),\r\n\t\t\t\t\t\ttoReadable: new Date(rangeEnd),\r\n\t\t\t\t\t\tname: i\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tsettings.parsed.haveCustomWeeks = true;\r\n\t\t\t\t\tvar currentWeek = settings.parsed.customWeeks[i] = {\r\n\t\t\t\t\t\tfrom: customTime.from,\r\n\t\t\t\t\t\tto: customTime.to,\r\n\t\t\t\t\t\thours: this._parseHours(customTime.hours),\r\n\t\t\t\t\t\tdates: {}\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfor(var d in customTime.dates){\r\n\t\t\t\t\t\tcurrentWeek.dates[d] = this._parseHours(customTime.dates[d]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsettings.parsed.customWeeksRangeStart = minCustomRangeStart;\r\n\t\t\tsettings.parsed.customWeeksRangeEnd = maxCustomRangeEnd;\r\n\r\n\t\t}\r\n\t},\r\n\r\n\t_tryChangeCalendarSettings: function (payload) {\r\n\t\tvar backup = JSON.stringify(this.getConfig());\r\n\t\tpayload();\r\n\t\tif (!this.hasWorkTime()) {\r\n\t\t//\tthis.$gantt.assert(false, \"Invalid calendar settings, no worktime available\");\r\n\t\t\tthis._setConfig(JSON.parse(backup));\r\n\t\t\tthis._clearCaches();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t},\r\n\r\n\t_arraysEqual: function(a, b){\r\n\t\tif (a === b) return true;\r\n\t\tif (!a || !b) return false;\r\n\t\tif (a.length != b.length) return false;\r\n\r\n\t\tfor (var i = 0; i < a.length; ++i) {\r\n\t\t\tif (a[i] !== b[i]) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\r\n\t_compareSettings: function (mySettings, thatSettings) {\r\n\t\tif (!this._arraysEqual(mySettings.hours, thatSettings.hours)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar myDays = Object.keys(mySettings.dates);\r\n\t\tvar otherDates = Object.keys(thatSettings.dates);\r\n\t\tmyDays.sort();\r\n\t\totherDates.sort();\r\n\r\n\t\tif (!this._arraysEqual(myDays, otherDates)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < myDays.length; i++){\r\n\t\t\tvar timestamp = myDays[i];\r\n\t\t\tvar myHours = mySettings.dates[timestamp];\r\n\t\t\tvar otherHours = mySettings.dates[timestamp];\r\n\r\n\t\t\t// day settings not equal\r\n\t\t\tif(myHours !== otherHours &&\r\n\t\t\t\t// but still can be two arrays with the equivalent hour settings\r\n\t\t\t\t!(Array.isArray(myHours) && Array.isArray(otherHours) && this._arraysEqual(myHours, otherHours))\r\n\t\t\t\t){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\tequals: function (calendar) {\r\n\t\tif(!(calendar instanceof CalendarWorkTimeStrategy)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar mySettings = this.getConfig();\r\n\t\tvar thatSettings = calendar.getConfig();\r\n\r\n\t\tif(!this._compareSettings(mySettings, thatSettings)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(mySettings.parsed.haveCustomWeeks && thatSettings.parsed.haveCustomWeeks){\r\n\t\t\tif(mySettings.parsed.customWeeksBoundaries.length != thatSettings.parsed.customWeeksBoundaries.length){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i in mySettings.parsed.customWeeks){\r\n\t\t\t\tvar myWeek = mySettings.parsed.customWeeks[i];\r\n\t\t\t\tvar thatWeek = thatSettings.parsed.customWeeks[i];\r\n\t\t\t\tif(!thatWeek){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!this._compareSettings(myWeek, thatWeek)){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else if(mySettings.parse.haveCustomWeeks !== thatSettings.parsed.haveCustomWeeks){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\tgetWorkHours: function () {\r\n\t\tvar config = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\r\n\t\treturn this._getWorkHours(config.date, false);\r\n\t},\r\n\t_getWorkHours: function (date, parsed) {\r\n\t\tvar calendar = this.getConfig();\r\n\t\tif(parsed !== false){\r\n\t\t\tcalendar = calendar.parsed;\r\n\t\t}\r\n\r\n\t\tif(!date){\r\n\t\t\treturn calendar.hours;\r\n\t\t}\r\n\r\n\t\tvar dateValue = this._timestamp({date: date});\r\n\r\n\t\tif(calendar.haveCustomWeeks){\r\n\t\t\tif(calendar.customWeeksRangeStart <= dateValue && calendar.customWeeksRangeEnd > dateValue){\r\n\t\t\t\tfor(var i = 0; i < calendar.customWeeksBoundaries.length; i++){\r\n\t\t\t\t\tif(calendar.customWeeksBoundaries[i].from <= dateValue && calendar.customWeeksBoundaries[i].to > dateValue){\r\n\t\t\t\t\t\tcalendar = calendar.customWeeks[calendar.customWeeksBoundaries[i].name];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar hours = true;\r\n\r\n\t\tif (calendar.dates[dateValue] !== undefined) {\r\n\t\t\thours = calendar.dates[dateValue];//custom day\r\n\t\t} else if (calendar.dates[date.getDay()] !== undefined) {\r\n\t\t\thours = calendar.dates[date.getDay()];//week day\r\n\t\t}\r\n\t\tif (hours === true) {\r\n\t\t\treturn calendar.hours;\r\n\t\t} else if (hours) {\r\n\t\t\treturn hours;\r\n\t\t}\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_getIntervalTimestamp: function(from, to){\r\n\t\tvar res = {\r\n\t\t\tstart: 0,\r\n\t\t\tend: 0\r\n\t\t};\r\n\r\n\t\tres.start = from.getHours() * 60 * 60 + from.getMinutes() * 60 + from.getSeconds();\r\n\t\tvar endHours = to.getHours();\r\n\t\tif(!endHours && !to.getMinutes() && !to.getSeconds() && from.valueOf() < to.valueOf()){\r\n\t\t\tendHours = 24;\r\n\t\t}\r\n\t\tres.end = endHours * 60 * 60 + to.getMinutes() * 60 + to.getSeconds();\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_parseHours: function(hours) {\r\n\t\tif(Array.isArray(hours)){\r\n\r\n\t\t\tvar timestampRanges = [];// worktime as seconds range\r\n\t\t\thours.forEach(function(hour){\r\n\t\t\t\tif(typeof hour === \"number\"){\r\n\t\t\t\t\ttimestampRanges.push(hour*60*60);\r\n\t\t\t\t}else if(typeof hour === \"string\") {\r\n\t\t\t\t\t// \"12-13\", or \"12:00-13:00\", or \"12:00:00-13:00:00\"\r\n\t\t\t\t\thour.split(\"-\").map(function(time){\r\n\t\t\t\t\t\treturn time.trim();\r\n\t\t\t\t\t}).forEach(function(part){\r\n\t\t\t\t\t\tvar parsed = part.split(\":\").map(function(time){\r\n\t\t\t\t\t\t\treturn time.trim();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tvar value = parseInt(parsed[0]*60*60);\r\n\t\t\t\t\t\tif(parsed[1]){\r\n\t\t\t\t\t\t\tvalue += parseInt(parsed[1]*60);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(parsed[2]){\r\n\t\t\t\t\t\t\tvalue += parseInt(parsed[2]);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ttimestampRanges.push(value);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar timerangeConfig = [];\r\n\t\t\tfor (var i = 0; i < timestampRanges.length; i += 2) {\r\n\t\t\t\tvar start = timestampRanges[i];\r\n\t\t\t\tvar end = timestampRanges[i + 1];\r\n\t\t\t\tvar duration = end - start;\r\n\r\n\t\t\t\ttimerangeConfig.push({\r\n\t\t\t\t\tstart: start,\r\n\t\t\t\t\tend: end,\r\n\t\t\t\t\tstartHour: Math.floor(start / (60*60)),\r\n\t\t\t\t\tstartMinute: Math.floor(start / (60)),\r\n\t\t\t\t\tendHour: Math.ceil(end / (60*60)),\r\n\t\t\t\t\tendMinute: Math.ceil(end / (60)),\r\n\t\t\t\t\tdurationSeconds: duration,\r\n\t\t\t\t\tdurationMinutes: duration/60,\r\n\t\t\t\t\tdurationHours: duration/(60 * 60)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn timerangeConfig;\r\n\t\t} else {\r\n\t\t\treturn hours;\r\n\t\t}\r\n\t},\r\n\r\n\tsetWorkTime: function (settings) {\r\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\r\n\t\t\tvar hours = settings.hours !== undefined ? settings.hours : true;\r\n\t\t\tvar timestamp = this._timestamp(settings);\r\n\t\t\tvar calendarConfig = this.getConfig();\r\n\t\t\tif (timestamp !== null) {\r\n\t\t\t\tcalendarConfig.dates[timestamp] = hours;\r\n\t\t\t} else if(!settings.customWeeks) {\r\n\t\t\t\tcalendarConfig.hours = hours;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings.customWeeks){\r\n\t\t\t\tif(!calendarConfig.customWeeks){\r\n\t\t\t\t\tcalendarConfig.customWeeks = {};\r\n\t\t\t\t}\r\n\t\t\t\t// GS-1867. allow setWorkTime to exclude dates in the customWeeks range\r\n\t\t\t\tif (typeof settings.customWeeks == \"string\"){\r\n\t\t\t\t\tif (timestamp !== null) {\r\n\t\t\t\t\t\tcalendarConfig.customWeeks[settings.customWeeks].dates[timestamp] = hours;\r\n\t\t\t\t\t} else if(!settings.customWeeks) {\r\n\t\t\t\t\t\tcalendarConfig.customWeeks[settings.customWeeks].hours = hours;\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t} else if (typeof settings.customWeeks === \"object\"\r\n\t\t\t\t&& Function.prototype.toString.call(settings.customWeeks.constructor) === \"function Object() { [native code] }\"){\r\n\t\t\t\t\tfor(var i in settings.customWeeks){\r\n\t\t\t\t\t\tcalendarConfig.customWeeks[i] = settings.customWeeks[i];\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._parseSettings();\r\n\t\t\tthis._clearCaches();\r\n\t\t}, this));\r\n\t},\r\n\r\n\tunsetWorkTime: function (settings) {\r\n\t\treturn this._tryChangeCalendarSettings(utils.bind(function () {\r\n\t\t\tif (!settings) {\r\n\t\t\t\tthis.reset_calendar();\r\n\t\t\t} else {\r\n\r\n\t\t\t\tvar timestamp = this._timestamp(settings);\r\n\r\n\t\t\t\tif (timestamp !== null) {\r\n\t\t\t\t\tdelete this.getConfig().dates[timestamp];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Load updated settings and clear work units cache\r\n\t\t\tthis._parseSettings();\r\n\t\t\tthis._clearCaches();\r\n\t\t}, this));\r\n\t},\r\n\r\n\t_isWorkTime: function (date, unit) {\r\n\t\t// Check if this item has in the cache\r\n\r\n\t\tvar useCache = true;//unit === \"day\"; // use cache only for days. In case of hours/minutes cache size grows too large and the overhead exceeds the gains\r\n\t\tvar isWorkUnit = -1;\r\n\t\tvar dateKey = null;\r\n\r\n\t\tif(useCache){\r\n\t\t\t// use string keys\r\n\t\t\tdateKey = String(date.valueOf());\r\n\t\t\tisWorkUnit = this._workingUnitsCache.getItem(unit, dateKey, date);\r\n\t\t}\r\n\r\n\t\tif (isWorkUnit == -1) {\r\n\t\t\t// calculate if not cached\r\n\t\t\tisWorkUnit = this._checkIfWorkingUnit(date, unit);\r\n\t\t\tif(useCache){\r\n\t\t\t\tthis._workingUnitsCache.setItem(unit, dateKey, isWorkUnit, date);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn isWorkUnit;\r\n\t},\r\n\r\n\tisWorkTime: function () {\r\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply( this.argumentsHelper, arguments);\r\n\t\treturn this._isWorkTime(config.date, config.unit);\r\n\t},\r\n\r\n\tcalculateDuration: function () {\r\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\r\n\r\n\t\tif (!config.unit) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//return this._calculateDuration(config.start_date, config.end_date, config.unit, config.step);\r\n\r\n\t\tvar self = this;\r\n\t\treturn this._dateDurationCache.getDuration(config.start_date, config.end_date, config.unit, config.step, function(){ \r\n\t\t\treturn self._calculateDuration(config.start_date, config.end_date, config.unit, config.step);\r\n\t\t});\r\n\t},\r\n\r\n\t_calculateDuration: function (from, to, unit, step) {\r\n\t\tvar res = 0;\r\n\r\n\t\tvar sign = 1;\r\n\t\tif(from.valueOf() > to.valueOf()){\r\n\t\t\tvar tmp = to;\r\n\t\t\tto = from;\r\n\t\t\tfrom = tmp;\r\n\t\t\tsign = -1;\r\n\t\t}\r\n\r\n\t\tif (unit == \"hour\" && step == 1) {\r\n\t\t\tres = this._getHoursBetween(from, to, unit, step);\r\n\t\t} else if(unit == \"minute\" && step == 1){\r\n\t\t\t// quick calculation for minutes with 1 minute step\r\n\t\t\tres = this._getMinutesBetween(from, to, unit, step);\r\n\t\t} else {\r\n\t\t\tres = this._getWorkUnitsBetweenGeneric(from, to, unit, step);\r\n\t\t}\r\n\r\n\t\t// getWorkUnits.. returns decimal durations\r\n\t\treturn sign * Math.round(res);\r\n\t},\r\n\thasDuration: function () {\r\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply( this.argumentsHelper, arguments);\r\n\r\n\t\tvar from = config.start_date,\r\n\t\t\tto = config.end_date,\r\n\t\t\tunit = config.unit,\r\n\t\t\tstep = config.step;\r\n\r\n\t\tif (!unit) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tvar start = new Date(from),\r\n\t\t\tend = new Date(to);\r\n\t\tstep = step || 1;\r\n\r\n\t\twhile (start.valueOf() < end.valueOf()) {\r\n\t\t\tif (this._isWorkTime(start, unit))\r\n\t\t\t\treturn true;\r\n\t\t\tstart = this._nextDate(start, unit, step);\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tcalculateEndDate: function () {\r\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply( this.argumentsHelper, arguments);\r\n\r\n\t\tvar from = config.start_date,\r\n\t\t\tduration = config.duration,\r\n\t\t\tunit = config.unit,\r\n\t\t\tstep = config.step;\r\n\r\n\t\tif (!unit)\r\n\t\t\treturn false;\r\n\r\n\t\tvar mult = (config.duration >= 0) ? 1 : -1;\r\n\t\tduration = Math.abs(duration * 1);\r\n\t//\tvar endDate = this._calculateEndDate(from, duration, unit, step * mult);\r\n\t//\treturn endDate;\r\n\t\tvar self = this;\r\n\t\treturn this._dateDurationCache.getEndDate(from, duration, unit, step * mult, function(){ \r\n\t\t\treturn self._calculateEndDate(from, duration, unit, step * mult);\r\n\t\t} );\r\n\t},\r\n\r\n\t_calculateEndDate: function (from, duration, unit, step) {\r\n\t\tif (!unit)\r\n\t\t\treturn false;\r\n\r\n\t\tif (step == 1 && unit == \"minute\") {\r\n\t\t\treturn this._calculateMinuteEndDate(from, duration, step);\r\n\t\t} else if(step == -1 && unit == \"minute\") {\r\n\t\t\treturn this._subtractMinuteDate(from, duration, step);\r\n\t\t} else if (step == 1 && unit == \"hour\") {\r\n\t\t\treturn this._calculateHourEndDate(from, duration, step);\r\n\t\t} else {\r\n\t\t\tvar interval = this._addInterval(from, duration, unit, step, null);\r\n\t\t\treturn interval.end;\r\n\t\t}\r\n\t},\r\n\r\n\t_addInterval: function (start, duration, unit, step, stopAction) {\r\n\t\tvar added = 0;\r\n\t\tvar current = start;\r\n\t\tvar dstShift = false;\r\n\r\n\t\twhile (added < duration && !(stopAction && stopAction(current))) {\r\n\t\t\tvar next = this._nextDate(current, unit, step);\r\n\r\n\t\t\t// GS-1501. Correct hours after DST change\r\n\t\t\tif (unit == \"day\"){\r\n\t\t\t\tdstShift = dstShift || !current.getHours() && next.getHours();\r\n\r\n\t\t\t\tif (dstShift){\r\n\t\t\t\t\tnext.setHours(0);\r\n\t\t\t\t\tif (next.getHours()){\r\n\t\t\t\t\t// the day when the timezone is changed, try to correct hours next time\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdstShift = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar dateValue = new Date(next.valueOf() + 1);\r\n\t\t\tif (step > 0) {\r\n\t\t\t\tdateValue = new Date(next.valueOf() - 1);\r\n\t\t\t}\r\n\t\t\tvar workTimeCheck = this._isWorkTime(dateValue, unit);\r\n\r\n\t\t\tif (workTimeCheck && !dstShift) {\r\n\t\t\t\tadded++;\r\n\t\t\t}\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tend: current,\r\n\t\t\tstart: start,\r\n\t\t\tadded: added\r\n\t\t};\r\n\t},\r\n\r\n\t_addHoursUntilDayEnd: function(from, duration) {\r\n\t\tvar dayEnd = this.$gantt.date.add(this.$gantt.date.day_start(new Date(from)), 1, \"day\");\r\n\t\tvar added = 0;\r\n\t\tvar left = duration;\r\n\r\n\t\tvar range = this._getIntervalTimestamp(from, dayEnd);\r\n\t\tvar worktimes = this._getWorkHours(from);\r\n\t\tfor(var i = 0; i < worktimes.length && added < duration; i++){\r\n\t\t\tvar interval = worktimes[i];\r\n\t\t\tif(range.end >= interval.start && range.start <= interval.end){\r\n\t\t\t\tvar minuteFrom = Math.max(interval.start, range.start);\r\n\t\t\t\tvar minuteTo = Math.min(interval.end, range.end);\r\n\t\t\t\tvar rangeHours = (minuteTo - minuteFrom) / (60 * 60);\r\n\t\t\t\tif(rangeHours > left){\r\n\t\t\t\t\trangeHours = left;\r\n\t\t\t\t\tminuteTo = minuteFrom + (left * 60 * 60);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar addHours = Math.round((minuteTo - minuteFrom) / (60 * 60));\r\n\t\t\t\tadded += addHours;\r\n\t\t\t\tleft -= addHours;\r\n\t\t\t\trange.start = minuteTo;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar intervalEnd = dayEnd;\r\n\t\tif(added === duration){\r\n\t\t\tintervalEnd = new Date(from.getFullYear(), from.getMonth(), from.getDate(), 0, 0, range.start);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tadded: added,\r\n\t\t\tend: intervalEnd\r\n\t\t};\r\n\t},\r\n\r\n\t_calculateHourEndDate: function (from, duration, step) {\r\n\t\tvar start = new Date(from),\r\n\t\tadded = 0;\r\n\t\tstep = step || 1;\r\n\t\tduration = Math.abs(duration * 1);\r\n\r\n\t\tvar interval = this._addHoursUntilDayEnd(start, duration);\r\n\t\tadded = interval.added;\r\n\t\tstart = interval.end;\r\n\r\n\t\tvar durationLeft = duration - added;\r\n\r\n\t\tif (durationLeft) {\r\n\t\t\tvar current = start;\r\n\t\t\twhile (added < duration) {\r\n\t\t\t\tvar next = this._nextDate(current, \"day\", step);\r\n\t\t\t\t// reset to day start in case DST switch happens in the process\r\n\t\t\t\tnext.setHours(0);\r\n\t\t\t\tnext.setMinutes(0);\r\n\t\t\t\tnext.setSeconds(0);\r\n\r\n\t\t\t\tvar hoursPerDay = 0;\r\n\t\t\t\tif(step > 0){\r\n\t\t\t\t\thoursPerDay = this.getHoursPerDay(new Date(next.valueOf() - 1));\r\n\t\t\t\t}else{\r\n\t\t\t\t\thoursPerDay = this.getHoursPerDay(new Date(next.valueOf() + 1));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (added + hoursPerDay >= duration) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadded += hoursPerDay;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcurrent = next;\r\n\t\t\t}\r\n\t\t\tstart = current;\r\n\t\t}\r\n\r\n\t\tif (added < duration) {\r\n\t\t\tvar durationLeft = duration - added;\r\n\t\t\tinterval = this._addHoursUntilDayEnd(start, durationLeft);\r\n\t\t\tstart = interval.end;\r\n\t\t}\r\n\r\n\t\treturn start;\r\n\t},\r\n\r\n\t_addMinutesUntilHourEnd: function(from, duration){\r\n\t\tif(from.getMinutes() === 0) {\r\n\t\t\t// already at hour end\r\n\t\t\treturn {\r\n\t\t\t\tadded: 0,\r\n\t\t\t\tend: new Date(from)\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar hourEnd = this.$gantt.date.add(this.$gantt.date.hour_start(new Date(from)), 1, \"hour\");\r\n\t\tvar added = 0;\r\n\t\tvar left = duration;\r\n\r\n\t\tvar range = this._getIntervalTimestamp(from, hourEnd);\r\n\t\tvar worktimes = this._getWorkHours(from);\r\n\t\tfor(var i = 0; i < worktimes.length && added < duration; i++){\r\n\t\t\tvar interval = worktimes[i];\r\n\t\t\tif(range.end >= interval.start && range.start <= interval.end){\r\n\t\t\t\tvar minuteFrom = Math.max(interval.start, range.start);\r\n\t\t\t\tvar minuteTo = Math.min(interval.end, range.end);\r\n\t\t\t\tvar rangeMinutes = (minuteTo - minuteFrom) / 60;\r\n\t\t\t\tif(rangeMinutes > left){\r\n\t\t\t\t\trangeMinutes = left;\r\n\t\t\t\t\tminuteTo = minuteFrom + (left * 60);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// TODO: verify testcase https://dhtmlxsupport.teamwork.com/desk/tickets/9625700/messages\r\n\t\t\t\t/*if (rangeMinutes === 0) {\r\n\t\t\t\t\trangeMinutes = left;\r\n\t\t\t\t\tminuteTo = minuteFrom + (left * 60);\r\n\t\t\t\t}*/\r\n\r\n\t\t\t\tvar addMinutes = Math.round((minuteTo - minuteFrom) / 60);\r\n\t\t\t\tleft -= addMinutes;\r\n\t\t\t\tadded += addMinutes;\r\n\t\t\t\trange.start = minuteTo;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar intervalEnd = hourEnd;\r\n\t\tif(added === duration){\r\n\t\t\tintervalEnd = new Date(from.getFullYear(), from.getMonth(), from.getDate(), 0, 0, range.start);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tadded: added,\r\n\t\t\tend: intervalEnd\r\n\t\t};\r\n\t},\r\n\r\n\t_subtractMinutesUntilHourStart: function(from, duration){\r\n\t\tvar hourStart = this.$gantt.date.hour_start(new Date(from));\r\n\t\tvar added = 0;\r\n\t\tvar left = duration;\r\n\r\n\t\tvar hourStartTimestamp = hourStart.getHours() * 60 * 60 + hourStart.getMinutes() * 60 + hourStart.getSeconds();\r\n\t\tvar initialDateTimestamp = from.getHours() * 60 * 60 + from.getMinutes() * 60 + from.getSeconds();\r\n\r\n\t\tvar worktimes = this._getWorkHours(from);\r\n\t\tfor(var i = worktimes.length - 1; i >= 0 && added < duration; i--){\r\n\t\t\tvar interval = worktimes[i];\r\n\t\t\tif(initialDateTimestamp > interval.start && hourStartTimestamp <= interval.end){\r\n\t\t\t\tvar minuteFrom = Math.min(initialDateTimestamp, interval.end);\r\n\t\t\t\tvar minuteTo = Math.max(hourStartTimestamp, interval.start);\r\n\r\n\t\t\t//\tvar minuteFrom = Math.max(interval.start, currentHour.start);\r\n\t\t\t//\tvar minuteTo = Math.min(interval.end, currentHour.end);\r\n\t\t\t\tvar rangeMinutes = (minuteFrom - minuteTo) / 60;\r\n\t\t\t\tif(rangeMinutes > left){\r\n\t\t\t\t\trangeMinutes = left;\r\n\t\t\t\t\tminuteTo = minuteFrom - (left * 60);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// TODO: verify testcase https://dhtmlxsupport.teamwork.com/desk/tickets/9625700/messages\r\n\t\t\t\t/*if (rangeMinutes === 0) {\r\n\t\t\t\t\trangeMinutes = left;\r\n\t\t\t\t\tminuteTo = minuteFrom - (left * 60);\r\n\t\t\t\t}*/\r\n\r\n\t\t\t\tvar addMinutes = Math.abs(Math.round((minuteFrom - minuteTo) / 60));\r\n\t\t\t\tleft -= addMinutes;\r\n\t\t\t\tadded += addMinutes;\r\n\t\t\t\tinitialDateTimestamp = minuteTo;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar intervalEnd = hourStart;\r\n\t\tif(added === duration){\r\n\t\t\tintervalEnd = new Date(from.getFullYear(), from.getMonth(), from.getDate(), 0, 0, initialDateTimestamp);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tadded: added,\r\n\t\t\tend: intervalEnd\r\n\t\t};\r\n\t},\r\n\r\n\t_subtractMinuteDate: function (from, duration, step) {\r\n\t\tvar start = new Date(from),\r\n\t\t\tadded = 0;\r\n\t\tstep = step || -1;\r\n\t\tduration = Math.abs(duration * 1);\r\n\t\tduration = Math.round(duration);\r\n\r\n\t\tconst minutePrecision = this._isMinutePrecision(start);\r\n\r\n\t\tlet addedInterval = this._subtractMinutesUntilHourStart(start, duration);\r\n\t\tadded += addedInterval.added;\r\n\r\n\t\tstart = addedInterval.end;\r\n\r\n\t\tvar calculatedDay = 0;\r\n\t\tvar daySchedule = [];\r\n\t\tvar minutesInDay = 0;\r\n\r\n\t\twhile (added < duration) {\r\n\t\t\tvar dayStart = this.$gantt.date.day_start(new Date(start));\r\n\r\n\t\t\tvar iterateFromDayEnd = false;\r\n\t\t\tif(start.valueOf() === dayStart.valueOf()){\r\n\t\t\t\tdayStart = this.$gantt.date.add(dayStart, -1, \"day\");\r\n\t\t\t\titerateFromDayEnd = true;\r\n\t\t\t}\r\n\t\t\t//var dayStartTimestamp = this.$gantt.date.day_start(new Date(start)).valueOf();\r\n\t\t\tvar dayEnd = new Date(dayStart.getFullYear(), dayStart.getMonth(), dayStart.getDate(), 23, 59,59,999).valueOf();\r\n\r\n\t\t\tif(dayEnd !== calculatedDay){\r\n\t\t\t\tdaySchedule = this._getWorkHours(dayStart);\r\n\t\t\t\tminutesInDay = this._getMinutesPerDay(dayStart);\r\n\t\t\t\tcalculatedDay = dayEnd;\r\n\t\t\t}\r\n\r\n\t\t\tvar left = duration - added;\r\n\t\t\tvar timestamp = this._getTimeOfDayStamp(start, iterateFromDayEnd);\r\n\r\n\t\t\tif(!daySchedule.length || !minutesInDay){\r\n\t\t\t\tstart = this.$gantt.date.add(start, -1, \"day\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif(daySchedule[daySchedule.length - 1].end <= timestamp){\r\n\t\t\t\tif(left > minutesInDay){\r\n\t\t\t\t\tadded += minutesInDay;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, -1, \"day\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar isWorkHour = false;\r\n\t\t\tvar workInterval = null;\r\n\t\t\tvar prevInterval = null;\r\n\t\t\tfor(var i = daySchedule.length - 1; i >= 0; i--){\r\n\t\t\t\tif(daySchedule[i].start < timestamp - 1 && daySchedule[i].end >= timestamp - 1){\r\n\t\t\t\t\tisWorkHour = true;\r\n\t\t\t\t\tworkInterval = daySchedule[i];\r\n\t\t\t\t\tprevInterval = daySchedule[i-1];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(isWorkHour){\r\n\r\n\t\t\t\t// we're at the end of worktime interval and subtracting more than the duration of the interval\r\n\t\t\t\t// -> subtract the duration of the interval and move to the start of the interval (we're moving from end)\r\n\t\t\t\tif(timestamp === workInterval.end && left >= workInterval.durationMinutes){\r\n\t\t\t\t\tadded += workInterval.durationMinutes;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, -workInterval.durationMinutes, \"minute\");\r\n\t\t\t\t} // worktime is set in whole hours (no intervals like 9:15-10:00)\r\n\t\t\t\t// the amount we need to subtract lies inside the interval\r\n\t\t\t\telse if(!minutePrecision && left <= (timestamp/60 - workInterval.startMinute)){\r\n\t\t\t\t\tadded += left;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, -left, \"minute\");\r\n\t\t\t\t}else if (minutePrecision){\r\n\t\t\t\t\t// GS-2129. If the working time is set in minutes, we accumulate the working time in minutes from right to left\r\n\t\t\t\t\t\r\n\t\t\t\t\t// duration we need to subtract lies completely inside the work interval\r\n\t\t\t\t\tif(left <= (timestamp/60 - workInterval.startMinute)){\r\n\t\t\t\t\t\tadded += left;\r\n\t\t\t\t\t\tstart = this.$gantt.date.add(start, -left, \"minute\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\t// we need to go trough multiple work intervals to subtract needed time\r\n\t\t\t\t\t\tadded += (timestamp/60 - workInterval.startMinute);\r\n\t\t\t\t\t\tif(prevInterval){\r\n\t\t\t\t\t\t\tstart = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, prevInterval.end);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart = this.$gantt.date.day_start(start);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar minutesInHour = this._getMinutesPerHour(start);\r\n\t\t\t\t\tif(minutesInHour <= left){\r\n\t\t\t\t\t\tadded += minutesInHour;\r\n\t\t\t\t\t\tstart = this._nextDate(start, \"hour\", step);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\taddedInterval = this._subtractMinutesUntilHourStart(start, left);\r\n\t\t\t\t\t\tadded += addedInterval.added;\r\n\t\t\t\t\t\tstart = addedInterval.end;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(start.getHours() === 0 && start.getMinutes() === 0 && start.getSeconds() === 0){\r\n\t\t\t\t\tvar prev = this._getClosestWorkTimePast(start, \"hour\");\r\n\t\t\t\t\tif(prev.valueOf() === start.valueOf()){\r\n\t\t\t\t\t\tvar prev = this.$gantt.date.add(start, -1, \"day\");\r\n\t\t\t\t\t\tvar times = this._getWorkHours(prev);\r\n\t\t\t\t\t\tif(times.length){\r\n\t\t\t\t\t\t\tvar lastInterval = times[times.length - 1];\r\n\t\t\t\t\t\t\tprev.setSeconds(lastInterval.durationSeconds);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart = prev;\r\n\r\n\t\t\t\t} else{\r\n\t\t\t\t\tstart = this._getClosestWorkTimePast(new Date(start - 1), \"hour\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (added < duration) {\r\n\t\t\tvar durationLeft = duration - added;\r\n\t\t\taddedInterval = this._subtractMinutesUntilHourStart(start, durationLeft);\r\n\t\t\tadded += addedInterval.added;\r\n\t\t\tstart = addedInterval.end;\r\n\t\t}\r\n\r\n\t\treturn start;\r\n\t},\r\n\t_calculateMinuteEndDate: function (from, duration, step) {\r\n\t\tvar start = new Date(from),\r\n\t\t\tadded = 0;\r\n\t\tstep = step || 1;\r\n\t\tduration = Math.abs(duration * 1);\r\n\t\tduration = Math.round(duration);\r\n\r\n\t\tvar addedInterval = this._addMinutesUntilHourEnd(start, duration);\r\n\t\tadded += addedInterval.added;\r\n\r\n\t\tstart = addedInterval.end;\r\n\r\n\t\tvar calculatedDay = 0;\r\n\t\tvar daySchedule = [];\r\n\t\tvar minutesInDay = 0;\r\n\r\n\t\tvar minutePrecision = this._isMinutePrecision(start);\r\n\r\n\t\twhile (added < duration) {\r\n\t\t\tvar dayStart = this.$gantt.date.day_start(new Date(start)).valueOf();\r\n\t\t\tif(dayStart !== calculatedDay){\r\n\t\t\t\tdaySchedule = this._getWorkHours(start);\r\n\t\t\t\tminutesInDay = this._getMinutesPerDay(start);\r\n\t\t\t\tcalculatedDay = dayStart;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar left = duration - added;\r\n\t\t\tvar timestamp = this._getTimeOfDayStamp(start);\r\n\r\n\t\t\tif(!daySchedule.length || !minutesInDay){\r\n\t\t\t\tstart = this.$gantt.date.add(this.$gantt.date.day_start(start), 1, \"day\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif(daySchedule[0].start >= timestamp){\r\n\t\t\t\tif(left >= minutesInDay){\r\n\t\t\t\t\tadded += minutesInDay;\r\n\t\t\t\t\tif (left == minutesInDay) {\r\n\t\t\t\t\t\tstart = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, daySchedule[daySchedule.length - 1].end);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tstart = this.$gantt.date.add(start, 1, \"day\");\r\n\t\t\t\t\t\tstart = this.$gantt.date.day_start(start);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar isWorkHour = false;\r\n\t\t\tvar workInterval = null;\r\n\t\t\tfor(var i = 0; i < daySchedule.length; i++){\r\n\t\t\t\tif(daySchedule[i].start <= timestamp && daySchedule[i].end > timestamp){\r\n\t\t\t\t\tisWorkHour = true;\r\n\t\t\t\t\tworkInterval = daySchedule[i];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(isWorkHour){\r\n\r\n\t\t\t\tif(timestamp === workInterval.start && left >= workInterval.durationMinutes){\r\n\t\t\t\t\tadded += workInterval.durationMinutes;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, workInterval.durationMinutes, \"minute\");\r\n\t\t\t\t}else if(left <= (workInterval.endMinute - timestamp/60)){\r\n\t\t\t\t\tadded += left;\r\n\t\t\t\t\tstart = this.$gantt.date.add(start, left, \"minute\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar minutesInHour = this._getMinutesPerHour(start);\r\n\t\t\t\t\tif(minutesInHour <= left){\r\n\t\t\t\t\t\tadded += minutesInHour;\r\n\t\t\t\t\t\t// when the working time settings are set in minutes move to the next minutes\r\n\t\t\t\t\t\tif (minutePrecision) {\r\n\t\t\t\t\t\t\tstart = this.$gantt.date.add(start, minutesInHour, \"minute\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tstart = this._nextDate(start, \"hour\", step);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\taddedInterval = this._addMinutesUntilHourEnd(start, left);\r\n\t\t\t\t\t\tadded += addedInterval.added;\r\n\t\t\t\t\t\tstart = addedInterval.end;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstart = this._getClosestWorkTimeFuture(start, \"hour\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (added < duration) {\r\n\t\t\tvar durationLeft = duration - added;\r\n\t\t\taddedInterval = this._addMinutesUntilHourEnd(start, durationLeft);\r\n\t\t\tadded += addedInterval.added;\r\n\t\t\tstart = addedInterval.end;\r\n\t\t}\r\n\r\n\t\treturn start;\r\n\t},\r\n\r\n\tgetClosestWorkTime: function () {\r\n\t\tvar settings = this.argumentsHelper.getClosestWorkTimeArguments.apply( this.argumentsHelper, arguments);\r\n\t\treturn this._getClosestWorkTime(settings.date, settings.unit, settings.dir);\r\n\t},\r\n\r\n\t_getClosestWorkTime: function (inputDate, unit, direction) {\r\n\t\tvar result = new Date(inputDate);\r\n\r\n\t\tif (this._isWorkTime(result, unit)) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tresult = this.$gantt.date[unit + '_start'](result);\r\n\r\n\t\tif (direction == 'any' || !direction) {\r\n\t\t\tvar closestFuture = this._getClosestWorkTimeFuture(result, unit);\r\n\t\t\tvar closestPast = this._getClosestWorkTimePast(result, unit);\r\n\t\t\tif (Math.abs(closestFuture - inputDate) <= Math.abs(inputDate - closestPast)) {\r\n\t\t\t\tresult = closestFuture;\r\n\t\t\t} else {\r\n\t\t\t\tresult = closestPast;\r\n\t\t\t}\r\n\t\t} else if (direction == \"past\") {\r\n\t\t\tresult = this._getClosestWorkTimePast(result, unit);\r\n\t\t} else {\r\n\t\t\tresult = this._getClosestWorkTimeFuture(result, unit);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t_getClosestWorkTimeFuture: function (date, unit) {\r\n\t\treturn this._getClosestWorkTimeGeneric(date, unit, 1);\r\n\t},\r\n\r\n\t_getClosestWorkTimePast: function (date, unit) {\r\n\t\tvar result = this._getClosestWorkTimeGeneric(date, unit, -1);\r\n\t\t// should return the end of the closest work interval\r\n\t\treturn this.$gantt.date.add(result, 1, unit);\r\n\t},\r\n\r\n\t_findClosestTimeInDay: function(date, direction, worktimes) {\r\n\t\tvar start = new Date(date);\r\n\t\tvar resultDate = null;\r\n\t\tvar fromDayEnd = false;\r\n\t\tif(!this._getWorkHours(start).length){\r\n\t\t\tstart = this._getClosestWorkTime(start, \"day\", direction < 0 ? \"past\" : \"future\");\r\n\t\t\tif(direction < 0){\r\n\t\t\t\tstart = new Date(start.valueOf() - 1);\r\n\t\t\t\tfromDayEnd = true;\r\n\t\t\t}\r\n\t\t\tworktimes = this._getWorkHours(start);\r\n\t\t}\r\n\r\n\t\tvar value = this._getTimeOfDayStamp(start);\r\n\t\tif(fromDayEnd){\r\n\t\t\tvalue = this._getTimeOfDayStamp(new Date(start.valueOf() + 1), fromDayEnd);\r\n\t\t}\r\n\t\tif(direction > 0){\r\n\t\t\tfor(var i = 0; i < worktimes.length; i++){\r\n\t\t\t\tif(worktimes[i].start >= value){\r\n\t\t\t\t\tresultDate = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, worktimes[i].start);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(var i = worktimes.length - 1; i >= 0; i--){\r\n\t\t\t\tif(worktimes[i].end <= value){\r\n\t\t\t\t\tresultDate = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, worktimes[i].end);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else if(worktimes[i].end > value && worktimes[i].start <= value) {\r\n\t\t\t\t\tresultDate = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, value);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn resultDate;\r\n\t},\r\n\t_getClosestWorkMinute: function(date, unit, direction) {\r\n\t\tvar start = new Date(date);\r\n\t\tvar worktimes = this._getWorkHours(start);\r\n\t\tvar resultDate = this._findClosestTimeInDay(start, direction, worktimes);\r\n\t\tif(!resultDate){\r\n\t\t\tstart = this.calculateEndDate(start, direction, \"day\");\r\n\t\t\tif(direction > 0){\r\n\t\t\t\tstart = this.$gantt.date.day_start(start);\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.$gantt.date.day_start(start);\r\n\t\t\t\tstart = this.$gantt.date.add(start, 1, \"day\");\r\n\t\t\t\tstart = new Date(start.valueOf() - 1);\r\n\t\t\t}\r\n\t\t\tworktimes = this._getWorkHours(start);\r\n\t\t\tresultDate = this._findClosestTimeInDay(start, direction, worktimes);\r\n\t\t}\r\n\t\tif(direction < 0){\r\n\t\t\t// getClosestWorkTimePast adds one time unit to the result date after this\r\n\t\t\tresultDate = this.$gantt.date.add(resultDate, -1, unit);\r\n\t\t}\r\n\t\treturn resultDate;\r\n\t},\r\n\r\n\t_getClosestWorkTimeGeneric: function (date, unit, increment) {\r\n\t\tif(unit === \"hour\" || unit === \"minute\"){\r\n\t\t\treturn this._getClosestWorkMinute(date, unit, increment);\r\n\t\t}\r\n\r\n\t\tvar unitOrder = this._getUnitOrder(unit),\r\n\t\t\tbiggerTimeUnit = this.units[unitOrder - 1];\r\n\r\n\t\tvar result = date;\r\n\r\n\t\t// be extra sure we won't fall into infinite loop, 3k seems big enough\r\n\t\tvar maximumLoop = 3000,\r\n\t\t\tcount = 0;\r\n\r\n\t\twhile (!this._isWorkTime(result, unit)) {\r\n\t\t\tif (biggerTimeUnit && !this._isWorkTime(result, biggerTimeUnit)) {\r\n\t\t\t\t// if we look for closest work hour and detect a week-end - first find the closest work day,\r\n\t\t\t\t// and continue iterations after that\r\n\t\t\t\tif (increment > 0) {\r\n\t\t\t\t\tresult = this._getClosestWorkTimeFuture(result, biggerTimeUnit);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult = this._getClosestWorkTimePast(result, biggerTimeUnit);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._isWorkTime(result, unit)) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcount++;\r\n\t\t\tif (count > maximumLoop) {\r\n\t\t\t\tthis.$gantt.assert(false, \"Invalid working time check\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tvar tzOffset = result.getTimezoneOffset();\r\n\t\t\tresult = this.$gantt.date.add(result, increment, unit);\r\n\r\n\t\t\tresult = this.$gantt._correct_dst_change(result, tzOffset, increment, unit);\r\n\t\t\tif (this.$gantt.date[unit + '_start']) {\r\n\t\t\t\tresult = this.$gantt.date[unit + '_start'](result);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t/**\r\n\t * Check whether this calendar has working time. Calendar has working time only if there are regular working days of week\r\n\t *\r\n\t */\r\n\thasWorkTime: function () {\r\n\t\tvar worktime = this.getConfig();\r\n\t\tvar dates = worktime.dates;\r\n\r\n\t\tvar daysOfWeek = [0, 1, 2, 3, 4, 5, 6];\r\n\t\tvar exceptions = [];\r\n\t\tfor(var i in worktime.dates){\r\n\t\t\tif(Number(i) > 6){\r\n\t\t\t\texceptions.push(Number(i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar hasRegularHours = this._checkWorkHours(worktime.hours);\r\n\r\n\t\tvar result = false;\r\n\t\tdaysOfWeek.forEach((function(day){\r\n\t\t\tif(result){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar dayConfig = dates[day];\r\n\t\t\tif(dayConfig === true){\r\n\t\t\t\t// workday uses global hours\r\n\t\t\t\tresult = hasRegularHours;\r\n\t\t\t}else if(Array.isArray(dayConfig)){\r\n\t\t\t\t// workday uses custom hours\r\n\t\t\t\tresult = this._checkWorkHours(dayConfig);\r\n\t\t\t}\r\n\t\t}).bind(this));\r\n\r\n\t\treturn result;\r\n\r\n\t},\r\n\r\n\t_checkWorkHours: function(hoursArray) {\r\n\t\tif (hoursArray.length === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tvar result = false;\r\n\t\tfor (var i = 0; i < hoursArray.length; i += 2) {\r\n\t\t\tif (hoursArray[i] !== hoursArray[i + 1]) {\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\r\n\t_isMinutePrecision: function (date) {\r\n\t\tlet minutePrecision = false;\r\n\t\tthis._getWorkHours(date).forEach(function(interval){\r\n\t\t\tif (interval.startMinute % 60 || interval.endMinute % 60){\r\n\t\t\t\tminutePrecision = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn minutePrecision;\r\n\t}\r\n};\r\n\r\nexport default CalendarWorkTimeStrategy;","import { IWorkUnitCache } from \"./workunit_cache_interface\";\r\nimport { WorkUnitsMapCache } from \"./workunit_map_cache\";\r\nimport { WorkUnitsObjectCache } from \"./workunit_object_cache\";\r\nexport { LargerUnitsCache } from \"./larger_units_helper\";\r\n\r\nexport function createCacheObject(): IWorkUnitCache {\r\n\r\n\t// worktime hash is on the hot path,\r\n\t// Map seems to work faster than plain array, use it whenever possible\r\n\tif (typeof Map !== \"undefined\") {\r\n\t\treturn new WorkUnitsMapCache();\r\n\t} else {\r\n\t\treturn new WorkUnitsObjectCache();\r\n\t}\r\n}\r\n","export default {\r\n\tisLegacyResourceCalendarFormat: function(resourceCalendarsProperty){\r\n\t\t// modern format:\r\n\t\t//gantt.config.resource_calendars = {\r\n\t\t//\tresourceId: calendarId,\r\n\t\t//\tresourceId: calendarId,\r\n\t\t//\tresourceId: calendarId\r\n\t\t//\t};\r\n\t\t\r\n\t\t// legacy format:\r\n\t\t// gantt.config.resource_calendars = {\r\n\t\t//\t\"resourceProperty\": {\r\n\t\t//\t\tresourceId: calendarId,\r\n\t\t//\t\tresourceId: calendarId,\r\n\t\t//\t\tresourceId: calendarId\r\n\t\t//\t\t}\r\n\t\t//\t};\r\n\r\n\t\tif(!resourceCalendarsProperty){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(var i in resourceCalendarsProperty){\r\n\t\t\tif(resourceCalendarsProperty[i] && typeof resourceCalendarsProperty[i] === \"object\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tgetResourceProperty: function(config){\r\n\t\tvar resourceCalendarsConfig = config.resource_calendars;\r\n\t\tvar propertyName = config.resource_property;\r\n\t\tif(this.isLegacyResourceCalendarFormat(resourceCalendarsConfig)){\r\n\t\t\tfor(var i in config){\r\n\t\t\t\tpropertyName = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn propertyName;\r\n\t},\r\n\tgetCalendarIdFromLegacyConfig: function(task, config){\r\n\t\tif (config) {\r\n\t\t\tfor (var field in config) {\r\n\t\t\t\tvar resource = config[field];\r\n\t\t\t\tif (task[field]) {\r\n\t\t\t\t\tvar calendarId = resource[task[field]];\r\n\t\t\t\t\tif (calendarId) {\r\n\t\t\t\t\t\treturn calendarId;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n};","import * as utils from \"../../utils/utils\";\r\nimport createArgumentsHelper from \"./calendar_arguments_helper\";\r\nimport CalendarMergeHelper from \"./strategy/work_calendar_merger\";\r\nimport CalendarWorkTimeStrategy from \"./strategy/calendar_strategy\";\r\nimport legacyResourceCalendarConfig from \"./legacy_resource_config\";\r\nimport dynamicResourceCalendarsFactory from \"./dynamic_resource_calendars\";\r\n\r\nconst dynamicResourceCalendars = dynamicResourceCalendarsFactory();\r\n\r\nfunction CalendarManager (gantt){\r\n\tthis.$gantt = gantt;\r\n\tthis._calendars = {};\r\n\tthis._legacyConfig = undefined;\r\n\tthis.$gantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(this.$gantt.config.resource_calendars){\r\n\t\t\tthis._isLegacyConfig = legacyResourceCalendarConfig.isLegacyResourceCalendarFormat(this.$gantt.config.resource_calendars);\r\n\t\t}\r\n\t}.bind(this));\r\n\r\n\tthis.$gantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\t\tthis.createDefaultCalendars();\r\n\t}.bind(this));\r\n\tthis.$gantt.attachEvent(\"onBeforeGanttRender\", function(){\r\n\t\tthis.createDefaultCalendars();\r\n\t}.bind(this));\r\n}\r\n\r\nCalendarManager.prototype = {\r\n\t_calendars: {},\r\n\t_convertWorkTimeSettings: function (settings) {\r\n\t\tvar days = settings.days;\r\n\t\tif (days && !settings.dates) {\r\n\t\t\tsettings.dates = settings.dates || {};\r\n\t\t\tfor (var i = 0; i < days.length; i++) {\r\n\t\t\t\tsettings.dates[i] = days[i];\r\n\t\t\t\tif (!(days[i] instanceof Array)) {\r\n\t\t\t\t\tsettings.dates[i] = !!days[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete settings.days;\r\n\t\treturn settings;\r\n\t},\r\n\tmergeCalendars: function(){\r\n\t\tvar calendars = [];\r\n\t\tvar args = arguments;\r\n\t\tif(Array.isArray(args[0])){\r\n\t\t\tcalendars = args[0].slice();\r\n\t\t}else{\r\n\t\t\tfor(var i = 0; i < arguments.length; i++){\r\n\t\t\t\tcalendars.push(arguments[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar mergeHelper = new CalendarMergeHelper();\r\n\r\n\t\tvar result;\r\n\t\tcalendars.forEach(function(calendar){\r\n\t\t\tif(!result){\r\n\t\t\t\tresult = calendar;\r\n\t\t\t} else{\r\n\t\t\t\tresult = this._createCalendarFromConfig(mergeHelper.merge(result, calendar));\r\n\t\t\t}\r\n\r\n\t\t}.bind(this));\r\n\t\treturn this.createCalendar(result);\r\n\t},\r\n\r\n\t_createCalendarFromConfig: function(config){\r\n\t\tvar apiCore = new CalendarWorkTimeStrategy(this.$gantt, createArgumentsHelper(this.$gantt));\r\n\t\tapiCore.id = String(utils.uid());\r\n\r\n\t\tvar preparedConfig = this._convertWorkTimeSettings(config);\r\n\t\tif(preparedConfig.customWeeks){\r\n\t\t\tfor(var i in preparedConfig.customWeeks){\r\n\t\t\t\tpreparedConfig.customWeeks[i] = this._convertWorkTimeSettings(preparedConfig.customWeeks[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tapiCore._setConfig(preparedConfig);\r\n\r\n\t\treturn apiCore;\r\n\t},\r\n\r\n\tcreateCalendar: function (parentCalendar) {\r\n\t\tvar settings;\r\n\r\n\t\tif (!parentCalendar) {\r\n\t\t\tparentCalendar = {};\r\n\t\t}\r\n\r\n\t\tif (parentCalendar.getConfig){\r\n\t\t\tsettings = utils.copy(parentCalendar.getConfig());\r\n\t\t} else if (parentCalendar.worktime) {\r\n\t\t\tsettings = utils.copy(parentCalendar.worktime);\r\n\t\t} else {\r\n\t\t\tsettings = utils.copy(parentCalendar);\r\n\t\t}\r\n\r\n\t\tvar defaults = utils.copy(this.defaults.fulltime.worktime);\r\n\t\tutils.mixin(settings, defaults);\r\n\r\n\t\treturn this._createCalendarFromConfig(settings);\r\n\t},\r\n\r\n\tgetCalendar: function (id) {\r\n\t\tid = id || \"global\";\r\n\t\tvar calendar = this._calendars[id];\r\n\t\tif(!calendar){\r\n\t\t\tthis.createDefaultCalendars();\r\n\t\t\tcalendar = this._calendars[id];\r\n\t\t}\r\n\r\n\t\treturn calendar;\r\n\t},\r\n\r\n\tgetCalendars: function () {\r\n\t\tvar res = [];\r\n\t\tfor (var i in this._calendars) {\r\n\t\t\tres.push(this.getCalendar(i));\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_getOwnCalendar: function(task){\r\n\t\tvar config = this.$gantt.config;\r\n\t\tif (task[config.calendar_property]) {\r\n\t\t\treturn this.getCalendar(task[config.calendar_property]);\r\n\t\t}\r\n\r\n\t\tif (config.resource_calendars) {\r\n\t\t\tvar calendar;\r\n\t\t\tvar calendarId;\r\n\t\t\tvar resourceProperty;\r\n\t\t\tif(this._legacyConfig === false){\r\n\t\t\t\tresourceProperty = config.resource_property;\r\n\t\t\t}else{\r\n\t\t\t\tresourceProperty = legacyResourceCalendarConfig.getResourceProperty(config);\r\n\t\t\t}\r\n\t\t\tif(Array.isArray(task[resourceProperty])){\r\n\t\t\t\t// if multiple resources are attached to the task - merge their calendars\r\n\t\t\t\tif(config.dynamic_resource_calendars){\r\n\t\t\t\t\tcalendarId = dynamicResourceCalendars.getCalendarIdFromMultipleResources(task[resourceProperty], this);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this._legacyConfig === undefined){\r\n\t\t\t\t\tthis._legacyConfig = legacyResourceCalendarConfig.isLegacyResourceCalendarFormat(config.resource_calendars);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this._legacyConfig){\r\n\t\t\t\t\tvar calendarId = legacyResourceCalendarConfig.getCalendarIdFromLegacyConfig(task, config.resource_calendars);\r\n\t\t\t\t}else if(resourceProperty && task[resourceProperty] && config.resource_calendars[task[resourceProperty]]){\r\n\t\t\t\t\tvar calendar = this.getResourceCalendar(task[resourceProperty]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(calendarId){\r\n\t\t\t\tcalendar = this.getCalendar(calendarId);\r\n\t\t\t}\r\n\r\n\t\t\tif(calendar){\r\n\t\t\t\treturn calendar;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns calendar assigned to the specified resource.\r\n\t * Returns the global calendar if no custom calendar is associated with the resource.\r\n\t * @param {(string|number|Object)} resource - resource object or resource id\r\n\t * @returns {object} Calendar object\r\n\t */\r\n\tgetResourceCalendar: function(resource) {\r\n\t\tif (resource === null || resource === undefined) {\r\n\t\t\treturn this.getCalendar();\r\n\t\t}\r\n\r\n\t\tvar resourceId = null;\r\n\t\t// if task id is provided\r\n\t\tif((typeof resource === \"number\" || typeof resource === \"string\")){\r\n\t\t\tresourceId = resource;\r\n\t\t}else{\r\n\t\t\tresourceId = resource.id || resource.key;\r\n\t\t}\r\n\r\n\t\tvar config = this.$gantt.config;\r\n\t\tvar calendarsConfig = config.resource_calendars;\r\n\t\tvar calendarId = null;\r\n\t\tif (calendarsConfig) {\r\n\t\t\tif(this._legacyConfig === undefined){\r\n\t\t\t\tthis._legacyConfig = legacyResourceCalendarConfig.isLegacyResourceCalendarFormat(config.resource_calendars);\r\n\t\t\t}\r\n\r\n\t\t\tif(this._legacyConfig){\r\n\t\t\t\tfor(var field in calendarsConfig){\r\n\t\t\t\t\tif(calendarsConfig[field][resourceId]){\r\n\t\t\t\t\t\tcalendarId = calendarsConfig[field][resourceId];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvar calendarId = calendarsConfig[resourceId];\r\n\t\t\t}\r\n\r\n\t\t\tif(calendarId){\r\n\t\t\t\treturn this.getCalendar(calendarId);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn this.getCalendar();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the calendar assigned to a task.\r\n\t * - Returns a calendar assigned via task[gantt.config.calendar_property] if specified.\r\n\t * - Returns a calendar assigned to the task resource if specified.\r\n\t * - Returns the global calendar otherwise.\r\n\t * @param {(string|number|Object)} task - task object or task id\r\n\t * @returns {object} Calendar object\r\n\t */\r\n\tgetTaskCalendar: function (task) {\r\n\t\tvar gantt = this.$gantt;\r\n\t\tvar taskObject;\r\n\t\tif (task === null || task === undefined) {\r\n\t\t\treturn this.getCalendar();\r\n\t\t}\r\n\r\n\t\t// if task id is provided\r\n\t\tif((typeof task === \"number\" || typeof task === \"string\") && gantt.isTaskExists(task)){\r\n\t\t\ttaskObject = gantt.getTask(task);\r\n\t\t}else{\r\n\t\t\ttaskObject = task;\r\n\t\t}\r\n\r\n\t\tif(!taskObject){\r\n\t\t\treturn this.getCalendar();\r\n\t\t}\r\n\r\n\t\tvar calendar = this._getOwnCalendar(taskObject);\r\n\t\tvar groupMode = !!gantt.getState().group_mode;\r\n\r\n\t\tif (!calendar && gantt.config.inherit_calendar && gantt.isTaskExists(taskObject.parent)){\r\n\t\t\t// GS-1579 group mode overrides tree hierarchy, iterate using `.parent` property, instead of using eachParent iterator\r\n\t\t\tvar currentTask = taskObject;\r\n\t\t\twhile(gantt.isTaskExists(currentTask.parent)){\r\n\t\t\t\tcurrentTask = gantt.getTask(currentTask.parent);\r\n\t\t\t\tif(gantt.isSummaryTask(currentTask)){\r\n\t\t\t\t\tcalendar = this._getOwnCalendar(currentTask);\r\n\t\t\t\t\tif(calendar){\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(groupMode && !calendar){\r\n\t\t\t\t// if group mode and inherit_calendars is enabled - preserve previously applied parent calendar\r\n\t\t\t\t// we may need it when groupBy parses grouped data, old parent may be not loaded yet\r\n\t\t\t\tif(task.$effective_calendar){\r\n\t\t\t\t\tcalendar = this.getCalendar(task.$effective_calendar);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn calendar || this.getCalendar();\r\n\t},\r\n\r\n\taddCalendar: function(calendar) { // puts new calendar to Global Storage - gantt.calendarManager._calendars {}\r\n\t\tif (!(this.isCalendar(calendar))) {\r\n\t\t\tvar id = calendar.id;\r\n\t\t\tcalendar = this.createCalendar(calendar);\r\n\t\t\tcalendar.id = id;\r\n\t\t}\r\n\r\n\t\t// validate/check if empty calendar\r\n\t\tif (!calendar._tryChangeCalendarSettings(function () {\r\n\t\t\t})) {\r\n\r\n\t\t\tthis.$gantt.callEvent(\"onCalendarError\", [{message: \"Invalid calendar settings, no worktime available\"}, calendar]);\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tvar config = this.$gantt.config;\r\n\r\n\t\t\tcalendar.id = calendar.id || utils.uid();\r\n\t\t\tthis._calendars[calendar.id] = calendar;\r\n\t\t\tif (!config.worktimes)\r\n\t\t\t\tconfig.worktimes = {};\r\n\t\t\tconfig.worktimes[calendar.id] = calendar.getConfig();\r\n\t\t\treturn calendar.id;\r\n\t\t}\r\n\t},\r\n\r\n\tdeleteCalendar: function (calendar) {\r\n\t\tvar config = this.$gantt.config;\r\n\t\tif (!calendar) return false;\r\n\t\tif (this._calendars[calendar]) {\r\n\t\t\tdelete this._calendars[calendar];\r\n\t\t\tif (config.worktimes && config.worktimes[calendar])\r\n\t\t\t\tdelete config.worktimes[calendar];\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n\r\n\trestoreConfigCalendars: function (configs) {\r\n\t\tfor (var i in configs) {\r\n\t\t\tif (this._calendars[i])\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar settings = configs[i];\r\n\t\t\tvar calendar = this.createCalendar(settings);\r\n\t\t\tcalendar.id = i;\r\n\t\t\tthis.addCalendar(calendar);\r\n\t\t}\r\n\t},\r\n\r\n\tdefaults: {\r\n\t\tglobal: {\r\n\t\t\tid: \"global\",\r\n\t\t\tworktime: {\r\n\t\t\t\thours: [8, 12, 13, 17],\r\n\t\t\t\tdays: [0, 1, 1, 1, 1, 1, 0]\r\n\t\t\t}\r\n\t\t},\r\n\t\tfulltime: {\r\n\t\t\tid: \"fulltime\",\r\n\t\t\tworktime: {\r\n\t\t\t\thours: [0, 24],\r\n\t\t\t\tdays: [1, 1, 1, 1, 1, 1, 1]\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcreateDefaultCalendars: function () {\r\n\t\tvar config = this.$gantt.config;\r\n\t\tthis.restoreConfigCalendars(this.defaults);\r\n\t\tthis.restoreConfigCalendars(config.worktimes);\r\n\t},\r\n\r\n\tisCalendar: function(possibleCalendar) {\r\n\t\t// because we don't have any way to check without dependency to CalendarWorkTimeStrategy\r\n\t\tvar props = [\r\n\t\t\tpossibleCalendar.isWorkTime,\r\n\t\t\tpossibleCalendar.setWorkTime,\r\n\t\t\tpossibleCalendar.getWorkHours,\r\n\t\t\tpossibleCalendar.unsetWorkTime,\r\n\t\t\tpossibleCalendar.getClosestWorkTime,\r\n\t\t\tpossibleCalendar.calculateDuration,\r\n\t\t\tpossibleCalendar.hasDuration,\r\n\t\t\tpossibleCalendar.calculateEndDate\r\n\t\t];\r\n\t\treturn props.every(function(entry) {\r\n\t\t\treturn entry instanceof Function;\r\n\t\t});\r\n\t}\r\n};\r\n\r\nexport default CalendarManager;","export default function() {\r\n\tfunction getResourcesCalendarKey(resourceAssignments){\r\n\t\treturn resourceAssignments.map(function(res){\r\n\t\t\tif(res && res.resource_id){\r\n\t\t\t\treturn res.resource_id;\r\n\t\t\t} else {\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t}).sort().join(\"-\");\r\n\t}\r\n\r\n\tvar dynamicCalendars = {};\r\n\r\n\tfunction mergeResourceCalendars(resourceAssignments, manager){\r\n\t\treturn manager.mergeCalendars(resourceAssignments.map(function(assignment){\r\n\t\t\tvar resourceId = (assignment && assignment.resource_id) ? assignment.resource_id : assignment;\r\n\t\t\treturn manager.getResourceCalendar(resourceId);\r\n\t\t}));\r\n\t}\r\n\tfunction getCalendarIdFromMultipleResources(resourceAssignments, manager){\r\n\t\tvar key = getResourcesCalendarKey(resourceAssignments);\r\n\t\tif(!resourceAssignments.length){\r\n\t\t\treturn null;\r\n\t\t}else if(resourceAssignments.length === 1){\r\n\t\t\treturn manager.getResourceCalendar(key).id;\r\n\t\t}else if (dynamicCalendars[key]){\r\n\t\t\treturn dynamicCalendars[key].id;\r\n\t\t} else {\r\n\t\t\tvar tempCalendar = mergeResourceCalendars(resourceAssignments, manager);\r\n\r\n\t\t\tdynamicCalendars[key] = tempCalendar;\r\n\t\t\treturn manager.addCalendar(tempCalendar);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetCalendarIdFromMultipleResources: getCalendarIdFromMultipleResources\r\n\t};\r\n};","function CalendarDisabledTimeStrategy(gantt, argumentsHelper){\r\n\tthis.argumentsHelper = argumentsHelper;\r\n\tthis.$gantt = gantt;\r\n}\r\n\r\nCalendarDisabledTimeStrategy.prototype = {\r\n\tgetWorkHours: function () {\r\n\t\treturn [0, 24];\r\n\t},\r\n\tsetWorkTime: function () {\r\n\t\treturn true;\r\n\t},\r\n\tunsetWorkTime: function () {\r\n\t\treturn true;\r\n\t},\r\n\tisWorkTime: function () {\r\n\t\treturn true;\r\n\t},\r\n\tgetClosestWorkTime: function (config) {\r\n\t\tvar config = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\r\n\t\treturn config.date;\r\n\t},\r\n\r\n\tcalculateDuration: function () {\r\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\r\n\t\tvar from = config.start_date,\r\n\t\t\tto = config.end_date,\r\n\t\t\tunit = config.unit,\r\n\t\t\tstep = config.step;\r\n\r\n\t\treturn this._calculateDuration(from, to, unit, step);\r\n\t},\r\n\t_calculateDuration: function (start, end, unit, step) {\r\n\t\tvar dateHelper = this.$gantt.date;\r\n\t\tvar fixedUnits = {\r\n\t\t\t\"week\": 1000 * 60 * 60 * 24 * 7,\r\n\t\t\t\"day\": 1000 * 60 * 60 * 24,\r\n\t\t\t\"hour\": 1000 * 60 * 60,\r\n\t\t\t\"minute\": 1000 * 60\r\n\t\t};\r\n\r\n\t\tvar res = 0;\r\n\t\tif (fixedUnits[unit]) {\r\n\t\t\tres = Math.round((end - start) / (step * fixedUnits[unit]));\r\n\t\t} else {\r\n\t\t\tvar from = new Date(start),\r\n\t\t\t\tto = new Date(end);\r\n\t\t\twhile (from.valueOf() < to.valueOf()) {\r\n\t\t\t\tres += 1;\r\n\t\t\t\tfrom = dateHelper.add(from, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif (from.valueOf() != end.valueOf()) {\r\n\t\t\t\tres += (to - from) / (dateHelper.add(from, step, unit) - from);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Math.round(res);\r\n\t},\r\n\r\n\thasDuration: function () {\r\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\r\n\t\tvar from = config.start_date,\r\n\t\t\tto = config.end_date,\r\n\t\t\tunit = config.unit;\r\n\r\n\t\tif (!unit) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfrom = new Date(from);\r\n\t\tto = new Date(to);\r\n\r\n\t\treturn (from.valueOf() < to.valueOf());\r\n\t},\r\n\r\n\thasWorkTime: function() {\r\n\t\treturn true;\r\n\t},\r\n\r\n\tequals: function(calendar) {\r\n\t\tif(!(calendar instanceof CalendarDisabledTimeStrategy)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\tcalculateEndDate: function () {\r\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tvar start = config.start_date,\r\n\t\t\tduration = config.duration,\r\n\t\t\tunit = config.unit,\r\n\t\t\tstep = config.step;\r\n\r\n\t\treturn this.$gantt.date.add(start, step * duration, unit);\r\n\t}\r\n};\r\n\r\nexport default CalendarDisabledTimeStrategy;","import createArgumentsHelper from \"./calendar_arguments_helper\";\r\nimport NoWorkTimeCalendar from \"./strategy/no_work_time\";\r\n\r\nfunction TimeCalculator(calendarManager){\r\n\r\n\tthis.$gantt = calendarManager.$gantt;\r\n\tthis.argumentsHelper = createArgumentsHelper(this.$gantt);\r\n\tthis.calendarManager = calendarManager;\r\n\tthis.$disabledCalendar = new NoWorkTimeCalendar(this.$gantt, this.argumentsHelper);\r\n}\r\n\r\nTimeCalculator.prototype = {\r\n\t_getCalendar: function (config) {\r\n\t\tvar calendar;\r\n\t\tif (!this.$gantt.config.work_time) {\r\n\t\t\tcalendar = this.$disabledCalendar;\r\n\t\t} else {\r\n\t\t\tvar manager = this.calendarManager;\r\n\t\t\tif (config.task) {\r\n\t\t\t\tcalendar = manager.getTaskCalendar(config.task);\r\n\t\t\t} else if (config.id) {\r\n\t\t\t\tcalendar = manager.getTaskCalendar(config);\r\n\t\t\t} else if (config.calendar) {\r\n\t\t\t\tcalendar = config.calendar;\r\n\t\t\t}\r\n\t\t\tif (!calendar) {\r\n\t\t\t\tcalendar = manager.getTaskCalendar();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn calendar;\r\n\t},\r\n\r\n\tgetWorkHours: function (config) {\r\n\t\tconfig = this.argumentsHelper.getWorkHoursArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tvar calendar = this._getCalendar(config);\r\n\r\n\t\treturn calendar.getWorkHours(config.date);\r\n\t},\r\n\r\n\tsetWorkTime: function (config, calendar) {\r\n\t\tconfig = this.argumentsHelper.setWorkTimeArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tif (!calendar)\r\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\r\n\t\treturn calendar.setWorkTime(config);\r\n\t},\r\n\r\n\tunsetWorkTime: function (config, calendar) {\r\n\t\tconfig = this.argumentsHelper.unsetWorkTimeArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tif (!calendar)\r\n\t\t\tcalendar = this.calendarManager.getCalendar(); // Global\r\n\t\treturn calendar.unsetWorkTime(config);\r\n\t},\r\n\tisWorkTime: function (date, unit, task, calendar) {\r\n\t\tvar config = this.argumentsHelper.isWorkTimeArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tcalendar = this._getCalendar(config);\r\n\t\treturn calendar.isWorkTime(config);\r\n\t},\r\n\tgetClosestWorkTime: function (config) {\r\n\t\tconfig = this.argumentsHelper.getClosestWorkTimeArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tvar calendar = this._getCalendar(config);\r\n\r\n\t\treturn calendar.getClosestWorkTime(config);\r\n\t},\r\n\r\n\tcalculateDuration: function () { // start_date_date, end_date, task\r\n\t\tvar config = this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\r\n\t\tvar calendar = this._getCalendar(config);\r\n\t\treturn calendar.calculateDuration(config);\r\n\t},\r\n\thasDuration: function () {\r\n\t\tvar config = this.argumentsHelper.hasDurationArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tvar calendar = this._getCalendar(config);\r\n\r\n\t\treturn calendar.hasDuration(config);\r\n\t},\r\n\tcalculateEndDate: function (config) { // start_date, duration, unit, task\r\n\t\tvar config = this.argumentsHelper.calculateEndDateArguments.apply(this.argumentsHelper, arguments);\r\n\r\n\t\tvar calendar = this._getCalendar(config);\r\n\t\treturn calendar.calculateEndDate(config);\r\n\t}\r\n};\r\n\r\nexport default TimeCalculator;\r\n\r\n","// TODO: rework public api for date methods\r\nimport * as utils from \"../../utils/utils\";\r\n\r\nvar createWorkTimeFacade = function(calendarManager, timeCalculator){\r\n\treturn {\r\n\t\tgetWorkHours: function (date) {\r\n\t\t\treturn timeCalculator.getWorkHours(date);\r\n\t\t},\r\n\r\n\t\tsetWorkTime: function (config) {\r\n\t\t\treturn timeCalculator.setWorkTime(config);\r\n\t\t},\r\n\r\n\t\tunsetWorkTime: function (config) {\r\n\t\t\ttimeCalculator.unsetWorkTime(config);\r\n\t\t},\r\n\r\n\t\tisWorkTime: function (date, unit, task) {\r\n\t\t\treturn timeCalculator.isWorkTime(date, unit, task);\r\n\t\t},\r\n\r\n\t\tgetClosestWorkTime: function (config) {\r\n\t\t\treturn timeCalculator.getClosestWorkTime(config);\r\n\t\t},\r\n\r\n\t\tcalculateDuration: function (start_date, end_date, task) {\r\n\t\t\treturn timeCalculator.calculateDuration(start_date, end_date, task);\r\n\t\t},\r\n\t\t_hasDuration: function (start_date, end_date, task) {\r\n\t\t\treturn timeCalculator.hasDuration(start_date, end_date, task);\r\n\t\t},\r\n\r\n\t\tcalculateEndDate: function (start, duration, unit, task) {\r\n\t\t\treturn timeCalculator.calculateEndDate(start, duration, unit, task);\r\n\t\t},\r\n\r\n\t\tmergeCalendars: utils.bind(calendarManager.mergeCalendars, calendarManager),\r\n\t\tcreateCalendar: utils.bind(calendarManager.createCalendar, calendarManager),\r\n\t\taddCalendar: utils.bind(calendarManager.addCalendar, calendarManager),\r\n\t\tgetCalendar: utils.bind(calendarManager.getCalendar, calendarManager),\r\n\t\tgetCalendars: utils.bind(calendarManager.getCalendars, calendarManager),\r\n\t\tgetResourceCalendar: utils.bind(calendarManager.getResourceCalendar, calendarManager),\r\n\t\tgetTaskCalendar: utils.bind(calendarManager.getTaskCalendar, calendarManager),\r\n\t\tdeleteCalendar: utils.bind(calendarManager.deleteCalendar, calendarManager)\r\n\t};\r\n};\r\n\r\n\r\nexport default { create: createWorkTimeFacade };","import * as helpers from \"../utils/helpers\";\r\n\r\nexport default function(gantt) {\r\n\r\n\tgantt.isUnscheduledTask = function (task) {\r\n\t\tgantt.assert(task && task instanceof Object, \"Invalid argument task =\"+task+\" of gantt.isUnscheduledTask. Task object was expected\");\r\n\t\treturn (!!task.unscheduled || !task.start_date);\r\n\t};\r\n\r\n\tgantt._isAllowedUnscheduledTask = function (task) {\r\n\t\treturn !!(task.unscheduled && gantt.config.show_unscheduled);\r\n\t};\r\n\r\n\tgantt._isTaskInTimelineLimits = function(task) {\r\n\t\tvar taskStart = task.start_date ? task.start_date.valueOf() : null;\r\n\t\tvar taskEnd = task.end_date ? task.end_date.valueOf() : null;\r\n\t\treturn !!(taskStart && taskEnd && taskStart <= this._max_date.valueOf() && taskEnd >= this._min_date.valueOf());\r\n\t};\r\n\tgantt.isTaskVisible = function (id) {\r\n\t\tif (!this.isTaskExists(id)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar task = this.getTask(id);\r\n\t\tif (!(this._isAllowedUnscheduledTask(task) || this._isTaskInTimelineLimits(task))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn !!(this.getGlobalTaskIndex(id) >= 0);\r\n\t};\r\n\r\n\tgantt._getProjectEnd = function() {\r\n\t\tif(gantt.config.project_end){\r\n\t\t\treturn gantt.config.project_end;\r\n\t\t}else{\r\n\t\t\tvar tasks = gantt.getTaskByTime();\r\n\t\t\ttasks = tasks.sort(function (a, b) {\r\n\t\t\t\treturn +a.end_date > +b.end_date ? 1 : -1;\r\n\t\t\t});\r\n\t\t\treturn tasks.length ? tasks[tasks.length - 1].end_date : null;\r\n\t\t}\r\n\t};\r\n\tgantt._getProjectStart = function() {\r\n\t\tif (gantt.config.project_start) {\r\n\t\t\treturn gantt.config.project_start;\r\n\t\t}\r\n\r\n\t\t// use timeline start if project start is not specified\r\n\t\tif (gantt.config.start_date) {\r\n\t\t\treturn gantt.config.start_date;\r\n\t\t}\r\n\t\tif (gantt.getState().min_date) {\r\n\t\t\treturn gantt.getState().min_date;\r\n\t\t}\r\n\r\n\t\t// earliest task start if neither project start nor timeline are specified\r\n\t\tvar tasks = gantt.getTaskByTime();\r\n\t\ttasks = tasks.sort(function (a, b) {\r\n\t\t\treturn +a.start_date > +b.start_date ? 1 : -1;\r\n\t\t});\r\n\t\treturn tasks.length ? tasks[0].start_date : null;\r\n\t};\r\n\r\n\tvar getDefaultTaskDate = function (item, parent_id) {\r\n\t\tvar parentExists = parent_id && parent_id != gantt.config.root_id && gantt.isTaskExists(parent_id);\r\n\t\tvar parent = parentExists ? gantt.getTask(parent_id) : false,\r\n\t\t\tstartDate = null;\r\n\t\tif (parent) {\r\n\t\t\tif(gantt.config.schedule_from_end){\r\n\t\t\t\tstartDate = gantt.calculateEndDate({\r\n\t\t\t\t\tstart_date: parent.end_date,\r\n\t\t\t\t\tduration: - gantt.config.duration_step,\r\n\t\t\t\t\ttask:item\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tif(!parent.start_date){\r\n\t\t\t\t\treturn getDefaultTaskDate(parent, gantt.getParent(parent));\r\n\t\t\t\t}\r\n\t\t\t\tstartDate = parent.start_date;\r\n\t\t\t}\r\n\r\n\t\t} else if(gantt.config.schedule_from_end) {\r\n\t\t\tstartDate = gantt.calculateEndDate({\r\n\t\t\t\tstart_date: gantt._getProjectEnd(),\r\n\t\t\t\tduration: - gantt.config.duration_step,\r\n\t\t\t\ttask:item\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst first = gantt.getTaskByIndex(0);\r\n\t\t\tconst minDate = gantt.config.start_date || gantt.getState().min_date;\r\n\r\n\t\t\tif (first){\r\n\t\t\t\tif (first.start_date){\r\n\t\t\t\t\tstartDate = first.start_date;\r\n\t\t\t\t}\r\n\t\t\t\telse if (first.end_date){\r\n\t\t\t\t\tstartDate = gantt.calculateEndDate({\r\n\t\t\t\t\t\tstart_date: first.end_date,\r\n\t\t\t\t\t\tduration: -gantt.config.duration_step,\r\n\t\t\t\t\t\ttask:item\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstartDate = minDate;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tstartDate = minDate;\r\n\t\t\t}\r\n\t\t}\r\n\t\tgantt.assert(startDate, \"Invalid dates\");\r\n\t\treturn new Date(startDate);\r\n\t};\r\n\r\n\tgantt._set_default_task_timing = function (task) {\r\n\t\ttask.start_date = task.start_date || getDefaultTaskDate(task, gantt.getParent(task));\r\n\t\ttask.duration = task.duration || gantt.config.duration_step;\r\n\t\ttask.end_date = task.end_date || gantt.calculateEndDate(task);\r\n\t};\r\n\r\n\tgantt.createTask = function (item, parent, index) {\r\n\t\titem = item || {};\r\n\r\n\t\tif (!gantt.defined(item.id))\r\n\t\t\titem.id = gantt.uid();\r\n\r\n\t\tif (!item.start_date) {\r\n\t\t\titem.start_date = getDefaultTaskDate(item, parent);\r\n\t\t}\r\n\t\tif (item.text === undefined) {\r\n\t\t\titem.text = gantt.locale.labels.new_task;\r\n\t\t}\r\n\t\tif (item.duration === undefined) {\r\n\t\t\titem.duration = 1;\r\n\t\t}\r\n\r\n\t\tif (this.isTaskExists(parent)) {\r\n\t\t\tthis.setParent(item, parent, true);\r\n\t\t\tvar parentObj = this.getTask(parent);\r\n\t\t\tparentObj.$open = true;\r\n\t\t}\r\n\r\n\t\tif (!this.callEvent(\"onTaskCreated\", [item])) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif (this.config.details_on_create) {\r\n\t\t\t//GS-761: assert unique ID\r\n\t\t\tif (gantt.isTaskExists(item.id)){\r\n\t\t\t\tvar task = gantt.getTask(item.id);\r\n\t\t\t\tif (task.$index != item.$index) {\r\n\t\t\t\t\t// Someone may try to mistakenly add a task with the same ID, and most likely\r\n\t\t\t\t\t// use the string format for the dates. Gantt shouldn't break in this scenario\r\n\t\t\t\t\tif (item.start_date && typeof item.start_date === \"string\"){\r\n\t\t\t\t\t\titem.start_date = this.date.parseDate(item.start_date, \"parse_date\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (item.end_date && typeof item.end_date === \"string\"){\r\n\t\t\t\t\t\titem.end_date = this.date.parseDate(item.end_date, \"parse_date\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.$data.tasksStore.updateItem(item.id, item);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\titem.$new = true;\r\n\t\t\t\tthis.silent(function(){\r\n\t\t\t\t\tgantt.$data.tasksStore.addItem(item, index);\r\n\t\t\t\t});\t\r\n\t\t\t}\r\n\t\t\tthis.selectTask(item.id);\r\n\t\t\tthis.refreshData();\r\n\t\t\tthis.showLightbox(item.id);\r\n\t\t} else {\r\n\t\t\tif (this.addTask(item, parent, index)) {\r\n\t\t\t\tthis.showTask(item.id);\r\n\t\t\t\tthis.selectTask(item.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn item.id;\r\n\t};\r\n\r\n\tgantt._update_flags = function (oldid, newid) {\r\n\t\t// TODO: need a proper way to update all possible flags\r\n\t\tvar store = gantt.$data.tasksStore;\r\n\t\tif (oldid === undefined) {\r\n\t\t\tthis._lightbox_id = null;\r\n\r\n\t\t\tstore.silent(function(){\r\n\t\t\t\tstore.unselect();\r\n\t\t\t});\r\n\t\t\t// GS-1522. If we have multiselect, unselect all previously selected tasks\r\n\t\t\tif (this.getSelectedTasks) {\r\n\t\t\t\tthis._multiselect.reset();\r\n\t\t\t}\r\n\r\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag) {\r\n\t\t\t\tthis._tasks_dnd.drag.id = null;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._lightbox_id == oldid)\r\n\t\t\t\tthis._lightbox_id = newid;\r\n\r\n\t\t\t// TODO: probably can be removed\r\n\t\t\tif (store.getSelectedId() == oldid) {\r\n\t\t\t\tstore.silent(function(){\r\n\t\t\t\t\tstore.unselect(oldid);\r\n\t\t\t\t\tstore.select(newid);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (this._tasks_dnd && this._tasks_dnd.drag && this._tasks_dnd.drag.id == oldid) {\r\n\t\t\t\tthis._tasks_dnd.drag.id = newid;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tvar getTaskTimingMode = function (task, force) {\r\n\t\tvar task_type = gantt.getTaskType(task.type);\r\n\r\n\t\tvar state = {\r\n\t\t\ttype: task_type,\r\n\t\t\t$no_start: false,\r\n\t\t\t$no_end: false,\r\n\t\t\tscheduled_summary: false\r\n\t\t};\r\n\r\n\t\tif(task_type === gantt.config.types.project && task.auto_scheduling === false){\r\n\t\t\tstate.scheduled_summary = true;\r\n\t\t}\r\n\r\n\t\tif (!force && task_type == task.$rendered_type) {\r\n\t\t\tstate.$no_start = task.$no_start;\r\n\t\t\tstate.$no_end = task.$no_end;\r\n\t\t\treturn state;\r\n\t\t}\r\n\r\n\t\tif (task_type == gantt.config.types.project) {\r\n\t\t\t//project duration is always defined by children duration\r\n\t\t\tstate.$no_end = state.$no_start = true;\r\n\t\t} else if (task_type != gantt.config.types.milestone) {\r\n\t\t\t//tasks can have fixed duration, children duration(as projects), or one date fixed, and other defined by nested items\r\n\t\t\tstate.$no_end = !(task.end_date || task.duration);\r\n\t\t\tstate.$no_start = !task.start_date;\r\n\r\n\t\t\tif (gantt._isAllowedUnscheduledTask(task)) {\r\n\t\t\t\tstate.$no_end = state.$no_start = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn state;\r\n\t};\r\n\r\n\tgantt._init_task_timing = function (task) {\r\n\t\tvar task_mode = getTaskTimingMode(task, true);\r\n\r\n\t\tvar dirty = task.$rendered_type != task_mode.type;\r\n\r\n\t\tvar task_type = task_mode.type;\r\n\r\n\t\tif (dirty) {\r\n\t\t\ttask.$no_start = task_mode.$no_start;\r\n\t\t\ttask.$no_end = task_mode.$no_end;\r\n\t\t\ttask.$rendered_type = task_mode.type;\r\n\t\t}\r\n\r\n\t\tif (dirty && task_type != this.config.types.milestone) {\r\n\t\t\tif (task_type == this.config.types.project) {\r\n\t\t\t\t//project duration is always defined by children duration\r\n\t\t\t\tthis._set_default_task_timing(task);\r\n\t\t\t\ttask.$calculate_duration = false;// do not recalculate duration below\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (task_type == this.config.types.milestone) {\r\n\t\t\ttask.end_date = task.start_date;\r\n\t\t}\r\n\t\tif (task.start_date && task.end_date && task.$calculate_duration !== false) {\r\n\t\t\ttask.duration = this.calculateDuration(task);\r\n\t\t}\r\n\r\n\t\tif(!task.$calculate_duration){\r\n\t\t\ttask.$calculate_duration = true;\r\n\t\t}\r\n\r\n\t\tif (!task.end_date) {\r\n\t\t\ttask.end_date = task.start_date;\r\n\t\t}\r\n\r\n\t\ttask.duration = task.duration || 0;\r\n\t\t// GS-1145. We should let tasks to have 0 duration if user wants it\r\n\t\tif (this.config.min_duration === 0 && task.duration === 0){\r\n\t\t\ttask.$no_end = false;\r\n\t\t}\r\n\r\n\t\t// work calendar of task has changed\r\n\t\tvar effectiveCalendar = this.getTaskCalendar(task);\r\n\t\tif(task.$effective_calendar && task.$effective_calendar !== effectiveCalendar.id){\r\n\t\t\tupdateTaskTiming(task);\r\n\t\t\tif(this.config.inherit_calendar && this.isSummaryTask(task)){\r\n\t\t\t\tthis.eachTask(function(child){\r\n\t\t\t\t\tupdateTaskTiming(child);\r\n\t\t\t\t}, task.id);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttask.$effective_calendar = effectiveCalendar.id;\r\n\t};\r\n\r\n\tfunction updateTaskTiming(task) {\r\n\t\ttask.$effective_calendar = gantt.getTaskCalendar(task).id;\r\n\t\ttask.start_date = gantt.getClosestWorkTime({\r\n\t\t\tdir: \"future\",\r\n\t\t\tdate: task.start_date,\r\n\t\t\tunit: gantt.config.duration_unit,\r\n\t\t\ttask: task\r\n\t\t});\r\n\t\ttask.end_date = gantt.calculateEndDate(task);\r\n\t}\r\n\r\n\tgantt.isSummaryTask = function (task) {\r\n\t\tgantt.assert(task && task instanceof Object, \"Invalid argument task =\"+task+\" of gantt.isSummaryTask. Task object was expected\");\r\n\r\n\t\tvar mode = getTaskTimingMode(task);\r\n\r\n\t\treturn !!(mode.$no_end || mode.$no_start);\r\n\t};\r\n\r\n// downward calculation of project duration\r\n\tgantt.resetProjectDates = function (task) {\r\n\t\tvar taskMode = getTaskTimingMode(task);\r\n\t\tif (taskMode.$no_end || taskMode.$no_start) {\r\n\t\t\tvar info = getSubtaskInfo(task.id);\r\n\t\t\tassignProjectDates.call(this, task, taskMode, info.start_date, info.end_date);\r\n\t\t\ttask.$rollup = info.rollup;\r\n\t\t}\r\n\t};\r\n\r\n\tfunction assignProjectDates(task, taskTiming, from, to) {\r\n\r\n\t\tconst summaryDateFields = {\r\n\t\t\tstart: \"start_date\",\r\n\t\t\tend: \"end_date\"\r\n\t\t};\r\n\t\tconst manuallyScheduledSummaryDateFields = {\r\n\t\t\tstart: \"$auto_start_date\",\r\n\t\t\tend: \"$auto_end_date\"\r\n\t\t};\r\n\r\n\t\tlet dateFields;\r\n\t\tif(task.type === gantt.config.types.project && task.auto_scheduling === false){\r\n\t\t\tdateFields = manuallyScheduledSummaryDateFields;\r\n\t\t}else{\r\n\t\t\tdateFields = summaryDateFields;\r\n\t\t}\r\n\r\n\t\tif (taskTiming.$no_start) {\r\n\t\t\tif (from) {\r\n\t\t\t\ttask[dateFields.start] = new Date(from);\r\n\t\t\t} else {\r\n\t\t\t\ttask[dateFields.start] = getDefaultTaskDate(task, this.getParent(task));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (taskTiming.$no_end) {\r\n\t\t\tif (to) {\r\n\t\t\t\ttask[dateFields.end] = new Date(to);\r\n\t\t\t} else {\r\n\t\t\t\ttask[dateFields.end] = this.calculateEndDate({\r\n\t\t\t\t\tstart_date: task[dateFields.start],\r\n\t\t\t\t\tduration: this.config.duration_step,\r\n\t\t\t\t\ttask: task\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (taskTiming.$no_start || taskTiming.$no_end) {\r\n\t\t\tthis._init_task_timing(task);\r\n\t\t}\r\n\t}\r\n\r\n\tgantt.getSubtaskDuration = function (taskId) {\r\n\t\tvar res = 0,\r\n\t\t\troot = taskId !== undefined ? taskId : gantt.config.root_id;\r\n\r\n\t\tthis.eachTask(function (child) {\r\n\t\t\tif (this.getTaskType(child.type) == gantt.config.types.project || this.isUnscheduledTask(child))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tres += child.duration;\r\n\t\t}, root);\r\n\r\n\t\treturn res;\r\n\t};\r\n\r\n\tfunction getSubtaskInfo (taskId){\r\n\t\tvar min = null,\r\n\t\t\tmax = null,\r\n\t\t\troot = taskId !== undefined ? taskId : gantt.config.root_id,\r\n\t\t\trollup = [];\r\n\r\n\t\tgantt.eachTask(function (child) {\r\n\t\t\tconst isScheduledSummary = (gantt.getTaskType(child.type) == gantt.config.types.project && (child.auto_scheduling === false));\r\n\t\t\tif ((gantt.getTaskType(child.type) == gantt.config.types.project && !isScheduledSummary) || gantt.isUnscheduledTask(child))\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\tif(child.rollup){\r\n\t\t\t\trollup.push(child.id);\r\n\t\t\t}\r\n\r\n\t\t\tif ((child.start_date && (!child.$no_start || isScheduledSummary)) && (!min || min > child.start_date.valueOf()))\r\n\t\t\t\tmin = child.start_date.valueOf();\r\n\t\t\tif ((child.end_date && (!child.$no_end || isScheduledSummary)) && (!max || max < child.end_date.valueOf()))\r\n\t\t\t\tmax = child.end_date.valueOf();\r\n\t\t}, root);\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: min ? new Date(min) : null,\r\n\t\t\tend_date: max ? new Date(max) : null,\r\n\t\t\trollup: rollup\r\n\t\t};\r\n\t}\r\n\r\n\tgantt.getSubtaskDates = function (task_id) {\r\n\t\tvar info = getSubtaskInfo(task_id);\r\n\t\treturn {\r\n\t\t\tstart_date: info.start_date,\r\n\t\t\tend_date: info.end_date\r\n\t\t};\r\n\t};\r\n\r\n\r\n// upward calculation of project duration\r\n\tgantt._update_parents = function (taskId, silent, updateAll) {\r\n\t\tif (!taskId) return;\r\n\r\n\t\tvar task = this.getTask(taskId);\r\n\t\tif(task.rollup){\r\n\t\t\tupdateAll = true;\r\n\t\t}\r\n\t\tvar pid = this.getParent(task);\r\n\r\n\t\tvar taskTiming = getTaskTimingMode(task);\r\n\r\n\t\tvar has_changed = true;\r\n\t\t// GS-761 the dates check is necessary for adding empty tasks: gantt.addTask({id:\"2\"})\r\n\t\tif (updateAll || (task.start_date && task.end_date && (taskTiming.$no_start || taskTiming.$no_end))) {\r\n\r\n\t\t\tconst startDateField = task.$auto_start_date ? \"$auto_start_date\" : \"start_date\";\r\n\t\t\tconst endDateField = task.$auto_end_date ? \"$auto_end_date\" : \"end_date\";\r\n\r\n\t\t\tvar oldStart = task[startDateField].valueOf(),\r\n\t\t\t\toldEnd = task[endDateField].valueOf();\r\n\r\n\t\t\tgantt.resetProjectDates(task);\r\n\r\n\t\t\t// not refresh parent projects if dates hasn't changed\r\n\t\t\tif (!updateAll && oldStart == task[startDateField].valueOf() && oldEnd == task[endDateField].valueOf()) {\r\n\t\t\t\thas_changed = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (has_changed && !silent) {\r\n\t\t\t\tthis.refreshTask(task.id, true);\r\n\t\t\t}\r\n\r\n\t\t\tif(taskTiming.scheduled_summary){\r\n\t\t\t\thas_changed = true;//recalculate upwards from scheduled summaries\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif (has_changed && pid && this.isTaskExists(pid)) {\r\n\t\t\tthis._update_parents(pid, silent, updateAll);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.roundDate = function (config) {\r\n\t\tvar scale = gantt.getScale();\r\n\r\n\t\tif (helpers.isDate(config)) {\r\n\t\t\tconfig = {\r\n\t\t\t\tdate: config,\r\n\t\t\t\tunit: scale ? scale.unit : gantt.config.duration_unit,\r\n\t\t\t\tstep: scale ? scale.step : gantt.config.duration_step\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar date = config.date,\r\n\t\t\tsteps = config.step,\r\n\t\t\tunit = config.unit;\r\n\r\n\t\tif(!scale){\r\n\t\t\treturn date;\r\n\t\t}\r\n\r\n\t\tvar upper, lower, colIndex;\r\n\t\tif (unit == scale.unit && steps == scale.step &&\r\n\t\t\t+date >= +scale.min_date && +date <= +scale.max_date) {\r\n\t\t\t//find date in time scale config\r\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\r\n\r\n\t\t\tif (!scale.trace_x[colIndex]) {\r\n\t\t\t\tcolIndex -= 1;// end of time scale\r\n\t\t\t\tif(scale.rtl){\r\n\t\t\t\t\tcolIndex = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlower = new Date(scale.trace_x[colIndex]);\r\n\t\t\tupper = gantt.date.add(lower, steps, unit);\r\n\t\t} else {\r\n\t\t\tcolIndex = Math.floor(gantt.columnIndexByDate(date));\r\n\r\n\t\t\tupper = gantt.date[unit + \"_start\"](new Date(scale.min_date));\r\n\t\t\tif (scale.trace_x[colIndex]) {\r\n\t\t\t\tupper = gantt.date[unit + \"_start\"](scale.trace_x[colIndex]);// end of time scale\r\n\t\t\t}\r\n\r\n\t\t\twhile (+upper < +date) {\r\n\t\t\t\tupper = gantt.date[unit + \"_start\"](gantt.date.add(upper, steps, unit));\r\n\r\n\t\t\t\tvar tzOffset = upper.getTimezoneOffset();\r\n\r\n\t\t\t\tupper = gantt._correct_dst_change(upper, tzOffset, upper, unit);\r\n\t\t\t\tif (gantt.date[unit + '_start'])\r\n\t\t\t\t\tupper = gantt.date[unit + '_start'](upper);\r\n\t\t\t}\r\n\r\n\t\t\tlower = gantt.date.add(upper, -1 * steps, unit);\r\n\r\n\t\t}\r\n\t\tif (config.dir && config.dir == 'future')\r\n\t\t\treturn upper;\r\n\t\tif (config.dir && config.dir == 'past')\r\n\t\t\treturn lower;\r\n\r\n\t\tif (Math.abs(date - lower) < Math.abs(upper - date)) {\r\n\t\t\treturn lower;\r\n\t\t} else {\r\n\t\t\treturn upper;\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tgantt.correctTaskWorkTime = function (task) {\r\n\t\tif (gantt.config.work_time && gantt.config.correct_work_time) {\r\n\t\t\tif (!this.isWorkTime(task.start_date, undefined, task)) {\r\n\t\t\t\ttask.start_date = this.getClosestWorkTime({date: task.start_date, dir: 'future', task: task});\r\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\r\n\t\t\t} else if (!this.isWorkTime(new Date(+task.end_date - 1), undefined, task)) {\r\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onBeforeTaskUpdate\", function (id, task) {\r\n\t\tgantt._init_task_timing(task);\r\n\t\treturn true;\r\n\t});\r\n\tgantt.attachEvent(\"onBeforeTaskAdd\", function (id, task) {\r\n\t\tgantt._init_task_timing(task);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onAfterTaskMove\", function (id, parent, tindex) {\r\n\t\tgantt._init_task_timing(gantt.getTask(id));\r\n\t\treturn true;\r\n\t});\r\n\r\n};","function addResizeListener(gantt){\r\n\tvar containerStyles = window.getComputedStyle(gantt.$root);\r\n\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\tgantt.$root.style.position = \"relative\";\r\n\t}\r\n\r\n\tvar resizeWatcher = document.createElement('iframe');\r\n\tresizeWatcher.className = \"gantt_container_resize_watcher\";\r\n\tresizeWatcher.tabIndex = -1;\r\n\tif(gantt.config.wai_aria_attributes){\r\n\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t}\r\n\r\n\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\tif (salesforce_environment){\r\n\t\tgantt.config.container_resize_method = \"timeout\";\r\n\t}\r\n\r\n\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\tgantt.$root.appendChild(resizeWatcher);\r\n\tif (resizeWatcher.contentWindow) {\r\n\t\tlistenWindowResize(gantt, resizeWatcher.contentWindow);\r\n\t} else {\r\n\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\tgantt.$root.removeChild(resizeWatcher);\r\n\t\tlistenWindowResize(gantt, window);\r\n\t}\r\n}\r\n\r\nfunction listenWindowResize(gantt, window){\r\n\tvar resizeTimeout = gantt.config.container_resize_timeout || 20;\r\n\tvar resizeDelay;\r\n\tlet previousSize = getContainerSize(gantt);\r\n\r\n\tif (gantt.config.container_resize_method == \"timeout\"){\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\telse {\r\n\t\ttry {\r\n\t\t\tgantt.event(window, \"resize\", function () {\r\n\t\t\t\tif (gantt.$scrollbarRepaint) {\r\n\t\t\t\t\tgantt.$scrollbarRepaint = null;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// GS-2140. Don't repaint Gantt if it has the same sizes\r\n\t\t\t\t\tlet currentSize = getContainerSize(gantt);\r\n\t\t\t\t\tif (previousSize.x == currentSize.x && previousSize.y == currentSize.y){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpreviousSize = currentSize;\r\n\t\t\t\t\trepaintGantt();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tlowlevelResizeWatcher();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction repaintGantt(){\r\n\t\tclearTimeout(resizeDelay);\r\n\t\tresizeDelay = setTimeout(function(){\r\n\t\t\tif(!gantt.$destroyed){\r\n\t\t\t\tgantt.render();\r\n\t\t\t}\r\n\t\t}, resizeTimeout);\r\n\t}\r\n\r\n\tvar previousHeight = gantt.$root.offsetHeight;\r\n\tvar previousWidth = gantt.$root.offsetWidth;\t\r\n\r\n\tfunction lowlevelResizeWatcher(){\r\n\t\tif (gantt.$root.offsetHeight != previousHeight ||\r\n\t\t\t\tgantt.$root.offsetWidth != previousWidth){\r\n\t\t\t\trepaintGantt();\r\n\t\t}\r\n\r\n\t\tpreviousHeight = gantt.$root.offsetHeight;\r\n\t\tpreviousWidth = gantt.$root.offsetWidth;\r\n\r\n\t\tsetTimeout(lowlevelResizeWatcher, resizeTimeout);\r\n\t}\r\n}\r\n\r\nfunction getContainerSize(gantt){\r\n\treturn {\r\n\t\tx: gantt.$root.offsetWidth,\r\n\t\ty: gantt.$root.offsetHeight\r\n\t};\r\n}\r\n\r\nexport default addResizeListener;","import * as domHelpers from \"./ui/utils/dom_helpers\";\r\nimport * as helpers from \"../utils/helpers\";\r\nimport isHeadless from \"../utils/is_headless\";\r\nimport addResizeListener from \"./ui/resize_listener\";\r\nimport calculateScaleRange from \"./gantt_data_range\";\r\nimport assert from \"./common/assert\";\r\n\r\nexport default function(gantt){\r\n\t\r\n\r\n\tgantt.assert = assert(gantt);\r\n\r\n\tfunction isHTMLElement(node){\r\n\t\ttry {\r\n\t\t\tnode.cloneNode(false);\r\n\t\t}\r\n\t\tcatch (e){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tvar invalidContainerMessage = \"Invalid value of the first argument of `gantt.init`. Supported values: HTMLElement, String (element id).\" +\r\n\t\"This error means that either invalid object is passed into `gantt.init` or that the element with the specified ID doesn't exist on the page when `gantt.init` is called.\";\r\n\r\n\tfunction validateNode(node){\r\n\t\tif (!node || (typeof node == 'string' && document.getElementById(node))) return true;\r\n\t\tif (isHTMLElement(node)) return true;\r\n\r\n\t\tgantt.assert(false, invalidContainerMessage);\r\n\t\tthrow new Error(invalidContainerMessage);\r\n\t}\r\n\r\n//initial initialization\r\n\tgantt.init = function(node, from, to){\r\n\t\tif (gantt.env.isNode) { \r\n\t\t\tnode = null; // for the nodejs version\r\n\t\t} else {\r\n\t\t\tvalidateNode(node); // for the web version\r\n\t\t}\r\n\r\n\t\tif(from && to){\r\n\t\t\tthis.config.start_date = this._min_date = new Date(from);\r\n\t\t\tthis.config.end_date = this._max_date = new Date(to);\r\n\t\t}\r\n\t\tthis.date.init();\r\n\r\n\t\t//can be called only once\r\n\t\tthis.init = function(node){\r\n\t\t\tif (gantt.env.isNode) { \r\n\t\t\t\tnode = null; // for the nodejs version\r\n\t\t\t} else {\r\n\t\t\t\tvalidateNode(node); // for the web version\r\n\t\t\t}\r\n\r\n\t\t\tif (this.$container && this.$container.parentNode){\r\n\t\t\t\tthis.$container.parentNode.removeChild(this.$container);\r\n\t\t\t\tthis.$container = null;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.$layout){\r\n\t\t\t\tthis.$layout.clear();\r\n\t\t\t}\r\n\t\t\tthis._reinit(node);\r\n\t\t};\r\n\t\tthis._reinit(node);\r\n\t};\r\n\r\n\tgantt._quickRefresh = function(code){\r\n\t\tvar stores = this._getDatastores.call(this);\r\n\t\tfor(var i = 0; i < stores.length; i++){\r\n\t\t\tstores[i]._quick_refresh = true;\r\n\t\t}\r\n\r\n\t\tcode();\r\n\r\n\t\tfor(var i = 0; i < stores.length; i++){\r\n\t\t\tstores[i]._quick_refresh = false;\r\n\t\t}\r\n\t};\r\n\r\n\tvar dropLayout = (function dropLayout(){\r\n\t\tif(this._clearTaskLayers){\r\n\t\t\tthis._clearTaskLayers();\r\n\t\t}\r\n\r\n\t\tif(this._clearLinkLayers){\r\n\t\t\tthis._clearLinkLayers();\r\n\t\t}\r\n\r\n\t\tif(this.$layout){\r\n\t\t\tthis.$layout.destructor();\r\n\t\t\tthis.$layout = null;\r\n\t\t\tthis.$ui.reset();\r\n\t\t}\r\n\t}).bind(gantt);\r\n\r\n\tvar rebuildLayout = (function rebuildLayout(){\r\n\t\tif(isHeadless(gantt)){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.$root.innerHTML = \"\";\r\n\r\n\t\tthis.$root.gantt = this;\r\n\t\tcalculateScaleRange(this);\r\n\t\tthis.config.layout.id = \"main\";\r\n\t\tthis.$layout = this.$ui.createView(\"layout\", this.$root, this.config.layout);\r\n\r\n\t\tthis.$layout.attachEvent(\"onBeforeResize\", function(){\r\n\t\t\tvar storeNames = gantt.$services.getService(\"datastores\");\r\n\t\t\tfor(var i = 0; i < storeNames.length; i++){\r\n\t\t\t\tgantt.getDatastore(storeNames[i]).filter();\r\n\t\t\t\tif (gantt.$data.tasksStore._skipTaskRecalculation){\r\n\t\t\t\t\t// do not repaint items, they will be repainted later in the onStoreUpdate event\r\n\t\t\t\t\tif (gantt.$data.tasksStore._skipTaskRecalculation != \"lightbox\"){\r\n\t\t\t\t\t\tgantt.$data.tasksStore._skipTaskRecalculation = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgantt.getDatastore(storeNames[i]).callEvent(\"onBeforeRefreshAll\", []);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.$layout.attachEvent(\"onResize\", function(){\r\n\t\t\tgantt._quickRefresh(function(){\r\n\t\t\t\tgantt.refreshData();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tthis.callEvent(\"onGanttLayoutReady\", []);\r\n\t\tthis.$layout.render();\r\n\r\n\t\tthis.$container = this.$layout.$container.firstChild;\r\n\r\n\t\taddResizeListener(this);\r\n\t}).bind(gantt);\r\n\r\n\tgantt.resetLayout = function(){\r\n\t\tdropLayout();\r\n\t\trebuildLayout();\r\n\t\tthis.render();\r\n\t};\r\n\r\n\tgantt._reinit = function(node){\r\n\t\tthis.callEvent(\"onBeforeGanttReady\", []);\r\n\t\tthis._update_flags();\r\n\r\n\t\tvar config = this.$services.getService(\"templateLoader\");\r\n\t\tconfig.initTemplates(this);\r\n\r\n\t\tdropLayout();\r\n\r\n\t\tthis.$root = null;\r\n\t\tif(node){\r\n\t\t\tthis.$root = domHelpers.toNode(node);\r\n\t\t\trebuildLayout();\r\n\t\t\tthis.$mouseEvents.reset(this.$root);\r\n\t\t\taddMinimalSizes(gantt);\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onTemplatesReady\",[]);\r\n\r\n\t\tthis.callEvent(\"onGanttReady\", []);\r\n\r\n\t\tthis.render();\r\n\t};\r\n\r\n\tfunction addMinimalSizes(gantt) {\r\n\t\tif (gantt.$container && !gantt.config.autosize) {\r\n\t\t\tif (gantt.$root.offsetHeight < 50) {\r\n\t\t\t\t// eslint-disable-next-line no-console\r\n\t\t\t\tconsole.warn(`The Gantt container has a small height, so you cannot see its content. If it is not intended, you need to set the 'height' style rule to the container:\r\nhttps://docs.dhtmlx.com/gantt/faq.html#theganttchartisntrenderedcorrectly`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgantt.$click={\r\n\t\tbuttons:{\r\n\t\t\t\"edit\": function(id) {\r\n\t\t\t\tif (gantt.isReadonly(gantt.getTask(id))) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tgantt.showLightbox(id);\r\n\t\t\t},\r\n\t\t\t\"delete\": function(id) {\r\n\t\t\t\tvar task = gantt.getTask(id);\r\n\t\t\t\tif (gantt.isReadonly(task)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar question = gantt.locale.labels.confirm_deleting;\r\n\t\t\t\tvar title = gantt.locale.labels.confirm_deleting_title;\r\n\r\n\t\t\t\tgantt._simple_confirm(question, title, function(){\r\n\t\t\t\t\tif(!gantt.isTaskExists(id)){\r\n\t\t\t\t\t\tgantt.hideLightbox();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(task.$new){\r\n\t\t\t\t\t\t// GS-2170. Do not recalculate the indexes and dates of other tasks\r\n\t\t\t\t\t\t// as they will be recalculated in the `refreshData`\r\n\t\t\t\t\t\tgantt.$data.tasksStore._skipTaskRecalculation = \"lightbox\";\r\n\t\t\t\t\t\tgantt.silent(function(){\r\n\t\t\t\t\t\t\tgantt.deleteTask(id, true);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tgantt.$data.tasksStore._skipTaskRecalculation = false;\r\n\t\t\t\t\t\tgantt.refreshData();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tgantt.$data.tasksStore._skipTaskRecalculation = true;\r\n\t\t\t\t\t\tgantt.deleteTask(id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tgantt.hideLightbox();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n//renders self\r\n\tgantt.render = function(){\r\n\t\tthis.callEvent(\"onBeforeGanttRender\", []);\r\n\r\n\t\tvar visibleDate;\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tif (!this.config.sort && this._sort) {\r\n\t\t\t\tthis._sort = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.$root){\r\n\t\t\t\tif(this.config.rtl){\r\n\t\t\t\t\tthis.$root.classList.add(\"gantt_rtl\");\r\n\t\t\t\t\tthis.$root.firstChild.classList.add(\"gantt_rtl\"); // GS-1499\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.$root.classList.remove(\"gantt_rtl\");\r\n\t\t\t\t\tthis.$root.firstChild.classList.remove(\"gantt_rtl\"); // GS-1499\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar pos = this.getScrollState();\r\n\t\t\tvar posX = pos ? pos.x : 0;\r\n\t\t\tif(this._getHorizontalScrollbar()){\r\n\t\t\t\tvar scrollbar = this._getHorizontalScrollbar();\r\n\t\t\t\tposX = scrollbar.$config.codeScrollLeft || posX || 0;\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvisibleDate = null;\r\n\t\t\tif(posX){\r\n\t\t\t\tvisibleDate = gantt.dateFromPos(posX + this.config.task_scroll_offset);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcalculateScaleRange(this);\r\n\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tthis.$layout.$config.autosize = this.config.autosize;\r\n\t\t\tvar preserveScroll = this.config.preserve_scroll;\r\n\t\t\tthis.config.preserve_scroll = false; // prevent scrolling from layout resize, scroll will be called here later on\r\n\t\t\tthis.$layout.resize();\r\n\t\t\tthis.config.preserve_scroll = preserveScroll;\r\n\r\n\t\t\tif(this.config.preserve_scroll && pos){\r\n\r\n\t\t\t\t// GS-1640: We need pos.y, otherwise part of the timeline won't be rendered if the scrollbar disappeared\r\n\t\t\t\tif (posX || pos.y) {\r\n\t\t\t\t\tvar new_pos = gantt.getScrollState();\r\n\t\t\t\t\tvar new_date = gantt.dateFromPos(new_pos.x);\r\n\t\t\t\t\tif(!(+visibleDate == +new_date && new_pos.y == pos.y)){\r\n\t\t\t\t\t\tvar posX = null;\r\n\t\t\t\t\t\tvar posY = null;\r\n\t\t\t\t\t\tif(visibleDate){\r\n\t\t\t\t\t\t\tvar posX = Math.max(gantt.posFromDate(visibleDate) - gantt.config.task_scroll_offset, 0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(pos.y){\r\n\t\t\t\t\t\t\tposY = pos.y;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgantt.scrollTo(posX, posY);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// GS-1640: We need to reset the scroll position for the grid if the scrollbar disappeared and\r\n\t\t\t\t// the grid and timeline have different scrollbars\r\n\t\t\t\tvar gridCell = gantt.$ui.getView(\"grid\");\r\n\t\t\t\tif (gridCell) {\r\n\t\t\t\t\tvar attachedScrollbar = gridCell.$config.scrollY;\r\n\t\t\t\t\tvar verticalScrollbar = gantt.$ui.getView(attachedScrollbar);\r\n\t\t\t\t\tif (verticalScrollbar) {\r\n\t\t\t\t\t\tvar scrollbarNodeVisible = gantt.utils.dom.isChildOf(verticalScrollbar.$view, gantt.$container);\r\n\t\t\t\t\t\tif (!scrollbarNodeVisible) {\r\n\t\t\t\t\t\t\tgridCell.scrollTo(undefined, 0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tgantt.refreshData();\r\n\t\t}\r\n\t\tthis.callEvent(\"onGanttRender\", []);\r\n\t};\r\n\r\n\t//TODO: add layout.resize method that wouldn't trigger data repaint\r\n\tgantt.setSizes = gantt.render;\r\n\r\n\r\n\tgantt.getTaskRowNode = function(id) {\r\n\t\tvar els = this.$grid_data.childNodes;\r\n\t\tvar attribute = this.config.task_attribute;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tif (els[i].getAttribute) {\r\n\t\t\t\tvar value = els[i].getAttribute(attribute);\r\n\t\t\t\tif (value == id) return els[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tgantt.changeLightboxType = function(type){\r\n\t\tif(this.getLightboxType() == type)\r\n\t\t\treturn true;\r\n\t\tgantt._silent_redraw_lightbox(type);\r\n\t};\r\n\r\n\tgantt._get_link_type = function (from_start, to_start) {\r\n\t\tvar type = null;\r\n\t\tif (from_start && to_start) {\r\n\t\t\ttype = gantt.config.links.start_to_start;\r\n\t\t} else if (!from_start && to_start) {\r\n\t\t\ttype = gantt.config.links.finish_to_start;\r\n\t\t} else if (!from_start && !to_start) {\r\n\t\t\ttype = gantt.config.links.finish_to_finish;\r\n\t\t} else if (from_start && !to_start) {\r\n\t\t\ttype = gantt.config.links.start_to_finish;\r\n\t\t}\r\n\t\treturn type;\r\n\t};\r\n\r\n\tgantt.isLinkAllowed = function (from, to, from_start, to_start) {\r\n\t\tvar link = null;\r\n\t\tif (typeof(from) == \"object\") {\r\n\t\t\tlink = from;\r\n\t\t} else {\r\n\t\t\tlink = {source: from, target: to, type: this._get_link_type(from_start, to_start)};\r\n\t\t}\r\n\r\n\t\tif (!link) return false;\r\n\t\tif (!(link.source && link.target && link.type)) return false;\r\n\t\tif (link.source == link.target) return false;\r\n\r\n\t\tvar res = true;\r\n\t\t//any custom rules\r\n\t\tif (this.checkEvent(\"onLinkValidation\"))\r\n\t\t\tres = this.callEvent(\"onLinkValidation\", [link]);\r\n\r\n\t\treturn res;\r\n\t};\r\n\r\n\r\n\tgantt._correct_dst_change = function(date, prevOffset, step, unit){\r\n\t\tvar time_unit = helpers.getSecondsInUnit(unit) * step;\r\n\t\tif(time_unit > 60*60 && time_unit < 60*60*24){\r\n\t\t\t//correct dst change only if current unit is more than one hour and less than day (days have own checking), e.g. 12h\r\n\t\t\tvar offsetChanged = date.getTimezoneOffset() - prevOffset;\r\n\t\t\tif(offsetChanged){\r\n\t\t\t\tdate = gantt.date.add(date, offsetChanged, \"minute\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn date;\r\n\t};\r\n\r\n\tgantt.isSplitTask = function(task){\r\n\t\tgantt.assert(task && task instanceof Object, \"Invalid argument task =\"+task+\" of gantt.isSplitTask. Task object was expected\");\r\n\t\treturn this.$data.tasksStore._isSplitItem(task);\r\n\t};\r\n\r\n\tgantt._is_icon_open_click = function(e) {\r\n\t\tif (!e)\r\n\t\t\treturn false;\r\n\t\tvar target = e.target || e.srcElement;\r\n\t\tif (!(target && target.className))\r\n\t\t\treturn false;\r\n\t\tvar className = domHelpers.getClassName(target);\r\n\t\tif (className.indexOf(\"gantt_tree_icon\") !== -1 && (className.indexOf(\"gantt_close\") !== -1 || className.indexOf(\"gantt_open\") !== -1))\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t};\r\n\r\n};","/*\r\n \tasserts will be removed in final code, so you can place them anythere\r\n\twithout caring about performance impacts\r\n*/\r\n\r\nexport default function(gantt){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(gantt.config.show_errors && gantt.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (gantt.message) {\r\n\t\t\t\t\tgantt.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n};","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"مهمة جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"الغاء\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [\"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Новае заданне\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", // Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tsection_type: \"Тып\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"ІСР\",\r\n\t\tcolumn_text: \"Задача\",\r\n\t\tcolumn_start_date: \"Пачатак\",\r\n\t\tcolumn_duration: \"Працяг\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Сувязь\",\r\n\t\tconfirm_link_deleting: \"будзе выдалена\",\r\n\t\tlink_start: \"(пачатак)\",\r\n\t\tlink_end: \"(канец)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Хвiлiна\",\r\n\t\thours: \"Гадзiна\",\r\n\t\tdays: \"Дзень\",\r\n\t\tweeks: \"Тыдзень\",\r\n\t\tmonths: \"Месяц\",\r\n\t\tyears: \"Год\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Адмяніць\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nova tasca\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", // \"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel·lar\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\nTranslation by FreezeSoul\r\n\r\nUpdate 26/10/2015:\r\nTranslation of new labels by zwh8800\r\n https://github.com/DHTMLX/gantt/pull/7\r\n\r\n*/\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"新任務\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", // Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tsection_type: \"类型\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"工作分解结构\",\r\n\t\tcolumn_text: \"任务名\",\r\n\t\tcolumn_start_date: \"开始时间\",\r\n\t\tcolumn_duration: \"持续时间\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\r\n\t\tlink: \"关联\",\r\n\t\tconfirm_link_deleting: \"将被删除\",\r\n\t\tlink_start: \" (开始)\",\r\n\t\tlink_end: \" (结束)\",\r\n\r\n\t\ttype_task: \"任务\",\r\n\t\ttype_project: \"项目\",\r\n\t\ttype_milestone: \"里程碑\",\r\n\r\n\t\tminutes: \"分钟\",\r\n\t\thours: \"小时\",\r\n\t\tdays: \"天\",\r\n\t\tweeks: \"周\",\r\n\t\tmonths: \"月\",\r\n\t\tyears: \"年\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"关闭\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nová práce\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", // Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Zpět\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Ny opgave\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Fortryd\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Neue Aufgabe\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", // \"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"PSP\",\r\n\t\tcolumn_text: \"Task-Namen\",\r\n\t\tcolumn_start_date: \"Startzeit\",\r\n\t\tcolumn_duration: \"Dauer\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"werden gelöscht\",\r\n\t\tlink_start: \"(starten)\",\r\n\t\tlink_end: \"(ende)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minuten\",\r\n\t\thours: \"Stunden\",\r\n\t\tdays: \"Tage\",\r\n\t\tweeks: \"Wochen\",\r\n\t\tmonths: \"Monate\",\r\n\t\tyears: \"Jahre\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Abbrechen\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Regel\",\r\n\t\tconstraint_type: \"Regel\",\r\n\t\tconstraint_date: \"Regel - Datum\",\r\n\t\tasap: \"So bald wie möglich\",\r\n\t\talap: \"So spät wie möglich\",\r\n\t\tsnet: \"Beginn nicht vor\",\r\n\t\tsnlt: \"Beginn nicht später als\",\r\n\t\tfnet: \"Fertigstellung nicht vor\",\r\n\t\tfnlt: \"Fertigstellung nicht später als\",\r\n\t\tmso: \"Muss beginnen am\",\r\n\t\tmfo: \"Muss fertig sein am\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Κυριακή\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Νέα εργασία\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Άκυρο\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"New task\",\r\n\t\ticon_save: \"Save\",\r\n\t\ticon_cancel: \"Cancel\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Delete\",\r\n\t\tconfirm_closing: \"\",// Your changes will be lost, are you sure?\r\n\t\tconfirm_deleting: \"Task will be deleted permanently, are you sure?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Time period\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n\r\n Update 30/10/2015:\r\n Translation of new labels by Jorge Macias\r\n https://disqus.com/by/disqus_bTuZk1voC7/\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nueva tarea\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", // \"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tsection_type: \"Tipo\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"EDT\",\r\n\t\tcolumn_text: \"Tarea\",\r\n\t\tcolumn_start_date: \"Inicio\",\r\n\t\tcolumn_duration: \"Duración\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Enlace\",\r\n\t\tconfirm_link_deleting: \"será borrada\",\r\n\t\tlink_start: \" (inicio)\",\r\n\t\tlink_end: \" (fin)\",\r\n\r\n\t\ttype_task: \"Tarea\",\r\n\t\ttype_project: \"Proyecto\",\r\n\t\ttype_milestone: \"Hito\",\r\n\r\n\r\n\t\tminutes: \"Minutos\",\r\n\t\thours: \"Horas\",\r\n\t\tdays: \"Días\",\r\n\t\tweeks: \"Semanas\",\r\n\t\tmonths: \"Meses\",\r\n\t\tyears: \"Años\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancelar\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n dhtmlxGantt Persian (Farsi, fa_IR) locale by Mohammad Shokri http://slashsbin.com/\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\r\n\t\t\t\"ژانویه\",\r\n\t\t\t\"فوریه\",\r\n\t\t\t\"مارس\",\r\n\t\t\t\"آوریل\",\r\n\t\t\t\"مه\",\r\n\t\t\t\"ژوئن\",\r\n\t\t\t\"ژوئیه\",\r\n\t\t\t\"اوت\",\r\n\t\t\t\"سپتامبر\",\r\n\t\t\t\"اکتبر\",\r\n\t\t\t\"نوامبر\",\r\n\t\t\t\"دسامبر\"\r\n\t\t],\r\n\t\tmonth_short: [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"],\r\n\t\tday_full: [\r\n\t\t\t\"يکشنبه\",\r\n\t\t\t\"دوشنبه\",\r\n\t\t\t\"سهشنبه\",\r\n\t\t\t\"چهارشنبه\",\r\n\t\t\t\"پنجشنبه\",\r\n\t\t\t\"جمعه\",\r\n\t\t\t\"شنبه\"\r\n\t\t],\r\n\t\tday_short: [\r\n\t\t\t\"ی\",\r\n\t\t\t\"د\",\r\n\t\t\t\"س\",\r\n\t\t\t\"چ\",\r\n\t\t\t\"پ\",\r\n\t\t\t\"ج\",\r\n\t\t\t\"ش\"\r\n\t\t]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"وظیفه جدید\",\r\n\t\ticon_save: \"ذخیره\",\r\n\t\ticon_cancel: \"لغو\",\r\n\t\ticon_details: \"جزییات\",\r\n\t\ticon_edit: \"ویرایش\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"تغییرات شما ازدست خواهد رفت، آیا مطمئن هستید؟\",\r\n\t\tconfirm_deleting: \"این مورد برای همیشه حذف خواهد شد، آیا مطمئن هستید؟\",\r\n\t\tsection_description: \"توضیحات\",\r\n\t\tsection_time: \"مدت زمان\",\r\n\t\tsection_type: \"نوع\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"عنوان\",\r\n\t\tcolumn_start_date: \"زمان شروع\",\r\n\t\tcolumn_duration: \"مدت\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"ارتباط\",\r\n\t\tconfirm_link_deleting: \"حذف خواهد شد\",\r\n\t\tlink_start: \" (آغاز)\",\r\n\t\tlink_end: \" (پایان)\",\r\n\r\n\t\ttype_task: \"وظیفه\",\r\n\t\ttype_project: \"پروژه\",\r\n\t\ttype_milestone: \"نگارش\",\r\n\r\n\t\tminutes: \"دقایق\",\r\n\t\thours: \"ساعات\",\r\n\t\tdays: \"روزها\",\r\n\t\tweeks: \"هفته\",\r\n\t\tmonths: \"ماهها\",\r\n\t\tyears: \"سالها\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"تایید\",\r\n\t\tmessage_cancel: \"لغو\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Uusi tehtävä\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Peru\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nouvelle tâche\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\",// Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"OTP\",\r\n\t\tcolumn_text: \"Nom de la tâche\",\r\n\t\tcolumn_start_date: \"Date initiale\",\r\n\t\tcolumn_duration: \"Durée\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Le lien\",\r\n\t\tconfirm_link_deleting: \"sera supprimé\",\r\n\t\tlink_start: \"(début)\",\r\n\t\tlink_end: \"(fin)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Heures\",\r\n\t\tdays: \"Jours\",\r\n\t\tweeks: \"Semaines\",\r\n\t\tmonths: \"Mois\",\r\n\t\tyears: \"Années\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Annuler\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"משימה חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"הסבר\",\r\n\t\tsection_time: \"תקופה\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"בטל\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n Translation by Davor\r\n http://docs.dhtmlx.com/gantt/desktop__localization.html#comment-2569116291\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Siječanj\", \"Veljača\", \"Ožujak\", \"Travanj\", \"Svibanj\", \"Lipanj\", \"Srpanj\", \"Kolovoz\", \"Rujan\", \"Listopad\", \"Studeni\", \"Prosinac\"],\r\n\t\tmonth_short: [\"Sij\", \"Velj\", \"Ožu\", \"Tra\", \"Svi\", \"Lip\", \"Srp\", \"Kol\", \"Ruj\", \"Lis\", \"Stu\", \"Pro\"],\r\n\t\tday_full: [\"Nedjelja\", \"Ponedjeljak\", \"Utorak\", \"Srijeda\", \"Četvrtak\", \"Petak\", \"Subota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Uto\", \"Sri\", \"Čet\", \"Pet\", \"Sub\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Novi Zadatak\",\r\n\t\ticon_save: \"Spremi\",\r\n\t\ticon_cancel: \"Odustani\",\r\n\t\ticon_details: \"Detalji\",\r\n\t\ticon_edit: \"Izmjeni\",\r\n\t\ticon_delete: \"Obriši\",\r\n\t\tconfirm_closing: \"\",\r\n\t\tconfirm_deleting: \"Zadatak će biti trajno izbrisan, jeste li sigurni?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Vremenski Period\",\r\n\t\tsection_type: \"Tip\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Naziv Zadatka\",\r\n\t\tcolumn_start_date: \"Početno Vrijeme\",\r\n\t\tcolumn_duration: \"Trajanje\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Poveznica\",\r\n\t\tconfirm_link_deleting: \"će biti izbrisan\",\r\n\t\tlink_start: \" (početak)\",\r\n\t\tlink_end: \" (kraj)\",\r\n\r\n\t\ttype_task: \"Zadatak\",\r\n\t\ttype_project: \"Projekt\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\t\tminutes: \"Minute\",\r\n\t\thours: \"Sati\",\r\n\t\tdays: \"Dani\",\r\n\t\tweeks: \"Tjedni\",\r\n\t\tmonths: \"Mjeseci\",\r\n\t\tyears: \"Godine\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Odustani\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Új feladat\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", // A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Mégse\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Tugas baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /* Perubahan tidak akan disimpan ? */\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Batal\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n Update 29/12/2015:\r\n New labels translation by ARCANGELI CLAUDIO\r\n\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nuovo compito\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\",// \"Sei sicuro di confermare la chiusura?\",\r\n\t\tconfirm_deleting: \"Sei sicuro di confermare l'eliminazione?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tsection_type: \"Tipo\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Nome Attività\",\r\n\t\tcolumn_start_date: \"Inizio\",\r\n\t\tcolumn_duration: \"Durata\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"sarà eliminato\",\r\n\t\tlink_start: \" (inizio)\",\r\n\t\tlink_end: \" (fine)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minuti\",\r\n\t\thours: \"Ore\",\r\n\t\tdays: \"Giorni\",\r\n\t\tweeks: \"Settimane\",\r\n\t\tmonths: \"Mesi\",\r\n\t\tyears: \"Anni\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Chiudi\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"新しい仕事\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", // 変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"キャンセル\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n\tTranslated by cjkim@dbvalley.com\r\n*/\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"1월\", \"2월\", \"3월\", \"4월\", \"5월\", \"6월\", \"7월\", \"8월\", \"9월\", \"10월\", \"11월\", \"12월\"],\r\n\t\tmonth_short: [\"1월\", \"2월\", \"3월\", \"4월\", \"5월\", \"6월\", \"7월\", \"8월\", \"9월\", \"10월\", \"11월\", \"12월\"],\r\n\t\tday_full: [\"일요일\", \"월요일\", \"화요일\", \"수요일\", \"목요일\", \"금요일\", \"토요일\"],\r\n\t\tday_short: [\"일\", \"월\", \"화\", \"수\", \"목\", \"금\", \"토\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"이름없는 작업\",\r\n\t\ticon_save: \"저장\",\r\n\t\ticon_cancel: \"취소\",\r\n\t\ticon_details: \"세부 사항\",\r\n\t\ticon_edit: \"수정\",\r\n\t\ticon_delete: \"삭제\",\r\n\t\tconfirm_closing: \"\",\r\n\t\tconfirm_deleting: \"작업을 삭제하시겠습니까?\",\r\n\t\tsection_description: \"설명\",\r\n\t\tsection_time: \"기간\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"작업명\",\r\n\t\tcolumn_start_date: \"시작일\",\r\n\t\tcolumn_duration: \"기간\",\r\n\t\tcolumn_add: \"\",\r\n\t\tlink: \"전제\",\r\n\t\tconfirm_link_deleting: \"삭제 하시겠습니까?\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\t\ttype_task: \"작업\",\r\n\t\ttype_project: \"프로젝트\",\r\n\t\ttype_milestone: \"마일스톤\",\r\n\t\tminutes: \"분\",\r\n\t\thours: \"시간\",\r\n\t\tdays: \"일\",\r\n\t\tweeks: \"주\",\r\n\t\tmonths: \"달\",\r\n\t\tyears: \"년\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"취소\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","export default class LocaleManager{\r\n\tprivate _locales:{[key:string]: IGanttLocale };\r\n\r\n\tconstructor(config: {[key:string]: IGanttLocale }){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale = (name: string, locale: IGanttLocale) => {\r\n\t\tthis._locales[name] = locale;\r\n\t};\r\n\r\n\tgetLocale = (name: string): IGanttLocale => {\r\n\t\treturn this._locales[name];\r\n\t};\r\n}","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Ny oppgave\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Avbryt\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nieuwe taak\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Taak omschrijving\",\r\n\t\tcolumn_start_date: \"Startdatum\",\r\n\t\tcolumn_duration: \"Duur\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Koppeling\",\r\n\t\tconfirm_link_deleting: \"zal worden verwijderd\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (eind)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"minuten\",\r\n\t\thours: \"uren\",\r\n\t\tdays: \"dagen\",\r\n\t\tweeks: \"weken\",\r\n\t\tmonths: \"maanden\",\r\n\t\tyears: \"jaren\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Annuleren\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Ny oppgave\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", // Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Avbryt\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nowe zadanie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", // Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tsection_type: \"Typ\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Nazwa zadania\",\r\n\t\tcolumn_start_date: \"Początek\",\r\n\t\tcolumn_duration: \"Czas trwania\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"zostanie usunięty\",\r\n\t\tlink_start: \" (początek)\",\r\n\t\tlink_end: \" (koniec)\",\r\n\r\n\t\ttype_task: \"Zadanie\",\r\n\t\ttype_project: \"Projekt\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minuty\",\r\n\t\thours: \"Godziny\",\r\n\t\tdays: \"Dni\",\r\n\t\tweeks: \"Tydzień\",\r\n\t\tmonths: \"Miesiące\",\r\n\t\tyears: \"Lata\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Anuluj\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n\r\n Updated by Jorge Albernaz Martins\r\n\r\n jorgefox@hotmail.com\r\n\r\n www.redfox.inf.br\r\n\r\n JorgeFox\r\n\r\n*/\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nova tarefa\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Excluir\",\r\n\t\tconfirm_closing: \"\",// Suas alterações serão perdidas, confirme?\r\n\t\tconfirm_deleting: \"As tarefas serão excluidas permanentemente, confirme?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período\",\r\n\t\tsection_type: \"Tipo\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"EAP\",\r\n\t\tcolumn_text: \"Nome tarefa\",\r\n\t\tcolumn_start_date: \"Data início\",\r\n\t\tcolumn_duration: \"Duração\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"Será excluído!\",\r\n\t\tlink_start: \" (início)\",\r\n\t\tlink_end: \" (fim)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Projeto\",\r\n\t\ttype_milestone: \"Marco\",\r\n\r\n\r\n\t\tminutes: \"Minutos\",\r\n\t\thours: \"Horas\",\r\n\t\tdays: \"Dias\",\r\n\t\tweeks: \"Semanas\",\r\n\t\tmonths: \"Meses\",\r\n\t\tyears: \"Anos\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancelar\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Restrição\",\r\n\t\tconstraint_type: \"Tipo Restrição\",\r\n\t\tconstraint_date: \"Data restrição\",\r\n\t\tasap: \"Mais breve possível\",\r\n\t\talap: \"Mais tarde possível\",\r\n\t\tsnet: \"Não começar antes de\",\r\n\t\tsnlt: \"Não começar depois de\",\r\n\t\tfnet: \"Não terminar antes de\",\r\n\t\tfnlt: \"Não terminar depois de\",\r\n\t\tmso: \"Precisa começar em\",\r\n\t\tmfo: \"Precisa terminar em\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"Tipo de filtros\",\r\n\t\tresources_filter_label: \"Ocultar vazios\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short: [\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Sarcina noua\",\r\n\t\ticon_save: \"Salveaza\",\r\n\t\ticon_cancel: \"Anuleaza\",\r\n\t\ticon_details: \"Detalii\",\r\n\t\ticon_edit: \"Editeaza\",\r\n\t\ticon_delete: \"Sterge\",\r\n\t\tconfirm_closing: \"Schimbarile nu vor fi salvate, esti sigur?\",// Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description: \"Descriere\",\r\n\t\tsection_time: \"Interval\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Anuleaza\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Новое задание\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", // Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tsection_type: \"Тип\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"ИСР\",\r\n\t\tcolumn_text: \"Задача\",\r\n\t\tcolumn_start_date: \"Начало\",\r\n\t\tcolumn_duration: \"Длительность\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Связь\",\r\n\t\tconfirm_link_deleting: \"будет удалена\",\r\n\t\tlink_start: \" (начало)\",\r\n\t\tlink_end: \" (конец)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Минута\",\r\n\t\thours: \"Час\",\r\n\t\tdays: \"День\",\r\n\t\tweeks: \"Неделя\",\r\n\t\tmonths: \"Месяц\",\r\n\t\tyears: \"Год\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Отменить\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"начните вводить слово для фильтрации\",\r\n\t\tresources_filter_label: \"спрятать не установленные\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nova naloga\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", // Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Prekliči\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Nová úloha\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", // Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\t\tsection_type: \"Type\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Späť\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n\tTranslation by Peter Eriksson\r\n */\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Ny uppgift\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detajer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\",\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tsection_type: \"Typ\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Uppgiftsnamn\",\r\n\t\tcolumn_start_date: \"Starttid\",\r\n\t\tcolumn_duration: \"Varaktighet\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\r\n\t\tlink: \"Länk\",\r\n\t\tconfirm_link_deleting: \"kommer tas bort\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (slut)\",\r\n\t\ttype_task: \"Uppgift\",\r\n\t\ttype_project: \"Projekt\",\r\n\t\ttype_milestone: \"Milstolpe\",\r\n\r\n\t\tminutes: \"Minuter\",\r\n\t\thours: \"Timmar\",\r\n\t\tdays: \"Dagar\",\r\n\t\tweeks: \"Veckor\",\r\n\t\tmonths: \"Månader\",\r\n\t\tyears: \"År\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Avbryt\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","/*\r\n * updated by @levkar at https://github.com/DHTMLX/gantt/pull/10\r\n */\r\nconst locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tmonth_short: [\"Oca\", \"Şub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Ağu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pzt\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cmt\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Yeni görev\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"İptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", // Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Görev silinecek, emin misiniz?\",\r\n\t\tsection_description: \"Açıklama\",\r\n\t\tsection_time: \"Zaman Aralığı\",\r\n\t\tsection_type: \"Tip\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Görev Adı\",\r\n\t\tcolumn_start_date: \"Başlangıç\",\r\n\t\tcolumn_duration: \"Süre\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Bağlantı\",\r\n\t\tconfirm_link_deleting: \"silinecek\",\r\n\t\tlink_start: \" (başlangıç)\",\r\n\t\tlink_end: \" (bitiş)\",\r\n\r\n\t\ttype_task: \"Görev\",\r\n\t\ttype_project: \"Proje\",\r\n\t\ttype_milestone: \"Kilometretaşı\",\r\n\r\n\r\n\t\tminutes: \"Dakika\",\r\n\t\thours: \"Saat\",\r\n\t\tdays: \"Gün\",\r\n\t\tweeks: \"Hafta\",\r\n\t\tmonths: \"Ay\",\r\n\t\tyears: \"Yıl\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Ýptal\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","const locale: IGanttLocale = {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tnew_task: \"Нове завдання\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", // Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tsection_type: \"Тип\",\r\n\t\tsection_deadline: \"Deadline\",\r\n\t\tsection_baselines: \"Baselines\",\r\n\t\t/* grid columns */\r\n\r\n\t\tcolumn_wbs: \"WBS\",\r\n\t\tcolumn_text: \"Task name\",\r\n\t\tcolumn_start_date: \"Start time\",\r\n\t\tcolumn_duration: \"Duration\",\r\n\t\tcolumn_add: \"\",\r\n\r\n\t\t/* link confirmation */\r\n\t\tlink: \"Link\",\r\n\t\tconfirm_link_deleting: \"will be deleted\",\r\n\t\tlink_start: \" (start)\",\r\n\t\tlink_end: \" (end)\",\r\n\r\n\t\ttype_task: \"Task\",\r\n\t\ttype_project: \"Project\",\r\n\t\ttype_milestone: \"Milestone\",\r\n\r\n\r\n\t\tminutes: \"Minutes\",\r\n\t\thours: \"Hours\",\r\n\t\tdays: \"Days\",\r\n\t\tweeks: \"Week\",\r\n\t\tmonths: \"Months\",\r\n\t\tyears: \"Years\",\r\n\r\n\t\t/* message popup */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Відміна\",\r\n\r\n\t\t/* constraints */\r\n\t\tsection_constraint: \"Constraint\",\r\n\t\tconstraint_type: \"Constraint type\",\r\n\t\tconstraint_date: \"Constraint date\",\r\n\t\tasap: \"As Soon As Possible\",\r\n\t\talap: \"As Late As Possible\",\r\n\t\tsnet: \"Start No Earlier Than\",\r\n\t\tsnlt: \"Start No Later Than\",\r\n\t\tfnet: \"Finish No Earlier Than\",\r\n\t\tfnlt: \"Finish No Later Than\",\r\n\t\tmso: \"Must Start On\",\r\n\t\tmfo: \"Must Finish On\",\r\n\r\n\t\t/* resource control */\r\n\t\tresources_filter_placeholder: \"type to filter\",\r\n\t\tresources_filter_label: \"hide empty\",\r\n\r\n\t\t/* empty state screen */\r\n\t\tempty_state_text_link: \"Click here\",\r\n\t\tempty_state_text_description: \"to create your first task\",\r\n\r\n\t\t/* baselines control */\r\n\t\tbaselines_section_placeholder: \"Start adding a new baseline\",\r\n\t\tbaselines_add_button: \"Add Baseline\",\r\n\t\tbaselines_remove_button: \"Remove\",\r\n\t\tbaselines_remove_all_button: \"Remove All\",\r\n\r\n\t\t/* deadline control */\r\n\t\tdeadline_enable_button: \"Set\",\r\n\t\tdeadline_disable_button: \"Remove\"\r\n\t}\r\n};\r\n\r\nexport default locale;\r\n","import * as utils from \"../utils/utils\";\r\nimport constants from \"../constants\";\r\nimport ExtensionManager from \"../ext/extension_manager\";\r\n\r\nimport services from \"../core/common/services\";\r\nimport config from \"../core/common/config\";\r\nimport ajax from \"../core/common/ajax\";\r\nimport date from \"../core/common/date\";\r\nimport {remoteEvents} from \"../core/remote/remote_events\";\r\n\r\nimport DnD from \"../core/common/dnd\";\r\nimport templates from \"../core/common/templates\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\nimport StateService from \"../core/common/state\";\r\n\r\nimport Promise from \"../utils/promise\";\r\nimport env from \"../utils/env\";\r\nimport datastoreHooks from \"../core/datastore/datastore_hooks\";\r\nimport DataProcessor from \"../core/dataprocessor\";\r\n\r\nimport plugins from \"../core/plugins\";\r\n\r\nimport grid_column_api from \"../core/grid_column_api\";\r\nimport tasks from \"../core/tasks\";\r\nimport parsing from \"../core/loading/parsing\";\r\nimport work_time from \"../core/worktime/work_time\";\r\nimport data from \"../core/data\";\r\n\r\nimport void_script_second from \"../publish_helpers/void_script_second\";\r\n\r\nimport data_task_types from \"../core/data_task_types\";\r\nimport cached_functions from \"../core/cached_functions\";\r\n\r\nimport gantt_core from \"../core/gantt_core\";\r\nimport destructor from \"../core/destructor\";\r\nimport void_script_third from \"../publish_helpers/void_script_third\";\r\n\r\nimport i18nFactory from \"../locale\";\r\n\r\nfunction DHXGantt(){\r\n\tthis.constants = constants;\r\n\tthis.version = VERSION;\r\n\tthis.license = LICENSE;\r\n\tthis.templates = {};\r\n\tthis.ext = {};\r\n\tthis.keys = {\r\n\t\tedit_save: this.constants.KEY_CODES.ENTER,\r\n\t\tedit_cancel: this.constants.KEY_CODES.ESC\r\n\t};\r\n}\r\n\r\nexport default function(supportedExtensions) {\r\n\t// use a named constructor to make gantt instance discoverable in heap snapshots\r\n\tvar gantt = new DHXGantt();\r\n\r\n\tvar extensionManager = new ExtensionManager(supportedExtensions);\r\n\tvar activePlugins = {};\r\n\tgantt.plugins = function(config){\r\n\t\tfor(var i in config){\r\n\t\t\tif(config[i] && !activePlugins[i]){\r\n\t\t\t\tvar plugin = extensionManager.getExtension(i);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(gantt);\r\n\t\t\t\t\tactivePlugins[i] = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn activePlugins;\r\n\t};\r\n\r\n\tgantt.$services = services();\r\n\tgantt.config = config();\r\n\tgantt.ajax = ajax(gantt);\r\n\tgantt.date = date(gantt);\r\n\tgantt.RemoteEvents = remoteEvents;\r\n\r\n\tvar dnd = DnD(gantt);\r\n\tgantt.$services.setService(\"dnd\", function(){return dnd;});\r\n\r\n\tvar templatesLoader = templates(gantt);\r\n\tgantt.$services.setService(\"templateLoader\", function () {\r\n\t\treturn templatesLoader;\r\n\t});\r\n\r\n\teventable(gantt);\r\n\r\n\t\r\n\tvar stateService = new StateService();\r\n\r\n\tstateService.registerProvider(\"global\", function () {\r\n\t\tvar res = {\r\n\t\t\tmin_date: gantt._min_date,\r\n\t\t\tmax_date: gantt._max_date,\r\n\t\t\tselected_task: null\r\n\t\t};\r\n\r\n\t\t// do not throw error if getState called from non-initialized gantt\r\n\t\tif(gantt.$data && gantt.$data.tasksStore){\r\n\t\t\tres.selected_task = gantt.$data.tasksStore.getSelectedId();\r\n\t\t}\r\n\t\treturn res;\r\n\t});\r\n\tgantt.getState = stateService.getState;\r\n\tgantt.$services.setService(\"state\", function () {\r\n\t\treturn stateService;\r\n\t});\r\n\r\n\tutils.mixin(gantt, utils);\r\n\r\n\tgantt.Promise = Promise;\r\n\tgantt.env = env;\r\n\r\n\tdatastoreHooks(gantt);\r\n\r\n\tgantt.dataProcessor = DataProcessor.DEPRECATED_api;\r\n\tgantt.createDataProcessor = DataProcessor.createDataProcessor;\r\n\r\n\tplugins(gantt);\r\n\r\n\tgrid_column_api(gantt);\r\n\ttasks(gantt);\r\n\tparsing(gantt);\r\n\twork_time(gantt);\r\n\tdata(gantt);\r\n\r\n\tvoid_script_second(gantt);\r\n\r\n\tdata_task_types(gantt);\r\n\tcached_functions(gantt);\r\n\r\n\tgantt_core(gantt);\r\n\tdestructor(gantt);\r\n\tvoid_script_third(gantt);\r\n\r\n\tvar i18n = i18nFactory();\r\n\tgantt.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgantt.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!gantt.locale){\r\n\t\t\t\t\tgantt.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!gantt.locale[i]){\r\n\t\t\t\t\t\t\t\tgantt.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tgantt.mixin(gantt.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tgantt.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tgantt.i18n.setLocale(\"en\");\r\n\treturn gantt;\r\n};","export default function(){\r\n\tvar services = {};\r\n\tfunction register (name, getter){\r\n\t\tservices[name] = getter;\r\n\t}\r\n\r\n\tfunction getService(name){\r\n\t\tif(!services[name]){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn services[name]();\r\n\t}\r\n\r\n\tfunction dropService(name) {\r\n\t\tif (services[name]) {\r\n\t\t\tdelete services[name];\r\n\t\t}\r\n\t}\r\n\r\n\tvar servicesEnum = {};\r\n\r\n\treturn {\r\n\t\tservices: servicesEnum,\r\n\t\tsetService: register,\r\n\t\tgetService: getService,\r\n\t\tdropService: dropService,\r\n\t\tdestructor: function(){\r\n\t\t\tfor(var i in services){\r\n\t\t\t\tif(services[i]){\r\n\t\t\t\t\tvar service = services[i];\r\n\t\t\t\t\tif(service && service.destructor){\r\n\t\t\t\t\t\tservice.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tservices = null;\r\n\t\t}\r\n\t};\r\n};\r\n","import eventable from \"../../utils/eventable\";\r\nimport * as utils from \"../../utils/utils\";\r\nimport timeout from \"../../utils/timeout\";\r\nimport global from \"../../utils/global\";\r\nimport * as domHelpers from \"../ui/utils/dom_helpers\";\r\n\r\nexport default function(gantt){\r\n\r\n\tfunction copyDomEvent(e){\r\n\t\treturn {\r\n\t\t\ttarget: e.target || e.srcElement,\r\n\t\t\tpageX: e.pageX,\r\n\t\t\tpageY: e.pageY,\r\n\t\t\tclientX: e.clientX,\r\n\t\t\tclientY: e.clientY,\r\n\t\t\tmetaKey: e.metaKey,\r\n\t\t\tshiftKey: e.shiftKey,\r\n\t\t\tctrlKey: e.ctrlKey,\r\n\t\t\taltKey: e.altKey\r\n\t\t};\r\n\t}\r\n\r\n\tfunction DnD(obj, config) {\r\n\t\tthis._obj = obj;\r\n\t\tthis._settings = config || {};\r\n\t\teventable(this);\r\n\r\n\t\tvar inputMethods = this.getInputMethods();\r\n\r\n\t\tthis._drag_start_timer = null;\r\n\t\tgantt.attachEvent(\"onGanttScroll\", utils.bind(function (left, top) {\r\n\t\t\tthis.clearDragTimer();\r\n\t\t}, this));\r\n\r\n\t\tvar lastDown = 0;\r\n\t\tvar eventParams = {passive: false};\r\n\t\tfor(var i = 0; i < inputMethods.length; i++){\r\n\t\t\t(utils.bind(function(input){\r\n\r\n\t\t\t\tgantt.event(obj, input.down, utils.bind(function (e) {\r\n\t\t\t\t\tif(!input.accessor(e)){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (typeof e.button !== 'undefined' && e.button !== 0) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(config.preventDefault && config.selector && domHelpers.closest(e.target, config.selector)){\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (gantt.config.touch && e.timeStamp && e.timeStamp - lastDown < 300) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._settings.original_target = copyDomEvent(e);\r\n\r\n\t\t\t\t\tthis._settings.original_element_sizes = {\r\n\t\t\t\t\t\t...domHelpers.getRelativeEventPosition(e, domHelpers.getClosestSizedElement(obj)), \r\n\t\t\t\t\t\twidth: e.target.offsetWidth,\r\n\t\t\t\t\t\theight: e.target.offsetHeight\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tif (gantt.config.touch) {\r\n\t\t\t\t\t\tthis.clearDragTimer();\r\n\t\t\t\t\t\tthis._drag_start_timer = setTimeout(utils.bind(function () {\r\n\t\t\t\t\t\t\tif(gantt.getState().lightbox){\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.dragStart(obj, e, input);\r\n\t\t\t\t\t\t}, this), gantt.config.touch_drag);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.dragStart(obj, e, input);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, this), eventParams);\r\n\t\t\t\tvar eventElement = document.body;\r\n\t\t\t\tgantt.event(eventElement, input.up, utils.bind(function (e) {\r\n\t\t\t\t\tif(!input.accessor(e)){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.clearDragTimer();\r\n\t\t\t\t}, this), eventParams);\r\n\r\n\t\t\t}, this))(inputMethods[i]);\r\n\t\t}\r\n\t}\r\n\r\n\tDnD.prototype = {\r\n\t\ttraceDragEvents: function (domElement, inputMethod) {\r\n\t\t\tvar mousemove = utils.bind(function (e) {\r\n\t\t\t\treturn this.dragMove(domElement, e, inputMethod.accessor);\r\n\t\t\t}, this);\r\n\t\t\tutils.bind(function (e) {\r\n\t\t\t\treturn this.dragScroll(domElement, e);\r\n\t\t\t}, this);\r\n\r\n\t\t\tvar limited_mousemove = utils.bind(function (e) {\r\n\t\t\t\tif (this.config.started && utils.defined(this.config.updates_per_second)) {\r\n\t\t\t\t\tif (!timeout(this, this.config.updates_per_second))\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar dndActive = mousemove(e);\r\n\r\n\t\t\t\tif (dndActive) {\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tif (e && e.preventDefault && e.cancelable){//e.cancelable condition - because navigator.vibrate is blocked by Chrome\r\n\t\t\t\t\t\t\te.preventDefault();//Cancel default action on DND\r\n\t\t\t\t\t\t} //Cancel default action on DND\r\n\t\t\t\t\t}catch (e){\r\n\t\t\t\t\t\t// just suppress the exception, nothing needed to be done here\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//e.cancelBubble = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn dndActive;\r\n\t\t\t}, this);\r\n\t\t\tvar eventElement = domHelpers.getRootNode(gantt.$root);\r\n\t\t\tvar mousemoveContainer = this.config.mousemoveContainer || domHelpers.getRootNode(gantt.$root);\r\n\r\n\t\t\tvar eventParams = {passive: false};\r\n\t\t\tvar mouseup = utils.bind(function (e) {\r\n\t\t\t\tgantt.eventRemove(mousemoveContainer, inputMethod.move, limited_mousemove);\r\n\t\t\t\tgantt.eventRemove(eventElement, inputMethod.up, mouseup, eventParams);\r\n\t\t\t\treturn this.dragEnd(domElement);\r\n\t\t\t}, this);\r\n\r\n\t\t\tgantt.event(mousemoveContainer, inputMethod.move, limited_mousemove, eventParams);\r\n\t\t\tgantt.event(eventElement, inputMethod.up, mouseup, eventParams);\r\n\t\t},\r\n\t\tcheckPositionChange: function (pos) {\r\n\t\t\tvar diff_x = pos.x - this.config.pos.x;\r\n\t\t\tvar diff_y = pos.y - this.config.pos.y;\r\n\t\t\tvar distance = Math.sqrt(Math.pow(Math.abs(diff_x), 2) + Math.pow(Math.abs(diff_y), 2));\r\n\r\n\t\t\tif (distance > this.config.sensitivity) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tinitDnDMarker: function () {\r\n\t\t\t// create dnd placeholder and put it in dom\r\n\t\t\tvar marker = this.config.marker = document.createElement(\"div\");\r\n\t\t\tmarker.className = \"gantt_drag_marker\";\r\n\t\t\t// GS-1333: don't show any message when we resize grid columns\r\n\t\t\tmarker.innerHTML = \"\";\r\n\t\t\tdocument.body.appendChild(marker);\r\n\t\t},\r\n\t\tbackupEventTarget: function (domEvent, getEvent) {\r\n\t\t\tif (!gantt.config.touch) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// keep original event target in DOM in order to keep dnd on touchmove event\r\n\t\t\tvar e = getEvent(domEvent);\r\n\r\n\t\t\tvar el = e.target || e.srcElement;\r\n\t\t\tvar copy = el.cloneNode(true);\r\n\t\t\t//this.config.target.target = copy;\r\n\t\t\tthis.config.original_target = copyDomEvent(e);\r\n\t\t\tthis.config.original_target.target = copy;\r\n\t\t\tthis.config.backup_element = el;\r\n\t\t\tel.parentNode.appendChild(copy);\r\n\r\n\t\t\tel.style.display = \"none\";\r\n\t\t\tvar mousemoveContainer = this.config.mousemoveContainer || document.body;\r\n\t\t\tmousemoveContainer.appendChild(el);\r\n\t\t},\r\n\t\tgetInputMethods: function () {\r\n\t\t\t// bind actions to browser events\r\n\t\t\tvar inputMethods = [];\r\n\r\n\t\t\tinputMethods.push({\r\n\t\t\t\t\"move\": \"mousemove\",\r\n\t\t\t\t\"down\": \"mousedown\",\r\n\t\t\t\t\"up\": \"mouseup\",\r\n\t\t\t\t\"accessor\": function (e) {\r\n\t\t\t\t\treturn e;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (gantt.config.touch) {\r\n\r\n\t\t\t\tvar touchEventsSupported = true;\r\n\t\t\t\ttry{\r\n\t\t\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t\t\t}catch (e){\r\n\t\t\t\t\ttouchEventsSupported = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(touchEventsSupported){\r\n\t\t\t\t\tinputMethods.push({\r\n\t\t\t\t\t\t\"move\": \"touchmove\",\r\n\t\t\t\t\t\t\"down\": \"touchstart\",\r\n\t\t\t\t\t\t\"up\": \"touchend\",\r\n\t\t\t\t\t\t\"accessor\": function (ev) {\r\n\t\t\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\t\ttarget: document.elementFromPoint(ev.touches[0].clientX, ev.touches[0].clientY),\r\n\t\t\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\treturn ev;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else if(global.navigator.pointerEnabled){\r\n\t\t\t\t\tinputMethods.push({\r\n\t\t\t\t\t\t\"move\": \"pointermove\",\r\n\t\t\t\t\t\t\"down\": \"pointerdown\",\r\n\t\t\t\t\t\t\"up\": \"pointerup\",\r\n\t\t\t\t\t\t\"accessor\": function (ev) {\r\n\t\t\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\t\t\t\treturn ev;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}else if (global.navigator.msPointerEnabled){\r\n\t\t\t\t\tinputMethods.push({\r\n\t\t\t\t\t\t\"move\": \"MSPointerMove\",\r\n\t\t\t\t\t\t\"down\": \"MSPointerDown\",\r\n\t\t\t\t\t\t\"up\": \"MSPointerUp\",\r\n\t\t\t\t\t\t\"accessor\": function (ev) {\r\n\t\t\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\t\t\t\treturn ev;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn inputMethods;\r\n\t\t},\r\n\t\tclearDragTimer: function () {\r\n\t\t\tif (this._drag_start_timer) {\r\n\t\t\t\tclearTimeout(this._drag_start_timer);\r\n\t\t\t\tthis._drag_start_timer = null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tdragStart: function (obj, e, inputMethod) {\r\n\t\t\tif (this.config && this.config.started) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.config = {\r\n\t\t\t\tobj: obj,\r\n\t\t\t\tmarker: null,\r\n\t\t\t\tstarted: false,\r\n\t\t\t\tpos: this.getPosition(e),\r\n\t\t\t\tsensitivity: 4\r\n\t\t\t};\r\n\t\t\tif (this._settings)\r\n\t\t\t\tutils.mixin(this.config, this._settings, true);\r\n\r\n\r\n\t\t\tthis.traceDragEvents(obj, inputMethod);\r\n\r\n\t\t\tgantt._prevent_touch_scroll = true;\r\n\t\t\tdocument.body.className += \" gantt_noselect\";\r\n\r\n\t\t\tif (gantt.config.touch) {\r\n\t\t\t\tthis.dragMove(obj, e, inputMethod.accessor);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tdragMove: function (obj, e, getEvent) {\r\n\t\t\tvar source = getEvent(e);\r\n\t\t\tif (!source) return false;\r\n\r\n\t\t\tif (!this.config.marker && !this.config.started) {\r\n\t\t\t\tvar pos = this.getPosition(source);\r\n\r\n\t\t\t\tif (gantt.config.touch || this.checkPositionChange(pos)) {\r\n\t\t\t\t\t// real drag starts here,\r\n\t\t\t\t\t// when user moves mouse at first time after onmousedown\r\n\t\t\t\t\tthis.config.started = true;\r\n\t\t\t\t\tthis.config.ignore = false;\r\n\t\t\t\t\tgantt._touch_drag = true;\r\n\t\t\t\t\tif (this.callEvent(\"onBeforeDragStart\", [obj, this.config.original_target]) === false) {\r\n\t\t\t\t\t\tthis.config.ignore = true;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.backupEventTarget(e, getEvent);\r\n\t\t\t\t\tthis.initDnDMarker();\r\n\t\t\t\t\tgantt._touch_feedback();\r\n\t\t\t\t\tthis.callEvent(\"onAfterDragStart\", [obj, this.config.original_target]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.config.ignore = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.config.ignore) {\r\n\t\t\t\t// GS-1279 Gantt crashes on Mobile Firefox after starting to create a link and moving finger outisde the page.\r\n\t\t\t\tif (e.targetTouches && !source.target) return;\r\n\t\t\t\t\r\n\t\t\t\tsource.pos = this.getPosition(source);\r\n\t\t\t\tthis.config.marker.style.left = source.pos.x + \"px\";\r\n\t\t\t\tthis.config.marker.style.top = source.pos.y + \"px\";\r\n\t\t\t\tthis.callEvent(\"onDragMove\", [obj, source]);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tdragEnd: function (obj) {\r\n\t\t\tvar target = this.config.backup_element;\r\n\t\t\tif (target && target.parentNode) {\r\n\t\t\t\ttarget.parentNode.removeChild(target);\r\n\t\t\t}\r\n\t\t\tgantt._prevent_touch_scroll = false;\r\n\t\t\tif (this.config.marker) {\r\n\t\t\t\tthis.config.marker.parentNode.removeChild(this.config.marker);\r\n\t\t\t\tthis.config.marker = null;\r\n\r\n\t\t\t\tthis.callEvent(\"onDragEnd\", []);\r\n\t\t\t}\r\n\t\t\tthis.config.started = false;\r\n\t\t\tgantt._touch_drag = false;\r\n\t\t\tdocument.body.className = document.body.className.replace(\" gantt_noselect\", \"\");\r\n\t\t},\r\n\r\n\t\tgetPosition: function (e) {\r\n\t\t\tvar x = 0, y = 0;\r\n\t\t\tif (e.pageX || e.pageY) {\r\n\t\t\t\tx = e.pageX;\r\n\t\t\t\ty = e.pageY;\r\n\t\t\t} else if (e.clientX || e.clientY) {\r\n\t\t\t\tx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\r\n\t\t\t\ty = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\r\n\t\t\t}\r\n\t\t\treturn {x: x, y: y};\r\n\t\t}\r\n\t};\r\n\r\n\treturn DnD;\r\n};\r\n","export default function(gantt) {\r\n\r\n\tvar regTemplates = {};\r\n\r\n\tfunction initTemplate(name, initial, template_name) {\r\n\t\ttemplate_name = template_name || name;\r\n\t\tvar config = gantt.config,\r\n\t\t\ttemplates = gantt.templates;\r\n\r\n\t\tif (gantt.config[name] && regTemplates[template_name] != config[name]) {\r\n\t\t\tif (!(initial && templates[template_name])) {\r\n\t\t\t\ttemplates[template_name] = gantt.date.date_to_str(config[name]);\r\n\t\t\t\tregTemplates[template_name] = config[name];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction initTemplates() {\r\n\t\tvar labels = gantt.locale.labels;\r\n\t\tlabels.gantt_save_btn = labels.icon_save;\r\n\t\tlabels.gantt_cancel_btn = labels.icon_cancel;\r\n\t\tlabels.gantt_delete_btn = labels.icon_delete;\r\n\r\n\r\n\t\tvar date = gantt.date;\r\n\r\n\t\t//build configuration based templates\r\n\t\tvar d = date.date_to_str;\r\n\t\tvar c = gantt.config;\r\n\t\tvar format_date = d(c.xml_date || c.date_format, c.server_utc);\r\n\t\tvar parse_date = date.str_to_date(c.xml_date || c.date_format, c.server_utc);\r\n\r\n\t\tinitTemplate(\"date_scale\", true, undefined, gantt.config, gantt.templates);\r\n\t\tinitTemplate(\"date_grid\", true, \"grid_date_format\", gantt.config, gantt.templates);\r\n\t\tinitTemplate(\"task_date\", true, undefined, gantt.config, gantt.templates);\r\n\r\n\t\tgantt.mixin(gantt.templates, {\r\n\t\t\txml_format: undefined, // deprecated\r\n\t\t\tformat_date: format_date,\r\n\r\n\t\t\txml_date: undefined, // deprecated\r\n\t\t\tparse_date: parse_date,\r\n\r\n\t\t\tprogress_text: function (start, end, task) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\tgrid_header_class: function (column, config) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\r\n\t\t\ttask_text: function (start, end, task) {\r\n\t\t\t\treturn task.text;\r\n\t\t\t},\r\n\t\t\ttask_class: function (start, end, task) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\ttask_end_date: function (date) {\r\n\t\t\t\treturn gantt.templates.task_date(date);\r\n\t\t\t},\r\n\t\t\tgrid_row_class: function (start, end, task) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\ttask_row_class: function (start, end, task) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\ttimeline_cell_class: function (item, date) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\ttimeline_cell_content: function (item, date) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\tscale_cell_class: function (date) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\tscale_row_class: function (date) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\r\n\t\t\tgrid_indent: function (item) {\r\n\t\t\t\treturn \"
\";\r\n\t\t\t},\r\n\t\t\tgrid_folder: function (item) {\r\n\t\t\t\treturn \"
\";\r\n\t\t\t},\r\n\t\t\tgrid_file: function (item) {\r\n\t\t\t\treturn \"
\";\r\n\t\t\t},\r\n\t\t\tgrid_open: function (item) {\r\n\t\t\t\treturn \"
\";\r\n\t\t\t},\r\n\t\t\tgrid_blank: function (item) {\r\n\t\t\t\treturn \"
\";\r\n\t\t\t},\r\n\t\t\tdate_grid: function (date, item, column) {\r\n\t\t\t\tif (item && gantt.isUnscheduledTask(item) && gantt.config.show_unscheduled) {\r\n\t\t\t\t\treturn gantt.templates.task_unscheduled_time(item);\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn gantt.templates.grid_date_format(date, column);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\ttask_time: function (start, end, ev) {\r\n\t\t\t\tif (gantt.isUnscheduledTask(ev) && gantt.config.show_unscheduled) {\r\n\t\t\t\t\treturn gantt.templates.task_unscheduled_time(ev);\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn gantt.templates.task_date(start) + \" - \" + gantt.templates.task_end_date(end);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\ttask_unscheduled_time: function (task) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\r\n\t\t\ttime_picker: d(c.time_picker),\r\n\t\t\tlink_class: function (link) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t},\r\n\t\t\tlink_description: function (link) {\r\n\t\t\t\tvar from = gantt.getTask(link.source),\r\n\t\t\t\t\tto = gantt.getTask(link.target);\r\n\r\n\t\t\t\treturn \"\" + from.text + \" – \" + to.text + \" \";\r\n\t\t\t},\r\n\r\n\t\t\tdrag_link: function (from, from_start, to, to_start) {\r\n\t\t\t\tfrom = gantt.getTask(from);\r\n\t\t\t\tvar labels = gantt.locale.labels;\r\n\r\n\t\t\t\tvar text = \"\" + from.text + \" \" + (from_start ? labels.link_start : labels.link_end) + \" \";\r\n\t\t\t\tif (to) {\r\n\t\t\t\t\tto = gantt.getTask(to);\r\n\t\t\t\t\ttext += \" \" + to.text + \" \" + (to_start ? labels.link_start : labels.link_end) + \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn text;\r\n\t\t\t},\r\n\t\t\tdrag_link_class: function (from, from_start, to, to_start) {\r\n\t\t\t\tvar add = \"\";\r\n\r\n\t\t\t\tif (from && to) {\r\n\t\t\t\t\tvar allowed = gantt.isLinkAllowed(from, to, from_start, to_start);\r\n\t\t\t\t\tadd = \" \" + (allowed ? \"gantt_link_allow\" : \"gantt_link_deny\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn \"gantt_link_tooltip\" + add;\r\n\t\t\t},\r\n\r\n\t\t\t/* used for aria-labels of bar elements and for tooltip.js */\r\n\t\t\ttooltip_date_format: date.date_to_str(\"%Y-%m-%d\"),\r\n\t\t\ttooltip_text: function (start, end, event) {\r\n\t\t\t\treturn `Task: ${event.text}
\r\n\t\t\t\tStart date: ${gantt.templates.tooltip_date_format(start)}
\r\n\t\t\t\tEnd date: ${gantt.templates.tooltip_date_format(end)}
`;\r\n\t\t\t},\r\n\t\t\tbaseline_text: function (task, baseline, index) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\treturn {\r\n\t\tinitTemplates: initTemplates,\r\n\t\tinitTemplate: initTemplate\r\n\t};\r\n\r\n};","import * as utils from \"../../utils/utils\";\r\nimport facadeFactory from \"./../facades/datastore\";\r\nimport calculateScaleRange from \"../gantt_data_range\";\r\nimport isPlaceholderTask from \"../../utils/placeholder_task\";\r\n\r\nimport treeHelper from \"../../utils/task_tree_helpers\";\r\n\r\nfunction initDataStores(gantt){\r\n\r\n\tvar facade = facadeFactory.create();\r\n\tutils.mixin(gantt, facade);\r\n\tvar tasksStore = gantt.createDatastore({\r\n\t\tname: \"task\",\r\n\t\ttype: \"treeDatastore\",\r\n\t\trootId: function() { return gantt.config.root_id; },\r\n\t\tinitItem: utils.bind(_init_task, gantt),\r\n\t\tgetConfig: function() { return gantt.config; }\r\n\t});\r\n\r\n\tvar linksStore = gantt.createDatastore({\r\n\t\tname: \"link\",\r\n\t\tinitItem: utils.bind(_init_link, gantt)\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\ttasksStore.destructor();\r\n\t\tlinksStore.destructor();\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onLinkValidation\", function(link){\r\n\t\tif(gantt.isLinkExists(link.id) || link.id === \"predecessor_generated\"){\r\n\t\t\t// link was already added into gantt\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar source = gantt.getTask(link.source);\r\n\t\tvar taskLinks = source.$source;\r\n\t\tfor (var i = 0; i < taskLinks.length; i++) {\r\n\t\t\tvar existingLink = gantt.getLink(taskLinks[i]);\r\n\r\n\t\t\tvar sourceMatch = link.source == existingLink.source;\r\n\t\t\tvar targetMatch = link.target == existingLink.target;\r\n\t\t\tvar typeMatch = link.type == existingLink.type;\r\n\r\n\t\t\t// prevent creating duplicated links from the UI\r\n\t\t\tif (sourceMatch && targetMatch && typeMatch) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onBeforeRefreshAll\", function(){\r\n\r\n\t\t// GS-2170 do not recalculate indexes and dates as the event will be called later in the onStoreUpdate event\r\n\t\tif (tasksStore._skipTaskRecalculation){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar order = tasksStore.getVisibleItems();\r\n\r\n\t\tfor(var i=0; i < order.length; i++){\r\n\t\t\tvar item = order[i];\r\n\t\t\titem.$index = i;\r\n\t\t\titem.$local_index = gantt.getTaskIndex(item.id);\r\n\t\t\tgantt.resetProjectDates(item);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onFilterItem\", function(id, task) {\r\n\t\tif (gantt.config.show_tasks_outside_timescale) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar min = null, max = null;\r\n\t\tif (gantt.config.start_date && gantt.config.end_date) {\r\n\t\t\tif (gantt._isAllowedUnscheduledTask(task)) return true;\r\n\t\t\tmin = gantt.config.start_date.valueOf();\r\n\t\t\tmax = gantt.config.end_date.valueOf();\r\n\r\n\t\t\tif (+task.start_date > max || +task.end_date < +min)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onIdChange\", function(oldId, newId){\r\n\t\tgantt._update_flags(oldId, newId);\r\n\r\n\t\tvar changedTask = gantt.getTask(newId);\r\n\t\tif(!tasksStore.isSilent()){\r\n\t\t\tif(changedTask.$split_subtask || changedTask.rollup){\r\n\t\t\t\tgantt.eachParent(function(parent){\r\n\t\t\t\t\tgantt.refreshTask(parent.id);\r\n\t\t\t\t}, newId);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onAfterUpdate\", function(id){\r\n\t\tgantt._update_parents(id);\r\n\t\tif(gantt.getState(\"batchUpdate\").batch_update){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar task = tasksStore.getItem(id);\r\n\t\tif (!task.$source) task.$source = [];\r\n\t\tfor (var i = 0; i < task.$source.length; i++) {\r\n\t\t\tlinksStore.refresh(task.$source[i]);\r\n\t\t}\r\n\t\tif (!task.$target) task.$target = [];\r\n\t\tfor (var i = 0; i < task.$target.length; i++) {\r\n\t\t\tlinksStore.refresh(task.$target[i]);\r\n\t\t}\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onBeforeItemMove\", function(sid, parent, tindex){\r\n\t\t// GS-125. Don't allow users to move the placeholder task\r\n\t\tif (isPlaceholderTask(sid, gantt, tasksStore)){\r\n\t\t\t//eslint-disable-next-line\r\n\t\t\tconsole.log(\"The placeholder task cannot be moved to another position.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onAfterItemMove\", function(sid, parent, tindex){\r\n\t\tvar source = gantt.getTask(sid);\r\n\r\n\t\tif(this.getNextSibling(sid) !== null){\r\n\t\t\tsource.$drop_target = this.getNextSibling(sid);\r\n\t\t} else if(this.getPrevSibling(sid) !== null){\r\n\t\t\tsource.$drop_target = \"next:\" + this.getPrevSibling(sid);\r\n\t\t}else{\r\n\t\t\tsource.$drop_target = \"next:null\";\r\n\t\t}\r\n\r\n\t});\r\n\r\n\ttasksStore.attachEvent(\"onStoreUpdated\", function(id, item, action){\r\n\t\tif(action == \"delete\"){\r\n\t\t\tgantt._update_flags(id, null);\r\n\t\t}\r\n\r\n\t\tvar state = gantt.$services.getService(\"state\");\r\n\t\tif(state.getState(\"batchUpdate\").batch_update){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(gantt.config.fit_tasks && action !== \"paint\"){\r\n\t\t\tvar oldState = gantt.getState();\r\n\t\t\tcalculateScaleRange(gantt);\r\n\t\t\tvar newState = gantt.getState();\r\n\r\n\t\t\t//this._init_tasks_range();\r\n\t\t\tif (+oldState.min_date != +newState.min_date || +oldState.max_date != +newState.max_date) {\r\n\t\t\t\tgantt.render();\r\n\r\n\t\t\t\tgantt.callEvent(\"onScaleAdjusted\", []);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(action == \"add\" || action == \"move\" || action == \"delete\"){\r\n\t\t\tif(gantt.$layout){\r\n\t\t\t\t// GS-2170. Do not recalculate the indexes and dates of other tasks in the\r\n\t\t\t\t// onBeforeResize layout event, but do it later. If lightbox is opened, it will\r\n\t\t\t\t// trigger the refreshData, so the indexes and dates will be recalculated there\r\n\t\t\t\tif (this.$config.name == \"task\" && (action == \"add\" || action == \"delete\")){\r\n\t\t\t\t\tif (this._skipTaskRecalculation != \"lightbox\"){\r\n\t\t\t\t\t\tthis._skipTaskRecalculation = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tgantt.$layout.resize();\r\n\t\t\t}\r\n\r\n\t\t}else if(!id){\r\n\t\t\tlinksStore.refresh();\r\n\t\t}\r\n\r\n\t});\r\n\r\n\tlinksStore.attachEvent(\"onAfterAdd\", function(id, link){\r\n\t\tsync_link(link);\r\n\t});\r\n\tlinksStore.attachEvent(\"onAfterUpdate\", function(id, link){\r\n\t\tsync_links();\r\n\t});\r\n\tlinksStore.attachEvent(\"onAfterDelete\", function(id, link){\r\n\t\tsync_link_delete(link);\r\n\t});\r\n\tlinksStore.attachEvent(\"onAfterSilentDelete\", function(id, link){\r\n\t\tsync_link_delete(link);\r\n\t});\r\n\tlinksStore.attachEvent(\"onBeforeIdChange\", function(oldId, newId){\r\n\t\tsync_link_delete(gantt.mixin({id:oldId}, gantt.$data.linksStore.getItem(newId)));\r\n\t\tsync_link(gantt.$data.linksStore.getItem(newId));\r\n\t});\r\n\r\n\tfunction checkLinkedTaskVisibility(taskId){\r\n\t\tvar isVisible = gantt.isTaskVisible(taskId);\r\n\t\tif(!isVisible && gantt.isTaskExists(taskId)){\r\n\t\t\tvar parent = gantt.getParent(taskId);\r\n\t\t\tif(gantt.isTaskExists(parent) && gantt.isTaskVisible(parent)){\r\n\t\t\t\tparent = gantt.getTask(parent);\r\n\t\t\t\tif(gantt.isSplitTask(parent)){\r\n\t\t\t\t\tisVisible = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn isVisible;\r\n\t}\r\n\r\n\tlinksStore.attachEvent(\"onFilterItem\", function(id, link){\r\n\t\tif (!gantt.config.show_links) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar sourceVisible = checkLinkedTaskVisibility(link.source);\r\n\t\tvar targetVisible = checkLinkedTaskVisibility(link.target);\r\n\r\n\t\tif (!(sourceVisible && targetVisible) ||\r\n\t\t\tgantt._isAllowedUnscheduledTask(gantt.getTask(link.source)) || gantt._isAllowedUnscheduledTask(gantt.getTask(link.target)))\r\n\t\t\treturn false;\r\n\r\n\t\treturn gantt.callEvent(\"onBeforeLinkDisplay\", [id, link]);\r\n\t});\r\n\r\n\r\n\t(function(){\r\n\t\t// delete all connected links after task is deleted\r\n\t\tvar deletedLinks = {};\r\n\r\n\t\tgantt.attachEvent(\"onBeforeTaskDelete\", function(id, item){\r\n\t\t\tdeletedLinks[id] = treeHelper.getSubtreeLinks(gantt, id);\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onAfterTaskDelete\", function(id, item) {\r\n\t\t\tif(deletedLinks[id]){\r\n\t\t\t\tgantt.$data.linksStore.silent(function(){\r\n\t\t\t\t\tfor(var i in deletedLinks[id]){\r\n\t\t\t\t\t\tif (gantt.isLinkExists(i)){\r\n\t\t\t\t\t\t\tgantt.$data.linksStore.removeItem(i);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsync_link_delete(deletedLinks[id][i]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdeletedLinks[id] = null;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t})();\r\n\r\n\tgantt.attachEvent(\"onAfterLinkDelete\", function(id, link) {\r\n\t\tgantt.refreshTask(link.source);\r\n\t\tgantt.refreshTask(link.target);\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onParse\", sync_links);\r\n\r\n\tmapEvents({\r\n\t\tsource: linksStore,\r\n\t\ttarget: gantt,\r\n\t\tevents:{\r\n\t\t\t\"onItemLoading\":\"onLinkLoading\",\r\n\t\t\t\"onBeforeAdd\":\"onBeforeLinkAdd\",\r\n\t\t\t\"onAfterAdd\":\"onAfterLinkAdd\",\r\n\t\t\t\"onBeforeUpdate\":\"onBeforeLinkUpdate\",\r\n\t\t\t\"onAfterUpdate\":\"onAfterLinkUpdate\",\r\n\t\t\t\"onBeforeDelete\":\"onBeforeLinkDelete\",\r\n\t\t\t\"onAfterDelete\":\"onAfterLinkDelete\",\r\n\t\t\t\"onIdChange\":\"onLinkIdChange\"\r\n\t\t}\r\n\t});\r\n\r\n\tmapEvents({\r\n\t\tsource: tasksStore,\r\n\t\ttarget: gantt,\r\n\t\tevents:{\r\n\t\t\t\"onItemLoading\":\"onTaskLoading\",\r\n\t\t\t\"onBeforeAdd\":\"onBeforeTaskAdd\",\r\n\t\t\t\"onAfterAdd\":\"onAfterTaskAdd\",\r\n\t\t\t\"onBeforeUpdate\":\"onBeforeTaskUpdate\",\r\n\t\t\t\"onAfterUpdate\":\"onAfterTaskUpdate\",\r\n\t\t\t\"onBeforeDelete\":\"onBeforeTaskDelete\",\r\n\t\t\t\"onAfterDelete\":\"onAfterTaskDelete\",\r\n\t\t\t\"onIdChange\":\"onTaskIdChange\",\r\n\t\t\t\"onBeforeItemMove\":\"onBeforeTaskMove\",\r\n\t\t\t\"onAfterItemMove\":\"onAfterTaskMove\",\r\n\t\t\t\"onFilterItem\":\"onBeforeTaskDisplay\",\r\n\t\t\t\"onItemOpen\":\"onTaskOpened\",\r\n\t\t\t\"onItemClose\":\"onTaskClosed\",\r\n\t\t\t\"onBeforeSelect\":\"onBeforeTaskSelected\",\r\n\t\t\t\"onAfterSelect\":\"onTaskSelected\",\r\n\t\t\t\"onAfterUnselect\":\"onTaskUnselected\"\r\n\t\t}\r\n\t});\r\n\r\n\tgantt.$data = {\r\n\t\ttasksStore: tasksStore,\r\n\t\tlinksStore: linksStore\r\n\t};\r\n\r\n\tfunction sync_link(link){\r\n\t\tif(gantt.isTaskExists(link.source)){\r\n\t\t\tvar sourceTask = gantt.getTask(link.source);\r\n\t\t\tsourceTask.$source = sourceTask.$source || [];\r\n\t\t\tsourceTask.$source.push(link.id);\r\n\t\t}\r\n\t\tif(gantt.isTaskExists(link.target)){\r\n\t\t\tvar targetTask = gantt.getTask(link.target);\r\n\t\t\ttargetTask.$target = targetTask.$target || [];\r\n\t\t\ttargetTask.$target.push(link.id);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction sync_link_delete(link){\r\n\t\tif(gantt.isTaskExists(link.source)){\r\n\t\t\tvar sourceTask = gantt.getTask(link.source);\r\n\t\t\tfor(var i = 0; i < sourceTask.$source.length; i++){\r\n\t\t\t\tif(sourceTask.$source[i] == link.id){\r\n\t\t\t\t\tsourceTask.$source.splice(i, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(gantt.isTaskExists(link.target)){\r\n\t\t\tvar targetTask = gantt.getTask(link.target);\r\n\t\t\tfor(var i = 0; i < targetTask.$target.length; i++){\r\n\t\t\t\tif(targetTask.$target[i] == link.id){\r\n\t\t\t\t\ttargetTask.$target.splice(i, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction sync_links() {\r\n\t\tvar task = null;\r\n\t\tvar tasks = gantt.$data.tasksStore.getItems();\r\n\r\n\t\tfor(var i = 0, len = tasks.length; i < len; i++){\r\n\t\t\ttask = tasks[i];\r\n\t\t\ttask.$source = [];\r\n\t\t\ttask.$target = [];\r\n\t\t}\r\n\r\n\t\tvar links = gantt.$data.linksStore.getItems();\r\n\t\tfor (var i = 0, len = links.length; i < len; i++) {\r\n\r\n\t\t\tvar link = links[i];\r\n\t\t\tsync_link(link);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction mapEvents(conf){\r\n\t\tvar mapFrom = conf.source;\r\n\t\tvar mapTo = conf.target;\r\n\t\tfor(var i in conf.events){\r\n\t\t\t(function(sourceEvent, targetEvent){\r\n\t\t\t\tmapFrom.attachEvent(sourceEvent, function(){\r\n\t\t\t\t\treturn mapTo.callEvent(targetEvent, Array.prototype.slice.call(arguments));\r\n\t\t\t\t}, targetEvent);\r\n\t\t\t})(i, conf.events[i]);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _init_task(task) {\r\n\t\tif (!this.defined(task.id))\r\n\t\t\ttask.id = this.uid();\r\n\r\n\t\tif (task.start_date)\r\n\t\t\ttask.start_date = gantt.date.parseDate(task.start_date, \"parse_date\");\r\n\t\tif (task.end_date)\r\n\t\t\ttask.end_date = gantt.date.parseDate(task.end_date, \"parse_date\");\r\n\r\n\r\n\t\tvar duration = null;\r\n\t\tif (task.duration || task.duration === 0) {\r\n\t\t\ttask.duration = duration = task.duration * 1;\r\n\t\t}\r\n\r\n\t\tif (duration) {\r\n\t\t\tif (task.start_date && !task.end_date) {\r\n\t\t\t\ttask.end_date = this.calculateEndDate(task);\r\n\t\t\t} else if (!task.start_date && task.end_date) {\r\n\t\t\t\ttask.start_date = this.calculateEndDate({\r\n\t\t\t\t\tstart_date: task.end_date,\r\n\t\t\t\t\tduration: -task.duration,\r\n\t\t\t\t\ttask: task\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t//task.$calculate_duration = false;\r\n\t\t}\r\n\r\n\t\tif (gantt.config.deadlines !== false && task.deadline){\r\n\t\t\ttask.deadline = gantt.date.parseDate(task.deadline, \"parse_date\");\r\n\t\t}\r\n\r\n\t\ttask.progress = Number(task.progress) || 0;\r\n\r\n\t\tif (this._isAllowedUnscheduledTask(task)) {\r\n\t\t\tthis._set_default_task_timing(task);\r\n\t\t}\r\n\t\tthis._init_task_timing(task);\r\n\t\tif (task.start_date && task.end_date)\r\n\t\t\tthis.correctTaskWorkTime(task);\r\n\r\n\t\ttask.$source = [];\r\n\t\ttask.$target = [];\r\n\r\n\t\tvar originalTask = this.$data.tasksStore.getItem(task.id);\r\n\t\tif (originalTask && !utils.defined(task.open)) {\r\n\t\t\t// if a task with the same id is already in the gantt and the new object doesn't specify the `open` state -\r\n\t\t\t// restore the `open` state we already have in the chart\r\n\t\t\ttask.$open = originalTask.$open;\r\n\t\t}\r\n\r\n\t\tif (task.parent === undefined) {\r\n\t\t\ttask.parent = this.config.root_id;\r\n\t\t}\r\n\t\tif(task.open){\r\n\t\t\ttask.$open = true;\r\n\t\t}\r\n\t\treturn task;\r\n\t}\r\n\r\n\tfunction _init_link(link) {\r\n\t\tif (!this.defined(link.id))\r\n\t\t\tlink.id = this.uid();\r\n\t\treturn link;\r\n\t}\r\n}\r\n\r\n\r\nexport default initDataStores;\r\n","import batch_update from \"./batch_update\";\r\nimport wbs from \"./wbs\";\r\nimport resources from \"./resources\";\r\nimport resource_assignments from \"./resource_assignments\";\r\nimport new_task_placeholder from \"./new_task_placeholder\";\r\nimport auto_task_types from \"./auto_task_types\";\r\nimport formatters from \"./formatters\";\r\nimport empty_state_screen from \"./empty_state_screen\";\r\nimport baselines from \"./baselines\";\r\n\r\nexport default function(gantt){\r\n\tif(!gantt.ext){\r\n\t\tgantt.ext = {};\r\n\t}\r\n\r\n\tvar modules = [\r\n\t\tbatch_update,\r\n\t\twbs,\r\n\t\tresources,\r\n\t\tresource_assignments,\r\n\t\tnew_task_placeholder,\r\n\t\tauto_task_types,\r\n\t\tformatters,\r\n\t\tempty_state_screen,\r\n\t\tbaselines\r\n\t];\r\n\r\n\tfor(var i = 0; i < modules.length; i++){\r\n\t\tif(modules[i])\r\n\t\t\tmodules[i](gantt);\r\n\t}\r\n};","export default function(gantt) {\r\n\tgantt.getGridColumn = function(name) {\r\n\t\tvar columns = gantt.config.columns;\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tif (columns[i].name == name)\r\n\t\t\t\treturn columns[i];\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t};\r\n\r\n\tgantt.getGridColumns = function() {\r\n\t\treturn gantt.config.columns.slice();\r\n\t};\r\n};","export default function(gantt) {\r\n\tgantt.isReadonly = function (item) {\r\n\r\n\t\tif((typeof item == \"number\" || typeof item == \"string\") && gantt.isTaskExists(item)){\r\n\t\t\titem = gantt.getTask(item);\r\n\t\t}\r\n\t\tif (item && item[this.config.editable_property]) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn (item && item[this.config.readonly_property]) || this.config.readonly;\r\n\t\t}\r\n\t};\r\n};","import CalendarManager from \"./calendar_manager\";\r\nimport TimeCalculator from \"./time_calculator\";\r\nimport worktimeFacadeFactory from \"../facades/worktime_calendars\";\r\nimport * as utils from \"../../utils/utils\";\r\n\r\nexport default function (gantt) {\r\n\tvar manager = new CalendarManager(gantt),\r\n\ttimeCalculator = new TimeCalculator(manager);\r\n\tvar facade = worktimeFacadeFactory.create(manager, timeCalculator);\r\n\tutils.mixin(gantt, facade);\r\n};\r\n","export default function(gantt) {\r\n\r\n\tgantt.getTaskType = function (type) {\r\n\t\treturn \"task\";\r\n\t};\r\n};","/*\r\n reuse results of functions that can be recalculated during rendering\r\n greatly increases the rendering speed when critical path enabled\r\n Sample - 94_dev/critical_path.html\r\n\r\n */\r\nexport default function(gantt){\r\n\r\ngantt._cached_functions = {\r\n\tcache: {},\r\n\tmode: false,\r\n\tcritical_path_mode: false,\r\n\twrap_methods : function(methods, object){\r\n\t\tif(object._prefetch_originals){\r\n\t\t\tfor(var i in object._prefetch_originals){\r\n\t\t\t\tobject[i] = object._prefetch_originals[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tobject._prefetch_originals = {};\r\n\t\tfor(var i = 0; i < methods.length; i++)\r\n\t\t\tthis.prefetch(methods[i], object);\r\n\r\n\t},\r\n\tprefetch : function(methodname, host){\r\n\t\tvar original = host[methodname];\r\n\t\tif(original){\r\n\t\t\tvar optimizer = this;\r\n\r\n\t\t\thost._prefetch_originals[methodname] = original;\r\n\t\t\thost[methodname] = function get_prefetched_value(){\r\n\r\n\t\t\t\tvar argumentsArray = new Array(arguments.length);\r\n\t\t\t\tfor (var i = 0, l = arguments.length; i < l; i++) {\r\n\t\t\t\t\targumentsArray[i] = arguments[i];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(optimizer.active){\r\n\t\t\t\t\tvar args = optimizer.get_arguments_hash(Array.prototype.slice.call(argumentsArray));\r\n\t\t\t\t\tif(!optimizer.cache[methodname]){\r\n\t\t\t\t\t\toptimizer.cache[methodname] = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar cached_values = optimizer.cache[methodname];\r\n\r\n\t\t\t\t\tif(optimizer.has_cached_value(cached_values, args)){\r\n\t\t\t\t\t\treturn optimizer.get_cached_value(cached_values, args);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar value = original.apply(this, argumentsArray);\r\n\t\t\t\t\t\toptimizer.cache_value(cached_values, args, value);\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn original.apply(this, argumentsArray);\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn original;\r\n\t},\r\n\tcache_value: function(cache, arguments_hash, value){\r\n\t\tif(this.is_date(value))\r\n\t\t\tvalue = new Date(value);\r\n\t\tcache[arguments_hash] = value;\r\n\t},\r\n\thas_cached_value: function(cache, arguments_hash){\r\n\t\treturn cache.hasOwnProperty(arguments_hash);\r\n\t},\r\n\tget_cached_value: function(cache, arguments_hash){\r\n\t\tvar data = cache[arguments_hash];\r\n\r\n\t\t//for cached dates - return copy\r\n\t\tif(this.is_date(data)){\r\n\t\t\tdata = new Date(data);\r\n\t\t}\r\n\t\treturn data;\r\n\t},\r\n\tis_date: function(value){\r\n\t\treturn (value && value.getUTCDate);\r\n\t},\r\n\tget_arguments_hash:function(args){\r\n\t\tvar values = [];\r\n\t\tfor(var i = 0; i < args.length; i++){\r\n\t\t\tvalues.push(this.stringify_argument(args[i]));\r\n\t\t}\r\n\t\treturn \"(\" + values.join(\";\") + \")\";\r\n\t},\r\n\tstringify_argument: function(value){\r\n\t\t//expecting task or link, or any other data entries, dates and primitive values\r\n\t\tvar ret = \"\";\r\n\t\tif(value.id){\r\n\t\t\tret = value.id;\r\n\t\t}else if(this.is_date(value)){\r\n\t\t\tret = value.valueOf();\r\n\t\t}else{\r\n\t\t\tret = value;\r\n\t\t}\r\n\t\treturn ret + \"\";\r\n\t},\r\n\tactivate: function(){\r\n\t\tthis.clear();\r\n\t\tthis.active = true;\r\n\t},\r\n\tdeactivate: function(){\r\n\t\tthis.clear();\r\n\t\tthis.active = false;\r\n\t},\r\n\tclear: function(){\r\n\t\tthis.cache = {};\r\n\t},\r\n\r\n\tsetup: function(gantt){\r\n\t\tvar override_gantt = [];\r\n\r\n\t\tvar gantt_methods = [\r\n\t\t\t'_isProjectEnd',\r\n\t\t\t'_getProjectEnd',\r\n\t\t\t'_getSlack'\r\n\t\t];\r\n\r\n\r\n\r\n\t\tif(this.mode == 'auto'){\r\n\t\t\tif(gantt.config.highlight_critical_path){\r\n\t\t\t\toverride_gantt = gantt_methods;\r\n\t\t\t}\r\n\t\t}else if(this.mode === true){\r\n\t\t\toverride_gantt = gantt_methods;\r\n\t\t}\r\n\r\n\t\tthis.wrap_methods(override_gantt, gantt);\r\n\r\n\t},\r\n\tupdate_if_changed: function(gantt){\r\n\t\tvar changed = (this.critical_path_mode != gantt.config.highlight_critical_path ||\r\n\t\t\t\t\t\tthis.mode !== gantt.config.optimize_render);\r\n\t\tif(changed){\r\n\t\t\tthis.critical_path_mode = gantt.config.highlight_critical_path;\r\n\t\t\tthis.mode = gantt.config.optimize_render;\r\n\t\t\tthis.setup(gantt);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction activate(){\r\n\tgantt._cached_functions.update_if_changed(gantt);\r\n\tif(!gantt._cached_functions.active){\r\n\t\tgantt._cached_functions.activate();\r\n\t}\r\n\treturn true;\r\n}\r\ngantt.attachEvent(\"onBeforeGanttRender\", activate);\r\ngantt.attachEvent(\"onBeforeDataRender\", activate);\r\ngantt.attachEvent(\"onBeforeSmartRender\", function(){\r\n\tactivate();\r\n});\r\ngantt.attachEvent(\"onBeforeParse\", activate);\r\ngantt.attachEvent(\"onDataRender\", function(){\r\n\tgantt._cached_functions.deactivate();\r\n});\r\nvar deactivTimeout = null;\r\ngantt.attachEvent(\"onSmartRender\", function(){\r\n\tif(deactivTimeout)\r\n\t\tclearTimeout(deactivTimeout);\r\n\tdeactivTimeout = setTimeout(function(){\r\n\t\tgantt._cached_functions.deactivate();\r\n\t}, 1000);\r\n});\r\n\r\ngantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\tgantt._cached_functions.update_if_changed(gantt);\r\n\treturn true;\r\n});\r\n\r\n};","function extend(gantt){\r\n\r\n\tgantt.destructor = function(){\r\n\t\tthis.clearAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\r\n\t\tif(this.$root){\r\n\t\t\tdelete this.$root.gantt;\r\n\t\t}\r\n\r\n\t\tif(this._eventRemoveAll){\r\n\t\t\tthis._eventRemoveAll();\r\n\t\t}\r\n\r\n\t\tif(this.$layout){\r\n\t\t\tthis.$layout.destructor();\r\n\t\t}\r\n\r\n\t\tif(this.resetLightbox){\r\n\t\t\tthis.resetLightbox();\r\n\t\t}\r\n\r\n\r\n\t\tif(this._dp && this._dp.destructor){\r\n\t\t\tthis._dp.destructor();\r\n\t\t}\r\n\t\tthis.$services.destructor();\r\n\r\n\t\t// detachAllEvents should be called last, because in components may be attached events\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tfor(var i in this){\r\n\t\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\t\tdelete this[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.$destroyed = true;\r\n\t};\r\n}\r\n\r\nexport default extend;\r\n","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fa from \"./locale_fa\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hr from \"./locale_hr\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\nimport kr from \"./locale_kr\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfa,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thr,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tkr,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","import * as utils from \"../../utils/utils\";\r\nimport * as domHelpers from \"./utils/dom_helpers\";\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\t\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"gantt_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tvar eventElement = domHelpers.getRootNode(gantt.$root) || document;\r\n\tgantt.event(eventElement, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tmodality.cover.onkeydown = modal_key;\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, className, result) {\r\n\t\tvar buttonAriaAttrs = gantt._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = className.toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar button_css = \"gantt_\" + name + \"_button\";\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"gantt_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"\" + text.text + \"
\";\r\n\t\tmessage.className = \"gantt-info gantt-\" + text.type;\r\n\t\tmessage.onclick = function () {\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t};\r\n\r\n\t\tgantt._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Gantt is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tgantt._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" gantt_modal_box gantt-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '';\r\n\t\tinner += '';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tbox.onclick = function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".gantt_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t};\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tbox.onkeydown = modal_key;\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tgantt.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tgantt.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tgantt.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tgantt.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n};","import * as utils from \"../../utils/utils\";\r\n\r\nfunction extendSettings (store, parentSettings){\r\n\tvar own = this.$config[store];\r\n\r\n\tif(own){\r\n\t\tif(!own.$extendedConfig){\r\n\t\t\town.$extendedConfig = true;\r\n\t\t\tObject.setPrototypeOf(own, parentSettings);\r\n\t\t}\r\n\t\treturn own;\r\n\t}else{\r\n\t\treturn parentSettings;\r\n\t}\r\n}\r\n\r\nvar configurable = function(parentView){\r\n\tvar parentConfig,\r\n\t\tparentTemplates;\r\n\r\n\treturn {\r\n\t\t$getConfig: function(){\r\n\t\t\tif(!parentConfig){\r\n\t\t\t\tparentConfig = parentView ? parentView.$getConfig() : this.$gantt.config;\r\n\t\t\t}\r\n\t\t\tif(!this.$config.config){\r\n\t\t\t\treturn parentConfig;\r\n\t\t\t}else{\r\n\t\t\t\treturn extendSettings.call(this, \"config\", parentConfig);\r\n\t\t\t}\r\n\t\t},\r\n\t\t$getTemplates: function(){\r\n\t\t\tif(!parentTemplates){\r\n\t\t\t\tparentTemplates = parentView ? parentView.$getTemplates() : this.$gantt.templates;\r\n\t\t\t}\r\n\t\t\tif(!this.$config.templates){\r\n\t\t\t\treturn parentTemplates;\r\n\t\t\t}else{\r\n\t\t\t\treturn extendSettings.call(this, \"templates\", parentTemplates);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n};\r\n\r\nexport default function(obj, parent){\r\n\tutils.mixin(obj, configurable(parent));\r\n};","import * as utils from \"../../utils/utils\";\r\nimport configurable from \"./configurable\";\r\n\r\nvar uiFactory = function createFactory(gantt){\r\n\tvar views = {};\r\n\r\n\tfunction ui(cell, parentView) {\r\n\t\tvar content;\r\n\t\tvar view = \"cell\";\r\n\t\tif (cell.view){\r\n\t\t\tview = \"viewcell\";\r\n\t\t}else if (cell.resizer) {\r\n\t\t\tview = \"resizer\";\r\n\t\t}\r\n\t\telse if (cell.rows || cell.cols) {\r\n\t\t\tview = \"layout\";\r\n\t\t}\r\n\t\telse if (cell.views) {\r\n\t\t\tview = \"multiview\";\r\n\t\t}\r\n\r\n\t\tcontent = createView.call(this, view, null, cell, parentView);\r\n\t\treturn content;\r\n\t}\r\n\t\r\n\tvar createdViews = {};\r\n\r\n\tfunction createView(name, parent, config, parentView) {\r\n\t\tvar creator = views[name];\r\n\r\n\t\tif(!creator || !creator.create)\r\n\t\t\treturn false;\r\n\r\n\t\tif(name == \"resizer\" && !config.mode){\r\n\t\t\tif(parentView.$config.cols){\r\n\t\t\t\tconfig.mode = \"x\";\r\n\t\t\t}else{\r\n\t\t\t\tconfig.mode = \"y\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(name == \"viewcell\" && config.view == \"scrollbar\" && !config.scroll){\r\n\t\t\tif(parentView.$config.cols){\r\n\t\t\t\tconfig.scroll = \"y\";\r\n\t\t\t}else{\r\n\t\t\t\tconfig.scroll = \"x\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar config = utils.copy(config);\r\n\r\n\t\tif(!config.id && !createdViews[config.view]){\r\n\t\t\tconfig.id = config.view;\r\n\t\t}\r\n\r\n\t\tif(config.id && !config.css){\r\n\t\t\tconfig.css = config.id+\"_cell\";\r\n\t\t}\r\n\r\n\t\tvar view = new creator.create(parent, config, this, gantt);\r\n\r\n\t\tif(creator.configure){\r\n\t\t\tcreator.configure(view);\r\n\t\t}\r\n\r\n\t\tconfigurable(view, parentView);\r\n\t\tif(!view.$id){\r\n\t\t\tview.$id = config.id || gantt.uid();\r\n\t\t}\r\n\r\n\t\tif(!view.$parent && typeof parent == \"object\"){\r\n\t\t\tview.$parent = parent;\r\n\t\t}\r\n\t\tif(!view.$config){\r\n\t\t\tview.$config = config;\r\n\t\t}\r\n\r\n\t\tif(createdViews[view.$id]){\r\n\t\t\tview.$id = gantt.uid();\r\n\t\t}\r\n\r\n\t\tcreatedViews[view.$id] = view;\r\n\r\n\t\treturn view;\r\n\t}\r\n\r\n\tfunction reset(){\r\n\t\tcreatedViews = {};\r\n\t}\r\n\r\n\tfunction register(name, viewConstructor, configure){\r\n\t\tviews[name] = {create: viewConstructor, configure: configure};\r\n\t}\r\n\r\n\tfunction getView(id){\r\n\t\treturn createdViews[id];\r\n\t}\r\n\r\n\tvar factory = {\r\n\t\tinitUI:ui,\r\n\t\treset: reset,\r\n\t\tregisterView: register,\r\n\t\tcreateView: createView,\r\n\t\tgetView: getView\r\n\t};\r\n\r\n\treturn factory;\r\n};\r\n\r\nexport default {\r\n\tcreateFactory: uiFactory\r\n};\r\n\r\n","import * as domHelpers from \"./utils/dom_helpers\";\r\n\r\nvar createMouseHandler = (function(domHelpers) {\r\n\treturn function (gantt) {\r\n\t\tvar eventHandlers = {\r\n\t\t\t\"click\": {},\r\n\t\t\t\"doubleclick\": {},\r\n\t\t\t\"contextMenu\": {}\r\n\t\t};\r\n\r\n\t\tfunction addEventTarget(event, className, handler, root) {\r\n\t\t\tif(!eventHandlers[event][className]){\r\n\t\t\t\teventHandlers[event][className] = [];\r\n\t\t\t}\r\n\r\n\t\t\teventHandlers[event][className].push({\r\n\t\t\t\thandler: handler,\r\n\t\t\t\troot: root\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction callHandler(eventName, className, root, args) {\r\n\t\t\tvar handlers = eventHandlers[eventName][className];\r\n\t\t\tif(handlers){\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tif(!(root || handlers[i].root) || handlers[i].root === root){\r\n\t\t\t\t\t\thandlers[i].handler.apply(this, args);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onClick(e) {\r\n\t\t\te = e || window.event;\r\n\t\t\tvar id = gantt.locate(e);\r\n\r\n\t\t\tvar handlers = findEventHandlers(e, eventHandlers.click);\r\n\t\t\tvar res = true;\r\n\t\t\tif (id !== null) {\r\n\t\t\t\tres = !gantt.checkEvent(\"onTaskClick\") || gantt.callEvent(\"onTaskClick\", [id, e]);\r\n\t\t\t} else {\r\n\t\t\t\tgantt.callEvent(\"onEmptyClick\", [e]);\r\n\t\t\t}\r\n\r\n\t\t\tif (res) {\r\n\t\t\t\tvar default_action = callEventHandlers(handlers, e, id);\r\n\t\t\t\tif (!default_action)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\t// GS-1025: if we don't do that, the dropdown or date select will be closed for unselected tasks\r\n\t\t\t\t// GS-1078: or for the built-in select inline editor\r\n\t\t\t\tswitch(e.target.nodeName) {\r\n\t\t\t\t\tcase \"SELECT\":\r\n\t\t\t\t\tcase 'INPUT':\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//allow task selection when the multiselect plugin is not enabled\r\n\t\t\t\tif (id && gantt.getTask(id) && !gantt._multiselect && gantt.config.select_task) {\r\n\t\t\t\t\tgantt.selectTask(id);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onContextMenu(e) {\r\n\t\t\te = e || window.event;\r\n\t\t\tvar src = e.target || e.srcElement,\r\n\t\t\t\ttaskId = gantt.locate(src),\r\n\t\t\t\tlinkId = gantt.locate(src, gantt.config.link_attribute);\r\n\r\n\t\t\tvar res = !gantt.checkEvent(\"onContextMenu\") || gantt.callEvent(\"onContextMenu\", [taskId, linkId, e]);\r\n\t\t\tif (!res) {\r\n\t\t\t\tif (e.preventDefault)\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\telse\r\n\t\t\t\t\te.returnValue = false;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\r\n\t\tfunction findEventHandlers(e, hash){\r\n\t\t\tvar trg = e.target || e.srcElement;\r\n\t\t\tvar handlers = [];\r\n\t\t\twhile (trg) {\r\n\t\t\t\tvar css = domHelpers.getClassName(trg);\r\n\t\t\t\tif (css) {\r\n\t\t\t\t\tcss = css.split(\" \");\r\n\t\t\t\t\tfor (var i = 0; i < css.length; i++) {\r\n\t\t\t\t\t\tif (!css[i]) continue;\r\n\t\t\t\t\t\tif (hash[css[i]]) {\r\n\t\t\t\t\t\t\tvar delegateHandlers = hash[css[i]];\r\n\r\n\t\t\t\t\t\t\tfor(var h = 0; h < delegateHandlers.length; h++){\r\n\t\t\t\t\t\t\t\tif(delegateHandlers[h].root){\r\n\t\t\t\t\t\t\t\t\tif(!domHelpers.isChildOf(trg, delegateHandlers[h].root)){\r\n\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\thandlers.push(delegateHandlers[h].handler);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttrg = trg.parentNode;\r\n\t\t\t}\r\n\t\t\treturn handlers;\r\n\t\t}\r\n\r\n\t\tfunction callEventHandlers(handlers, e, id){\r\n\t\t\tvar res = true;\r\n\r\n\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\tvar handlerResult = handlers[i].call(gantt, e, id, e.target || e.srcElement);\r\n\t\t\t\tres = res && !(typeof handlerResult != \"undefined\" && handlerResult !== true);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t}\r\n\r\n\r\n\t\tfunction onDoubleClick(e) {\r\n\t\t\te = e || window.event;\r\n\t\t\tvar id = gantt.locate(e);\r\n\r\n\t\t\tvar handlers = findEventHandlers(e, eventHandlers.doubleclick);\r\n\t\t\t// when doubleclick fired not on task, id === null\r\n\t\t\tvar res = !gantt.checkEvent(\"onTaskDblClick\") || id === null || gantt.callEvent(\"onTaskDblClick\", [id, e]);\r\n\t\t\tif (res) {\r\n\t\t\t\tvar default_action = callEventHandlers(handlers, e, id);\r\n\t\t\t\tif (!default_action)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tif (id !== null && gantt.getTask(id)) {\r\n\t\t\t\t\tif (res && gantt.config.details_on_dblclick && !gantt.isReadonly(id)) {\r\n\t\t\t\t\t\tgantt.showLightbox(id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction onMouseMove(e) {\r\n\t\t\tif (gantt.checkEvent(\"onMouseMove\")) {\r\n\t\t\t\tvar id = gantt.locate(e);\r\n\t\t\t\tgantt._last_move_event = e;\r\n\t\t\t\tgantt.callEvent(\"onMouseMove\", [id, e]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction detach(eventName, className, handler, root) {\r\n\t\t\tif (eventHandlers[eventName] && eventHandlers[eventName][className]) {\r\n\t\t\t\tvar handlers = eventHandlers[eventName];\r\n\t\t\t\tvar elementHandlers = handlers[className];\r\n\t\t\t\tfor(var i = 0; i < elementHandlers.length; i++){\r\n\t\t\t\t\tif(elementHandlers[i].root == root){\r\n\t\t\t\t\t\telementHandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!elementHandlers.length){\r\n\t\t\t\t\tdelete handlers[className];\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar domEvents = gantt._createDomEventScope();\r\n\r\n\t\tfunction reset(node){\r\n\r\n\t\t\tdomEvents.detachAll();\r\n\r\n\t\t\tif(node){\r\n\t\t\t\tdomEvents.attach(node, \"click\", onClick);\r\n\t\t\t\tdomEvents.attach(node, \"dblclick\", onDoubleClick);\r\n\t\t\t\tdomEvents.attach(node, \"mousemove\", onMouseMove);\r\n\t\t\t\tdomEvents.attach(node, \"contextmenu\", onContextMenu);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\r\n\t\treturn {\r\n\t\t\treset: reset,\r\n\t\t\tglobal: function(event, classname, handler){\r\n\t\t\t\taddEventTarget(event, classname, handler, null);\r\n\t\t\t},\r\n\t\t\tdelegate: addEventTarget,\r\n\t\t\tdetach: detach,\r\n\t\t\tcallHandler: callHandler,\r\n\t\t\tonDoubleClick: onDoubleClick,\r\n\t\t\tonMouseMove: onMouseMove,\r\n\t\t\tonContextMenu: onContextMenu,\r\n\t\t\tonClick: onClick,\r\n\t\t\tdestructor: function(){\r\n\t\t\t\treset();\r\n\t\t\t\teventHandlers = null;\r\n\t\t\t\tdomEvents = null;\r\n\t\t\t}\r\n\r\n\t\t};\r\n\t};\r\n\r\n})(domHelpers);\r\n\r\n\r\nexport default {\r\n\tinit:createMouseHandler\r\n};","export default function(viewport, box, gantt){\r\n\tif(!box){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(box.left > viewport.x_end || box.left + box.width < viewport.x){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(box.top > viewport.y_end || box.top + box.height < viewport.y){\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn true;\r\n};","export default function(gantt){\r\n\treturn gantt.config.smart_rendering && gantt._smart_render;\r\n};","export default function(item, view, config){\r\n\treturn {\r\n\t\ttop: view.getItemTop(item.id),\r\n\t\theight: view.getItemHeight(item.id),\r\n\t\tleft: 0,\r\n\t\tright: Infinity\r\n\t};\r\n};","export default function getVisibleTasksRange(gantt, view, config, datastore, viewport){\r\n\tvar buffer = 1;\r\n\tvar start = view.getItemIndexByTopPosition(viewport.y) || 0;\r\n\tvar end = view.getItemIndexByTopPosition(viewport.y_end) || datastore.count();\r\n\tvar indexStart = Math.max(0, start - buffer);\r\n\tvar indexEnd = Math.min(datastore.count(), end + buffer);\r\n\t// GS-2481 and GS-1715, need to take into account selected task when using keyboard shortcuts and when the inline editor is opened \r\n\tconst extraTasksIds= [];\r\n\tif (gantt.config.keyboard_navigation && gantt.getSelectedId()) {\r\n\t\textraTasksIds.push(gantt.getSelectedId());\r\n\t}\r\n\tif (gantt.$ui.getView(\"grid\") && gantt.ext.inlineEditors && gantt.ext.inlineEditors.getState().id) {\r\n\t\tlet inlineEditorId = gantt.ext.inlineEditors.getState().id;\r\n\t\tif (datastore.exists(inlineEditorId)){\r\n\t\t\textraTasksIds.push(inlineEditorId);\r\n\t\t}\r\n\t}\r\n\treturn {\r\n\t\tstart: indexStart,\r\n\t\tend: indexEnd,\r\n\t\tids: extraTasksIds \r\n\t};\r\n};","import genericViewPortChecker from \"./viewport/is_in_viewport\";\r\nimport isLegacyRender from \"./is_legacy_smart_render\";\r\nimport basicGetRectangle from \"./viewport/get_grid_row_rectangle\";\r\nimport basicGetRange from \"./viewport/get_visible_bars_range\";\r\nvar rendererFactory = function(gantt){\r\n\r\n\t//hash of dom elements is needed to redraw single bar/link\r\n\tvar task_area_pulls = {},\r\n\t\ttask_area_renderers = {};\r\n\r\n\tfunction getView(layer){\r\n\t\tvar view = null;\r\n\t\tif (typeof layer.view === \"string\") {\r\n\t\t\tview = gantt.$ui.getView(layer.view);\r\n\t\t} else if (layer.view) {\r\n\t\t\tview = layer.view;\r\n\t\t}\r\n\t\treturn view;\r\n\t}\r\n\r\n\tfunction getRenderer(id, layer, node) {\r\n\t\t\r\n\t\tif (task_area_renderers[id])\r\n\t\t\treturn task_area_renderers[id];\r\n\r\n\t\tif (!layer.renderer)\r\n\t\t\tgantt.assert(false, \"Invalid renderer call\");\r\n\r\n\t\tvar renderMethod = null;\r\n\t\tvar updateMethod = null;\r\n\t\tvar getRectangle = null;\r\n\t\tvar renderCallbackMethod = null;\r\n\t\tvar specializedViewPortChecker = null;\r\n\r\n\t\tif(typeof layer.renderer === \"function\"){\r\n\t\t\trenderMethod = layer.renderer;\r\n\t\t\tgetRectangle = basicGetRectangle;\r\n\t\t}else{\r\n\t\t\trenderMethod = layer.renderer.render;\r\n\t\t\tupdateMethod = layer.renderer.update;\r\n\t\t\trenderCallbackMethod = layer.renderer.onrender;\r\n\t\t\t\r\n\t\t\tif(layer.renderer.isInViewPort){\r\n\t\t\t\tspecializedViewPortChecker = layer.renderer.isInViewPort;\r\n\t\t\t}else{\r\n\t\t\t\tgetRectangle = layer.renderer.getRectangle;\r\n\t\t\t}\r\n\r\n\t\t\tif (!getRectangle && getRectangle !== null) {\r\n\t\t\t\tgetRectangle = basicGetRectangle;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar filter = layer.filter;\r\n\r\n\t\tif (node)\r\n\t\t\tnode.setAttribute(gantt.config.layer_attribute, true);\r\n\r\n\t\ttask_area_renderers[id] = {\r\n\t\t\trender_item: function (item, container, viewPort, layerView, viewConfig) {\r\n\t\t\t\tcontainer = container || node;\r\n\t\t\t\tif (filter) {\r\n\t\t\t\t\tif (!filter(item)) {\r\n\t\t\t\t\t\tthis.remove_item(item.id);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar view = layerView || getView(layer);\r\n\t\t\t\tvar config = viewConfig || (view ? view.$getConfig() : null);\r\n\t\t\t\tvar rendererViewPort = viewPort;\r\n\t\t\t\tif(!rendererViewPort && config && config.smart_rendering){\r\n\t\t\t\t\trendererViewPort = view.getViewPort();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar dom = null;\r\n\t\t\t\tif(!isLegacyRender(gantt) && (getRectangle || specializedViewPortChecker) && rendererViewPort){\r\n\t\t\t\t\tvar isVisible = false;\r\n\t\t\t\t\tif(specializedViewPortChecker){\r\n\t\t\t\t\t\tisVisible = specializedViewPortChecker(item, rendererViewPort, view, config, gantt);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tisVisible = genericViewPortChecker(rendererViewPort, getRectangle(item, view, config, gantt), gantt);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(isVisible){\r\n\t\t\t\t\t\tdom = renderMethod.call(gantt, item, view, config, rendererViewPort);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdom = renderMethod.call(gantt, item, view, config, rendererViewPort);\r\n\t\t\t\t}\r\n\t\t\t\tthis.append(item, dom, container);\r\n\r\n\t\t\t\tvar useBuffer = container.nodeType == 11;//DocumentFragment\r\n\t\t\t\tif(renderCallbackMethod && !useBuffer && dom) {\r\n\t\t\t\t\trenderCallbackMethod.call(gantt, item, dom, view);\r\n\t\t\t\t} \r\n\t\t\t},\r\n\r\n\t\t\tclear: function (container) {\r\n\r\n\t\t\t\tthis.rendered = task_area_pulls[id] = {};\r\n\t\t\t\tif(!layer.append)\r\n\t\t\t\t\tthis.clear_container(container);\r\n\t\t\t},\r\n\t\t\tclear_container: function (container) {\r\n\t\t\t\tcontainer = container || node;\r\n\t\t\t\tif (container){\r\n\t\t\t\t\tcontainer.innerHTML = \"\";\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget_visible_range: function(datastore){\r\n\t\t\t\tvar view = getView(layer);\r\n\t\t\t\tvar viewport;\r\n\t\t\t\tvar viewConfig = view ? view.$getConfig() : null;\r\n\t\t\t\tif(viewConfig && viewConfig.smart_rendering){\r\n\t\t\t\t\tviewport = view.getViewPort();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar range;\r\n\t\t\t\tif(view && viewport){\r\n\t\t\t\t\tif(typeof layer.renderer === \"function\"){\r\n\t\t\t\t\t\trange = basicGetRange(gantt, view, viewConfig, datastore, viewport);\r\n\t\t\t\t\t}else if(layer.renderer && layer.renderer.getVisibleRange){\r\n\t\t\t\t\t\trange = layer.renderer.getVisibleRange(gantt, view, viewConfig, datastore, viewport);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!range){\r\n\t\t\t\t\trange = {\r\n\t\t\t\t\t\tstart: 0,\r\n\t\t\t\t\t\tend: datastore.count()\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn range;\r\n\t\t\t},\r\n\t\t\tprepare_data: function(items){\r\n\t\t\t\tif(layer.renderer && layer.renderer.prepareData){\r\n\t\t\t\t\treturn layer.renderer.prepareData(items, gantt, layer);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\trender_items: function (items, container) {\r\n\t\t\t\tcontainer = container || node;\r\n\r\n\t\t\t\tvar buffer = document.createDocumentFragment();\r\n\t\t\t\tthis.clear(container);\r\n\r\n\t\t\t\tvar viewPort = null;\r\n\t\t\t\tvar view = getView(layer);\r\n\t\t\t\tvar viewConfig = view ? view.$getConfig() : null;\r\n\t\t\t\tif(viewConfig && viewConfig.smart_rendering){\r\n\t\t\t\t\tviewPort = view.getViewPort();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (var i = 0, vis = items.length; i < vis; i++) {\r\n\t\t\t\t\tthis.render_item(items[i], buffer, viewPort, view, viewConfig);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcontainer.appendChild(buffer, container);\r\n\r\n\t\t\t\tvar itemsSearch = {};\r\n\t\t\t\titems.forEach(function(item){\r\n\t\t\t\t\titemsSearch[item.id] = item;\r\n\t\t\t\t});\r\n\t\t\t\tvar renderedItems = {};\r\n\t\t\t\tif (renderCallbackMethod) {\r\n\t\t\t\t\tvar newElements = {};\r\n\t\t\t\t\tfor(var i in this.rendered) {\r\n\t\t\t\t\t\tif(!renderedItems[i]){\r\n\t\t\t\t\t\t\tnewElements[i] = this.rendered[i];\r\n\t\t\t\t\t\t\trenderCallbackMethod.call(gantt, itemsSearch[i], this.rendered[i], view);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tupdate_items: function (items, container) {\r\n\t\t\t\tvar view = getView(layer);\r\n\t\t\t\tvar viewConfig = view ? view.$getConfig() : null;\r\n\t\t\t\tif(!view || !view.$getConfig().smart_rendering || isLegacyRender(gantt)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!this.rendered){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(getRectangle || specializedViewPortChecker)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcontainer = container || node;\r\n\r\n\t\t\t\tvar buffer = document.createDocumentFragment();\r\n\r\n\t\t\t\tvar viewPort = null;\r\n\t\t\t\tif(view){\r\n\t\t\t\t\tviewPort = view.getViewPort();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar itemsSearch = {};\r\n\t\t\t\titems.forEach(function(item){\r\n\t\t\t\t\titemsSearch[item.id] = item;\r\n\t\t\t\t});\r\n\t\t\t\tvar renderedItems = {};\r\n\r\n\t\t\t\tvar nodesToRemove = {};\r\n\t\t\t\tfor(var i in this.rendered){\r\n\t\t\t\t\tnodesToRemove[i] = true;\r\n\t\t\t\t\trenderedItems[i] = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar renderCalledFor = {};\r\n\t\t\t\tfor (var i = 0, vis = items.length; i < vis; i++) {\r\n\t\t\t\t\tvar item = items[i];\r\n\t\t\t\t\tvar itemNode = this.rendered[item.id];\r\n\t\t\t\t\tnodesToRemove[item.id] = false;\r\n\t\t\t\t\tif (itemNode && itemNode.parentNode) {\r\n\t\t\t\t\t\tvar isVisible = false;\r\n\t\t\t\t\t\tif(specializedViewPortChecker){\r\n\t\t\t\t\t\t\tisVisible = specializedViewPortChecker(item, viewPort, view, viewConfig, gantt);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tisVisible = genericViewPortChecker(viewPort, getRectangle(item, view, viewConfig, gantt), gantt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!isVisible) {\r\n\t\t\t\t\t\t\tnodesToRemove[item.id] = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif(updateMethod){\r\n\t\t\t\t\t\t\t\tupdateMethod.call(gantt, item, itemNode, view, viewConfig, viewPort);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.restore(item, buffer);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\trenderCalledFor[items[i].id] = true;\r\n\t\t\t\t\t\tthis.render_item(items[i], buffer, viewPort, view, viewConfig);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var i in nodesToRemove){\r\n\t\t\t\t\tif(nodesToRemove[i]){\r\n\t\t\t\t\t\tthis.hide(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(buffer.childNodes.length){\r\n\t\t\t\t\tcontainer.appendChild(buffer, container);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (renderCallbackMethod) {\r\n\t\t\t\t\tvar newElements = {};\r\n\t\t\t\t\tfor(var i in this.rendered) {\r\n\t\t\t\t\t\tif(!renderedItems[i] || renderCalledFor[i]){\r\n\t\t\t\t\t\t\tnewElements[i] = this.rendered[i];\r\n\t\t\t\t\t\t\trenderCallbackMethod.call(gantt, itemsSearch[i], this.rendered[i], view);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tappend: function (item, node, container) {\r\n\t\t\t\tif(!this.rendered){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!node) {\r\n\t\t\t\t\tif (this.rendered[item.id]) {\r\n\t\t\t\t\t\tthis.remove_item(item.id);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.rendered[item.id] && this.rendered[item.id].parentNode) {\r\n\t\t\t\t\tthis.replace_item(item.id, node);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontainer.appendChild(node);\r\n\t\t\t\t}\r\n\t\t\t\tthis.rendered[item.id] = node;\r\n\t\t\t},\r\n\t\t\treplace_item: function (item_id, newNode) {\r\n\t\t\t\tvar item = this.rendered[item_id];\r\n\t\t\t\tif (item && item.parentNode) {\r\n\t\t\t\t\titem.parentNode.replaceChild(newNode, item);\r\n\r\n\t\t\t\t}\r\n\t\t\t\tthis.rendered[item_id] = newNode;\r\n\t\t\t},\r\n\t\t\tremove_item: function (item_id) {\r\n\t\t\t\tthis.hide(item_id);\r\n\t\t\t\tdelete this.rendered[item_id];\r\n\t\t\t},\r\n\t\t\thide: function (item_id) {\r\n\t\t\t\tvar item = this.rendered[item_id];\r\n\t\t\t\tif (item && item.parentNode) {\r\n\t\t\t\t\titem.parentNode.removeChild(item);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\trestore: function (item, container) {\r\n\t\t\t\tvar dom = this.rendered[item.id];\r\n\t\t\t\tif (dom) {\r\n\t\t\t\t\tif (!dom.parentNode) {\r\n\t\t\t\t\t\tthis.append(item, dom, container || node);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.render_item(item, container || node);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tchange_id: function (oldid, newid) {\r\n\t\t\t\tthis.rendered[newid] = this.rendered[oldid];\r\n\t\t\t\tdelete this.rendered[oldid];\r\n\t\t\t},\r\n\t\t\trendered: task_area_pulls[id],\r\n\t\t\tnode: node,\r\n\t\t\tdestructor: function () {\r\n\t\t\t\tthis.clear();\r\n\t\t\t\tdelete task_area_renderers[id];\r\n\t\t\t\tdelete task_area_pulls[id];\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn task_area_renderers[id];\r\n\t}\r\n\r\n\r\n\tfunction clearRenderers() {\r\n\t\tfor (var i in task_area_renderers) {\r\n\t\t\tgetRenderer(i).destructor();\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetRenderer: getRenderer,\r\n\t\tclearRenderers: clearRenderers\r\n\t};\r\n\r\n};\r\n\r\nexport default rendererFactory;","import renderFactoryProvider from \"./render_factory\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport isLegacyRender from \"./is_legacy_smart_render\";\r\n\r\nvar layerFactory = function(gantt){\r\n\r\n\tvar renderFactory = renderFactoryProvider(gantt);\r\n\treturn {\r\n\tcreateGroup: function (getContainer, relativeRoot, defaultFilters, initLayer) {\r\n\r\n\t\tvar renderGroup = {\r\n\t\t\ttempCollection: [],\r\n\t\t\trenderers: {},\r\n\t\t\tcontainer: getContainer,\r\n\t\t\tfilters: [],\r\n\t\t\tgetLayers: function () {\r\n\t\t\t\tthis._add();// add pending layers\r\n\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i in this.renderers) {\r\n\t\t\t\t\tres.push(this.renderers[i]);\r\n\t\t\t\t}\r\n\t\t\t\treturn res;\r\n\t\t\t},\r\n\t\t\tgetLayer: function (id) {\r\n\t\t\t\treturn this.renderers[id];\r\n\t\t\t},\r\n\t\t\t_add: function (layer) {\r\n\t\t\t\tif (layer) {\r\n\t\t\t\t\tlayer.id = layer.id || utils.uid();\r\n\t\t\t\t\tthis.tempCollection.push(layer);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar container = this.container();\r\n\r\n\t\t\t\tvar pending = this.tempCollection;\r\n\t\t\t\tfor (var i = 0; i < pending.length; i++) {\r\n\t\t\t\t\tlayer = pending[i];\r\n\r\n\t\t\t\t\tif (!this.container() && !(layer && layer.container && domHelpers.isChildOf(layer.container, document.body))) continue;\r\n\r\n\t\t\t\t\tvar node = layer.container,\r\n\t\t\t\t\t\tid = layer.id,\r\n\t\t\t\t\t\ttopmost = layer.topmost;\r\n\t\t\t\t\tif (!node.parentNode) {\r\n\t\t\t\t\t\t//insert on top or below the tasks\r\n\t\t\t\t\t\tif (topmost) {\r\n\t\t\t\t\t\t\tcontainer.appendChild(node);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvar rel = relativeRoot ? relativeRoot() : container.firstChild;\r\n\t\t\t\t\t\t\t// GS-1274: if we don't add the second check, Gantt stops working if\r\n\t\t\t\t\t\t\t// we add the task layer without the timeline and switch to a layout with the timeline\r\n\t\t\t\t\t\t\tif (rel && rel.parentNode == container)\r\n\t\t\t\t\t\t\t\tcontainer.insertBefore(node, rel);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tcontainer.appendChild(node);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.renderers[id] = renderFactory.getRenderer(\r\n\t\t\t\t\t\tid,\r\n\t\t\t\t\t\tlayer,\r\n\t\t\t\t\t\tnode\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif (initLayer) {\r\n\t\t\t\t\t\tinitLayer(layer, gantt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.tempCollection.splice(i, 1);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\taddLayer: function (config) {\r\n\t\t\t\tif(config){\r\n\t\t\t\t\tif(typeof config == \"function\"){\r\n\t\t\t\t\t\tconfig = {renderer: config};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(config.filter === undefined){\r\n\t\t\t\t\t\tconfig.filter = mergeFilters(defaultFilters || []);\r\n\t\t\t\t\t}else if(config.filter instanceof Array){\r\n\t\t\t\t\t\tconfig.filter.push(defaultFilters);\r\n\t\t\t\t\t\tconfig.filter = mergeFilters(config.filter);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!config.container){\r\n\t\t\t\t\t\tconfig.container = document.createElement(\"div\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\tconfig.requestUpdate = function(){\r\n\t\t\t\t\t\tif(gantt.config.smart_rendering && !isLegacyRender(gantt)){\r\n\t\t\t\t\t\t\tif(self.renderers[config.id]){\r\n\t\t\t\t\t\t\t\tself.onUpdateRequest(self.renderers[config.id]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._add(config);\r\n\t\t\t\treturn (config ? config.id : undefined);\r\n\t\t\t},\r\n\t\t\tonUpdateRequest: function(layer){\r\n\r\n\t\t\t},\r\n\r\n\t\t\teachLayer: function(code){\r\n\t\t\t\tfor (var i in this.renderers) {\r\n\t\t\t\t\tcode(this.renderers[i]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tremoveLayer: function (id) {\r\n\t\t\t\tif(!this.renderers[id])\r\n\t\t\t\t\treturn;\r\n\t\t\t\tthis.renderers[id].destructor();\r\n\t\t\t\tdelete this.renderers[id];\r\n\t\t\t},\r\n\t\t\tclear: function () {\r\n\t\t\t\tfor (var i in this.renderers) {\r\n\t\t\t\t\tthis.renderers[i].destructor();\r\n\t\t\t\t}\r\n\t\t\t\tthis.renderers = {};\r\n\t\t\t}//,\r\n\t\t\t//prepareConfig: prepareConfig\r\n\t\t};\r\n\r\n\t\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\t\trenderGroup.clear();\r\n\t\t\trenderGroup = null;\r\n\t\t});\r\n\r\n\t\treturn renderGroup;\r\n\t}\r\n};};\r\n\r\n\r\nfunction mergeFilters(filter_methods){\r\n\tif(!(filter_methods instanceof Array)){\r\n\t\tfilter_methods = Array.prototype.slice.call(arguments, 0);\r\n\t}\r\n\r\n\treturn function(obj){\r\n\t\tvar res = true;\r\n\t\tfor(var i = 0, len = filter_methods.length; i < len; i++){\r\n\t\t\tvar filter_method = filter_methods[i];\r\n\t\t\tif(filter_method){\r\n\t\t\t\tres = res && (filter_method(obj.id, obj) !== false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t};\r\n}\r\n\r\n\r\nexport default layerFactory;\r\n","export default function(item, view, config){\r\n\tif(!item.start_date || !item.end_date){\r\n\t\treturn null;\r\n\t}\r\n\tvar padding = 200;\r\n\tvar startCoord = view.posFromDate(item.start_date);\r\n\tvar endCoord = view.posFromDate(item.end_date);\r\n\tvar left = Math.min(startCoord, endCoord) - padding;\r\n\tvar right = Math.max(startCoord, endCoord) + padding;\r\n\treturn {\r\n\t\ttop: view.getItemTop(item.id),\r\n\t\theight: view.getItemHeight(item.id),\r\n\t\tleft: left,\r\n\t\twidth: right - left\r\n\t};\r\n};","import getLinkRectangle from \"../get_link_rectangle\";\r\n\r\nexport default function(){\r\n\tvar coordinates = [];\r\n\tvar calculated = false;\r\n\r\n\tfunction clearCache(){\r\n\t\tcoordinates = [];\r\n\t\tcalculated = false;\r\n\t}\r\n\r\n\tfunction buildCache(datastore, view, gantt){\r\n\t\tvar config = view.$getConfig();\r\n\t\tvar visibleItems = datastore.getVisibleItems();\r\n\t\t//datastore.eachItem(function(link){\r\n\t\tvisibleItems.forEach(function(link){\r\n\t\t\tvar rec = getLinkRectangle(link, view, config, gantt);\r\n\t\t\tif(!rec){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcoordinates.push({id: link.id, rec: rec});\r\n\t\t});\r\n\r\n\t\tcoordinates.sort(function(a, b){\r\n\t\t\tif(a.rec.right < b.rec.right){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcalculated = true;\r\n\t}\r\n\r\n\tvar initialized = false;\r\n\tfunction init(datastore){\r\n\t\tif(initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tinitialized = true;\r\n\t\tdatastore.attachEvent(\"onPreFilter\", clearCache);\r\n\t\tdatastore.attachEvent(\"onStoreUpdated\", clearCache);\r\n\t\tdatastore.attachEvent(\"onClearAll\", clearCache);\r\n\t\tdatastore.attachEvent(\"onBeforeStoreUpdate\", clearCache);\r\n\t}\r\n\r\n\treturn function getVisibleLinksRange(gantt, view, config, datastore, viewport){\r\n\t\tinit(datastore);\r\n\t\tif(!calculated){\r\n\t\t\tbuildCache(datastore, view, gantt);\r\n\t\t}\r\n\r\n\t\tvar visibleBoxes = [];\r\n\t\tfor(var i = 0; i < coordinates.length; i++){\r\n\t\t\tvar item = coordinates[i];\r\n\t\t\tvar box = item.rec;\r\n\t\t\tif(box.right < viewport.x){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(box.left < viewport.x_end && box.right > viewport.x && box.top < viewport.y_end && box.bottom > viewport.y){\r\n\t\t\t\tvisibleBoxes.push(item.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {\r\n\t\t\tids: visibleBoxes\r\n\t\t};\r\n\t};\r\n};","\r\n\r\nimport barRectangle from \"./get_bar_rectangle\";\r\n\r\nexport default function getLinkBox(item, view, config, gantt){\r\n\tif(!gantt.isTaskExists(item.source)){\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif(!gantt.isTaskExists(item.target)){\r\n\t\treturn null;\r\n\t}\r\n\tvar sourceBox = barRectangle(gantt.getTask(item.source), view, gantt);\r\n\tvar targetBox = barRectangle(gantt.getTask(item.target), view, gantt);\r\n\r\n\tif(!sourceBox || !targetBox){\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar padding = 100;\r\n\tvar left = Math.min(sourceBox.left, targetBox.left) - padding;\r\n\tvar right = Math.max(sourceBox.left + sourceBox.width, targetBox.left + targetBox.width) + padding;\r\n\tvar top = Math.min(sourceBox.top, targetBox.top) - padding;\r\n\tvar bottom = Math.max(sourceBox.top + sourceBox.height, targetBox.top + targetBox.height) + padding;\r\n\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: bottom - top,\r\n\t\tbottom,\r\n\t\tleft: left,\r\n\t\twidth: right - left,\r\n\t\tright\r\n\t};\r\n};\r\n","\r\n// optimized checker for links smart rendering\r\n\r\n// first check the vertical position since it's easier to calculate\r\n\r\nexport default function isLinkInViewPort(item, viewport, view, config, gantt){\r\n\tvar source = view.$gantt.getTask(item.source);\r\n\tvar target = view.$gantt.getTask(item.target);\r\n\t// check vertical visibility first since it's a lighter check\r\n\tvar sourceTop = view.getItemTop(source.id);\r\n\tvar sourceHeight = view.getItemHeight(source.id);\r\n\r\n\tvar targetTop = view.getItemTop(target.id);\r\n\tvar targetHeight = view.getItemHeight(target.id);\r\n\r\n\tif(viewport.y > sourceTop + sourceHeight &&\r\n\t\tviewport.y > targetTop + targetHeight){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(viewport.y_end < targetTop &&\r\n\t\tviewport.y_end < sourceTop){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar padding = 100;\r\n\tvar sourceLeft = view.posFromDate(source.start_date);\r\n\tvar sourceRight = view.posFromDate(source.end_date);\r\n\tvar targetLeft = view.posFromDate(target.start_date);\r\n\tvar targetRight = view.posFromDate(target.end_date);\r\n\r\n\tif(sourceLeft > sourceRight){\r\n\t\t// rtl\r\n\t\tvar tmp = sourceRight;\r\n\t\tsourceRight = sourceLeft;\r\n\t\tsourceLeft = tmp;\r\n\t}\r\n\tif(targetLeft > targetRight){\r\n\t\t// rtl\r\n\t\tvar tmp = targetRight;\r\n\t\ttargetRight = targetLeft;\r\n\t\ttargetLeft = tmp;\r\n\t}\r\n\tsourceLeft += -padding; // add buffer for custom elements\r\n\tsourceRight += padding;\r\n\ttargetLeft += -padding; // add buffer for custom elements\r\n\ttargetRight += padding;\r\n\r\n\tif(viewport.x > sourceRight &&\r\n\t\tviewport.x > targetRight){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(viewport.x_end < sourceLeft &&\r\n\t\tviewport.x_end < targetLeft){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\n","import createLayerFactory from \"./render/layer_engine\";\r\n\r\nimport getVisibleTaskRange from \"./render/viewport/get_visible_bars_range\";\r\nimport getVisibleLinksRangeFactory from \"./render/viewport/factory/get_visible_link_range\";\r\n\r\nimport isLinkInViewport from \"./render/viewport/is_link_in_viewport\";\r\n\r\nfunction initLayer(layer, gantt){\r\n\tif(!layer.view){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar view = layer.view;\r\n\tif(typeof view === \"string\"){\r\n\t\tview = gantt.$ui.getView(view);\r\n\t}\r\n\r\n\tif(view && view.attachEvent){\r\n\t\tview.attachEvent(\"onScroll\", function(){\r\n\t\t\tvar state = gantt.$services.getService(\"state\");\r\n\t\t\t// don't repaint if we're inside batchUpdate, a complete repaint will be called afterwards\r\n\t\t\tif(!state.getState(\"batchUpdate\").batch_update && !view.$config.$skipSmartRenderOnScroll){\r\n\t\t\t\tif(layer.requestUpdate){\r\n\t\t\t\t\tlayer.requestUpdate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nvar createLayerEngine = function(gantt){\r\n\tvar factory = createLayerFactory(gantt);\r\n\treturn {\r\n\t\tgetDataRender: function(name){\r\n\t\t\treturn gantt.$services.getService(\"layer:\" + name) || null;\r\n\t\t},\r\n\t\tcreateDataRender: function(config){\r\n\t\t\tvar name = config.name,\r\n\t\t\t\tdefaultContainer = config.defaultContainer,\r\n\t\t\t\tpreviusSiblingContainer = config.defaultContainerSibling;\r\n\r\n\t\t\tvar layers = factory.createGroup(\r\n\t\t\t\tdefaultContainer,\r\n\t\t\t\tpreviusSiblingContainer,\r\n\t\t\t\tfunction(itemId, item){\r\n\t\t\t\t\tif(layers.filters){\r\n\t\t\t\t\t\tfor(var i = 0; i < layers.filters.length; i++){\r\n\t\t\t\t\t\t\tif(layers.filters[i](itemId, item) === false){\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tinitLayer\r\n\t\t\t);\r\n\r\n\t\t\tgantt.$services.setService(\"layer:\" + name, function(){\r\n\t\t\t\treturn layers;\r\n\t\t\t});\r\n\r\n\t\t\tgantt.attachEvent(\"onGanttReady\", function () {\r\n\t\t\t\tlayers.addLayer();// init layers on start\r\n\t\t\t});\r\n\r\n\t\t\treturn layers;\r\n\t\t},\r\n\t\tinit: function(){\r\n\t\t\tvar taskLayers = this.createDataRender({\r\n\t\t\t\tname: \"task\",\r\n\t\t\t\tdefaultContainer: function(){\r\n\t\t\t\t\tif(gantt.$task_data){\r\n\t\t\t\t\t\treturn gantt.$task_data;\r\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\r\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_data;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdefaultContainerSibling: function(){\r\n\t\t\t\t\tif(gantt.$task_links){\r\n\t\t\t\t\t\treturn gantt.$task_links;\r\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\r\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_links;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tfilter: function(item){\r\n\r\n\t\t\t\t}\r\n\t\t\t}, gantt);\r\n\r\n\t\t\tvar linkLayers = this.createDataRender({\r\n\t\t\t\tname: \"link\",\r\n\t\t\t\tdefaultContainer: function(){\r\n\t\t\t\t\tif(gantt.$task_data){\r\n\t\t\t\t\t\treturn gantt.$task_data;\r\n\t\t\t\t\t}else if(gantt.$ui.getView(\"timeline\")){\r\n\t\t\t\t\t\treturn gantt.$ui.getView(\"timeline\").$task_data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, gantt);\r\n\r\n\t\t\treturn {\r\n\t\t\t\taddTaskLayer: function(config){\r\n\t\t\t\t\tconst rangeFunction = getVisibleTaskRange;\r\n\t\t\t\t\tif(typeof config === \"function\"){\r\n\t\t\t\t\t\tconfig = {\r\n\t\t\t\t\t\t\trenderer: {\r\n\t\t\t\t\t\t\t\trender: config,\r\n\t\t\t\t\t\t\t\tgetVisibleRange: rangeFunction\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(config.renderer && !config.renderer.getVisibleRange){\r\n\t\t\t\t\t\t\tconfig.renderer.getVisibleRange = rangeFunction;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconfig.view = \"timeline\";\r\n\r\n\t\t\t\t\treturn taskLayers.addLayer(config);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t_getTaskLayers: function(){\r\n\t\t\t\t\treturn taskLayers.getLayers();\r\n\t\t\t\t},\r\n\t\t\t\tremoveTaskLayer: function(id){\r\n\t\t\t\t\ttaskLayers.removeLayer(id);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t_clearTaskLayers: function(){\r\n\t\t\t\t\ttaskLayers.clear();\r\n\t\t\t\t},\r\n\t\t\t\taddLinkLayer: function(config){\r\n\t\t\t\t\tconst rangeFunction = getVisibleLinksRangeFactory();\r\n\t\t\t\t\tif(typeof config === \"function\"){\r\n\t\t\t\t\t\tconfig = {\r\n\t\t\t\t\t\t\trenderer: {\r\n\t\t\t\t\t\t\t\trender: config,\r\n\t\t\t\t\t\t\t\tgetVisibleRange: rangeFunction\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(config.renderer && !config.renderer.getVisibleRange){\r\n\t\t\t\t\t\t\tconfig.renderer.getVisibleRange = rangeFunction;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconfig.view = \"timeline\";\r\n\t\t\t\t\tif(config && config.renderer){\r\n\t\t\t\t\t\tif(!config.renderer.getRectangle && !config.renderer.isInViewPort){\r\n\t\t\t\t\t\t\tconfig.renderer.isInViewPort = isLinkInViewport;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn linkLayers.addLayer(config);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t_getLinkLayers: function(){\r\n\t\t\t\t\treturn linkLayers.getLayers();\r\n\t\t\t\t},\r\n\t\t\t\tremoveLinkLayer: function(id){\r\n\t\t\t\t\tlinkLayers.removeLayer(id);\r\n\t\t\t\t},\r\n\r\n\t\t\t\t_clearLinkLayers: function(){\r\n\t\t\t\t\tlinkLayers.clear();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t};\r\n};\r\n\r\nexport default createLayerEngine;","import * as utils from \"../../../utils/utils\";\r\nimport eventable from \"../../../utils/eventable\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\n\r\nvar Cell = (function () {\r\n\t\"use strict\";\r\n\r\n\tfunction Cell(parent, config, factory, gantt) {\r\n\t\tif (parent) {\r\n\t\t\tthis.$container = domHelpers.toNode(parent);\r\n\t\t\tthis.$parent = parent;\r\n\t\t}\r\n\t\t// save config\r\n\t\tthis.$config = utils.mixin(config, {\r\n\t\t\theaderHeight: 33\r\n\t\t});\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis.$domEvents = gantt._createDomEventScope();\r\n\t\t// set id\r\n\t\tthis.$id = config.id || \"c\" + utils.uid();\r\n\r\n\t\tthis.$name = \"cell\";\r\n\t\tthis.$factory = factory;\r\n\r\n\t\teventable(this);\r\n\r\n\t}\r\n\r\n\tCell.prototype.destructor = function () {\r\n\t\tthis.$parent = this.$container = this.$view = null;\r\n\t\tvar mouse = this.$gantt.$services.getService(\"mouseEvents\");\r\n\t\tmouse.detach(\"click\", \"gantt_header_arrow\", this._headerClickHandler);\r\n\t\tthis.$domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\t};\r\n\tCell.prototype.cell = function (id) {\r\n\t\treturn null;\r\n\t};\r\n\r\n\tCell.prototype.scrollTo = function(left, top){\r\n\r\n\t\t//GS-333 Add a way to scroll the HTML views:\r\n\t\tvar cell = this.$view;\r\n\t\tif (this.$config.html) cell = this.$view.firstChild;\r\n\r\n\t\tif (left*1 == left){\r\n\t\t\tcell.scrollLeft = left;\r\n\t\t}\r\n\t\tif(top*1 == top){\r\n\t\t\tcell.scrollTop = top;\r\n\t\t}\r\n\t};\r\n\r\n\tCell.prototype.clear = function(){\r\n\t\tthis.getNode().innerHTML = \"\";\r\n\t\tthis.getNode().className = \"gantt_layout_content\";\r\n\t\tthis.getNode().style.padding = \"0\";\r\n\t};\r\n\r\n\tCell.prototype.resize = function (final) {\r\n\t\tif (this.$parent) {\r\n\t\t\treturn this.$parent.resize(final);\r\n\t\t}\r\n\r\n\t\tif(final === false){\r\n\t\t\tthis.$preResize = true;\r\n\t\t}\r\n\r\n\t\tvar topCont = this.$container;\r\n\t\tvar x = topCont.offsetWidth;\r\n\t\tvar y = topCont.offsetHeight;\r\n\t\tvar topSize = this.getSize();\r\n\t\tif (topCont === document.body) {\r\n\t\t\tx = document.body.offsetWidth;\r\n\t\t\ty = document.body.offsetHeight;\r\n\t\t}\r\n\t\tif (x < topSize.minWidth) {\r\n\t\t\tx = topSize.minWidth;\r\n\t\t}\r\n\t\tif (x > topSize.maxWidth) {\r\n\t\t\tx = topSize.maxWidth;\r\n\t\t}\r\n\t\tif (y < topSize.minHeight) {\r\n\t\t\ty = topSize.minHeight;\r\n\t\t}\r\n\t\tif (y > topSize.maxHeight) {\r\n\t\t\ty = topSize.maxHeight;\r\n\t\t}\r\n\t\tthis.setSize(x, y);\r\n\r\n\t\tif(!this.$preResize){\r\n\t\t//\tself.callEvent(\"onResize\", [x, y]);\r\n\t\t}\r\n\t\tthis.$preResize = false;\r\n\t};\r\n\r\n\tCell.prototype.hide = function () {\r\n\t\tthis._hide(true);\r\n\t\tthis.resize();\r\n\t};\r\n\tCell.prototype.show = function (force) {\r\n\t\tthis._hide(false);\r\n\t\tif (force && this.$parent) {\r\n\t\t\tthis.$parent.show();\r\n\t\t}\r\n\t\tthis.resize();\r\n\t};\r\n\tCell.prototype._hide = function (mode) {\r\n\t\tif (mode === true && this.$view.parentNode) {\r\n\t\t\tthis.$view.parentNode.removeChild(this.$view);\r\n\t\t}\r\n\t\telse if (mode === false && !this.$view.parentNode) {\r\n\t\t\tvar index = this.$parent.cellIndex(this.$id);\r\n\t\t\tthis.$parent.moveView(this, index);\r\n\t\t}\r\n\t\tthis.$config.hidden = mode;\r\n\t};\r\n\tCell.prototype.$toHTML = function (content, css) {\r\n\t\tif (content === void 0) { content = \"\"; }\r\n\t\tcss = [(css || \"\"), (this.$config.css || \"\")].join(\" \");\r\n\t\tvar obj = this.$config;\r\n\t\tvar header = \"\";\r\n\t\tif (obj.raw) {\r\n\t\t\tcontent = typeof obj.raw === \"string\" ? obj.raw : \"\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!content) {\r\n\t\t\t\tcontent = \"\" + (obj.html || \"\") + \"
\";\r\n\t\t\t}\r\n\t\t\tif (obj.header) {\r\n\t\t\t\tvar collapseIcon = obj.canCollapse ? \"\" : \"\";\r\n\t\t\t\theader = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\" + header + content + \"
\";\r\n\t};\r\n\tCell.prototype.$fill = function (node, parent) {\r\n\t\tthis.$view = node;\r\n\t\tthis.$parent = parent;\r\n\t\tthis.init();\r\n\t};\r\n\tCell.prototype.getNode = function () {\r\n\t\treturn (this.$view.querySelector(\"gantt_layout_cell\") || this.$view);\r\n\t};\r\n\tCell.prototype.init = function () {\r\n\t\t// [NOT-GOOD] code is executed for each component, while it still has only one handler, it is no good\r\n\r\n\t\tvar self = this;\r\n\r\n\t\tthis._headerClickHandler = function(e){\r\n\t\t\tvar cellId = domHelpers.locateAttribute(e, \"data-cell-id\");\r\n\t\t\tif(cellId == self.$id){\r\n\t\t\t\tself.toggle();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar mouse = this.$gantt.$services.getService(\"mouseEvents\");\r\n\t\tmouse.delegate(\"click\", \"gantt_header_arrow\", this._headerClickHandler);\r\n\r\n\t\tthis.callEvent(\"onReady\", []);\r\n\t};\r\n\tCell.prototype.toggle = function () {\r\n\t\tthis.$config.collapsed = !this.$config.collapsed;\r\n\t\tthis.resize();\r\n\t};\r\n\tCell.prototype.getSize = function () {\r\n\t\tvar size = {\r\n\t\t\theight: this.$config.height || 0,\r\n\t\t\twidth: this.$config.width || 0,\r\n\t\t\tgravity: this.$config.gravity || 1,\r\n\t\t\tminHeight: this.$config.minHeight || 0,\r\n\t\t\tminWidth: this.$config.minWidth || 0,\r\n\t\t\tmaxHeight: this.$config.maxHeight || 100000000000,\r\n\t\t\tmaxWidth: this.$config.maxWidth || 100000000000\r\n\t\t};\r\n\t\tif (this.$config.collapsed) {\r\n\t\t\tvar mode = this.$config.mode === \"x\";\r\n\t\t\tsize[mode ? \"width\" : \"height\"] = size[mode ? \"maxWidth\" : \"maxHeight\"] = this.$config.headerHeight;\r\n\t\t}\r\n\t\treturn size;\r\n\t};\r\n\r\n\tCell.prototype.getContentSize = function(){\r\n\r\n\t\tvar width = this.$lastSize.contentX;\r\n\t\tif(width !== width*1){\r\n\t\t\twidth = this.$lastSize.width;\r\n\t\t}\r\n\r\n\t\tvar height = this.$lastSize.contentY;\r\n\t\tif(height !== height*1){\r\n\t\t\theight = this.$lastSize.height;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\twidth: width,\r\n\t\t\theight: height\r\n\t\t};\r\n\t};\r\n\r\n\tCell.prototype._getBorderSizes = function(){\r\n\t\tvar borders = {\r\n\t\t\ttop: 0,\r\n\t\t\tright: 0,\r\n\t\t\tbottom: 0,\r\n\t\t\tleft: 0,\r\n\t\t\thorizontal: 0,\r\n\t\t\tvertical: 0\r\n\t\t};\r\n\t\tif(this._currentBorders){\r\n\t\t\tif(this._currentBorders[this._borders.left]){\r\n\t\t\t\tborders.left = 1;\r\n\t\t\t\tborders.horizontal++;\r\n\t\t\t}\r\n\r\n\t\t\tif(this._currentBorders[this._borders.right]){\r\n\t\t\t\tborders.right = 1;\r\n\t\t\t\tborders.horizontal++;\r\n\t\t\t}\r\n\r\n\t\t\tif(this._currentBorders[this._borders.top]){\r\n\t\t\t\tborders.top = 1;\r\n\t\t\t\tborders.vertical++;\r\n\t\t\t}\r\n\r\n\t\t\tif(this._currentBorders[this._borders.bottom]){\r\n\t\t\t\tborders.bottom = 1;\r\n\t\t\t\tborders.vertical++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn borders;\r\n\r\n\t};\r\n\r\n\tCell.prototype.setSize = function (x, y) {\r\n\t\tthis.$view.style.width = x + \"px\";\r\n\t\tthis.$view.style.height = y + \"px\";\r\n\r\n\t\tvar borders = this._getBorderSizes();\r\n\t\tvar contentY = y - borders.vertical;\r\n\t\tvar contentX = x - borders.horizontal;\r\n\r\n\t\tthis.$lastSize = { x: x, y: y, contentX: contentX, contentY: contentY };\r\n\t\tif (this.$config.header) {\r\n\t\t\tthis._sizeHeader();\r\n\t\t}else{\r\n\t\t\tthis._sizeContent();\r\n\t\t}\r\n\t};\r\n\r\n\tCell.prototype._borders = {\r\n\t\t\"left\":\"gantt_layout_cell_border_left\",\r\n\t\t\"right\":\"gantt_layout_cell_border_right\",\r\n\t\t\"top\":\"gantt_layout_cell_border_top\",\r\n\t\t\"bottom\":\"gantt_layout_cell_border_bottom\"\r\n\t};\r\n\r\n\tCell.prototype._setBorders = function(css, view){\r\n\t\tif(!view) {\r\n\t\t\tview = this;\r\n\t\t}\r\n\t\tvar node = view.$view;\r\n\r\n\t\tfor( var i in this._borders){\r\n\t\t\tdomHelpers.removeClassName(node, this._borders[i]);\r\n\t\t}\r\n\r\n\t\tif(typeof css == \"string\"){\r\n\t\t\tcss = [css];\r\n\t\t}\r\n\r\n\t\tvar cssHash = {};\r\n\r\n\t\tfor(var i = 0; i < css.length; i++){\r\n\t\t\tdomHelpers.addClassName(node, css[i]);\r\n\t\t\tcssHash[css[i]] = true;\r\n\t\t}\r\n\r\n\t\tview._currentBorders = cssHash;\r\n\t};\r\n\r\n\r\n\tCell.prototype._sizeContent = function(){\r\n\t\tvar content = this.$view.childNodes[0];\r\n\t\tif(content && content.className == \"gantt_layout_content\"){\r\n\t\t\tcontent.style.height = this.$lastSize.contentY + \"px\";\r\n\t\t}\r\n\t};\r\n\r\n\tCell.prototype._sizeHeader = function () {\r\n\t\tvar size = this.$lastSize;\r\n\t\tsize.contentY -= this.$config.headerHeight;\r\n\t\tvar header = this.$view.childNodes[0];\r\n\t\tvar content = this.$view.childNodes[1];\r\n\t\tvar xLayout = this.$config.mode === \"x\";\r\n\t\tif (this.$config.collapsed) {\r\n\t\t\tcontent.style.display = \"none\";\r\n\t\t\tif (xLayout) {\r\n\t\t\t\theader.className = \"gantt_layout_header collapsed_x\";\r\n\t\t\t\theader.style.width = size.y + \"px\";\r\n\t\t\t\tvar d = Math.floor(size.y / 2 - size.x / 2);\r\n\t\t\t\theader.style.transform = \"rotate(90deg) translate(\" + d + \"px, \" + d + \"px)\";\r\n\t\t\t\tcontent.style.display = \"none\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\theader.className = \"gantt_layout_header collapsed_y\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (xLayout) {\r\n\t\t\t\theader.className = \"gantt_layout_header\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\theader.className = \"gantt_layout_header vertical\";\r\n\t\t\t}\r\n\t\t\theader.style.width = 'auto';\r\n\t\t\theader.style.transform = '';\r\n\t\t\tcontent.style.display = \"\";\r\n\t\t\tcontent.style.height = size.contentY + \"px\";\r\n\t\t}\r\n\t\theader.style.height = this.$config.headerHeight + \"px\";\r\n\t};\r\n\treturn Cell;\r\n}());\r\n\r\nexport default Cell;\r\n","export default function (d, b) {\r\n\tfor (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n\tfunction __() { this.constructor = d; }\r\n\td.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n};","import __extends from \"../../../utils/extends\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport Cell from \"./cell\";\r\n\r\nvar Layout = (function (_super) {\r\n\t\"use strict\";\r\n\r\n\t__extends(Layout, _super);\r\n\tfunction Layout(parent, config, factory) {\r\n\t\tvar _this = _super.apply(this, arguments) || this;\r\n\r\n\t\tif(parent)\r\n\t\t\t_this.$root = true;\r\n\r\n\t\t_this._parseConfig(config);\r\n\t\t_this.$name = \"layout\";\r\n\t\treturn _this;\r\n\t}\r\n\r\n\tLayout.prototype.destructor = function () {\r\n\t\tif (this.$container && this.$view) {\r\n\t\t\tdomHelpers.removeNode(this.$view);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\tvar child = this.$cells[i];\r\n\t\t\tchild.destructor();\r\n\t\t}\r\n\t\tthis.$cells = [];\r\n\r\n\t\t_super.prototype.destructor.call(this);\r\n\t};\r\n\r\n\tLayout.prototype._resizeScrollbars = function(autosize, scrollbars){\r\n\t\tvar scrollChanged = false;\r\n\t\tvar visibleScrollbars = [],\r\n\t\t\thiddenScrollbars = [];\r\n\r\n\t\tconst scrollbarsToHide = [];\r\n\r\n\t\tfunction showScrollbar(scrollbar){\r\n\t\t\tscrollbar.$parent.show();\r\n\t\t\tscrollChanged = true;\r\n\t\t\tvisibleScrollbars.push(scrollbar);\r\n\t\t}\r\n\t\tfunction hideScrollbar(scrollbar){\r\n\t\t\tscrollbar.$parent.hide();\r\n\t\t\tscrollChanged = true;\r\n\t\t\thiddenScrollbars.push(scrollbar);\r\n\t\t}\r\n\r\n\t\tvar scrollbar;\r\n\t\tfor(var i = 0; i < scrollbars.length; i++){\r\n\t\t\tscrollbar = scrollbars[i];\r\n\r\n\t\t\tif(autosize[scrollbar.$config.scroll]) {\r\n\t\t\t\thideScrollbar(scrollbar);\r\n\t\t\t}else if(scrollbar.shouldHide()){\r\n\t\t\t\t//hideScrollbar(scrollbar);\r\n\t\t\t\tscrollbarsToHide.push(scrollbar);\r\n\t\t\t}else if(scrollbar.shouldShow()){\r\n\t\t\t\tshowScrollbar(scrollbar);\r\n\t\t\t}else{\r\n\t\t\t\tif(scrollbar.isVisible()){\r\n\t\t\t\t\tvisibleScrollbars.push(scrollbar);\r\n\t\t\t\t}else{\r\n\t\t\t\t\thiddenScrollbars.push(scrollbar);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar visibleGroups = {};\r\n\t\tfor(var i = 0; i < visibleScrollbars.length; i++){\r\n\t\t\tif(visibleScrollbars[i].$config.group){\r\n\t\t\t\tvisibleGroups[visibleScrollbars[i].$config.group] = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// GS-2220\r\n\t\tscrollbarsToHide.forEach(function(scrollbar){\r\n\t\t\tif(!(scrollbar.$config.group && visibleGroups[scrollbar.$config.group])){\r\n\t\t\t\thideScrollbar(scrollbar);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfor(var i = 0; i < hiddenScrollbars.length; i++){\r\n\t\t\tscrollbar = hiddenScrollbars[i];\r\n\r\n\t\t\tif(scrollbar.$config.group && visibleGroups[scrollbar.$config.group]){\r\n\t\t\t\tshowScrollbar(scrollbar);\r\n\t\t\t\t// GS-707 If the scrollbar was hidden then showed, the container resize shouldn't happen because of that\r\n\t\t\t\tfor(var j = 0; j < visibleScrollbars.length; j++){\r\n\t\t\t\t\tif(visibleScrollbars[j] == scrollbar){\r\n\t\t\t\t\t\tthis.$gantt.$scrollbarRepaint = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn scrollChanged;\r\n\t};\r\n\r\n\tLayout.prototype._syncCellSizes = function(groupName, newSize){\r\n\t\tif(!groupName)\r\n\t\t\treturn;\r\n\r\n\t\tvar groups = {};\r\n\r\n\t\tthis._eachChild(function(cell){\r\n\t\t\tif(cell.$config.group && cell.$name != \"scrollbar\" && cell.$name != \"resizer\"){\r\n\t\t\t\tif(!groups[cell.$config.group]){\r\n\t\t\t\t\tgroups[cell.$config.group] = [];\r\n\t\t\t\t}\r\n\t\t\t\tgroups[cell.$config.group].push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(groups[groupName]){\r\n\t\t\tthis._syncGroupSize(groups[groupName], newSize);\r\n\t\t}\r\n\t\treturn groups[groupName];\r\n\t};\r\n\r\n\tLayout.prototype._syncGroupSize = function(cells, newSize){\r\n\t\tif(!cells.length) return;\r\n\r\n\t\tvar property = cells[0].$parent._xLayout ? \"width\" : \"height\";\r\n\t\tvar direction = cells[0].$parent.getNextSibling(cells[0].$id) ? 1 : -1;\r\n\r\n\t\tvar newSizeValue = newSize.value;\r\n\t\tvar isGravity = newSize.isGravity;\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tvar ownSize = cells[i].getSize();\r\n\r\n\t\t\tvar resizeSibling = direction > 0 ? cells[i].$parent.getNextSibling(cells[i].$id) : cells[i].$parent.getPrevSibling(cells[i].$id);\r\n\t\t\tif(resizeSibling.$name == \"resizer\"){\r\n\t\t\t\tresizeSibling = direction > 0 ? resizeSibling.$parent.getNextSibling(resizeSibling.$id) : resizeSibling.$parent.getPrevSibling(resizeSibling.$id);\r\n\t\t\t}\r\n\t\t\tvar siblingSize = resizeSibling.getSize();\r\n\r\n\t\t\tif(!isGravity) {\r\n\t\t\t\tif(resizeSibling[property]){\r\n\t\t\t\t\tvar totalGravity = ownSize.gravity + siblingSize.gravity;\r\n\t\t\t\t\tvar totalSize = ownSize[property] + siblingSize[property];\r\n\t\t\t\t\tvar k = totalGravity / totalSize;\r\n\t\t\t\t\tcells[i].$config.gravity = k * newSizeValue;\r\n\r\n\t\t\t\t\tresizeSibling.$config[property] = totalSize - newSizeValue;\r\n\t\t\t\t\tresizeSibling.$config.gravity = totalGravity - k * newSizeValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcells[i].$config[property] = newSizeValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcells[i].$config.gravity = newSizeValue;\r\n\t\t\t}\r\n\r\n\t\t\tvar mainGrid = this.$gantt.$ui.getView(\"grid\");\r\n\t\t\tif(mainGrid && cells[i].$content === mainGrid && !mainGrid.$config.scrollable && !isGravity){\r\n\t\t\t\tthis.$gantt.config.grid_width = newSizeValue;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype.resize = function(startStage){\r\n\t\tvar mainCall = false;\r\n\t\tif(this.$root && !this._resizeInProgress){\r\n\t\t\tthis.callEvent(\"onBeforeResize\", []);\r\n\t\t\tmainCall = true;\r\n\t\t\tthis._resizeInProgress = true;\r\n\t\t}\r\n\r\n\t\t_super.prototype.resize.call(this, true);\r\n\t\t_super.prototype.resize.call(this, false);\r\n\r\n\t\tif(mainCall){\r\n\r\n\t\t\tvar contentViews = [];\r\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"viewCell\"));\r\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"viewLayout\"));\r\n\t\t\tcontentViews = contentViews.concat(this.getCellsByType(\"hostCell\"));\r\n\r\n\t\t\tvar scrollbars = this.getCellsByType(\"scroller\");\r\n\r\n\t\t\tfor(var i = 0; i < contentViews.length; i++){\r\n\t\t\t\tif(!contentViews[i].$config.hidden)\r\n\t\t\t\t\tcontentViews[i].setContentSize();\r\n\t\t\t}\r\n\r\n\t\t\tvar autosize = this._getAutosizeMode(this.$config.autosize);\r\n\r\n\t/* // possible to rollback set content size when autisize is disabled, not sure if need to\r\n\t\t\tcontentViews.forEach(function(view){\r\n\t\t\t\tconst parent = view.$parent;\r\n\t\t\t\tif(!autosize.x){\r\n\t\t\t\t\tif(parent.$config.$originalWidthStored){\r\n\t\t\t\t\t\tparent.$config.$originalWidthStored = false;\r\n\t\t\t\t\t\tparent.$config.width = parent.$config.$originalWidth;\r\n\t\t\t\t\t\tparent.$config.$originalWidth = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!autosize.y){\r\n\t\t\t\t\tif(parent.$config.$originalHeightStored){\r\n\t\t\t\t\t\tparent.$config.$originalHeightStored = false;\r\n\t\t\t\t\t\tparent.$config.height = parent.$config.$originalHeight;\r\n\t\t\t\t\t\tparent.$config.$originalHeight = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});*/\r\n\t\t\t\r\n\t\t\tvar scrollChanged = this._resizeScrollbars(autosize, scrollbars);\r\n\r\n\t\t\tif(this.$config.autosize){\r\n\t\t\t\tthis.autosize(this.$config.autosize);\r\n\t\t\t\tcontentViews.forEach(function(view){\r\n\t\t\t\t\tconst parent = view.$parent;\r\n\t\t\t\t\tconst sizes = parent.getContentSize(autosize);\r\n\t\t\t\t\tif(autosize.x){\r\n\t\t\t\t\t\tif(!parent.$config.$originalWidthStored){\r\n\t\t\t\t\t\t\tparent.$config.$originalWidthStored = true;\r\n\t\t\t\t\t\t\tparent.$config.$originalWidth = parent.$config.width;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tparent.$config.width = sizes.width;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(autosize.y){\r\n\t\t\t\t\t\tif(!parent.$config.$originalHeightStored){\r\n\t\t\t\t\t\t\tparent.$config.$originalHeightStored = true;\r\n\t\t\t\t\t\t\tparent.$config.$originalHeight = parent.$config.height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tparent.$config.height = sizes.height;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tscrollChanged = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(scrollChanged){\r\n\t\t\t\tthis.resize();\r\n\t\t\t\tfor(var i = 0; i < contentViews.length; i++){\r\n\t\t\t\t\tif(!contentViews[i].$config.hidden)\r\n\t\t\t\t\t\tcontentViews[i].setContentSize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.callEvent(\"onResize\", []);\r\n\t\t}\r\n\t\tif(mainCall){\r\n\t\t\tthis._resizeInProgress = false;\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype._eachChild = function(code, cell){\r\n\t\tcell = cell || this;\r\n\t\tcode(cell);\r\n\t\tif(cell.$cells){\r\n\t\t\tfor(var i = 0; i < cell.$cells.length; i++){\r\n\t\t\t\tthis._eachChild(code, cell.$cells[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype.isChild = function(view){\r\n\t\tvar res = false;\r\n\t\tthis._eachChild(function(child){\r\n\t\t\tif(child === view || child.$content === view){\r\n\t\t\t\tres = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn res;\r\n\t};\r\n\r\n\tLayout.prototype.getCellsByType = function(type){\r\n\t\tvar res = [];\r\n\t\tif(type === this.$name){\r\n\t\t\tres.push(this);\r\n\t\t}\r\n\r\n\t\tif(this.$content && this.$content.$name == type){\r\n\t\t\tres.push(this.$content);\r\n\t\t}\r\n\r\n\t\tif(this.$cells){\r\n\t\t\tfor(var i = 0; i < this.$cells.length; i++){\r\n\t\t\t\tvar children = Layout.prototype.getCellsByType.call(this.$cells[i], type);\r\n\t\t\t\tif(children.length){\r\n\t\t\t\t\tres.push.apply(res, children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tLayout.prototype.getNextSibling = function(cellId){\r\n\t\tvar index = this.cellIndex(cellId);\r\n\t\tif(index >= 0 && this.$cells[index + 1]){\r\n\t\t\treturn this.$cells[index + 1];\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype.getPrevSibling = function(cellId){\r\n\t\tvar index = this.cellIndex(cellId);\r\n\t\tif(index >= 0 && this.$cells[index - 1]){\r\n\t\t\treturn this.$cells[index - 1];\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tLayout.prototype.cell = function (id) {\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\tvar child = this.$cells[i];\r\n\t\t\tif (child.$id === id) {\r\n\t\t\t\treturn child;\r\n\t\t\t}\r\n\t\t\tvar sub = child.cell(id);\r\n\t\t\tif (sub) {\r\n\t\t\t\treturn sub;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tLayout.prototype.cellIndex = function (id) {\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\tif (this.$cells[i].$id === id) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t};\r\n\tLayout.prototype.moveView = function (view, ind) {\r\n\t\tif (this.$cells[ind] !== view) {\r\n\t\t\treturn window.alert(\"Not implemented\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tind += this.$config.header ? 1 : 0;\r\n\t\t\tvar node = this.$view;\r\n\t\t\tif (ind >= node.childNodes.length) {\r\n\t\t\t\tnode.appendChild(view.$view);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnode.insertBefore(view.$view, node.childNodes[ind]);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tLayout.prototype._parseConfig = function (config) {\r\n\t\tthis.$cells = [];\r\n\t\tthis._xLayout = !config.rows;\r\n\t\tvar cells = config.rows || config.cols || config.views;\r\n\t\tfor (var i = 0; i < cells.length; i++) {\r\n\t\t\tvar cell = cells[i];\r\n\t\t\tcell.mode = this._xLayout ? \"x\" : \"y\";\r\n\t\t\tvar $content = this.$factory.initUI(cell, this);\r\n\t\t\tif(!$content){\r\n\t\t\t\tcells.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}else{\r\n\t\t\t\t$content.$parent = this;\r\n\t\t\t\tthis.$cells.push($content);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tLayout.prototype.getCells = function () {\r\n\t\treturn this.$cells;\r\n\t};\r\n\tLayout.prototype.render = function () {\r\n\t\tvar view = domHelpers.insertNode(this.$container, this.$toHTML());\r\n\t\tthis.$fill(view, null);\r\n\t\tthis.callEvent(\"onReady\", []);\r\n\t\tthis.resize();\r\n\r\n\t\t// do simple repaint after the first call\r\n\t\tthis.render = this.resize;\r\n\t};\r\n\tLayout.prototype.$fill = function (node, parent) {\r\n\t\tthis.$view = node;\r\n\t\tthis.$parent = parent;\r\n\t\tvar cells = domHelpers.getChildNodes(node, \"gantt_layout_cell\");\r\n\t\tfor (var i = cells.length - 1; i >= 0; i--) {\r\n\t\t\tvar sub = this.$cells[i];\r\n\t\t\tsub.$fill(cells[i], this);\r\n\t\t\t// initially hidden cell\r\n\t\t\tif (sub.$config.hidden) {\r\n\t\t\t\tsub.$view.parentNode.removeChild(sub.$view);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tLayout.prototype.$toHTML = function () {\r\n\t\tvar mode = this._xLayout ? \"x\" : \"y\";\r\n\t\tvar html = [];\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\thtml.push(this.$cells[i].$toHTML());\r\n\t\t}\r\n\t\treturn _super.prototype.$toHTML.call(this, html.join(\"\"), (this.$root ? \"gantt_layout_root \" : \"\") + \"gantt_layout gantt_layout_\" + mode);\r\n\t};\r\n\r\n\tLayout.prototype.getContentSize = function(mode){\r\n\t\tvar contentWidth = 0,\r\n\t\t\tcontentHeight = 0;\r\n\r\n\t\tvar cellSize, cell, borders;\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\tcell = this.$cells[i];\r\n\t\t\tif(cell.$config.hidden)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tcellSize = cell.getContentSize(mode);\r\n\r\n\t\t\tif(cell.$config.view === \"scrollbar\" && mode[cell.$config.scroll]){\r\n\t\t\t\tcellSize.height = 0;\r\n\t\t\t\tcellSize.width = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(cell.$config.resizer){\r\n\t\t\t\tif(this._xLayout){\r\n\t\t\t\t\tcellSize.height = 0;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellSize.width = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tborders = cell._getBorderSizes();\r\n\r\n\t\t\tif(this._xLayout){\r\n\t\t\t\tcontentWidth += (cellSize.width + borders.horizontal);\r\n\t\t\t\tcontentHeight = Math.max(contentHeight, (cellSize.height + borders.vertical));\r\n\t\t\t}else{\r\n\t\t\t\tcontentWidth = Math.max(contentWidth, cellSize.width + borders.horizontal);\r\n\t\t\t\tcontentHeight += cellSize.height + borders.vertical;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tborders = this._getBorderSizes();\r\n\t\tcontentWidth += borders.horizontal;\r\n\t\tcontentHeight += borders.vertical;\r\n\r\n\t\t// GS-149 & GS-150: By default this code only increases the container sizes, because of that, the cell sizes\r\n\t\t// are also increased. Keep this code here in the case if something goes wrong\r\n\t\t/*\r\n\t\tif(this.$root){\r\n\t\t\tcontentWidth += 1;\r\n\t\t\tcontentHeight += 1;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn {\r\n\t\t\twidth: contentWidth,\r\n\t\t\theight: contentHeight\r\n\t\t};\r\n\t};\r\n\r\n\tLayout.prototype._cleanElSize = function(value){\r\n\t\treturn ((value || \"\").toString().replace(\"px\", \"\") * 1 || 0);\r\n\t};\r\n\tLayout.prototype._getBoxStyles = function(div){\r\n\t\tvar computed = null;\r\n\t\tif(window.getComputedStyle){\r\n\t\t\tcomputed = window.getComputedStyle(div, null);\r\n\t\t}else{\r\n\t\t\t//IE with elem.currentStyle does not calculate sizes from %, so will use the default approach\r\n\t\t\tcomputed = {\r\n\t\t\t\t\"width\":div.clientWidth,\r\n\t\t\t\t\"height\":div.clientHeight\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar properties = [\r\n\t\t\t\"width\",\r\n\t\t\t\"height\",\r\n\r\n\t\t\t\"paddingTop\",\r\n\t\t\t\"paddingBottom\",\r\n\t\t\t\"paddingLeft\",\r\n\t\t\t\"paddingRight\",\r\n\r\n\t\t\t\"borderLeftWidth\",\r\n\t\t\t\"borderRightWidth\",\r\n\t\t\t\"borderTopWidth\",\r\n\t\t\t\"borderBottomWidth\"\r\n\t\t];\r\n\t\tvar styles = {\r\n\t\t\tboxSizing:(computed.boxSizing == \"border-box\")\r\n\t\t};\r\n\r\n\t\tif(computed.MozBoxSizing){\r\n\t\t\tstyles.boxSizing = (computed.MozBoxSizing == \"border-box\");\r\n\t\t}\r\n\t\tfor(var i =0; i < properties.length; i++){\r\n\t\t\tstyles[properties[i]] = computed[properties[i]] ? this._cleanElSize(computed[properties[i]]) : 0;\r\n\t\t}\r\n\r\n\r\n\t\tvar box = {\r\n\t\t\thorPaddings : (styles.paddingLeft + styles.paddingRight + styles.borderLeftWidth + styles.borderRightWidth),\r\n\t\t\tvertPaddings : (styles.paddingTop + styles.paddingBottom + styles.borderTopWidth + styles.borderBottomWidth),\r\n\t\t\tborderBox: styles.boxSizing,\r\n\t\t\tinnerWidth : styles.width,\r\n\t\t\tinnerHeight : styles.height,\r\n\t\t\touterWidth : styles.width,\r\n\t\t\touterHeight : styles.height\r\n\t\t};\r\n\r\n\r\n\t\tif(box.borderBox){\r\n\t\t\tbox.innerWidth -= box.horPaddings;\r\n\t\t\tbox.innerHeight -= box.vertPaddings;\r\n\t\t}else{\r\n\t\t\tbox.outerWidth += box.horPaddings;\r\n\t\t\tbox.outerHeight += box.vertPaddings;\r\n\t\t}\r\n\r\n\t\treturn box;\r\n\t};\r\n\r\n\tLayout.prototype._getAutosizeMode = function(config){\r\n\t\tvar res = {x:false, y:false};\r\n\t\tif(config === \"xy\"){\r\n\t\t\tres.x = res.y = true;\r\n\t\t}else if(config === \"y\" || config === true){\r\n\t\t\tres.y = true;\r\n\t\t}else if(config === \"x\"){\r\n\t\t\tres.x = true;\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tLayout.prototype.autosize = function(mode) {\r\n\t\tvar res = this._getAutosizeMode(mode);\r\n\t\tvar boxSizes = this._getBoxStyles(this.$container);\r\n\t\tvar contentSizes = this.getContentSize(mode);\r\n\r\n\t\tvar node = this.$container;\r\n\t\tif(res.x){\r\n\t\t\tif(boxSizes.borderBox){\r\n\t\t\t\tcontentSizes.width += boxSizes.horPaddings;\r\n\t\t\t}\r\n\t\t\tnode.style.width = contentSizes.width + \"px\";\r\n\t\t}\r\n\t\tif(res.y){\r\n\t\t\tif(boxSizes.borderBox){\r\n\t\t\t\tcontentSizes.height += boxSizes.vertPaddings;\r\n\t\t\t}\r\n\t\t\tnode.style.height = contentSizes.height + \"px\";\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype.getSize = function () {\r\n\t\tthis._sizes = [];\r\n\t\tvar width = 0;\r\n\t\tvar minWidth = 0;\r\n\t\tvar maxWidth = 100000000000;\r\n\t\tvar height = 0;\r\n\t\tvar maxHeight = 100000000000;\r\n\t\tvar minHeight = 0;\r\n\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\r\n\t\t\tvar size = this._sizes[i] = this.$cells[i].getSize();\r\n\t\t\tif (this.$cells[i].$config.hidden) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (this._xLayout) {\r\n\t\t\t\tif (!size.width && size.minWidth) {\r\n\t\t\t\t\twidth += size.minWidth;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\twidth += size.width;\r\n\t\t\t\t}\r\n\t\t\t\tmaxWidth += size.maxWidth;\r\n\t\t\t\tminWidth += size.minWidth;\r\n\t\t\t\theight = Math.max(height, size.height);\r\n\t\t\t\tmaxHeight = Math.min(maxHeight, size.maxHeight); // min of maxHeight\r\n\t\t\t\tminHeight = Math.max(minHeight, size.minHeight); // max of minHeight\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (!size.height && size.minHeight) {\r\n\t\t\t\t\theight += size.minHeight;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\theight += size.height;\r\n\t\t\t\t}\r\n\t\t\t\tmaxHeight += size.maxHeight;\r\n\t\t\t\tminHeight += size.minHeight;\r\n\t\t\t\twidth = Math.max(width, size.width);\r\n\t\t\t\tmaxWidth = Math.min(maxWidth, size.maxWidth); // min of maxWidth\r\n\t\t\t\tminWidth = Math.max(minWidth, size.minWidth); // max of minWidth\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar self = _super.prototype.getSize.call(this);\r\n\t\t// maxWidth\r\n\t\tif (self.maxWidth >= 100000) {\r\n\t\t\tself.maxWidth = maxWidth;\r\n\t\t}\r\n\t\t// maxHeight\r\n\t\tif (self.maxHeight >= 100000) {\r\n\t\t\tself.maxHeight = maxHeight;\r\n\t\t}\r\n\t\t// minWidth\r\n\t\tself.minWidth = self.minWidth !== self.minWidth ? 0 : self.minWidth;// || self.width || Math.max(minWidth, width);\r\n\t\t// minHeight\r\n\t\tself.minHeight = self.minHeight !== self.minHeight ? 0 : self.minHeight;//self.minHeight || self.height || Math.max(minHeight, height);\r\n\t\t// sizes with paddings and margins\r\n\t\tif (this._xLayout) {\r\n\t\t\tself.minWidth += this.$config.margin * (this.$cells.length) || 0;\r\n\t\t\tself.minWidth += this.$config.padding * 2 || 0;\r\n\t\t\tself.minHeight += (this.$config.padding * 2) || 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tself.minHeight += this.$config.margin * (this.$cells.length) || 0;\r\n\t\t\tself.minHeight += (this.$config.padding * 2) || 0;\r\n\t\t}\r\n\t\t\r\n\t\treturn self;\r\n\t};\r\n\t// calc total gravity and free space\r\n\tLayout.prototype._calcFreeSpace = function (s, cell, xLayout) {\r\n\t\tvar min = xLayout ? cell.minWidth : cell.minHeight;\r\n\t\tvar max = xLayout ? cell.maxWidth : cell.maxWidth;\r\n\t\tvar side = s;\r\n\t\tif (!side) {\r\n\t\t\tside = Math.floor(this._free / this._gravity * cell.gravity);\r\n\t\t\tif (side > max) {\r\n\t\t\t\tside = max;\r\n\t\t\t\tthis._free -= side;\r\n\t\t\t\tthis._gravity -= cell.gravity;\r\n\t\t\t}\r\n\t\t\tif (side < min) {\r\n\t\t\t\tside = min;\r\n\t\t\t\tthis._free -= side;\r\n\t\t\t\tthis._gravity -= cell.gravity;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (side > max) {\r\n\t\t\t\tside = max;\r\n\t\t\t}\r\n\t\t\tif (side < min) {\r\n\t\t\t\tside = min;\r\n\t\t\t}\r\n\t\t\tthis._free -= side;\r\n\t\t}\r\n\t\treturn side;\r\n\t};\r\n\tLayout.prototype._calcSize = function (s, size, xLayout) {\r\n\t\tvar side = s;\r\n\t\tvar min = xLayout ? size.minWidth : size.minHeight;\r\n\t\tvar max = xLayout ? size.maxWidth : size.maxHeight;\r\n\t\tif (!side) {\r\n\t\t\tside = Math.floor(this._free / this._gravity * size.gravity);\r\n\t\t}\r\n\t\tif (side > max) {\r\n\t\t\tside = max;\r\n\t\t}\r\n\t\tif (side < min) {\r\n\t\t\tside = min;\r\n\t\t}\r\n\t\treturn side;\r\n\t};\r\n\r\n\tLayout.prototype._configureBorders = function(){\r\n\t\tif(this.$root){\r\n\t\t\tthis._setBorders([\r\n\t\t\t\tthis._borders.left,\r\n\t\t\t\tthis._borders.top,\r\n\t\t\t\tthis._borders.right,\r\n\t\t\t\tthis._borders.bottom\r\n\t\t\t],\r\n\t\t\tthis);\r\n\t\t}\r\n\r\n\t\tvar borderClass = this._xLayout ? this._borders.right : this._borders.bottom;\r\n\r\n\t\tvar cells = this.$cells;\r\n\r\n\t\tvar lastVisibleIndex = cells.length - 1;\r\n\t\tfor(var i = lastVisibleIndex; i >= 0; i--){\r\n\t\t\tif (!cells[i].$config.hidden) {\r\n\t\t\t\tlastVisibleIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < cells.length; i++) {\r\n\t\t\tif (cells[i].$config.hidden) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tvar lastCell = i >= lastVisibleIndex;\r\n\t\t\tvar borderColorClass = \"\";\r\n\t\t\tif(!lastCell && cells[i + 1]){\r\n\t\t\t\tif(cells[i + 1].$config.view == \"scrollbar\"){\r\n\t\t\t\t\tif(this._xLayout){\r\n\t\t\t\t\t\tlastCell = true;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tborderColorClass = \"gantt_layout_cell_border_transparent\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis._setBorders(lastCell ? [] : [borderClass, borderColorClass], cells[i]);\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype._updateCellVisibility = function(){\r\n\t\tvar oldVisibleCells = this._visibleCells || {};\r\n\t\tvar firstCall = !this._visibleCells;\r\n\t\tvar visibleCells = {};\r\n\t\tvar cell = null;\r\n\t\tvar parentVisibility = [];\r\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\r\n\t\t\tcell = this.$cells[i];\r\n\t\t\tif (cell.$config.hide_empty){\r\n\t\t\t\tparentVisibility.push(cell);\r\n\t\t\t}\r\n\r\n\t\t\tif (!firstCall && cell.$config.hidden && oldVisibleCells[cell.$id]) {\r\n\t\t\t\tcell._hide(true);\r\n\t\t\t}else if(!cell.$config.hidden && !oldVisibleCells[cell.$id]){\r\n\t\t\t\tcell._hide(false);\r\n\t\t\t}\r\n\r\n\t\t\tif(!cell.$config.hidden){\r\n\t\t\t\tvisibleCells[cell.$id] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis._visibleCells = visibleCells;\r\n\r\n\t\t// GS-27. A way to hide the whole cell if all its children are hidden\r\n\t\tfor (var i = 0; i < parentVisibility.length; i++) {\r\n\t\t\tvar cell = parentVisibility[i];\r\n\t\t\tvar children = cell.$cells;\r\n\t\t\tvar hideCell = true;\r\n\t\t\tchildren.forEach(function(child){\r\n\t\t\t\tif (!child.$config.hidden && !child.$config.resizer){\r\n\t\t\t\t\thideCell = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcell.$config.hidden = hideCell;\r\n\t\t}\r\n\t};\r\n\r\n\tLayout.prototype.setSize = function (x, y) {\r\n\t\tthis._configureBorders();\r\n\t\t_super.prototype.setSize.call(this, x, y);\r\n\t\ty = this.$lastSize.contentY;\r\n\t\tx = this.$lastSize.contentX;\r\n\r\n\t\tvar padding = (this.$config.padding || 0);\r\n\t\tthis.$view.style.padding = padding + \"px\";\r\n\t\tthis._gravity = 0;\r\n\t\tthis._free = this._xLayout ? x : y;\r\n\t\tthis._free -= padding * 2;\r\n\t\t// calc all gravity\r\n\r\n\t\tvar cell,\r\n\t\t\tsize;\r\n\r\n\t\tthis._updateCellVisibility();\r\n\r\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\r\n\t\t\tcell = this.$cells[i];\r\n\r\n\t\t\tif (cell.$config.hidden) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tvar margin = (this.$config.margin || 0);\r\n\t\t\tif(cell.$name == \"resizer\" && !margin){\r\n\t\t\t\tmargin = -1;\r\n\t\t\t}\r\n\r\n\t\t\t// set margins to child cell\r\n\t\t\tvar cellView = cell.$view;\r\n\r\n\t\t\tvar marginSide = this._xLayout ? \"marginRight\" : \"marginBottom\";\r\n\t\t\tif (i !== this.$cells.length - 1) {\r\n\t\t\t\tcellView.style[marginSide] = margin + \"px\";\r\n\t\t\t\tthis._free -= margin; // calc free space without margin\r\n\t\t\t}\r\n\t\t\tsize = this._sizes[i];\r\n\t\t\tif (this._xLayout) {\r\n\t\t\t\tif (!size.width) {\r\n\t\t\t\t\tthis._gravity += size.gravity;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (!size.height) {\r\n\t\t\t\t\tthis._gravity += size.gravity;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var i = 0; i < this._sizes.length; i++) {\r\n\t\t\tcell = this.$cells[i];\r\n\r\n\t\t\tif (cell.$config.hidden) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tsize = this._sizes[i];\r\n\t\t\tvar width = size.width;\r\n\t\t\tvar height = size.height;\r\n\t\t\tif (this._xLayout) {\r\n\t\t\t\tthis._calcFreeSpace(width, size, true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis._calcFreeSpace(height, size, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\tcell = this.$cells[i];\r\n\r\n\t\t\tif (cell.$config.hidden) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tsize = this._sizes[i];\r\n\t\t\tvar dx = void 0;\r\n\t\t\tvar dy = void 0;\r\n\t\t\tif (this._xLayout) {\r\n\t\t\t\tdx = this._calcSize(size.width, size, true);\r\n\t\t\t\tdy = y - padding * 2; // layout height without paddings\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdx = x - padding * 2; // layout width without paddings\r\n\t\t\t\tdy = this._calcSize(size.height, size, false);\r\n\t\t\t}\r\n\r\n\t\t\tcell.setSize(dx, dy);\r\n\t\t}\r\n\r\n\t};\r\n\r\n\treturn Layout;\r\n}(Cell));\r\n\r\nexport default Layout;","import __extends from \"../../../utils/extends\";\r\nimport Layout from \"./layout\";\r\nimport Cell from \"./cell\";\r\n\r\nvar ViewLayout = (function (_super) {\r\n\t\"use strict\";\r\n\r\n\t__extends(ViewLayout, _super);\r\n\tfunction ViewLayout(parent, config, factory) {\r\n\t\tvar _this = _super.apply(this, arguments) || this;\r\n\t\tfor (var i = 0; i < _this.$cells.length; i++) {\r\n\t\t\t_this.$cells[i].$config.hidden = (i !== 0);\r\n\t\t}\r\n\t\t_this.$cell = _this.$cells[0];\r\n\t\t_this.$name = \"viewLayout\";\r\n\r\n\t\treturn _this;\r\n\t}\r\n\tViewLayout.prototype.cell = function (id) {\r\n\t\tvar cell = _super.prototype.cell.call(this, id);\r\n\t\tif (!cell.$view) {\r\n\t\t\tthis.$fill(null, this);\r\n\t\t}\r\n\t\treturn cell;\r\n\t};\r\n\tViewLayout.prototype.moveView = function (view) {\r\n\t\tvar body = this.$view;\r\n\t\tif (this.$cell) {\r\n\t\t\tthis.$cell.$config.hidden = true;\r\n\t\t\tbody.removeChild(this.$cell.$view);\r\n\t\t}\r\n\t\tthis.$cell = view;\r\n\t\tbody.appendChild(view.$view);\r\n\t};\r\n\tViewLayout.prototype.setSize = function (x, y) {\r\n\t\tCell.prototype.setSize.call(this, x, y);\r\n\t};\r\n\r\n\tViewLayout.prototype.setContentSize = function(){\r\n\t\tvar size = this.$lastSize;\r\n\t\tthis.$cell.setSize(size.contentX, size.contentY);\r\n\t};\r\n\r\n\tViewLayout.prototype.getSize = function () {\r\n\t\tvar sizes = _super.prototype.getSize.call(this);\r\n\t\tif (this.$cell) {\r\n\t\t\tvar cellSize = this.$cell.getSize();\r\n\t\t\tif (this.$config.byMaxSize) {\r\n\t\t\t\tfor (var i = 0; i < this.$cells.length; i++) {\r\n\t\t\t\t\tvar otherCell = this.$cells[i].getSize();\r\n\t\t\t\t\tfor (var cell in cellSize) {\r\n\t\t\t\t\t\tcellSize[cell] = Math.max(cellSize[cell], otherCell[cell]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var size in sizes) {\r\n\t\t\t\tsizes[size] = sizes[size] || cellSize[size];\r\n\t\t\t}\r\n\t\t\tsizes.gravity = Math.max(sizes.gravity, cellSize.gravity);\r\n\t\t}\r\n\t\treturn sizes;\r\n\t};\r\n\treturn ViewLayout;\r\n}(Layout));\r\n\r\nexport default ViewLayout;","import __extends from \"../../../utils/extends\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport Cell from \"./cell\";\r\n\r\nvar ViewCell = (function (_super) {\r\n\t\"use strict\";\r\n\r\n\t__extends(ViewCell, _super);\r\n\tfunction ViewCell(parent, config, factory) {\r\n\r\n\t\tvar _this = _super.apply(this, arguments) || this;\r\n\r\n\t\tif(config.view){\r\n\t\t\tif(config.id){\r\n\t\t\t\t// pass id to the nested view\r\n\t\t\t\tthis.$id = utils.uid();\r\n\t\t\t}\r\n\t\t\tvar childConfig = utils.copy(config);\r\n\t\t\tdelete childConfig.config;\r\n\t\t\tdelete childConfig.templates;\r\n\r\n\t\t\tthis.$content = this.$factory.createView(config.view, this, childConfig, this);\r\n\t\t\tif(!this.$content)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t_this.$name = \"viewCell\";\r\n\t\treturn _this;\r\n\t}\r\n\r\n\tViewCell.prototype.destructor = function(){\r\n\t\tthis.clear();\r\n\t\t_super.prototype.destructor.call(this);\r\n\t};\r\n\r\n\tViewCell.prototype.clear = function(){\r\n\r\n\t\tthis.$initialized = false;\r\n\r\n\t\t// call destructor\r\n\t\tif (this.$content){\r\n\t\t\tvar method = this.$content.unload || this.$content.destructor;\r\n\t\t\tif (method){\r\n\t\t\t\tmethod.call(this.$content);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_super.prototype.clear.call(this);\r\n\r\n\t};\r\n\r\n\tViewCell.prototype.scrollTo = function(left, top){\r\n\r\n\t\tif(this.$content && this.$content.scrollTo){\r\n\t\t\tthis.$content.scrollTo(left, top);\r\n\t\t}else{\r\n\t\t\t_super.prototype.scrollTo.call(this, left, top);\r\n\t\t}\r\n\t};\r\n\r\n\tViewCell.prototype._setContentSize = function(x, y){\r\n\t\tvar borders = this._getBorderSizes();\r\n\t\tif(typeof x === \"number\"){\r\n\t\t\tvar outerX = x + borders.horizontal;\r\n\t\t\tthis.$config.width = outerX;\r\n\t\t}\r\n\t\tif(typeof y === \"number\"){\r\n\t\t\tvar outerY = y + borders.vertical;\r\n\t\t\tthis.$config.height = outerY;\r\n\t\t}\r\n\t};\r\n\r\n\tViewCell.prototype.setSize = function(x, y){\r\n\t\t_super.prototype.setSize.call(this, x, y);\r\n\r\n\t\tif(!this.$preResize && this.$content) {\r\n\t\t\tif (!this.$initialized) {\r\n\t\t\t\tthis.$initialized = true;\r\n\t\t\t\tvar header = this.$view.childNodes[0];\r\n\t\t\t\tvar content = this.$view.childNodes[1];\r\n\t\t\t\tif(!content) content = header;\r\n\r\n\t\t\t\t/*if(this.$content.$config){\r\n\t\t\t\t\tthis.$content.$config.width = this.$lastSize.contentX;\r\n\t\t\t\t\tthis.$content.$config.height = this.$lastSize.contentY;\r\n\t\t\t\t}*/\r\n\t\t\t\tthis.$content.init(content);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tViewCell.prototype.setContentSize = function(){\r\n\t\tif(!this.$preResize && this.$content) {\r\n\t\t\tif (this.$initialized) {\r\n\t\t\t\tthis.$content.setSize(this.$lastSize.contentX, this.$lastSize.contentY);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tViewCell.prototype.getContentSize = function(){\r\n\t\tvar size = _super.prototype.getContentSize.call(this);\r\n\r\n\t\tif(this.$content && this.$initialized){\r\n\t\t\tvar childSize = this.$content.getSize();\r\n\t\t\tsize.width = childSize.contentX === undefined ? childSize.width : childSize.contentX;\r\n\t\t\tsize.height = childSize.contentY === undefined ? childSize.height : childSize.contentY;\r\n\t\t}\r\n\r\n\t\tvar borders = this._getBorderSizes();\r\n\t\tsize.width += borders.horizontal;\r\n\t\tsize.height += borders.vertical;\r\n\r\n\t\treturn size;\r\n\t};\r\n\r\n\treturn ViewCell;\r\n}(Cell));\r\n\r\nexport default ViewCell;","import __extends from \"../../../utils/extends\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport env from \"../../../utils/env\";\r\nimport Cell from \"./cell\";\r\n\r\nvar ScrollbarCell = (function (_super) {\r\n\t\"use strict\";\r\n\r\n\tvar SCROLL_MODIFIER_KEYS = [\"altKey\", \"shiftKey\", \"metaKey\"]; // it's no way to disable ctrl+wheel\r\n\t__extends(ScrollbarCell, _super);\r\n\tfunction ScrollbarCell(parent, config, factory, gantt) {\r\n\r\n\t\tvar _this = _super.apply(this, arguments) || this;\r\n\t\tthis.$config = utils.mixin(config, {scroll: \"x\"});\r\n\t\t_this._scrollHorizontalHandler = utils.bind(_this._scrollHorizontalHandler, _this);\r\n\t\t_this._scrollVerticalHandler = utils.bind(_this._scrollVerticalHandler, _this);\r\n\t\t_this._outerScrollVerticalHandler = utils.bind(_this._outerScrollVerticalHandler, _this);\r\n\t\t_this._outerScrollHorizontalHandler = utils.bind(_this._outerScrollHorizontalHandler, _this);\r\n\t\t_this._mouseWheelHandler = utils.bind(_this._mouseWheelHandler, _this);\r\n\r\n\t\tthis.$config.hidden = true;\r\n\t\tvar size = gantt.config.scroll_size;\r\n\r\n\t\tif(gantt.env.isIE){\r\n\t\t\t// full element height/width must be bigger than just a browser scrollbar,\r\n\t\t\t// otherwise the scrollbar element won't be scrolled on click\r\n\t\t\tsize += 1;\r\n\t\t}\r\n\r\n\t\tif(this._isHorizontal()){\r\n\t\t\t_this.$config.height = size;\r\n\t\t\t_this.$parent.$config.height = size;\r\n\t\t}else{\r\n\t\t\t_this.$config.width = size;\r\n\t\t\t_this.$parent.$config.width = size;\r\n\t\t}\r\n\r\n\t\tthis.$config.scrollPosition = 0;\r\n\r\n\t\t_this.$name = \"scroller\";\r\n\t\treturn _this;\r\n\t}\r\n\r\n\tScrollbarCell.prototype.init = function(container){\r\n\t\tcontainer.innerHTML = this.$toHTML();\r\n\t\tthis.$view = container.firstChild;\r\n\r\n\t\tif(!this.$view){\r\n\t\t\tthis.init();\r\n\t\t}\r\n\t\tif(this._isVertical()){\r\n\t\t\tthis._initVertical();\r\n\t\t}else{\r\n\t\t\tthis._initHorizontal();\r\n\t\t}\r\n\t\tthis._initMouseWheel();\r\n\t\tthis._initLinkedViews();\r\n\t};\r\n\r\n\tScrollbarCell.prototype.$toHTML = function () {\r\n\t\tvar className = this._isHorizontal() ? \"gantt_hor_scroll\" : \"gantt_ver_scroll\";\r\n\t\treturn \"\";\r\n\t};\r\n\r\n\tScrollbarCell.prototype._getRootParent = function(){\r\n\t\tvar parent = this.$parent;\r\n\t\twhile(parent && parent.$parent){\r\n\t\t\tparent = parent.$parent;\r\n\t\t}\r\n\t\tif(parent){\r\n\t\t\treturn parent;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tfunction eachCell(root, res){\r\n\t\tres.push(root);\r\n\t\tif(root.$cells){\r\n\t\t\tfor(var i = 0; i < root.$cells.length; i++){\r\n\t\t\t\teachCell(root.$cells[i], res);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tScrollbarCell.prototype._eachView = function(){\r\n\t\tvar res = [];\r\n\t\teachCell(this._getRootParent(), res);\r\n\t\treturn res;\r\n\t};\r\n\r\n\tScrollbarCell.prototype._getLinkedViews = function(){\r\n\t\tvar views = this._eachView();\r\n\t\tvar res = [];\r\n\t\tfor(var i = 0; i < views.length; i++){\r\n\t\t\tif(views[i].$config && ((this._isVertical() && views[i].$config.scrollY == this.$id) || (this._isHorizontal() && views[i].$config.scrollX == this.$id)) ){\r\n\t\t\t\tres.push(views[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\r\n\tScrollbarCell.prototype._initHorizontal = function(){\r\n\t\tthis.$scroll_hor = this.$view;\r\n\t\tthis.$domEvents.attach(this.$view, \"scroll\", this._scrollHorizontalHandler);\r\n\r\n\t};\r\n\r\n\tScrollbarCell.prototype._initLinkedViews = function(){\r\n\t\tvar views = this._getLinkedViews();\r\n\t\tvar css = this._isVertical() ?\"gantt_layout_outer_scroll gantt_layout_outer_scroll_vertical\" : \"gantt_layout_outer_scroll gantt_layout_outer_scroll_horizontal\";\r\n\t\tfor(var i = 0; i < views.length; i++){\r\n\t\t\t//views[i].$config.css = [views[i].$config.css || \"\", css].join(\" \");\r\n\t\t\tdomHelpers.addClassName(views[i].$view || views[i].getNode(), css);\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype._initVertical = function(){\r\n\t\tthis.$scroll_ver = this.$view;\r\n\t\tthis.$domEvents.attach(this.$view, \"scroll\", this._scrollVerticalHandler);\r\n\t};\r\n\r\n\tScrollbarCell.prototype._updateLinkedViews = function(){\r\n\t};\r\n\r\n\tScrollbarCell.prototype._initMouseWheel = function(){\r\n\t\tvar ff = env.isFF;\r\n\t\tif (ff)\r\n\t\t\tthis.$domEvents.attach(this._getRootParent().$view, \"wheel\", this._mouseWheelHandler, {passive: false});\r\n\t\telse\r\n\t\t\tthis.$domEvents.attach(this._getRootParent().$view, \"mousewheel\", this._mouseWheelHandler, {passive: false});\r\n\t};\r\n\r\n\r\n\r\n\r\n\tScrollbarCell.prototype.scrollHorizontally = function(left){\r\n\t\tif(this._scrolling) return;\r\n\t\tthis._scrolling = true;\r\n\r\n\t\tthis.$scroll_hor.scrollLeft = left;\r\n\t\tthis.$config.codeScrollLeft = left;\r\n\t\tleft = this.$scroll_hor.scrollLeft;\r\n\r\n\t\tvar views = this._getLinkedViews();\r\n\t\tfor(var i = 0; i < views.length; i++){\r\n\t\t\tif(views[i].scrollTo){\r\n\t\t\t\tviews[i].scrollTo(left, undefined);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar oldSize = this.$config.scrollPosition;\r\n\t\tthis.$config.scrollPosition = left;\r\n\t\tthis.callEvent(\"onScroll\", [oldSize, left, this.$config.scroll]);\r\n\t\tthis._scrolling = false;\r\n\t};\r\n\tScrollbarCell.prototype.scrollVertically = function(top){\r\n\t\tif(this._scrolling) return;\r\n\t\tthis._scrolling = true;\r\n\r\n\t\tthis.$scroll_ver.scrollTop = top;\r\n\t\ttop = this.$scroll_ver.scrollTop;\r\n\r\n\t\tvar views = this._getLinkedViews();\r\n\r\n\t\tfor(var i = 0; i < views.length; i++){\r\n\t\t\tif(views[i].scrollTo){\r\n\t\t\t\tviews[i].scrollTo(undefined, top);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar oldSize = this.$config.scrollPosition;\r\n\t\tthis.$config.scrollPosition = top;\r\n\t\tthis.callEvent(\"onScroll\", [oldSize, top, this.$config.scroll]);\r\n\t\tthis._scrolling = false;\r\n\t};\r\n\r\n\tScrollbarCell.prototype._isVertical = function(){\r\n\t\treturn this.$config.scroll == \"y\";\r\n\t};\r\n\tScrollbarCell.prototype._isHorizontal = function(){\r\n\t\treturn this.$config.scroll == \"x\";\r\n\t};\r\n\tScrollbarCell.prototype._scrollHorizontalHandler = function (e) {\r\n\t\tif(this._isVertical() || this._scrolling){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//in safari we can catch previous onscroll after setting new value from mouse-wheel event\r\n\t\t//set delay to prevent value drifiting\r\n\t\tif ((new Date()) - ( this._wheel_time || 0 ) < 100) return true;\r\n\t\t//if (this.$gantt._touch_scroll_active) return;\r\n\t\tvar left = this.$scroll_hor.scrollLeft;\r\n\r\n\t\tthis.scrollHorizontally(left);\r\n\r\n\t\tthis._oldLeft = this.$scroll_hor.scrollLeft;\r\n\t};\r\n\tScrollbarCell.prototype._outerScrollHorizontalHandler = function(e){\r\n\t\tif(this._isVertical()){\r\n\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype.show = function(){\r\n\t\tthis.$parent.show();\r\n\t};\r\n\tScrollbarCell.prototype.hide = function(){\r\n\t\tthis.$parent.hide();\r\n\t};\r\n\r\n\tScrollbarCell.prototype._getScrollSize = function(){\r\n\t\tvar scrollSize = 0;\r\n\t\tvar outerSize = 0;\r\n\t\tvar isHorizontal = this._isHorizontal();\r\n\r\n\t\tvar linked = this._getLinkedViews();\r\n\t\tvar view;\r\n\t\tvar scrollProperty = isHorizontal ? \"scrollWidth\" : \"scrollHeight\",\r\n\t\t\tinnerSizeProperty = isHorizontal ? \"contentX\" : \"contentY\";\r\n\t\tvar outerProperty = isHorizontal ? \"x\" : \"y\";\r\n\t\tvar offset = this._getScrollOffset();\r\n\r\n\t\tfor(var i = 0; i < linked.length; i++){\r\n\t\t\tview = linked[i];\r\n\t\t\tif(!(view && view.$content && view.$content.getSize && !view.$config.hidden)) continue;\r\n\r\n\t\t\tvar sizes = view.$content.getSize();\r\n\t\t\tvar cellScrollSize;\r\n\t\t\tif(sizes.hasOwnProperty(scrollProperty)){\r\n\t\t\t\tcellScrollSize = sizes[scrollProperty];\r\n\t\t\t}else{\r\n\t\t\t\tcellScrollSize = sizes[innerSizeProperty];\r\n\t\t\t}\r\n\r\n\t\t\tif(offset){\r\n\t\t\t\t// precalculated vertical/horizontal offsets of scrollbar to emulate 4.x look\r\n\t\t\t\tif(sizes[innerSizeProperty] > sizes[outerProperty] && sizes[innerSizeProperty] > scrollSize && (cellScrollSize > (sizes[outerProperty] - offset + 2))){\r\n\t\t\t\t\tscrollSize = cellScrollSize + (isHorizontal ? 0 : 2);\r\n\t\t\t\t\touterSize = sizes[outerProperty];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvar nonScrollableSize = Math.max(sizes[innerSizeProperty] - cellScrollSize, 0);\r\n\t\t\t\tvar scrollableViewPortSize = Math.max(sizes[outerProperty] - nonScrollableSize, 0);\r\n\t\t\t\tcellScrollSize = cellScrollSize + nonScrollableSize;\r\n\r\n\t\t\t\tif(cellScrollSize > scrollableViewPortSize && (cellScrollSize > scrollSize) ){\r\n\t\t\t\t\t//|| (cellScrollSize === scrollSize && sizes[outerProperty] < outerSize) // same scroll width but smaller scrollable view port\r\n\r\n\t\t\t\t\tscrollSize = cellScrollSize;\r\n\t\t\t\t\touterSize = sizes[outerProperty];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\touterScroll: outerSize,\r\n\t\t\tinnerScroll: scrollSize\r\n\t\t};\r\n\t};\r\n\r\n\tScrollbarCell.prototype.scroll = function(position){\r\n\t\tif(this._isHorizontal()){\r\n\t\t\tthis.scrollHorizontally(position);\r\n\t\t}else{\r\n\t\t\tthis.scrollVertically(position);\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype.getScrollState = function(){\r\n\t\treturn {\r\n\t\t\tvisible: this.isVisible(),\r\n\t\t\tdirection: this.$config.scroll,\r\n\t\t\tsize: this.$config.outerSize,\r\n\t\t\tscrollSize: this.$config.scrollSize || 0,\r\n\t\t\tposition: this.$config.scrollPosition || 0\r\n\t\t};\r\n\t};\r\n\r\n\tScrollbarCell.prototype.setSize = function(width, height){\r\n\t\t_super.prototype.setSize.apply(this, arguments);\r\n\r\n\t\tvar scrollSizes = this._getScrollSize();\r\n\r\n\t\tvar ownSize = (this._isVertical() ? height : width) - this._getScrollOffset() + (this._isHorizontal() ? 1 : 0);\r\n\r\n\t\tif(scrollSizes.innerScroll && ownSize > scrollSizes.outerScroll){\r\n\t\t\tscrollSizes.innerScroll += (ownSize - scrollSizes.outerScroll);\r\n\t\t}\r\n\t\tthis.$config.scrollSize = scrollSizes.innerScroll;\r\n\r\n\t\tthis.$config.width = width;\r\n\t\tthis.$config.height = height;\r\n\t\tthis._setScrollSize(scrollSizes.innerScroll);\r\n\t};\r\n\r\n\tScrollbarCell.prototype.isVisible = function(){\r\n\t\treturn !!(this.$parent && this.$parent.$view.parentNode);\r\n\t};\r\n\r\n\tScrollbarCell.prototype.shouldShow = function(){\r\n\t\tvar scrollSizes = this._getScrollSize();\r\n\t\tif(!scrollSizes.innerScroll && (this.$parent && this.$parent.$view.parentNode)){\r\n\t\t\treturn false;\r\n\t\t}else if(scrollSizes.innerScroll && !(this.$parent && this.$parent.$view.parentNode)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype.shouldHide = function(){\r\n\t\tvar scrollSizes = this._getScrollSize();\r\n\t\tif(!scrollSizes.innerScroll && (this.$parent && this.$parent.$view.parentNode)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tScrollbarCell.prototype.toggleVisibility = function(){\r\n\t\tif(this.shouldHide()){\r\n\t\t\tthis.hide();\r\n\t\t}else if(this.shouldShow()){\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype._getScaleOffset = function(view){\r\n\t\tvar offset = 0;\r\n\t\tif(view && (view.$config.view == \"timeline\" || view.$config.view == \"grid\")){\r\n\t\t\toffset = view.$content.$getConfig().scale_height;\r\n\t\t}\r\n\t\treturn offset;\r\n\t};\r\n\r\n\tScrollbarCell.prototype._getScrollOffset = function(){\r\n\t\tvar offset = 0;\r\n\t\tif(this._isVertical()){\r\n\t\t\tvar parentLayout = this.$parent.$parent;\r\n\t\t\toffset = Math.max(\r\n\t\t\t\tthis._getScaleOffset(parentLayout.getPrevSibling(this.$parent.$id)),\r\n\t\t\t\tthis._getScaleOffset(parentLayout.getNextSibling(this.$parent.$id))\r\n\t\t\t\t);\r\n\t\t}else{\r\n\t\t\tvar linked = this._getLinkedViews();\r\n\r\n\t\t\tfor (var i = 0; i < linked.length; i++) {\r\n\t\t\t\tvar view = linked[i],\r\n\t\t\t\t\tvparent = view.$parent;\r\n\t\t\t\tvar cells = vparent.$cells;\r\n\r\n\t\t\t\tvar last = cells[cells.length - 1];\r\n\r\n\t\t\t\tif (last && last.$config.view == \"scrollbar\" && last.$config.hidden === false) {\r\n\t\t\t\t\toffset = last.$config.width;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn offset || 0;\r\n\t};\r\n\r\n\tScrollbarCell.prototype._setScrollSize = function(size){\r\n\t\tvar property = this._isHorizontal() ? \"width\" : \"height\";\r\n\t\tvar scrollbar = this._isHorizontal() ? this.$scroll_hor : this.$scroll_ver;\r\n\r\n\t\tvar offset = this._getScrollOffset();\r\n\r\n\t\tvar node = scrollbar.firstChild;\r\n\r\n\t\tif(offset){\r\n\t\t\tif(this._isVertical()){\r\n\r\n\t\t\t\tthis.$config.outerSize = (this.$config.height - offset + 3);\r\n\t\t\t\tscrollbar.style.height = this.$config.outerSize + \"px\";\r\n\t\t\t\tscrollbar.style.top = (offset-1) + \"px\";\r\n\t\t\t\tdomHelpers.addClassName(scrollbar, this.$parent._borders.top);\r\n\t\t\t\tdomHelpers.addClassName(scrollbar.parentNode, \"gantt_task_vscroll\");\r\n\t\t\t}else{\r\n\t\t\t\tthis.$config.outerSize = (this.$config.width - offset + 1);\r\n\t\t\t\tscrollbar.style.width = this.$config.outerSize + \"px\";\r\n\t\t\t\t//domHelpers.addClassName(scrollbar, this.$parent._borders.right);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tscrollbar.style.top = \"auto\";\r\n\t\t\tdomHelpers.removeClassName(scrollbar, this.$parent._borders.top);\r\n\t\t\tdomHelpers.removeClassName(scrollbar.parentNode, \"gantt_task_vscroll\");\r\n\t\t\tthis.$config.outerSize = this.$config.height;\r\n\t\t}\r\n\r\n\t\tnode.style[property] = size + \"px\";\r\n\t};\r\n\r\n\tScrollbarCell.prototype._scrollVerticalHandler = function (e) {\r\n\t\tif(this._scrollHorizontalHandler() || this._scrolling){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//if (this.$gantt._touch_scroll_active) return;\r\n\t\tvar top = this.$scroll_ver.scrollTop;\r\n\t\tvar prev = this._oldTop;\r\n\t\tif(top == prev) return;\r\n\r\n\t\tthis.scrollVertically(top);\r\n\r\n\t\tthis._oldTop = this.$scroll_ver.scrollTop;\r\n\r\n\t};\r\n\tScrollbarCell.prototype._outerScrollVerticalHandler = function(e){\r\n\t\tif(this._scrollHorizontalHandler()){\r\n\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tScrollbarCell.prototype._checkWheelTarget = function(targetNode){\r\n\t\tvar connectedViews = this._getLinkedViews().concat(this);\r\n\r\n\t\tfor(var i = 0; i < connectedViews.length; i++){\r\n\t\t\tvar node = connectedViews[i].$view;\r\n\t\t\tif(domHelpers.isChildOf(targetNode, node)){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\tScrollbarCell.prototype._mouseWheelHandler = function(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tif(!this._checkWheelTarget(target))\r\n\t\t\treturn;\r\n\r\n\t\tthis._wheel_time = new Date();\r\n\r\n\t\tvar res = {};\r\n\r\n\t\tvar wheelSpeed = {x: 1, y: 1};\r\n\t\tvar wheelSpeedConfig = this.$gantt.config.wheel_scroll_sensitivity;\r\n\r\n\t\tif (typeof wheelSpeedConfig == \"number\" && !!wheelSpeedConfig) {\r\n\t\t\twheelSpeed = {x: wheelSpeedConfig, y: wheelSpeedConfig};\r\n\t\t}\r\n\t\telse if (({}).toString.apply(wheelSpeedConfig) == \"[object Object]\") {\r\n\t\t\twheelSpeed = {x: wheelSpeedConfig.x, y: wheelSpeedConfig.y};\r\n\t\t}\r\n\r\n\t\tvar ff = env.isFF;\r\n\t\tvar deltaX = ff ? (e.deltaX) : e.wheelDeltaX;\r\n\t\tvar deltaY = ff ? (e.deltaY) : e.wheelDelta;\r\n\r\n\t\tvar multiplier = -20;\r\n\t\tif (ff) {\r\n\t\t\tif (e.deltaMode !== 0) {\r\n\t\t\t\tmultiplier = -40;\r\n\t\t\t} else {\r\n\t\t\t\tmultiplier = -10;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar wx = ff ? (deltaX * multiplier * wheelSpeed.x) : deltaX * 2 * wheelSpeed.x;\r\n\t\tvar wy = ff ? (deltaY * multiplier * wheelSpeed.y) : deltaY * wheelSpeed.y;\r\n\r\n\t\tvar horizontalScrollModifier = this.$gantt.config.horizontal_scroll_key;\r\n\r\n\t\tif (horizontalScrollModifier !== false) {\r\n\t\t\tif (SCROLL_MODIFIER_KEYS.indexOf(horizontalScrollModifier) >= 0) {\r\n\t\t\t\tif(e[horizontalScrollModifier] && !(e.deltaX || e.wheelDeltaX)){\r\n\t\t\t\t\t// shift+mousewheel for horizontal scroll\r\n\t\t\t\t\twx = wy*2;\r\n\t\t\t\t\twy = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif (wx && Math.abs(wx) > Math.abs(wy)){\r\n\t\t\tif(this._isVertical()){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(res.x) return true;//no horisontal scroll, must not block scrolling\r\n\t\t\tif(!this.$scroll_hor || !this.$scroll_hor.offsetWidth) return true;\r\n\r\n\t\t\tvar dir = wx/-40;\r\n\t\t\tvar oldLeft = this._oldLeft;\r\n\t\t\tvar left = oldLeft+dir*30;\r\n\t\t\tthis.scrollHorizontally(left);\r\n\t\t\tthis.$scroll_hor.scrollLeft = left;\r\n\t\t\t// not block scroll if position hasn't changed\r\n\t\t\tif(oldLeft == this.$scroll_hor.scrollLeft){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._oldLeft = this.$scroll_hor.scrollLeft;\r\n\t\t} else {\r\n\t\t\tif(this._isHorizontal()){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(res.y) return true;//no vertical scroll, must not block scrolling\r\n\t\t\tif(!this.$scroll_ver || !this.$scroll_ver.offsetHeight) return true;\r\n\r\n\t\t\tvar dir = wy/-40;\r\n\t\t\tif (typeof wy == \"undefined\")\r\n\t\t\t\tdir = e.detail;\r\n\r\n\t\t\tvar oldTop = this._oldTop;\r\n\t\t\tvar top = this.$scroll_ver.scrollTop+dir*30;\r\n\r\n\t\t\t//if(!this.$gantt.config.prevent_default_scroll &&\r\n\t\t\t//\t(this.$gantt._cached_scroll_pos && ((this.$gantt._cached_scroll_pos.y == top) || (this.$gantt._cached_scroll_pos.y <= 0 && top <= 0)))) return true;\r\n\r\n\r\n\t\t\tthis.scrollVertically(top);\r\n\t\t\tthis.$scroll_ver.scrollTop = top;\r\n\r\n\t\t\t// not block scroll if position hasn't changed\r\n\t\t\tif(oldTop == this.$scroll_ver.scrollTop){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tthis._oldTop = this.$scroll_ver.scrollTop;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble=true;\r\n\t\treturn false;\r\n\t};\r\n\r\n\treturn ScrollbarCell;\r\n})(Cell);\r\n\r\nexport default ScrollbarCell;","import quickPositionHelperFactory from \"./row_position_fixed_height\";\r\n\r\nfunction createMixin(view){\r\n\tvar getItemTopCache = {};\r\n\tvar getRowTopCache = {};\r\n\tvar getItemHeightCache = null;\r\n\tvar totalHeightCache = -1;\r\n\tvar getItemHeightCacheState = null;\r\n\r\n\tvar quickPosition = quickPositionHelperFactory(view);\r\n\r\n\treturn {\r\n\t\t_resetTopPositionHeight: function(){\r\n\t\t\tgetItemTopCache = {};\r\n\t\t\tgetRowTopCache = {};\r\n\t\t\tquickPosition.resetCache();\r\n\t\t},\r\n\t\t_resetHeight: function(){\r\n\t\t\tvar store = this.$config.rowStore;\r\n\t\t\tvar newState = this.getCacheStateTotalHeight(store);\r\n\t\t\tif(!getItemHeightCacheState){\r\n\t\t\t\tgetItemHeightCacheState = newState;\r\n\t\t\t}else if(this.shouldClearHeightCache(getItemHeightCacheState, newState)){\r\n\t\t\t\tgetItemHeightCacheState = newState;\r\n\t\t\t\tgetItemHeightCache = null;\r\n\t\t\t}\r\n\r\n\t\t\ttotalHeightCache = -1;\r\n\t\t\tquickPosition.resetCache();\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Get top coordinate by row index (order)\r\n\t\t * @param {number} index\r\n\t\t */\r\n\t\tgetRowTop: function(index){\r\n\t\t\tif(quickPosition.canUseSimpleCalculation()){\r\n\t\t\t\treturn quickPosition.getRowTop(index);\r\n\t\t\t}\r\n\r\n\t\t\tvar store = this.$config.rowStore;\r\n\t\t\tif(!store){\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif(getRowTopCache[index] !== undefined){\r\n\t\t\t\treturn getRowTopCache[index];\r\n\t\t\t}else {\r\n\t\t\t\tvar all = store.getIndexRange();\r\n\t\t\t\tvar top = 0;\r\n\t\t\t\tvar result = 0;\r\n\t\t\t\tfor(var i = 0; i < all.length; i++){\r\n\t\t\t\t\tgetRowTopCache[i] = top;\r\n\t\t\t\t\ttop += this.getItemHeight(all[i].id);\r\n\t\t\t\t\tif(i < index){\r\n\t\t\t\t\t\tresult = top;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Get top coordinate by item id\r\n\t\t * @param {*} task_id\r\n\t\t */\r\n\t\tgetItemTop: function (taskId) {\r\n\t\t\tif(this.$config.rowStore){\r\n\t\t\t\tif(getItemTopCache[taskId] !== undefined){\r\n\t\t\t\t\treturn getItemTopCache[taskId];\r\n\t\t\t\t}\r\n\t\t\t\tvar store = this.$config.rowStore;\r\n\t\t\t\tif(!store) return 0;\r\n\r\n\t\t\t\tvar itemIndex = store.getIndexById(taskId);\r\n\r\n\t\t\t\tif (itemIndex === -1 && store.getParent && store.exists(taskId)) {\r\n\t\t\t\t\tvar parentId = store.getParent(taskId);\r\n\t\t\t\t\tif (store.exists(parentId)) {\r\n\t\t\t\t\t\t// if task is not found in list - maybe it's parent is a split task and we should use parents index instead\r\n\t\t\t\t\t\tvar parent = store.getItem(parentId);\r\n\t\t\t\t\t\tif (this.$gantt.isSplitTask(parent)) {\r\n\t\t\t\t\t\t\treturn this.getItemTop(parentId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tgetItemTopCache[taskId] = this.getRowTop(itemIndex);\r\n\t\t\t\treturn getItemTopCache[taskId];\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Get height of the item by item id\r\n\t\t * @param {*} itemId\r\n\t\t */\r\n\t\tgetItemHeight: function (itemId) {\r\n\t\t\tif(quickPosition.canUseSimpleCalculation()){\r\n\t\t\t\treturn quickPosition.getItemHeight(itemId);\r\n\t\t\t}\r\n\r\n\t\t\tif(!getItemHeightCache && this.$config.rowStore){\r\n\t\t\t\tthis._fillHeightCache(this.$config.rowStore);\r\n\t\t\t}\r\n\r\n\t\t\tif(getItemHeightCache[itemId] !== undefined){\r\n\t\t\t\treturn getItemHeightCache[itemId];\r\n\t\t\t}\r\n\r\n\t\t\tvar defaultHeight = this.$getConfig().row_height;\r\n\r\n\t\t\tif(this.$config.rowStore){\r\n\t\t\t\tvar store = this.$config.rowStore;\r\n\t\t\t\tif(!store) return defaultHeight;\r\n\r\n\t\t\t\tvar item = store.getItem(itemId);\r\n\r\n\t\t\t\treturn getItemHeightCache[itemId] = item && item.row_height || defaultHeight;\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultHeight;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_fillHeightCache: function(store){\r\n\t\t\tif(!store){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tgetItemHeightCache = {};\r\n\t\t\tvar defaultHeight = this.$getConfig().row_height;\r\n\t\t\tstore.eachItem(function(item){\r\n\t\t\t\treturn getItemHeightCache[item.id] = item && item.row_height || defaultHeight;\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tgetCacheStateTotalHeight: function(store){\r\n\r\n\t\t\tvar globalHeight = this.$getConfig().row_height;\r\n\t\t\tvar itemHeightCache = {};\r\n\t\t\tvar items = [];\r\n\t\t\tvar sumHeight = 0;\r\n\t\t\tif(store){\r\n\t\t\t\tstore.eachItem(function(item){\r\n\t\t\t\t\titems.push(item);\r\n\t\t\t\t\titemHeightCache[item.id] = item.row_height;\r\n\t\t\t\t\tsumHeight += item.row_height || globalHeight;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn {\r\n\t\t\t\tglobalHeight: globalHeight,\r\n\t\t\t\titems: items,\r\n\t\t\t\tcount: items.length,\r\n\t\t\t\tsumHeight: sumHeight\r\n\t\t\t};\r\n\t\t},\r\n\t\tshouldClearHeightCache: function(oldState, newState){\r\n\r\n\t\t\tif(oldState.count != newState.count){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(oldState.globalHeight != newState.globalHeight){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif(oldState.sumHeight != newState.sumHeight){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i in oldState.items){\r\n\t\t\t\tvar newValue = newState.items[i];\r\n\t\t\t\tif(newValue !== undefined && newValue != oldState.items[i]){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\t/**\r\n\t\t * Get total height of items\r\n\t\t */\r\n\t\tgetTotalHeight: function () {\r\n\t\t\tif(quickPosition.canUseSimpleCalculation()){\r\n\t\t\t\treturn quickPosition.getTotalHeight();\r\n\t\t\t}\r\n\r\n\t\t\tif(totalHeightCache != -1){\r\n\t\t\t\treturn totalHeightCache;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.$config.rowStore){\r\n\t\t\t\tvar store = this.$config.rowStore;\r\n\t\t\t\tthis._fillHeightCache(store);\r\n\t\t\t\tvar getHeight = this.getItemHeight.bind(this);\r\n\t\t\t\tvar visibleItems = store.getVisibleItems();\r\n\t\t\t\tvar totalHeight = 0;\r\n\r\n\t\t\t\tvisibleItems.forEach(function(item){\r\n\t\t\t\t\ttotalHeight += getHeight(item.id);\r\n\t\t\t\t});\r\n\r\n\t\t\t\ttotalHeightCache = totalHeight;\r\n\t\t\t\treturn totalHeight;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Get item by top position\r\n\t\t * @param {*} top\r\n\t\t */\r\n\t\tgetItemIndexByTopPosition: function (top) {\r\n\t\t\tif(this.$config.rowStore){\r\n\t\t\t\tif(quickPosition.canUseSimpleCalculation()){\r\n\t\t\t\t\treturn quickPosition.getItemIndexByTopPosition(top);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar store = this.$config.rowStore;\r\n\t\t\t\tfor(var i = 0; i < store.countVisible(); i++){\r\n\t\t\t\t\tvar current = this.getRowTop(i);\r\n\t\t\t\t\tvar next = this.getRowTop(i+1);\r\n\t\t\t\t\tif(!next){\r\n\t\t\t\t\t\tvar taskId = store.getIdByIndex(i);\r\n\t\t\t\t\t\tnext = current + this.getItemHeight(taskId);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(top >= current && top < next){\r\n\t\t\t\t\t\treturn i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// GS-1723: If we iterated all tasks and didn't find the position, the target is below all other tasks\r\n\t\t\t\treturn store.countVisible() + 2;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default createMixin;","function createHelper(view){\r\n\tvar cachedRowHeight = -1;\r\n\tvar canUseSimpleCalc = -1;\r\n\treturn {\r\n\t\tresetCache: function(){\r\n\t\t\tcachedRowHeight = -1;\r\n\t\t\tcanUseSimpleCalc = -1;\r\n\t\t},\r\n\t\t_getRowHeight: function(){\r\n\t\t\tif(cachedRowHeight === -1){\r\n\t\t\t\tcachedRowHeight = view.$getConfig().row_height;\r\n\t\t\t}\r\n\t\t\treturn cachedRowHeight;\r\n\t\t},\r\n\t\t_refreshState: function(){\r\n\t\t\tthis.resetCache();\r\n\t\t\tcanUseSimpleCalc = true;\r\n\t\t\tvar store = view.$config.rowStore;\r\n\t\t\tif(!store){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar globalRowHeight = this._getRowHeight();\r\n\t\t\tfor (var i=0; i\";\r\n\t\tthis.$task = container.childNodes[0];\r\n\r\n\t\tthis.$task.innerHTML = \"
\";\r\n\t\tthis.$task_scale = this.$task.childNodes[0];\r\n\r\n\t\tthis.$task_data = this.$task.childNodes[1];\r\n\t\tconst taskBg = \"
\";\r\n\t\tconst links = \"
\";\r\n\t\tconst taskBars = \"
\";\r\n\r\n\t\tconst taskConstraints = \"
\";\r\n\t\tconst taskDeadlines = \"
\";\r\n\t\tconst taskBaselines = \"
\";\r\n\r\n\t\tthis.$task_data.innerHTML = taskBg + taskBaselines + links + taskBars + taskConstraints + taskDeadlines;\r\n\r\n\t\tthis.$task_bg = this.$task_data.childNodes[0];\r\n\t\tthis.$task_baselines = this.$task_data.childNodes[1];\r\n\t\tthis.$task_links = this.$task_data.childNodes[2];\r\n\t\tthis.$task_bars = this.$task_data.childNodes[3];\r\n\t\tthis.$task_constraints = this.$task_data.childNodes[4];\r\n\t\tthis.$task_deadlines = this.$task_data.childNodes[5];\r\n\r\n\t\tthis._tasks = {\r\n\t\t\tcol_width: 0,\r\n\t\t\twidth: [], // width of each column\r\n\t\t\tfull_width: 0, // width of all columns\r\n\t\t\ttrace_x: [],\r\n\t\t\trendered: {}\r\n\t\t};\r\n\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar attr = config[this.$config.bind + \"_attribute\"];\r\n\t\tvar linksAttr = config[this.$config.bindLinks + \"_attribute\"];\r\n\t\tif(!attr && this.$config.bind){\r\n\t\t\tattr = \"data-\" + this.$config.bind + \"-id\";\r\n\t\t}\r\n\t\tif(!linksAttr && this.$config.bindLinks){\r\n\t\t\tlinksAttr = \"data-\" + this.$config.bindLinks + \"-id\";\r\n\t\t}\r\n\t\tthis.$config.item_attribute = attr || null;\r\n\t\tthis.$config.link_attribute = linksAttr || null;\r\n\r\n\t\tvar layers = this._createLayerConfig();\r\n\t\tif(!this.$config.layers){\r\n\t\t\tthis.$config.layers = layers.tasks;\r\n\t\t}\r\n\t\tif(!this.$config.linkLayers){\r\n\t\t\tthis.$config.linkLayers = layers.links;\r\n\t\t}\r\n\r\n\t\tthis._attachLayers(this.$gantt);\r\n\r\n\t\tthis.callEvent(\"onReady\", []);\r\n\t\t//this.refresh();\r\n\t\tif (this.$gantt.ext.dragTimeline) {\r\n\t\t\tthis._timelineDragScroll = this.$gantt.ext.dragTimeline.create();\r\n\t\t\tthis._timelineDragScroll.attach(this);\r\n\t\t}\r\n\t},\r\n\r\n\tsetSize: function(width, height){\r\n\t\tvar config = this.$getConfig();\r\n\r\n\t\tif(width*1 === width){\r\n\t\t\tthis.$config.width = width;\r\n\t\t}\r\n\t\tif(height*1 === height){\r\n\r\n\t\t\tthis.$config.height = height;\r\n\t\t\tvar dataHeight = Math.max(this.$config.height - config.scale_height);\r\n\t\t\tthis.$task_data.style.height = dataHeight + 'px';\r\n\t\t}\r\n\r\n\t\tthis.refresh();\r\n\t\tthis.$task_bg.style.backgroundImage = \"\";\r\n\r\n\t\tif(config.smart_rendering && this.$config.rowStore){\r\n\t\t\tthis.$task_bg.style.height = this.getTotalHeight() +\"px\";\r\n\t\t}else{\r\n\t\t\tthis.$task_bg.style.height = \"\";\r\n\t\t}\r\n\r\n\t\tvar scale = this._tasks;\r\n\t\t//timeline area layers\r\n\t\tvar data_els = this.$task_data.childNodes;\r\n\t\tfor(var i= 0, len = data_els.length; i < len; i++){\r\n\t\t\tvar el = data_els[i];\r\n\t\t\tif(el.hasAttribute(\"data-layer\") && el.style)\r\n\t\t\t\tel.style.width = scale.full_width + \"px\";\r\n\t\t}\r\n\t},\r\n\r\n\tisVisible: function(){\r\n\t\tif(this.$parent && this.$parent.$config){\r\n\t\t\treturn !this.$parent.$config.hidden;\r\n\t\t}else{\r\n\t\t\treturn this.$task.offsetWidth;\r\n\t\t}\r\n\t},\r\n\r\n\tgetSize: function(){\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar store = this.$config.rowStore;\r\n\r\n\t\tvar contentHeight = store ? this.getTotalHeight() : 0,\r\n\t\t\tcontentWidth = this.isVisible() ? this._tasks.full_width : 0;\r\n\r\n\t\treturn {\r\n\t\t\tx: this.isVisible() ? this.$config.width : 0,\r\n\t\t\ty: this.isVisible() ? this.$config.height : 0,\r\n\t\t\tcontentX: this.isVisible() ? contentWidth : 0,\r\n\t\t\tcontentY: this.isVisible() ? (config.scale_height + contentHeight) : 0,\r\n\t\t\tscrollHeight: this.isVisible() ? contentHeight : 0,\r\n\t\t\tscrollWidth: this.isVisible() ? contentWidth : 0\r\n\t\t};\r\n\t},\r\n\r\n\tscrollTo: function(left, top){\r\n\t\tif(!this.isVisible())\r\n\t\t\treturn;\r\n\r\n\t\tvar scrolled = false;\r\n\r\n\t\tthis.$config.scrollTop = this.$config.scrollTop || 0;\r\n\t\tthis.$config.scrollLeft = this.$config.scrollLeft || 0;\r\n\t\tif(top*1 === top){\r\n\t\t\tthis.$config.scrollTop = top;\r\n\t\t\tthis.$task_data.scrollTop = this.$config.scrollTop;\r\n\t\t\tscrolled = true;\r\n\t\t}\r\n\t\tif (left*1 === left){\r\n\t\t\tthis.$task.scrollLeft = left;\r\n\t\t\tthis.$config.scrollLeft = this.$task.scrollLeft;\r\n\t\t\tthis._refreshScales();\r\n\t\t\tscrolled = true;\r\n\t\t}\r\n\r\n\t\tif(scrolled){\r\n\t\t\tthis.callEvent(\"onScroll\", [this.$config.scrollLeft, this.$config.scrollTop]);\r\n\t\t}\r\n\t},\r\n\r\n\t_refreshScales: function _refreshScales() {\r\n\t\tif(!this.isVisible())\r\n\t\t\treturn;\r\n\r\n\t\tvar config = this.$getConfig();\r\n\t\tif (!config.smart_scales) return;\r\n\r\n\t\tvar viewPort = this.getViewPort();\r\n\r\n\t\tvar scales = this._scales;\r\n\t\tthis.$task_scale.innerHTML = this._getScaleChunkHtml(scales, viewPort.x, viewPort.x_end);\r\n\t},\r\n\r\n\tgetViewPort: function(){\r\n\t\tvar scrollLeft = this.$config.scrollLeft || 0;\r\n\t\tvar scrollTop = this.$config.scrollTop || 0;\r\n\t\tvar height = this.$config.height || 0;\r\n\t\tvar width = this.$config.width || 0;\r\n\t\treturn {\r\n\t\t\ty: scrollTop,\r\n\t\t\ty_end: scrollTop + height,\r\n\t\t\tx: scrollLeft,\r\n\t\t\tx_end: scrollLeft + width,\r\n\t\t\theight: height,\r\n\t\t\twidth: width\r\n\t\t};\r\n\t},\r\n\r\n\t_createLayerConfig: createLayerConfig,\r\n\r\n\t_attachLayers: function(gantt){\r\n\t\tthis._taskLayers = [];\r\n\t\tthis._linkLayers = [];\r\n\r\n\t\tvar self = this;\r\n\r\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\r\n\r\n\t\tif(this.$config.bind){\r\n\r\n\t\t\tthis._bindStore();\r\n\t\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\r\n\r\n\t\t\tif(!taskRenderer){\r\n\t\t\t\ttaskRenderer = layers.createDataRender({\r\n\t\t\t\t\tname: this.$config.bind,\r\n\t\t\t\t\tdefaultContainer: function(){ return self.$task_data;}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttaskRenderer.container = function(){ return self.$task_data;};\r\n\r\n\t\t\tvar taskLayers = this.$config.layers;\r\n\t\t\tfor(var i = 0; taskLayers && i < taskLayers.length; i++){\r\n\t\t\t\tvar layer = taskLayers[i];\r\n\r\n\t\t\t\tif(typeof layer == \"string\"){\r\n\t\t\t\t\tlayer = this.$gantt.$ui.layers[layer]();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof layer == \"function\" || (layer && layer.render && layer.update)){\r\n\t\t\t\t\tlayer = {renderer: layer};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlayer.view = this;\r\n\r\n\t\t\t\tvar bar_layer = taskRenderer.addLayer(layer);\r\n\t\t\t\tthis._taskLayers.push(bar_layer);\r\n\t\t\t\tif(layer.expose){\r\n\t\t\t\t\tthis._taskRenderer = taskRenderer.getLayer(bar_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._initStaticBackgroundRender();\r\n\t\t}\r\n\r\n\t\tif(this.$config.bindLinks){\r\n\t\t\tself.$config.linkStore = self.$gantt.getDatastore(self.$config.bindLinks);\r\n\r\n\t\t\tvar linkRenderer = layers.getDataRender(this.$config.bindLinks);\r\n\r\n\t\t\tif(!linkRenderer){\r\n\t\t\t\tlinkRenderer = layers.createDataRender({\r\n\t\t\t\t\tname: this.$config.bindLinks,\r\n\t\t\t\t\tdefaultContainer: function(){ return self.$task_data;}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tvar linkLayers = this.$config.linkLayers;\r\n\t\t\tfor(var i = 0; linkLayers && i < linkLayers.length; i++){\r\n\r\n\t\t\t\tif(typeof layer == \"string\"){\r\n\t\t\t\t\tlayer = this.$gantt.$ui.layers[layer]();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar layer = linkLayers[i];\r\n\t\t\t\tlayer.view = this;\r\n\t\t\t//\tlayer.getViewPort = getViewPort;\r\n\t\t\t//\tsubscribeSmartRender(layer);\r\n\t\t\t\tvar linkLayer = linkRenderer.addLayer(layer);\r\n\t\t\t\tthis._taskLayers.push(linkLayer);\r\n\t\t\t\tif(linkLayers[i].expose){\r\n\t\t\t\t\tthis._linkRenderer = linkRenderer.getLayer(linkLayer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_initStaticBackgroundRender: function(){\r\n\t\tvar self = this;\r\n\t\tvar staticRender = canvasRender.create();\r\n\t\tvar store = self.$config.rowStore;\r\n\t\tif(!store) return;\r\n\r\n\t\tthis._staticBgHandler = store.attachEvent(\"onStoreUpdated\", function(id, item, mode){\r\n\t\t\tif(id !== null) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.isVisible())\r\n\t\t\t\treturn;\r\n\t\t\tvar config = self.$getConfig();\r\n\t\t\tif(config.static_background || config.timeline_placeholder) {\r\n\t\t\t\tvar store = self.$gantt.getDatastore(self.$config.bind);\r\n\t\t\t\tvar staticBgContainer = self.$task_bg_static;\r\n\t\t\t\tif(!staticBgContainer){\r\n\t\t\t\t\tstaticBgContainer = document.createElement(\"div\");\r\n\t\t\t\t\tstaticBgContainer.className = \"gantt_task_bg\";\r\n\t\t\t\t\tself.$task_bg_static = staticBgContainer;\r\n\t\t\t\t\tif(self.$task_bg.nextSibling){\r\n\t\t\t\t\t\tself.$task_data.insertBefore(staticBgContainer, self.$task_bg.nextSibling);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tself.$task_data.appendChild(staticBgContainer);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (store) {\r\n\t\t\t\t\tvar staticBackgroundHeight = self.getTotalHeight();\r\n\t\t\t\t\tif (config.timeline_placeholder){\r\n\t\t\t\t\t\tstaticBackgroundHeight = config.timeline_placeholder.height || self.$task_data.offsetHeight || 99999;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstaticRender.render(staticBgContainer, config, self.getScale(), staticBackgroundHeight, self.getItemHeight(item ? item.id : null));\r\n\t\t\t\t}\r\n\t\t\t}else if(config.static_background){\r\n\t\t\t\tif(self.$task_bg_static && self.$task_bg_static.parentNode){\r\n\t\t\t\t\tself.$task_bg_static.parentNode.removeChild(self.$task_bg_static);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.attachEvent(\"onDestroy\", function () {\r\n\t\t\tstaticRender.destroy();\r\n\t\t});\r\n\t\tthis._initStaticBackgroundRender = function(){};//init once\r\n\t},\r\n\r\n\t_clearLayers: function(gantt){\r\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\r\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\r\n\t\tvar linkRenderer = layers.getDataRender(this.$config.bindLinks);\r\n\r\n\t\tif (this._taskLayers) {\r\n\t\t\tfor(var i = 0; i < this._taskLayers.length; i++){\r\n\t\t\t\ttaskRenderer.removeLayer(this._taskLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (this._linkLayers) {\r\n\t\t\tfor(var i = 0; i < this._linkLayers.length; i++){\r\n\t\t\t\tlinkRenderer.removeLayer(this._linkLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._linkLayers = [];\r\n\t\tthis._taskLayers = [];\r\n\t},\r\n\r\n\t_render_tasks_scales: function _render_tasks_scales() {\r\n\t\tvar config = this.$getConfig();\r\n\r\n\t\tvar scales_html = \"\",\r\n\t\t\touter_width = 0,\r\n\t\t\tscale_height = 0;\r\n\r\n\t\tvar state = this.$gantt.getState();\r\n\r\n\t\tif (this.isVisible()) {\r\n\t\t\tvar helpers = this.$scaleHelper;\r\n\t\t\tvar scales = this._getScales();\r\n\t\t\tscale_height = config.scale_height;\r\n\r\n\t\t\tvar availWidth = this.$config.width;\r\n\t\t\tif(config.autosize == \"x\" || config.autosize == \"xy\"){\r\n\t\t\t\tavailWidth = Math.max(config.autosize_min_width, 0);\r\n\t\t\t}\r\n\r\n\t\t\tvar cfgs = helpers.prepareConfigs(scales, config.min_column_width, availWidth, scale_height - 1, state.min_date, state.max_date, config.rtl);\r\n\t\t\tvar cfg = this._tasks = cfgs[cfgs.length - 1];\r\n\t\t\tthis._scales = cfgs;\r\n\t\t\tthis._posFromDateCache = {};\r\n\r\n\t\t\tscales_html = this._getScaleChunkHtml(cfgs, 0, this.$config.width);\r\n\r\n\t\t\touter_width = cfg.full_width + \"px\";//cfg.full_width + (this._scroll_sizes().y ? scrollSizes.scroll_size : 0) + \"px\";\r\n\t\t\tscale_height += \"px\";\r\n\t\t}\r\n\r\n\t\tthis.$task_scale.style.height = scale_height;\r\n\r\n\t\tthis.$task_data.style.width =\r\n\t\t\tthis.$task_scale.style.width = outer_width;\r\n\r\n\t\tthis.$task_scale.innerHTML = scales_html;\r\n\r\n\t},\r\n\r\n\t_getScaleChunkHtml: function _get_scale_chunk_html (scales, fromPos, toPos) {\r\n\t\tvar templates = this.$gantt.templates;\r\n\t\tvar html = [];\r\n\r\n\t\tvar css = templates.scale_row_class;\r\n\t\tfor (var i = 0; i < scales.length; i++) {\r\n\t\t\tvar cssClass = \"gantt_scale_line\";\r\n\t\t\tvar tplClass = css(scales[i]);\r\n\t\t\tif (tplClass) {\r\n\t\t\t\tcssClass += \" \" + tplClass;\r\n\t\t\t}\r\n\r\n\t\t\thtml.push(\"\" + this._prepareScaleHtml(scales[i], fromPos, toPos, i) + \"
\");\r\n\t\t}\r\n\r\n\t\treturn html.join(\"\");\r\n\t},\r\n\t_prepareScaleHtml: function _prepare_scale_html(config, fromPos, toPos, index) {\r\n\t\tvar globalConfig = this.$getConfig();\r\n\t\tvar globalTemplates = this.$gantt.templates;\r\n\r\n\t\tvar cells = [];\r\n\t\tvar date = null, css = null;\r\n\r\n\t\tvar content = config.format || config.template || config.date;\r\n\r\n\t\tif(typeof content === \"string\"){\r\n\t\t\tcontent = this.$gantt.date.date_to_str(content);\r\n\t\t}\r\n\r\n\t\tvar startIndex = 0,\r\n\t\t\tendIndex = config.count;\r\n\r\n\t\tif (globalConfig.smart_scales && (!isNaN(fromPos) && !isNaN(toPos))) {\r\n\t\t\tstartIndex = helpers.findBinary(config.left, fromPos);\r\n\t\t\tendIndex = helpers.findBinary(config.left, toPos) + 1;\r\n\t\t}\r\n\r\n\t\tcss = config.css || function () {\r\n\t\t\t};\r\n\t\tif (!config.css && globalConfig.inherit_scale_class) {\r\n\t\t\tcss = globalTemplates.scale_cell_class;\r\n\t\t}\r\n\r\n\t\tfor (var i = startIndex; i < endIndex; i++) {\r\n\t\t\tif (!config.trace_x[i]) break;\r\n\r\n\t\t\tdate = new Date(config.trace_x[i]);\r\n\t\t\tvar value = content.call(this, date),\r\n\t\t\t\twidth = config.width[i],\r\n\t\t\t\theight = config.height,\r\n\t\t\t\tleft = config.left[i],\r\n\t\t\t\tstyle = \"\",\r\n\t\t\t\ttemplate = \"\",\r\n\t\t\t\tcssclass = \"\";\r\n\r\n\t\t\tif (width) {\r\n\t\t\t\tvar position = globalConfig.smart_scales ? (\"position:absolute;left:\" + left + \"px\") : \"\";\r\n\r\n\t\t\t\tstyle = \"width:\" + (width) + \"px;\" + position;\r\n\t\t\t\t// GS-1188: Display the scale value in the viewport for long cells\r\n\t\t\t\tconst viewPort = this.getViewPort();\r\n\t\t\t\tconst floatConfig = (globalConfig.scales[index] || {}).sticky; // for old scale settings\r\n\r\n\t\t\t\tlet labelPosition = '';\r\n\t\t\t\tconst approxLabelWidth = 70;\r\n\t\t\t\t// if sticky config is not specified - sticky labels are enabled for long cells only\r\n\t\t\t\tif ((floatConfig !== false && width > approxLabelWidth) || floatConfig === true) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (left < viewPort.x && left + width/2 - approxLabelWidth/2 < viewPort.x){\r\n\t\t\t\t\t\tlabelPosition = ` style='position:absolute;left: ${viewPort.x - left + 10}px;' `;\r\n\t\t\t\t\t} else if(left + width/2 + approxLabelWidth/2 > viewPort.x_end && width > approxLabelWidth){\r\n\t\t\t\t\t\tlet labelPos = viewPort.x_end - left - 10;\r\n\t\t\t\t\t\tlet translateValue = \"-100%\";\r\n\t\t\t\t\t\tif(labelPos < approxLabelWidth) {\r\n\t\t\t\t\t\t\tlabelPos = approxLabelWidth;\r\n\t\t\t\t\t\t\ttranslateValue = `-${labelPos}px`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlabelPosition = ` style='position:absolute;left: ${labelPos}px;transform: translate(${translateValue},0);' `;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcssclass = \"gantt_scale_cell\" + (i == config.count - 1 ? \" gantt_last_cell\" : \"\");\r\n\r\n\t\t\t\ttemplate = css.call(this, date);\r\n\t\t\t\tif (template) cssclass += \" \" + template;\r\n\r\n\t\t\t\tvar ariaAttr = this.$gantt._waiAria.getTimelineCellAttr(value);\r\n\t\t\t\tvar cell = `${value}
`;\r\n\t\t\t\tcells.push(cell);\r\n\t\t\t} else {\r\n\t\t\t\t//do not render ignored cells\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn cells.join(\"\");\r\n\t},\r\n\tdateFromPos: function dateFromPos(x) {\r\n\t\tvar scale = this._tasks;\r\n\t\tif (x < 0 || x > scale.full_width || !scale.full_width) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar ind = helpers.findBinary(this._tasks.left, x);\r\n\t\tvar summ = this._tasks.left[ind];\r\n\r\n\t\tvar col_width = scale.width[ind] || scale.col_width;\r\n\t\tvar part = 0;\r\n\t\tif (col_width) {\r\n\t\t\tpart = (x - summ) / col_width;\r\n\t\t\tif(scale.rtl){\r\n\t\t\t\tpart = 1 - part;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tvar unit = 0;\r\n\t\tif (part) {\r\n\t\t\tunit = this._getColumnDuration(scale, scale.trace_x[ind]);\r\n\t\t}\r\n\r\n\t\tvar date = new Date(scale.trace_x[ind].valueOf() + Math.round(part * unit));\r\n\t\treturn date;\r\n\t},\r\n\tposFromDate: function posFromDate(date) {\r\n\t\tif (!this.isVisible())\r\n\t\t\treturn 0;\r\n\r\n\t\tif(!date){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tvar dateValue = String(date.valueOf());\r\n\r\n\t\tif(this._posFromDateCache[dateValue] !== undefined){\r\n\t\t\treturn this._posFromDateCache[dateValue];\r\n\t\t}\r\n\t\tvar ind = this.columnIndexByDate(date);\r\n\t\tthis.$gantt.assert(ind >= 0, \"Invalid day index\");\r\n\r\n\t\tvar wholeCells = Math.floor(ind);\r\n\t\tvar partCell = ind % 1;\r\n\r\n\t\tvar pos = this._tasks.left[Math.min(wholeCells, this._tasks.width.length - 1)];\r\n\t\tif (wholeCells == this._tasks.width.length)\r\n\t\t\tpos += this._tasks.width[this._tasks.width.length - 1];\r\n\t\t//for(var i=1; i <= wholeCells; i++)\r\n\t\t//\tpos += gantt._tasks.width[i-1];\r\n\r\n\t\tif (partCell) {\r\n\t\t\tif (wholeCells < this._tasks.width.length) {\r\n\t\t\t\tpos += this._tasks.width[wholeCells] * (partCell % 1);\r\n\t\t\t} else {\r\n\t\t\t\tpos += 1;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tvar roundPos = Math.round(pos);\r\n\t\tthis._posFromDateCache[dateValue] = roundPos;\r\n\t\treturn Math.round(roundPos);\r\n\t},\r\n\r\n\t_getNextVisibleColumn: function (startIndex, columns, ignores) {\r\n\t\t// iterate columns to the right\r\n\t\tvar date = +columns[startIndex];\r\n\t\tvar visibleDateIndex = startIndex;\r\n\t\twhile (ignores[date]) {\r\n\t\t\tvisibleDateIndex++;\r\n\t\t\tdate = +columns[visibleDateIndex];\r\n\t\t}\r\n\r\n\t\treturn visibleDateIndex;\r\n\t},\r\n\t_getPrevVisibleColumn: function (startIndex, columns, ignores) {\r\n\t\t// iterate columns to the left\r\n\t\tvar date = +columns[startIndex];\r\n\t\tvar visibleDateIndex = startIndex;\r\n\t\twhile (ignores[date]) {\r\n\t\t\tvisibleDateIndex--;\r\n\t\t\tdate = +columns[visibleDateIndex];\r\n\t\t}\r\n\t\treturn visibleDateIndex;\r\n\t},\r\n\t_getClosestVisibleColumn: function (startIndex, columns, ignores) {\r\n\t\tvar visibleDateIndex = this._getNextVisibleColumn(startIndex, columns, ignores);\r\n\t\tif (!columns[visibleDateIndex]) {\r\n\t\t\tvisibleDateIndex = this._getPrevVisibleColumn(startIndex, columns, ignores);\r\n\t\t}\r\n\t\treturn visibleDateIndex;\r\n\t},\r\n\tcolumnIndexByDate: function columnIndexByDate(date) {\r\n\t\tvar pos = new Date(date).valueOf();\r\n\t\tvar days = this._tasks.trace_x_ascending,\r\n\t\t\tignores = this._tasks.ignore_x;\r\n\r\n\t\tvar state = this.$gantt.getState();\r\n\r\n\t\tif (pos <= state.min_date) {\r\n\t\t\tif(this._tasks.rtl){\r\n\t\t\t\treturn days.length;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (pos >= state.max_date) {\r\n\t\t\tif(this._tasks.rtl){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn days.length;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dateIndex = helpers.findBinary(days, pos);\r\n\r\n\t\tvar visibleIndex = this._getClosestVisibleColumn(dateIndex, days, ignores);\r\n\t\tvar visibleDate = days[visibleIndex];\r\n\t\tvar transition = this._tasks.trace_index_transition;\r\n\r\n\t\tif(!visibleDate){\r\n\t\t\tif(transition){\r\n\t\t\t\treturn transition[0];\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar part = ((date - days[visibleIndex]) / this._getColumnDuration(this._tasks, days[visibleIndex]));\r\n\t\tif(transition){\r\n\t\t\treturn transition[visibleIndex] + (1 - part);\r\n\t\t}else{\r\n\t\t\treturn visibleIndex + part;\r\n\t\t}\r\n\t},\r\n\tgetItemPosition:function (task, start_date, end_date) {\r\n\t\tvar xLeft, xRight, width;\r\n\r\n\t\tlet displayStart = start_date || task.start_date || task.$auto_start_date;\r\n\t\tlet displayEnd = end_date || task.end_date || task.$auto_end_date;\r\n\t\tif(this._tasks.rtl){\r\n\t\t\txRight = this.posFromDate(displayStart);\r\n\t\t\txLeft = this.posFromDate(displayEnd);\r\n\t\t}else{\r\n\t\t\txLeft = this.posFromDate(displayStart);\r\n\t\t\txRight = this.posFromDate(displayEnd);\r\n\t\t}\r\n\t\twidth = Math.max((xRight - xLeft), 0);\r\n\r\n\t\tvar y = this.getItemTop(task.id);\r\n\r\n\t\tvar height = this.getBarHeight(task.id);\r\n\t\tvar rowHeight = this.getItemHeight(task.id);\r\n\t\treturn {\r\n\t\t\tleft: xLeft,\r\n\t\t\ttop: y,\r\n\t\t\theight: height,\r\n\t\t\twidth: width,\r\n\t\t\trowHeight: rowHeight\r\n\t\t};\r\n\t},\r\n\r\n\tgetBarHeight: function(taskId, isMilestoneRender){\r\n\t\tvar config = this.$getConfig();\r\n\r\n\t\tvar task = this.$config.rowStore.getItem(taskId);\r\n\t\t// height of the bar item\r\n\t\tvar height = task.task_height || task.bar_height || config.bar_height || config.task_height;\r\n\t\tvar rowHeight = this.getItemHeight(taskId);\r\n\r\n\t\tif (height == \"full\") {\r\n\t\t\tvar offset = config.bar_height_padding || 3;\r\n\t\t\theight = rowHeight - offset;\r\n\t\t}\r\n\t\t//item height cannot be bigger than row height\r\n\t\theight = Math.min(height, rowHeight);\r\n\t\tif (isMilestoneRender) { // to get correct height for addapting Milestone to the row\r\n\t\t\theight = Math.round(height / Math.sqrt(2));\r\n\t\t}\r\n\t\treturn Math.max(height, 0);\r\n\t},\r\n\r\n\tgetScale: function(){\r\n\t\treturn this._tasks;\r\n\t},\r\n\r\n\t_getScales: function _get_scales() {\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar helpers = this.$scaleHelper;\r\n\t\tvar scales = [helpers.primaryScale(config)].concat(helpers.getSubScales(config));\r\n\r\n\t\thelpers.sortScales(scales);\r\n\t\treturn scales;\r\n\t},\r\n\r\n\t_getColumnDuration: function _get_coll_duration(scale, date) {\r\n\t\treturn this.$gantt.date.add(date, scale.step, scale.unit) - date;\r\n\t},\r\n\t_bindStore: function () {\r\n\t\tif (this.$config.bind){\r\n\t\t\tvar rowStore = this.$gantt.getDatastore(this.$config.bind);\r\n\t\t\tthis.$config.rowStore = rowStore;\r\n\t\t\tif(rowStore && !rowStore._timelineCacheAttached){\r\n\t\t\t\tvar self = this;\r\n\t\t\t\trowStore._timelineCacheAttached = rowStore.attachEvent(\"onBeforeFilter\", function(){\r\n\t\t\t\t\tself._resetTopPositionHeight();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_unbindStore: function(){\r\n\t\tif (this.$config.bind){\r\n\t\t\tvar rowStore = this.$gantt.getDatastore(this.$config.bind);\r\n\t\t\tif(rowStore && rowStore._timelineCacheAttached){\r\n\t\t\t\trowStore.detachEvent(rowStore._timelineCacheAttached);\r\n\t\t\t\trowStore._timelineCacheAttached = false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\trefresh: function(){\r\n\t\tthis._bindStore();\r\n\r\n\t\tif(this.$config.bindLinks) {\r\n\t\t\tthis.$config.linkStore = this.$gantt.getDatastore(this.$config.bindLinks);\r\n\t\t}\r\n\r\n\t\tthis._resetTopPositionHeight();\r\n\t\tthis._resetHeight();\r\n\t\tthis._initStaticBackgroundRender();\r\n\t\tthis._render_tasks_scales();\r\n\t},\r\n\r\n\tdestructor: function(){\r\n\t\tvar gantt = this.$gantt;\r\n\t\tthis._clearLayers(gantt);\r\n\t\tthis._unbindStore();\r\n\t\tthis.$task = null;\r\n\t\tthis.$task_scale = null;\r\n\t\tthis.$task_data = null;\r\n\t\tthis.$task_bg = null;\r\n\t\tthis.$task_links = null;\r\n\t\tthis.$task_bars = null;\r\n\r\n\t\tthis.$gantt = null;\r\n\r\n\t\tif(this.$config.rowStore){\r\n\t\t\tthis.$config.rowStore.detachEvent(this._staticBgHandler);\r\n\t\t\tthis.$config.rowStore = null;\r\n\t\t}\r\n\t\tif(this.$config.linkStore){\r\n\t\t\tthis.$config.linkStore = null;\r\n\t\t}\r\n\r\n\t\tif(this._timelineDragScroll) {\r\n\t\t\tthis._timelineDragScroll.destructor();\r\n\t\t\tthis._timelineDragScroll = null;\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t}\r\n};\r\n\r\nexport default Timeline;","\r\nexport default function(){\r\n\tvar self = this;\r\n\tvar taskFilter = function(){\r\n\t\treturn self.isVisible();\r\n\t};\r\n\r\n\tvar barVisible = function(id, task){\r\n\t\treturn !task.hide_bar;\r\n\t};\r\n\r\n\tconst gantt = this.$gantt;\r\n\r\n\tvar taskLayers = [\r\n\t\t{\r\n\t\t\texpose: true,\r\n\t\t\trenderer: this.$gantt.$ui.layers.taskBar(),\r\n\t\t\tcontainer: this.$task_bars,\r\n\t\t\tfilter: [taskFilter, barVisible]\r\n\t\t}\r\n\t];\r\n\r\n\ttaskLayers.push({\r\n\t\trenderer: this.$gantt.$ui.layers.taskBg(),\r\n\t\tcontainer: this.$task_bg,\r\n\t\tfilter: [\r\n\t\t\t//function(){\r\n\t\t\t//\treturn !self.$getConfig().static_background;\r\n\t\t\t//},\r\n\t\t\ttaskFilter\r\n\t\t]\r\n\t});\r\n\r\n\tvar linkLayers = [\r\n\t\t{\r\n\t\t\texpose: true,\r\n\t\t\trenderer: this.$gantt.$ui.layers.link(),\r\n\t\t\tcontainer: this.$task_links,\r\n\t\t\tfilter: [taskFilter]\r\n\t\t}\r\n\t];\r\n\r\n\treturn {\r\n\t\ttasks: taskLayers,\r\n\t\tlinks: linkLayers\r\n\t};\r\n\r\n};","const SENSITIVITY = 20;\r\nconst TIMEOUT = 50;\r\nconst SCROLLSTEP = 10;\r\n\r\nexport default class ScrollableGrid {\r\n\tpublic getCurrentX;\r\n\tprivate $gantt;\r\n\tprivate $grid;\r\n\tprivate _dnd;\r\n\tprivate _scrollView;\r\n\tprivate _scrollOrder: 0 | 1 | -1 = 0;\r\n\r\n\tconstructor(params) {\r\n\t\tconst {gantt, grid, dnd, getCurrentX} = params;\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis.$grid = grid;\r\n\t\tthis._dnd = dnd;\r\n\t\tthis.getCurrentX = getCurrentX;\r\n\t\tthis._scrollView = this.$gantt.$ui.getView(this.$grid.$config.scrollX);\r\n\t\tthis.attachEvents();\r\n\t}\r\n\tattachEvents() {\r\n\t\tif (this.isScrollable()) {\r\n\t\t\tthis._dnd.attachEvent(\"onDragMove\", (obj, e) => {\r\n\t\t\t\tconst gridBoundingRect = this.$grid.$grid.getBoundingClientRect();\r\n\t\t\t\tconst maxLeft = gridBoundingRect.right;\r\n\t\t\t\tconst minLeft = gridBoundingRect.left;\r\n\t\t\t\tconst currentX = this.getCurrentX(e.clientX);\r\n\r\n\t\t\t\tif (currentX >= maxLeft - SENSITIVITY) {\r\n\t\t\t\t\tthis.autoscrollRight();\r\n\t\t\t\t\tthis.autoscrollStart();\r\n\t\t\t\t}\r\n\t\t\t\tif (currentX <= minLeft + SENSITIVITY) {\r\n\t\t\t\t\tthis.autoscrollLeft();\r\n\t\t\t\t\tthis.autoscrollStart();\r\n\t\t\t\t}\r\n\t\t\t\tif (currentX < maxLeft - SENSITIVITY && currentX > minLeft + SENSITIVITY) {\r\n\t\t\t\t\tthis.autoscrollStop();\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t\tthis._dnd.attachEvent(\"onDragEnd\", () => {\r\n\t\t\t\tthis.autoscrollStop();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\tautoscrollStart() {\r\n\t\tif (this._scrollOrder === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst scrollStep = SCROLLSTEP * this._scrollOrder;\r\n\t\tconst scrollState = this._scrollView.getScrollState();\r\n\t\tthis._scrollView.scrollTo(scrollState.position + scrollStep);\r\n\t\tsetTimeout(() => { this.autoscrollStart(); }, TIMEOUT);\r\n\t}\r\n\tautoscrollRight() {\r\n\t\tthis._scrollOrder = 1;\r\n\t}\r\n\tautoscrollLeft() {\r\n\t\tthis._scrollOrder = -1;\r\n\t}\r\n\tautoscrollStop() {\r\n\t\tthis._scrollOrder = 0;\r\n\t}\r\n\tgetCorrection() {\r\n\t\tif (!this.isScrollable()) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn this._scrollView.getScrollState().position;\r\n\t}\r\n\tisScrollable() {\r\n\t\treturn !!this.$grid.$config.scrollable;\r\n\t}\r\n}","import * as domHelpers from \"../../utils/dom_helpers\";\r\nimport ScrollableGrid from \"./scrollable_grid\";\r\n\r\nconst COLUMN_ID_ATTR_NAME = \"data-column-id\";\r\n\r\nexport class ColumnsGridDnd {\r\n\tprivate $gantt;\r\n\tprivate $grid;\r\n\tprivate _dragX;\r\n\tprivate _dnd;\r\n\tprivate _originAutoscroll;\r\n\tprivate _scrollableGrid: ScrollableGrid;\r\n\tprivate _draggedCell;\r\n\tprivate _targetMarker = null;\r\n\tprivate _gridConfig;\r\n\tconstructor(gantt, grid) {\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis.$grid = grid;\r\n\t}\r\n\tinit() {\r\n\t\tconst DND = this.$gantt.$services.getService(\"dnd\");\r\n\t\tthis._dnd = new DND(this.$grid.$grid_scale, { updates_per_second: 60 });\r\n\t\tthis._scrollableGrid = new ScrollableGrid({\r\n\t\t\tgantt: this.$gantt,\r\n\t\t\tgrid: this.$grid,\r\n\t\t\tdnd: this._dnd,\r\n\t\t\tgetCurrentX: this.calculateCurrentPosition\r\n\t\t});\r\n\t\tthis.attachEvents();\r\n\t}\r\n\tattachEvents() {\r\n\t\tthis._dnd.attachEvent(\"onBeforeDragStart\", (obj, e) => {\r\n\t\t\tthis._draggedCell = this.$gantt.utils.dom.closest(e.target, \".gantt_grid_head_cell\");\r\n\t\t\tif(!this._draggedCell){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst columns = this.$grid.$getConfig().columns;\r\n\t\t\tconst columnName = this._draggedCell.getAttribute(COLUMN_ID_ATTR_NAME);\r\n\t\t\tlet draggedColumn;\r\n\t\t\tlet draggedIndex;\r\n\t\t\tcolumns.map(function(column, index){\r\n\t\t\t\tif(column.name === columnName){\r\n\t\t\t\t\tdraggedColumn = column;\r\n\t\t\t\t\tdraggedIndex = index;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (this.$grid.callEvent(\"onBeforeColumnDragStart\", [{ draggedColumn, draggedIndex}]) === false) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this._draggedCell || !draggedColumn) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tthis._gridConfig = this.$grid.$getConfig();\r\n\t\t\tthis._originAutoscroll = this.$gantt.config.autoscroll;\r\n\t\t\tthis.$gantt.config.autoscroll = false;\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tthis._dnd.attachEvent(\"onAfterDragStart\", (obj, e) => {\r\n\t\t\tif (!this._draggedCell) {\r\n\t\t\t\treturn; // GS-1333: don't try to reorder a column when we resize it\r\n\t\t\t}\r\n\t\t\tthis._dnd.config.column = this._draggedCell.getAttribute(COLUMN_ID_ATTR_NAME);\r\n\t\t\tthis._dnd.config.marker.innerHTML = this._draggedCell.outerHTML;\r\n\t\t\tthis._dnd.config.marker.classList.add(\"gantt_column_drag_marker\");\r\n\t\t\tthis._dnd.config.marker.style.height = this._gridConfig.scale_height + \"px\";\r\n\t\t\tthis._dnd.config.marker.style.lineHeight = this._gridConfig.scale_height + \"px\";\r\n\t\t\tthis._draggedCell.classList.add(\"gantt_grid_head_cell_dragged\");\r\n\t\t});\r\n\r\n\t\tthis._dnd.attachEvent(\"onDragMove\", (obj, e) => {\r\n\t\t\tif(!this._draggedCell){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis._dragX = e.clientX;\r\n\t\t\tconst x = this.calculateCurrentPosition(e.clientX);\r\n\t\t\tconst columnIndexes = this.findColumnsIndexes();\r\n\t\t\tconst targetIndex = columnIndexes.targetIndex;\r\n\t\t\tconst draggedIndex = columnIndexes.draggedIndex;\r\n\t\t\tconst columns = this.$grid.$getConfig().columns;\r\n\r\n\t\t\tconst draggedColumn = columns[draggedIndex];\r\n\t\t\tconst targetColumn = columns[targetIndex];\r\n\t\t\tif (this.$grid.callEvent(\"onColumnDragMove\", [{ draggedColumn, targetColumn, draggedIndex, targetIndex }]) === false) {\r\n\t\t\t\tthis.cleanTargetMarker();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tthis.setMarkerPosition(x);\r\n\t\t\tthis.drawTargetMarker(columnIndexes);\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tthis._dnd.attachEvent(\"onDragEnd\", () => {\r\n\t\t\tif (!this._draggedCell) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.$gantt.config.autoscroll = this._originAutoscroll;\r\n\t\t\tthis._draggedCell.classList.remove(\"gantt_grid_head_cell_dragged\");\r\n\t\t\tthis.cleanTargetMarker();\r\n\t\t\tthis.reorderColumns();\r\n\t\t});\r\n\r\n\t}\r\n\treorderColumns() {\r\n\t\tconst { targetIndex, draggedIndex } = this.findColumnsIndexes();\r\n\r\n\t\tconst columns = this.$grid.$getConfig().columns;\r\n\t\tconst draggedColumn = columns[draggedIndex];\r\n\t\tconst targetColumn = columns[targetIndex];\r\n\r\n\t\tif (this.$grid.callEvent(\"onBeforeColumnReorder\", [{ draggedColumn, targetColumn, draggedIndex, targetIndex }]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (targetIndex === draggedIndex) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcolumns.splice(draggedIndex, 1);\r\n\t\tcolumns.splice(targetIndex, 0, draggedColumn);\r\n\t\tthis.$gantt.render();\r\n\t\tthis.$grid.callEvent(\"onAfterColumnReorder\", [{ draggedColumn, targetColumn, draggedIndex, targetIndex }]);\r\n\t}\r\n\tfindColumnsIndexes() {\r\n\t\tconst draggedId = this._dnd.config.column;\r\n\t\tconst columns = this.$grid.$getConfig().columns;\r\n\t\tlet targetIndex: number;\r\n\t\tlet draggedIndex: number;\r\n\t\tlet xBefore: number;\r\n\t\tlet xAfter: number;\r\n\t\tconst currentColumn = { startX: 0, endX: 0 };\r\n\r\n\t\tlet start = 0;\r\n\t\tlet end = columns.length - 1;\r\n\t\tlet compare = (a, b) => a <= b;\r\n\t\tlet next = (index) => ++index;\r\n\t\tif (this.$gantt.config.rtl) {\r\n\t\t\tstart = columns.length - 1;\r\n\t\t\tend = 0;\r\n\t\t\tcompare = (a, b) => a >= b;\r\n\t\t\tnext = (index) => --index;\r\n\t\t}\r\n\r\n\t\tlet columnRelativePos: number;\r\n\r\n\t\tconst relativeX = this._dragX - this.$grid.$grid.getBoundingClientRect().left + this._scrollableGrid.getCorrection();\r\n\t\tfor (let i = start; compare(i, end); i = next(i)) {\r\n\t\t\tif (targetIndex !== undefined && draggedIndex !== undefined) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(!columns[i].hide) {\r\n\t\t\t\tcurrentColumn.startX = currentColumn.endX;\r\n\t\t\t\tcurrentColumn.endX += columns[i].width;\r\n\r\n\t\t\t\t// if drop on a column or drop after the last column\r\n\t\t\t\tif (relativeX >= currentColumn.startX && (relativeX <= currentColumn.endX || !compare(next(i), end))) {\r\n\t\t\t\t\ttargetIndex = i;\r\n\t\t\t\t\txBefore = currentColumn.startX;\r\n\t\t\t\t\txAfter = currentColumn.endX;\r\n\t\t\t\t\tcolumnRelativePos = (relativeX - currentColumn.startX) / (currentColumn.endX - currentColumn.startX);\r\n\t\t\t\t}\r\n\t\t\t\tif (draggedId === columns[i].name) {\r\n\t\t\t\t\tdraggedIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttargetIndex,\r\n\t\t\tdraggedIndex,\r\n\t\t\txBefore,\r\n\t\t\txAfter,\r\n\t\t\tcolumnRelativePos\r\n\t\t};\r\n\t}\r\n\tsetMarkerPosition(x: number, y: number = 10) {\r\n\t\tconst { marker } = this._dnd.config;\r\n\t\tconst gridOffset = this._dnd._obj.getBoundingClientRect();\r\n\t\tmarker.style.top = `${gridOffset.y + y}px`;\r\n\t\tmarker.style.left = `${x}px`;\r\n\t}\r\n\tcalculateCurrentPosition = (eventX: number) => {\r\n\t\tconst gridBoundingRect = this.$grid.$grid.getBoundingClientRect();\r\n\t\tconst maxLeft = gridBoundingRect.right;\r\n\t\tconst minLeft = gridBoundingRect.left;\r\n\t\tlet x = eventX;\r\n\t\tif (x > maxLeft) {\r\n\t\t\tx = maxLeft;\r\n\t\t}\r\n\t\tif (x < minLeft) {\r\n\t\t\tx = minLeft;\r\n\t\t}\r\n\t\treturn x;\r\n\t};\r\n\tdrawTargetMarker({ targetIndex, draggedIndex, xBefore, xAfter, columnRelativePos }) {\r\n\t\tif (!this._targetMarker) {\r\n\t\t\tthis._targetMarker = document.createElement(\"div\");\r\n\t\t\tdomHelpers.addClassName(this._targetMarker, \"gantt_grid_target_marker\");\r\n\t\t\tthis._targetMarker.style.display = \"none\";\r\n\t\t\tthis._targetMarker.style.height = `${this._gridConfig.scale_height}px`;\r\n\t\t}\r\n\r\n\t\t// marker can be detached after gantt.render\r\n\t\tif(!this._targetMarker.parentNode){\r\n\t\t\tthis.$grid.$grid_scale.appendChild(this._targetMarker);\r\n\t\t}\r\n\r\n\t\tlet nextPosition: number;\r\n\t\tif (targetIndex > draggedIndex) {\r\n\t\t\tnextPosition = xAfter;\r\n\t\t} else if (targetIndex < draggedIndex) {\r\n\t\t\tnextPosition = xBefore;\r\n\t\t} else {\r\n\t\t\tif(columnRelativePos > 0.5){\r\n\t\t\t\tnextPosition = xAfter;\r\n\t\t\t}else{\r\n\t\t\t\tnextPosition = xBefore;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._targetMarker.style.left = `${nextPosition}px`;\r\n\t\tthis._targetMarker.style.display = \"block\";\r\n\t}\r\n\tcleanTargetMarker() {\r\n\t\tif (this._targetMarker && this._targetMarker.parentNode) {\r\n\t\t\tthis.$grid.$grid_scale.removeChild(this._targetMarker);\r\n\t\t}\r\n\t\tthis._targetMarker = null;\r\n\t}\r\n}","function create(gantt){\r\n\tvar events = [];\r\n\r\n\treturn {\r\n\t\tdelegate:function(event, className, handler, root) {\r\n\t\t\tevents.push([event, className, handler, root]);\r\n\r\n\t\t\tvar helper = gantt.$services.getService(\"mouseEvents\");\r\n\t\t\thelper.delegate(event, className, handler, root);\r\n\t\t},\r\n\t\tdestructor: function(){\r\n\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\r\n\t\t\tfor(var i = 0; i < events.length; i++){\r\n\t\t\t\tvar h = events[i];\r\n\t\t\t\tmouseEvents.detach(h[0], h[1], h[2], h[3]);\r\n\t\t\t}\r\n\t\t\tevents = [];\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default create;","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport eventable from \"../../../utils/eventable\";\r\nimport gridResize from \"./grid_resize\";\r\nimport topPositionMixin from \"../row_position_mixin\";\r\nimport rowResize from \"./task_grid_row_resize\";\r\n\r\nimport ColumnDnd from \"../plugins/column_grid_dnd\";\r\n\r\nimport mouseEventContainer from \"../mouse_event_container\";\r\n\r\nvar Grid = function (parent, config, factory, gantt) {\r\n\tthis.$config = utils.mixin({}, config || {});\r\n\tthis.$gantt = gantt;\r\n\tthis.$parent = parent;\r\n\teventable(this);\r\n\tthis.$state = {};\r\n\tutils.mixin(this, topPositionMixin(this));\r\n};\r\n\r\n\r\nGrid.prototype = {\r\n\tinit: function(container) {\r\n\t\tvar gantt = this.$gantt;\r\n\t\tvar gridAriaAttr = gantt._waiAria.gridAttrString();\r\n\t\tvar gridDataAriaAttr = gantt._waiAria.gridDataAttrString();\r\n\t\tvar _ganttConfig = this.$getConfig();\r\n\t\tvar reorderColumns = _ganttConfig.reorder_grid_columns || false;\r\n\t\tif (this.$config.reorder_grid_columns !== undefined) {\r\n\t\t\treorderColumns = this.$config.reorder_grid_columns;\r\n\t\t}\r\n\r\n\r\n\t\tcontainer.innerHTML = \"
\";\r\n\t\tthis.$grid = container.childNodes[0];\r\n\r\n\t\tthis.$grid.innerHTML = \"
\";\r\n\r\n\t\tthis.$grid_scale = this.$grid.childNodes[0];\r\n\t\tthis.$grid_data = this.$grid.childNodes[1];\r\n\r\n\t\tvar attr = _ganttConfig[this.$config.bind + \"_attribute\"];\r\n\t\tif (!attr && this.$config.bind) {\r\n\t\t\tattr = \"data-\" + this.$config.bind + \"-id\";\r\n\t\t}\r\n\t\tthis.$config.item_attribute = attr || null;\r\n\r\n\t\tif (!this.$config.layers) {\r\n\t\t\tvar layers = this._createLayerConfig();\r\n\t\t\tthis.$config.layers = layers;\r\n\t\t}\r\n\r\n\t\tvar resizer = gridResize(gantt, this);\r\n\t\tresizer.init();\r\n\t\tthis._renderHeaderResizers = resizer.doOnRender;\r\n\t\tthis._mouseDelegates = mouseEventContainer(gantt);\r\n\r\n\t\tvar resizerrow = rowResize(gantt, this);\r\n\t\tresizerrow.init();\r\n\r\n\t\tthis._addLayers(this.$gantt);\r\n\t\tthis._initEvents();\r\n\r\n\t\tif (reorderColumns) {\r\n\t\t\tthis._columnDND = new ColumnDnd(gantt, this);\r\n\t\t\tthis._columnDND.init();\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onReady\", []);\r\n\t\t//this.refresh();\r\n\t},\r\n\r\n\t_validateColumnWidth: function (column, property) {\r\n\t\t// user can set {name:\"text\", width:\"200\",...} for some reason,\r\n\t\t// check and convert it to number when possible\r\n\t\tvar value = column[property];\r\n\t\tif (value && value != \"*\") {\r\n\t\t\tvar gantt = this.$gantt;\r\n\t\t\tvar numericWidth = value * 1;\r\n\t\t\tif (isNaN(numericWidth)) {\r\n\t\t\t\tgantt.assert(false, \"Wrong \" + property + \" value of column \" + column.name);\r\n\t\t\t} else {\r\n\t\t\t\tcolumn[property] = numericWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tsetSize: function (width, height) {\r\n\t\tthis.$config.width = this.$state.width = width;\r\n\t\tthis.$config.height = this.$state.height = height;\r\n\r\n\t\t// TODO: maybe inherit and override in a subclass instead of extending here\r\n\r\n\t\tvar columns = this.getGridColumns(),\r\n\t\t\tinnerWidth = 0;\r\n\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar elasticColumns = config.grid_elastic_columns;\r\n\r\n\t\tfor (var i = 0, l = columns.length; i < l; i++) {\r\n\t\t\tthis._validateColumnWidth(columns[i], \"min_width\");\r\n\t\t\tthis._validateColumnWidth(columns[i], \"max_width\");\r\n\t\t\tthis._validateColumnWidth(columns[i], \"width\");\r\n\r\n\t\t\tinnerWidth += columns[i].width * 1;\r\n\t\t}\r\n\r\n\t\tvar outerWidth;\r\n\t\tif (isNaN(innerWidth) || !this.$config.scrollable) {\r\n\t\t\touterWidth = this._setColumnsWidth(width + 1);\r\n\t\t\tinnerWidth = outerWidth;\r\n\t\t}\r\n\r\n\t\tif(this.$config.scrollable && elasticColumns && !isNaN(innerWidth)){\r\n\t\t\t// GS-1352: Allow resizing the grid columns, then the grid width is increased\r\n\t\t\t// or keep the grid width, but don't allow column resize to affect the grid width\r\n\t\t\tlet columnProperty = \"width\";\r\n\t\t\tif (elasticColumns == \"min_width\"){\r\n\t\t\t\tcolumnProperty = \"min_width\";\r\n\t\t\t}\r\n\t\t\tlet newColumnWidth = 0;\r\n\t\t\tcolumns.forEach(function(col){\r\n\t\t\t\tnewColumnWidth += col[columnProperty] || config.min_grid_column_width;\r\n\t\t\t});\r\n\t\t\t//newColumnWidth--; // the total column width shouldn't match the outerWidth // GS-2190 reducing width seems to be not needed\r\n\t\t\tvar columnsWidth = Math.max(newColumnWidth, width);\r\n\t\t\tinnerWidth = this._setColumnsWidth(columnsWidth);\r\n\t\t\touterWidth = width;\r\n\t\t}\r\n\r\n\t\tif (this.$config.scrollable) {\r\n\t\t\tthis.$grid_scale.style.width = innerWidth + \"px\";\r\n\t\t\tthis.$grid_data.style.width = innerWidth + \"px\";\r\n\t\t} else {\r\n\t\t\tthis.$grid_scale.style.width = \"inherit\";\r\n\t\t\tthis.$grid_data.style.width = \"inherit\";\r\n\t\t}\r\n\t\tthis.$config.width -= 1;\r\n\r\n\t\tvar config = this.$getConfig();\r\n\t\tif (outerWidth !== width) {\r\n\t\t\tif(outerWidth !== undefined){\r\n\t\t\t\tconfig.grid_width = outerWidth;\r\n\t\t\t\tthis.$config.width = outerWidth - 1;\r\n\t\t\t}else{\r\n\t\t\t\tif(!isNaN(innerWidth)){\r\n\t\t\t\t\tthis._setColumnsWidth(innerWidth);\r\n\t\t\t\t\tconfig.grid_width = innerWidth;\r\n\t\t\t\t\tthis.$config.width = innerWidth - 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dataHeight = Math.max(this.$state.height - config.scale_height, 0);\r\n\t\tthis.$grid_data.style.height = dataHeight + \"px\";\r\n\t\tthis.refresh();\r\n\t},\r\n\tgetSize: function () {\r\n\r\n\t\tvar config = this.$getConfig();\r\n\r\n\t\tvar store = this.$config.rowStore;\r\n\r\n\t\tvar contentHeight = store ? this.getTotalHeight() : 0,\r\n\t\t\tcontentWidth = this._getGridWidth();\r\n\r\n\t\tvar size = {\r\n\t\t\tx: this.$state.width,\r\n\t\t\ty: this.$state.height,\r\n\t\t\tcontentX: this.isVisible() ? contentWidth : 0,\r\n\t\t\tcontentY: this.isVisible() ? (config.scale_height + contentHeight) : 0,\r\n\t\t\tscrollHeight: this.isVisible() ? contentHeight : 0,\r\n\t\t\tscrollWidth: this.isVisible() ? contentWidth : 0\r\n\t\t};\r\n\r\n\t\treturn size;\r\n\t},\r\n\r\n\t_bindStore: function () {\r\n\t\tif (this.$config.bind){\r\n\t\t\tvar rowStore = this.$gantt.getDatastore(this.$config.bind);\r\n\t\t\tthis.$config.rowStore = rowStore;\r\n\t\t\tif(rowStore && !rowStore._gridCacheAttached){\r\n\t\t\t\tvar self = this;\r\n\t\t\t\trowStore._gridCacheAttached = rowStore.attachEvent(\"onBeforeFilter\", function(){\r\n\t\t\t\t\tself._resetTopPositionHeight();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_unbindStore: function(){\r\n\t\tif (this.$config.bind){\r\n\t\t\tvar rowStore = this.$gantt.getDatastore(this.$config.bind);\r\n\t\t\tif(rowStore && rowStore._gridCacheAttached){\r\n\t\t\t\trowStore.detachEvent(rowStore._gridCacheAttached);\r\n\t\t\t\trowStore._gridCacheAttached = false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\trefresh: function () {\r\n\t\tthis._bindStore();\r\n\r\n\t\tthis._resetTopPositionHeight();\r\n\t\tthis._resetHeight();\r\n\t\tthis._initSmartRenderingPlaceholder();\r\n\r\n\t\tthis._calculateGridWidth();\r\n\t\tthis._renderGridHeader();\r\n\t},\r\n\r\n\tgetViewPort: function(){\r\n\t\tvar scrollLeft = this.$config.scrollLeft || 0;\r\n\t\tvar scrollTop = this.$config.scrollTop || 0;\r\n\t\tvar height = this.$config.height || 0;\r\n\t\tvar width = this.$config.width || 0;\r\n\t\treturn {\r\n\t\t\ty: scrollTop,\r\n\t\t\ty_end: scrollTop + height,\r\n\t\t\tx: scrollLeft,\r\n\t\t\tx_end: scrollLeft + width,\r\n\t\t\theight: height,\r\n\t\t\twidth: width\r\n\t\t};\r\n\t},\r\n\r\n\tscrollTo: function (left, top) {\r\n\t\tif (!this.isVisible())\r\n\t\t\treturn;\r\n\r\n\t\tvar scrolled = false;\r\n\r\n\t\tthis.$config.scrollTop = this.$config.scrollTop || 0;\r\n\t\tthis.$config.scrollLeft = this.$config.scrollLeft || 0;\r\n\r\n\t\tif (left * 1 == left) {\r\n\t\t\tthis.$config.scrollLeft = this.$state.scrollLeft = this.$grid.scrollLeft = left;\r\n\t\t\tscrolled = true;\r\n\t\t}\r\n\r\n\t\t// var config = this.$getConfig();\r\n\t\tif (top * 1 == top) {\r\n\t\t\tthis.$config.scrollTop = this.$state.scrollTop = this.$grid_data.scrollTop = top;\r\n\t\t\tscrolled = true;\r\n\t\t}\r\n\r\n\t\tif(scrolled){\r\n\t\t\tthis.callEvent(\"onScroll\", [this.$config.scrollLeft, this.$config.scrollTop]);\r\n\t\t}\r\n\t},\r\n\r\n\tgetColumnIndex: function (name, excludeHidden) {\r\n\t\tvar columns = this.$getConfig().columns;\r\n\t\tvar hiddenIndexShift = 0;\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\t// GS-1257. If the cell is hidden, the target column index should be correct\r\n\t\t\tif (excludeHidden && columns[i].hide){\r\n\t\t\t\thiddenIndexShift++;\r\n\t\t\t}\r\n\t\t\tif (columns[i].name == name) {\r\n\t\t\t\treturn i - hiddenIndexShift;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tgetColumn: function (name) {\r\n\t\tvar index = this.getColumnIndex(name);\r\n\t\tif (index === null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn this.$getConfig().columns[index];\r\n\t},\r\n\r\n\tgetGridColumns: function () {\r\n\t\tvar config = this.$getConfig();\r\n\t\treturn config.columns.slice();\r\n\t},\r\n\tisVisible: function () {\r\n\t\tif (this.$parent && this.$parent.$config) {\r\n\t\t\treturn !this.$parent.$config.hidden;\r\n\t\t} else {\r\n\t\t\treturn this.$grid.offsetWidth;\r\n\t\t}\r\n\t},\r\n\r\n\t// getItemHeight: function () {\r\n\t// \tvar config = this.$getConfig();\r\n\t// \treturn config.row_height;\r\n\t// },\r\n\r\n\t_createLayerConfig: function () {\r\n\t\tvar gantt = this.$gantt;\r\n\t\tvar self = this;\r\n\t\tvar layers = [\r\n\t\t\t{\r\n\t\t\t\trenderer: gantt.$ui.layers.gridLine(),\r\n\t\t\t\tcontainer: this.$grid_data,\r\n\t\t\t\tfilter: [function () {\r\n\t\t\t\t\treturn self.isVisible();\r\n\t\t\t\t}]\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\trenderer: gantt.$ui.layers.gridTaskRowResizer(),\r\n\t\t\t\tcontainer: this.$grid_data,\r\n\t\t\t\tappend: true,\r\n\t\t\t\tfilter: [function () {\r\n\t\t\t\t\treturn gantt.config.resize_rows;\r\n\t\t\t\t}]\r\n\t\t\t}\r\n\t\t];\r\n\t\treturn layers;\r\n\t},\r\n\r\n\t_addLayers: function (gantt) {\r\n\t\tif (!this.$config.bind)\r\n\t\t\treturn;\r\n\r\n\t\tthis._taskLayers = [];\r\n\r\n\t\tvar self = this;\r\n\r\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\r\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\r\n\r\n\t\tif (!taskRenderer) {\r\n\t\t\ttaskRenderer = layers.createDataRender({\r\n\t\t\t\tname: this.$config.bind,\r\n\t\t\t\tdefaultContainer: function () { return self.$grid_data; }\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar taskLayers = this.$config.layers;\r\n\t\tfor (var i = 0; taskLayers && i < taskLayers.length; i++) {\r\n\t\t\tvar layer = taskLayers[i];\r\n\t\t\tlayer.view = this;\r\n\r\n\t\t\tvar bar_layer = taskRenderer.addLayer(layer);\r\n\t\t\tthis._taskLayers.push(bar_layer);\r\n\t\t}\r\n\r\n\t\tthis._bindStore();\r\n\r\n\t\tthis._initSmartRenderingPlaceholder();\r\n\t},\r\n\r\n\t_refreshPlaceholderOnStoreUpdate: function (id) {\r\n\t\tvar config = this.$getConfig(),\r\n\t\t\tstore = this.$config.rowStore;\r\n\r\n\t\tif (!store || id !== null || !this.isVisible() || !config.smart_rendering) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar contentHeight;\r\n\t\tif (this.$config.scrollY) {\r\n\t\t\tvar scroll = this.$gantt.$ui.getView(this.$config.scrollY);\r\n\t\t\tif (scroll)\r\n\t\t\t\tcontentHeight = scroll.getScrollState().scrollSize;\r\n\t\t}\r\n\r\n\t\tif (!contentHeight) {\r\n\t\t\tcontentHeight = store ? this.getTotalHeight() : 0;\r\n\t\t}\r\n\r\n\t\tif (contentHeight) {\r\n\t\t\tif (this.$rowsPlaceholder && this.$rowsPlaceholder.parentNode) {\r\n\t\t\t\tthis.$rowsPlaceholder.parentNode.removeChild(this.$rowsPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tvar placeholder = this.$rowsPlaceholder = document.createElement(\"div\");\r\n\t\t\tplaceholder.style.visibility = \"hidden\";\r\n\t\t\tplaceholder.style.height = contentHeight + \"px\";\r\n\t\t\tplaceholder.style.width = \"1px\";\r\n\t\t\tthis.$grid_data.appendChild(placeholder);\r\n\t\t}\r\n\t},\r\n\r\n\t_initSmartRenderingPlaceholder: function () {\r\n\t\tvar store = this.$config.rowStore;\r\n\t\tif (!store) {\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tthis._initSmartRenderingPlaceholder = function () { };\r\n\t\t}\r\n\t\tthis._staticBgHandler = store.attachEvent(\"onStoreUpdated\", utils.bind(this._refreshPlaceholderOnStoreUpdate, this));\r\n\t},\r\n\r\n\t_initEvents: function () {\r\n\t\tvar gantt = this.$gantt;\r\n\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_close\", gantt.bind(function (e, id, trg) {\r\n\t\t\tvar store = this.$config.rowStore;\r\n\t\t\tif (!store) return true;\r\n\r\n\t\t\tvar target = domHelpers.locateAttribute(e, this.$config.item_attribute);\r\n\t\t\tif (target) {\r\n\t\t\t\tstore.close(target.getAttribute(this.$config.item_attribute));\r\n\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}, this), this.$grid);\r\n\r\n\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_open\", gantt.bind(function (e, id, trg) {\r\n\t\t\tvar store = this.$config.rowStore;\r\n\t\t\tif (!store) return true;\r\n\r\n\t\t\tvar target = domHelpers.locateAttribute(e, this.$config.item_attribute);\r\n\t\t\tif (target) {\r\n\t\t\t\tstore.open(target.getAttribute(this.$config.item_attribute));\r\n\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}, this), this.$grid);\r\n\t},\r\n\r\n\t_clearLayers: function (gantt) {\r\n\t\tvar layers = this.$gantt.$services.getService(\"layers\");\r\n\t\tvar taskRenderer = layers.getDataRender(this.$config.bind);\r\n\r\n\t\tif (this._taskLayers) {\r\n\t\t\tfor (var i = 0; i < this._taskLayers.length; i++) {\r\n\t\t\t\ttaskRenderer.removeLayer(this._taskLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._taskLayers = [];\r\n\t},\r\n\r\n\t_getColumnWidth: function (column, config, width) {\r\n\t\tvar min_width = column.min_width || config.min_grid_column_width;\r\n\t\tvar new_width = Math.max(width, min_width || 10);\r\n\t\tif (column.max_width)\r\n\t\t\tnew_width = Math.min(new_width, column.max_width);\r\n\t\treturn new_width;\r\n\t},\r\n\t// set min width only if width < than config.min_grid_column_width\r\n\t_checkGridColumnMinWidthLimits: function (columns, config) {\r\n\t\tfor (var i = 0, l = columns.length; i < l; i++) {\r\n\t\t\tvar width = columns[i].width * 1;\r\n\t\t\tif (!columns[i].min_width && width < config.min_grid_column_width){\r\n\t\t\t\tcolumns[i].min_width = width;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t// return min and max possible grid width according to restricts\r\n\t_getGridWidthLimits: function () {\r\n\t\tvar config = this.$getConfig(),\r\n\t\t\tcolumns = this.getGridColumns(),\r\n\t\t\tmin_limit = 0,\r\n\t\t\tmax_limit = 0;\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tmin_limit += columns[i].min_width ? columns[i].min_width : config.min_grid_column_width;\r\n\t\t\tif (max_limit !== undefined) {\r\n\t\t\t\tmax_limit = columns[i].max_width ? (max_limit + columns[i].max_width) : undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis._checkGridColumnMinWidthLimits(columns, config); // FIX ME: should it be before calculating limits?\r\n\t\treturn [min_limit, max_limit];\r\n\t},\r\n\t// resize columns to get total newWidth, starting from columns[start_index]\r\n\t_setColumnsWidth: function (newWidth, start_index) {\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar columns = this.getGridColumns(),\r\n\t\t\tcolumns_width = 0,\r\n\t\t\tfinal_width = newWidth;\r\n\r\n\t\tstart_index = !window.isNaN(start_index) ? start_index : -1;\r\n\r\n\t\tfor (var i = 0, l = columns.length; i < l; i++) {\r\n\t\t\tcolumns_width += columns[i].width * 1;\r\n\t\t}\r\n\r\n\t\tif (window.isNaN(columns_width)) {\r\n\t\t\tthis._calculateGridWidth();\r\n\t\t\tcolumns_width = 0;\r\n\t\t\tfor (var i = 0, l = columns.length; i < l; i++) {\r\n\t\t\t\tcolumns_width += columns[i].width * 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar extra_width = final_width - columns_width;\r\n\r\n\t\tvar start_width = 0;\r\n\t\tfor (var i = 0; i < start_index + 1; i++) {\r\n\t\t\tstart_width += columns[i].width;\r\n\t\t}\r\n\r\n\t\tcolumns_width -= start_width;\r\n\r\n\t\tfor (var i = start_index + 1; i < columns.length; i++) {\r\n\r\n\t\t\tvar col = columns[i];\r\n\t\t\tvar share = Math.round(extra_width * (col.width / columns_width));\r\n\r\n\t\t\t// columns have 2 additional restrict fields - min_width & max_width that are set by user\r\n\t\t\tif (extra_width < 0) {\r\n\t\t\t\tif (col.min_width && col.width + share < col.min_width)\r\n\t\t\t\t\tshare = col.min_width - col.width;\r\n\t\t\t\telse if (!col.min_width && config.min_grid_column_width && col.width + share < config.min_grid_column_width)\r\n\t\t\t\t\tshare = config.min_grid_column_width - col.width;\r\n\t\t\t} else if (col.max_width && col.width + share > col.max_width)\r\n\t\t\t\tshare = col.max_width - col.width;\r\n\r\n\t\t\tcolumns_width -= col.width;\r\n\t\t\tcol.width += share;\r\n\t\t\textra_width -= share;\r\n\r\n\t\t}\r\n\r\n\t\tvar iterator = extra_width > 0 ? 1 : -1;\r\n\t\twhile ((extra_width > 0 && iterator === 1) || (extra_width < 0 && iterator === -1)) {\r\n\t\t\tvar curExtra = extra_width;\r\n\t\t\tfor (i = start_index + 1; i < columns.length; i++) {\r\n\t\t\t\tvar new_width = columns[i].width + iterator;\r\n\r\n\t\t\t\tif (new_width == this._getColumnWidth(columns[i], config, new_width)) {\r\n\t\t\t\t\textra_width -= iterator;\r\n\t\t\t\t\tcolumns[i].width = new_width;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!extra_width)\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (curExtra == extra_width)\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t// if impossible to resize the right-side columns, resize the start column\r\n\t\tif (extra_width && start_index > -1) {\r\n\t\t\tvar new_width = columns[start_index].width + extra_width;\r\n\t\t\tif (new_width == this._getColumnWidth(columns[start_index], config, new_width))\r\n\t\t\t\tcolumns[start_index].width = new_width;\r\n\t\t}\r\n\r\n\t\t//if (this.callEvent(\"onGridResizeEnd\", [config.grid_width, final_width]) === false)\r\n\t\t//\treturn;\r\n\r\n\t\treturn this._getColsTotalWidth();\r\n\t},\r\n\r\n\t_getColsTotalWidth: function () {\r\n\t\tvar columns = this.getGridColumns();\r\n\t\tvar cols_width = 0;\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar v = parseFloat(columns[i].width);\r\n\t\t\tif (window.isNaN(v)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tcols_width += v;\r\n\t\t}\r\n\t\treturn cols_width;\r\n\t},\r\n\t_calculateGridWidth: function () {\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar columns = this.getGridColumns();\r\n\t\tvar cols_width = 0;\r\n\t\tvar unknown = [];\r\n\t\tvar width = [];\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar v = parseFloat(columns[i].width);\r\n\t\t\tif (window.isNaN(v)) {\r\n\t\t\t\tv = config.min_grid_column_width || 10;\r\n\t\t\t\tunknown.push(i);\r\n\t\t\t}\r\n\t\t\twidth[i] = v;\r\n\t\t\tcols_width += v;\r\n\t\t}\r\n\t\tvar gridWidth = this._getGridWidth() + 1;\r\n\t\tif (config.autofit || unknown.length) {\r\n\t\t\tvar diff = gridWidth - cols_width;\r\n\t\t\t// TODO: logic may be improved for proportional changing of width\r\n\r\n\t\t\t// autofit adjusts columns widths to the outer grid width\r\n\t\t\t// it doesn't makes sense if grid has inner scroll with elastic columns\r\n\t\t\tif (config.autofit && !config.grid_elastic_columns) {\r\n\t\t\t\t// delta must be added for all columns\r\n\t\t\t\tfor (var i = 0; i < width.length; i++) {\r\n\t\t\t\t\tvar delta = Math.round(diff / (width.length - i));\r\n\t\t\t\t\twidth[i] += delta;\r\n\t\t\t\t\tvar new_width = this._getColumnWidth(columns[i], config, width[i]);\r\n\r\n\t\t\t\t\tif (new_width != width[i]) {\r\n\t\t\t\t\t\tdelta = new_width - width[i];\r\n\t\t\t\t\t\twidth[i] = new_width;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdiff -= delta;\r\n\t\t\t\t}\r\n\t\t\t} else if (unknown.length) {\r\n\t\t\t\t// there are several columns with undefined width\r\n\t\t\t\tfor (var i = 0; i < unknown.length; i++) {\r\n\t\t\t\t\tvar delta = Math.round(diff / (unknown.length - i)); // no float values, just integer\r\n\t\t\t\t\tvar index = unknown[i];\r\n\t\t\t\t\twidth[index] += delta;\r\n\t\t\t\t\tvar new_width = this._getColumnWidth(columns[index], config, width[index]);\r\n\t\t\t\t\tif (new_width != width[index]) {\r\n\t\t\t\t\t\tdelta = new_width - width[index];\r\n\t\t\t\t\t\twidth[index] = new_width;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdiff -= delta;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i = 0; i < width.length; i++) {\r\n\t\t\t\tcolumns[i].width = width[i];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar changed = (gridWidth != cols_width);\r\n\t\t\tthis.$config.width = cols_width - 1;\r\n\t\t\tconfig.grid_width = cols_width;\r\n\t\t\tif (changed) {\r\n\t\t\t\tthis.$parent._setContentSize(this.$config.width, null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_renderGridHeader: function () {\r\n\t\tvar gantt = this.$gantt;\r\n\t\tvar config = this.$getConfig();\r\n\t\tvar locale = this.$gantt.locale;\r\n\t\tvar templates = this.$gantt.templates;\r\n\r\n\t\tvar columns = this.getGridColumns();\r\n\t\tif (config.rtl) {\r\n\t\t\tcolumns = columns.reverse();\r\n\t\t}\r\n\t\tvar cells = [];\r\n\t\tvar width = 0,\r\n\t\t\tlabels = locale.labels;\r\n\r\n\t\tvar lineHeigth = config.scale_height - 1;\r\n\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar last = i == columns.length - 1;\r\n\t\t\tvar col = columns[i];\r\n\r\n\t\t\t// ensure columns have non-empty names\r\n\t\t\tif (!col.name) {\r\n\t\t\t\tcol.name = gantt.uid() + \"\";\r\n\t\t\t}\r\n\r\n\t\t\tvar colWidth = col.width * 1;\r\n\r\n\t\t\tvar gridWidth = this._getGridWidth();\r\n\t\t\tif (last && gridWidth > width + colWidth)\r\n\t\t\t\tcol.width = colWidth = gridWidth - width;\r\n\t\t\twidth += colWidth;\r\n\t\t\tvar sort = (gantt._sort && col.name == gantt._sort.name) ? (`
`) : \"\";\r\n\t\t\tvar cssClass = [\"gantt_grid_head_cell\",\r\n\t\t\t\t(\"gantt_grid_head_\" + col.name),\r\n\t\t\t\t(last ? \"gantt_last_cell\" : \"\"),\r\n\t\t\t\ttemplates.grid_header_class(col.name, col)].join(\" \");\r\n\r\n\t\t\tvar style = \"width:\" + (colWidth - (last ? 1 : 0)) + \"px;\";\r\n\t\t\tvar label = (col.label || labels[\"column_\" + col.name] || labels[col.name]);\r\n\t\t\tlabel = label || \"\";\r\n\r\n\t\t\tvar ariaAttrs = gantt._waiAria.gridScaleCellAttrString(col, label);\r\n\r\n\t\t\tvar cell = \"\" + label + sort + \"
\";\r\n\t\t\tcells.push(cell);\r\n\t\t}\r\n\t\tthis.$grid_scale.style.height = (config.scale_height) + \"px\";\r\n\t\tthis.$grid_scale.style.lineHeight = lineHeigth + \"px\";\r\n\t\t//this.$grid_scale.style.width = \"inherit\";\r\n\t\tthis.$grid_scale.innerHTML = cells.join(\"\");\r\n\r\n\t\tif (this._renderHeaderResizers) {\r\n\t\t\tthis._renderHeaderResizers();\r\n\t\t}\r\n\t},\r\n\r\n\t_getGridWidth: function () {\r\n\t\t// TODO: refactor/remove/comment some of _getGridWidth/this.$config.width/this.$state.width, it's not clear what they do\r\n\t\treturn this.$config.width;\r\n\t},\r\n\r\n\tdestructor: function () {\r\n\t\tthis._clearLayers(this.$gantt);\r\n\t\tif (this._mouseDelegates) {\r\n\t\t\tthis._mouseDelegates.destructor();\r\n\t\t\tthis._mouseDelegates = null;\r\n\t\t}\r\n\t\tthis._unbindStore();\r\n\t\tthis.$grid = null;\r\n\t\tthis.$grid_scale = null;\r\n\t\tthis.$grid_data = null;\r\n\t\tthis.$gantt = null;\r\n\t\tif (this.$config.rowStore) {\r\n\t\t\tthis.$config.rowStore.detachEvent(this._staticBgHandler);\r\n\t\t\tthis.$config.rowStore = null;\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\t}\r\n};\r\n\r\nexport default Grid;\r\n","function createResizer(gantt, grid){\r\n\treturn {\r\n\t\tinit: function(){},\r\n\t\tdoOnRender: function(){}\r\n\t};\r\n}\r\n\r\nexport default createResizer;","import * as domHelpers from \"../utils/dom_helpers\";\r\n\r\nfunction createRowResizer(gantt, grid){\r\n\r\n\tvar _task_grid_row_resize = {\r\n\t\trow_before_start: gantt.bind(function (dnd, obj, e) {\r\n\t\t\tvar config = grid.$getConfig();\r\n\t\t\tvar store = grid.$config.rowStore;\r\n\r\n\t\t\tvar el = domHelpers.locateAttribute(e, config.task_grid_row_resizer_attribute);\r\n\t\t\tif (!el) return false;\r\n\r\n\t\t\tvar row_id = this.locate(e, config.task_grid_row_resizer_attribute),\r\n\t\t\t\trow = store.getItem(row_id);\r\n\r\n\t\t\tif (grid.callEvent(\"onBeforeRowResize\", [row]) === false)\r\n\t\t\t\treturn false;\r\n\t\t}, gantt),\r\n\r\n\t\trow_after_start: gantt.bind(function (dnd, obj, e) {\r\n\t\t\tvar config = grid.$getConfig();\r\n\r\n\t\t\tvar row_id = this.locate(e, config.task_grid_row_resizer_attribute);\r\n\t\t\tdnd.config.marker.innerHTML = \"\";\r\n\r\n\t\t\tdnd.config.marker.className += \" gantt_row_grid_resize_area\";\r\n\t\t\tdnd.config.marker.style.width = grid.$grid.offsetWidth + \"px\";\r\n\t\t\tdnd.config.drag_id = row_id;\r\n\r\n\t\t}, gantt),\r\n\r\n\t\trow_drag_move: gantt.bind(function (dnd, obj, e) {\r\n\t\t\tvar store = grid.$config.rowStore;\r\n\t\t\tvar config = grid.$getConfig();\r\n\t\t\tvar dd = dnd.config;\r\n\t\t\tvar id = dd.drag_id,\r\n\t\t\t\titemHeight = grid.getItemHeight(id),\r\n\t\t\t\titemTop = grid.getItemTop(id) - obj.scrollTop;\r\n\t\t\tvar pos = domHelpers.getNodePosition(grid.$grid_data),\r\n\t\t\t\tpointerPosition = parseInt(dd.marker.style.top, 10),\r\n\t\t\t\tmarkerStartPosition = itemTop + pos.y,\r\n\t\t\t\tmarker_height = 0,\r\n\t\t\t\tminPointerPosition = config.min_task_grid_row_height;\r\n\r\n\t\t\tmarker_height = pointerPosition - markerStartPosition;\r\n\t\t\tif(marker_height < minPointerPosition){\r\n\t\t\t\tmarker_height = minPointerPosition;\r\n\t\t\t}\r\n\r\n\t\t\tdd.marker.style.left = pos.x + \"px\";\r\n\t\t\tdd.marker.style.top = markerStartPosition - 1 + \"px\";\r\n\t\t\tdd.marker.style.height = Math.abs(marker_height) + 1 + \"px\";\r\n\r\n\t\t\tdd.marker_height = marker_height;\r\n\t\t\t\r\n\t\t\tgrid.callEvent(\"onRowResize\", [id, store.getItem(id), marker_height + itemHeight]);\r\n\t\t\treturn true;\r\n\t\t}, gantt),\r\n\r\n\t\trow_drag_end: gantt.bind(function (dnd, obj, e) {\r\n\t\t\tvar store = grid.$config.rowStore;\r\n\t\t\tvar dd = dnd.config;\r\n\t\t\tvar id = dd.drag_id,\r\n\t\t\t\titem = store.getItem(id),\r\n\t\t\t\toldItemHeight = grid.getItemHeight(id);\r\n\r\n\t\t\tvar finalHeight = dd.marker_height;\r\n\r\n\t\t\tif (grid.callEvent(\"onBeforeRowResizeEnd\", [id, item, finalHeight]) === false)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif (item.row_height == finalHeight)\r\n\t\t\t\treturn;\r\n\r\n\t\t\titem.row_height = finalHeight;\r\n\t\t\tgantt.updateTask(id);\r\n\r\n\t\t\tgrid.callEvent(\"onAfterRowResize\", [id, item, oldItemHeight, finalHeight]);\r\n\r\n\t\t\tthis.render();\r\n\t\t}, gantt)\r\n\t};\r\n\r\n\t// calls the initialization of the D'n'D events for resize elements\r\n\tvar _init_resize = function () {\r\n\r\n\t\tvar DnD = gantt.$services.getService(\"dnd\");\r\n\r\n\t\tvar config = grid.$getConfig();\r\n\r\n\t\tvar dnd = new DnD(grid.$grid_data, {updates_per_second: 60});\r\n\t\tif (gantt.defined(config.dnd_sensitivity))\r\n\t\t\tdnd.config.sensitivity = config.dnd_sensitivity;\r\n\r\n\t\tdnd.attachEvent(\"onBeforeDragStart\", function (obj, e) {\r\n\t\t\treturn _task_grid_row_resize.row_before_start(dnd, obj, e);\r\n\t\t});\r\n\t\tdnd.attachEvent(\"onAfterDragStart\", function (obj, e) {\r\n\t\t\treturn _task_grid_row_resize.row_after_start(dnd, obj, e);\r\n\t\t});\r\n\t\tdnd.attachEvent(\"onDragMove\", function (obj, e) {\r\n\t\t\treturn _task_grid_row_resize.row_drag_move(dnd, obj, e);\r\n\t\t});\r\n\t\tdnd.attachEvent(\"onDragEnd\", function (obj, e) {\r\n\t\t\treturn _task_grid_row_resize.row_drag_end(dnd, obj, e);\r\n\t\t});\r\n\r\n\t};\r\n\r\n\treturn {\r\n\t\tinit: _init_resize\r\n\t};\r\n}\r\n\r\nexport default createRowResizer;","export default {\r\n\tinit: function (controller, grid) {\r\n\t\tvar gantt = grid.$gantt;\r\n\r\n\t\tgantt.attachEvent(\"onTaskClick\", function (id, e) {\r\n\t\t\tif (gantt._is_icon_open_click(e))\r\n\t\t\t\treturn true;\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar cell = controller.locateCell(e.target);\r\n\r\n\t\t\tif (cell && controller.getEditorConfig(cell.columnName)) {\r\n\t\t\t\tif (controller.isVisible() && state.id == cell.id && state.columnName == cell.columnName) {\r\n\t\t\t\t\t// do nothing if editor is already active in this cell\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontroller.startEdit(cell.id, cell.columnName);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onEmptyClick\", function () {\r\n\t\t\tif (controller.isVisible() && controller.isChanged()) {\r\n\t\t\t\tcontroller.save();\r\n\t\t\t} else {\r\n\t\t\t\tcontroller.hide();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onTaskDblClick\", function (id, e) {\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar cell = controller.locateCell(e.target);\r\n\t\t\tif (cell && controller.isVisible() && cell.columnName == state.columnName) {\r\n\t\t\t\t//GS-933 probably, we don't need to hide the inline editor because the lightbox cannot be opened if you double-click on an inline editor\r\n\t\t\t\t//remove this code later if people don't complain\r\n\t\t\t\t//controller.hide();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\t},\r\n\r\n\tonShow: function (controller, placeholder, grid) {\r\n\t\tvar gantt = grid.$gantt;\r\n\t\t\r\n\r\n\t\tif(gantt.ext && gantt.ext.keyboardNavigation){\r\n\t\t\tvar keyNav = gantt.ext.keyboardNavigation;\r\n\t\t\tkeyNav.attachEvent(\"onKeyDown\", function(command, e){\r\n\t\t\t\tvar keyboard = gantt.constants.KEY_CODES;\r\n\t\t\t\tvar keyCode = e.keyCode;\r\n\t\t\t\tvar preventKeyNav = false;\r\n\r\n\t\t\t\tswitch (keyCode){\r\n\t\t\t\t\tcase keyboard.SPACE:\r\n\t\t\t\t\t\tif(controller.isVisible()){\r\n\t\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (preventKeyNav){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} else{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tplaceholder.onkeydown = function (e) {\r\n\t\t\te = e || window.event;\r\n\r\n\t\t\tvar keyboard = gantt.constants.KEY_CODES;\r\n\t\t\tif (e.defaultPrevented || (e.shiftKey && e.keyCode != keyboard.TAB)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar shouldPrevent = true;\r\n\t\t\tswitch (e.keyCode) {\r\n\t\t\t\tcase gantt.keys.edit_save:\r\n\t\t\t\t\tcontroller.save();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase gantt.keys.edit_cancel:\r\n\t\t\t\t\tcontroller.hide();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.UP:\r\n\t\t\t\tcase keyboard.DOWN:\r\n\t\t\t\t\tif (controller.isVisible()) {\r\n\t\t\t\t\t\tcontroller.hide();\r\n\t\t\t\t\t\tshouldPrevent = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.TAB:\r\n\t\t\t\t\tif (e.shiftKey) {\r\n\t\t\t\t\t\tcontroller.editPrevCell(true);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcontroller.editNextCell(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshouldPrevent = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (shouldPrevent) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t};\r\n\t},\r\n\tonHide: function () {\r\n\r\n\t},\r\n\r\n\tdestroy: function () {\r\n\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tinit: function(controller, grid){\r\n\t\tvar self = controller;\r\n\t\tvar gantt = grid.$gantt;\r\n\r\n\t\tvar onBlurDelay = null;\r\n\t\tvar keyNav = gantt.ext.keyboardNavigation;\r\n\t\tkeyNav.attachEvent(\"onBeforeFocus\", function (node) {\r\n\t\t\tvar activeCell = controller.locateCell(node);\r\n\t\t\tclearTimeout(onBlurDelay);\r\n\t\t\tif (activeCell) {\r\n\t\t\t\tvar columnName = activeCell.columnName;\r\n\t\t\t\tvar id = activeCell.id;\r\n\r\n\t\t\t\tvar editorState = self.getState();\r\n\t\t\t\tif(self.isVisible()){\r\n\t\t\t\t\tif(editorState.id == id && editorState.columnName === columnName) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tkeyNav.attachEvent(\"onFocus\", function (node) {\r\n\t\t\tvar activeCell = controller.locateCell(node);\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tclearTimeout(onBlurDelay);\r\n\t\t\tif (activeCell && !(activeCell.id == state.id && activeCell.columnName == state.columnName)) {\r\n\t\t\t\tif(self.isVisible()){\r\n\t\t\t\t\tself.save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tcontroller.attachEvent(\"onHide\", function(){\r\n\t\t\tclearTimeout(onBlurDelay);\r\n\t\t});\r\n\r\n\t\tkeyNav.attachEvent(\"onBlur\", function () {\r\n\t\t\tonBlurDelay = setTimeout(function(){\r\n\t\t\t\tself.save();\r\n\t\t\t});\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onTaskDblClick\", function(id,e){\r\n\t\t\t// block lightbox on double click inside editor\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar cell = controller.locateCell(e.target);\r\n\t\t\tif(cell && controller.isVisible() && cell.columnName == state.columnName){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tgantt.attachEvent(\"onTaskClick\", function (id, e) {\r\n\t\t\tif(gantt._is_icon_open_click(e))\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar cell = controller.locateCell(e.target);\r\n\r\n\t\t\tif (cell && controller.getEditorConfig(cell.columnName)) {\r\n\t\t\t\tif(controller.isVisible() && state.id == cell.id && state.columnName == cell.columnName){\r\n\t\t\t\t\t// do nothing if editor is already active in this cell\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcontroller.startEdit(cell.id, cell.columnName);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tgantt.attachEvent(\"onEmptyClick\", function () {\r\n\t\t\tself.save();\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\tkeyNav.attachEvent(\"onKeyDown\", function(command, e){\r\n\t\t\tvar activeCell = controller.locateCell(e.target);\r\n\t\t\tvar hasEditor = activeCell ? controller.getEditorConfig(activeCell.columnName) : false;\r\n\r\n\t\t\tvar state = controller.getState();\r\n\t\t\tvar keyboard = gantt.constants.KEY_CODES;\r\n\t\t\tvar keyCode = e.keyCode;\r\n\t\t\tvar preventKeyNav = false;\r\n\r\n\t\t\tswitch (keyCode){\r\n\t\t\t\tcase keyboard.ENTER:\r\n\t\t\t\t\tif(controller.isVisible()){\r\n\t\t\t\t\t\tcontroller.save();\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}else if(hasEditor && !(e.ctrlKey || e.metaKey || e.shiftKey)){\r\n\t\t\t\t\t\tself.startEdit(activeCell.id, activeCell.columnName);\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.ESC:\r\n\t\t\t\t\tif(controller.isVisible()){\r\n\t\t\t\t\t\tcontroller.hide();\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.UP:\r\n\t\t\t\tcase keyboard.DOWN:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.LEFT:\r\n\t\t\t\tcase keyboard.RIGHT:\r\n\t\t\t\t\tif((hasEditor && controller.isVisible()) || state.editorType === \"date\"){\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.SPACE:\r\n\t\t\t\t\tif(controller.isVisible()){\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(hasEditor && !controller.isVisible()){\r\n\t\t\t\t\t\tself.startEdit(activeCell.id, activeCell.columnName);\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.DELETE:\r\n\t\t\t\t\tif(hasEditor && !controller.isVisible()){\r\n\t\t\t\t\t\tself.startEdit(activeCell.id, activeCell.columnName);\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t} else if(hasEditor && controller.isVisible()){\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyboard.TAB:\r\n\t\t\t\t\tif(controller.isVisible()){\r\n\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tcontroller.editPrevCell(true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcontroller.editNextCell(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar newState = controller.getState();\r\n\t\t\t\t\t\tif(newState.id){\r\n\t\t\t\t\t\t\tkeyNav.focus({type:\"taskCell\", id: newState.id, column:newState.columnName});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(controller.isVisible())\r\n\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\telse{\r\n\r\n\t\t\t\t\t\t// start editing on character key\r\n\t\t\t\t\t\tif((keyCode >= 48 && keyCode <= 57) || // [0-9]\r\n\t\t\t\t\t\t\t(keyCode > 95 && keyCode < 112) || // numpad\r\n\t\t\t\t\t\t\t(keyCode >= 64 && keyCode <= 91) || // [a-z]\r\n\t\t\t\t\t\t\t(keyCode > 185 && keyCode < 193) || //;=-,etc\r\n\t\t\t\t\t\t\t(keyCode > 218 && keyCode < 223)\r\n\t\t\t\t\t\t){\r\n\t\t\t\t\t\t\tvar modifiers = command.modifiers;\r\n\r\n\t\t\t\t\t\t\tvar anyModifier = modifiers.alt || modifiers.ctrl || modifiers.meta || modifiers.shift;\r\n\t\t\t\t\t\t\tif(modifiers.alt){\r\n\t\t\t\t\t\t\t\t// don't start editing on alt+key\r\n\t\t\t\t\t\t\t}else if (anyModifier && keyNav.getCommandHandler(command, \"taskCell\")){\r\n\t\t\t\t\t\t\t\t// don't start editing if command already have a keyboard shortcut\r\n\t\t\t\t\t\t\t}else if(hasEditor && !controller.isVisible()){\r\n\t\t\t\t\t\t\t\tself.startEdit(activeCell.id, activeCell.columnName);\r\n\t\t\t\t\t\t\t\tpreventKeyNav = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif (preventKeyNav){\r\n\t\t\t\treturn false;\r\n\t\t\t} else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t},\r\n\tonShow: function(controller, placeholder, grid){},\r\n\tonHide: function(controller, placeholder, grid){\r\n\t\tconst gantt = grid.$gantt;\r\n\t\tif (gantt){\r\n\t\t\tgantt.focus();\r\n\t\t}\r\n\r\n\t},\r\n\tdestroy: function(){}\r\n};\r\n\r\n","export default function (gantt) {\r\n\r\n\tvar BaseEditor = function () {\r\n\t};\r\n\r\n\tBaseEditor.prototype = {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t},\r\n\t\thide: function () {\r\n\t\t},\r\n\t\tset_value: function (value, id, column, node) {\r\n\t\t\tthis.get_input(node).value = value;\r\n\t\t},\r\n\t\tget_value: function (id, column, node) {\r\n\t\t\treturn this.get_input(node).value || \"\";\r\n\t\t},\r\n\t\tis_changed: function (value, id, column, node) {\r\n\t\t\tvar currentValue = this.get_value(id, column, node);\r\n\t\t\tif (currentValue && value && currentValue.valueOf && value.valueOf) {\r\n\t\t\t\treturn currentValue.valueOf() != value.valueOf();\r\n\t\t\t} else {\r\n\t\t\t\treturn currentValue != value;\r\n\t\t\t}\r\n\t\t},\r\n\t\tis_valid: function (value, id, column, node) {\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tsave: function (id, column, node) {\r\n\r\n\t\t},\r\n\t\tget_input: function (node) {\r\n\t\t\treturn node.querySelector(\"input\");\r\n\t\t},\r\n\t\tfocus: function (node) {\r\n\t\t\tvar input = this.get_input(node);\r\n\t\t\tif (!input) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (input.focus) {\r\n\t\t\t\tinput.focus();\r\n\t\t\t}\r\n\r\n\t\t\tif (input.select) {\r\n\t\t\t\tinput.select();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn BaseEditor;\r\n};","import BaseFactory from \"./base\";\r\nimport * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\r\n\tfunction TextEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TextEditor, BaseEditor);\r\n\r\n\tutils.mixin(TextEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tvar html = `
`;\r\n\t\t\tplaceholder.innerHTML = html;\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn TextEditor;\r\n};","import BaseFactory from \"./base\";\r\nimport * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\r\n\tfunction NumberEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(NumberEditor, BaseEditor);\r\n\r\n\tutils.mixin(NumberEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tvar min = config.min || 0,\r\n\t\t\t\tmax = config.max || 100;\r\n\r\n\t\t\tvar html = `
`;\r\n\t\t\tplaceholder.innerHTML = html;\r\n\r\n\t\t\t// GS-1914. Do not allow entering alues beyond min and max via keyboard\r\n\t\t\tplaceholder.oninput = function (e) {\r\n\t\t\t\tif (+e.target.value < min) {\r\n\t\t\t\t\te.target.value = min;\r\n\t\t\t\t}\r\n\t\t\t\tif (+e.target.value > max) {\r\n\t\t\t\t\te.target.value = max;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\t\tget_value: function (id, column, node) {\r\n\t\t\treturn this.get_input(node).value || \"\";\r\n\t\t},\r\n\t\tis_valid: function (value, id, column, node) {\r\n\t\t\treturn !isNaN(parseInt(value, 10));\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn NumberEditor;\r\n};","import BaseFactory from \"./base\";\r\nimport * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\r\n\tfunction SelectEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(SelectEditor, BaseEditor);\r\n\r\n\tutils.mixin(SelectEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tvar html = ``;\r\n\t\t\tvar optionsHtml = [],\r\n\t\t\t\toptions = config.options || [];\r\n\r\n\t\t\tfor (var i = 0; i < options.length; i++) {\r\n\t\t\t\toptionsHtml.push(\"\" + options[i].label + \" \");\r\n\t\t\t}\r\n\r\n\t\t\thtml += optionsHtml.join(\"\") + \"
\";\r\n\t\t\tplaceholder.innerHTML = html;\r\n\t\t},\r\n\t\tget_input: function (node) {\r\n\t\t\treturn node.querySelector(\"select\");\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn SelectEditor;\r\n};","import * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\nimport BaseFactory from \"./base\";\r\n\r\nexport default function (gantt) {\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\t\r\n\t\r\n\r\n\tvar html5DateFormat = \"%Y-%m-%d\";\r\n\r\n\tvar dateToStr = null;\r\n\tvar strToDate = null;\r\n\r\n\tfunction init() {\r\n\t\tif (!dateToStr) {\r\n\t\t\tdateToStr = gantt.date.date_to_str(html5DateFormat);\r\n\t\t}\r\n\t\tif (!strToDate) {\r\n\t\t\tstrToDate = gantt.date.str_to_date(html5DateFormat);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction DateEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(DateEditor, BaseEditor);\r\n\r\n\tutils.mixin(DateEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tinit();\r\n\t\t\tvar minValue = null;\r\n\t\t\tvar maxValue = null;\r\n\r\n\t\t\tif(typeof config.min === \"function\"){\r\n\t\t\t\tminValue = config.min(id, column);\r\n\t\t\t}else{\r\n\t\t\t\tminValue = config.min;\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.max === \"function\"){\r\n\t\t\t\tmaxValue = config.max(id, column);\r\n\t\t\t}else{\r\n\t\t\t\tmaxValue = config.max;\r\n\t\t\t}\r\n\r\n\t\t\tvar minAttr = minValue ? \" min='\" + dateToStr(minValue)+\"' \" : \"\";\r\n\t\t\tvar maxAttr = maxValue ? \" max='\" + dateToStr(maxValue)+\"' \" : \"\";\r\n\t\t\tvar html = `
`;\r\n\t\t\tplaceholder.innerHTML = html;\r\n\r\n\t\t\t// GS-1914. Do not allow entering alues beyond min and max via keyboard\r\n\t\t\tplaceholder.oninput = function (e) {\r\n\t\t\t\tif (+gantt.date.str_to_date(\"%Y-%m-%d\")(e.target.value) < +minValue) {\r\n\t\t\t\t\te.target.value = gantt.date.date_to_str(\"%Y-%m-%d\")(minValue);\r\n\t\t\t\t}\r\n\t\t\t\tif (+gantt.date.str_to_date(\"%Y-%m-%d\")(e.target.value) > +maxValue) {\r\n\t\t\t\t\te.target.value = gantt.date.date_to_str(\"%Y-%m-%d\")(maxValue);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\t\tset_value: function (value, id, column, node) {\r\n\t\t\tif (value && value.getFullYear) {\r\n\t\t\t\tthis.get_input(node).value = dateToStr(value);\r\n\t\t\t} else {\r\n\t\t\t\tthis.get_input(node).value = value;\r\n\t\t\t}\r\n\t\t},\r\n\t\tis_valid: function (value, id, column, node) {\r\n\t\t\tif (!value || isNaN(value.getTime()))\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tget_value: function (id, column, node) {\r\n\t\t\tvar parsed;\r\n\t\t\ttry {\r\n\t\t\t\tparsed = strToDate(this.get_input(node).value || \"\");\r\n\t\t\t} catch (e) {\r\n\t\t\t\tparsed = null;// return null will cancel changes\r\n\t\t\t}\r\n\r\n\t\t\treturn parsed;\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn DateEditor;\r\n};\r\n","import BaseFactory from \"./base\";\r\nimport * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\r\n\tfunction PredecessorEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(PredecessorEditor, BaseEditor);\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || gantt.ext.formatters.linkFormatter();\r\n\t}\r\n\r\n\tfunction parseInputString(value, config) {\r\n\t\tvar predecessors = (value || \"\").split(config.delimiter || \",\");\r\n\t\tfor (var i = 0; i < predecessors.length; i++) {\r\n\t\t\tvar val = predecessors[i].trim();\r\n\t\t\tif (val) {\r\n\t\t\t\tpredecessors[i] = val;\r\n\t\t\t} else {\r\n\t\t\t\tpredecessors.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t\tpredecessors.sort();\r\n\t\treturn predecessors;\r\n\t}\r\n\r\n\tfunction formatPredecessors(task, config, gantt) {\r\n\t\tvar links = task.$target;\r\n\t\tvar labels = [];\r\n\t\tfor (var i = 0; i < links.length; i++) {\r\n\t\t\tvar link = gantt.getLink(links[i]);\r\n\t\t\tlabels.push(getFormatter(config).format(link));\r\n\t\t}\r\n\t\treturn labels.join((config.delimiter || \",\") + \" \");\r\n\t}\r\n\r\n\tfunction getSelectedLinks(taskId, predecessorCodes, config) {\r\n\t\tvar links = [];\r\n\t\t// select only unique codes GS-1439\r\n\t\t[...new Set(predecessorCodes)].forEach(function (code) {\r\n\t\t\tvar link = getFormatter(config).parse(code);\r\n\t\t\tif(link){\r\n\t\t\t\tlink.target = taskId;\r\n\t\t\t\t// GS-1290 A way to preserve the link. Otherwise validation will return false\r\n\t\t\t\t// because the existing link ID is not passed there\r\n\t\t\t\tlink.id = \"predecessor_generated\";\r\n\t\t\t\tif (gantt.isLinkAllowed(link)) {\r\n\t\t\t\t\tlink.id = undefined;\r\n\t\t\t\t\tlinks.push(link);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn links;\r\n\t}\r\n\r\n\tfunction formatLinkKey(link){\r\n\t\treturn link.source + \"_\" + link.target + \"_\" + link.type + \"_\" + (link.lag||0);\r\n\t}\r\n\r\n\tfunction getLinksDiff(task, predecessorCodes, config) {\r\n\t\tvar selectedLinks = getSelectedLinks(task.id, predecessorCodes, config);\r\n\t\tvar existingLinksSearch = {};\r\n\t\ttask.$target.forEach(function (linkId) {\r\n\t\t\tvar link = gantt.getLink(linkId);\r\n\t\t\texistingLinksSearch[formatLinkKey(link)] = link.id;\r\n\t\t});\r\n\r\n\t\tvar linksToAdd = [];\r\n\t\tselectedLinks.forEach(function (link) {\r\n\t\t\tvar linkKey = formatLinkKey(link);\r\n\t\t\tif (!existingLinksSearch[linkKey]) {\r\n\t\t\t\tlinksToAdd.push(link);\r\n\t\t\t} else {\r\n\t\t\t\tdelete existingLinksSearch[linkKey];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar linksToDelete = [];\r\n\t\tfor (var i in existingLinksSearch) {\r\n\t\t\tlinksToDelete.push(existingLinksSearch[i]);\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tadd: linksToAdd,\r\n\t\t\tremove: linksToDelete\r\n\t\t};\r\n\t}\r\n\r\n\tutils.mixin(PredecessorEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tvar html = `
`;\r\n\t\t\tplaceholder.innerHTML = html;\r\n\t\t},\r\n\t\thide: function () {\r\n\t\t},\r\n\t\tset_value: function (value, id, column, node) {\r\n\t\t\tthis.get_input(node).value = formatPredecessors(value, column.editor, gantt);\r\n\t\t},\r\n\t\tget_value: function (id, column, node) {\r\n\t\t\treturn parseInputString((this.get_input(node).value || \"\"), column.editor);\r\n\t\t},\r\n\t\tsave: function (id, column, node) {\r\n\t\t\tvar task = gantt.getTask(id);\r\n\r\n\t\t\tvar linksDiff = getLinksDiff(task, this.get_value(id, column, node), column.editor);\r\n\r\n\t\t\tif (linksDiff.add.length || linksDiff.remove.length) {\r\n\t\t\t\tgantt.batchUpdate(function () {\r\n\t\t\t\t\tlinksDiff.add.forEach(function (link) {\r\n\t\t\t\t\t\tgantt.addLink(link);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tlinksDiff.remove.forEach(function (linkId) {\r\n\t\t\t\t\t\tgantt.deleteLink(linkId);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (gantt.autoSchedule)\r\n\t\t\t\t\t\tgantt.autoSchedule();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t},\r\n\t\tis_changed: function (value, id, column, node) {\r\n\t\t\tvar inputPredecessors = this.get_value(id, column, node);\r\n\t\t\tvar taskPredecessors = parseInputString(formatPredecessors(value, column.editor, gantt), column.editor);\r\n\r\n\t\t\treturn inputPredecessors.join() !== taskPredecessors.join();\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn PredecessorEditor;\r\n};","import BaseFactory from \"./base\";\r\nimport * as utils from \"../../../../../utils/utils\";\r\nimport __extends from \"../../../../../utils/extends\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tvar BaseEditor = BaseFactory(gantt);\r\n\r\n\tfunction TextEditor() {\r\n\t\tvar self = BaseEditor.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TextEditor, BaseEditor);\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || gantt.ext.formatters.durationFormatter();\r\n\t}\r\n\tutils.mixin(TextEditor.prototype, {\r\n\t\tshow: function (id, column, config, placeholder) {\r\n\t\t\tvar html = `
`;\r\n\t\t\tplaceholder.innerHTML = html;\r\n\t\t},\r\n\t\tset_value: function (value, id, column, node) {\r\n\t\t\tthis.get_input(node).value = getFormatter(column.editor).format(value);\r\n\t\t},\r\n\t\tget_value: function (id, column, node) {\r\n\t\t\treturn getFormatter(column.editor).parse(this.get_input(node).value || \"\");\r\n\t\t}\r\n\t}, true);\r\n\r\n\treturn TextEditor;\r\n};","export default function (gantt) {\r\n\treturn function processTaskDateProperties(item, mapTo, mode) {\r\n\t\tif (mode == \"keepDates\") {\r\n\t\t\tkeepDatesOnEdit(item, mapTo);\r\n\t\t} else if (mode == \"keepDuration\") {\r\n\t\t\tkeepDurationOnEdit(item, mapTo);\r\n\t\t} else {\r\n\t\t\tdefaultActionOnEdit(item, mapTo);\r\n\t\t}\r\n\t};\r\n\r\n\t// resize task\r\n\t// resize task when start/end/duration changes\r\n\tfunction keepDatesOnEdit(item, mapTo) {\r\n\t\tif (mapTo == \"duration\") {\r\n\t\t\titem.end_date = gantt.calculateEndDate(item);\r\n\t\t} else if (mapTo == \"end_date\" || mapTo == \"start_date\") {\r\n\t\t\titem.duration = gantt.calculateDuration(item);\r\n\t\t}\r\n\t}\r\n\r\n\t// move task(before 6.2)\r\n\t// move task when start/end dates changes\r\n\t// resize task when duration changes\r\n\tfunction keepDurationOnEdit(item, mapTo) {\r\n\t\tif (mapTo == \"end_date\") {\r\n\t\t\titem.start_date = decreaseStartDate(item);\r\n\t\t} else if (mapTo == \"start_date\" || mapTo == \"duration\") {\r\n\t\t\titem.end_date = gantt.calculateEndDate(item);\r\n\t\t}\r\n\t}\r\n\r\n\t// default behavior\r\n\t// move task when start date changes\r\n\t// resize task when end date/duration changes\r\n\tfunction defaultActionOnEdit(item, mapTo) {\r\n\t\tif (gantt.config.schedule_from_end){\r\n\t\t\tif (mapTo == \"end_date\" || mapTo == \"duration\") {\r\n\t\t\t\titem.start_date = decreaseStartDate(item);\r\n\t\t\t} else if (mapTo == \"start_date\") {\r\n\t\t\t\titem.duration = gantt.calculateDuration(item);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (mapTo == \"start_date\" || mapTo == \"duration\") {\r\n\t\t\t\titem.end_date = gantt.calculateEndDate(item);\r\n\t\t\t} else if (mapTo == \"end_date\") {\r\n\t\t\t\titem.duration = gantt.calculateDuration(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction decreaseStartDate(item){\r\n\t\treturn gantt.calculateEndDate({\r\n\t\t\tstart_date: item.end_date,\r\n\t\t\tduration: -item.duration,\r\n\t\t\ttask: item\r\n\t\t});\r\n\t}\r\n};","import getKeyboardMapping from \"./keyboard_mappings\";\r\nimport textEditorFactory from \"./editors/text\";\r\nimport numberEditorFactory from \"./editors/number\";\r\nimport selectEditorFactory from \"./editors/select\";\r\nimport dateEditorFactory from \"./editors/date\";\r\nimport predecessorEditorFactory from \"./editors/predecessor\";\r\nimport durationEditorFactory from \"./editors/duration\";\r\nimport * as utils from \"../../../../utils/utils\";\r\nimport * as domHelpers from \"../../utils/dom_helpers\";\r\nimport eventable from \"../../../../utils/eventable\";\r\nimport linkedPropertiesProcessor from \"./linked_properties\";\r\n\r\nfunction initConfigs(gantt){\r\n\tgantt.config.editor_types = {\r\n\t\ttext: new (textEditorFactory(gantt))(),\r\n\t\tnumber: new (numberEditorFactory(gantt))(),\r\n\t\tselect: new (selectEditorFactory(gantt))(),\r\n\t\tdate: new (dateEditorFactory(gantt))(),\r\n\t\tpredecessor: new (predecessorEditorFactory(gantt))(),\r\n\t\tduration: new (durationEditorFactory(gantt))()\r\n\t};\r\n}\r\n\r\nfunction create(gantt){\r\n\tvar keyboardMapping = getKeyboardMapping(gantt);\r\n\r\n\tvar eventBus = {};\r\n\teventable(eventBus);\r\n\r\n\tfunction createGridEditors(grid) {\r\n\r\n\t\tfunction _getGridCellFromNode(node){\r\n\t\t\tif(!domHelpers.isChildOf(node, grid.$grid)){\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tvar row = domHelpers.locateAttribute(node, grid.$config.item_attribute);\r\n\t\t\tvar cell = domHelpers.locateAttribute(node, \"data-column-name\");\r\n\t\t\tif(row && cell){\r\n\t\t\t\tvar columnName = cell.getAttribute(\"data-column-name\");\r\n\t\t\t\tvar id = row.getAttribute(grid.$config.item_attribute);\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\tcolumnName: columnName\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t\tfunction _getEditorPosition(itemId, columnName) {\r\n\t\t\tvar config = grid.$getConfig();\r\n\t\t\tvar top = grid.getItemTop(itemId);\r\n\t\t\tvar height = grid.getItemHeight(itemId);\r\n\t\t\tvar cols = grid.getGridColumns();\r\n\t\t\tvar left = 0,\r\n\t\t\t\tright = 0,\r\n\t\t\t\twidth = 0;\r\n\r\n\t\t\tfor (var i = 0; i < cols.length; i++) {\r\n\t\t\t\tif (cols[i].name == columnName) {\r\n\t\t\t\t\twidth = cols[i].width;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (config.rtl) {\r\n\t\t\t\t\tright += cols[i].width;\r\n\t\t\t\t}\telse {\r\n\t\t\t\t\tleft += cols[i].width;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (config.rtl) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttop: top,\r\n\t\t\t\t\tright: right,\r\n\t\t\t\t\theight: height,\r\n\t\t\t\t\twidth: width\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttop: top,\r\n\t\t\t\t\tleft: left,\r\n\t\t\t\t\theight: height,\r\n\t\t\t\t\twidth: width\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tfunction findVisibleIndex(grid, columnName) {\r\n\t\t\tvar columns = grid.getGridColumns();\r\n\t\t\tfor (var i = 0; i < columns.length; i++){\r\n\t\t\t\tif(columns[i].name == columnName){\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tfunction _createPlaceholder(itemId, columnName) {\r\n\t\t\tvar config = grid.$getConfig();\r\n\t\t\tvar pos = _getEditorPosition(itemId, columnName);\r\n\t\t\tvar el = document.createElement(\"div\");\r\n\t\t\tel.className = \"gantt_grid_editor_placeholder\";\r\n\t\t\tel.setAttribute(grid.$config.item_attribute, itemId);\r\n\t\t\tel.setAttribute(grid.$config.bind + \"_id\", itemId);// for backward compatibility\r\n\r\n\t\t\tel.setAttribute(\"data-column-name\", columnName);\r\n\r\n\t\t\tvar visibleIndex = findVisibleIndex(grid, columnName);\r\n\t\t\tel.setAttribute(\"data-column-index\", visibleIndex);\r\n\r\n\t\t\tgantt._waiAria.inlineEditorAttr(el);\r\n\r\n\t\t\tif (config.rtl) {\r\n\t\t\t\tel.style.cssText = [\r\n\t\t\t\t\t\"top:\" + pos.top + \"px\",\r\n\t\t\t\t\t\"right:\" + pos.right + \"px\",\r\n\t\t\t\t\t\"width:\" + pos.width + \"px\",\r\n\t\t\t\t\t\"height:\" + pos.height + \"px\"\r\n\t\t\t\t].join(\";\");\r\n\t\t\t} else {\r\n\t\t\t\tel.style.cssText = [\r\n\t\t\t\t\t\"top:\" + pos.top + \"px\",\r\n\t\t\t\t\t\"left:\" + pos.left + \"px\",\r\n\t\t\t\t\t\"width:\" + pos.width + \"px\",\r\n\t\t\t\t\t\"height:\" + pos.height + \"px\"\r\n\t\t\t\t].join(\";\");\r\n\t\t\t}\r\n\r\n\t\t\treturn el;\r\n\t\t}\r\n\r\n\t\tvar updateTaskDateProperties = linkedPropertiesProcessor(gantt);\r\n\r\n\t\tvar handlers = [];\r\n\t\tvar ganttHandlers = [];\r\n\t\tvar store = null;\r\n\t\tvar controller = {\r\n\t\t\t_itemId: null,\r\n\t\t\t_columnName: null,\r\n\t\t\t_editor: null,\r\n\t\t\t_editorType: null,\r\n\t\t\t_placeholder: null,\r\n\r\n\t\t\tlocateCell: _getGridCellFromNode,\r\n\t\t\tgetEditorConfig: function (columnName) {\r\n\t\t\t\tvar column = grid.getColumn(columnName);\r\n\t\t\t\treturn column.editor;\r\n\t\t\t},\r\n\r\n\t\t\tinit: function () {\r\n\t\t\t\tvar mapping = keyboardMapping.getMapping();\r\n\t\t\t\tif(mapping.init){\r\n\t\t\t\t\tmapping.init(this, grid);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstore = grid.$gantt.getDatastore(grid.$config.bind);\r\n\r\n\t\t\t\tvar self = this;\r\n\r\n\t\t\t\thandlers.push(store.attachEvent(\"onIdChange\", function(oldId, newId){\r\n\t\t\t\t\tif(self._itemId == oldId){\r\n\t\t\t\t\t\tself._itemId = newId;\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\t\t\t\thandlers.push(store.attachEvent(\"onStoreUpdated\", function(){\r\n\t\t\t\t\tif(grid.$gantt.getState(\"batchUpdate\").batch_update){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(self.isVisible() && !store.isVisible(self._itemId)){\r\n\t\t\t\t\t\tself.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\r\n\t\t\t\tganttHandlers.push(gantt.attachEvent(\"onDataRender\", function(){\r\n\t\t\t\t\tif(self._editor && self._placeholder && !domHelpers.isChildOf(self._placeholder, gantt.$root)){\r\n\t\t\t\t\t\tgrid.$grid_data.appendChild(self._placeholder);\r\n\t\t\t\t\t}\r\n\t\t\t\t}));\r\n\r\n\t\t\t\tthis.init = function(){};\r\n\t\t\t},\r\n\r\n\t\t\tgetState: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\teditor: this._editor,\r\n\t\t\t\t\teditorType: this._editorType,\r\n\t\t\t\t\tplaceholder: this._placeholder,\r\n\t\t\t\t\tid: this._itemId,\r\n\t\t\t\t\tcolumnName: this._columnName\r\n\t\t\t\t};\r\n\t\t\t},\r\n\r\n\t\t\tstartEdit: function(itemId, columnName) {\r\n\t\t\t\tif (this.isVisible()) {\r\n\t\t\t\t\tthis.save();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!store.exists(itemId)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar editorState = {id: itemId, columnName: columnName};\r\n\t\t\t\tif (gantt.isReadonly(store.getItem(itemId))) {\r\n\t\t\t\t\tthis.callEvent(\"onEditPrevent\", [editorState]);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.callEvent(\"onBeforeEditStart\", [editorState]) === false) {\r\n\t\t\t\t\tthis.callEvent(\"onEditPrevent\", [editorState]);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.show(editorState.id, editorState.columnName);\r\n\t\t\t\tthis.setValue();\r\n\r\n\t\t\t\tthis.callEvent(\"onEditStart\", [editorState]);\r\n\t\t\t},\r\n\t\t\tisVisible: function(){\r\n\t\t\t\treturn !!(this._editor && domHelpers.isChildOf(this._placeholder, gantt.$root));\r\n\t\t\t},\r\n\t\t\tshow: function (itemId, columnName) {\r\n\t\t\t\tif (this.isVisible()) {\r\n\t\t\t\t\tthis.save();\r\n\t\t\t\t}\r\n\t\t\t\tvar editorState = {id: itemId, columnName: columnName};\r\n\r\n\t\t\t\tvar column = grid.getColumn(editorState.columnName);\r\n\t\t\t\tvar editorConfig = this.getEditorConfig(column.name);\r\n\t\t\t\tif(!editorConfig)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar editor = grid.$getConfig().editor_types[editorConfig.type];\r\n\r\n\t\t\t\tvar placeholder = _createPlaceholder(editorState.id, editorState.columnName);\r\n\t\t\t\tgrid.$grid_data.appendChild(placeholder);\r\n\t\t\t\teditor.show(editorState.id, column, editorConfig, placeholder);\r\n\t\t\t\tthis._editor = editor;\r\n\t\t\t\tthis._placeholder = placeholder;\r\n\t\t\t\tthis._itemId = editorState.id;\r\n\t\t\t\tthis._columnName = editorState.columnName;\r\n\t\t\t\tthis._editorType = editorConfig.type;\r\n\r\n\t\t\t\tvar mapping = keyboardMapping.getMapping();\r\n\t\t\t\tif(mapping.onShow){\r\n\t\t\t\t\tmapping.onShow(this, placeholder, grid);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tsetValue: function () {\r\n\t\t\t\tvar state = this.getState();\r\n\t\t\t\tvar itemId = state.id,\r\n\t\t\t\t\tcolumnName = state.columnName;\r\n\r\n\t\t\t\tvar column = grid.getColumn(columnName);\r\n\t\t\t\tvar item = store.getItem(itemId);\r\n\t\t\t\tvar editorConfig = this.getEditorConfig(columnName);\r\n\r\n\t\t\t\tif(!editorConfig)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar value = item[editorConfig.map_to];\r\n\t\t\t\tif(editorConfig.map_to == \"auto\"){\r\n\t\t\t\t\tvalue = store.getItem(itemId);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._editor.set_value(value, itemId, column, this._placeholder);\r\n\t\t\t\tthis.focus();\r\n\t\t\t},\r\n\r\n\t\t\tfocus: function(){\r\n\t\t\t\tthis._editor.focus(this._placeholder);\r\n\t\t\t},\r\n\r\n\t\t\tgetValue: function () {\r\n\t\t\t\tvar column = grid.getColumn(this._columnName);\r\n\t\t\t\treturn this._editor.get_value(this._itemId, column, this._placeholder);\r\n\t\t\t},\r\n\r\n\t\t\t_getItemValue: function() {\r\n\t\t\t\tvar editorConfig = this.getEditorConfig(this._columnName);\r\n\r\n\t\t\t\tif(!editorConfig)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar item = gantt.getTask(this._itemId);\r\n\t\t\t\tvar value = item[editorConfig.map_to];\r\n\t\t\t\tif(editorConfig.map_to == \"auto\"){\r\n\t\t\t\t\tvalue = store.getItem(this._itemId);\r\n\t\t\t\t}\r\n\t\t\t\treturn value;\r\n\t\t\t},\r\n\r\n\t\t\tisChanged: function(){\r\n\r\n\t\t\t\tvar column = grid.getColumn(this._columnName);\r\n\r\n\t\t\t\tvar value = this._getItemValue();\r\n\r\n\t\t\t\treturn this._editor.is_changed(value, this._itemId, column, this._placeholder);\r\n\t\t\t},\r\n\r\n\t\t\thide: function () {\r\n\t\t\t\tif(!this._itemId)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tvar itemId = this._itemId,\r\n\t\t\t\t\tcolumnName = this._columnName;\r\n\r\n\t\t\t\tvar mapping = keyboardMapping.getMapping();\r\n\t\t\t\tif(mapping.onHide){\r\n\t\t\t\t\tmapping.onHide(this, this._placeholder, grid);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._itemId = null;\r\n\t\t\t\tthis._columnName = null;\r\n\t\t\t\tthis._editorType = null;\r\n\t\t\t\tif (!this._placeholder) return;\r\n\r\n\t\t\t\tif (this._editor && this._editor.hide) {\r\n\t\t\t\t\tthis._editor.hide(this._placeholder);\r\n\t\t\t\t}\r\n\t\t\t\tthis._editor = null;\r\n\t\t\t\tif (this._placeholder.parentNode) {\r\n\t\t\t\t\tthis._placeholder.parentNode.removeChild(this._placeholder);\r\n\t\t\t\t}\r\n\t\t\t\tthis._placeholder = null;\r\n\r\n\t\t\t\tthis.callEvent(\"onEditEnd\", [{id: itemId, columnName: columnName}]);\r\n\t\t\t},\r\n\t\t\tsave: function () {\r\n\t\t\t\tif(!(this.isVisible() && store.exists(this._itemId) && this.isChanged())) {\r\n\t\t\t\t\tthis.hide();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar itemId = this._itemId,\r\n\t\t\t\t\tcolumnName = this._columnName;\r\n\r\n\t\t\t\tif(!store.exists(itemId)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar item = store.getItem(itemId);\r\n\t\t\t\tvar editorConfig = this.getEditorConfig(columnName);\r\n\t\t\t\tvar editorState = {\r\n\t\t\t\t\tid: itemId,\r\n\t\t\t\t\tcolumnName: columnName,\r\n\t\t\t\t\tnewValue: this.getValue(),\r\n\t\t\t\t\toldValue: this._getItemValue()\r\n\t\t\t\t};\r\n\t\t\t\tif (this.callEvent(\"onBeforeSave\", [editorState]) !== false) {\r\n\t\t\t\t\tif (!this._editor.is_valid || this._editor.is_valid(editorState.newValue, editorState.id, grid.getColumn(columnName), this._placeholder)) {\r\n\r\n\t\t\t\t\t\tvar mapTo = editorConfig.map_to;\r\n\t\t\t\t\t\tvar value = editorState.newValue;\r\n\t\t\t\t\t\tif (mapTo != \"auto\") {\r\n\t\t\t\t\t\t\titem[mapTo] = value;\r\n\t\t\t\t\t\t\tupdateTaskDateProperties(item, mapTo, gantt.config.inline_editors_date_processing);\r\n\r\n\t\t\t\t\t\t\tstore.updateItem(itemId);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis._editor.save(itemId, grid.getColumn(columnName), this._placeholder);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.callEvent(\"onSave\", [editorState]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.hide();\r\n\t\t\t},\r\n\r\n\t\t\t_findEditableCell: function findEditableCell(start, direction){\r\n\t\t\t\tvar nextIndex = start;\r\n\t\t\t\tvar columns = grid.getGridColumns();\r\n\t\t\t\tvar nextColumn = columns[nextIndex];\r\n\r\n\t\t\t\tvar columnName = nextColumn ? nextColumn.name : null;\r\n\t\t\t\tif(columnName){\r\n\t\t\t\t\twhile(columnName && !this.getEditorConfig(columnName)){\r\n\t\t\t\t\t\tcolumnName = this._findEditableCell(start + direction, direction);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn columnName;\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\r\n\t\t\tgetNextCell: function moveCell(dir){\r\n\t\t\t\t// GS-1257. true means to exclude hidden columns\r\n\t\t\t\treturn this._findEditableCell(grid.getColumnIndex(this._columnName, true) + dir, dir);\r\n\t\t\t},\r\n\r\n\t\t\tgetFirstCell: function getFirstCell(){\r\n\t\t\t\treturn this._findEditableCell(0, 1);\r\n\t\t\t},\r\n\r\n\t\t\tgetLastCell: function getLastCell(){\r\n\t\t\t\treturn this._findEditableCell(grid.getGridColumns().length - 1, -1);\r\n\t\t\t},\r\n\r\n\t\t\teditNextCell: function nextCell(canChangeRow){\r\n\t\t\t\tvar cell = this.getNextCell(1);\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tvar nextColumn = this.getNextCell(1);\r\n\t\t\t\t\tif(nextColumn && this.getEditorConfig(nextColumn)){\r\n\t\t\t\t\t\tthis.startEdit(this._itemId, nextColumn);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(canChangeRow && this.moveRow(1)){\r\n\t\t\t\t\tvar task = this.moveRow(1);\r\n\t\t\t\t\tcell = this.getFirstCell();\r\n\t\t\t\t\tif(cell && this.getEditorConfig(cell)){\r\n\t\t\t\t\t\tthis.startEdit(task, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\teditPrevCell: function prevCell(canChangeRow){\r\n\t\t\t\tvar cell = this.getNextCell(-1);\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tvar nextColumn = this.getNextCell(-1);\r\n\t\t\t\t\tif(nextColumn && this.getEditorConfig(nextColumn)){\r\n\t\t\t\t\t\tthis.startEdit(this._itemId, nextColumn);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(canChangeRow && this.moveRow(-1)){\r\n\t\t\t\t\tvar task = this.moveRow(-1);\r\n\t\t\t\t\tcell = this.getLastCell();\r\n\t\t\t\t\tif(cell && this.getEditorConfig(cell)){\r\n\t\t\t\t\t\tthis.startEdit(task, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tmoveRow: function moveRow(dir) {\r\n\t\t\t\tvar moveTask = dir > 0 ? gantt.getNext : gantt.getPrev;\r\n\t\t\t\tmoveTask = gantt.bind(moveTask, gantt);\r\n\r\n\t\t\t\tvar nextItem = moveTask(this._itemId);\r\n\t\t\t\t// skip readonly rows\r\n\t\t\t\twhile (gantt.isTaskExists(nextItem) && gantt.isReadonly(gantt.getTask(nextItem))) {\r\n\t\t\t\t\tnextItem = moveTask(nextItem);\r\n\t\t\t\t}\r\n\t\t\t\treturn nextItem;\r\n\t\t\t},\r\n\r\n\t\t\teditNextRow: function nextRow(skipReadonly){\r\n\t\t\t\tvar id = this.getState().id;\r\n\t\t\t\tif (!gantt.isTaskExists(id)) return;\r\n\r\n\t\t\t\tvar next = null;\r\n\t\t\t\tif (skipReadonly){\r\n\t\t\t\t\tnext = this.moveRow(1);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tnext = gantt.getNext(id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (gantt.isTaskExists(next)){\r\n\t\t\t\t\tthis.startEdit(next, this._columnName);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\teditPrevRow: function prevRow(skipReadonly){\r\n\t\t\t\tvar id = this.getState().id;\r\n\t\t\t\tif (!gantt.isTaskExists(id)) return;\r\n\r\n\t\t\t\tvar prev = null;\r\n\t\t\t\tif (skipReadonly){\r\n\t\t\t\t\tprev = this.moveRow(-1);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tprev = gantt.getPrev(id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (gantt.isTaskExists(prev)){\r\n\t\t\t\t\tthis.startEdit(prev, this._columnName);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdestructor: function(){\r\n\t\t\t\thandlers.forEach(function(handlerId){\r\n\t\t\t\t\tstore.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tganttHandlers.forEach(function(handlerId){\r\n\t\t\t\t\tgantt.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t\thandlers = [];\r\n\t\t\t\tganttHandlers = [];\r\n\r\n\t\t\t\tstore = null;\r\n\t\t\t\tthis.hide();\r\n\t\t\t\tthis.detachAllEvents();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tutils.mixin(controller, keyboardMapping);\r\n\t\tutils.mixin(controller, eventBus);\r\n\r\n\t\treturn controller;\r\n\t}\r\n\r\n\r\n\tvar inlineEditController = {\r\n\t\tinit: initConfigs,\r\n\t\tcreateEditors: createGridEditors\r\n\t};\r\n\r\n\tutils.mixin(inlineEditController, keyboardMapping);\r\n\tutils.mixin(inlineEditController, eventBus);\r\n\r\n\treturn inlineEditController;\r\n}\r\n\r\n\r\n\r\n\r\nexport default create;","import defaultMapping from \"./keyboard_mappings/default\";\r\nimport keyNavMappings from \"./keyboard_mappings/keyboard_navigation\";\r\n\r\nexport default function(gantt){\r\n\r\n\tvar mapping = null;\r\n\r\n\treturn {\r\n\t\tsetMapping: function(map){\r\n\t\t\tmapping = map;\r\n\t\t},\r\n\t\tgetMapping: function(){\r\n\r\n\t\t\tif(mapping){\r\n\t\t\t\treturn mapping;\r\n\t\t\t}else if(gantt.config.keyboard_navigation_cells && gantt.ext.keyboardNavigation){\r\n\t\t\t\treturn keyNavMappings;\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultMapping;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n};\r\n","// optimized checker for task bars smart rendering\r\n\r\n// first check the vertical position since it's easier to calculate\r\nexport default function isBarInViewport(item, viewport, view, config, gantt){\r\n\tif(!item.start_date || !item.end_date){\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar top = view.getItemTop(item.id);\r\n\tvar height = view.getItemHeight(item.id);\r\n\r\n\tif(top > viewport.y_end || top + height < viewport.y){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar padding = 200;\r\n\tvar startCoord = view.posFromDate(item.start_date);\r\n\tvar endCoord = view.posFromDate(item.end_date);\r\n\tvar left = Math.min(startCoord, endCoord) - padding;\r\n\tvar right = Math.max(startCoord, endCoord) + padding;\r\n\r\n\tif(left > viewport.x_end || right < viewport.x){\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n};","function createTaskRenderer(gantt) {\r\n\r\n\tfunction _render_task_element(task, view, config) {\r\n\t\tvar config = view.$getConfig();\r\n\t\tvar painters = config.type_renderers;\r\n\t\tvar renderer = painters[gantt.getTaskType(task.type)],\r\n\t\t\tdefaultRenderer = _task_default_render;\r\n\r\n\t\tif (!renderer) {\r\n\t\t\treturn defaultRenderer.call(gantt, task, view, config);\r\n\t\t}else{\r\n\t\t\treturn renderer.call(gantt, task, function(task){ return defaultRenderer.call(gantt, task, view, config);}, view);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _task_default_render(task, view, config) {\r\n\t\tif (gantt._isAllowedUnscheduledTask(task))\r\n\t\t\treturn;\r\n\r\n\t\tif (!gantt._isTaskInTimelineLimits(task)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar pos = view.getItemPosition(task);\r\n\r\n\t\tvar cfg = config,\r\n\t\t\ttemplates = view.$getTemplates();\r\n\r\n\t\tvar taskType = gantt.getTaskType(task.type);\r\n\t\tvar height = view.getBarHeight(task.id, taskType == cfg.types.milestone);\r\n\r\n\t\tvar controlsMargin = 0;\r\n\t\tif (taskType == cfg.types.milestone) {\r\n\t\t\tcontrolsMargin = (height - pos.height)/2;\r\n\t\t}\r\n\r\n\t\tvar padd = Math.floor((view.getItemHeight(task.id) - height) / 2);\r\n\t\tconst hasBaselines = gantt.config.baselines !== false && task.baselines && task.baselines.length;\r\n\t\tconst baselinesOnDifferentRow = gantt.config.baselines !== false && (gantt.config.baselines.render_mode == \"separateRow\" || gantt.config.baselines.render_mode == \"individualRow\");\r\n\t\tif (hasBaselines && baselinesOnDifferentRow){\r\n\t\t\tif (task.bar_height !== \"full\" && task.bar_height < task.row_height){\r\n\t\t\t\tif (taskType === cfg.types.milestone){\r\n\t\t\t\t\tlet milestoneHeight = view.getBarHeight(task.id, true);\r\n\t\t\t\t\tlet milestoneWidth = Math.sqrt(2 * milestoneHeight * milestoneHeight);\r\n\t\t\t\t\tpadd = Math.floor((milestoneWidth - height) / 2) + 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpadd = 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t//\tif(task.type == cfg.types.milestone){\r\n\t//\t\tpadd -= 1;\r\n\t//\t}\r\n\t//\tif (taskType == cfg.types.milestone && cfg.link_line_width > 1) {\r\n\t//\t\t//little adjust milestone position, so horisontal corners would match link arrow when thickness of link line is more than 1px\r\n\t//\t\tpadd += 1;\r\n\t//\t}\r\n\r\n\t\tif (taskType == cfg.types.milestone) {\r\n\t\t\tpos.left -= Math.round(height / 2);\r\n\t\t\tpos.width = height;\r\n\t\t}\r\n\r\n\t\tvar div = document.createElement(\"div\");\r\n\r\n\t\tvar width = Math.round(pos.width);\r\n\r\n\t\tif(view.$config.item_attribute) {\r\n\t\t\tdiv.setAttribute(view.$config.item_attribute, task.id);\r\n\t\t\tdiv.setAttribute(view.$config.bind + \"_id\", task.id); // 'task_id'/'resource_id' for backward compatibility\r\n\t\t}\r\n\r\n\t\tif (cfg.show_progress && taskType != cfg.types.milestone) {\r\n\t\t\t_render_task_progress(task, div, width, cfg, templates);\r\n\t\t}\r\n\r\n\t\t//use separate div to display content above progress bar\r\n\t\tvar content = _render_task_content(task, width, templates);\r\n\r\n\t\tdiv.appendChild(content);\r\n\r\n\t\tvar css = _combine_item_class(\"gantt_task_line\",\r\n\t\t\ttemplates.task_class(task.start_date, task.end_date, task),\r\n\t\t\ttask.id,\r\n\t\t\tview);\r\n\t\tif (task.color || task.progressColor || task.textColor) {\r\n\t\t\tcss += \" gantt_task_inline_color\";\r\n\t\t}\r\n\t\tif (pos.width < 20){\r\n\t\t\tcss += \" gantt_thin_task\";\r\n\t\t}\r\n\t\tdiv.className = css;\r\n\r\n\t\tvar styles = [\r\n\t\t\t\"left:\" + pos.left + \"px\",\r\n\t\t\t\"top:\" + (padd + pos.top) + 'px',\r\n\t\t\t\"height:\" + (height) + 'px',\r\n\t\t\t\"line-height:\" + (Math.max(height < 30 ? height - 2 : height, 0)) + 'px',\r\n\t\t\t\"width:\" + width + 'px'\r\n\t\t];\r\n\r\n\t\tdiv.style.cssText = styles.join(\";\");\r\n\t\tif (task.color) {\r\n\t\t\tdiv.style.setProperty(\"--dhx-gantt-task-background\", task.color);\r\n\t\t}\r\n\t\tif (task.textColor) {\r\n\t\t\tdiv.style.setProperty(\"--dhx-gantt-task-color\", task.textColor);\r\n\t\t}\r\n\r\n\t\tif (task.progressColor) {\r\n\t\t\tdiv.style.setProperty(\"--dhx-gantt-task-progress-color\", task.progressColor);\r\n\t\t}\r\n\r\n\t\t\r\n\t\tvar side = _render_leftside_content(task, cfg, templates, controlsMargin);\r\n\t\tif (side) div.appendChild(side);\r\n\r\n\t\tside = _render_rightside_content(task, cfg, templates, controlsMargin);\r\n\t\tif (side) div.appendChild(side);\r\n\r\n\t\tgantt._waiAria.setTaskBarAttr(task, div);\r\n\r\n\t\tvar state = gantt.getState();\r\n\r\n\t\tif (!gantt.isReadonly(task)) {\r\n\t\t\tif (cfg.drag_resize && !gantt.isSummaryTask(task) && taskType != cfg.types.milestone) {\r\n\t\t\t\t_render_pair(div, \"gantt_task_drag\", task, function (css) {\r\n\t\t\t\t\tvar el = document.createElement(\"div\");\r\n\t\t\t\t\tel.className = css;\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}, cfg);\r\n\t\t\t}\r\n\t\t\tif (cfg.drag_links && cfg.show_links) {\r\n\t\t\t\t_render_pair(div, \"gantt_link_control\", task, function (css) {\r\n\t\t\t\t\tvar outer = document.createElement(\"div\");\r\n\t\t\t\t\touter.className = css;\r\n\t\t\t\t\touter.style.cssText = [\r\n\t\t\t\t\t\t\"height:\" + height + 'px',\r\n\t\t\t\t\t\t\"line-height:\" + height + 'px'\r\n\t\t\t\t\t].join(\";\");\r\n\t\t\t\t\tvar inner = document.createElement(\"div\");\r\n\t\t\t\t\tinner.className = \"gantt_link_point\";\r\n\r\n\t\t\t\t\tvar showLinkPoints = false;\r\n\t\t\t\t\tif(state.link_source_id && cfg.touch){\r\n\t\t\t\t\t\tshowLinkPoints = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tinner.style.display = showLinkPoints ? \"block\" : \"\";\r\n\t\t\t\t\touter.appendChild(inner);\r\n\t\t\t\t\treturn outer;\r\n\t\t\t\t}, cfg, controlsMargin);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn div;\r\n\t}\r\n\r\n\tfunction _render_side_content(task, template, cssClass, marginStyle) {\r\n\t\tif (!template) return null;\r\n\r\n\t\tvar text = template(task.start_date, task.end_date, task);\r\n\t\tif (!text) return null;\r\n\t\tvar content = document.createElement(\"div\");\r\n\t\tcontent.className = \"gantt_side_content \" + cssClass;\r\n\t\tcontent.innerHTML = text;\r\n\t\tif(marginStyle){\r\n\t\t\tcontent.style[marginStyle.type] = Math.abs(marginStyle.value) + \"px\";\r\n\t\t}\r\n\t\treturn content;\r\n\t}\r\n\r\n\tfunction _render_leftside_content(task, cfg, templates, margin) {\r\n\t\tvar css = \"gantt_left \" + _get_link_crossing_css(!cfg.rtl ? true : false, task, cfg);\r\n\t\tvar marginStyle = null;\r\n\t\tif(margin){\r\n\t\t\tmarginStyle = { type: \"marginRight\", value: margin };\r\n\t\t}\r\n\t\treturn _render_side_content(task, templates.leftside_text, css, marginStyle);\r\n\t}\r\n\r\n\tfunction _render_rightside_content(task, cfg, templates, margin) {\r\n\t\tvar css = \"gantt_right \" + _get_link_crossing_css(!cfg.rtl ? false : true, task, cfg);\r\n\t\tvar marginStyle = null;\r\n\t\tif(margin){\r\n\t\t\tmarginStyle = { type: \"marginLeft\", value: margin };\r\n\t\t}\r\n\t\treturn _render_side_content(task, templates.rightside_text, css, marginStyle);\r\n\t}\r\n\r\n\tfunction _get_link_crossing_css(left, task) {\r\n\t\tvar cond = _get_conditions(left);\r\n\r\n\t\tfor (var i in cond) {\r\n\t\t\tvar links = task[i];\r\n\t\t\tfor (var ln = 0; ln < links.length; ln++) {\r\n\t\t\t\tvar link = gantt.getLink(links[ln]);\r\n\r\n\t\t\t\tfor (var tp = 0; tp < cond[i].length; tp++) {\r\n\t\t\t\t\tif (link.type == cond[i][tp]) {\r\n\t\t\t\t\t\treturn \"gantt_link_crossing\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\r\n\tfunction _render_task_content(task, width, templates) {\r\n\t\tvar content = document.createElement(\"div\");\r\n\t\tif (gantt.getTaskType(task.type) != gantt.config.types.milestone){\r\n\t\t\tcontent.innerHTML = templates.task_text(task.start_date, task.end_date, task);\r\n\t\t} else if(gantt.getTaskType(task.type) == gantt.config.types.milestone && width) {\r\n\t\t\tcontent.style.height = content.style.width = width + \"px\";\r\n\t\t}\r\n\t\tcontent.className = \"gantt_task_content\";\r\n\t\t//content.style.width = width + 'px';\r\n\t\treturn content;\r\n\t}\r\n\r\n\tfunction _render_task_progress(task, element, maxWidth, cfg, templates) {\r\n\t\tvar done = task.progress * 1 || 0;\r\n\r\n\t\tmaxWidth = Math.max(maxWidth - 2, 0);//2px for borders\r\n\t\tvar pr = document.createElement(\"div\");\r\n\t\tvar width = Math.round(maxWidth * done);\r\n\r\n\t\twidth = Math.min(maxWidth, width);\r\n\r\n\t\tpr.style.width = width + 'px';\r\n\t\tpr.className = \"gantt_task_progress\";\r\n\t\tpr.innerHTML = templates.progress_text(task.start_date, task.end_date, task);\r\n\r\n\t\tif(cfg.rtl){\r\n\t\t\tpr.style.position = \"absolute\";\r\n\t\t\tpr.style.right = \"0px\";\r\n\t\t}\r\n\r\n\t\tvar wrapper = document.createElement(\"div\");\r\n\t\twrapper.className = \"gantt_task_progress_wrapper\";\r\n\t\twrapper.appendChild(pr);\r\n\t\telement.appendChild(wrapper);\r\n\r\n\t\tif (gantt.config.drag_progress && !gantt.isReadonly(task)) {\r\n\t\t\tvar drag = document.createElement(\"div\");\r\n\r\n\t\t\tvar markerPos = width;\r\n\t\t\tif(cfg.rtl){\r\n\t\t\t\tmarkerPos = maxWidth - width;\r\n\t\t\t}\r\n\r\n\t\t\tdrag.style.left = markerPos + 'px';\r\n\t\t\tdrag.className = \"gantt_task_progress_drag\";\r\n\t\t\tdrag.innerHTML = `\r\n\r\n `;\r\n\t\t\tpr.appendChild(drag);\r\n\t\t\telement.appendChild(drag);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _get_conditions(leftside) {\r\n\t\tif (leftside) {\r\n\t\t\treturn {\r\n\t\t\t\t$source: [\r\n\t\t\t\t\tgantt.config.links.start_to_start\r\n\t\t\t\t],\r\n\t\t\t\t$target: [\r\n\t\t\t\t\tgantt.config.links.start_to_start,\r\n\t\t\t\t\tgantt.config.links.finish_to_start\r\n\t\t\t\t]\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\treturn {\r\n\t\t\t\t$source: [\r\n\t\t\t\t\tgantt.config.links.finish_to_start,\r\n\t\t\t\t\tgantt.config.links.finish_to_finish\r\n\t\t\t\t],\r\n\t\t\t\t$target: [\r\n\t\t\t\t\tgantt.config.links.finish_to_finish\r\n\t\t\t\t]\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tfunction _combine_item_class(basic, template, itemId, view) {\r\n\t\tvar cfg = view.$getConfig();\r\n\t\tvar css = [basic];\r\n\t\tif (template)\r\n\t\t\tcss.push(template);\r\n\r\n\t\tvar state = gantt.getState();\r\n\r\n\t\tvar task = gantt.getTask(itemId);\r\n\r\n\t\tif (gantt.getTaskType(task.type) == cfg.types.milestone) {\r\n\t\t\tcss.push(\"gantt_milestone\");\r\n\t\t}else if (gantt.getTaskType(task.type) == cfg.types.project) {\r\n\t\t\tcss.push(\"gantt_project\");\r\n\t\t}\r\n\r\n\t\tcss.push(\"gantt_bar_\" + gantt.getTaskType(task.type));\r\n\r\n\r\n\t\tif (gantt.isSummaryTask(task))\r\n\t\t\tcss.push(\"gantt_dependent_task\");\r\n\r\n\t\tif (gantt.isSplitTask(task) && ((cfg.open_split_tasks && !task.$open) || !cfg.open_split_tasks)) {\r\n\t\t\tcss.push(\"gantt_split_parent\");\r\n\t\t}\r\n\r\n\t\tif (cfg.select_task && gantt.isSelectedTask(itemId)) {\r\n\t\t\tcss.push(\"gantt_selected\");\r\n\t\t}\r\n\r\n\t\tif (itemId == state.drag_id) {\r\n\t\t\tcss.push(\"gantt_drag_\" + state.drag_mode);\r\n\t\t\tif (state.touch_drag) {\r\n\t\t\t\tcss.push(\"gantt_touch_\" + state.drag_mode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (state.link_source_id == itemId){\r\n\t\t\tcss.push(\"gantt_link_source\");\r\n\t\t\tif(state.link_from_start) {\r\n\t\t\t\tcss.push(\"gantt_link_from_start\");\r\n\t\t\t}else{\r\n\t\t\t\tcss.push(\"gantt_link_from_end\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (state.link_target_id == itemId)\r\n\t\t\tcss.push(\"gantt_link_target\");\r\n\r\n\r\n\t\tif (cfg.highlight_critical_path && gantt.isCriticalTask) {\r\n\t\t\tif (gantt.isCriticalTask(task))\r\n\t\t\t\tcss.push(\"gantt_critical_task\");\r\n\t\t}\r\n\r\n\t\tif (state.link_landing_area &&\r\n\t\t\t(state.link_target_id && state.link_source_id) &&\r\n\t\t\t(state.link_target_id != state.link_source_id) &&\r\n\t\t\t(state.link_target_id == itemId || state.link_source_id == itemId)) {\r\n\r\n\t\t\tvar from_id = state.link_source_id;\r\n\t\t\tvar from_start = state.link_from_start;\r\n\t\t\tvar to_start = state.link_to_start;\r\n\r\n\t\t\tvar allowDrag = gantt.isLinkAllowed(from_id, itemId, from_start, to_start);\r\n\r\n\t\t\tvar dragClass = \"\";\r\n\t\t\tif (allowDrag) {\r\n\t\t\t\tif (to_start)\r\n\t\t\t\t\tdragClass = \"link_start_allow\";\r\n\t\t\t\telse\r\n\t\t\t\t\tdragClass = \"link_finish_allow\";\r\n\t\t\t} else {\r\n\t\t\t\tif (to_start)\r\n\t\t\t\t\tdragClass = \"link_start_deny\";\r\n\t\t\t\telse\r\n\t\t\t\t\tdragClass = \"link_finish_deny\";\r\n\t\t\t}\r\n\t\t\tcss.push(dragClass);\r\n\t\t}\r\n\t\treturn css.join(\" \");\r\n\t}\r\n\r\n\tfunction _render_pair(parent, css, task, content, config, margin) {\r\n\t\tvar state = gantt.getState();\r\n\t\tvar className, element;\r\n\t\tif (+task.start_date >= +state.min_date) {\r\n\t\t\tclassName = [css, config.rtl ? \"task_right\" : \"task_left\", \"task_start_date\"];\r\n\t\t\telement = content(className.join(\" \"));\r\n\t\t\telement.setAttribute(\"data-bind-property\", \"start_date\");\r\n\t\t\tif(margin){\r\n\t\t\t\telement.style.marginLeft = margin + \"px\";\r\n\t\t\t}\r\n\t\t\tparent.appendChild(element);\r\n\t\t}\r\n\r\n\t\tif (+task.end_date <= +state.max_date){\r\n\t\t\tclassName = [css, config.rtl ? \"task_left\" : \"task_right\", \"task_end_date\"];\r\n\t\t\telement = content(className.join(\" \"));\r\n\t\t\telement.setAttribute(\"data-bind-property\", \"end_date\");\r\n\t\t\tif(margin){\r\n\t\t\t\telement.style.marginRight = margin + \"px\";\r\n\t\t\t}\r\n\t\t\tparent.appendChild(element);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn _render_task_element;\r\n}\r\n\r\nexport default createTaskRenderer;","import isInViewPort from \"./viewport/is_bar_in_viewport\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\nimport createBaseBarRender from \"./task_bar_render\";\r\n\r\nexport default function createTaskRenderer(gantt){\r\n\tvar defaultRender = createBaseBarRender(gantt);\r\n\treturn {\r\n\t\trender: defaultRender,\r\n\t\tupdate: null,\r\n\t\t//getRectangle: getBarRectangle\r\n\t\tisInViewPort: isInViewPort,\r\n\t\tgetVisibleRange: getVisibleRange\r\n\t};\r\n};","export default function () {\r\n // eslint-disable-next-line no-console\r\n console.error(\"You are trying to use a Pro feature that is not available in the GPL version.\");\r\n return {\r\n render: function (){},\r\n isInViewPort: function (){},\r\n getVisibleRange: function (){}\r\n };\r\n};\r\n","export default function(item, view, config){\r\n\treturn {\r\n\t\ttop: view.getItemTop(item.id),\r\n\t\theight: view.getItemHeight(item.id),\r\n\t\tleft: 0,\r\n\t\tright: Infinity\r\n\t};\r\n};","export default function getVisibleCellsRange(scale, viewport){\r\n\tvar firstCellIndex = 0;\r\n\tvar lastCellIndex = scale.left.length - 1;\r\n\tif(viewport){\r\n\t\tfor(var i = 0; i < scale.left.length; i++){\r\n\t\t\tvar left = scale.left[i];\r\n\t\t\tif(left < viewport.x){\r\n\t\t\t\tfirstCellIndex = i;\r\n\t\t\t}\r\n\t\t\tif(left > viewport.x_end){\r\n\t\t\t\tlastCellIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tstart: firstCellIndex,\r\n\t\tend: lastCellIndex\r\n\t};\r\n};","import isLegacyRender from \"../is_legacy_smart_render\";\r\n\r\nexport default function isColumnVisible(columnIndex, scale, viewPort, gantt){\r\n\tvar width = scale.width[columnIndex];\r\n\tif(width <= 0){\r\n\t\treturn false;\r\n\t}\r\n\tif(!gantt.config.smart_rendering || isLegacyRender(gantt)){\r\n\t\treturn true;\r\n\t}\r\n\tvar cellLeftCoord = scale.left[columnIndex] - width;\r\n\tvar cellRightCoord = scale.left[columnIndex] + width;\r\n\treturn (cellLeftCoord <= viewPort.x_end && cellRightCoord >= viewPort.x);//do not render skipped columns\r\n};","export default function (items, gantt){\r\n\tvar placeholderConfig = gantt.config.timeline_placeholder;\r\n\titems = items || [];\r\n\tif (placeholderConfig && items.filter(e => e.id === 'timeline_placeholder_task').length === 0){\r\n\t\tvar state = gantt.getState();\r\n\t\tvar lastTaskId = null;\r\n\t\tvar start_date = state.min_date;\r\n\t\tvar end_date = state.max_date;\r\n\t\tif (items.length){\r\n\t\t\tlastTaskId = items[items.length -1].id;\r\n\t\t}\r\n\t\tvar placeholderTask = {\r\n\t\t\tstart_date: start_date, \r\n\t\t\tend_date: end_date, \r\n\t\t\trow_height: placeholderConfig.height || 0,\r\n\t\t\tid: \"timeline_placeholder_task\", \r\n\t\t\tunscheduled: true,\r\n\t\t\tlastTaskId: lastTaskId, \r\n\t\t\tcalendar_id: placeholderConfig.calendar || \"global\",\r\n\t\t\t$source:[], \r\n\t\t\t$target: []\r\n\t\t};\r\n\t\titems.push(placeholderTask);\r\n\t}\r\n};","import isInViewPort from \"./viewport/is_link_in_viewport\";\r\nimport getVisibleRange from \"./viewport/factory/get_visible_link_range\";\r\nimport { childrenHaveBaselines, getMaxParentHeight } from \"./baseline_helper\";\r\n\r\n\r\nfunction createLinkRender(gantt){\r\n\r\nfunction _render_link_element(link, view, config) {\r\n\tvar source = gantt.getTask(link.source);\r\n\tif(source.hide_bar){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar target = gantt.getTask(link.target);\r\n\tif(target.hide_bar){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar pt = path_builder.get_endpoint(link, view, source, target);\r\n\tvar dy = pt.e_y - pt.y;\r\n\tvar dx = pt.e_x - pt.x;\r\n\tif(!dx && !dy){\r\n\t\treturn null;\r\n\t}\r\n\r\n\r\n\tvar dots = path_builder.get_points(link, view, source, target);\r\n\tconst lines = drawer.get_lines(dots, view);\r\n\r\n\tconst shapes = transform_lines_to_shapes(lines.filter(l => l.size > 0), config);\r\n \r\n\tconst div = render_shapes(shapes, view, link, config);\r\n\r\n\r\n\tvar css = \"gantt_task_link\";\r\n\r\n\tif (link.color) {\r\n\t\tcss += \" gantt_link_inline_color\";\r\n\t}\r\n\tvar cssTemplate = gantt.templates.link_class ? gantt.templates.link_class(link) : \"\";\r\n\tif (cssTemplate) {\r\n\t\tcss += \" \" + cssTemplate;\r\n\t}\r\n\r\n\tif (config.highlight_critical_path && gantt.isCriticalLink) {\r\n\t\tif (gantt.isCriticalLink(link))\r\n\t\t\tcss += \" gantt_critical_link\";\r\n\t}\r\n\r\n\tdiv.className = css;\r\n\r\n\tif(view.$config.link_attribute){\r\n\t\tdiv.setAttribute(view.$config.link_attribute, link.id);\r\n\t\tdiv.setAttribute(\"link_id\", link.id);\r\n\t}\r\n\tif (link.color) {\r\n\t\tdiv.style.setProperty(\"--dhx-gantt-link-background\", link.color);\r\n\t}\r\n\r\n\tgantt._waiAria.linkAttr(link, div);\r\n\r\n\treturn div;\r\n}\r\n\r\n\tfunction render_shapes(shapes, view, link, config) {\r\n\t\tconst container = document.createElement(\"div\");\r\n\r\n\t\tshapes.forEach(shape => {\r\n\t\t\tlet element;\r\n\t\t\tif (shape.type === 'line') {\r\n\t\t\t\telement = drawer.render_line(shape.data, null, view, link.source);\r\n\t\t\t} else if (shape.type === 'corner') {\r\n\t\t\t\telement = drawer.render_corner(shape.data, view);\r\n\t\t\t}else if (shape.type === 'arrow') {\r\n\t\t\t\telement = drawer.render_arrow(shape.data, config);\r\n\t\t\t}\r\n\r\n\t\t\tcontainer.appendChild(element);\r\n\t\t});\r\n\r\n\t\treturn container;\r\n\t}\r\n\r\n\tfunction transform_lines_to_shapes(lines, config) {\r\n\t\tconst radius = config.link_radius || 4;\r\n\t\tconst arrowSize = config.link_arrow_size || 6; // Arrow size from config\r\n\t\tconst shapes = [];\r\n\t\r\n\t\tfor (let i = 0; i < lines.length; i++) {\r\n\t\t\tconst line = lines[i];\r\n\t\t\tconst nextLine = lines[i + 1];\r\n\t\r\n\t\t\tif (!nextLine || config.link_radius <= 1) {\r\n\t\t\t\tshapes.push({ type: 'line', data: line });\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (line.direction !== nextLine.direction) {\r\n\t\t\t\tif(line.size < radius || nextLine.size < radius){\r\n\t\t\t\t\tshapes.push({ type: 'line', data: line });\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tline.size -= radius;\r\n\t\t\t\tshapes.push({ type: 'line', data: line });\r\n\t\r\n\t\t\t\tlet cornerX = line.x;\r\n\t\t\t\tlet cornerY = line.y - config.link_line_width / 2;\r\n\t\r\n\t\t\t\tswitch (line.direction) {\r\n\t\t\t\t\tcase 'right':\r\n\t\t\t\t\t\tcornerX += line.size;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'left':\r\n\t\t\t\t\t\tcornerX -= line.size;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'down':\r\n\t\t\t\t\t\tcornerY += line.size;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'up':\r\n\t\t\t\t\t\tcornerY -= line.size;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tconst corner = {\r\n\t\t\t\t\tx: cornerX,\r\n\t\t\t\t\ty: cornerY,\r\n\t\t\t\t\tdirection: { from: line.direction, to: nextLine.direction },\r\n\t\t\t\t\tradius\r\n\t\t\t\t};\r\n\t\t\t\tshapes.push({ type: 'corner', data: corner });\r\n\t\r\n\t\t\t\tswitch (nextLine.direction) {\r\n\t\t\t\t\tcase 'right':\r\n\t\t\t\t\t\tnextLine.x += radius;\r\n\t\t\t\t\t\tnextLine.size -= radius;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'left':\r\n\t\t\t\t\t\tnextLine.x -= radius;\r\n\t\t\t\t\t\tnextLine.size -= radius;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'down':\r\n\t\t\t\t\t\tnextLine.y += radius;\r\n\t\t\t\t\t\tnextLine.size -= radius;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'up':\r\n\t\t\t\t\t\tnextLine.y -= radius;\r\n\t\t\t\t\t\tnextLine.size -= radius;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tshapes.push({ type: 'line', data: line });\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tconst lastLine = lines[lines.length - 1];\r\n\t\r\n\t\tif (lastLine.direction === 'right' || lastLine.direction === 'left') {\r\n\t\t\tlastLine.size -= arrowSize*3/4; \r\n\t\r\n\t\t\tlet arrowX = lastLine.direction === 'right' ? (lastLine.x + lastLine.size) : lastLine.x - lastLine.size - arrowSize/2;\r\n\t\t\tlet arrowY = lastLine.y - (config.link_line_width / 2) - (arrowSize / 2) + 1;\r\n\t\r\n\t\t\tif(lastLine.direction === 'left'){\r\n\t\t\t\tarrowY -= 1;// left pointing arrows for some reason need adjustments\r\n\t\t\t\tarrowX -= 2;\r\n\t\t\t}else{\r\n\t\t\t\tarrowX -= 1;\r\n\t\t\t}\r\n\t\t\tconst arrow = {\r\n\t\t\t\tx: arrowX,\r\n\t\t\t\ty: arrowY,\r\n\t\t\t\tsize: arrowSize,\r\n\t\t\t\tdirection: lastLine.direction\r\n\t\t\t};\r\n\t\r\n\t\t\tshapes.push({ type: 'line', data: lastLine });\r\n\t\t\tshapes.push({ type: 'arrow', data: arrow });\r\n\t\t} else {\r\n\t\t\tshapes.push({ type: 'line', data: lastLine });\r\n\t\t}\r\n\t\r\n\t\treturn shapes;\r\n\t}\r\n\t\r\n\r\n\r\nvar drawer = {\r\n\tcurrent_pos: null,\r\n\tdirs: {\"left\": 'left', \"right\": 'right', \"up\": 'up', \"down\": 'down'},\r\n\tpath: [],\r\n\tclear: function () {\r\n\t\tthis.current_pos = null;\r\n\t\tthis.path = [];\r\n\t},\r\n\tpoint: function (pos) {\r\n\t\tthis.current_pos = gantt.copy(pos);\r\n\t},\r\n\tget_lines: function (dots) {\r\n\t\tthis.clear();\r\n\t\tthis.point(dots[0]);\r\n\t\tfor (var i = 1; i < dots.length; i++) {\r\n\t\t\tthis.line_to(dots[i]);\r\n\t\t}\r\n\t\treturn this.get_path();\r\n\t},\r\n\tline_to: function (pos) {\r\n\t\tvar next = gantt.copy(pos);\r\n\t\tvar prev = this.current_pos;\r\n\r\n\t\tvar line = this._get_line(prev, next);\r\n\t\tthis.path.push(line);\r\n\t\tthis.current_pos = next;\r\n\t},\r\n\tget_path: function () {\r\n\t\treturn this.path;\r\n\t},\r\n\tget_wrapper_sizes: function (v, view, itemId) {\r\n\t\tvar config = view.$getConfig();\r\n\t\tvar res,\r\n\t\t\twrapper_size = config.link_wrapper_width,\r\n\t\t\ty = v.y - (wrapper_size) / 2;\r\n\t\tswitch (v.direction) {\r\n\t\t\tcase this.dirs.left:\r\n\t\t\t\tres = {\r\n\t\t\t\t\ttop: y,\r\n\t\t\t\t\theight: wrapper_size,\r\n\t\t\t\t\tlineHeight: wrapper_size,\r\n\t\t\t\t\tleft: v.x - v.size - wrapper_size / 2,\r\n\t\t\t\t\twidth: v.size + wrapper_size\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase this.dirs.right:\r\n\t\t\t\tres = {\r\n\t\t\t\t\ttop: y,\r\n\t\t\t\t\tlineHeight: wrapper_size,\r\n\t\t\t\t\theight: wrapper_size,\r\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\r\n\t\t\t\t\twidth: v.size + wrapper_size\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase this.dirs.up:\r\n\t\t\t\tres = {\r\n\t\t\t\t\ttop: y - v.size,\r\n\t\t\t\t\tlineHeight: v.size + wrapper_size,\r\n\t\t\t\t\theight: v.size + wrapper_size,\r\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\r\n\t\t\t\t\twidth: wrapper_size\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase this.dirs.down:\r\n\t\t\t\tres = {\r\n\t\t\t\t\ttop: y /*- wrapper_size/2*/,\r\n\t\t\t\t\tlineHeight: v.size + wrapper_size,\r\n\t\t\t\t\theight: v.size + wrapper_size,\r\n\t\t\t\t\tleft: v.x - wrapper_size / 2,\r\n\t\t\t\t\twidth: wrapper_size\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t},\r\n\tget_line_sizes: function (v, view) {\r\n\t\tvar config = view.$getConfig();\r\n\t\tvar res,\r\n\t\t\tline_size = config.link_line_width,\r\n\t\t\twrapper_size = config.link_wrapper_width,\r\n\t\t\tsize = v.size + line_size;\r\n\t\tswitch (v.direction) {\r\n\t\t\tcase this.dirs.left:\r\n\t\t\tcase this.dirs.right:\r\n\t\t\t\tres = {\r\n\t\t\t\t\theight: line_size,\r\n\t\t\t\t\twidth: size,\r\n\t\t\t\t\tmarginTop: (wrapper_size - line_size) / 2,\r\n\t\t\t\t\tmarginLeft: (wrapper_size - line_size) / 2\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tcase this.dirs.up:\r\n\t\t\tcase this.dirs.down:\r\n\t\t\t\tres = {\r\n\t\t\t\t\theight: size,\r\n\t\t\t\t\twidth: line_size,\r\n\t\t\t\t\tmarginTop: (wrapper_size - line_size) / 2,\r\n\t\t\t\t\tmarginLeft: (wrapper_size - line_size) / 2\r\n\t\t\t\t};\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\r\n\t\treturn res;\r\n\t},\r\n\trender_line: function (v, end, view, itemId) {\r\n\t\tvar pos = this.get_wrapper_sizes(v, view, itemId);\r\n\t\tvar wrapper = document.createElement(\"div\");\r\n\t\twrapper.style.cssText = [\r\n\t\t\t\"top:\" + pos.top + \"px\",\r\n\t\t\t\"left:\" + pos.left + \"px\",\r\n\t\t\t\"height:\" + pos.height + \"px\",\r\n\t\t\t\"width:\" + pos.width + \"px\"\r\n\t\t].join(';');\r\n\t\twrapper.className = \"gantt_line_wrapper\";\r\n\r\n\t\tvar innerPos = this.get_line_sizes(v, view);\r\n\t\tvar inner = document.createElement(\"div\");\r\n\t\tinner.style.cssText = [\r\n\t\t\t\"height:\" + innerPos.height + \"px\",\r\n\t\t\t\"width:\" + innerPos.width + \"px\",\r\n\t\t\t\"margin-top:\" + innerPos.marginTop + \"px\",\r\n\t\t\t\"margin-left:\" + innerPos.marginLeft + \"px\"\r\n\t\t].join(\";\");\r\n\r\n\t\tinner.className = \"gantt_link_line_\" + v.direction;\r\n\t\twrapper.appendChild(inner);\r\n\r\n\t\treturn wrapper;\r\n\t},\r\n\r\n\trender_corner: function (corner, view) {\r\n\t\tconst radius = corner.radius;\r\n\t\tconst config = view.$getConfig();\r\n\t\tconst lineWidth = config.link_line_width || 2;\r\n\t\tconst cornerDiv = document.createElement(\"div\");\r\n\t\r\n\t\tcornerDiv.classList.add(\"gantt_link_corner\");\r\n\t\tcornerDiv.classList.add(`gantt_link_corner_${corner.direction.from}_${corner.direction.to}`);\r\n\t\r\n\t\tcornerDiv.style.width = `${radius}px`;\r\n\t\tcornerDiv.style.height = `${radius}px`;\r\n\t\r\n\t\tlet borderVertical;\r\n\t\tlet borderHorizontal;\r\n\r\n\t\tif (corner.direction.from === 'right' && corner.direction.to === 'down') {\r\n\t\t\tborderVertical = \"Right\";\r\n\t\t\tborderHorizontal = \"Top\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y}px`;\r\n\t\t} else if (corner.direction.from === 'down' && corner.direction.to === 'right') {\r\n\t\t\tborderVertical = \"Left\";\r\n\t\t\tborderHorizontal = \"Bottom\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y}px`;\r\n\t\t} else if (corner.direction.from === 'right' && corner.direction.to === 'up') {\r\n\t\t\tborderVertical = \"Right\";\r\n\t\t\tborderHorizontal = \"Bottom\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y - radius}px`;\r\n\t\t} else if (corner.direction.from === 'up' && corner.direction.to === 'right') {\r\n\t\t\tborderVertical = \"Left\";\r\n\t\t\tborderHorizontal = \"Top\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y - radius}px`;\r\n\t\t} else if (corner.direction.from === 'left' && corner.direction.to === 'down') {\r\n\t\t\tborderVertical = \"Left\";\r\n\t\t\tborderHorizontal = \"Top\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - radius - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y}px`;\r\n\t\t} else if (corner.direction.from === 'down' && corner.direction.to === 'left') {\r\n\t\t\tborderVertical = \"Right\";\r\n\t\t\tborderHorizontal = \"Bottom\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - radius - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y}px`;\r\n\t\t} else if (corner.direction.from === 'left' && corner.direction.to === 'up') {\r\n\t\t\tborderVertical = \"Left\";\r\n\t\t\tborderHorizontal = \"Bottom\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - radius - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y - radius}px`;\r\n\t\t} else if (corner.direction.from === 'up' && corner.direction.to === 'left') {\r\n\t\t\tborderVertical = \"Right\";\r\n\t\t\tborderHorizontal = \"Top\";\r\n\t\t\tcornerDiv.style.left = `${corner.x - radius - config.link_line_width/2}px`;\r\n\t\t\tcornerDiv.style.top = `${corner.y - radius}px`;\r\n\t\t}\r\n\r\n\t\tcornerDiv.style[`border${borderHorizontal}Width`] = `${lineWidth}px`;\r\n\t\tcornerDiv.style[`border${borderVertical}Width`] = `${lineWidth}px`;\r\n\t\tcornerDiv.style[`border${borderVertical}Style`] = `solid`;\r\n\t\tcornerDiv.style[`border${borderHorizontal}Style`] = `solid`;\r\n\t\tcornerDiv.style[`border${borderHorizontal}${borderVertical}Radius`] = `${radius}px`;\r\n\r\n\t\r\n\t\treturn cornerDiv;\r\n\t},\r\n\r\n\trender_arrow(arrow, config) {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tvar top = arrow.y;\r\n\t\tvar left = arrow.x;\r\n\t\r\n\t\tvar size = config.link_arrow_size;\r\n\t\tdiv.style.setProperty(\"--dhx-gantt-icon-size\", `${size}px`);\r\n\t\r\n\t\tvar className = \"gantt_link_arrow gantt_link_arrow_\" + arrow.direction;\r\n\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + 'px';\r\n\t\tdiv.className = className;\r\n\t\r\n\t\treturn div;\r\n\t},\r\n\t\r\n\t_get_line: function (from, to) {\r\n\t\tvar direction = this.get_direction(from, to);\r\n\t\tvar vect = {\r\n\t\t\tx: from.x,\r\n\t\t\ty: from.y,\r\n\t\t\tdirection: this.get_direction(from, to)\r\n\t\t};\r\n\t\tif (direction == this.dirs.left || direction == this.dirs.right) {\r\n\t\t\tvect.size = Math.abs(from.x - to.x);\r\n\t\t} else {\r\n\t\t\tvect.size = Math.abs(from.y - to.y);\r\n\t\t}\r\n\t\treturn vect;\r\n\t},\r\n\tget_direction: function (from, to) {\r\n\t\tvar direction = 0;\r\n\t\tif (to.x < from.x) {\r\n\t\t\tdirection = this.dirs.left;\r\n\t\t} else if (to.x > from.x) {\r\n\t\t\tdirection = this.dirs.right;\r\n\t\t} else if (to.y > from.y) {\r\n\t\t\tdirection = this.dirs.down;\r\n\t\t} else {\r\n\t\t\tdirection = this.dirs.up;\r\n\t\t}\r\n\t\treturn direction;\r\n\t}\r\n\r\n};\r\n\r\nvar path_builder = {\r\n\r\n\tpath: [],\r\n\tclear: function () {\r\n\t\tthis.path = [];\r\n\t},\r\n\tcurrent: function () {\r\n\t\treturn this.path[this.path.length - 1];\r\n\t},\r\n\tpoint: function (next) {\r\n\t\tif (!next)\r\n\t\t\treturn this.current();\r\n\r\n\t\tthis.path.push(gantt.copy(next));\r\n\t\treturn next;\r\n\t},\r\n\tpoint_to: function (direction, diff, point) {\r\n\t\tif (!point)\r\n\t\t\tpoint = gantt.copy(this.point());\r\n\t\telse\r\n\t\t\tpoint = {x: point.x, y: point.y};\r\n\t\tvar dir = drawer.dirs;\r\n\t\tswitch (direction) {\r\n\t\t\tcase (dir.left):\r\n\t\t\t\tpoint.x -= diff;\r\n\t\t\t\tbreak;\r\n\t\t\tcase (dir.right):\r\n\t\t\t\tpoint.x += diff;\r\n\t\t\t\tbreak;\r\n\t\t\tcase (dir.up):\r\n\t\t\t\tpoint.y -= diff;\r\n\t\t\t\tbreak;\r\n\t\t\tcase (dir.down):\r\n\t\t\t\tpoint.y += diff;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.point(point);\r\n\t},\r\n\tget_points: function (link, view, source, target) {\r\n\t\tvar pt = this.get_endpoint(link, view, source, target);\r\n\t\tvar xy = gantt.config;\r\n\r\n\t\tvar dy = pt.e_y - pt.y;\r\n\t\tvar dx = pt.e_x - pt.x;\r\n\r\n\t\tvar dir = drawer.dirs;\r\n\r\n\t\tvar rowHeight = view.getItemHeight(link.source);\r\n\r\n\t\tthis.clear();\r\n\t\tthis.point({x: pt.x, y: pt.y});\r\n\r\n\t\tvar shiftX = 2 * xy.link_arrow_size;//just random size for first line\r\n\t\tvar lineType = this.get_line_type(link, view.$getConfig());\r\n\r\n\t\tvar forward = (pt.e_x > pt.x);\r\n\t\tif (lineType.from_start && lineType.to_start) {\r\n\t\t\tthis.point_to(dir.left, shiftX);\r\n\t\t\tif (forward) {\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t} else {\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t}\r\n\t\t\tthis.point_to(dir.right, shiftX);\r\n\r\n\t\t} else if (!lineType.from_start && lineType.to_start) {\r\n\t\t\t// GS-2619. No need to add loops for the split tasks (zero dy means the tasks are on the same line)\r\n\t\t\tif (dy !== 0){\r\n\t\t\t\tforward = (pt.e_x > (pt.x + 2 * shiftX));\r\n\t\t\t}\r\n\t\t\tthis.point_to(dir.right, shiftX);\r\n\t\t\tif (forward) {\r\n\t\t\t\tdx -= shiftX;\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t} else {\r\n\t\t\t\tdx -= 2 * shiftX;\r\n\t\t\t\tvar sign = dy > 0 ? 1 : -1;\r\n\r\n\t\t\t\tthis.point_to(dir.down, sign * (rowHeight / 2));\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t\tthis.point_to(dir.down, sign * ( Math.abs(dy) - (rowHeight / 2)));\r\n\t\t\t\tthis.point_to(dir.right, shiftX);\r\n\t\t\t}\r\n\r\n\t\t} else if (!lineType.from_start && !lineType.to_start) {\r\n\t\t\tthis.point_to(dir.right, shiftX);\r\n\t\t\tif (forward) {\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t} else {\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t}\r\n\t\t\tthis.point_to(dir.left, shiftX);\r\n\t\t} else if (lineType.from_start && !lineType.to_start) {\r\n\t\t\t// GS-2619. No need to add loops for the split tasks (zero dy means the tasks are on the same line)\r\n\t\t\tif (dy !== 0){\r\n\t\t\t\tforward = (pt.e_x > (pt.x - 2 * shiftX));\r\n\t\t\t}\r\n\t\t\tthis.point_to(dir.left, shiftX);\r\n\r\n\t\t\tif (!forward) {\r\n\t\t\t\tdx += shiftX;\r\n\t\t\t\tthis.point_to(dir.down, dy);\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t} else {\r\n\t\t\t\tdx += 2 * shiftX;\r\n\t\t\t\tvar sign = dy > 0 ? 1 : -1;\r\n\t\t\t\tthis.point_to(dir.down, sign * (rowHeight / 2));\r\n\t\t\t\tthis.point_to(dir.right, dx);\r\n\t\t\t\tthis.point_to(dir.down, sign * ( Math.abs(dy) - (rowHeight / 2)));\r\n\t\t\t\tthis.point_to(dir.left, shiftX);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn this.path;\r\n\t},\r\n\tget_line_type: function(link, config){\r\n\t\tvar types = config.links;\r\n\t\tvar from_start = false, to_start = false;\r\n\t\tif (link.type == types.start_to_start) {\r\n\t\t\tfrom_start = to_start = true;\r\n\t\t} else if (link.type == types.finish_to_finish) {\r\n\t\t\tfrom_start = to_start = false;\r\n\t\t} else if (link.type == types.finish_to_start) {\r\n\t\t\tfrom_start = false;\r\n\t\t\tto_start = true;\r\n\t\t} else if (link.type == types.start_to_finish) {\r\n\t\t\tfrom_start = true;\r\n\t\t\tto_start = false;\r\n\t\t} else {\r\n\t\t\tgantt.assert(false, \"Invalid link type\");\r\n\t\t}\r\n\r\n\t\tif(config.rtl){\r\n\t\t\tfrom_start = !from_start;\r\n\t\t\tto_start = !to_start;\r\n\t\t}\r\n\r\n\t\treturn {from_start: from_start, to_start: to_start};\r\n\t},\r\n\r\n\tget_endpoint: function (link, view, source, target) {\r\n\t\tvar config = view.$getConfig();\r\n\r\n\t\tvar lineType = this.get_line_type(link, config);\r\n\t\tvar from_start = lineType.from_start,\r\n\t\t\tto_start = lineType.to_start;\r\n\r\n\t\tvar from = getMilestonePosition(source, view, config),\r\n\t\t\tto = getMilestonePosition(target, view, config);\r\n\r\n\t\treturn {\r\n\t\t\tx: from_start ? from.left : (from.left + from.width),\r\n\t\t\te_x: to_start ? to.left : (to.left + to.width),\r\n\t\t\ty: from.top + (from.rowHeight/2) - 1,\r\n\t\t\te_y: to.top + (to.rowHeight/2) - 1\r\n\t\t};\r\n\t}\r\n};\r\n\r\nfunction getMilestonePosition(task, view, config){\r\n\tvar pos = view.getItemPosition(task);\r\n\r\n\t// GS-2270: Link to the split children shouldn't exceed the parent row height\r\n\tlet splitParams = getMaxParentHeight(gantt, view, task);\r\n\tlet maxHeight = splitParams.maxHeight;\r\n\r\n\tlet splitChild = splitParams.splitChild;\r\n\tconst baselinesOnDifferentRow = gantt.config.baselines !== false && (gantt.config.baselines.render_mode == \"separateRow\" || gantt.config.baselines.render_mode == \"individualRow\");\r\n\tconst baselines = baselinesOnDifferentRow && task.baselines && task.baselines.length;\r\n\r\n\tif (splitParams.shrinkHeight){\r\n\t\tpos.rowHeight = maxHeight;\r\n\t}\r\n\r\n\tlet milestoneWidth;\r\n\tlet milestoneTask = gantt.getTaskType(task.type) == config.types.milestone;\r\n\tif(milestoneTask){\r\n\t\tlet milestoneHeight = view.getBarHeight(task.id, true);\r\n\t\tmilestoneWidth = Math.sqrt(2*milestoneHeight*milestoneHeight);\r\n\t\tif (splitParams.shrinkHeight && maxHeight < milestoneHeight){\r\n\t\t\tmilestoneHeight = maxHeight;\r\n\t\t\tmilestoneWidth = maxHeight;\r\n\t\t}\r\n\t\tpos.left -= milestoneWidth / 2;\r\n\t\tpos.width = milestoneWidth;\r\n\t} \r\n\tif (splitChild){\r\n\t\tif (maxHeight >= pos.height) {\r\n\t\t\tconst siblingBaselines = childrenHaveBaselines(gantt, task.parent);\r\n\t\t\tif (baselines || siblingBaselines){\r\n\t\t\t\tif (milestoneTask){\r\n\t\t\t\t\tpos.rowHeight = pos.height + 4;\r\n\t\t\t\t\tpos.left += (pos.width - pos.rowHeight + 4) / 2;\r\n\t\t\t\t\tpos.width = pos.rowHeight - 3;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpos.rowHeight = pos.height + 6;\r\n\t\t\t\t}\r\n\t\t\t} else if (milestoneTask) {\r\n\t\t\t\tpos.left += (milestoneWidth - pos.height) / 2;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tpos.rowHeight = maxHeight + 2;\r\n\t\t\tif (milestoneTask){\r\n\t\t\t\tpos.left += (pos.width - pos.rowHeight + 4) / 2;\r\n\t\t\t\tpos.width = pos.rowHeight - 3;\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (baselines){\r\n\t\tpos.rowHeight = pos.height + 4;\r\n\t}\r\n\r\n\treturn pos;\r\n}\r\n\r\n\r\nreturn {\r\n\trender: _render_link_element,\r\n\tupdate: null,\r\n\t//getRectangle: getLinkRectangle\r\n\tisInViewPort: isInViewPort,\r\n\tgetVisibleRange: getVisibleRange()\r\n};\r\n}\r\n\r\nexport default createLinkRender;","export default function(item, viewport, view, config, gantt){\r\n // GS-2481 and GS-1715, don't remove selected task when using keyboard shortcuts and when the inline editor is opened\r\n if(gantt.$ui.getView(\"grid\") && ((gantt.config.keyboard_navigation && gantt.getSelectedId()) || (gantt.ext.inlineEditors && gantt.ext.inlineEditors.getState().id))) {\r\n\t\treturn true;\r\n\t}\r\n var top = view.getItemTop(item.id);\r\n\tvar height = view.getItemHeight(item.id);\r\n\r\n\tif(top > viewport.y_end || top + height < viewport.y){\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n};","import * as helpers from \"../utils/helpers\";\r\n\r\nexport default function createResourceTimelineBuilder(gantt){\r\n\r\n\tlet resourceTaskCache = {};\r\n\r\n\tgantt.$data.tasksStore.attachEvent(\"onStoreUpdated\", function(){\r\n\t\tresourceTaskCache = {};\r\n\t});\r\n\r\n\tfunction getResourceLoad(resource, resourceProperty, scale, timeline){\r\n\t\tconst cacheKey = resource.id + \"_\" + resourceProperty + \"_\" + scale.unit + \"_\" + scale.step;\r\n\t\tlet res;\r\n\t\tif (!resourceTaskCache[cacheKey]) {\r\n\t\t\tres = resourceTaskCache[cacheKey] = calculateResourceLoad(resource, resourceProperty, scale, timeline);\r\n\r\n\t\t} else {\r\n\t\t\tres = resourceTaskCache[cacheKey];\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\r\n\tfunction calculateResourceLoadFromAssignments(items, scale, assignmentsPassed){\r\n\t\tconst scaleUnit = scale.unit;\r\n\t\tconst scaleStep = scale.step;\r\n\t\tconst timegrid = {};\r\n\r\n\t\tconst precalculatedTimes = {};\r\n\t\tfor (let i = 0; i < items.length; i++) {\r\n\t\t\tconst item = items[i];\r\n\t\t\tlet task = item;\r\n\t\t\tif(assignmentsPassed){\r\n\t\t\t\ttask = gantt.getTask(item.task_id);\r\n\t\t\t}\r\n\t\t\tif (task.unscheduled){\r\n\t\t\t\tcontinue; // do not process assignments for unscheduled tasks\r\n\t\t\t}\r\n\t\t\tlet minDate = (item.start_date || task.start_date);\r\n\t\t\tlet maxDate = (item.end_date || task.end_date);\r\n\t\t\tif(assignmentsPassed){\r\n\t\t\t\tif(item.start_date){\r\n\t\t\t\t\tminDate = new Date(Math.max(item.start_date.valueOf(), task.start_date.valueOf()));\r\n\t\t\t\t}\r\n\t\t\t\tif(item.end_date){\r\n\t\t\t\t\tmaxDate = new Date(Math.min(item.end_date.valueOf(), task.end_date.valueOf()));\r\n\t\t\t\t}\r\n\t\t\t\t// GS-2063: handle case with fixedDates mode\r\n\t\t\t\tif(item.mode && item.mode == \"fixedDates\"){\r\n\t\t\t\t\tminDate = item.start_date;\r\n\t\t\t\t\tmaxDate = item.end_date;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet firstColumn = helpers.findBinary(scale.trace_x, minDate.valueOf());\r\n\t\t\tlet minScaleDate = new Date(scale.trace_x[firstColumn] || gantt.date[scaleUnit + \"_start\"](new Date(minDate)));\r\n\t\t\t// GS-2307: need to take into account that task could start before the min scale date\r\n\t\t\t// so the task would be added to timegrid\r\n\t\t\tlet currDate = new Date(Math.min(minDate.valueOf(), minScaleDate.valueOf())); \r\n\r\n\t\t\tlet calendar = gantt.config.work_time ? gantt.getTaskCalendar(task) : gantt;\r\n\t\t\tprecalculatedTimes[calendar.id] = {};\r\n\t\t\twhile (currDate < maxDate) {\r\n\t\t\t\tconst cachedTimes = precalculatedTimes[calendar.id];\r\n\r\n\t\t\t\tlet date = currDate;\r\n\t\t\t\tconst timestamp = date.valueOf();\r\n\r\n\t\t\t\tcurrDate = gantt.date.add(currDate, scaleStep, scaleUnit);\r\n\r\n\t\t\t\tif(cachedTimes[timestamp] === false){\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar isWorkTime = calendar.isWorkTime({date: date, task: task, unit: scaleUnit});\r\n\t\t\t\tif(!isWorkTime){\r\n\t\t\t\t\tcachedTimes[timestamp] = false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!timegrid[timestamp]){\r\n\t\t\t\t\ttimegrid[timestamp] = {tasks: [], assignments: []};\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttimegrid[timestamp].tasks.push(task);\r\n\t\t\t\tif(assignmentsPassed){\r\n\t\t\t\t\ttimegrid[timestamp].assignments.push(item);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn timegrid;\r\n\t}\r\n\r\n\tfunction calculateResourceLoad(resource, resourceProperty, scale, timeline) {\r\n\r\n\t\tlet items;\r\n\t\tlet assignmentsPassed = false;\r\n\t\tlet timegrid = {};\r\n\r\n\t\tif(gantt.config.process_resource_assignments && resourceProperty === gantt.config.resource_property){\r\n\t\t\tif(resource.$role == \"task\"){\r\n\t\t\t\titems = gantt.getResourceAssignments(resource.$resource_id, resource.$task_id);\r\n\t\t\t}else{\r\n\t\t\t\titems = gantt.getResourceAssignments(resource.id);\r\n\t\t\t}\r\n\r\n\t\t\tassignmentsPassed = true;\r\n\t\t}else if(resource.$role == \"task\"){\r\n\t\t\titems = [];\r\n\t\t}else{\r\n\t\t\titems = gantt.getTaskBy(resourceProperty, resource.id);\r\n\t\t}\r\n\r\n\t\ttimegrid = calculateResourceLoadFromAssignments(items, scale, assignmentsPassed);\r\n\t\tconst scaleUnit = scale.unit;\r\n\t\tconst scaleStep = scale.step;\r\n\r\n\t\tconst timetable = [];\r\n\t\tlet start, end, tasks, assignments, cell;\r\n\t\tconst config = timeline.$getConfig();\r\n\r\n\t\tfor(let i = 0; i < scale.trace_x.length; i++){\r\n\t\t\tstart = new Date(scale.trace_x[i]);\r\n\t\t\tend = gantt.date.add(start, scaleStep, scaleUnit);\r\n\t\t\tcell = timegrid[start.valueOf()] || {};\r\n\t\t\ttasks = cell.tasks || [];\r\n\t\t\tassignments = cell.assignments || [];\r\n\t\t\tif(tasks.length || config.resource_render_empty_cells){\r\n\t\t\t\ttimetable.push({\r\n\t\t\t\t\tstart_date: start,\r\n\t\t\t\t\tend_date: end,\r\n\t\t\t\t\ttasks: tasks,\r\n\t\t\t\t\tassignments: assignments\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttimetable.push(null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn timetable;\r\n\t}\r\n\r\n\r\n\r\n\treturn getResourceLoad;\r\n};","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport isPlaceholderTask from \"../../../utils/placeholder_task\";\r\n\r\nfunction _init_dnd(gantt, grid) {\r\n\tvar DnD = gantt.$services.getService(\"dnd\");\r\n\r\n\tif(!grid.$config.bind || !gantt.getDatastore(grid.$config.bind)){\r\n\t\treturn;\r\n\t}\r\n\r\n\tfunction locate(e){\r\n\t\treturn domHelpers.locateAttribute(e, grid.$config.item_attribute);\r\n\t}\r\n\r\n\tfunction getStore(){\r\n\t\treturn gantt.getDatastore(grid.$config.bind);\r\n\t}\r\n\r\n\tfunction checkPlaceholderTask(id){\r\n\t\treturn isPlaceholderTask(id, gantt, getStore());\r\n\t}\r\n\r\n\tvar dnd = new DnD(grid.$grid_data, {updates_per_second: 60});\r\n\tif (gantt.defined(grid.$getConfig().dnd_sensitivity))\r\n\t\tdnd.config.sensitivity = grid.$getConfig().dnd_sensitivity;\r\n\r\n\tdnd.attachEvent(\"onBeforeDragStart\", gantt.bind(function (obj, e) {\r\n\t\tvar el = locate(e);\r\n\t\tif (!el) return false;\r\n\t\tif (gantt.hideQuickInfo) gantt.hideQuickInfo();\r\n\r\n\t\tif (domHelpers.closest(e.target, \".gantt_grid_editor_placeholder\")){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar id = el.getAttribute(grid.$config.item_attribute);\r\n\t\tif (checkPlaceholderTask(id)) return false;\r\n\r\n\t\tvar datastore = getStore();\r\n\r\n\t\tvar task = datastore.getItem(id);\r\n\r\n\t\tif (gantt.isReadonly(task))\r\n\t\t\treturn false;\r\n\r\n\t\tdnd.config.initial_open_state = task.$open;\r\n\t\tif (!gantt.callEvent(\"onRowDragStart\", [id, e.target || e.srcElement, e])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}, gantt));\r\n\r\n\tdnd.attachEvent(\"onAfterDragStart\", gantt.bind(function (obj, e) {\r\n\t\tvar el = locate(e);\r\n\t\tdnd.config.marker.innerHTML = el.outerHTML;\r\n\t\tvar element = dnd.config.marker.firstChild;\r\n\t\tif(element){\r\n\t\t\telement.style.position = \"static\";\r\n\t\t}\r\n\r\n\t\tdnd.config.id = el.getAttribute(grid.$config.item_attribute);\r\n\r\n\t\tvar store = getStore();\r\n\r\n\t\tvar task = store.getItem(dnd.config.id);\r\n\t\tdnd.config.index = store.getBranchIndex(dnd.config.id);\r\n\t\tdnd.config.parent = task.parent;\r\n\t\ttask.$open = false;\r\n\t\ttask.$transparent = true;\r\n\t\tthis.refreshData();\r\n\t}, gantt));\r\n\r\n\tdnd.lastTaskOfLevel = function (level) {\r\n\t\tvar last_item = null;\r\n\t\tvar store = getStore();\r\n\t\tvar tasks = store.getItems();\r\n\t\tfor (var i = 0, len = tasks.length; i < len; i++) {\r\n\t\t\tif (tasks[i].$level == level) {\r\n\t\t\t\tlast_item = tasks[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn last_item ? last_item.id : null;\r\n\t};\r\n\tdnd._getGridPos = gantt.bind(function (e) {\r\n\t\tvar pos = domHelpers.getNodePosition(grid.$grid_data);\r\n\t\t// row offset\r\n\t\tvar x = pos.x + grid.$grid.scrollLeft;\r\n\t\tvar y = e.pos.y - 10;\r\n\r\n\t\tvar rowHeight = grid.getItemHeight(dnd.config.id);\r\n\t\t// prevent moving row out of grid_data container\r\n\t\tif (y < pos.y) y = pos.y;\r\n\t\tvar gridHeight = grid.getTotalHeight();\r\n\t\tif (y > pos.y + gridHeight - rowHeight) y = pos.y + gridHeight - rowHeight;\r\n\t\tconst maxBottom = pos.y + pos.height;\r\n\t\tif (y > maxBottom - rowHeight) {\r\n\t\t\ty = maxBottom - rowHeight;\r\n\t\t}\r\n\r\n\t\tpos.x = x;\r\n\t\tpos.y = y;\r\n\t\treturn pos;\r\n\t}, gantt);\r\n\tdnd._getTargetY = gantt.bind(function (e) {\r\n\t\tvar pos = domHelpers.getNodePosition(grid.$grid_data);\r\n\t\tvar scrollPos = grid.$state.scrollTop || 0;\r\n\t\tvar maxBottom = gantt.$grid_data.getBoundingClientRect().height + scrollPos;\r\n\r\n\t\tvar y = e.pageY - pos.y + scrollPos;\r\n\t\tif (y > maxBottom) {\r\n\t\t\ty = maxBottom;\r\n\t\t} else if (y < scrollPos) {\r\n\t\t\ty = scrollPos;\r\n\t\t}\r\n\t\treturn y;\r\n\t}, gantt);\r\n\tdnd._getTaskByY = gantt.bind(function (y, dropIndex) {\r\n\r\n\t\tvar store = getStore();\r\n\r\n\t\ty = y || 0;\r\n\r\n\t\tvar index = grid.getItemIndexByTopPosition(y);\r\n\t\tindex = dropIndex < index ? index - 1 : index;\r\n\r\n\t\tif (index > store.countVisible() - 1)\r\n\t\t\treturn null;\r\n\r\n\t\treturn store.getIdByIndex(index);\r\n\t}, gantt);\r\n\tdnd.attachEvent(\"onDragMove\", gantt.bind(function (obj, e) {\r\n\t\tvar gridDataSizes = gantt.$grid_data.getBoundingClientRect();\r\n\t\tvar maxBottom = gridDataSizes.height + gridDataSizes.y + (grid.$state.scrollTop || 0) + window.scrollY;\r\n\t\tvar dd = dnd.config;\r\n\t\tvar pos = dnd._getGridPos(e);\r\n\r\n\t\tgantt._waiAria.reorderMarkerAttr(dd.marker);\r\n\r\n\t\tvar config = grid.$getConfig(),\r\n\t\t\tstore = getStore();\r\n\r\n\t\t// setting position of row\r\n\t\tif (pos.y < maxBottom) {\r\n\t\t\tdd.marker.style.top = pos.y + \"px\";\r\n\t\t} else {\r\n\t\t\tdd.marker.style.top = maxBottom + \"px\";\r\n\t\t}\r\n\t\tdd.marker.style.left = pos.x + 10 + \"px\";\r\n\t\tconst containerSize = domHelpers.getNodePosition(gantt.$root);\r\n\t\tif (pos.width > containerSize.width){\r\n\t\t\tdd.marker.style.width = containerSize.width - 10 - 2 + \"px\";\r\n\t\t\tdd.marker.style.overflow = \"hidden\";\t\r\n\t\t}\r\n\r\n\t\t// highlight row when mouseover\r\n\t\tvar item = store.getItem(dnd.config.id);\r\n\t\tvar targetY = dnd._getTargetY(e);\r\n\t\tvar el = dnd._getTaskByY(targetY, store.getIndexById(item.id));\r\n\r\n\t\tif (!store.exists(el)) {\r\n\t\t\tel = dnd.lastTaskOfLevel(config.order_branch_free ? item.$level : 0);\r\n\t\t\tif (el == dnd.config.id) {\r\n\t\t\t\tel = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction allowedLevel(next, item) {\r\n\t\t\treturn (!(store.isChildOf(over.id, item.id)) && (next.$level == item.$level || config.order_branch_free));\r\n\t\t}\r\n\r\n\t\tif (store.exists(el)) {\r\n\t\t\tvar over = store.getItem(el);\r\n\r\n\t\t\tvar itemTop = grid.getItemTop(over.id);\r\n\t\t\tvar itemHeight = grid.getItemHeight(over.id);\r\n\t\t\tif (itemTop + itemHeight / 2 < targetY) {\r\n\t\t\t\t//hovering over bottom part of item, check can be drop to bottom\r\n\t\t\t\tvar index = store.getIndexById(over.id);\r\n\t\t\t\tvar nextId = store.getNext(over.id);//adds +1 when hovering over placeholder\r\n\t\t\t\tvar next = store.getItem(nextId);\r\n\t\t\t\tif (checkPlaceholderTask(nextId)){\r\n\t\t\t\t\tvar prevId = store.getPrev(next.id);\r\n\t\t\t\t\tnext = store.getItem(prevId);\r\n\t\t\t\t}\r\n\t\t\t\tif (next) {\r\n\t\t\t\t\tif (next.id != item.id) {\r\n\t\t\t\t\t\tover = next; //there is a valid target\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (config.order_branch_free) {\r\n\t\t\t\t\t\t\tif (!(store.isChildOf(item.id, over.id) && store.getChildren(over.id).length == 1))\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tstore.move(item.id, store.getBranchIndex(over.id) + 1, store.getParent(over.id));\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//we at end of the list, check and drop at the end of list\r\n\t\t\t\t\tnextId = store.getIdByIndex(index);\r\n\t\t\t\t\tnext = store.getItem(nextId);\r\n\r\n\t\t\t\t\tif (checkPlaceholderTask(nextId)){\r\n\t\t\t\t\t\tvar prevId = store.getPrev(next.id);\r\n\t\t\t\t\t\tnext = store.getItem(prevId);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (allowedLevel(next, item) && next.id != item.id) {\r\n\t\t\t\t\t\tstore.move(item.id, -1, store.getParent(next.id));\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (config.order_branch_free) {\r\n\t\t\t\tif (over.id != item.id && allowedLevel(over, item) && !checkPlaceholderTask(over.id)) {\r\n\t\t\t\t\tif (!store.hasChild(over.id)) {\r\n\t\t\t\t\t\tover.$open = true;\r\n\t\t\t\t\t\tstore.move(item.id, -1, over.id);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (store.getIndexById(over.id) || itemHeight / 3 < targetY) return;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//if item is on different level, check the one before it\r\n\t\t\tvar index = store.getIndexById(over.id),\r\n\t\t\t\tprevId = store.getIdByIndex(index - 1);\r\n\r\n\t\t\tvar prev = store.getItem(prevId);\r\n\r\n\t\t\tvar shift = 1;\r\n\t\t\twhile ((!prev || prev.id == over.id) && index - shift >= 0) {\r\n\r\n\t\t\t\tprevId = store.getIdByIndex(index - shift);\r\n\t\t\t\tprev = store.getItem(prevId);\r\n\t\t\t\tshift++;\r\n\t\t\t}\r\n\r\n\t\t\tif (item.id == over.id || checkPlaceholderTask(over.id)) return;\r\n\t\t\t//replacing item under cursor\r\n\t\t\tif (allowedLevel(over, item) && item.id != over.id) {\r\n\t\t\t\tstore.move(item.id, 0, 0, over.id);\r\n\r\n\t\t\t} else if (over.$level == item.$level - 1 && !store.getChildren(over.id).length) {\r\n\t\t\t\tstore.move(item.id, 0, over.id);\r\n\r\n\t\t\t} else if (prev && (allowedLevel(prev, item)) && (item.id != prev.id)) {\r\n\t\t\t\tstore.move(item.id, -1, store.getParent(prev.id));\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}, gantt));\r\n\r\n\tdnd.attachEvent(\"onDragEnd\", gantt.bind(function () {\r\n\t\tvar store = getStore();\r\n\t\tvar task = store.getItem(dnd.config.id);\r\n\t\ttask.$transparent = false;\r\n\t\ttask.$open = dnd.config.initial_open_state;\r\n\r\n\t\tif (this.callEvent(\"onBeforeRowDragEnd\", [dnd.config.id, dnd.config.parent, dnd.config.index]) === false) {\r\n\t\t\tstore.move(dnd.config.id, dnd.config.index, dnd.config.parent);\r\n\t\t\ttask.$drop_target = null;\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onRowDragEnd\", [dnd.config.id, task.$drop_target]);\r\n\t\t}\r\n\t\tgantt.render();\r\n\t\tthis.refreshData();\r\n\t}, gantt));\r\n}\r\n\r\nexport default {\r\n\tinit: _init_dnd\r\n};","/**\r\n * The state object for order branch drag and drop\r\n */\r\n\r\nimport * as utils from \"../../../../utils/utils\";\r\n\r\nexport default {\r\n\tcreateDropTargetObject: function createDropTargetObject(parent) {\r\n\t\tvar res = {\r\n\t\t\ttargetParent: null,\r\n\t\t\ttargetIndex: 0,\r\n\t\t\ttargetId: null,\r\n\t\t\tchild: false,\r\n\t\t\tnextSibling: false,\r\n\t\t\tprevSibling: false\r\n\t\t};\r\n\r\n\t\tif (parent) {\r\n\t\t\tutils.mixin(res, parent, true);\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\tnextSiblingTarget: function nextSiblingTarget(dndTaskId, targetTaskId, store) {\r\n\t\tvar result = this.createDropTargetObject();\r\n\t\tresult.targetId = targetTaskId;\r\n\t\tresult.nextSibling = true;\r\n\t\tresult.targetParent = store.getParent(result.targetId);\r\n\t\tresult.targetIndex = store.getBranchIndex(result.targetId);\r\n\t\tif(store.getParent(dndTaskId) != result.targetParent || result.targetIndex < store.getBranchIndex(dndTaskId)){\r\n\t\t\tresult.targetIndex += 1;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprevSiblingTarget: function prevSiblingTarget(dndTaskId, targetTaskId, store) {\r\n\t\tvar result = this.createDropTargetObject();\r\n\t\tresult.targetId = targetTaskId;\r\n\t\tresult.prevSibling = true;\r\n\t\tresult.targetParent = store.getParent(result.targetId);\r\n\t\tresult.targetIndex = store.getBranchIndex(result.targetId);\r\n\t\tif(store.getParent(dndTaskId) == result.targetParent && result.targetIndex > store.getBranchIndex(dndTaskId)){\r\n\t\t\tresult.targetIndex -= 1;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tfirstChildTarget: function firstChildTarget(dndTaskId, targetTaskId, store) {\r\n\t\tvar result = this.createDropTargetObject();\r\n\t\tresult.targetId = targetTaskId;\r\n\t\tresult.targetParent = result.targetId;\r\n\t\tresult.targetIndex = 0;\r\n\t\tresult.child = true;\r\n\t\treturn result;\r\n\t},\r\n\tlastChildTarget: function lastChildTarget(dndTaskId, targetTaskId, store) {\r\n\t\tvar children = store.getChildren(targetTaskId);\r\n\t\tvar result = this.createDropTargetObject();\r\n\t\tresult.targetId = children[children.length - 1];\r\n\t\tresult.targetParent = targetTaskId;\r\n\t\tresult.targetIndex = children.length;\r\n\t\tresult.nextSibling = true;\r\n\t\treturn result;\r\n\t}\r\n};","/**\r\n * resolve dnd position of the task when gantt.config.order_branch_free = false\r\n */\r\n\r\nimport dropTarget from \"./drop_target\";\r\n\r\nfunction getLast(store){\r\n\tvar current = store.getNext();\r\n\twhile(store.exists(current)){\r\n\r\n\t\tvar next = store.getNext(current);\r\n\t\tif(!store.exists(next)){\r\n\t\t\treturn current;\r\n\t\t}else{\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction findClosesTarget(dndTaskId, taskId, allowedLevel, store, up){\r\n\tvar prev = taskId;\r\n\twhile(store.exists(prev)){\r\n\t\tvar targetLevel = store.calculateItemLevel(store.getItem(prev));\r\n\t\tif((targetLevel === allowedLevel || targetLevel === (allowedLevel - 1)) && store.getBranchIndex(prev) > -1){\r\n\t\t\tbreak;\r\n\t\t}else {\r\n\t\t\tprev = up ? store.getPrev(prev) : store.getNext(prev);\r\n\t\t}\r\n\t}\r\n\r\n\tif(store.exists(prev)){\r\n\t\tif(store.calculateItemLevel(store.getItem(prev)) === allowedLevel){\r\n\t\t\treturn up ? dropTarget.nextSiblingTarget(dndTaskId, prev, store) : dropTarget.prevSiblingTarget(dndTaskId, prev, store);\r\n\t\t}else{\r\n\t\t\treturn dropTarget.firstChildTarget(dndTaskId, prev, store);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction findTargetAbove(dndTaskId, taskId, allowedLevel, store){\r\n\treturn findClosesTarget(dndTaskId, taskId, allowedLevel, store, true);\r\n}\r\nfunction findTargetBelow(dndTaskId, taskId, allowedLevel, store){\r\n\treturn findClosesTarget(dndTaskId, taskId, allowedLevel, store, false);\r\n}\r\n\r\nexport default function getSameLevelDropPosition(dndTaskId, targetTaskId, relTargetPos, eventTop, store, level){\r\n\tvar result;\r\n\tif(targetTaskId !== store.$getRootId()){\r\n\t\tvar targetTask = store.getItem(targetTaskId);\r\n\t\tvar targetLevel = store.calculateItemLevel(targetTask);\r\n\t\tif(targetLevel === level){\r\n\t\t\tvar prevSibling = store.getPrevSibling(targetTaskId);\r\n\t\t\tif(relTargetPos < 0.5 && !prevSibling){\r\n\t\t\t\tresult = dropTarget.prevSiblingTarget(dndTaskId, targetTaskId, store);\r\n\t\t\t}else{\r\n\t\t\t\tif(relTargetPos < 0.5){\r\n\t\t\t\t\ttargetTaskId = prevSibling;\r\n\t\t\t\t}\r\n\t\t\t\tresult = dropTarget.nextSiblingTarget(dndTaskId, targetTaskId, store);\r\n\t\t\t}\r\n\t\t}else if(targetLevel > level){\r\n\t\t\tstore.eachParent(function(parent){\r\n\t\t\t\tif(store.calculateItemLevel(parent) === level){\r\n\t\t\t\t\ttargetTaskId = parent.id;\r\n\t\t\t\t}\r\n\t\t\t}, targetTask); \r\n\t\t\tresult = findTargetAbove(dndTaskId, targetTaskId, level, store);\r\n\t\t}else{\r\n\t\t\tvar targetAbove = findTargetAbove(dndTaskId, targetTaskId, level, store);\r\n\t\t\tvar targetBelow = findTargetBelow(dndTaskId, targetTaskId, level, store);\r\n\t\t\tresult = (relTargetPos < 0.5) ? targetAbove : targetBelow;\r\n\t\t}\r\n\t}else{\r\n\t\tvar rootId = store.$getRootId();\r\n\t\tvar rootLevel = store.getChildren(rootId);\r\n\t\tresult = dropTarget.createDropTargetObject();\r\n\t\tif(rootLevel.length && eventTop >= 0){\r\n\t\t\tresult = findTargetAbove(dndTaskId, getLast(store), level, store);\r\n\t\t}else{\r\n\t\t\tresult = findTargetBelow(dndTaskId, rootId, level, store);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n","import * as domHelpers from \"../../utils/dom_helpers\";\r\n\r\n/**\r\n * methods for highlighting current drag and drop position\r\n */\r\n\r\nfunction highlightPosition(target, root, grid){\r\n\tvar markerPos = getTaskMarkerPosition(target, grid);\r\n\t// setting position of row\r\n\troot.marker.style.left = markerPos.x + 9 + \"px\";\r\n\troot.marker.style.width = markerPos.width + \"px\";\r\n\troot.marker.style.overflow = \"hidden\";\r\n\tvar markerLine = root.markerLine;\r\n\tif(!markerLine){\r\n\t\tmarkerLine = document.createElement(\"div\");\r\n\t\tmarkerLine.className = \"gantt_drag_marker gantt_grid_dnd_marker\";\r\n\t\tmarkerLine.innerHTML = \"
\";\r\n\t\tmarkerLine.style.pointerEvents = \"none\";\r\n\t}\r\n\r\n\tif(target.child){\r\n\t\thighlightFolder(target, markerLine, grid);\r\n\t}else{\r\n\t\thighlightRow(target, markerLine, grid);\r\n\t}\r\n\r\n\tif(!root.markerLine){\r\n\t\tdocument.body.appendChild(markerLine);\r\n\t\troot.markerLine = markerLine;\r\n\t}\r\n}\r\n\r\nfunction removeLineHighlight(root){\r\n\tif(root.markerLine && root.markerLine.parentNode){\r\n\t\troot.markerLine.parentNode.removeChild(root.markerLine);\r\n\t}\r\n\troot.markerLine = null;\r\n}\r\n\r\nfunction highlightRow(target, markerLine, grid){\r\n\tvar linePos = getLineMarkerPosition(target, grid);\r\n\tvar maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY;\r\n\r\n\tmarkerLine.innerHTML = \"
\";\r\n\tmarkerLine.style.left = linePos.x + \"px\";\r\n\tmarkerLine.style.height = \"4px\";\r\n\r\n\tvar markerLineTop = linePos.y - 2;\r\n\tmarkerLine.style.top = markerLineTop + \"px\";\r\n\tmarkerLine.style.width = linePos.width + \"px\";\r\n\r\n\tif (markerLineTop > maxBottom) {\r\n\t\tmarkerLine.style.top = maxBottom + 'px';\r\n\t}\r\n\r\n\treturn markerLine;\r\n}\r\nfunction highlightFolder(target, markerFolder, grid){\r\n\tvar id = target.targetParent;\r\n\tvar pos = gridToPageCoordinates({x: 0, y: grid.getItemTop(id)}, grid);\r\n\tvar maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY;\r\n\r\n\tlet folderHighlightWidth = setWidthWithinContainer(grid.$gantt, grid.$grid_data.offsetWidth);\t\r\n\r\n\tmarkerFolder.innerHTML = \"
\";\r\n\tmarkerFolder.style.width = folderHighlightWidth + \"px\";\r\n\tmarkerFolder.style.top = pos.y + \"px\";\r\n\tmarkerFolder.style.left = pos.x + \"px\";\r\n\tmarkerFolder.style.height = grid.getItemHeight(id) + \"px\";\r\n\tif (pos.y > maxBottom) {\r\n\t\tmarkerFolder.style.top = maxBottom + 'px';\r\n\t}\r\n\r\n\treturn markerFolder;\r\n}\r\n\r\nfunction getLineMarkerPosition(target, grid){\r\n\tvar store = grid.$config.rowStore;\r\n\tvar pos = {x:0, y:0};\r\n\tvar indentNode = grid.$grid_data.querySelector(\".gantt_tree_indent\");\r\n\tvar indent = 15;\r\n\tvar level = 0;\r\n\tif(indentNode){\r\n\t\tindent = indentNode.offsetWidth;\r\n\t}\r\n\tvar iconWidth = 40;\r\n\tif(target.targetId !== store.$getRootId()){\r\n\t\tvar itemTop = grid.getItemTop(target.targetId);\r\n\t\tvar itemHeight = grid.getItemHeight(target.targetId);\r\n\t\tlevel = store.exists(target.targetId) ? store.calculateItemLevel(store.getItem(target.targetId)) : 0;\r\n\r\n\t\tif(target.prevSibling){\r\n\t\t\tpos.y = itemTop;\r\n\t\t}else if(target.nextSibling){\r\n\t\t\tvar childCount = 0;\r\n\t\t\tstore.eachItem(function(child){\r\n\t\t\t\tif(store.getIndexById(child.id) !== -1)\r\n\t\t\t\t\tchildCount++;\r\n\t\t\t}, target.targetId);\r\n\r\n\t\t\tpos.y = itemTop + itemHeight + childCount*itemHeight;\r\n\t\t}else {\r\n\t\t\tpos.y = itemTop + itemHeight;\r\n\t\t\tlevel += 1;\r\n\t\t}\r\n\t}\r\n\tpos.x = iconWidth + level * indent;\r\n\tpos.width = setWidthWithinContainer(grid.$gantt, Math.max(grid.$grid_data.offsetWidth - pos.x, 0), pos.x);\r\n\treturn gridToPageCoordinates(pos, grid);\r\n}\r\n\r\nfunction gridToPageCoordinates(pos, grid){\r\n\tvar gridPos = domHelpers.getNodePosition(grid.$grid_data);\r\n\tpos.x += gridPos.x + grid.$grid.scrollLeft;\r\n\tpos.y += gridPos.y - grid.$grid_data.scrollTop;\r\n\treturn pos;\r\n}\r\n\r\nfunction getTaskMarkerPosition(e, grid) {\r\n\tvar pos = domHelpers.getNodePosition(grid.$grid_data);\r\n\tvar ePos = domHelpers.getRelativeEventPosition(e, grid.$grid_data);\r\n\t// row offset\r\n\tvar x = pos.x + grid.$grid.scrollLeft;\r\n\tvar y = ePos.y - 10;\r\n\r\n\tvar rowHeight = grid.getItemHeight(e.targetId);\r\n\t// prevent moving row out of grid_data container\r\n\tif (y < pos.y) y = pos.y;\r\n\tvar gridHeight = grid.getTotalHeight();\r\n\tif (y > pos.y + gridHeight - rowHeight) y = pos.y + gridHeight - rowHeight;\r\n\r\n\tpos.x = x;\r\n\tpos.y = y;\r\n\tpos.width = setWidthWithinContainer(grid.$gantt, pos.width, 9);\r\n\treturn pos;\r\n}\r\n\r\nfunction setWidthWithinContainer(gantt, width, offset = 0){\r\n\tconst containerSize = domHelpers.getNodePosition(gantt.$root);\r\n\tif (width > containerSize.width){\r\n\t\twidth = containerSize.width - offset - 2;\r\n\t}\r\n\treturn width;\r\n}\r\n\r\nexport default {\r\n\tremoveLineHighlight: removeLineHighlight,\r\n\thighlightPosition: highlightPosition\r\n};\r\n","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport dropTarget from \"./tasks_grid_dnd_marker_helpers/drop_target\";\r\nimport getLockedLevelTarget from \"./tasks_grid_dnd_marker_helpers/locked_level\";\r\nimport getMultiLevelTarget from \"./tasks_grid_dnd_marker_helpers/multi_level\";\r\nimport higlighter from \"./tasks_grid_dnd_marker_helpers/highlight\";\r\nimport isPlaceholderTask from \"../../../utils/placeholder_task\";\r\n\r\nfunction _init_dnd(gantt, grid) {\r\n\tvar DnD = gantt.$services.getService(\"dnd\");\r\n\r\n\tif(!grid.$config.bind || !gantt.getDatastore(grid.$config.bind)){\r\n\t\treturn;\r\n\t}\r\n\r\n\tfunction locate(e){\r\n\t\treturn domHelpers.locateAttribute(e, grid.$config.item_attribute);\r\n\t}\r\n\r\n\tfunction getStore(){\r\n\t\treturn gantt.getDatastore(grid.$config.bind);\r\n\t}\r\n\r\n\tfunction checkPlaceholderTask(id){\r\n\t\treturn isPlaceholderTask(id, gantt, getStore());\r\n\t}\r\n\r\n\tvar dnd = new DnD(grid.$grid_data, {updates_per_second: 60});\r\n\tif (gantt.defined(grid.$getConfig().dnd_sensitivity))\r\n\t\tdnd.config.sensitivity = grid.$getConfig().dnd_sensitivity;\r\n\r\n\tdnd.attachEvent(\"onBeforeDragStart\", gantt.bind(function (obj, e) {\r\n\t\tvar el = locate(e);\r\n\t\tif (!el) return false;\r\n\t\tif (gantt.hideQuickInfo) gantt.hideQuickInfo();\r\n\t\tif (domHelpers.closest(e.target, \".gantt_grid_editor_placeholder\")){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar id = el.getAttribute(grid.$config.item_attribute);\r\n\t\tvar datastore = grid.$config.rowStore;\r\n\t\tvar task = datastore.getItem(id);\r\n\r\n\t\tif (gantt.isReadonly(task) || checkPlaceholderTask(id))\r\n\t\t\treturn false;\r\n\r\n\t\tdnd.config.initial_open_state = task.$open;\r\n\t\tif (!gantt.callEvent(\"onRowDragStart\", [id, e.target || e.srcElement, e])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}, gantt));\r\n\r\n\tdnd.attachEvent(\"onAfterDragStart\", gantt.bind(function (obj, e) {\r\n\t\tvar el = locate(e);\r\n\r\n\t\tdnd.config.marker.innerHTML = el.outerHTML;\r\n\t\tvar element = dnd.config.marker.firstChild;\r\n\t\tif(element){\r\n\t\t\tdnd.config.marker.style.opacity = 0.4;\r\n\t\t\telement.style.position = \"static\";\r\n\t\t\telement.style.pointerEvents = \"none\";\r\n\t\t}\r\n\r\n\t\tdnd.config.id = el.getAttribute(grid.$config.item_attribute);\r\n\r\n\t\tvar store = grid.$config.rowStore;\r\n\r\n\t\tvar task = store.getItem(dnd.config.id);\r\n\t\tdnd.config.level = store.calculateItemLevel(task);\r\n\t\tdnd.config.drop_target = dropTarget.createDropTargetObject({\r\n\t\t\ttargetParent: store.getParent(task.id),\r\n\t\t\ttargetIndex: store.getBranchIndex(task.id),\r\n\t\t\ttargetId: task.id,\r\n\t\t\tnextSibling: true\r\n\t\t});\r\n\r\n\t\ttask.$open = false;\r\n\t\ttask.$transparent = true;\r\n\t\tthis.refreshData();\r\n\t}, gantt));\r\n\r\n\tfunction getTargetTaskId(e){\r\n\t\tvar y = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;\r\n\t\tvar store = grid.$config.rowStore;\r\n\r\n\t\tif (!document.doctype){\r\n\t\t\ty += window.scrollY;\r\n\t\t}\r\n\t\ty = y || 0;\r\n\r\n\t\t// limits for the marker according to the layout layer\r\n\t\tvar scrollPos = grid.$state.scrollTop || 0;\r\n\t\tvar maxBottom = gantt.$grid_data.getBoundingClientRect().height + scrollPos + window.scrollY;\r\n\t\tvar minTop = scrollPos;\r\n\r\n\t\tvar firstVisibleTaskIndex = grid.getItemIndexByTopPosition(grid.$state.scrollTop);\r\n\t\tif (!store.exists(firstVisibleTaskIndex)){\r\n\t\t\tfirstVisibleTaskIndex = store.countVisible() - 1;\r\n\t\t}\r\n\t\tif (firstVisibleTaskIndex < 0) {\r\n\t\t\treturn store.$getRootId();\r\n\t\t}\r\n\r\n\t\tvar firstVisibleTaskId = store.getIdByIndex(firstVisibleTaskIndex);\r\n\r\n\t\tvar firstVisibleTaskPos = grid.$state.scrollTop / grid.getItemHeight(firstVisibleTaskId);\r\n\t\tvar hiddenTaskPart = firstVisibleTaskPos - Math.floor(firstVisibleTaskPos);\r\n\t\tif (hiddenTaskPart > 0.1 && hiddenTaskPart < 0.9) {\r\n\t\t\tmaxBottom = maxBottom - grid.getItemHeight(firstVisibleTaskId) * hiddenTaskPart;\r\n\t\t\tminTop = minTop + grid.getItemHeight(firstVisibleTaskId) * (1 - hiddenTaskPart);\r\n\t\t}\r\n\r\n\t\t// GS-715. The placeholder task row shouldn't be draggable below the Gantt container\r\n\t\tconst gridPosition = domHelpers.getNodePosition(grid.$grid_data);\r\n\t\tconst gridBottom = gridPosition.y + gridPosition.height;\r\n\t\tconst placeholderRowHeight = dnd.config.marker.offsetHeight;\r\n\t\tif (y + placeholderRowHeight + window.scrollY >= maxBottom){\r\n\t\t\tdnd.config.marker.style.top = gridBottom - placeholderRowHeight\t+ \"px\";\r\n\t\t}\r\n\r\n\t\tif (y >= maxBottom) {\r\n\t\t\ty = maxBottom;\r\n\t\t} else if (y <= minTop) {\r\n\t\t\ty = minTop;\r\n\t\t\tdnd.config.marker.style.top = gridPosition.y + \"px\";\r\n\t\t}\r\n\r\n\t\tvar index = grid.getItemIndexByTopPosition(y);\r\n\r\n\t\tif (index > store.countVisible() - 1 || index < 0) {\r\n\t\t\treturn store.$getRootId();\r\n\t\t}\r\n\r\n\t\tvar targetId = store.getIdByIndex(index);\r\n\t\tif (checkPlaceholderTask(targetId)) {\r\n\t\t\treturn store.getPrevSibling(targetId);\r\n\t\t}\r\n\r\n\t\treturn store.getIdByIndex(index);\r\n\t}\r\n\r\n\tfunction getDropPosition(e){\r\n\t\tvar targetTaskId = getTargetTaskId(e);\r\n\t\tvar relTargetPos = null;\r\n\t\tvar store = grid.$config.rowStore;\r\n\t\tvar config = grid.$getConfig();\r\n\t\tvar lockLevel = !config.order_branch_free;\r\n\r\n\t\tvar eventTop = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;\r\n\t\tif (!document.doctype){\r\n\t\t\teventTop += window.scrollY;\r\n\t\t}\r\n\r\n\t\tif(targetTaskId !== store.$getRootId()) {\r\n\t\t\tvar rowTop = grid.getItemTop(targetTaskId);\r\n\t\t\tvar rowHeight = grid.getItemHeight(targetTaskId);\r\n\t\t\trelTargetPos = (eventTop - rowTop) / rowHeight;\r\n\t\t}\r\n\r\n\t\tvar result;\r\n\t\tif(!lockLevel){\r\n\t\t\tresult = getMultiLevelTarget(dnd.config.id, targetTaskId, relTargetPos, eventTop, store);\r\n\t\t}else{\r\n\t\t\tresult = getLockedLevelTarget(dnd.config.id, targetTaskId, relTargetPos, eventTop, store, dnd.config.level);\r\n\t\t\tif(result && result.targetParent && checkPlaceholderTask(result.targetParent)){\r\n\t\t\t\ttargetTaskId = store.getPrevSibling(result.targetParent);\r\n\t\t\t\tresult = getLockedLevelTarget(dnd.config.id, targetTaskId, relTargetPos, eventTop, store, dnd.config.level);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tdnd.attachEvent(\"onDragMove\", gantt.bind(function (obj, e) {\r\n\t\tvar target = getDropPosition(e);\r\n\r\n\t\tif(!target ||\r\n\t\t\tgantt.callEvent(\"onBeforeRowDragMove\", [dnd.config.id, target.targetParent, target.targetIndex]) === false){\r\n\t\t\t\ttarget = dropTarget.createDropTargetObject(dnd.config.drop_target);\r\n\t\t\t}\r\n\r\n\t\thiglighter.highlightPosition(target, dnd.config, grid);\r\n\t\tdnd.config.drop_target = target;\r\n\t\tgantt._waiAria.reorderMarkerAttr(dnd.config.marker);\r\n\r\n\t\tthis.callEvent(\"onRowDragMove\", [dnd.config.id, target.targetParent, target.targetIndex]);\r\n\t\treturn true;\r\n\t}, gantt));\r\n\r\n\tdnd.attachEvent(\"onDragEnd\", gantt.bind(function () {\r\n\t\tvar store = grid.$config.rowStore;\r\n\t\tvar task = store.getItem(dnd.config.id);\r\n\r\n\t\thiglighter.removeLineHighlight(dnd.config);\r\n\r\n\t\ttask.$transparent = false;\r\n\t\ttask.$open = dnd.config.initial_open_state;\r\n\t\tvar target = dnd.config.drop_target;\r\n\r\n\t\tif (this.callEvent(\"onBeforeRowDragEnd\", [dnd.config.id, target.targetParent, target.targetIndex]) === false) {\r\n\t\t\ttask.$drop_target = null;\r\n\t\t} else {\r\n\t\t\tstore.move(dnd.config.id, target.targetIndex, target.targetParent);\r\n\t\t\tgantt.render();\r\n\t\t\tthis.callEvent(\"onRowDragEnd\", [dnd.config.id, target.targetParent, target.targetIndex]);\r\n\t\t}\r\n\t\tstore.refresh(task.id);\r\n\t}, gantt));\r\n}\r\n\r\nexport default {\r\n\tinit: _init_dnd\r\n};","/**\r\n * resolve dnd position of the task when gantt.config.order_branch_free = true\r\n */\r\n\r\nimport dropTarget from \"./drop_target\";\r\n\r\nexport default function getMultiLevelDropPosition(dndTaskId, targetTaskId, relTargetPos, eventTop, store){\r\n\tvar result;\r\n\r\n\tif(targetTaskId !== store.$getRootId()){\r\n\t\tif(relTargetPos < 0.25){\r\n\t\t\tresult = dropTarget.prevSiblingTarget(dndTaskId, targetTaskId, store);\r\n\t\t}else if(relTargetPos > 0.60 && !(store.hasChild(targetTaskId) && store.getItem(targetTaskId).$open)){\r\n\t\t\tresult = dropTarget.nextSiblingTarget(dndTaskId, targetTaskId, store);\r\n\t\t}else {\r\n\t\t\tresult = dropTarget.firstChildTarget(dndTaskId, targetTaskId, store);\r\n\t\t}\r\n\t}else{\r\n\t\tvar rootId = store.$getRootId();\r\n\t\tif(store.hasChild(rootId) && eventTop >= 0){\r\n\t\t\tresult = dropTarget.lastChildTarget(dndTaskId, rootId, store);\r\n\t\t}else{\r\n\t\t\tresult = dropTarget.firstChildTarget(dndTaskId, rootId, store);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};","import * as utils from \"../../../utils/utils\";\r\nimport rowDnd from \"./tasks_grid_dnd\";\r\nimport rowDndMarker from \"./tasks_grid_dnd_marker\";\r\nimport mouseEventContainer from \"../mouse_event_container\";\r\n\r\nvar initializer = (function(){\r\n\treturn function(gantt){\r\n\t\treturn {\r\n\t\t\tonCreated: function (grid) {\r\n\t\t\t\tgrid.$config = utils.mixin(grid.$config, {\r\n\t\t\t\t\tbind: \"task\"\r\n\t\t\t\t});\r\n\t\t\t\tif(grid.$config.id == \"grid\") {\r\n\t\t\t\t\tthis.extendGantt(grid);\r\n\t\t\t\t\tgantt.ext.inlineEditors = gantt.ext._inlineEditors.createEditors(grid);\r\n\t\t\t\t\tgantt.ext.inlineEditors.init();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._mouseDelegates = mouseEventContainer(gantt);\r\n\t\t\t},\r\n\t\t\tonInitialized: function (grid) {\r\n\t\t\t\tvar config = grid.$getConfig();\r\n\t\t\t\tif (config.order_branch) {\r\n\t\t\t\t\tif(config.order_branch == \"marker\"){\r\n\t\t\t\t\t\trowDndMarker.init(grid.$gantt, grid);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trowDnd.init(grid.$gantt, grid);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.initEvents(grid, gantt);\r\n\t\t\t\tif(grid.$config.id == \"grid\") {\r\n\t\t\t\t\tthis.extendDom(grid);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonDestroyed: function (grid) {\r\n\t\t\t\tif(grid.$config.id == \"grid\") {\r\n\t\t\t\t\tgantt.ext.inlineEditors.destructor();\r\n\t\t\t\t}\r\n\t\t\t\tthis.clearEvents(grid, gantt);\r\n\t\t\t},\r\n\r\n\t\t\tinitEvents: function (grid, gantt) {\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_row\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar config = grid.$getConfig();\r\n\t\t\t\t\tif (id !== null) {\r\n\t\t\t\t\t\tvar task = this.getTask(id);\r\n\t\t\t\t\t\tif (config.scroll_on_click && !gantt._is_icon_open_click(e))\r\n\t\t\t\t\t\t\tthis.showDate(task.start_date);\r\n\t\t\t\t\t\tgantt.callEvent(\"onTaskRowClick\", [id, trg]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, gantt), grid.$grid);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_grid_head_cell\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar column = trg.getAttribute(\"data-column-id\");\r\n\r\n\t\t\t\t\tif (!gantt.callEvent(\"onGridHeaderClick\", [column, e]))\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\tvar config = grid.$getConfig();\r\n\r\n\t\t\t\t\tif (column == \"add\") {\r\n\t\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\r\n\t\t\t\t\t\tmouseEvents.callHandler(\"click\", \"gantt_add\", grid.$grid, [e, config.root_id]);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (config.sort && column) { // GS-929: if there is no column name, we cannot sort the column\r\n\t\t\t\t\t\tvar sorting_method = column,\r\n\t\t\t\t\t\t\tconf;\r\n\r\n\t\t\t\t\t\tfor (var i = 0; i < config.columns.length; i++) {\r\n\t\t\t\t\t\t\tif (config.columns[i].name == column) {\r\n\t\t\t\t\t\t\t\tconf = config.columns[i];\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (conf && conf.sort !== undefined && conf.sort !== true) {\r\n\t\t\t\t\t\t\tsorting_method = conf.sort;\r\n\r\n\t\t\t\t\t\t\tif (!sorting_method) { // column sort property 'false', no sorting\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar sort = (this._sort && this._sort.direction && this._sort.name == column) ? this._sort.direction : \"desc\";\r\n\t\t\t\t\t\t// invert sort direction\r\n\t\t\t\t\t\tsort = (sort == \"desc\") ? \"asc\" : \"desc\";\r\n\t\t\t\t\t\tthis._sort = {\r\n\t\t\t\t\t\t\tname: column,\r\n\t\t\t\t\t\t\tdirection: sort\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tthis.sort(sorting_method, sort == \"desc\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}, gantt), grid.$grid);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_add\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar config = grid.$getConfig();\r\n\t\t\t\t\tif (config.readonly) return;\r\n\r\n\t\t\t\t\tvar item = {};\r\n\t\t\t\t\tthis.createTask(item, id ? id : gantt.config.root_id);\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}, gantt), grid.$grid);\r\n\r\n\t\t\t},\r\n\r\n\t\t\tclearEvents: function(grid, gantt){\r\n\t\t\t\tthis._mouseDelegates.destructor();\r\n\t\t\t\tthis._mouseDelegates = null;\r\n\t\t\t},\r\n\r\n\t\t\textendDom: function(grid){\r\n\t\t\t\tgantt.$grid = grid.$grid;\r\n\t\t\t\tgantt.$grid_scale = grid.$grid_scale;\r\n\t\t\t\tgantt.$grid_data = grid.$grid_data;\r\n\t\t\t},\r\n\t\t\textendGantt: function(grid){\r\n\t\t\t\tgantt.getGridColumns = gantt.bind(grid.getGridColumns, grid);\r\n\r\n\t\t\t\tgrid.attachEvent(\"onColumnResizeStart\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResizeStart\", arguments);\r\n\t\t\t\t});\r\n\t\t\t\tgrid.attachEvent(\"onColumnResize\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResize\", arguments);\r\n\t\t\t\t});\r\n\t\t\t\tgrid.attachEvent(\"onColumnResizeEnd\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onColumnResizeEnd\", arguments);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tgrid.attachEvent(\"onColumnResizeComplete\", function(columns, totalWidth){\r\n\t\t\t\t\tgantt.config.grid_width = totalWidth;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tgrid.attachEvent(\"onBeforeRowResize\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onBeforeRowResize\", arguments);\r\n\t\t\t\t});\r\n\t\t\t\tgrid.attachEvent(\"onRowResize\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onRowResize\", arguments);\r\n\t\t\t\t});\r\n\t\t\t\tgrid.attachEvent(\"onBeforeRowResizeEnd\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onBeforeRowResizeEnd\", arguments);\r\n\t\t\t\t});\r\n\t\t\t\tgrid.attachEvent(\"onAfterRowResize\", function(){\r\n\t\t\t\t\treturn gantt.callEvent(\"onAfterRowResize\", arguments);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n})();\r\n\r\nexport default initializer;","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport * as utils from \"../../../utils/utils\";\r\nimport timeout from \"../../../utils/timeout\";\r\nimport * as helpers from \"../../../utils/helpers\";\r\n\r\nfunction createTaskDND(timeline, gantt) {\r\n\tvar services = gantt.$services;\r\n\treturn {\r\n\t\tdrag: null,\r\n\t\tdragMultiple: {},\r\n\t\t_events: {\r\n\t\t\tbefore_start: {},\r\n\t\t\tbefore_finish: {},\r\n\t\t\tafter_finish: {}\r\n\t\t},\r\n\t\t_handlers: {},\r\n\t\tinit: function() {\r\n\t\t\tthis._domEvents = gantt._createDomEventScope();\r\n\t\t\tthis.clear_drag_state();\r\n\t\t\tvar drag = gantt.config.drag_mode;\r\n\t\t\tthis.set_actions();\r\n\r\n\t\t\tvar stateService = services.getService(\"state\");\r\n\t\t\tstateService.registerProvider(\"tasksDnd\", utils.bind(function() {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tdrag_id : this.drag ? this.drag.id : undefined,\r\n\t\t\t\t\tdrag_mode : this.drag ? this.drag.mode : undefined,\r\n\t\t\t\t\tdrag_from_start : this.drag ? this.drag.left : undefined\r\n\t\t\t\t};\r\n\t\t\t}, this));\r\n\r\n\t\t\tvar evs = {\r\n\t\t\t\t\"before_start\": \"onBeforeTaskDrag\",\r\n\t\t\t\t\"before_finish\": \"onBeforeTaskChanged\",\r\n\t\t\t\t\"after_finish\": \"onAfterTaskDrag\"\r\n\t\t\t};\r\n\t\t\t//for now, all drag operations will trigger the same events\r\n\t\t\tfor (var stage in this._events) {\r\n\t\t\t\tfor (var mode in drag) {\r\n\t\t\t\t\tthis._events[stage][mode] = evs[stage];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._handlers[drag.move] = this._move;\r\n\t\t\tthis._handlers[drag.resize] = this._resize;\r\n\t\t\tthis._handlers[drag.progress] = this._resize_progress;\r\n\t\t},\r\n\t\tset_actions: function() {\r\n\t\t\tvar data = timeline.$task_data;\r\n\t\t\tthis._domEvents.attach(data, \"mousemove\", gantt.bind(function(e) {\r\n\t\t\t\tthis.on_mouse_move(e);\r\n\t\t\t}, this));\r\n\t\t\tthis._domEvents.attach(data, \"mousedown\", gantt.bind(function(e) {\r\n\t\t\t\tthis.on_mouse_down(e);\r\n\t\t\t}, this));\r\n\t\t\tthis._domEvents.attach(document.body, \"mouseup\", gantt.bind(function(e) {\r\n\t\t\t\tthis.on_mouse_up(e);\r\n\t\t\t}, this));\r\n\t\t},\r\n\r\n\t\tclear_drag_state: function() {\r\n\t\t\tthis.drag = {\r\n\t\t\t\tid: null,\r\n\t\t\t\tmode: null,\r\n\t\t\t\tpos: null,\r\n\t\t\t\tstart_x: null,\r\n\t\t\t\tstart_y: null,\r\n\t\t\t\tobj: null,\r\n\t\t\t\tleft: null\r\n\t\t\t};\r\n\t\t\tthis.dragMultiple = {};\r\n\t\t},\r\n\t\t_resize: function(task, shift, drag) {\r\n\t\t\tvar cfg = timeline.$getConfig();\r\n\t\t\tvar coords_x = this._drag_task_coords(task, drag);\r\n\t\t\tif (drag.left) {\r\n\t\t\t\ttask.start_date = gantt.dateFromPos(coords_x.start + shift);\r\n\t\t\t\tif (!task.start_date) {\r\n\t\t\t\t\ttask.start_date = new Date(gantt.getState().min_date);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttask.end_date = gantt.dateFromPos(coords_x.end + shift);\r\n\t\t\t\tif (!task.end_date) {\r\n\t\t\t\t\ttask.end_date = new Date(gantt.getState().max_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar minDurationInUnits = this._calculateMinDuration(cfg.min_duration, cfg.duration_unit);\r\n\t\t\tif (task.end_date - task.start_date < cfg.min_duration) {\r\n\t\t\t\tif (drag.left)\r\n\t\t\t\t\ttask.start_date = gantt.calculateEndDate(task.end_date, -minDurationInUnits, cfg.duration_unit, task);\r\n\t\t\t\telse\r\n\t\t\t\t\ttask.end_date = gantt.calculateEndDate(task.start_date, minDurationInUnits, cfg.duration_unit, task);\r\n\t\t\t}\r\n\t\t\tgantt._init_task_timing(task);\r\n\t\t},\r\n\t\t_calculateMinDuration: function(duration, unit) {\r\n\t\t\tvar inMs = {\r\n\t\t\t\t\"minute\": 60000,\r\n\t\t\t\t\"hour\": 3600000,\r\n\t\t\t\t\"day\": 86400000,\r\n\t\t\t\t\"week\": 604800000,\r\n\t\t\t\t\"month\": 2419200000,\r\n\t\t\t\t\"year\": 31356000000\r\n\t\t\t};\r\n\t\t\treturn Math.ceil(duration / inMs[unit]);\r\n\t\t},\r\n\t\t_resize_progress: function(task, shift, drag) {\r\n\t\t\tvar coords_x = this._drag_task_coords(task, drag);\r\n\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tvar diffValue = !config.rtl ? (drag.pos.x - coords_x.start) : (coords_x.start - drag.pos.x);\r\n\r\n\t\t\tvar diff = Math.max(0, diffValue);\r\n\t\t\ttask.progress = Math.min(1, diff / Math.abs(coords_x.end - coords_x.start));\r\n\t\t},\r\n\t\t_find_max_shift: function(dragItems, shift) {\r\n\t\t\tvar correctShift;\r\n\t\t\tfor (var i in dragItems) {\r\n\t\t\t\tvar drag = dragItems[i];\r\n\t\t\t\tvar task = gantt.getTask(drag.id);\r\n\r\n\t\t\t\tvar coords_x = this._drag_task_coords(task, drag);\r\n\t\t\t\tvar minX = gantt.posFromDate(new Date(gantt.getState().min_date));\r\n\t\t\t\tvar maxX = gantt.posFromDate(new Date(gantt.getState().max_date));\r\n\r\n\t\t\t\tif (coords_x.end + shift > maxX) {\r\n\t\t\t\t\tvar maxShift = maxX - coords_x.end;\r\n\t\t\t\t\tif (maxShift < correctShift || correctShift === undefined) {\r\n\t\t\t\t\t\tcorrectShift = maxShift;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (coords_x.start + shift < minX) {\r\n\t\t\t\t\tvar minShift = minX - coords_x.start;\r\n\t\t\t\t\tif (minShift > correctShift || correctShift === undefined) {\r\n\t\t\t\t\t\tcorrectShift = minShift;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn correctShift;\r\n\t\t},\r\n\t\t_move: function(task, shift, drag, multipleDragShift) {\r\n\t\t\tvar coords_x = this._drag_task_coords(task, drag);\r\n\t\t\tvar new_start = null,\r\n\t\t\tnew_end = null;\r\n\t\t\t// GS-454: If we drag multiple tasks, rely on the dates instead of timeline coordinates\r\n\t\t\tif (multipleDragShift){\r\n\t\t\t\tnew_start = new Date(+drag.obj.start_date + multipleDragShift),\r\n\t\t\t\tnew_end = new Date(+drag.obj.end_date + multipleDragShift);\r\n\t\t\t} else {\r\n\t\t\t\tnew_start = gantt.dateFromPos(coords_x.start + shift),\r\n\t\t\t\tnew_end = gantt.dateFromPos(coords_x.end + shift);\r\n\t\t\t}\r\n\t\t\tif (!new_start) {\r\n\t\t\t\ttask.start_date = new Date(gantt.getState().min_date);\r\n\t\t\t\ttask.end_date = gantt.dateFromPos(gantt.posFromDate(task.start_date) + (coords_x.end - coords_x.start));\r\n\t\t\t} else if (!new_end) {\r\n\t\t\t\ttask.end_date = new Date(gantt.getState().max_date);\r\n\t\t\t\ttask.start_date = gantt.dateFromPos(gantt.posFromDate(task.end_date) - (coords_x.end - coords_x.start));\r\n\t\t\t} else {\r\n\t\t\t\ttask.start_date = new_start;\r\n\t\t\t\ttask.end_date = new_end;\r\n\t\t\t}\r\n\t\t},\r\n\t\t_drag_task_coords: function(t, drag) {\r\n\t\t\tvar start = drag.obj_s_x = drag.obj_s_x || gantt.posFromDate(t.start_date);\r\n\t\t\tvar end = drag.obj_e_x = drag.obj_e_x || gantt.posFromDate(t.end_date);\r\n\t\t\treturn {\r\n\t\t\t\tstart: start,\r\n\t\t\t\tend: end\r\n\t\t\t};\r\n\t\t},\r\n\t\t_mouse_position_change: function(oldPos, newPos) {\r\n\t\t\tvar dx = oldPos.x - newPos.x,\r\n\t\t\t\tdy = oldPos.y - newPos.y;\r\n\t\t\treturn Math.sqrt(dx * dx + dy * dy);\r\n\t\t},\r\n\t\t_is_number: function(n) {\r\n\t\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\r\n\t\t},\r\n\r\n\t\ton_mouse_move: function(e) {\r\n\t\t\tif (this.drag.start_drag) {\r\n\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\r\n\r\n\t\t\t\tvar sX = this.drag.start_drag.start_x,\r\n\t\t\t\t\tsY = this.drag.start_drag.start_y;\r\n\r\n\t\t\t\tif ((Date.now() - this.drag.timestamp > 50) ||\r\n\t\t\t\t\t(this._is_number(sX) && this._is_number(sY) && this._mouse_position_change({\r\n\t\t\t\t\t\tx: sX,\r\n\t\t\t\t\t\ty: sY\r\n\t\t\t\t\t}, pos) > 20)) {\r\n\t\t\t\t\tthis._start_dnd(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar drag = this.drag;\r\n\r\n\t\t\tif (drag.mode) {\r\n\t\t\t\tif (!timeout(this, 40))//limit update frequency\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tthis._update_on_move(e);\r\n\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_update_item_on_move: function(shift, id, mode, drag, e, multipleDragShift) {\r\n\t\t\tvar task = gantt.getTask(id);\r\n\t\t\tvar original = gantt.mixin({}, task);\r\n\t\t\tvar copy = gantt.mixin({}, task);\r\n\t\t\tthis._handlers[mode].apply(this, [copy, shift, drag, multipleDragShift]);\r\n\t\t\tgantt.mixin(task, copy, true);\r\n\t\t\t//gantt._update_parents(drag.id, true);\r\n\t\t\tgantt.callEvent(\"onTaskDrag\", [task.id, mode, copy, original, e]);\r\n\t\t\tgantt.mixin(task, copy, true);\r\n\t\t\tgantt.refreshTask(id);\r\n\t\t},\r\n\r\n\t\t_update_on_move: function(e) {\r\n\t\t\tvar drag = this.drag;\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tif (drag.mode) {\r\n\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, timeline.$task_data);\r\n\t\t\t\tif (drag.pos && drag.pos.x == pos.x)\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\tdrag.pos = pos;\r\n\r\n\t\t\t\tvar curr_date = gantt.dateFromPos(pos.x);\r\n\t\t\t\tif (!curr_date || isNaN(curr_date.getTime()))\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tvar shift = pos.x - drag.start_x;\r\n\t\t\t\tvar task = gantt.getTask(drag.id);\r\n\t\t\t\tif (this._handlers[drag.mode]) {\r\n\t\t\t\t\tif (drag.mode === config.drag_mode.move) {\r\n\t\t\t\t\t\tvar dragHash = {};\r\n\r\n\t\t\t\t\t\tif (this._isMultiselect()) {\r\n\t\t\t\t\t\t\tvar selectedTasksIds = gantt.getSelectedTasks();\r\n\t\t\t\t\t\t\tif (selectedTasksIds.indexOf(drag.id) >= 0) {\r\n\t\t\t\t\t\t\t\tdragHash = this.dragMultiple;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar dragProject = false;\r\n\t\t\t\t\t\tif (gantt.isSummaryTask(task) && gantt.config.drag_project) {\r\n\t\t\t\t\t\t\tvar initialDrag = {};\r\n\t\t\t\t\t\t\tinitialDrag[drag.id] = utils.copy(drag);\r\n\t\t\t\t\t\t\tdragProject = true;\r\n\t\t\t\t\t\t\tdragHash = utils.mixin(initialDrag, this.dragMultiple);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar maxShift = this._find_max_shift(dragHash, shift);\r\n\t\t\t\t\t\tif (maxShift !== undefined) {\r\n\t\t\t\t\t\t\tshift = maxShift;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis._update_item_on_move(shift, drag.id, drag.mode, drag, e);\r\n\r\n\t\t\t\t\t\tfor (var i in dragHash) {\r\n\t\t\t\t\t\t\tvar childDrag = dragHash[i];\r\n\t\t\t\t\t\t\tif(dragProject && childDrag.id != drag.id){\r\n\t\t\t\t\t\t\t\tgantt._bulk_dnd = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// GS-454: Calculate the date shift in milliseconds instead of pixels\r\n\t\t\t\t\t\t\tif (maxShift === undefined && (dragProject || Object.keys(dragHash).length > 1)) {\r\n\t\t\t\t\t\t\t\tvar shiftDate = gantt.dateFromPos(drag.start_x);\r\n\t\t\t\t\t\t\t\tvar multipleDragShift = curr_date - shiftDate;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis._update_item_on_move(shift, childDrag.id, childDrag.mode, childDrag, e, multipleDragShift);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgantt._bulk_dnd = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// for resize and progress\r\n\t\t\t\t\t\tthis._update_item_on_move(shift, drag.id, drag.mode, drag, e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgantt._update_parents(drag.id);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ton_mouse_down: function(e, src) {\r\n\t\t\t// on Mac we do not get onmouseup event when clicking right mouse button leaving us in dnd state\r\n\t\t\t// let's ignore right mouse button then\r\n\t\t\tif (e.button == 2 && e.button !== undefined)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tvar id = gantt.locate(e);\r\n\t\t\tvar task = null;\r\n\t\t\tif (gantt.isTaskExists(id)) {\r\n\t\t\t\ttask = gantt.getTask(id);\r\n\t\t\t}\r\n\r\n\t\t\tif (gantt.isReadonly(task) || this.drag.mode) return;\r\n\r\n\t\t\tthis.clear_drag_state();\r\n\r\n\t\t\tsrc = src || (e.target || e.srcElement);\r\n\r\n\t\t\tvar className = domHelpers.getClassName(src);\r\n\t\t\tvar drag = this._get_drag_mode(className, src);\r\n\r\n\t\t\tif (!className || !drag) {\r\n\t\t\t\tif (src.parentNode)\r\n\t\t\t\t\treturn this.on_mouse_down(e, src.parentNode);\r\n\t\t\t\telse\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!drag) {\r\n\t\t\t\tif (gantt.checkEvent(\"onMouseDown\") && gantt.callEvent(\"onMouseDown\", [className.split(\" \")[0]])) {\r\n\t\t\t\t\tif (src.parentNode)\r\n\t\t\t\t\t\treturn this.on_mouse_down(e, src.parentNode);\r\n\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (drag.mode && drag.mode != config.drag_mode.ignore && config[\"drag_\" + drag.mode]) {\r\n\t\t\t\t\tid = gantt.locate(src);\r\n\t\t\t\t\ttask = gantt.copy(gantt.getTask(id) || {});\r\n\r\n\t\t\t\t\tif (gantt.isReadonly(task)) {\r\n\t\t\t\t\t\tthis.clear_drag_state();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ((gantt.isSummaryTask(task) && !(task.auto_scheduling === false) && !config.drag_project) && drag.mode != config.drag_mode.progress) {//only progress drag is allowed for tasks with flexible duration\r\n\t\t\t\t\t\tthis.clear_drag_state();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdrag.id = id;\r\n\t\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\r\n\r\n\t\t\t\t\tdrag.start_x = pos.x;\r\n\t\t\t\t\tdrag.start_y = pos.y;\r\n\t\t\t\t\tdrag.obj = task;\r\n\t\t\t\t\tthis.drag.start_drag = drag;\r\n\t\t\t\t\tthis.drag.timestamp = Date.now();\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tthis.clear_drag_state();\r\n\t\t\t}\r\n\t\t},\r\n\t\t_fix_dnd_scale_time: function(task, drag) {\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tvar unit = gantt.getScale().unit,\r\n\t\t\t\tstep = gantt.getScale().step;\r\n\t\t\tif (!config.round_dnd_dates) {\r\n\t\t\t\tunit = 'minute';\r\n\t\t\t\tstep = config.time_step;\r\n\t\t\t}\r\n\r\n\t\t\tfunction fixStart(task) {\r\n\t\t\t\tif (!gantt.config.correct_work_time)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tvar config = timeline.$getConfig();\r\n\t\t\t\tif (!gantt.isWorkTime(task.start_date, undefined, task))\r\n\t\t\t\t\ttask.start_date = gantt.calculateEndDate({\r\n\t\t\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\t\t\tduration: -1,\r\n\t\t\t\t\t\tunit: config.duration_unit,\r\n\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction fixEnd(task) {\r\n\t\t\t\tif (!gantt.config.correct_work_time)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tvar config = timeline.$getConfig();\r\n\t\t\t\tif (!gantt.isWorkTime(new Date(task.end_date - 1), undefined, task))\r\n\t\t\t\t\ttask.end_date = gantt.calculateEndDate({\r\n\t\t\t\t\t\tstart_date: task.end_date,\r\n\t\t\t\t\t\tduration: 1,\r\n\t\t\t\t\t\tunit: config.duration_unit,\r\n\t\t\t\t\t\ttask: task\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (drag.mode == config.drag_mode.resize) {\r\n\t\t\t\tif (drag.left) {\r\n\t\t\t\t\ttask.start_date = gantt.roundDate({date: task.start_date, unit: unit, step: step});\r\n\t\t\t\t\tfixStart(task);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttask.end_date = gantt.roundDate({date: task.end_date, unit: unit, step: step});\r\n\t\t\t\t\tfixEnd(task);\r\n\t\t\t\t}\r\n\t\t\t} else if (drag.mode == config.drag_mode.move) {\r\n\t\t\t\ttask.start_date = gantt.roundDate({date: task.start_date, unit: unit, step: step});\r\n\t\t\t\tfixStart(task);\r\n\t\t\t\ttask.end_date = gantt.calculateEndDate(task);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_fix_working_times: function(task, drag) {\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tvar drag = drag || {mode: config.drag_mode.move};\r\n\r\n\t\t\tif (drag.mode == config.drag_mode.resize) {\r\n\t\t\t\tif (drag.left) {\r\n\t\t\t\t\ttask.start_date = gantt.getClosestWorkTime({date: task.start_date, dir: 'future', task: task});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttask.end_date = gantt.getClosestWorkTime({date: task.end_date, dir: 'past', task: task});\r\n\t\t\t\t}\r\n\t\t\t} else if (drag.mode == config.drag_mode.move) {\r\n\t\t\t\tgantt.correctTaskWorkTime(task);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_finalize_mouse_up: function(taskId, config, drag, e) {\r\n\t\t\tvar task = gantt.getTask(taskId);\r\n\r\n\t\t\tif (config.work_time && config.correct_work_time) {\r\n\t\t\t\tthis._fix_working_times(task, drag);\r\n\t\t\t}\r\n\r\n\t\t\tthis._fix_dnd_scale_time(task, drag);\r\n\r\n\t\t\tif (!this._fireEvent(\"before_finish\", drag.mode, [taskId, drag.mode, gantt.copy(drag.obj), e])) {\r\n\t\t\t\t//drag.obj._dhx_changed = false;\r\n\t\t\t\tthis.clear_drag_state();\r\n\t\t\t\tif (taskId == drag.id) {\r\n\t\t\t\t\tdrag.obj._dhx_changed = false;\r\n\t\t\t\t\tgantt.mixin(task, drag.obj, true);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tgantt.refreshTask(task.id);\r\n\t\t\t} else {\r\n\t\t\t\tvar drag_id = taskId;\r\n\r\n\t\t\t\tgantt._init_task_timing(task);\r\n\r\n\t\t\t\tthis.clear_drag_state();\r\n\t\t\t\tgantt.updateTask(task.id);\r\n\t\t\t\tthis._fireEvent(\"after_finish\", drag.mode, [drag_id, drag.mode, e]);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\ton_mouse_up: function(e) {\r\n\r\n\t\t\tvar drag = this.drag;\r\n\t\t\tif (drag.mode && drag.id) {\r\n\t\t\t\tvar config = timeline.$getConfig();\r\n\t\t\t\t//drop\r\n\t\t\t\tvar task = gantt.getTask(drag.id);\r\n\t\t\t\tvar dragMultiple = this.dragMultiple;\r\n\r\n\t\t\t\tvar finalizingBulkMove = false;\r\n\t\t\t\tvar moveCount = 0;\r\n\t\t\t\tif (drag.mode === config.drag_mode.move) {\r\n\t\t\t\t\tif ((gantt.isSummaryTask(task) && config.drag_project) || (this._isMultiselect())) {\r\n\t\t\t\t\t\tfinalizingBulkMove = true;\r\n\t\t\t\t\t\tmoveCount = Object.keys(dragMultiple).length;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar doFinalize = function doFinalize(){\r\n\t\t\t\t\tif(finalizingBulkMove){\r\n\t\t\t\t\t\tfor (var i in dragMultiple) {\r\n\t\t\t\t\t\t\t// GS-1057: Don't call drag events for the dragged task as they will be called later\r\n\t\t\t\t\t\t\tif (dragMultiple[i].id != drag.id){\r\n\t\t\t\t\t\t\t\tthis._finalize_mouse_up(dragMultiple[i].id, config, dragMultiple[i], e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._finalize_mouse_up(drag.id, config, drag, e);\r\n\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(finalizingBulkMove && moveCount > 10){// 10 - arbitrary threshold for bulk dnd at which we start doing complete repaint to refresh\r\n\t\t\t\t\tgantt.batchUpdate(function(){\r\n\t\t\t\t\t\tdoFinalize.call(this);\r\n\t\t\t\t\t}.bind(this));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdoFinalize.call(this);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tthis.clear_drag_state();\r\n\t\t},\r\n\t\t_get_drag_mode: function(className, el) {\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tvar modes = config.drag_mode;\r\n\t\t\tvar classes = (className || \"\").split(\" \");\r\n\t\t\tvar classname = classes[0];\r\n\t\t\tvar drag = {mode: null, left: null};\r\n\t\t\tswitch (classname) {\r\n\t\t\t\tcase \"gantt_task_line\":\r\n\t\t\t\tcase \"gantt_task_content\":\r\n\t\t\t\t\tdrag.mode = modes.move;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"gantt_task_drag\":\r\n\t\t\t\t\tdrag.mode = modes.resize;\r\n\r\n\t\t\t\t\tvar dragProperty = el.getAttribute(\"data-bind-property\");\r\n\r\n\t\t\t\t\tif (dragProperty == \"start_date\") {\r\n\t\t\t\t\t\tdrag.left = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdrag.left = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"gantt_task_progress_drag\":\r\n\t\t\t\t\tdrag.mode = modes.progress;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"gantt_link_control\":\r\n\t\t\t\tcase \"gantt_link_point\":\r\n\t\t\t\t\tdrag.mode = modes.ignore;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrag = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn drag;\r\n\r\n\t\t},\r\n\r\n\t\t_start_dnd: function(e) {\r\n\t\t\tvar drag = this.drag = this.drag.start_drag;\r\n\t\t\tdelete drag.start_drag;\r\n\r\n\t\t\tvar cfg = timeline.$getConfig();\r\n\t\t\tvar id = drag.id;\r\n\r\n\t\t\tif (!cfg[\"drag_\" + drag.mode] || !gantt.callEvent(\"onBeforeDrag\", [id, drag.mode, e]) || !this._fireEvent(\"before_start\", drag.mode, [id, drag.mode, e])) {\r\n\t\t\t\tthis.clear_drag_state();\r\n\t\t\t} else {\r\n\t\t\t\tdelete drag.start_drag;\r\n\t\t\t\tvar task = gantt.getTask(id);\r\n\t\t\t\tif (gantt.isReadonly(task)){\r\n\t\t\t\t\tthis.clear_drag_state();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this._isMultiselect()) {\r\n\t\t\t\t\t// for don't move selected tasks when drag unselected task\r\n\t\t\t\t\tvar selectedTasksIds = gantt.getSelectedTasks();\r\n\t\t\t\t\tif (selectedTasksIds.indexOf(drag.id) >= 0) {\r\n\t\t\t\t\t\thelpers.forEach(selectedTasksIds, gantt.bind(function(taskId) {\r\n\t\t\t\t\t\t\tvar selectedTask = gantt.getTask(taskId);\r\n\t\t\t\t\t\t\tif (gantt.isSummaryTask(selectedTask) && gantt.config.drag_project && drag.mode == cfg.drag_mode.move) {\r\n\t\t\t\t\t\t\t\tthis._addSubtasksToDragMultiple(selectedTask.id);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.dragMultiple[taskId] = gantt.mixin({\r\n\t\t\t\t\t\t\t\tid: selectedTask.id,\r\n\t\t\t\t\t\t\t\tobj: gantt.copy(selectedTask)\r\n\t\t\t\t\t\t\t}, this.drag);\r\n\t\t\t\t\t\t}, this));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// for move unselected summary\r\n\t\t\t\tif (gantt.isSummaryTask(task) && gantt.config.drag_project && drag.mode == cfg.drag_mode.move) {\r\n\t\t\t\t\tthis._addSubtasksToDragMultiple(task.id);\r\n\t\t\t\t}\r\n\t\t\t\tgantt.callEvent(\"onTaskDragStart\", []);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\t_fireEvent: function(stage, mode, params) {\r\n\t\t\tgantt.assert(this._events[stage], \"Invalid stage:{\" + stage + \"}\");\r\n\r\n\t\t\tvar trigger = this._events[stage][mode];\r\n\r\n\t\t\tgantt.assert(trigger, \"Unknown after drop mode:{\" + mode + \"}\");\r\n\t\t\tgantt.assert(params, \"Invalid event arguments\");\r\n\r\n\r\n\t\t\tif (!gantt.checkEvent(trigger))\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn gantt.callEvent(trigger, params);\r\n\t\t},\r\n\r\n\t\tround_task_dates: function(task) {\r\n\t\t\tvar drag_state = this.drag;\r\n\t\t\tvar config = timeline.$getConfig();\r\n\t\t\tif (!drag_state) {\r\n\t\t\t\tdrag_state = {mode: config.drag_mode.move};\r\n\t\t\t}\r\n\t\t\tthis._fix_dnd_scale_time(task, drag_state);\r\n\t\t},\r\n\t\tdestructor: function() {\r\n\t\t\tthis._domEvents.detachAll();\r\n\t\t},\r\n\t\t_isMultiselect: function() {\r\n\t\t\treturn gantt.config.drag_multiple && !!(gantt.getSelectedTasks && gantt.getSelectedTasks().length > 0);\r\n\t\t},\r\n\t\t_addSubtasksToDragMultiple: function(summaryId) {\r\n\t\t\tgantt.eachTask(function(child) {\r\n\t\t\t\tthis.dragMultiple[child.id] = gantt.mixin({\r\n\t\t\t\t\tid: child.id,\r\n\t\t\t\t\tobj: gantt.copy(child)\r\n\t\t\t\t}, this.drag);\r\n\t\t\t}, summaryId, this);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction initTaskDND() {\r\n\tvar _tasks_dnd;\r\n\treturn {\r\n\t\textend: function(timeline) {\r\n\t\t\ttimeline.roundTaskDates = function(task) {\r\n\t\t\t\t_tasks_dnd.round_task_dates(task);\r\n\t\t\t};\r\n\r\n\t\t},\r\n\t\tinit: function(timeline, gantt) {\r\n\t\t\t_tasks_dnd = createTaskDND(timeline, gantt);\r\n\t\t\t// TODO: entry point for touch handlers, move touch to timeline\r\n\t\t\ttimeline._tasks_dnd = _tasks_dnd;\r\n\t\t\treturn _tasks_dnd.init(gantt);\r\n\t\t},\r\n\t\tdestructor: function() {\r\n\t\t\tif (_tasks_dnd) {\r\n\t\t\t\t_tasks_dnd.destructor();\r\n\t\t\t\t_tasks_dnd = null;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default {\r\n\tcreateTaskDND: initTaskDND\r\n};","import * as domHelpers from \"../utils/dom_helpers\";\r\n\r\nvar initLinksDND = function(timeline, gantt) {\r\n\tvar _link_landing,\r\n\t\t_link_target_task,\r\n\t\t_link_target_task_start,\r\n\t\t_link_source_task,\r\n\t\t_link_source_task_start,\r\n\t\tmarkerDefaultOffset = 10,\r\n\t\tscrollDefaultSize = 18;\r\n\r\n\tfunction getDndState(){\r\n\t\treturn {\r\n\t\t\tlink_source_id : _link_source_task,\r\n\t\t\tlink_target_id : _link_target_task,\r\n\t\t\tlink_from_start : _link_source_task_start,\r\n\t\t\tlink_to_start : _link_target_task_start,\r\n\t\t\tlink_landing_area : _link_landing\r\n\t\t};\r\n\t}\r\n\r\n\tvar services = gantt.$services;\r\n\r\n\tvar state = services.getService(\"state\");\r\n\tvar DnD = services.getService(\"dnd\");\r\n\r\n\tstate.registerProvider(\"linksDnD\", getDndState);\r\n\r\n\tvar start_marker = \"task_start_date\",\r\n\t\tend_marker = \"task_end_date\",\r\n\t\tlink_edge_marker = \"gantt_link_point\",\r\n\t\tlink_landing_hover_area = \"gantt_link_control\";\r\n\r\n\tvar dnd = new DnD(timeline.$task_bars, {\r\n\t\tsensitivity : 0,\r\n\t\tupdates_per_second : 60,\r\n\t\tmousemoveContainer: gantt.$root,\r\n\t\tselector: \".\" + link_edge_marker,\r\n\t\tpreventDefault: true\r\n\t});\r\n\r\n\tdnd.attachEvent(\"onBeforeDragStart\", gantt.bind(function(obj,e) {\r\n\t\tvar target = (e.target||e.srcElement);\r\n\t\tresetDndState();\r\n\t\tif(gantt.getState(\"tasksDnd\").drag_id)\r\n\t\t\treturn false;\r\n\r\n\t\tif(domHelpers.locateClassName(target, link_edge_marker)){\r\n\t\t\tif(domHelpers.locateClassName(target, start_marker))\r\n\t\t\t\t_link_source_task_start = true;\r\n\r\n\t\t\tvar sid = gantt.locate(e);\r\n\t\t\t_link_source_task = sid;\r\n\r\n\t\t\tvar t = gantt.getTask(sid);\r\n\t\t\tif(gantt.isReadonly(t)){\r\n\t\t\t\tresetDndState();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tthis._dir_start = {\r\n\t\t\t\tx: dnd.config.original_element_sizes.x + dnd.config.original_element_sizes.width/2,\r\n\t\t\t\ty: dnd.config.original_element_sizes.y + dnd.config.original_element_sizes.height/2\r\n\t\t\t};\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}, this));\r\n\r\n\tdnd.attachEvent(\"onAfterDragStart\", gantt.bind(function(obj,e) {\r\n\t\tif(gantt.config.touch) {\r\n\t\t\tgantt.refreshData();\r\n\t\t}\r\n\t\tupdateMarkedHtml(dnd.config.marker);\r\n\t}, this));\r\n\r\n\tfunction getVieportSize(){\r\n\t\tvar root = gantt.$root;\r\n\t\treturn { right: root.offsetWidth, bottom: root.offsetHeight };\r\n\t}\r\n\tfunction getMarkerSize (marker){\r\n\t\tvar width = 0, height = 0;\r\n\t\tif(marker){\r\n\t\t\twidth = marker.offsetWidth || 0;\r\n\t\t\theight = marker.offsetHeight || 0;\r\n\t\t}\r\n\t\treturn { width: width, height: height };\r\n\t}\r\n\r\n\tfunction getPosition(e, marker){\r\n\t\tvar oldPos = dnd.getPosition(e);\r\n\r\n\t\tvar markerSize = getMarkerSize(marker);\r\n\t\tvar viewportSize = getVieportSize();\r\n\r\n\t\tvar offsetX = gantt.config.tooltip_offset_x || markerDefaultOffset;\r\n\t\tvar offsetY = gantt.config.tooltip_offset_y || markerDefaultOffset;\r\n\r\n\t\tvar scrollSize = gantt.config.scroll_size || scrollDefaultSize;\r\n\r\n\t\t// GS-1315: Add offset if there are elements above Gantt\r\n\t\tvar ganttOffsetY = gantt.$container.getBoundingClientRect().y + window.scrollY;\r\n\r\n\t\tvar position = {\r\n\t\t\ty: oldPos.y + offsetY,\r\n\t\t\tx: oldPos.x + offsetX,\r\n\t\t\tbottom: oldPos.y + markerSize.height + offsetY + scrollSize,\r\n\t\t\tright: oldPos.x + markerSize.width + offsetX + scrollSize\r\n\t\t};\r\n\r\n\t\tif(position.bottom > viewportSize.bottom + ganttOffsetY){\r\n\t\t\tposition.y = viewportSize.bottom + ganttOffsetY - markerSize.height - offsetY;\r\n\t\t}\r\n\r\n\t\tif(position.right > viewportSize.right){\r\n\t\t\tposition.x = viewportSize.right - markerSize.width - offsetX;\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n\r\n\tdnd.attachEvent(\"onDragMove\", gantt.bind(function(obj,e) {\r\n\t\tvar dd = dnd.config;\r\n\t\tvar pos = getPosition(e, dd.marker);\r\n\t\tadvanceMarker(dd.marker, pos);\r\n\t\tvar landing = !!domHelpers.locateClassName(e, link_landing_hover_area);\r\n\r\n\t\tvar prevTarget = _link_target_task;\r\n\t\tvar prevLanding = _link_landing;\r\n\t\tvar prevToStart = _link_target_task_start;\r\n\r\n\t\tvar targ = gantt.locate(e),\r\n\t\t\tto_start = true;\r\n\r\n\t\t// can drag and drop link to another gantt on the page, such links are not supported\r\n\t\tvar eventTarget = domHelpers.getTargetNode(e);\r\n\r\n\t\tvar sameGantt = domHelpers.isChildOf(eventTarget, gantt.$root);\r\n\t\tif(!sameGantt){\r\n\t\t\tlanding = false;\r\n\t\t\ttarg = null;\r\n\t\t}\r\n\r\n\t\tif(landing){\r\n\t\t\t//refreshTask\r\n\t\t\tto_start = !domHelpers.locateClassName(e, end_marker);\r\n\t\t\tlanding = !!targ;\r\n\t\t}\r\n\r\n\t\t_link_target_task = targ;\r\n\t\t_link_landing = landing;\r\n\t\t_link_target_task_start = to_start;\r\n\r\n\t\tif(landing){\r\n\r\n\t\t\tvar node = domHelpers.locateClassName(e, link_landing_hover_area);\r\n\t\t\r\n\t\t\tconst point = node.querySelector(`.${link_edge_marker}`);\r\n\t\t\tif(point){\r\n\t\t\t\tconst absCoords = domHelpers.getRelativeNodePosition(point, timeline.$task_bg);\r\n\t\t\t\tthis._dir_end = {\r\n\t\t\t\t\tx: absCoords.x + point.offsetWidth/2,\r\n\t\t\t\t\ty: absCoords.y + point.offsetHeight/2\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tthis._dir_end = domHelpers.getRelativeEventPosition(e, timeline.$task_data);\r\n\t\t\tif(gantt.env.isEdge){ // to fix margin collapsing\r\n\t\t\t\tthis._dir_end.y += window.scrollY;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar targetChanged = !(prevLanding == landing && prevTarget == targ && prevToStart == to_start);\r\n\t\tif(targetChanged){\r\n\t\t\tif(prevTarget)\r\n\t\t\t\tgantt.refreshTask(prevTarget, false);\r\n\t\t\tif(targ)\r\n\t\t\t\tgantt.refreshTask(targ, false);\r\n\t\t}\r\n\r\n\t\tif(targetChanged){\r\n\t\t\tupdateMarkedHtml(dd.marker);\r\n\t\t}\r\n\r\n\t\tshowDirectingLine(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y);\r\n\r\n\t\treturn true;\r\n\t}, this));\r\n\r\n\r\n\tdnd.attachEvent(\"onDragEnd\", gantt.bind(function() {\r\n\t\tvar drag = getDndState();\r\n\r\n\t\tif(drag.link_source_id && drag.link_target_id && drag.link_source_id != drag.link_target_id){\r\n\t\t\tvar type = gantt._get_link_type(drag.link_from_start, drag.link_to_start);\r\n\r\n\t\t\tvar link = {source : drag.link_source_id, target: drag.link_target_id, type:type};\r\n\t\t\tif(link.type && gantt.isLinkAllowed(link)) {\r\n\t\t\t\tif(gantt.callEvent(\"onLinkCreated\", [link])){\r\n\t\t\t\t\tgantt.addLink(link);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tresetDndState();\r\n\r\n\t\tif(gantt.config.touch) {\r\n\t\t\tgantt.refreshData();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (drag.link_source_id)\r\n\t\t\t\tgantt.refreshTask(drag.link_source_id, false);\r\n\t\t\tif (drag.link_target_id)\r\n\t\t\t\tgantt.refreshTask(drag.link_target_id, false);\r\n\t\t}\r\n\t\tremoveDirectionLine();\r\n\t}, this));\r\n\r\n\tfunction updateMarkedHtml(marker){\r\n\t\tvar link = getDndState();\r\n\r\n\t\tvar css = [\"gantt_link_tooltip\"];\r\n\t\tif(link.link_source_id && link.link_target_id){\r\n\t\t\tif(gantt.isLinkAllowed(link.link_source_id, link.link_target_id, link.link_from_start, link.link_to_start)){\r\n\t\t\t\tcss.push(\"gantt_allowed_link\");\r\n\t\t\t}else{\r\n\t\t\t\tcss.push(\"gantt_invalid_link\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar className = gantt.templates.drag_link_class(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start);\r\n\t\tif(className)\r\n\t\t\tcss.push(className);\r\n\r\n\t\tvar html = \"\" +\r\n\t\t\tgantt.templates.drag_link(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start) +\r\n\t\t\t\"
\";\r\n\t\tmarker.innerHTML = html;\r\n\t}\r\n\r\n\tfunction advanceMarker(marker, pos){\r\n\t\tmarker.style.left = pos.x + \"px\";\r\n\t\tmarker.style.top = pos.y + \"px\";\r\n\t}\r\n\r\n\tfunction resetDndState(){\r\n\t\t_link_source_task =\r\n\t\t\t_link_source_task_start =\r\n\t\t\t\t_link_target_task = null;\r\n\t\t_link_target_task_start = true;\r\n\t}\r\n\tfunction showDirectingLine(s_x, s_y, e_x, e_y){\r\n\t\tvar div = getDirectionLine();\r\n\r\n\t\tvar link = getDndState();\r\n\r\n\t\tvar css = [\"gantt_link_direction\"];\r\n\t\tif(gantt.templates.link_direction_class){\r\n\t\t\tcss.push(gantt.templates.link_direction_class(link.link_source_id, link.link_from_start, link.link_target_id, link.link_to_start));\r\n\t\t}\r\n\r\n\t\tvar dist =Math.sqrt( (Math.pow(e_x - s_x, 2)) + (Math.pow(e_y - s_y, 2)) );\r\n\t\tdist = Math.max(0, dist - 3);\r\n\t\tif(!dist)\r\n\t\t\treturn;\r\n\r\n\t\tdiv.className = css.join(\" \");\r\n\t\tvar tan = (e_y - s_y)/(e_x - s_x),\r\n\t\t\tangle = Math.atan(tan);\r\n\r\n\t\tif(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 2){\r\n\t\t\tangle += Math.PI;\r\n\t\t}else if(coordinateCircleQuarter(s_x, e_x, s_y, e_y) == 3){\r\n\t\t\tangle -= Math.PI;\r\n\t\t}\r\n\r\n\r\n\r\n\t\tvar sin = Math.sin(angle),\r\n\t\t\tcos = Math.cos(angle),\r\n\t\t\ttop = Math.round(s_y),\r\n\t\t\tleft = Math.round(s_x);\r\n\r\n\r\n\t\tvar style = [\r\n\t\t\t\"-webkit-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-moz-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-ms-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"-o-transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"transform: rotate(\"+angle+\"rad)\",\r\n\t\t\t\"width:\" + Math.round(dist) + \"px\"\r\n\t\t];\r\n\r\n\t\tif(window.navigator.userAgent.indexOf(\"MSIE 8.0\") != -1){\r\n\t\t\t//ms-filter breaks styles in ie9, so add it only for 8th\r\n\t\t\tstyle.push(\"-ms-filter: \\\"\" + ieTransform(sin, cos) + \"\\\"\");\r\n\r\n\t\t\tvar shiftLeft = Math.abs(Math.round(s_x - e_x)),\r\n\t\t\t\tshiftTop = Math.abs(Math.round(e_y - s_y));\r\n\t\t\t//fix rotation axis\r\n\t\t\tswitch(coordinateCircleQuarter(s_x, e_x, s_y, e_y)){\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\ttop -= shiftTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tleft -= shiftLeft;\r\n\t\t\t\t\ttop -= shiftTop;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tleft -= shiftLeft;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tstyle.push(\"top:\" + top + \"px\");\r\n\t\tstyle.push(\"left:\" + left + \"px\");\r\n\r\n\t\tdiv.style.cssText = style.join(\";\");\r\n\t}\r\n\r\n\tfunction ieTransform(sin, cos){\r\n\t\treturn \"progid:DXImageTransform.Microsoft.Matrix(\"+\r\n\t\t\t\"M11 = \"+cos+\",\"+\r\n\t\t\t\"M12 = -\"+sin+\",\"+\r\n\t\t\t\"M21 = \"+sin+\",\"+\r\n\t\t\t\"M22 = \"+cos+\",\"+\r\n\t\t\t\"SizingMethod = 'auto expand'\"+\r\n\t\t\")\";\r\n\t}\r\n\tfunction coordinateCircleQuarter(sX, eX, sY, eY){\r\n\t\tif(eX >= sX){\r\n\t\t\tif(eY <= sY){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 4;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(eY <= sY){\r\n\t\t\t\treturn 2;\r\n\t\t\t}else{\r\n\t\t\t\treturn 3;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\tfunction getDirectionLine(){\r\n\t\tif(!dnd._direction || !dnd._direction.parentNode){\r\n\t\t\tdnd._direction = document.createElement(\"div\");\r\n\t\t\ttimeline.$task_links.appendChild(dnd._direction);\r\n\t\t}\r\n\t\treturn dnd._direction;\r\n\t}\r\n\tfunction removeDirectionLine(){\r\n\t\tif(dnd._direction){\r\n\t\t\tif (dnd._direction.parentNode)\t//the event line can be detached because of data refresh\r\n\t\t\t\tdnd._direction.parentNode.removeChild(dnd._direction);\r\n\r\n\t\t\tdnd._direction = null;\r\n\t\t}\r\n\t}\r\n\tgantt.attachEvent(\"onGanttRender\", gantt.bind(function() {\r\n\t\tif(dnd._direction){\r\n\t\t\tshowDirectingLine(this._dir_start.x, this._dir_start.y, this._dir_end.x, this._dir_end.y);\r\n\t\t}\r\n\t}, this));\r\n};\r\n\r\nexport default {\r\n\tcreateLinkDND: function(){\r\n\t\treturn {\r\n\t\t\tinit: initLinksDND\r\n\t\t};\r\n\t}\r\n};","import * as utils from \"../../../utils/utils\";\r\nimport taskDnD from \"./tasks_dnd\";\r\nimport linkDnD from \"./links_dnd\";\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport MouseDelegates from \"../mouse_event_container\";\r\n\r\nvar initializer = (function(){\r\n\treturn function(gantt){\r\n\t\tvar services = gantt.$services;\r\n\t\treturn {\r\n\t\t\tonCreated: function (timeline) {\r\n\t\t\t\tvar config = timeline.$config;\r\n\t\t\t\tconfig.bind = utils.defined(config.bind) ? config.bind : \"task\";\r\n\t\t\t\tconfig.bindLinks = utils.defined(config.bindLinks) ? config.bindLinks : \"link\";\r\n\r\n\t\t\t\ttimeline._linksDnD = linkDnD.createLinkDND();\r\n\t\t\t\ttimeline._tasksDnD = taskDnD.createTaskDND();\r\n\t\t\t\ttimeline._tasksDnD.extend(timeline);\r\n\r\n\t\t\t\tthis._mouseDelegates = MouseDelegates(gantt);\r\n\t\t\t},\r\n\t\t\tonInitialized: function (timeline) {\r\n\t\t\t\tthis._attachDomEvents(gantt);\r\n\r\n\t\t\t\tthis._attachStateProvider(gantt, timeline);\r\n\r\n\t\t\t\ttimeline._tasksDnD.init(timeline, gantt);\r\n\t\t\t\ttimeline._linksDnD.init(timeline, gantt);\r\n\r\n\t\t\t\tif(timeline.$config.id == \"timeline\"){\r\n\t\t\t\t\tthis.extendDom(timeline);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\tonDestroyed: function (timeline) {\r\n\t\t\t\tthis._clearDomEvents(gantt);\r\n\t\t\t\tthis._clearStateProvider(gantt);\r\n\t\t\t\tif (timeline._tasksDnD) {\r\n\t\t\t\t\ttimeline._tasksDnD.destructor();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\textendDom: function(timeline){\r\n\t\t\t\tgantt.$task = timeline.$task;\r\n\t\t\t\tgantt.$task_scale = timeline.$task_scale;\r\n\t\t\t\tgantt.$task_data = timeline.$task_data;\r\n\t\t\t\tgantt.$task_bg = timeline.$task_bg;\r\n\t\t\t\tgantt.$task_links = timeline.$task_links;\r\n\t\t\t\tgantt.$task_bars = timeline.$task_bars;\r\n\t\t\t},\r\n\r\n\t\t\t_clearDomEvents: function(){\r\n\t\t\t\tthis._mouseDelegates.destructor();\r\n\t\t\t\tthis._mouseDelegates = null;\r\n\t\t\t},\r\n\r\n\t\t\t_attachDomEvents: function(gantt){\r\n\t\t\t\tfunction _delete_link_handler(id, e) {\r\n\t\t\t\t\tif (id && this.callEvent(\"onLinkDblClick\", [id, e])) {\r\n\r\n\t\t\t\t\t\tvar link = this.getLink(id);\r\n\t\t\t\t\t\tif (this.isReadonly(link)) return;\r\n\r\n\t\t\t\t\t\tvar title = \"\";\r\n\t\t\t\t\t\tvar question = this.locale.labels.link + \" \" + this.templates.link_description(this.getLink(id)) + \" \" + this.locale.labels.confirm_link_deleting;\r\n\r\n\t\t\t\t\t\twindow.setTimeout(function () {\r\n\t\t\t\t\t\t\tgantt._simple_confirm(question, title, function () {\r\n\t\t\t\t\t\t\t\tgantt.deleteLink(id);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}, (this.config.touch ? 300 : 1));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_task_link\", gantt.bind(function (e, trg) {\r\n\t\t\t\t\tvar id = this.locate(e, this.config.link_attribute);\r\n\t\t\t\t\tif (id) {\r\n\t\t\t\t\t\tthis.callEvent(\"onLinkClick\", [id, e]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"click\", \"gantt_scale_cell\", gantt.bind(function (e, trg) {\r\n\t\t\t\t\tvar pos = domHelpers.getRelativeEventPosition(e, gantt.$task_data);\r\n\t\t\t\t\tvar date = gantt.dateFromPos(pos.x);\r\n\t\t\t\t\tvar coll = Math.floor(gantt.columnIndexByDate(date));\r\n\r\n\t\t\t\t\tvar coll_date = gantt.getScale().trace_x[coll];\r\n\r\n\t\t\t\t\tgantt.callEvent(\"onScaleClick\", [e, coll_date]);\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_task_link\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar id = this.locate(e, gantt.config.link_attribute);\r\n\t\t\t\t\t_delete_link_handler.call(this, id, e);\r\n\t\t\t\t}, gantt), this.$task);\r\n\r\n\t\t\t\tthis._mouseDelegates.delegate(\"doubleclick\", \"gantt_link_point\", gantt.bind(function (e, id, trg) {\r\n\t\t\t\t\tvar id = this.locate(e),\r\n\t\t\t\t\t\ttask = this.getTask(id);\r\n\r\n\t\t\t\t\tvar link = null;\r\n\t\t\t\t\tif (trg.parentNode && domHelpers.getClassName(trg.parentNode)) {\r\n\t\t\t\t\t\tif (domHelpers.getClassName(trg.parentNode).indexOf(\"_left\") > -1) {\r\n\t\t\t\t\t\t\tlink = task.$target[0];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlink = task.$source[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (link)\r\n\t\t\t\t\t\t_delete_link_handler.call(this, link, e);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}, gantt), this.$task);\r\n\t\t\t},\r\n\r\n\t\t\t_attachStateProvider: function(gantt, timeline){\r\n\t\t\t\tvar self = timeline;\r\n\t\t\t\tvar state = services.getService(\"state\");\r\n\t\t\t\tstate.registerProvider(\"tasksTimeline\", function(){\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tscale_unit: self._tasks ? self._tasks.unit : undefined,\r\n\t\t\t\t\t\tscale_step: self._tasks ? self._tasks.step : undefined\r\n\t\t\t\t\t};\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t_clearStateProvider: function(){\r\n\t\t\t\tvar state = services.getService(\"state\");\r\n\t\t\t\tstate.unregisterProvider(\"tasksTimeline\");\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n})();\r\n\r\nexport default initializer;","import * as domHelpers from \"./utils/dom_helpers\";\r\n\r\nvar initializer = (function() {\r\n\treturn function (gantt) {\r\n\t\treturn {\r\n\r\n\t\t\tgetVerticalScrollbar: function(){\r\n\t\t\t\treturn gantt.$ui.getView(\"scrollVer\");\r\n\t\t\t},\r\n\t\t\tgetHorizontalScrollbar: function(){\r\n\t\t\t\treturn gantt.$ui.getView(\"scrollHor\");\r\n\t\t\t},\r\n\r\n\t\t\t_legacyGridResizerClass: function(layout){\r\n\t\t\t\tvar resizers = layout.getCellsByType(\"resizer\");\r\n\t\t\t\tfor(var i = 0; i < resizers.length; i++){\r\n\t\t\t\t\tvar r = resizers[i];\r\n\t\t\t\t\tvar gridResizer = false;\r\n\r\n\t\t\t\t\tvar prev = r.$parent.getPrevSibling(r.$id);\r\n\t\t\t\t\tif(prev && prev.$config && prev.$config.id === \"grid\"){\r\n\t\t\t\t\t\tgridResizer= true;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar next = r.$parent.getNextSibling(r.$id);\r\n\t\t\t\t\t\tif(next && next.$config && next.$config.id === \"grid\"){\r\n\t\t\t\t\t\t\tgridResizer= true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(gridResizer){\r\n\t\t\t\t\t\tr.$config.css = (r.$config.css ? r.$config.css + \" \" : \"\") + \"gantt_grid_resize_wrap\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tonCreated: function(layout) {\r\n\t\t\t\tvar first = true;\r\n\r\n\t\t\t\tthis._legacyGridResizerClass(layout);\r\n\r\n\t\t\t\tlayout.attachEvent(\"onBeforeResize\", function() {\r\n\t\t\t\t\tvar mainTimeline = gantt.$ui.getView(\"timeline\");\r\n\t\t\t\t\tif (mainTimeline)\r\n\t\t\t\t\t\tmainTimeline.$config.hidden = mainTimeline.$parent.$config.hidden = !gantt.config.show_chart;\r\n\r\n\t\t\t\t\tvar mainGrid = gantt.$ui.getView(\"grid\");\r\n\r\n\t\t\t\t\tif(!mainGrid)\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\tvar colsWidth = mainGrid._getColsTotalWidth();\r\n\t\t\t\t\tvar hideGrid = !gantt.config.show_grid || !gantt.config.grid_width || colsWidth === 0;\r\n\t\t\t\t\tif (first && !hideGrid && colsWidth !== false){\r\n\t\t\t\t\t\t\tgantt.config.grid_width = colsWidth;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmainGrid.$config.hidden = mainGrid.$parent.$config.hidden = hideGrid;\r\n\r\n\t\t\t\t\tif (!mainGrid.$config.hidden) {\r\n\t\t\t\t\t\t/* restrict grid width due to min_width, max_width, min_grid_column_width */\r\n\t\t\t\t\t\tvar grid_limits = mainGrid._getGridWidthLimits();\r\n\t\t\t\t\t\tif (grid_limits[0] && gantt.config.grid_width < grid_limits[0])\r\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[0];\r\n\t\t\t\t\t\tif (grid_limits[1] && gantt.config.grid_width > grid_limits[1])\r\n\t\t\t\t\t\t\tgantt.config.grid_width = grid_limits[1];\r\n\t\t\t\t\t\tif (mainTimeline && gantt.config.show_chart){\r\n\r\n\t\t\t\t\t\t\tmainGrid.$config.width = gantt.config.grid_width - 1;\r\n\r\n\t\t\t\t\t\t\t// GS-1314: Don't let the non-scrollable grid to be larger than the container with the correct width\r\n\t\t\t\t\t\t\tif (!mainGrid.$config.scrollable && mainGrid.$config.scrollY && gantt.$root.offsetWidth){\r\n\t\t\t\t\t\t\t\tvar ganttContainerWidth = mainGrid.$gantt.$layout.$container.offsetWidth;\r\n\t\t\t\t\t\t\t\tvar verticalScrollbar = gantt.$ui.getView(mainGrid.$config.scrollY);\r\n\t\t\t\t\t\t\t\tvar verticalScrollbarWidth = verticalScrollbar.$config.width;\r\n\r\n\t\t\t\t\t\t\t\t// GS-2488: to prevent grid from occupying the whole gantt container(timeline will be disabled) \r\n\t\t\t\t\t\t\t\t// need to leave min width for timeline\r\n\t\t\t\t\t\t\t\tvar gridOverflow = ganttContainerWidth - (mainGrid.$config.width + verticalScrollbarWidth) - 4;\r\n\t\t\t\t\t\t\t\tif (gridOverflow < 0){\r\n\t\t\t\t\t\t\t\t\tmainGrid.$config.width += gridOverflow;\r\n\t\t\t\t\t\t\t\t\tgantt.config.grid_width += gridOverflow;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\t\t\tif (mainTimeline && !domHelpers.isChildOf(mainTimeline.$task, layout.$view)) {\r\n\t\t\t\t\t\t\t\t\t// timeline is being displayed after being not visible, reset grid with from full screen\r\n\t\t\t\t\t\t\t\t\tif (!mainGrid.$config.original_grid_width) {\r\n\t\t\t\t\t\t\t\t\t\tvar skinSettings = gantt.skins[gantt.skin];\r\n\t\t\t\t\t\t\t\t\t\tif(skinSettings && skinSettings.config && skinSettings.config.grid_width){\r\n\t\t\t\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = skinSettings.config.grid_width;\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tgantt.config.grid_width = mainGrid.$config.original_grid_width;\r\n\t\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tmainGrid.$parent._setContentSize(mainGrid.$config.width, null);\r\n\t\t\t\t\t\t\t\t\tgantt.$layout._syncCellSizes(mainGrid.$parent.$config.group, {value: gantt.config.grid_width, isGravity: false});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t\tif (mainGrid.$parent.$config.group) {\r\n\t\t\t\t\t\t\t\t\tgantt.$layout._syncCellSizes(mainGrid.$parent.$config.group, {value: mainGrid.$parent.$config.width, isGravity: false});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (mainTimeline && domHelpers.isChildOf(mainTimeline.$task, layout.$view)) {\r\n\t\t\t\t\t\t\t\t// hiding timeline, remember grid with to restore it when timeline is displayed again\r\n\t\t\t\t\t\t\t\tmainGrid.$config.original_grid_width = gantt.config.grid_width;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\t\t\tmainGrid.$parent.$config.width = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfirst = false;\r\n\t\t\t\t});\r\n\t\t\t\tthis._initScrollStateEvents(layout);\r\n\t\t\t},\r\n\r\n\t\t\t_initScrollStateEvents: function(layout) {\r\n\t\t\t\tgantt._getVerticalScrollbar = this.getVerticalScrollbar;\r\n\t\t\t\tgantt._getHorizontalScrollbar = this.getHorizontalScrollbar;\r\n\r\n\t\t\t\tvar vertical = this.getVerticalScrollbar();\r\n\t\t\t\tvar horizontal = this.getHorizontalScrollbar();\r\n\t\t\t\tif (vertical) {\r\n\t\t\t\t\tvertical.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\r\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\r\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [scrollState.x, oldPos, scrollState.x, newPos]);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tif (horizontal) {\r\n\t\t\t\t\thorizontal.attachEvent(\"onScroll\", function(oldPos, newPos, dir){\r\n\t\t\t\t\t\tvar scrollState = gantt.getScrollState();\r\n\t\t\t\t\t\tgantt.callEvent(\"onGanttScroll\", [oldPos, scrollState.y, newPos, scrollState.y]);\r\n\r\n\t\t\t\t\t\t// if the grid doesn't fit the width, scroll the row container\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tif (grid && grid.$grid_data && !grid.$config.scrollable){\r\n\t\t\t\t\t\t\tgrid.$grid_data.style.left = grid.$grid.scrollLeft + \"px\";\r\n\t\t\t\t\t\t\tgrid.$grid_data.scrollLeft = grid.$grid.scrollLeft;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlayout.attachEvent(\"onResize\", function(){\r\n\t\t\t\t\tif (vertical && !gantt.$scroll_ver){\r\n\t\t\t\t\t\tgantt.$scroll_ver = vertical.$scroll_ver;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (horizontal && !gantt.$scroll_hor){\r\n\t\t\t\t\t\tgantt.$scroll_hor = horizontal.$scroll_hor;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\r\n\t\t\t_findGridResizer: function(layout, grid){\r\n\t\t\t\tvar resizers = layout.getCellsByType(\"resizer\");\r\n\r\n\t\t\t\tvar gridFirst = true;\r\n\t\t\t\tvar gridResizer;\r\n\t\t\t\tfor(var i = 0; i < resizers.length; i++){\r\n\t\t\t\t\tvar res = resizers[i];\r\n\t\t\t\t\tres._getSiblings();\r\n\t\t\t\t\tvar prev = res._behind;\r\n\t\t\t\t\tvar next = res._front;\r\n\t\t\t\t\tif(prev && prev.$content === grid || (prev.isChild && prev.isChild(grid))){\r\n\t\t\t\t\t\tgridResizer = res;\r\n\t\t\t\t\t\tgridFirst = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else if(next && next.$content === grid || (next.isChild && next.isChild(grid))){\r\n\t\t\t\t\t\tgridResizer = res;\r\n\t\t\t\t\t\tgridFirst = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn {\r\n\t\t\t\t\tresizer: gridResizer,\r\n\t\t\t\t\tgridFirst: gridFirst\r\n\t\t\t\t};\r\n\t\t\t},\r\n\r\n\t\t\tonInitialized: function (layout) {\r\n\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\r\n\t\t\t\tvar resizeInfo = this._findGridResizer(layout, grid);\r\n\r\n\t\t\t\t// expose grid resize events\r\n\t\t\t\tif(resizeInfo.resizer){\r\n\t\t\t\t\tvar gridFirst = resizeInfo.gridFirst,\r\n\t\t\t\t\t\tnext = resizeInfo.resizer;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(next.$config.mode !== \"x\"){\r\n\t\t\t\t\t\treturn;// track only horizontal resize\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar initialWidth;\r\n\t\t\t\t\tnext.attachEvent(\"onResizeStart\", function(prevCellWidth, nextCellWidth){\r\n\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\r\n\t\t\t\t\t\tif(viewCell){\r\n\t\t\t\t\t\t\tvar limits = grid._getGridWidthLimits();\r\n\r\n\t\t\t\t\t\t\t// min grid width is defined by min widths of its columns, unless grid has horizontal scroll\r\n\t\t\t\t\t\t\tif(!grid.$config.scrollable)\r\n\t\t\t\t\t\t\t\tviewCell.$config.minWidth = limits[0];\r\n\r\n\t\t\t\t\t\t\tviewCell.$config.maxWidth = limits[1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tinitialWidth = gridFirst ? prevCellWidth : nextCellWidth;\r\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResizeStart\", [initialWidth]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tnext.attachEvent(\"onResize\", function(newBehindSize, newFrontSize){\r\n\t\t\t\t\t\tvar newSize = gridFirst ? newBehindSize : newFrontSize;\r\n\t\t\t\t\t\treturn gantt.callEvent(\"onGridResize\", [initialWidth, newSize]);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tnext.attachEvent(\"onResizeEnd\", function(oldBackSize, oldFrontSize, newBackSize, newFrontSize){\r\n\r\n\t\t\t\t\t\tvar oldSize = gridFirst ? oldBackSize : oldFrontSize;\r\n\t\t\t\t\t\tvar newSize = gridFirst ? newBackSize : newFrontSize;\r\n\t\t\t\t\t\tvar grid = gantt.$ui.getView(\"grid\");\r\n\t\t\t\t\t\tvar viewCell = grid ? grid.$parent : null;\r\n\t\t\t\t\t\tif(viewCell){\r\n\t\t\t\t\t\t\tviewCell.$config.minWidth = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar res = gantt.callEvent(\"onGridResizeEnd\", [oldSize, newSize]);\r\n\t\t\t\t\t\tif(res && newSize !== 0){// new size may be numeric zero when cell size is defined by 'gravity', actual size will be calculated by layout later\r\n\t\t\t\t\t\t\tgantt.config.grid_width = newSize;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\tonDestroyed: function (timeline) {\r\n\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t};\r\n})();\r\n\r\nexport default initializer;","import uiFactory from \"./ui_factory\";\r\nimport mouseEvents from \"./mouse\";\r\nimport createLayers from \"./gantt_layers\";\r\nimport Cell from \"./layout/cell\";\r\nimport Layout from \"./layout/layout\";\r\nimport ViewLayout from \"./layout/view_layout\";\r\nimport ViewCell from \"./layout/view_cell\";\r\nimport Resizer from \"./layout/resizer_cell\";\r\nimport Scrollbar from \"./layout/scrollbar_cell\";\r\nimport Timeline from \"./timeline/timeline\";\r\nimport Grid from \"./grid/grid\";\r\nimport ResourceGrid from \"./grid/resource_grid\";\r\nimport ResourceTimeline from \"./timeline/resource_timeline\";\r\nimport ResourceHistogram from \"./timeline/resource_histogram\";\r\n\r\n\r\nimport gridEditorsFactory from \"./grid/editors/controller\";\r\n\r\nimport renderTaskBar from \"./render/task_bar_smart_render\";\r\nimport renderTimedProjectBar from \"./render/task_project_smart_render\";\r\nimport renderSplitTaskBar from \"./render/task_split_render\";\r\nimport renderRollupTaskBar from \"./render/task_rollup_render\";\r\nimport renderTaskBg from \"./render/task_bg_render\";\r\nimport renderLink from \"./render/link_render\";\r\nimport gridRenderer from \"./render/task_grid_line_render\";\r\nimport resourceMatrixRenderer from \"./render/resource_matrix_render\";\r\nimport resourceHistogramRenderer from \"./render/resource_histogram_render\";\r\nimport gridTaskRowResizerRenderer from \"./render/task_grid_row_resize_render\";\r\nimport renderConstraints from \"./render/task_constraints_render\";\r\nimport renderDeadline from \"./render/task_deadline_render\";\r\nimport renderBaselines from \"./render/task_baselines_render\";\r\nimport mainGridInitializer from \"./grid/main_grid_initializer\";\r\nimport mainTimelineInitializer from \"./timeline/main_timeline_initializer\";\r\nimport mainLayoutInitializer from \"./main_layout_initializer\";\r\n\r\nfunction initUI(gantt){\r\n\tfunction attachInitializer(view, initializer){\r\n\t\tvar ext = initializer(gantt);\r\n\t\tif(ext.onCreated)\r\n\t\t\text.onCreated(view);\r\n\t\tview.attachEvent(\"onReady\", function(){\r\n\t\t\tif(ext.onInitialized)\r\n\t\t\t\text.onInitialized(view);\r\n\t\t});\r\n\t\tview.attachEvent(\"onDestroy\", function(){\r\n\t\t\tif(ext.onDestroyed)\r\n\t\t\t\text.onDestroyed(view);\r\n\t\t});\r\n\t}\r\n\r\n\tvar factory = uiFactory.createFactory(gantt);\r\n\tfactory.registerView(\"cell\", Cell);\r\n\tfactory.registerView(\"resizer\", Resizer);\r\n\tfactory.registerView(\"scrollbar\", Scrollbar);\r\n\tfactory.registerView(\"layout\", Layout, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"main\"){\r\n\t\t\tattachInitializer(view, mainLayoutInitializer);\r\n\t\t}\r\n\t});\r\n\tfactory.registerView(\"viewcell\", ViewCell);\r\n\tfactory.registerView(\"multiview\", ViewLayout);\r\n\tfactory.registerView(\"timeline\", Timeline, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"timeline\" || view.$config.bind == \"task\"){\r\n\t\t\tattachInitializer(view, mainTimelineInitializer);\r\n\t\t}\r\n\t});\r\n\tfactory.registerView(\"grid\", Grid, function(view){\r\n\t\tvar id = view.$config ? view.$config.id : null;\r\n\t\tif(id === \"grid\" || view.$config.bind == \"task\"){\r\n\t\t\tattachInitializer(view, mainGridInitializer);\r\n\t\t}\r\n\t});\r\n\r\n\tfactory.registerView(\"resourceGrid\", ResourceGrid);\r\n\tfactory.registerView(\"resourceTimeline\", ResourceTimeline);\r\n\tfactory.registerView(\"resourceHistogram\", ResourceHistogram);\r\n\r\n\tvar layersEngine = createLayers(gantt);\r\n\r\n\tvar inlineEditors = gridEditorsFactory(gantt);\r\n\r\n\tgantt.ext.inlineEditors = inlineEditors;\r\n\tgantt.ext._inlineEditors = inlineEditors;\r\n\tinlineEditors.init(gantt);\r\n\r\n\treturn {\r\n\t\tfactory:factory,\r\n\t\tmouseEvents: mouseEvents.init(gantt),\r\n\t\tlayersApi: layersEngine.init(),\r\n\t\trender:{\r\n\t\t\tgridLine: function(){\r\n\t\t\t\treturn gridRenderer(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBg: function(){\r\n\t\t\t\treturn renderTaskBg(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBar: function(){\r\n\t\t\t\treturn renderTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttimedProjectBar: function(){\r\n\t\t\t\treturn renderTimedProjectBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskRollupBar: function() {\r\n\t\t\t\treturn renderRollupTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskSplitBar: function(){\r\n\t\t\t\treturn renderSplitTaskBar(gantt);\r\n\t\t\t},\r\n\t\t\ttaskConstraints: function(){\r\n\t\t\t\treturn renderConstraints(gantt);\r\n\t\t\t},\r\n\t\t\ttaskDeadline: function(){\r\n\t\t\t\treturn renderDeadline(gantt);\r\n\t\t\t},\r\n\t\t\ttaskBaselines: function(){\r\n\t\t\t\treturn renderBaselines(gantt);\r\n\t\t\t},\r\n\t\t\tlink: function(){\r\n\t\t\t\treturn renderLink(gantt);\r\n\t\t\t},\r\n\t\t\tresourceRow: function(){\r\n\t\t\t\treturn resourceMatrixRenderer(gantt);\r\n\t\t\t},\r\n\t\t\tresourceHistogram: function(){\r\n\t\t\t\treturn resourceHistogramRenderer(gantt);\r\n\t\t\t},\r\n\t\t\tgridTaskRowResizer: function(){\r\n\t\t\t\treturn gridTaskRowResizerRenderer(gantt);\r\n\t\t\t}\r\n\t\t},\r\n\t\tlayersService: {\r\n\t\t\tgetDataRender: function(name){\r\n\t\t\t\treturn layersEngine.getDataRender(name, gantt);\r\n\t\t\t},\r\n\t\t\tcreateDataRender: function(config){\r\n\t\t\t\treturn layersEngine.createDataRender(config, gantt);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default {\r\n\tinit: initUI\r\n};","export default null;","import * as helpers from \"../../../utils/helpers\";\r\nimport getRowRectangle from \"./viewport/get_grid_row_rectangle\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\nimport isInViewPort from \"./viewport/is_grid_row_in_viewport\";\r\n\r\nfunction createGridLineRender(gantt){\r\n\r\n\tfunction _render_grid_item(item, view, config, viewport) {\r\n\t\tvar columns = view.getGridColumns();\r\n\t\tvar templates = view.$getTemplates();\r\n\r\n\t\tvar store = view.$config.rowStore;\r\n\r\n\t\tvar cells = [];\r\n\t\tvar has_child;\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar last = i == columns.length - 1;\r\n\t\t\tvar col = columns[i];\r\n\t\t\tvar cell;\r\n\r\n\t\t\tvar value;\r\n\t\t\tvar textValue;\r\n\t\t\tif (col.name == \"add\") {\r\n\t\t\t\tvar aria = gantt._waiAria.gridAddButtonAttrString(col);\r\n\r\n\t\t\t\tvalue = \"
\";\r\n\t\t\t\ttextValue = \"\";\r\n\t\t\t} else {\r\n\t\t\t\tif (col.template)\r\n\t\t\t\t\tvalue = col.template(item);\r\n\t\t\t\telse\r\n\t\t\t\t\tvalue = item[col.name];\r\n\r\n\t\t\t\tif (helpers.isDate(value)){\r\n\t\t\t\t\tvalue = templates.date_grid(value, item, col.name);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (value === null || value === undefined) {\r\n\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttextValue = value;\r\n\t\t\t\tvalue = \"\" + value + \"
\";\r\n\t\t\t}\r\n\t\t\tvar css = \"gantt_cell\" + (last ? \" gantt_last_cell\" : \"\");\r\n\r\n\t\t\tvar tree = [];\r\n\t\t\tif (col.tree) {\r\n\t\t\t\tcss += \" gantt_cell_tree\";\r\n\t\t\t\tfor (var j = 0; j < item.$level; j++)\r\n\t\t\t\t\ttree.push(templates.grid_indent(item));\r\n\r\n\t\t\t\thas_child = store.hasChild(item.id) && !(gantt.isSplitTask(item) && !gantt.config.open_split_tasks);\r\n\t\t\t\tif (has_child) {\r\n\t\t\t\t\ttree.push(templates.grid_open(item));\r\n\t\t\t\t\ttree.push(templates.grid_folder(item));\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttree.push(templates.grid_blank(item));\r\n\t\t\t\t\ttree.push(templates.grid_file(item));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar style = \"width:\" + (col.width - (last ? 1 : 0)) + \"px;\";\r\n\t\t\tif (this.defined(col.align)){\r\n\t\t\t\tvar flexAlign = {\r\n\t\t\t\t\tright: \"flex-end\",\r\n\t\t\t\t\tleft: \"flex-start\",\r\n\t\t\t\t\tcenter: \"center\"\r\n\t\t\t\t};\r\n\t\t\t\tvar justifyContent = flexAlign[col.align];\r\n\r\n\t\t\t\tstyle += \"text-align:\" + col.align + \";justify-content:\" + justifyContent + \";\";\r\n\t\t\t}\r\n\r\n\t\t\tvar aria = gantt._waiAria.gridCellAttrString(col, textValue, item);\r\n\r\n\t\t\ttree.push(value);\r\n\t\t\tcell = \"\" + tree.join(\"\") + \"
\";\r\n\t\t\tcells.push(cell);\r\n\t\t}\r\n\t\t// GS-291. The odd class should be assigned correctly\r\n\t\tcss = \"\";\r\n\t\tconst storeName = store.$config.name;\r\n\t\tswitch (storeName) {\r\n\t\t\tcase \"task\":\r\n\t\t\t\tcss = gantt.getGlobalTaskIndex(item.id) % 2 === 0 ? \"\" : \" odd\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"resource\":\r\n\t\t\t\tcss = store.visibleOrder.indexOf(item.id) % 2 === 0 ? \"\" : \" odd\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcss += (item.$transparent) ? \" gantt_transparent\" : \"\";\r\n\r\n\t\tcss += (item.$dataprocessor_class ? \" \" + item.$dataprocessor_class : \"\");\r\n\r\n\t\tif (templates.grid_row_class) {\r\n\t\t\tvar css_template = templates.grid_row_class.call(gantt, item.start_date, item.end_date, item);\r\n\t\t\tif (css_template)\r\n\t\t\t\tcss += \" \" + css_template;\r\n\t\t}\r\n\r\n\t\tif(store.isSelected(item.id)) {\r\n\t\t\tcss += \" gantt_selected\";\r\n\t\t}\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.className = \"gantt_row\" + css + \" gantt_row_\" + gantt.getTaskType(item.type);\r\n\t\tvar height = view.getItemHeight(item.id);\r\n\t\tel.style.height = height + \"px\";\r\n\t\tel.style.lineHeight = height + \"px\";\r\n\r\n\t\tif(config.smart_rendering){\r\n\t\t\tel.style.position = \"absolute\";\r\n\t\t\tel.style.left = \"0px\";\r\n\t\t\tel.style.top = view.getItemTop(item.id) + \"px\";\r\n\t\t}\r\n\r\n\t\tif(view.$config.item_attribute){\r\n\t\t\tel.setAttribute(view.$config.item_attribute, item.id);\r\n\t\t\tel.setAttribute(view.$config.bind + \"_id\", item.id); // 'task_id'/'resource_id' for backward compatibility\r\n\t\t}\r\n\r\n\t\tgantt._waiAria.taskRowAttr(item, el);\r\n\r\n\t\tel.innerHTML = cells.join(\"\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tfunction onrender(item, rowNode, view){\r\n\t\tvar columns = view.getGridColumns();\r\n\t\tfor (var i = 0; i < columns.length; i++) {\r\n\t\t\tvar column = columns[i];\r\n\t\t\tif (column.onrender){\r\n\r\n\t\t\t\t// find cell node for current column\r\n\t\t\t\tvar cellNode = rowNode.querySelector(\"[data-column-name=\" + column.name + \"]\");\r\n\t\t\t\tif (cellNode) {\r\n\t\t\t\t\tvar content = column.onrender(item, cellNode);\r\n\t\t\t\t\tif (content && typeof content === \"string\") {\r\n\t\t\t\t\t\tcellNode.innerHTML = content;\r\n\t\t\t\t\t} else if (content && typeof content === \"object\") {\r\n\t\t\t\t\t\t// render object to node using additional functionality\r\n\t\t\t\t\t\tif (gantt.config.external_render){\r\n\t\t\t\t\t\t\tvar adapter = gantt.config.external_render;\r\n\t\t\t\t\t\t\tif (adapter.isElement(content)){\r\n\t\t\t\t\t\t\t\tadapter.renderElement(content, cellNode);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\trender: _render_grid_item,\r\n\t\tupdate: null,\r\n\t\tgetRectangle: getRowRectangle,\r\n\t\tisInViewPort: isInViewPort,\r\n\t\tgetVisibleRange: getVisibleRange,\r\n\t\tonrender: onrender\r\n\t};\r\n}\r\n\r\nexport default createGridLineRender;","import getRowRectangle from \"./viewport/get_bg_row_rectangle\";\r\nimport isLegacyRender from \"./is_legacy_smart_render\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\nimport getVisibleCellsRange from \"./viewport/get_visible_cells_range\";\r\nimport isColumnVisible from \"./viewport/is_column_visible\";\r\nimport bgPlaceholder from \"./prerender/task_bg_placeholder\";\r\n\r\nfunction createTaskBgRender(gantt){\r\n\tvar renderedCells = {};\r\n\tvar visibleCells = {};\r\n\r\n\tfunction isRendered(item, columnIndex){\r\n\t\tif(renderedCells[item.id][columnIndex] && renderedCells[item.id][columnIndex].parentNode){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction detachRenderedCell(itemId, columnIndex){\r\n\t\tif(renderedCells[itemId] && renderedCells[itemId][columnIndex] &&\r\n\t\t\trenderedCells[itemId][columnIndex].parentNode\r\n\t\t\t){\r\n\t\t\t\trenderedCells[itemId][columnIndex].parentNode.removeChild(renderedCells[itemId][columnIndex]);\r\n\t\t\t}\r\n\t}\r\n\r\n\tfunction getCellClassTemplate(view){\r\n\t\tvar templates = view.$getTemplates();\r\n\t\tvar cssTemplate;\r\n\t\tif (typeof templates.task_cell_class !== \"undefined\") {\r\n\t\t\tcssTemplate = templates.task_cell_class;\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tvar log = console.warn || console.log;\r\n\t\t\tlog('gantt.templates.task_cell_class template is deprecated and will be removed soon. Please use gantt.templates.timeline_cell_class instead.');\r\n\t\t} else {\r\n\t\t\tcssTemplate = templates.timeline_cell_class;\r\n\t\t}\r\n\t\treturn cssTemplate;\r\n\t}\r\n\tfunction getCellContentTemplate(view){\r\n\t\tvar templates = view.$getTemplates();\r\n\t\tvar contentTemplate = templates.timeline_cell_content;\r\n\t\treturn contentTemplate;\r\n\t}\r\n\r\n\tfunction renderCells(item, node, view, config, viewPort){\r\n\t\tvar cfg = view.getScale();\r\n\t\tvar count = cfg.count;\r\n\t\tvar cssTemplate = getCellClassTemplate(view);\r\n\t\tvar contentTemplate = getCellContentTemplate(view);\r\n\r\n\t\tif (config.show_task_cells) {\r\n\t\t\tif(!renderedCells[item.id]){\r\n\t\t\t\trenderedCells[item.id] = {};\r\n\t\t\t}\r\n\t\t\tif(!visibleCells[item.id]){\r\n\t\t\t\tvisibleCells[item.id] = {};\r\n\t\t\t}\r\n\r\n\t\t\tvar range = getVisibleCellsRange(cfg, viewPort);\r\n\r\n\t\t\tfor(var i in visibleCells[item.id]){\r\n\t\t\t\tvar index = visibleCells[item.id][i];\r\n\r\n\t\t\t\tif(Number(index) < range.start || Number(index) > range.end){\r\n\t\t\t\t\tdetachRenderedCell(item.id, index);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvisibleCells[item.id] = {};\r\n\t\t\t// TODO: do not iterate all cell, only ones in the viewport and once that are already rendered\r\n\t\t\tfor (var columnIndex = range.start; columnIndex <= range.end; columnIndex++) {\r\n\t\t\t\tvar cell = renderOneCell(cfg, columnIndex, item, viewPort, count, cssTemplate, contentTemplate, config);\r\n\t\t\t\tif(!cell && isRendered(item, columnIndex)){\r\n\t\t\t\t\tdetachRenderedCell(item.id, columnIndex);\r\n\t\t\t\t}else if (cell && !cell.parentNode){\r\n\t\t\t\t\tnode.appendChild(cell);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction renderOneCell(scale, columnIndex, item, viewPort, count, cssTemplate, contentTemplate, config){\r\n\t\tvar width = scale.width[columnIndex],\r\n\t\t\tcssclass = \"\";\r\n\r\n\t\tif (isColumnVisible(columnIndex, scale, viewPort, gantt)) {//do not render skipped columns\r\n\r\n\t\t\tvar cssTemplateContent = cssTemplate(item, scale.trace_x[columnIndex]);\r\n\t\t\tvar htmlTemplateContent = \"\";\r\n\t\t\tif (contentTemplate) {// for backward compatibility, contentTemplate was added in 7.2.0+, will be undefined if someone used copy of old config/template object\r\n\t\t\t\thtmlTemplateContent = contentTemplate(item, scale.trace_x[columnIndex]);\r\n\t\t\t}\r\n\r\n\t\t\tif(config.static_background){\r\n\t\t\t\t// if cell render in static background is not allowed, or if it's a blank cell\r\n\t\t\t\tvar customCell = !!(cssTemplateContent || htmlTemplateContent);\r\n\t\t\t\tif(!(config.static_background_cells && customCell)){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(renderedCells[item.id][columnIndex]){\r\n\t\t\t\tvisibleCells[item.id][columnIndex] = columnIndex;\r\n\t\t\t\treturn renderedCells[item.id][columnIndex];\r\n\t\t\t}\r\n\t\t\tvar cell = document.createElement(\"div\");\r\n\t\t\tcell.style.width = (width) + \"px\";\r\n\r\n\t\t\tcssclass = \"gantt_task_cell\" + (columnIndex == count - 1 ? \" gantt_last_cell\" : \"\");\r\n\t\t\tif (cssTemplateContent) {\r\n\t\t\t\tcssclass += \" \" + cssTemplateContent;\r\n\t\t\t}\r\n\t\t\tcell.className = cssclass;\r\n\r\n\t\t\tif (htmlTemplateContent) {\r\n\t\t\t\tcell.innerHTML = htmlTemplateContent;\r\n\t\t\t}\r\n\r\n\t\t\tcell.style.position = \"absolute\";\r\n\t\t\tcell.style.left = scale.left[columnIndex] + \"px\";\r\n\t\t\trenderedCells[item.id][columnIndex] = cell;\r\n\t\t\tvisibleCells[item.id][columnIndex] = columnIndex;\r\n\r\n\t\t\treturn cell;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction _render_bg_line(item, view, config, viewPort) {\r\n\t\tvar templates = view.$getTemplates();\r\n\t\tvar cfg = view.getScale();\r\n\t\tvar count = cfg.count;\r\n\r\n\t\tif(config.static_background && !config.static_background_cells){\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar row = document.createElement(\"div\");\r\n\r\n\t\tvar cellCssTemplate = getCellClassTemplate(view);\r\n\t\tvar cellHtmlTemplate = getCellContentTemplate(view);\r\n\r\n\t\tvar range;\r\n\r\n\t\tif(!viewPort || !config.smart_rendering || isLegacyRender(gantt)){\r\n\t\t\trange = {\r\n\t\t\t\tstart: 0,\r\n\t\t\t\tend: count - 1\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\trange = getVisibleCellsRange(cfg, viewPort.x);\r\n\t\t}\r\n\t\tif (config.show_task_cells) {\r\n\t\t\trenderedCells[item.id] = {};\r\n\t\t\tvisibleCells[item.id] = {};\r\n\t\t\tfor (var columnIndex = range.start; columnIndex <= range.end; columnIndex++) {\r\n\t\t\t\tvar cell = renderOneCell(cfg, columnIndex, item, viewPort, count, cellCssTemplate, cellHtmlTemplate, config);\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\trow.appendChild(cell);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// GS-291. The odd class should be assigned correctly\r\n\t\tconst store = view.$config.rowStore;\r\n\t\tconst odd = store.getIndexById(item.id) % 2 !== 0;\r\n\r\n\t\tvar cssTemplate = templates.task_row_class(item.start_date, item.end_date, item);\r\n\t\tvar css = \"gantt_task_row\" + (odd ? \" odd\" : \"\") + (cssTemplate ? ' ' + cssTemplate : '');\r\n\r\n\t\tif(store.isSelected(item.id)) {\r\n\t\t\tcss += \" gantt_selected\";\r\n\t\t}\r\n\r\n\t\trow.className = css;\r\n\r\n\t\tif (config.smart_rendering) {\r\n\t\t\trow.style.position = \"absolute\";\r\n\t\t\trow.style.top = view.getItemTop(item.id) + \"px\";\r\n\t\t\trow.style.width = \"100%\";\r\n\t\t}else{\r\n\t\t\trow.style.position = \"relative\";\r\n\t\t}\r\n\t\trow.style.height = (view.getItemHeight(item.id)) + \"px\";\r\n\r\n\t\tif (item.id == \"timeline_placeholder_task\"){\r\n\t\t\tvar placeholderTop = 0;\r\n\t\t\tif (item.lastTaskId){\r\n\t\t\t\tvar lastTaskTop = view.getItemTop(item.lastTaskId);\r\n\t\t\t\tvar lastTaskHeight = view.getItemHeight(item.lastTaskId);\r\n\t\t\t\tplaceholderTop = lastTaskTop + lastTaskHeight;\t\r\n\t\t\t}\r\n\r\n\t\t\tvar maxHeight = item.row_height || view.$task_data.offsetHeight;\r\n\r\n\t\t\tvar placeholderHeight = maxHeight - placeholderTop;\r\n\t\t\t// So that it won't exceed the placeholder timeline height\r\n\t\t\tif (placeholderHeight < 0){\r\n\t\t\t\tplaceholderHeight = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (config.smart_rendering) {\r\n\t\t\t\trow.style.top = placeholderTop + \"px\";\t\r\n\t\t\t}\r\n\t\t\trow.style.height = placeholderHeight + \"px\";\r\n\t\t}\r\n\r\n\r\n\t\tif(view.$config.item_attribute){\r\n\t\t\trow.setAttribute(view.$config.item_attribute, item.id);\r\n\t\t\trow.setAttribute(view.$config.bind + \"_id\", item.id); // 'task_id'/'resource_id' for backward compatibility\r\n\t\t}\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\treturn {\r\n\t\trender: _render_bg_line,\r\n\t\tupdate: renderCells,\r\n\t\tgetRectangle: getRowRectangle,\r\n\t\tgetVisibleRange: getVisibleRange,\r\n\t\tprepareData: bgPlaceholder\r\n\t};\r\n}\r\n\r\nexport default createTaskBgRender;\r\n","import createBaseBarRender from \"./task_bar_render\";\r\nimport isInViewPort from \"./viewport/is_bar_in_viewport\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\n\r\nfunction createTaskRenderer(gantt){\r\n\tconst defaultRender = createBaseBarRender(gantt);\r\n\r\n\tconst renderedNodes = {};\r\n\r\n\tfunction checkVisibility(child, viewPort, timeline, config, gantt){\r\n\t\tlet isVisible = true;\r\n\t\t// GS-2123. Don't render rollup tasks that are outside the viewport\r\n\t\tif (config.smart_rendering){\r\n\t\t\tisVisible = isInViewPort(child, viewPort, timeline, config, gantt);\r\n\t\t}\r\n\t\treturn isVisible;\r\n\t}\r\n\r\n\tfunction generateChildElement(task, child, timeline, sizes){\r\n\t\tconst childCopy = gantt.copy(gantt.getTask(child.id));\r\n\t\tchildCopy.$rendered_at = task.id;\r\n\t\t// a way to filter rollup tasks:\r\n\t\tconst displayRollup = gantt.callEvent(\"onBeforeRollupTaskDisplay\", [childCopy.id, childCopy, task.id]);\r\n\t\tif (displayRollup === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst element = defaultRender(childCopy, timeline);\r\n\t\tif(!element){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst height = timeline.getBarHeight(task.id, child.type == gantt.config.types.milestone);\r\n\t\tconst padding = Math.floor((timeline.getItemHeight(task.id) - height) / 2);\r\n\r\n\t\telement.style.top = (sizes.top + padding) + \"px\";\r\n\t\telement.classList.add(\"gantt_rollup_child\");\r\n\t\telement.setAttribute(\"data-rollup-parent-id\", task.id);\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\tfunction getKey(childId, renderParentId){\r\n\t\treturn childId + \"_\" + renderParentId;\r\n\t}\r\n\r\n\r\n\tfunction renderRollupTask(task, timeline, config, viewPort) {\r\n\t\tif (task.rollup !== false && task.$rollup && task.$rollup.length) {\r\n\t\t\tconst el = document.createElement('div'),\r\n\t\t\t\tsizes = gantt.getTaskPosition(task);\r\n\r\n\t\t\t// vertical position is not important for the rollup tasks as long as the parent is rendered\r\n\t\t\tif (viewPort){\r\n\t\t\t\tviewPort.y = 0;\r\n\t\t\t\tviewPort.y_end = gantt.$task_bg.scrollHeight;\r\n\t\t\t}\r\n\r\n\t\t\ttask.$rollup.forEach(function(itemId){\r\n\t\t\t\tif (!gantt.isTaskExists(itemId)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tconst child = gantt.getTask(itemId);\r\n\t\t\t\tlet isVisible = checkVisibility(child, viewPort, timeline, config, gantt);\r\n\t\t\t\tif (!isVisible){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst element = generateChildElement(task, child, timeline, sizes);\r\n\t\t\t\tif (element) {\r\n\t\t\t\t\trenderedNodes[getKey(child.id, task.id)] = element;\r\n\t\t\t\t\tel.appendChild(element);\r\n\t\t\t\t} else{\r\n\t\t\t\t\trenderedNodes[getKey(child.id, task.id)] = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\treturn el;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction repaintRollupTask(task, itemNode, timeline, config, viewPort) {\r\n\t\tconst el = document.createElement(\"div\"),\r\n\t\tsizes = gantt.getTaskPosition(task);\r\n\r\n\t\t// vertical position is not important for the rollup tasks as long as the parent is rendered\r\n\t\tviewPort.y = 0;\r\n\t\tviewPort.y_end = gantt.$task_bg.scrollHeight;\r\n\r\n\t\ttask.$rollup.forEach(function(itemId){\r\n\t\t\tconst child = gantt.getTask(itemId);\r\n\t\t\tconst rollupKey = getKey(child.id, task.id);\r\n\t\t\tlet isVisible = checkVisibility(child, viewPort, timeline, config, gantt);\r\n\t\t\tif (isVisible !== !!renderedNodes[rollupKey]) {\r\n\r\n\t\t\t\tif (isVisible) {\r\n\t\t\t\t\tconst element = generateChildElement(task, child, timeline, sizes);\r\n\t\t\t\t\trenderedNodes[rollupKey] = element || false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trenderedNodes[rollupKey] = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!!renderedNodes[rollupKey]) {\r\n\t\t\t\tel.appendChild(renderedNodes[rollupKey]);\r\n\t\t\t}\r\n\t\t\titemNode.innerHTML = \"\";\r\n\t\t\titemNode.appendChild(el);\r\n\t\t});\r\n\t}\r\n\r\n\r\n\r\n\treturn {\r\n\t\trender: renderRollupTask,\r\n\t\tupdate: repaintRollupTask,\r\n\t\t//getRectangle: getBarRectangle\r\n\t\tisInViewPort: isInViewPort,\r\n\t\tgetVisibleRange: getVisibleRange\r\n\t};\r\n}\r\n\r\nexport default createTaskRenderer;","import getRectangle from \"./viewport/get_bg_row_rectangle\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\nimport getVisibleCellsRange from \"./viewport/get_visible_cells_range\";\r\nimport isColumnVisible from \"./viewport/is_column_visible\";\r\nimport resourceTimetable from \"../../resource_timetable_builder\";\r\n\r\nfunction generateRenderResourceLine(gantt){\r\n\tvar getResourceLoad = resourceTimetable(gantt);\r\n\tvar renderedResourceLines = {};\r\n\r\n\tfunction renderResourceLineCell(resource, day, templates, config, timeline){\r\n\t\tvar css = templates.resource_cell_class(day.start_date, day.end_date, resource, day.tasks, day.assignments);\r\n\t\tvar content = templates.resource_cell_value(day.start_date, day.end_date, resource, day.tasks, day.assignments);\r\n\t\tvar height = timeline.getItemHeight(resource.id) - 1;\r\n\r\n\t\tif (css || content){\r\n\t\t\tvar sizes = timeline.getItemPosition(resource, day.start_date, day.end_date);\r\n\t\t\tvar el = document.createElement('div');\r\n\t\t\tel.setAttribute(timeline.$config.item_attribute, resource.id);\r\n\t\t\tel.className = [\"gantt_resource_marker\", css].join(\" \");\r\n\r\n\t\t\tel.style.cssText = [\r\n\t\t\t\t'left:' + sizes.left + 'px',\r\n\t\t\t\t'width:' + sizes.width + 'px',\r\n\t\t\t\t'height:' + (height) + 'px',\r\n\t\t\t\t'line-height:' + (height) + 'px',\r\n\t\t\t\t'top:' + sizes.top + 'px'\r\n\t\t\t].join(\";\");\r\n\r\n\t\t\tif(content)\r\n\t\t\t\tel.innerHTML = content;\r\n\r\n\t\t\treturn el;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction detachRenderedResourceLine(id, index){\r\n\t\tif(renderedResourceLines[id] && renderedResourceLines[id][index] &&\r\n\t\t\trenderedResourceLines[id][index].parentNode\r\n\t\t\t){\r\n\t\t\t\trenderedResourceLines[id][index].parentNode.removeChild(renderedResourceLines[id][index]);\r\n\t\t\t}\r\n\t}\r\n\r\n\tfunction renderResourceLine(resource, timeline, config, viewport) {\r\n\t\tvar templates = timeline.$getTemplates();\r\n\t\tvar scale = timeline.getScale();\r\n\t\tvar timetable = getResourceLoad(resource, config.resource_property, timeline.getScale(), timeline);\r\n\t\tvar smartRendering = !!viewport;//no viewport means smart rendering is disabled\r\n\t\tvar cells = [];\r\n\t\trenderedResourceLines[resource.id] = {};\r\n\r\n\t\tvar range = getVisibleCellsRange(scale, viewport);\r\n\t\tfor (var columnIndex = range.start; columnIndex <= range.end; columnIndex++) {\r\n\r\n\t\t\tvar day = timetable[columnIndex];\r\n\t\t\tif(!day){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif(smartRendering && !isColumnVisible(columnIndex, scale, viewport, gantt)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tvar cell = renderResourceLineCell(resource, day, templates, config, timeline);\r\n\t\t\tif(cell){\r\n\t\t\t\tcells.push(cell);\r\n\t\t\t\trenderedResourceLines[resource.id][columnIndex] = cell;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar row = null;\r\n\t\tif(cells.length){\r\n\t\t\trow = document.createElement(\"div\");\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\trow.appendChild(cells[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn row;\r\n\t}\r\n\r\n\tfunction updateResourceLine(resource, node, timeline, config, viewport) {\r\n\t\tvar templates = timeline.$getTemplates();\r\n\t\tvar scale = timeline.getScale();\r\n\t\tvar timetable = getResourceLoad(resource, config.resource_property, timeline.getScale(), timeline);\r\n\r\n\t\tvar range = getVisibleCellsRange(scale, viewport);\r\n\r\n\t\tvar checkedColumns = {};\r\n\t\tif(renderedResourceLines && renderedResourceLines[resource.id]){\r\n\t\t\tfor(var i in renderedResourceLines[resource.id]){\r\n\t\t\t\tcheckedColumns[i] = i;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var columnIndex = range.start; columnIndex <= range.end; columnIndex++) {\r\n\t\t\tvar day = timetable[columnIndex];\r\n\t\t\tcheckedColumns[columnIndex] = false;\r\n\t\t\tif(!day){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif(!isColumnVisible(columnIndex, scale, viewport, gantt)){\r\n\t\t\t\tdetachRenderedResourceLine(resource.id, columnIndex);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif(!renderedResourceLines[resource.id] || !renderedResourceLines[resource.id][columnIndex]){\r\n\t\t\t\tvar cell = renderResourceLineCell(resource, day, templates, config, timeline);\r\n\t\t\t\tif(cell){\r\n\t\t\t\t\tnode.appendChild(cell);\r\n\t\t\t\t\trenderedResourceLines[resource.id][columnIndex] = cell;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(renderedResourceLines[resource.id] && renderedResourceLines[resource.id][columnIndex] && !renderedResourceLines[resource.id][columnIndex].parentNode){\r\n\t\t\t\tnode.appendChild(renderedResourceLines[resource.id][columnIndex]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor(var i in checkedColumns){\r\n\t\t\tif(checkedColumns[i] !== false){\r\n\t\t\t\tdetachRenderedResourceLine(resource.id, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\trender: renderResourceLine,\r\n\t\tupdate: updateResourceLine,\r\n\t\tgetRectangle: getRectangle,\r\n\t\tgetVisibleRange: getVisibleRange\r\n\t};\r\n}\r\n\r\nexport default generateRenderResourceLine;","import getRowRectangle from \"./viewport/get_grid_row_rectangle\";\r\nimport getVisibleRange from \"./viewport/get_visible_bars_range\";\r\n\r\nfunction createGridTaskRowResizerRender(gantt){\r\n\r\n\tfunction _render_grid_item(item, view, viewport) {\r\n\r\n\t\tvar config = view.$getConfig();\r\n\t\tvar resize_el = document.createElement(\"div\");\r\n\t\tresize_el.className = \"gantt_task_grid_row_resize_wrap\";\r\n\r\n\t\tresize_el.style.top = (view.getItemTop(item.id) + view.getItemHeight(item.id)) + \"px\";\r\n\r\n\t\tresize_el.innerHTML = \"
\";\r\n\t\tresize_el.setAttribute(config.task_grid_row_resizer_attribute, item.id);\r\n\r\n\t\tgantt._waiAria.rowResizerAttr(resize_el);\r\n\t\treturn resize_el;\r\n\t}\r\n\r\n\treturn {\r\n\t\trender: _render_grid_item,\r\n\t\tupdate: null,\r\n\t\tgetRectangle: getRowRectangle,\r\n\t\tgetVisibleRange: getVisibleRange\r\n\t};\r\n}\r\n\r\nexport default createGridTaskRowResizerRender;","function _configure(col, data, force) {\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\" || force)\r\n\t\t\tcol[key] = data[key];\r\n}\r\n\r\nfunction _get_skin(force, gantt) {\r\n\r\n\tconst styles = getComputedStyle(gantt.$root);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-gantt-theme\");\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\r\n\t\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t}else{\r\n\t\tvar skin = gantt.skin;\r\n\t\tthemeName = skin;\r\n\t\tif (!skin || force) {\r\n\t\t\tvar links = document.getElementsByTagName(\"link\");\r\n\t\t\tfor (var i = 0; i < links.length; i++) {\r\n\t\t\t\tvar res = links[i].href.match(\"dhtmlxgantt_([a-z_]+).css\");\r\n\t\t\t\tif (res) {\r\n\t\t\t\t\tif (gantt.skins[res[1]] || !skin) {\r\n\t\t\t\t\t\tthemeName = res[1];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgantt._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme\r\n\t};\r\n\r\n\r\n\r\n\tgantt.skin = themeName || \"terrace\";\r\n\tvar skinset = gantt.skins[gantt.skin] || gantt.skins[\"terrace\"];\r\n\r\n\t//apply skin related settings\r\n\t_configure(gantt.config, skinset.config, force);\r\n\r\n\tif(!isCssVarTheme){\r\n\t\tgantt.config.link_radius = 1;\r\n\t}\r\n\r\n\tvar config = gantt.getGridColumns();\r\n\tif (config[1] && !gantt.defined(config[1].width))\r\n\t\tconfig[1].width = skinset._second_column_width;\r\n\tif (config[2] && !gantt.defined(config[2].width))\r\n\t\tconfig[2].width = skinset._third_column_width;\r\n\t\r\n\tfor (var i=0; i column.width) ? column.min_width : column.width;\r\n\t\t\t\tcolumn.width = (column.max_width && column.max_width < column.width) ? column.max_width : column.width;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (skinset.config.task_height){\r\n\t\tgantt.config.task_height = skinset.config.task_height || \"full\";\r\n\t}\r\n\tif (skinset.config.bar_height){\r\n\t\tgantt.config.bar_height = skinset.config.bar_height || \"full\";\r\n\t}\r\n\r\n\tif (skinset._lightbox_template)\r\n\t\tgantt._lightbox_template = skinset._lightbox_template;\r\n\r\n\tif (skinset._redefine_lightbox_buttons) {\r\n\t\tgantt.config.buttons_right = skinset._redefine_lightbox_buttons[\"buttons_right\"];\r\n\t\tgantt.config.buttons_left = skinset._redefine_lightbox_buttons[\"buttons_left\"];\r\n\t}\r\n\r\n\r\n\tgantt.resetLightbox();\r\n}\r\n\r\n\r\n\r\nexport default function(gantt) {\r\n\t\r\n\tif(!gantt.resetSkin){\r\n\t\tgantt.resetSkin = function () {\r\n\t\t\tthis.skin = \"\";\r\n\t\t\t_get_skin(true, this);\r\n\t\t};\r\n\t\tgantt.skins = {};\r\n\r\n\t\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t\t\t_get_skin(false, this);\r\n\t\t\tmonitorThemeChange();\r\n\t\t});\r\n\t}\r\n\r\n\tgantt._addThemeClass = function(){\r\n\t\tdocument.documentElement.setAttribute(\"data-gantt-theme\", gantt.skin);\r\n\t};\r\n\r\n\tgantt.setSkin = function(value){\r\n\t\tthis.skin = value;\r\n\t\tgantt._addThemeClass();\r\n\t\tmonitorThemeChange();\r\n\t\tif(gantt.$root){\r\n\t\t\t_get_skin(true, gantt);\r\n\t\t\tthis.render();\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t};\r\n\r\n\r\n\tlet monitorIntervalId = null;\r\n\tfunction monitorThemeChange(){\r\n\t\tconst container = gantt.$root;\r\n\t\t\r\n\t\tif(monitorIntervalId){\r\n\t\t\tclearInterval(monitorIntervalId);\r\n\t\t}\r\n\t\t\r\n\t\tif(container){\r\n\t\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-gantt-theme');\r\n\t\t\t\tif(csstheme && csstheme !== gantt.skin){\r\n\t\t\t\t\tgantt.setSkin(csstheme);\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t}\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(monitorIntervalId);\r\n\t});\r\n};","import * as domHelpers from \"../utils/dom_helpers\";\r\nimport isHeadless from \"../../../utils/is_headless\";\r\n\r\nexport default function(gantt){\r\n\r\n\tvar scrollRange = 50,\r\n\t\tscrollStep = 30,\r\n\t\tscrollDelay = 10,\r\n\t\tscrollSpeed = 50;\r\n\r\n\tvar interval = null,\r\n\t\tisMove = false,\r\n\t\tdelayTimeout = null,\r\n\t\tstartPos = {\r\n\t\t\tstarted: false\r\n\t\t},\r\n\t\teventPos = {};\r\n\r\n\r\n\tfunction isDisplayed(element){\r\n\t\treturn element &&\r\n\t\t\tdomHelpers.isChildOf(element, gantt.$root) &&\r\n\t\t\telement.offsetHeight;\r\n\t}\r\n\r\n\tfunction getAutoscrollContainer(){\r\n\t\tvar element;\r\n\t\tif(isDisplayed(gantt.$task)){\r\n\t\t\telement = gantt.$task;\r\n\t\t}else if(isDisplayed(gantt.$grid)){\r\n\t\t\telement = gantt.$grid;\r\n\t\t}else{\r\n\t\t\telement = gantt.$root;\r\n\t\t}\r\n\r\n\t\treturn element;\r\n\t}\r\n\r\n\tfunction isScrollState() {\r\n\t\tvar dragMarker = !!document.querySelector(\".gantt_drag_marker\");\r\n\t\tvar isResize = !!document.querySelector(\".gantt_drag_marker.gantt_grid_resize_area\")\r\n\t\t\t|| !!document.querySelector(\".gantt_drag_marker.gantt_row_grid_resize_area\") ;\r\n\t\tvar isLink = !!document.querySelector(\".gantt_link_direction\");\r\n\t\tvar state = gantt.getState();\r\n\t\tvar isClickDrag = state.autoscroll;\r\n\t\tisMove = dragMarker && !isResize && !isLink;\r\n\r\n\t\treturn !((!state.drag_mode && !dragMarker) || isResize) || isClickDrag;\r\n\t}\r\n\r\n\tfunction defineDelayTimeout(state) {\r\n\t\tif (delayTimeout) {\r\n\t\t\tclearTimeout(delayTimeout);\r\n\t\t\tdelayTimeout = null;\r\n\t\t}\r\n\t\tif (state) {\r\n\t\t\tvar speed = gantt.config.autoscroll_speed;\r\n\t\t\tif (speed && speed < 10) // limit speed value to 10\r\n\t\t\t\tspeed = 10;\r\n\r\n\t\t\tdelayTimeout = setTimeout(function() {\r\n\t\t\t\tinterval = setInterval(tick, speed || scrollSpeed);\r\n\t\t\t}, gantt.config.autoscroll_delay || scrollDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction defineScrollInterval(state) {\r\n\t\tif (state) {\r\n\t\t\tdefineDelayTimeout(true);\r\n\t\t\tif (!startPos.started) {\r\n\t\t\t\tstartPos.x = eventPos.x;\r\n\t\t\t\tstartPos.y = eventPos.y;\r\n\t\t\t\tstartPos.started = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (interval) {\r\n\t\t\t\tclearInterval(interval);\r\n\t\t\t\tinterval = null;\r\n\t\t\t}\r\n\t\t\tdefineDelayTimeout(false);\r\n\t\t\tstartPos.started = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction autoscrollInterval(event) {\r\n\t\tvar isScroll = isScrollState();\r\n\r\n\t\tif ((interval || delayTimeout) && !isScroll) {\r\n\t\t\tdefineScrollInterval(false);\r\n\t\t}\r\n\r\n\t\tif (!gantt.config.autoscroll || !isScroll) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\teventPos = {\r\n\t\t\tx: event.clientX,\r\n\t\t\ty: event.clientY\r\n\t\t};\r\n\r\n\t\t// if it is a mobile device, we need to detect the touch event coords\r\n\t\tif (event.type == \"touchmove\"){\r\n\t\t\teventPos.x = event.targetTouches[0].clientX;\r\n\t\t\teventPos.y = event.targetTouches[0].clientY;\r\n\t\t}\r\n\r\n\t\tif (!interval && isScroll) {\r\n\t\t\tdefineScrollInterval(true);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction tick() {\r\n\r\n\t\tif (!isScrollState()) {\r\n\t\t\tdefineScrollInterval(false);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar container = getAutoscrollContainer();\r\n\t\tif(!container){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// GS-1150: if we reorder or resize something in the grid, we should obtain the grid container\r\n\t\tvar gridDrag = false;\r\n\t\tvar gridMarkers = [\r\n\t\t\t\".gantt_drag_marker.gantt_grid_resize_area\",\r\n\t\t\t\".gantt_drag_marker .gantt_row.gantt_row_task\",\r\n\t\t\t\".gantt_drag_marker.gantt_grid_dnd_marker\"\r\n\t\t];\r\n\t\tgridMarkers.forEach(function (selector) {\r\n\t\t\tgridDrag = gridDrag || !!document.querySelector(selector);\r\n\t\t});\r\n\t\tif (gridDrag){\r\n\t\t\tcontainer = gantt.$grid;\r\n\t\t}\r\n\r\n\t\tvar box = domHelpers.getNodePosition(container);\r\n\r\n\t\tvar posX = eventPos.x - box.x;\r\n\t\tvar posY = eventPos.y - box.y + window.scrollY; // GS-1315: window.scrollY here and below for the elements above Gantt\r\n\r\n\t\tvar scrollLeft = isMove ? 0 : need_scroll(posX, box.width, startPos.x - box.x);\r\n\t\tvar scrollTop = need_scroll(posY, box.height, startPos.y - box.y + window.scrollY);\r\n\r\n\t\tvar scrollState = gantt.getScrollState();\r\n\r\n\t\tvar currentScrollTop = scrollState.y,\r\n\t\t\tscrollOuterHeight = scrollState.inner_height,\r\n\t\t\tscrollInnerHeight = scrollState.height,\r\n\t\t\tcurrentScrollLeft = scrollState.x,\r\n\t\t\tscrollOuterWidth = scrollState.inner_width,\r\n\t\t\tscrollInnerWidth = scrollState.width;\r\n\r\n\t\t// do scrolling only if we have scrollable area to do so\r\n\t\tif (scrollTop && !scrollOuterHeight) {\r\n\t\t\tscrollTop = 0;\r\n\t\t} else if (scrollTop < 0 && !currentScrollTop) {\r\n\t\t\tscrollTop = 0;\r\n\t\t} else if (scrollTop > 0 && currentScrollTop + scrollOuterHeight >= scrollInnerHeight + 2) {\r\n\t\t\tscrollTop = 0;\r\n\t\t}\r\n\r\n\t\tif (scrollLeft && !scrollOuterWidth) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t} else if (scrollLeft < 0 && !currentScrollLeft) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t} else if (scrollLeft > 0 && currentScrollLeft + scrollOuterWidth >= scrollInnerWidth) {\r\n\t\t\tscrollLeft = 0;\r\n\t\t}\r\n\r\n\t\tvar step = gantt.config.autoscroll_step;\r\n\r\n\t\tif (step && step < 2) // limit step value to 2\r\n\t\t\tstep = 2;\r\n\r\n\t\tscrollLeft = scrollLeft * (step || scrollStep);\r\n\t\tscrollTop = scrollTop * (step || scrollStep);\r\n\r\n\t\tif (scrollLeft || scrollTop) {\r\n\t\t\tscroll(scrollLeft, scrollTop);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction need_scroll(pos, boxSize, startCoord) {\r\n\t\tif ((pos - scrollRange < 0) && (pos < startCoord))\r\n\t\t\treturn -1;\r\n\t\telse if ((pos > boxSize - scrollRange) && (pos > startCoord))\r\n\t\t\treturn 1;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfunction scroll(left, top) {\r\n\t\tvar scrollState = gantt.getScrollState();\r\n\r\n\t\tvar scrollLeft = null,\r\n\t\t\tscrollTop = null;\r\n\r\n\t\tif (left) {\r\n\t\t\tscrollLeft = scrollState.x + left;\r\n\t\t\tscrollLeft = Math.min(scrollState.width, scrollLeft);\r\n\t\t\tscrollLeft = Math.max(0, scrollLeft);\r\n\t\t}\r\n\r\n\t\tif (top) {\r\n\t\t\tscrollTop = scrollState.y + top;\r\n\t\t\tscrollTop = Math.min(scrollState.height, scrollTop);\r\n\t\t\tscrollTop = Math.max(0, scrollTop);\r\n\t\t}\r\n\r\n\t\tgantt.scrollTo(scrollLeft, scrollTop);\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", function() {\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tvar eventElement = domHelpers.getRootNode(gantt.$root) || document.body;\r\n\t\t\tgantt.eventRemove(eventElement, \"mousemove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"mousemove\", autoscrollInterval);\r\n\r\n\t\t\tgantt.eventRemove(eventElement, \"touchmove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"touchmove\", autoscrollInterval);\r\n\r\n\t\t\tgantt.eventRemove(eventElement, \"pointermove\", autoscrollInterval);\r\n\t\t\tgantt.event(eventElement, \"pointermove\", autoscrollInterval);\r\n\t\t}\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onDestroy\", function(){\r\n\t\tdefineScrollInterval(false);\r\n\t});\r\n\r\n};","if (window.jQuery){\r\n\r\n\t(function( $ ){\r\n\r\n\t\tvar methods = [];\r\n\t\t$.fn.dhx_gantt = function(config){\r\n\t\t\tconfig = config || {};\r\n\t\t\tif (typeof(config) === 'string') {\r\n\t\t\t\tif (methods[config] ) {\r\n\t\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t\t}else {\r\n\t\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_gantt');\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvar views = [];\r\n\t\t\t\tthis.each(function() {\r\n\t\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\t\tif (!this.gantt && !(window.gantt.$root == this)){\r\n\r\n\t\t\t\t\t\t\tvar newgantt = (window.gantt.$container && window.Gantt) ? window.Gantt.getGanttInstance():window.gantt;\r\n\t\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\t\tnewgantt.config[key] = config[key];\r\n\r\n\t\t\t\t\t\t\tnewgantt.init(this);\r\n\t\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\t\tnewgantt.parse(config.data);\r\n\r\n\t\t\t\t\t\t\tviews.push(newgantt);\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\tviews.push(typeof this.gantt == \"object\" ? this.gantt : window.gantt);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t\tif (views.length === 1) return views[0];\r\n\t\t\t\treturn views;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t})(window.jQuery);\r\n\r\n}\r\n\r\n\r\nexport default null;","if (window.dhtmlx){\r\n\r\n\tif (!window.dhtmlx.attaches)\r\n\twindow.dhtmlx.attaches = {};\r\n\r\n\twindow.dhtmlx.attaches.attachGantt=function(start, end, gantt){\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\r\n\t\tgantt = gantt || window.gantt;\r\n\r\n\t\tobj.id = \"gantt_\"+ gantt.uid();\r\n\t\tobj.style.width = \"100%\";\r\n\t\tobj.style.height = \"100%\";\r\n\t\tobj.cmp = \"grid\";\r\n\r\n\t\tdocument.body.appendChild(obj);\r\n\t\tthis.attachObject(obj.id);\r\n\t\tthis.dataType = \"gantt\";\r\n\t\tthis.dataObj = gantt;\r\n\r\n\t\tvar that = this.vs[this.av];\r\n\t\tthat.grid = gantt;\r\n\r\n\t\tgantt.init(obj.id, start, end);\r\n\t\tobj.firstChild.style.border = \"none\";\r\n\r\n\t\tthat.gridId = obj.id;\r\n\t\tthat.gridObj = obj;\r\n\r\n\t\tvar method_name=\"_viewRestore\";\r\n\t\treturn this.vs[this[method_name]()].grid;\r\n\t};\r\n\r\n}\r\nif (typeof(window.dhtmlXCellObject) != \"undefined\") {\r\n\r\n\twindow.dhtmlXCellObject.prototype.attachGantt=function(start, end, gantt){\r\n\t\tgantt = gantt || window.gantt;\r\n\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"gantt_\"+gantt.uid();\r\n\t\tobj.style.width = \"100%\";\r\n\t\tobj.style.height = \"100%\";\r\n\t\tobj.cmp = \"grid\";\r\n\r\n\t\tdocument.body.appendChild(obj);\r\n\t\tthis.attachObject(obj.id);\r\n\r\n\t\tthis.dataType = \"gantt\";\r\n\t\tthis.dataObj = gantt;\r\n\r\n\t\tgantt.init(obj.id, start, end);\r\n\t\tobj.firstChild.style.border = \"none\";\r\n\r\n\t\tobj = null;\r\n\t\tthis.callEvent(\"_onContentAttach\",[]);\r\n\r\n\t\treturn this.dataObj;\r\n\t};\r\n}\r\n\r\nexport default null;","import env from \"../../../utils/env\";\r\nimport eventable from \"../../../utils/eventable\";\r\nimport { IScale, TModifierKeys } from \"../../common/config\";\r\n\r\ninterface ITimelineZoomConfig {\r\n\thandler?: (e: Event) => {};\r\n\tstartDate?: Date;\r\n\tendDate?: Date;\r\n\tlevels: IZoomLevel[];\r\n\tactiveLevelIndex?: number;\r\n\twidthStep?: number;\r\n\tminColumnWidth?: number;\r\n\tmaxColumnWidth?: number;\r\n\tuseKey?: \"ctrlKey\" | \"altKey\" | \"shiftKey\";\r\n\ttrigger?: \"wheel\" | null | undefined;\r\n\telement?: Element | (() => Element);\r\n}\r\n\r\nconst USE_KEY = [\"ctrlKey\", \"altKey\", \"shiftKey\", \"metaKey\"];\r\n\r\ninterface IZoomLevel {\r\n\tname?: string;\r\n\tscale_height?: number;\r\n\tmin_column_width: number;\r\n\tscales: IScale[];\r\n}\r\n\r\nconst _defaultScales = [\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"month\",\r\n\t\t\tdate: \"%M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"hour\",\r\n\t\t\tdate: \"%H:00\",\r\n\t\t\tstep: 8\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t{\r\n\t\t\tunit: \"day\",\r\n\t\t\tdate: \"%d %M\",\r\n\t\t\tstep: 1\r\n\t\t},\r\n\t\t{\r\n\t\t\tunit: \"hour\",\r\n\t\t\tdate: \"%H:00\",\r\n\t\t\tstep: 1\r\n\t\t}\r\n\t]\r\n];\r\n\r\nexport default class TimelineZoom {\r\n\tpublic attachEvent: (eventName: string, handler: () => void) => string;\r\n\tpublic callEvent: (eventName: string, args: any[]) => any;\r\n\tpublic detachEvent: (eventName: string) => any;\r\n\tprotected _initialStartDate: Date;\r\n\tprotected _initialEndDate: Date;\r\n\tprotected _activeLevelIndex: number;\r\n\tprotected _levels: IZoomLevel[];\r\n\tprotected _handler: (e: any) => void;\r\n\tprotected $gantt;\r\n\tprotected _widthStep: number;\r\n\tprotected _minColumnWidth: number;\r\n\tprotected _maxColumnWidth: number;\r\n\tprotected _useKey: TModifierKeys;\r\n\tprotected _visibleDate: Date;\r\n\tprotected _initialized: boolean;\r\n\tprotected _domEvents: any;\r\n\r\n\tconstructor(gantt) {\r\n\t\tthis.$gantt = gantt;\r\n\t\tthis._domEvents = this.$gantt._createDomEventScope();\r\n\t}\r\n\r\n\tpublic init(config: ITimelineZoomConfig) {\r\n\t\t// GS-1354 and GS-1318. If we check the headless mode using the function,\r\n\t\t// it will return false when Gantt is not initialized, but we may want to do it later\r\n\t\tif(this.$gantt.env.isNode){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._initialStartDate = config.startDate;\r\n\t\tthis._initialEndDate = config.endDate;\r\n\t\tthis._activeLevelIndex = config.activeLevelIndex ? config.activeLevelIndex : 0;\r\n\t\tthis._levels = this._mapScales(config.levels || _defaultScales);\r\n\t\tthis._handler = config.handler || this._defaultHandler;\r\n\t\tthis._minColumnWidth = config.minColumnWidth || 60;\r\n\t\tthis._maxColumnWidth = config.maxColumnWidth || 240;\r\n\t\tthis._widthStep = config.widthStep || 3/8 * config.minColumnWidth;\r\n\t\tthis._useKey = config.useKey;\r\n\r\n\t\tif(!this._initialized){\r\n\t\t\teventable(this);\r\n\t\t\tthis.$gantt.attachEvent(\"onGanttScroll\", () => {\r\n\t\t\t\tthis._getVisibleDate();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\r\n\t\tif(config.trigger === \"wheel\"){\r\n\t\t\tif(this.$gantt.$root){\r\n\t\t\t\tthis._attachWheelEvent(config);\r\n\t\t\t}else{\r\n\t\t\t\tthis.$gantt.attachEvent(\"onGanttReady\", () => {\r\n\t\t\t\t\tthis._attachWheelEvent(config);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._initialized = true;\r\n\t\tthis.setLevel(this._activeLevelIndex);\r\n\t}\r\n\r\n\tpublic zoomIn = () => {\r\n\t\tconst index = this.getCurrentLevel() - 1;\r\n\t\tif(index < 0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.setLevel(index);\r\n\t};\r\n\r\n\tpublic zoomOut = () => {\r\n\t\tconst index = this.getCurrentLevel() + 1;\r\n\t\tif(index > this._levels.length - 1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.setLevel(index);\r\n\t};\r\n\r\n\tpublic getCurrentLevel = () => {\r\n\t\treturn this._activeLevelIndex;\r\n\t};\r\n\r\n\tpublic getLevels = () => {\r\n\t\treturn this._levels;\r\n\t};\r\n\r\n\tpublic setLevel = (level: number|string) => {\r\n\t\tconst zoomLevel = this._getZoomIndexByName(level);\r\n\r\n\t\tif(zoomLevel === -1){\r\n\t\t\tthis.$gantt.assert(zoomLevel !== -1, \"Invalid zoom level for gantt.ext.zoom.setLevel. \" + level + \" is not an expected value.\");\r\n\t\t}\r\n\t\tthis._setLevel(zoomLevel, 0);\r\n\t};\r\n\r\n\tprotected _getZoomIndexByName = (levelName: number|string) => {\r\n\t\tlet zoomLevel:number = -1;\r\n\t\tif(typeof levelName === \"string\"){\r\n\t\t\tif(!isNaN(Number(levelName)) && this._levels[Number(levelName)]){\r\n\t\t\t\tzoomLevel = Number(levelName);\r\n\t\t\t}else{\r\n\t\t\t\tfor(let i = 0; i < this._levels.length; i++){\r\n\t\t\t\t\tif(this._levels[i].name === levelName){\r\n\t\t\t\t\t\tzoomLevel = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tzoomLevel = levelName;\r\n\t\t}\r\n\t\treturn zoomLevel;\r\n\t};\r\n\r\n\tprotected _mapScales(levels: IScale[][] | any): IZoomLevel[]{\r\n\t\treturn levels.map((l) => {\r\n\t\t\tif(Array.isArray(l)){\r\n\t\t\t\treturn {\r\n\t\t\t\t\tscales: l\r\n\t\t\t\t};\r\n\t\t\t}else{\r\n\t\t\t\treturn l;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprotected _getVisibleDate = () => {\r\n\t\t// GS-1450. Don't try to get the visible date if there is no timeline\r\n\t\tif (!this.$gantt.$task){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst scrollPos = this.$gantt.getScrollState().x;\r\n\t\tconst viewPort = this.$gantt.$task.offsetWidth;\r\n\t\tthis._visibleDate = this.$gantt.dateFromPos(scrollPos + viewPort/2);\r\n\t};\r\n\r\n\tprotected _setLevel = (level: number, cursorOffset: number) => {\r\n\t\tthis._activeLevelIndex = level;\r\n\r\n\t\tconst gantt = this.$gantt;\r\n\t\tconst nextConfig = gantt.copy(this._levels[this._activeLevelIndex]);\r\n\t\tconst chartConfig = gantt.copy(nextConfig);\r\n\t\tdelete chartConfig.name;\r\n\r\n\t\tgantt.mixin(gantt.config, chartConfig, true);\r\n\r\n\t\tconst isRendered = !!gantt.$root && !!gantt.$task;\r\n\r\n\t\tif(isRendered){\r\n\t\t\tif(cursorOffset){\r\n\t\t\t\tconst cursorDate = this.$gantt.dateFromPos(cursorOffset + this.$gantt.getScrollState().x);\r\n\t\t\t\tthis.$gantt.render();\r\n\t\t\t\tconst newPosition = this.$gantt.posFromDate(cursorDate);\r\n\t\t\t\tthis.$gantt.scrollTo(newPosition - cursorOffset);\r\n\t\t\t}else{\r\n\t\t\t\tconst viewPort = this.$gantt.$task.offsetWidth;\r\n\t\t\t\tif(!this._visibleDate){\r\n\t\t\t\t\tthis._getVisibleDate();\r\n\t\t\t\t}\r\n\t\t\t\tconst middleDate = this._visibleDate;\r\n\t\t\t\tthis.$gantt.render();\r\n\t\t\t\tconst newPosition = this.$gantt.posFromDate(middleDate);\r\n\t\t\t\tthis.$gantt.scrollTo(newPosition - viewPort/2);\r\n\t\t\t}\r\n\r\n\t\t\tthis.callEvent(\"onAfterZoom\", [this._activeLevelIndex, nextConfig]);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _attachWheelEvent = (config) => {\r\n\t\tconst event = env.isFF ? \"wheel\" : \"mousewheel\";\r\n\t\tlet el: Element;\r\n\t\tif(typeof config.element === \"function\"){\r\n\t\t\tel = config.element();\r\n\t\t}else{\r\n\t\t\tel = config.element as Element;\r\n\t\t}\r\n\t\tif (!el){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(el, event, this.$gantt.bind(function(e) {\r\n\t\t\tif (this._useKey) {\r\n\t\t\t\tif (USE_KEY.indexOf(this._useKey) < 0) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!e[this._useKey]) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (typeof this._handler === \"function\") {\r\n\t\t\t\tthis._handler.apply(this, [e]);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}, this), {passive: false});\r\n\t};\r\n\r\n\tprivate _defaultHandler = (e: any):void => {\r\n\t\tconst timelineOffset = this.$gantt.$task.getBoundingClientRect().x;\r\n\t\tconst cursorOffset = e.clientX - timelineOffset;\r\n\t\tconst wheelY = this.$gantt.env.isFF ? (e.deltaY*-40) : e.wheelDelta;\r\n\t\tlet wheelUp = false;\r\n\t\tif (wheelY > 0) {\r\n\t\t\twheelUp = true;\r\n\t\t}\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t\tthis._setScaleSettings(wheelUp, cursorOffset);\r\n\t};\r\n\r\n\tprivate _setScaleSettings(wheelUp: boolean, cursorOffset: number) {\r\n\t\tif (wheelUp) {\r\n\t\t\tthis._stepUp(cursorOffset);\r\n\t\t} else {\r\n\t\t\tthis._stepDown(cursorOffset);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate _setScaleDates = () => {\r\n\t\tif(this._initialStartDate && this._initialEndDate){\r\n\t\t\tthis.$gantt.config.start_date = this._initialStartDate;\r\n\t\t\tthis.$gantt.config.end_date = this._initialEndDate;\r\n\t\t}\r\n\t};\r\n\r\n\tprivate _stepUp(cursorOffset) {\r\n\t\tif (this._activeLevelIndex >= this._levels.length - 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet nextLevel = this._activeLevelIndex;\r\n\t\tthis._setScaleDates();\r\n\r\n\t\tif(this._widthStep){\r\n\t\t\tlet newColumnWidth = this.$gantt.config.min_column_width + this._widthStep;\r\n\t\t\tif (newColumnWidth > this._maxColumnWidth) {\r\n\t\t\t\tnewColumnWidth = this._minColumnWidth;\r\n\t\t\t\tnextLevel++;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$gantt.config.min_column_width = newColumnWidth;\r\n\t\t}else{\r\n\t\t\tnextLevel++;\r\n\t\t}\r\n\t\tthis._setLevel(nextLevel, cursorOffset);\r\n\t}\r\n\tprivate _stepDown(cursorOffset) {\r\n\t\tif (this._activeLevelIndex < 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet nextLevel = this._activeLevelIndex;\r\n\t\tthis._setScaleDates();\r\n\r\n\t\tif(this._widthStep){\r\n\t\t\tlet newColumnWidth = this.$gantt.config.min_column_width - this._widthStep;\r\n\t\t\tif (newColumnWidth < this._minColumnWidth) {\r\n\t\t\t\tnewColumnWidth = this._maxColumnWidth;\r\n\t\t\t\tnextLevel--;\r\n\t\t\t}\r\n\t\t\tthis.$gantt.config.min_column_width = newColumnWidth;\r\n\t\t}else{\r\n\t\t\tnextLevel--;\r\n\t\t}\r\n\t\tthis._setLevel(nextLevel, cursorOffset);\r\n\t}\r\n}","export default function(gantt) {\r\n\r\n\tgantt.config.touch_drag = 75; //nearly immediate dnd\r\n\tgantt.config.touch = true;\r\n\tgantt.config.touch_feedback = true;\r\n\tgantt.config.touch_feedback_duration = 1;\r\n\tgantt._prevent_touch_scroll = false;\r\n\r\n\r\n\tgantt._touch_feedback = function () {\r\n\t\tif (gantt.config.touch_feedback) {\r\n\t\t\tif (navigator.vibrate)\r\n\t\t\t\tnavigator.vibrate(gantt.config.touch_feedback_duration);\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif (gantt.$container)\t{\r\n\t\t\taddTouchEvents();\r\n\t\t}\r\n\t});\r\n\tgantt.attachEvent(\"onGanttLayoutReady\", function(){\r\n\t\tif (gantt.$container)\t{\r\n\t\t\t\tgantt.attachEvent(\"onGanttRender\", addTouchEvents, {once: true});\r\n\t\t}\r\n\t});\r\n\r\n\tfunction addTouchEvents(){\r\n\t\tif (gantt.config.touch != \"force\")\r\n\t\t\tgantt.config.touch = gantt.config.touch &&\r\n\t\t\t\t((navigator.userAgent.indexOf(\"Mobile\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"iPad\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Android\") != -1) ||\r\n\t\t\t\t\t(navigator.userAgent.indexOf(\"Touch\") != -1)) ||\r\n\t\t\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\t\tif (gantt.config.touch) {\r\n\r\n\t\t\tvar touchEventsSupported = true;\r\n\t\t\ttry {\r\n\t\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t\t} catch (e) {\r\n\t\t\t\ttouchEventsSupported = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (touchEventsSupported) {\r\n\t\t\t\tgantt._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function () {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t} else if (window.navigator.pointerEnabled) {\r\n\t\t\t\tgantt._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function (ev) {\r\n\t\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t\t});\r\n\t\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\t\tgantt._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\t\treturn ev;\r\n\t\t\t\t}, function (ev) {\r\n\t\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tfunction findTargetView(event){\r\n\t\tvar allViews = gantt.$layout.getCellsByType(\"viewCell\");\r\n\r\n\t\tfor(var i = 0; i < allViews.length; i++){\r\n\t\t\tvar box = allViews[i].$view.getBoundingClientRect();\r\n\t\t\tif(event.clientX >= box.left && event.clientX <= box.right &&\r\n\t\t\t\tevent.clientY <= box.bottom && event.clientY >= box.top){\r\n\t\t\t\t\treturn allViews[i];\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getScrollState(view){\r\n\t\tvar scrollX = view.$config.scrollX ? gantt.$ui.getView(view.$config.scrollX) : null;\r\n\t\tvar scrollY = view.$config.scrollY ? gantt.$ui.getView(view.$config.scrollY) : null;\r\n\r\n\t\tvar scrollState = {x: null, y: null};\r\n\t\tif(scrollX){\r\n\t\t\tvar state = scrollX.getScrollState();\r\n\t\t\tif(state.visible){\r\n\t\t\t\tscrollState.x = scrollX.$view.scrollLeft;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(scrollY){\r\n\t\t\tvar state = scrollY.getScrollState();\r\n\t\t\tif(state.visible){\r\n\t\t\t\tscrollState.y = scrollY.$view.scrollTop;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn scrollState;\r\n\t}\r\n\r\n\tfunction scrollView(view, left, top){\r\n\t\tvar scrollX = view.$config.scrollX ? gantt.$ui.getView(view.$config.scrollX) : null;\r\n\t\tvar scrollY = view.$config.scrollY ? gantt.$ui.getView(view.$config.scrollY) : null;\r\n\r\n\t\tif(scrollX){\r\n\t\t\tscrollX.scrollTo(left, null);\r\n\t\t}\r\n\t\tif(scrollY){\r\n\t\t\tscrollY.scrollTo(null, top);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getTaskDND(){\r\n\t\tvar tasksDnD;\r\n\t\tif(gantt.$ui.getView(\"timeline\")){\r\n\t\t\ttasksDnD = gantt.$ui.getView(\"timeline\")._tasks_dnd;\r\n\t\t}\r\n\t\treturn tasksDnD;\r\n\t}\r\n\r\n\tvar touchHandlers = [];\r\n\r\n//we can't use native scrolling, as we need to sync momentum between different parts\r\n//so we will block native scroll and use the custom one\r\n//in future we can add custom momentum\r\n\tgantt._touch_events = function (names, accessor, ignore) {\r\n\t\t//webkit on android need to be handled separately\r\n\t\tvar dblclicktime = 0;\r\n\t\tvar actionMode = false;\r\n\t\tvar scrollMode = false;\r\n\t\tvar actionStart = null;\r\n\t\tvar scrollState;\r\n\t\tvar longTapTimer = null;\r\n\t\tvar currentDndId = null;\r\n\t\tvar dndNodes = [];\r\n\t\tvar targetView = null;\r\n\t\tlet multiTouchEvents = {};\r\n\r\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\r\n\t\t\tgantt.eventRemove(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\r\n\t\t}\r\n\t\ttouchHandlers = [];\r\n\r\n\t\t//touch move\r\n\t\ttouchHandlers.push([gantt.$container, names[0], function (e) {\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\t\tif (ignore(e)) return;\r\n\r\n\t\t\t\t//ignore common and scrolling moves\r\n\t\t\t\tif (!actionMode) return;\r\n\r\n\t\t\t\tif (longTapTimer) clearTimeout(longTapTimer);\r\n\r\n\t\t\t\tvar source = accessor(e);\r\n\t\t\t\tif (tasksDnD && (tasksDnD.drag.id || tasksDnD.drag.start_drag)) {\r\n\t\t\t\t\ttasksDnD.on_mouse_move(source);\r\n\t\t\t\t\tif (e.preventDefault)\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\te.cancelBubble = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!gantt._prevent_touch_scroll) {\r\n\t\t\t\t\tif (source && actionStart) {\r\n\t\t\t\t\t\tvar dx = actionStart.pageX - source.pageX;\r\n\t\t\t\t\t\tvar dy = actionStart.pageY - source.pageY;\r\n\t\t\t\t\t\tif (!scrollMode && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {\r\n\t\t\t\t\t\t\tscrollMode = true;\r\n\t\t\t\t\t\t\t//gantt._touch_scroll_active = scroll_mode = true;\r\n\t\t\t\t\t\t\tdblclicktime = 0;\r\n\r\n\t\t\t\t\t\t\tif(targetView){\r\n\t\t\t\t\t\t\t\tscrollState = getScrollState(targetView);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tscrollState = gantt.getScrollState();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (scrollMode) {\r\n\r\n\t\t\t\t\t\t\tvar newScrollState;\r\n\t\t\t\t\t\t\tvar scrollX = scrollState.x + dx;\r\n\t\t\t\t\t\t\tvar scrollY = scrollState.y + dy;\r\n\t\t\t\t\t\t\tif(targetView){\r\n\t\t\t\t\t\t\t\tscrollView(targetView, scrollX, scrollY);\r\n\t\t\t\t\t\t\t\tnewScrollState = getScrollState(targetView);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tgantt.scrollTo(scrollX, scrollY);\r\n\t\t\t\t\t\t\t\tnewScrollState = gantt.getScrollState();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ((scrollState.x != newScrollState.x && dy > 2 * dx) ||\r\n\t\t\t\t\t\t\t\t(scrollState.y != newScrollState.y && dx > 2 * dy )) {\r\n\t\t\t\t\t\t\t\treturn block_action(e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn block_action(e);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}]);\r\n\r\n\t\t// prevent page drag on touch move\r\n\t\ttry{\r\n\t\t\tdocument.addEventListener('touchmove', function(e) {\r\n\t\t\t\tif (gantt._touch_drag) {\r\n\t\t\t\t\tblock_action(e);\r\n\t\t\t\t}\r\n\t\t\t}, { passive: false });\r\n\t\t}\r\n\t\tcatch(e){\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.warn(\"Cannot prevent touch event for the page drag\");\r\n\t\t}\r\n\r\n\t\t//block touch context menu in IE10\r\n\t\ttouchHandlers.push([this.$container, \"contextmenu\", function (e) {\r\n\t\t\tif (actionMode)\r\n\t\t\t\treturn block_action(e);\r\n\t\t}]);\r\n\r\n\t\t//touch start\r\n\t\ttouchHandlers.push([this.$container, names[1], function (e) {\r\n\t\t\tmultiTouchEvents = e.touches.length;\r\n\t\t\t// block pull-to-refresh\r\n\t\t\tif(document && document.body){\r\n\t\t\t\tdocument.body.classList.add(\"gantt_touch_active\");\r\n\t\t\t}\r\n\r\n\t\t\tif (ignore(e)) return;\r\n\t\t\tif (e.touches && e.touches.length > 1) {\r\n\t\t\t\tactionMode = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tactionStart = accessor(e);\r\n\t\t\ttargetView = findTargetView(actionStart);\r\n\t\t\tif (!gantt._locate_css(actionStart, \"gantt_hor_scroll\") && !gantt._locate_css(actionStart, \"gantt_ver_scroll\")) {\r\n\t\t\t\tactionMode = true;\r\n\t\t\t}\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\t//long tap\r\n\t\t\tlongTapTimer = setTimeout(function () {\r\n\t\t\t\tvar taskId = gantt.locate(actionStart);\r\n\t\t\t\tif (tasksDnD && (taskId && !gantt._locate_css(actionStart, \"gantt_link_control\") && !gantt._locate_css(actionStart, \"gantt_grid_data\"))) {\r\n\t\t\t\t\ttasksDnD.on_mouse_down(actionStart);\r\n\r\n\t\t\t\t\tif (tasksDnD.drag && tasksDnD.drag.start_drag) {\r\n\t\t\t\t\t\t// we need that as touch events break if the target node is removed from the DOM\r\n\t\t\t\t\t\tcloneTaskRendered(taskId);\r\n\t\t\t\t\t\ttasksDnD._start_dnd(actionStart);\r\n\t\t\t\t\t\tgantt._touch_drag = true;\r\n\r\n\t\t\t\t\t\tgantt.refreshTask(taskId);\r\n\r\n\t\t\t\t\t\tgantt._touch_feedback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlongTapTimer = null;\r\n\t\t\t}, gantt.config.touch_drag);\r\n\t\t}]);\r\n\r\n\t\t//touch end\r\n\t\ttouchHandlers.push([this.$container, names[2], function (e) {\r\n\t\t\tif(document && document.body){\r\n\t\t\t\tdocument.body.classList.remove(\"gantt_touch_active\");\r\n\t\t\t}\r\n\t\t\tif (ignore(e)) return;\r\n\t\t\tif (longTapTimer) clearTimeout(longTapTimer);\r\n\t\t\tgantt._touch_drag = false;\r\n\t\t\tactionMode = false;\r\n\t\t\tvar source = accessor(e);\r\n\r\n\t\t\tvar tasksDnD = getTaskDND();\r\n\r\n\t\t\tif(tasksDnD)\r\n\t\t\t\ttasksDnD.on_mouse_up(source);\r\n\r\n\t\t\tif (currentDndId && gantt.isTaskExists(currentDndId)) {\r\n\t\t\t\tgantt.refreshTask(currentDndId);\r\n\t\t\t\tif(dndNodes.length){\r\n\t\t\t\t\tdndNodes.forEach(function(node){\r\n\t\t\t\t\t\tif(node.parentNode){\r\n\t\t\t\t\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tgantt._touch_feedback();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//gantt._touch_scroll_active = action_mode = scroll_mode = false;\r\n\t\t\tactionMode = scrollMode = false;\r\n\t\t\tdndNodes = [];\r\n\t\t\tcurrentDndId = null;\r\n\r\n\t\t\t//dbl-tap handling\r\n\t\t\tif (actionStart && dblclicktime) {\r\n\t\t\t\tvar now = new Date();\r\n\t\t\t\t// doubletap shouldn't happen with multitouch\r\n\t\t\t\tif ((now - dblclicktime) < 500 && multiTouchEvents <= 1) {\r\n\r\n\t\t\t\t\tvar mouseEvents = gantt.$services.getService(\"mouseEvents\");\r\n\t\t\t\t\tmouseEvents.onDoubleClick(actionStart);\r\n\t\t\t\t\tblock_action(e);\r\n\t\t\t\t} else\r\n\t\t\t\t\tdblclicktime = now;\r\n\t\t\t} else {\r\n\t\t\t\tdblclicktime = new Date();\r\n\t\t\t}\r\n\t\t}]);\r\n\r\n\t\tfor(var i = 0; i < touchHandlers.length; i++){\r\n\t\t\tgantt.event(touchHandlers[i][0], touchHandlers[i][1], touchHandlers[i][2]);\r\n\t\t}\r\n\r\n\t\t//common helper, prevents event\r\n\t\tfunction block_action(e) {\r\n\t\t\tif (e && e.preventDefault && e.cancelable){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfunction cloneTaskRendered(taskId) {\r\n\t\t\tconst renders = gantt._getTaskLayers();\r\n\t\t\tlet task = gantt.getTask(taskId);\r\n\t\t\tif (task) {\r\n\t\t\t\tlet visible = gantt.isTaskVisible(taskId);\r\n\t\t\t\tif (visible){\r\n\t\t\t\t\tcurrentDndId = taskId;\r\n\t\t\t\t\tfor (let i = 0; i < renders.length; i++) {\r\n\t\t\t\t\t\ttask = renders[i].rendered[taskId];\r\n\t\t\t\t\t\tif (task && task.getAttribute(gantt.config.task_attribute) && task.getAttribute(gantt.config.task_attribute) == taskId) {\r\n\t\t\t\t\t\t\tconst copy = task.cloneNode(true);\r\n\t\t\t\t\t\t\tdndNodes.push(task);\r\n\t\t\t\t\t\t\trenders[i].rendered[taskId] = copy;\r\n\t\t\t\t\t\t\ttask.style.display = \"none\";\r\n\t\t\t\t\t\t\tcopy.className += \" gantt_drag_move \";\r\n\t\t\t\t\t\t\ttask.parentNode.appendChild(copy);\r\n\t\t\t\t\t\t\t//return copy;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (task.$split_subtask){\r\n\t\t\t\t\tlet renderedParent = task.$rendered_parent;\r\n\t\t\t\t\tvisible = gantt.isTaskVisible(renderedParent);\r\n\t\t\t\t\tif (!visible){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcurrentDndId = taskId;\r\n\t\t\t\t\tfor (let i = 0; i < renders.length; i++) {\r\n\t\t\t\t\t\tconst parent = renders[i].rendered[renderedParent];\r\n\t\t\t\t\t\tlet taskNode;\r\n\t\t\t\t\t\tif (parent && parent.childNodes){\r\n\t\t\t\t\t\t\ttaskNode = parent.querySelector(`[${gantt.config.task_attribute}=\"${task.id}\"]`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (taskNode) {\r\n\t\t\t\t\t\t\t// move the child node to a different parent as the task bar will be repainted\r\n\t\t\t\t\t\t\t// and the initial node will be lost\r\n\t\t\t\t\t\t\tconst copy = taskNode.cloneNode(true);\r\n\t\t\t\t\t\t\ttaskNode.parentNode.appendChild(copy);\r\n\r\n\t\t\t\t\t\t\tgantt.$task_bars.appendChild(taskNode);\r\n\t\t\t\t\t\t\ttaskNode.style.display = \"none\";\r\n\r\n\t\t\t\t\t\t\t// don't add the node as rendered otherwise it will be lost:\r\n\t\t\t\t\t\t\t// renders[i].rendered[taskId] = taskNode;\r\n\t\t\t\t\t\t\t// instead, add it to dndNodes as its elements will be removed after drag\r\n\t\t\t\t\t\t\tdndNodes.push(taskNode);\r\n\r\n\t\t\t\t\t\t\ttaskNode = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n};","function dummy() {\r\n\t// eslint-disable-next-line\r\n\tconsole.log(\"Method is not implemented.\"); \r\n}\r\nfunction BaseControl() {\r\n}\r\n\r\n// base methods will be runned in gantt context\r\nBaseControl.prototype.render = dummy; // arguments: sns\r\nBaseControl.prototype.set_value = dummy; // arguments: node, value, ev, sns(config)\r\nBaseControl.prototype.get_value = dummy; // arguments node, ev, sns(config)\r\nBaseControl.prototype.focus = dummy; // arguments: node\r\n\r\nexport default function(gantt) { // we could send current instance of gantt to module\r\n\treturn BaseControl;\r\n};","import * as helpers from \"../../../utils/helpers\";\r\n\r\nvar htmlHelpers = {\r\n\tgetHtmlSelect: function(options, attributes, value) {\r\n\t\tvar innerHTML = \"\";\r\n\t\tvar _this = this;\r\n\r\n\t\toptions = options || [];\r\n\t\t\r\n\t\thelpers.forEach(options, function(entry) {\r\n\t\t\tvar _attributes = [{ key: \"value\", value: entry.key }];\r\n\r\n\t\t\tif (value == entry.key) {\r\n\t\t\t\t_attributes[_attributes.length] = { key: \"selected\", value: \"selected\" };\r\n\t\t\t}\r\n\t\t\tif (entry.attributes) {\r\n\t\t\t\t_attributes = _attributes.concat(entry.attributes);\r\n\t\t\t}\r\n\t\t\tinnerHTML += _this.getHtmlOption({ innerHTML: entry.label }, _attributes);\r\n\t\t});\r\n\r\n\t\treturn _getHtmlContainer(\"select\", { innerHTML: innerHTML }, attributes);\r\n\t},\r\n\tgetHtmlOption: function(options, attributes) { return _getHtmlContainer(\"option\", options, attributes); },\r\n\tgetHtmlButton: function(options, attributes) { return _getHtmlContainer(\"button\", options, attributes); },\r\n\tgetHtmlDiv: function(options, attributes) { return _getHtmlContainer(\"div\", options, attributes); },\r\n\tgetHtmlLabel: function(options, attributes) { return _getHtmlContainer(\"label\", options, attributes); },\r\n\tgetHtmlInput: function(attributes) {\r\n\t\treturn \" \";\r\n\t}\r\n};\r\n\r\nfunction _getHtmlContainer(tag, options, attributes) {\r\n\tvar html;\r\n\r\n\toptions = options || [];\r\n\t\r\n\thtml = \"<\" + tag + _getHtmlAttributes(attributes || []) + \">\" + (options.innerHTML || \"\") + \"\" + tag +\">\";\r\n\treturn html;\r\n\r\n}\r\n\r\nfunction _getHtmlAttributes(attributes) {\r\n\tvar html = \"\";\r\n\r\n\thelpers.forEach(attributes, function(entry) {\r\n\t\thtml += \" \" + entry.key + \"='\" + entry.value + \"'\";\r\n\t});\r\n\treturn html;\r\n}\r\n\r\nexport default htmlHelpers;","import __extends from \"../../../../utils/extends\";\r\nimport htmlHelpers from \"../../utils/html_helpers\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction SelectControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\t\r\n\t\treturn self; \r\n\t}\r\n\t\r\n\t__extends(SelectControl, _super);\r\n\t\r\n\tSelectControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\thtml += htmlHelpers.getHtmlSelect(sns.options, [{ key: \"style\", value: \"width:100%;\" }, { key: \"title\", value: sns.name }]);\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tSelectControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar select = node.firstChild;\r\n\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\tselect.onchange = sns.onchange;\r\n\t\t\tselect._dhx_onchange = true;\r\n\t\t}\r\n\t\tif (typeof value === \"undefined\")\r\n\t\t\tvalue = (select.options[0] || {}).value;\r\n\t\tselect.value = value || \"\";\r\n\t};\r\n\t\r\n\tSelectControl.prototype.get_value = function(node) {\r\n\t\treturn node.firstChild.value;\r\n\t};\r\n\t\r\n\tSelectControl.prototype.focus = function(node) {\r\n\t\tvar a = node.firstChild;\r\n\t\tgantt._focus(a, true);\r\n\t};\r\n\t\r\n\treturn SelectControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\nimport SelectControl from \"./select_control\";\r\nexport default function(gantt) {\r\n\tvar _super = SelectControl(gantt);\r\n\r\n\tfunction ParentControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(ParentControl, _super);\r\n\r\n\r\n\tParentControl.prototype.render = function(sns) {\r\n\t\treturn _display(sns, false);\r\n\t};\r\n\r\n\tParentControl.prototype.set_value = function(node, value, ev, config) {\r\n\t\t// GS-1051. If the value is `0`, the set_value function in the select control won't select \r\n\t\t// the first child because (0 || '') = '';\r\n\t\tif (value === 0) value = \"0\";\r\n\r\n\t\tvar tmpDom = document.createElement(\"div\");\r\n\t\ttmpDom.innerHTML = _display(config, ev.id);\r\n\t\tvar newOptions = tmpDom.removeChild(tmpDom.firstChild);\r\n\t\tnode.onselect = null;\r\n\t\tnode.parentNode.replaceChild(newOptions, node);\r\n\r\n\t\treturn gantt.form_blocks.select.set_value.apply(gantt, [newOptions, value, ev, config]);\r\n\t};\r\n\r\n\tfunction _display(config, item_id) {\r\n\t\tvar tasks = [],\r\n\t\t\toptions = [];\r\n\t\tif (item_id) {\r\n\t\t\ttasks = gantt.getTaskByTime();\r\n\t\t\tif (config.allow_root) {\r\n\t\t\t\ttasks.unshift({id: gantt.config.root_id, text: config.root_label || \"\"});\r\n\t\t\t}\r\n\t\t\ttasks = _filter(tasks, config, item_id);\r\n\t\t\tif (config.sort) {\r\n\t\t\t\ttasks.sort(config.sort);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar text = config.template || gantt.templates.task_text;\r\n\t\tfor (var i = 0; i < tasks.length; i++) {\r\n\t\t\tvar label = text.apply(gantt, [tasks[i].start_date, tasks[i].end_date, tasks[i]]);\r\n\t\t\tif (label === undefined) {\r\n\t\t\t\tlabel = \"\";\r\n\t\t\t}\r\n\t\t\toptions.push({\r\n\t\t\t\tkey: tasks[i].id,\r\n\t\t\t\tlabel: label\r\n\t\t\t});\r\n\t\t}\r\n\t\tconfig.options = options;\r\n\t\tconfig.map_to = config.map_to || \"parent\";\r\n\t\treturn gantt.form_blocks.select.render.apply(this, arguments);\r\n\t}\r\n\r\n\tfunction _filter(options, config, item_id) {\r\n\t\tvar filter = config.filter || function() {\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\t\toptions = options.slice(0);\r\n\r\n\t\tfor (var i = 0; i < options.length; i++) {\r\n\t\t\tvar task = options[i];\r\n\t\t\tif (task.id == item_id || gantt.isChildOf(task.id, item_id) || filter(task.id, task) === false) {\r\n\t\t\t\toptions.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\treturn ParentControl;\r\n};","import TemplateControlConstructor from \"./controls/template_control\";\r\nimport TextareaControlConstructor from \"./controls/textarea_control\";\r\nimport TimeControlConstructor from \"./controls/time_control\";\r\nimport SelectControlConstructor from \"./controls/select_control\";\r\nimport CheckboxControlConstructor from \"./controls/checkbox_control\";\r\nimport RadioControlConstructor from \"./controls/radio_control\";\r\nimport DurationControlConstructor from \"./controls/duration_control\";\r\nimport ParentControlConstructor from \"./controls/parent_control\";\r\nimport ResourcesControlConstructor from \"./controls/resources_control\";\r\nimport ConstraintControlConstructor from \"./controls/constraint_control\";\r\nimport TypeselectControlConstructor from \"./controls/typeselect_control\";\r\nimport BaselineControlConstructor from \"./controls/baseline_control\";\r\n\r\nimport * as domHelpers from \"../utils/dom_helpers\";\r\nimport * as helpers from \"../../../utils/helpers\";\r\n\t\r\n\r\nexport default function (gantt) {\r\n\r\n\r\n\tvar TemplateControl = TemplateControlConstructor(gantt);\r\n\tvar TextareaControl = TextareaControlConstructor(gantt);\r\n\tvar TimeControl = TimeControlConstructor(gantt);\r\n\tvar SelectControl = SelectControlConstructor(gantt);\r\n\tvar CheckboxControl = CheckboxControlConstructor(gantt);\r\n\tvar RadioControl = RadioControlConstructor(gantt);\r\n\tvar DurationControl = DurationControlConstructor(gantt);\r\n\tvar ParentControl = ParentControlConstructor(gantt);\r\n\tvar ResourcesControl = ResourcesControlConstructor(gantt);\r\n\tvar ConstraintControl = ConstraintControlConstructor(gantt);\r\n\tvar TypeselectControl = TypeselectControlConstructor(gantt);\r\n\tvar BaselineControl = BaselineControlConstructor(gantt);\r\n\r\n\tgantt._lightbox_methods = {};\r\n\tgantt._lightbox_template = \"
\";\r\n\tgantt._lightbox_template = `
`;\r\n\r\n\t// GS-1952. Attaching the lightbox to the BODY element is not considered secure.\r\n\t// Attach it to Gantt container for Salesforce and other secure environments\r\n\tgantt._lightbox_root = gantt.$root;\r\n\tfunction setParentNode() {\r\n\t\tconst cspEnvironment = gantt.config.csp === true;\r\n\t\tconst salesforceEnvironment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"] || ('$shadowResolver$' in document.body);\r\n\t\tif (cspEnvironment || salesforceEnvironment) {\r\n\t\t\tgantt._lightbox_root = gantt.$root;\r\n\t\t} else {\r\n\t\t\tgantt._lightbox_root = document.body;\r\n\t\t}\r\n\t}\r\n\r\n\t//TODO: gantt._lightbox_id is changed from data.js and accessed from autoscheduling, check if it can be removed from gantt object\r\n\tvar state = gantt.$services.getService(\"state\");\r\n\tstate.registerProvider(\"lightbox\", function () {\r\n\t\treturn {\r\n\t\t\tlightbox: gantt._lightbox_id\r\n\t\t};\r\n\t});\r\n\r\n\tgantt.showLightbox = function (id) {\r\n\t\tvar task = this.getTask(id);\r\n\t\tif (!this.callEvent(\"onBeforeLightbox\", [id])) {\r\n\t\t\tif(gantt.isTaskExists(id) && gantt.getTask(id).$new){\r\n\t\t\t\t//GS-2340 if 'onBeforeLightbox' returns 'false' need update the order in datastore\r\n\t\t\t\tthis.$data.tasksStore._updateOrder();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar box = this.getLightbox(this.getTaskType(task.type));\r\n\r\n\t\tthis.showCover(box);\r\n\t\tthis._fill_lightbox(id, box);\r\n\t\tthis._setLbPosition(box);\r\n\t\tthis._waiAria.lightboxVisibleAttr(box);\r\n\r\n\t\tthis.callEvent(\"onLightbox\", [id]);\r\n\t};\r\n\r\n\tfunction _is_chart_visible(gantt) {\r\n\t\tvar timeline = gantt.$ui.getView(\"timeline\");\r\n\t\tif (timeline && timeline.isVisible()) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgantt._get_timepicker_step = function () {\r\n\t\tif (this.config.round_dnd_dates) {\r\n\t\t\tvar step;\r\n\t\t\tif (_is_chart_visible(this)) {\r\n\t\t\t\tvar scale = gantt.getScale();\r\n\t\t\t\tstep = (helpers.getSecondsInUnit(scale.unit) * scale.step) / 60;//timepicker step is measured in minutes\r\n\t\t\t}\r\n\r\n\t\t\tif (!step || step >= 60 * 24) {\r\n\t\t\t\tstep = this.config.time_step;\r\n\t\t\t}\r\n\t\t\treturn step;\r\n\t\t}\r\n\t\treturn this.config.time_step;\r\n\t};\r\n\tgantt.getLabel = function (property, key) {\r\n\t\tvar sections = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < sections.length; i++) {\r\n\t\t\tif (sections[i].map_to == property) {\r\n\t\t\t\tvar options = sections[i].options;\r\n\t\t\t\tfor (var j = 0; j < options.length; j++) {\r\n\t\t\t\t\tif (options[j].key == key) {\r\n\t\t\t\t\t\treturn options[j].label;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t};\r\n\r\n\tgantt.updateCollection = function (list_name, collection) {\r\n\t\tcollection = collection.slice(0);\r\n\t\tvar list = gantt.serverList(list_name);\r\n\t\tif (!list) return false;\r\n\t\tlist.splice(0, list.length);\r\n\t\tlist.push.apply(list, collection || []);\r\n\t\tgantt.resetLightbox();\r\n\t};\r\n\tgantt.getLightboxType = function () {\r\n\t\treturn this.getTaskType(this._lightbox_type);\r\n\t};\r\n\tgantt.getLightbox = function (type) {\r\n\t\tvar lightboxDiv;\r\n\t\tvar fullWidth;\r\n\t\tvar html;\r\n\t\tvar sns;\r\n\t\tvar ds;\r\n\t\tvar classNames = \"\";\r\n\t\tsetParentNode();\r\n\r\n\t\tif (type === undefined)\r\n\t\t\ttype = this.getLightboxType();\r\n\r\n\t\tif (!this._lightbox || this.getLightboxType() != this.getTaskType(type)) {\r\n\t\t\tthis._lightbox_type = this.getTaskType(type);\r\n\t\t\tlightboxDiv = document.createElement(\"div\");\r\n\t\t\tclassNames = \"gantt_cal_light\";\r\n\t\t\tfullWidth = this._is_lightbox_timepicker();\r\n\r\n\t\t\tif (gantt.config.wide_form)\r\n\t\t\t\tclassNames += \" gantt_cal_light_wide\";\r\n\r\n\t\t\tif (fullWidth) {\r\n\t\t\t\tclassNames += \" gantt_cal_light_full\";\r\n\t\t\t}\r\n\r\n\t\t\tlightboxDiv.className = classNames;\r\n\r\n\t\t\tlightboxDiv.style.visibility = \"hidden\";\r\n\t\t\thtml = this._lightbox_template;\r\n\t\t\thtml += \"\";\r\n\t\t\thtml += getHtmlButtons(this.config.buttons_left);\r\n\t\t\thtml += \"
\";\r\n\t\t\thtml += getHtmlButtons(this.config.buttons_right, true);\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\tlightboxDiv.innerHTML = html;\r\n\r\n\t\t\tgantt._waiAria.lightboxAttr(lightboxDiv);\r\n\r\n\t\t\tif (gantt.config.drag_lightbox) {\r\n\t\t\t\tlightboxDiv.firstChild.onmousedown = gantt._ready_to_dnd;\r\n\t\t\t\tlightboxDiv.firstChild.ontouchstart = function (e){\r\n\t\t\t\t\tgantt._ready_to_dnd(e.touches[0]);\r\n\t\t\t\t};\r\n\t\t\t\tlightboxDiv.firstChild.onselectstart = function () {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t};\r\n\t\t\t\tlightboxDiv.firstChild.style.cursor = \"pointer\";\r\n\t\t\t\tgantt._init_dnd_events();\r\n\t\t\t}\r\n\r\n\t\t\t// GS-1428: If there is lightbox node, we need to remove it from the DOM\r\n\t\t\tif (this._lightbox){\r\n\t\t\t\tthis.resetLightbox();\r\n\t\t\t}\r\n\t\t\tshow_cover();\r\n\t\t\tthis._cover.insertBefore(lightboxDiv, this._cover.firstChild);\r\n\t\t\tthis._lightbox = lightboxDiv;\r\n\r\n\t\t\tsns = this._get_typed_lightbox_config(type);\r\n\t\t\thtml = this._render_sections(sns);\r\n\r\n\t\t\tds = lightboxDiv.querySelector(\"div.gantt_cal_larea\");\r\n\t\t\t\r\n\t\t\t//GS-1131. If gantt_cal_larea is displayed, Firefox renders buttons incorrectly;\r\n\t\t\tvar backup_overflow = ds.style.overflow;\r\n\t\t\tds.style.overflow = 'hidden';\r\n\r\n\t\t\tds.innerHTML = html;\r\n\r\n\t\t\t\r\n\r\n\t\t\tbindLabelsToInputs(sns);\r\n\r\n\t\t\tds.style.overflow = backup_overflow;\r\n\r\n\t\t\tthis._init_lightbox_events(this);\r\n\t\t\tlightboxDiv.style.display = \"none\";\r\n\t\t\tlightboxDiv.style.visibility = \"visible\";\r\n\t\t}\r\n\t\treturn this._lightbox;\r\n\t};\r\n\r\n\tgantt._render_sections = function (sns) {\r\n\t\tvar html = \"\";\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar block = this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id = \"area_\" + this.uid();\r\n\r\n\t\t\tvar display = sns[i].hidden ? \" style='display:none'\" : \"\";\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button) {\r\n\t\t\t\tbutton = \"\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"\" +\r\n\t\t\t\t\"\";\r\n\t\t\t}\r\n\t\t\tif (this.config.wide_form) {\r\n\t\t\t\thtml += \"\";\r\n\t\t\t}\r\n\t\t\thtml += \"
\" + button + this.locale.labels[\"section_\" + sns[i].name] + \"
\" + block.render.call(this, sns[i]);\r\n\t\t\thtml += \"
\";\r\n\t\t}\r\n\t\treturn html;\r\n\t};\r\n\r\n\tgantt._center_lightbox = function(box){\r\n\t\tgantt._setLbPosition(box);\r\n\t};\r\n\tgantt._setLbPosition = function(box) {\r\n\t\tif(!box){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst rootElement = gantt._lightbox_root || gantt.$root;\r\n\t\tbox.style.top = Math.max(rootElement.offsetHeight / 2 - box.offsetHeight/2, 0) + \"px\";\r\n\t\tbox.style.left = Math.max(rootElement.offsetWidth / 2 - box.offsetWidth/2, 0) + \"px\";\r\n\t};\r\n\r\n\tgantt.showCover = function (box) {\r\n\t\tif (box){\r\n\t\t\tbox.style.display=\"block\";\r\n\t\r\n\t\t\tthis._setLbPosition(box);\r\n\t\t}\r\n\t\tshow_cover();\r\n\t\tthis._cover.style.display = \"\";\r\n\t};\r\n\tconst show_cover=function(){\r\n\t\tif(gantt._cover) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\tgantt._cover=document.createElement(\"div\");\r\n\t\tgantt._cover.className=\"gantt_cal_cover\";\r\n\t\tgantt._cover.style.display = \"none\";\r\n\t\r\n\t\tgantt.event(gantt._cover, \"mousemove\", gantt._move_while_dnd);\r\n\t\tgantt.event(gantt._cover, \"mouseup\", gantt._finish_dnd);\r\n\t\r\n\t\tconst rootElement = gantt._lightbox_root || gantt.$root;\r\n\t\trootElement.appendChild(gantt._cover);\r\n\t};\r\n\r\n\tgantt._init_lightbox_events = function () {\r\n\t\tgantt.lightbox_events = {};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_save_btn = function () {\r\n\t\t\tgantt._save_lightbox();\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_delete_btn = function () {\r\n\t\t\tgantt._lightbox_current_type = null;\r\n\t\t\tif (!gantt.callEvent(\"onLightboxDelete\", [gantt._lightbox_id]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tif (gantt.isTaskExists(gantt._lightbox_id)) {\r\n\t\t\t\tgantt.$click.buttons[\"delete\"](gantt._lightbox_id);\r\n\t\t\t} else {\r\n\t\t\t\tgantt.hideLightbox();\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events.gantt_cancel_btn = function () {\r\n\t\t\tgantt._cancel_lightbox();\r\n\t\t};\r\n\r\n\r\n\t\tgantt.lightbox_events[\"default\"] = function (e, src) {\r\n\t\t\tif (src.getAttribute(\"data-dhx-button\")) {\r\n\t\t\t\tgantt.callEvent(\"onLightboxButton\", [src.className, src, e]);\r\n\t\t\t} else {\r\n\t\t\t\tvar index, block, sec;\r\n\r\n\t\t\t\tvar className = domHelpers.getClassName(src);\r\n\t\t\t\tif (className.indexOf(\"gantt_custom_button\") != -1) {\r\n\t\t\t\t\tif (className.indexOf(\"gantt_custom_button_\") != -1) {\r\n\t\t\t\t\t\tindex = src.parentNode.getAttribute(\"data-index\");\r\n\t\t\t\t\t\tsec = src;\r\n\t\t\t\t\t\twhile (sec && domHelpers.getClassName(sec).indexOf(\"gantt_cal_lsection\") == -1) {\r\n\t\t\t\t\t\t\tsec = sec.parentNode;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tindex = src.getAttribute(\"data-index\");\r\n\t\t\t\t\t\tsec = src.parentNode;\r\n\t\t\t\t\t\tsrc = src.firstChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar sections = gantt._get_typed_lightbox_config();\r\n\r\n\t\t\t\tif (index) {\r\n\t\t\t\t\tindex = index * 1;\r\n\t\t\t\t\tblock = gantt.form_blocks[sections[index * 1].type];\r\n\t\t\t\t\tblock.button_click(index, src, sec, sec.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.event(gantt.getLightbox(), \"click\", function (e) {\r\n\t\t\tif(e.target.closest(\".gantt_cal_ltitle_close_btn\")){\r\n\t\t\t\tgantt._cancel_lightbox();\r\n\t\t\t}\r\n\t\t\tvar src = domHelpers.getTargetNode(e);\r\n\r\n\t\t\tvar className = domHelpers.getClassName(src);\r\n\t\t\tif (!className) {\r\n\t\t\t\tsrc = src.previousSibling;\r\n\t\t\t\tclassName = domHelpers.getClassName(src);\r\n\t\t\t}\r\n\t\t\tif (src && className && className.indexOf(\"gantt_btn_set\") === 0) {\r\n\t\t\t\tsrc = src.firstChild;\r\n\t\t\t\tclassName = domHelpers.getClassName(src);\r\n\t\t\t}\r\n\t\t\tif (src && className) {\r\n\t\t\t\tvar func = gantt.defined(gantt.lightbox_events[src.className]) ? gantt.lightbox_events[src.className] : gantt.lightbox_events[\"default\"];\r\n\t\t\t\treturn func(e, src);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\tgantt.getLightbox().onkeydown = function (e) {\r\n\t\t\tvar event = e || window.event;\r\n\t\t\tvar target = e.target || e.srcElement;\r\n\t\t\tvar buttonTarget = domHelpers.getClassName(target).indexOf(\"gantt_btn_set\") > -1;\r\n\r\n\t\t\tswitch ((e || event).keyCode) {\r\n\t\t\t\tcase gantt.constants.KEY_CODES.SPACE: {\r\n\t\t\t\t\tif ((e || event).shiftKey) return;\r\n\t\t\t\t\tif (buttonTarget && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase gantt.keys.edit_save:\r\n\t\t\t\t\tif ((e || event).shiftKey) return;\r\n\t\t\t\t\tif (buttonTarget && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tgantt._save_lightbox();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase gantt.keys.edit_cancel:\r\n\t\t\t\t\tgantt._cancel_lightbox();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\tgantt._cancel_lightbox = function () {\r\n\t\tvar task = this.getLightboxValues();\r\n\t\tgantt._lightbox_current_type = null;\r\n\t\tthis.callEvent(\"onLightboxCancel\", [this._lightbox_id, task.$new]);\r\n\t\tif (gantt.isTaskExists(task.id) && task.$new) {\r\n\t\t\tthis.silent(function () {\r\n\t\t\t\tgantt.$data.tasksStore.removeItem(task.id);\r\n\t\t\t\tgantt._update_flags(task.id, null);\r\n\t\t\t});\r\n\t\t\tthis.refreshData();\r\n\t\t}\r\n\r\n\t\tthis.hideLightbox();\r\n\t};\r\n\r\n\tgantt._save_lightbox = function () {\r\n\t\tvar task = this.getLightboxValues();\r\n\t\tgantt._lightbox_current_type = null;\r\n\t\tif (!this.callEvent(\"onLightboxSave\", [this._lightbox_id, task, !!task.$new]))\r\n\t\t\treturn;\r\n\r\n\t\t// GS-2170. Do not recalculate the indexes and dates of other tasks\r\n\t\t// as they will be recalculated in the `refreshData`\r\n\t\tgantt.$data.tasksStore._skipTaskRecalculation = \"lightbox\";\r\n\t\tif (task.$new) {\r\n\t\t\tdelete task.$new;\r\n\t\t\tthis.addTask(task, task.parent, this.getTaskIndex(task.id));\r\n\t\t} else if (this.isTaskExists(task.id)) {\r\n\t\t\tthis.mixin(this.getTask(task.id), task, true);\r\n\t\t\tthis.refreshTask(task.id);\r\n\t\t\tthis.updateTask(task.id);\r\n\t\t}\r\n\t\tgantt.$data.tasksStore._skipTaskRecalculation = false;\r\n\t\tthis.refreshData();\r\n\r\n\t\t// TODO: do we need any blockable events here to prevent closing lightbox?\r\n\t\tthis.hideLightbox();\r\n\t};\r\n\r\n\tgantt._resolve_default_mapping = function (section) {\r\n\t\tvar mapping = section.map_to;\r\n\t\tvar time_controls = { \"time\": true, \"time_optional\": true, \"duration\": true, \"duration_optional\": true };\r\n\t\tif (time_controls[section.type]) {\r\n\t\t\tif (section.map_to == \"auto\") {\r\n\t\t\t\tmapping = { start_date: \"start_date\", end_date: \"end_date\", duration: \"duration\" };\r\n\t\t\t} else if (typeof (section.map_to) === \"string\") {\r\n\t\t\t\tmapping = { start_date: section.map_to };\r\n\t\t\t}\r\n\t\t} else if (section.type === \"constraint\") {\r\n\t\t\tif (!section.map_to || typeof (section.map_to) === \"string\") {\r\n\t\t\t\tmapping = { constraint_type: \"constraint_type\", constraint_date: \"constraint_date\" };\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn mapping;\r\n\t};\r\n\r\n\tgantt.getLightboxValues = function () {\r\n\t\tvar task = {};\r\n\r\n\t\tif (gantt.isTaskExists(this._lightbox_id)) {\r\n\t\t\ttask = this.mixin({}, this.getTask(this._lightbox_id));\r\n\t\t}\r\n\r\n\t\tvar sns = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar node = gantt._lightbox_root.querySelector(\"#\" + sns[i].id);\r\n\t\t\tnode = (node ? node.nextSibling : node);\r\n\t\t\tvar block = this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue;\r\n\t\t\tvar res = block.get_value.call(this, node, task, sns[i]);\r\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\r\n\t\t\tif (typeof map_to == \"string\" && map_to != \"auto\") {\r\n\t\t\t\ttask[map_to] = res;\r\n\t\t\t} else if (typeof map_to == \"object\") {\r\n\t\t\t\tfor (var property in map_to) {\r\n\t\t\t\t\tif (map_to[property])\r\n\t\t\t\t\t\ttask[map_to[property]] = res[property];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// GS-1282 We need to preserve the task type even if the lightbox doesn't have the typeselect section\r\n\t\t// GS-2460 set the current type from selector\r\n\t\tif (gantt._lightbox_current_type) {\r\n\t\t\ttask.type = gantt._lightbox_current_type;\r\n\t\t}\r\n\r\n\t\treturn task;\r\n\t};\r\n\r\n\r\n\tgantt.hideLightbox = function () {\r\n\t\tvar box = this.getLightbox();\r\n\t\tif (box) box.style.display = \"none\";\r\n\r\n\t\tthis._waiAria.lightboxHiddenAttr(box);\r\n\t\tthis._lightbox_id = null;\r\n\r\n\t\tthis.hideCover(box);\r\n\t\tthis.resetLightbox();\r\n\t\tthis.callEvent(\"onAfterLightbox\", []);\r\n\t};\r\n\tgantt.hideCover = function (box) {\r\n\t\tif(box){\r\n\t\t\tbox.style.display = \"none\";\r\n\t\t}\r\n\t\tif (this._cover)\r\n\t\t\tthis._cover.parentNode.removeChild(this._cover);\r\n\t\tthis._cover = null;\r\n\t};\r\n\r\n\tgantt.resetLightbox = function () {\r\n\t\tif (gantt._lightbox && !gantt._custom_lightbox)\r\n\t\t\tgantt._lightbox.remove();\r\n\t\tgantt._lightbox = null;\r\n\t};\r\n\tgantt._set_lightbox_values = function (data, box) {\r\n\t\tvar task = data;\r\n\t\tvar s = box.getElementsByTagName(\"span\");\r\n\t\tvar lightboxHeader = [];\r\n\t\tif (gantt.templates.lightbox_header) {\r\n\t\t\tlightboxHeader.push(\"\");\r\n\t\t\tlightboxHeader.push(gantt.templates.lightbox_header(task.start_date, task.end_date, task));\r\n\t\t\ts[1].innerHTML = \"\";\r\n\t\t\ts[2].innerHTML = gantt.templates.lightbox_header(task.start_date, task.end_date, task);\r\n\t\t} else {\r\n\t\t\tlightboxHeader.push(this.templates.task_time(task.start_date, task.end_date, task));\r\n\t\t\tlightboxHeader.push(String(this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70)); //IE6 fix\r\n\t\t\ts[1].innerHTML = this.templates.task_time(task.start_date, task.end_date, task);\r\n\t\t\ts[2].innerHTML = String(this.templates.task_text(task.start_date, task.end_date, task) || \"\").substr(0, 70); //IE6 fix\r\n\t\t}\r\n\t\ts[1].innerHTML = lightboxHeader[0];\r\n\t\ts[2].innerHTML = lightboxHeader[1];\r\n\r\n\t\tgantt._waiAria.lightboxHeader(box, lightboxHeader.join(\" \"));\r\n\r\n\t\tvar sns = this._get_typed_lightbox_config(this.getLightboxType());\r\n\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\tvar section = sns[i];\r\n\r\n\t\t\tif (!this.form_blocks[section.type]) {\r\n\t\t\t\tcontinue;//skip incorrect sections, same check is done during rendering\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar node = gantt._lightbox_root.querySelector(\"#\" + section.id).nextSibling;\r\n\t\t\tvar block = this.form_blocks[section.type];\r\n\t\t\tvar map_to = gantt._resolve_default_mapping(sns[i]);\r\n\t\t\tvar value = this.defined(task[map_to]) ? task[map_to] : section.default_value;\r\n\t\t\tblock.set_value.call(gantt, node, value, task, section);\r\n\r\n\t\t\tif (section.focus)\r\n\t\t\t\tblock.focus.call(gantt, node);\r\n\t\t}\r\n\t\tif (gantt.isTaskExists(data.id)){\r\n\t\t\tgantt._lightbox_id = data.id;\r\n\t\t}\r\n\t};\r\n\tgantt._fill_lightbox = function (id, box) {\r\n\t\tvar task = this.getTask(id);\r\n\t\tthis._set_lightbox_values(task, box);\r\n\t};\r\n\r\n\r\n\tgantt.getLightboxSection = function (name) {\r\n\t\tvar config = this._get_typed_lightbox_config();\r\n\t\tvar i = 0;\r\n\t\tfor (i; i < config.length; i++)\r\n\t\t\tif (config[i].name == name)\r\n\t\t\t\tbreak;\r\n\t\tvar section = config[i];\r\n\t\tif (!section)\r\n\t\t\treturn null;\r\n\r\n\t\tif (!this._lightbox)\r\n\t\t\tthis.getLightbox();\r\n\t\tvar header = gantt._lightbox_root.querySelector(\"#\" + section.id);\r\n\t\tvar node = header.nextSibling;\r\n\r\n\t\tvar result = {\r\n\t\t\tsection: section,\r\n\t\t\theader: header,\r\n\t\t\tnode: node,\r\n\t\t\tgetValue: function (ev) {\r\n\t\t\t\treturn gantt.form_blocks[section.type].get_value.call(gantt, node, (ev || {}), section);\r\n\t\t\t},\r\n\t\t\tsetValue: function (value, ev) {\r\n\t\t\t\treturn gantt.form_blocks[section.type].set_value.call(gantt, node, value, (ev || {}), section);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar handler = this._lightbox_methods[\"get_\" + section.type + \"_control\"];\r\n\t\treturn handler ? handler(result) : result;\r\n\t};\r\n\r\n\tgantt._lightbox_methods.get_template_control = function (result) {\r\n\t\tresult.control = result.node;\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_select_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"select\")[0];\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_textarea_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"textarea\")[0];\r\n\t\treturn result;\r\n\t};\r\n\tgantt._lightbox_methods.get_time_control = function (result) {\r\n\t\tresult.control = result.node.getElementsByTagName(\"select\"); // array\r\n\t\treturn result;\r\n\t};\r\n\r\n\r\n\tgantt._init_dnd_events = function () {\r\n\t\tvar eventElement = gantt._lightbox_root;\r\n\t\tthis.event(eventElement, \"mousemove\", gantt._move_while_dnd);\r\n\t\tthis.event(eventElement, \"mouseup\", gantt._finish_dnd);\r\n\t\tthis.event(eventElement, \"touchmove\", function (e){\r\n\t\t\tgantt._move_while_dnd(e.touches[0]);\r\n\t\t});\r\n\t\tthis.event(eventElement, \"touchend\", function (e){\r\n\t\t\tgantt._finish_dnd(e.touches[0]);\r\n\t\t});\r\n\t\t// GS-1952: In Salesforce environment, the lightbox is attached to the Gantt container. \r\n\t\t// So when Gantt is reinitialized, the events are no longer attached to the Gantt container.\r\n\t\t// gantt._init_dnd_events = function () {\r\n\t\t// };\r\n\t};\r\n\tgantt._move_while_dnd = function (event) {\r\n\t\tif (gantt._dnd_start_lb) {\r\n\t\t\tif (!document.gantt_unselectable) {\r\n\t\t\t\tgantt._lightbox_root.className += \" gantt_unselectable\";\r\n\t\t\t\tdocument.gantt_unselectable = true;\r\n\t\t\t}\r\n\t\t\tvar lb = gantt.getLightbox();\r\n\t\t\tvar now = [event.pageX, event.pageY];\r\n\t\t\tlb.style.top = gantt._lb_start[1] + now[1] - gantt._dnd_start_lb[1] + \"px\";\r\n\t\t\tlb.style.left = gantt._lb_start[0] + now[0] - gantt._dnd_start_lb[0] + \"px\";\r\n\t\t}\r\n\t};\r\n\tgantt._ready_to_dnd = function (event) {\r\n\t\tvar lb = gantt.getLightbox();\r\n\t\tgantt._lb_start = [lb.offsetLeft, lb.offsetTop];\r\n\t\tgantt._dnd_start_lb = [event.pageX, event.pageY];\r\n\t};\r\n\tgantt._finish_dnd = function () {\r\n\t\tif (gantt._lb_start) {\r\n\t\t\tgantt._lb_start = gantt._dnd_start_lb = false;\r\n\t\t\tgantt._lightbox_root.className = gantt._lightbox_root.className.replace(\" gantt_unselectable\", \"\");\r\n\t\t\tdocument.gantt_unselectable = false;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tgantt._focus = function (node, select) {\r\n\t\tif (node && node.focus) {\r\n\t\t\tif (gantt.config.touch) {\r\n\t\t\t\t//do not focus editor, to prevent auto-zoom\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (select && node.select) node.select();\r\n\t\t\t\t\tnode.focus();\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t// silent errors\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tgantt.form_blocks = {\r\n\t\tgetTimePicker: function (sns, hidden) {\r\n\t\t\tvar html = \"\";\r\n\t\t\tvar cfg = this.config;\r\n\t\t\tvar i;\r\n\t\t\tvar options;\r\n\t\t\tvar ariaAttrs;\r\n\t\t\tvar readonly;\r\n\t\t\tvar display;\r\n\t\t\tvar settings = {\r\n\t\t\t\tfirst: 0,\r\n\t\t\t\tlast: 24 * 60,\r\n\t\t\t\tdate: this.date.date_part(new Date(gantt._min_date.valueOf())),\r\n\t\t\t\ttimeFormat: getTimeFormat(sns)\r\n\t\t\t};\r\n\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = { size: 0 };\r\n\r\n\t\t\tif (gantt.config.limit_time_select) {\r\n\t\t\t\tsettings.first = 60 * cfg.first_hour;\r\n\t\t\t\tsettings.last = 60 * cfg.last_hour + 1;\r\n\t\t\t\tsettings.date.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tfor (i = 0; i < settings.timeFormat.length; i++) {\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (i > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions = getHtmlTimePickerOptions(sns, i, settings);\r\n\r\n\t\t\t\tif (options) {\r\n\t\t\t\t\tariaAttrs = gantt._waiAria.lightboxSelectAttrString(settings.timeFormat[i]);\r\n\t\t\t\t\treadonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\tdisplay = hidden ? \" style='display:none' \" : \"\";\r\n\t\t\t\t\thtml += \"\" + options + \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tgetTimePickerValue: function (selects, config, offset) {\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar needSetTime = gantt.defined(map[3]);\r\n\r\n\t\t\tvar time;\r\n\t\t\tvar hours = 0;\r\n\t\t\tvar minutes = 0;\r\n\r\n\t\t\tvar mapOffset = offset || 0;\r\n\r\n\t\t\tif (needSetTime) {\r\n\t\t\t\ttime = parseInt(selects[map[3] + mapOffset].value, 10);\r\n\t\t\t\thours = Math.floor(time / 60);\r\n\t\t\t\tminutes = time % 60;\r\n\t\t\t}\r\n\t\t\treturn new Date(selects[map[2] + mapOffset].value, selects[map[1] + mapOffset].value, selects[map[0] + mapOffset].value, hours, minutes);\r\n\t\t},\r\n\r\n\t\t_fill_lightbox_select: function (s, i, d, map) {\r\n\t\t\ts[i + map[0]].value = d.getDate();\r\n\t\t\ts[i + map[1]].value = d.getMonth();\r\n\t\t\ts[i + map[2]].value = d.getFullYear();\r\n\t\t\tif (gantt.defined(map[3])) {\r\n\t\t\t\tvar v = d.getHours() * 60 + d.getMinutes();\r\n\t\t\t\tv = Math.round(v / gantt._get_timepicker_step()) * gantt._get_timepicker_step();\r\n\t\t\t\tvar input = s[i + map[3]];\r\n\t\t\t\tinput.value = v;\r\n\t\t\t\t//in case option not shown\r\n\t\t\t\tinput.setAttribute(\"data-value\", v);\r\n\t\t\t}\r\n\t\t},\r\n\t\ttemplate: new TemplateControl(),\r\n\t\ttextarea: new TextareaControl(),\r\n\t\tselect: new SelectControl(),\r\n\t\ttime: new TimeControl(),\r\n\t\tduration: new DurationControl(),\r\n\t\tparent: new ParentControl(),\r\n\t\tradio: new RadioControl(),\r\n\t\tcheckbox: new CheckboxControl(),\r\n\t\tresources: new ResourcesControl(),\r\n\t\tconstraint: new ConstraintControl(),\r\n\t\tbaselines: new BaselineControl(),\r\n\t\ttypeselect: new TypeselectControl()\r\n\t};\r\n\r\n\tgantt._is_lightbox_timepicker = function () {\r\n\t\tvar s = this._get_typed_lightbox_config();\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tif (s[i].name == \"time\" && s[i].type == \"time\")\r\n\t\t\t\treturn true;\r\n\t\treturn false;\r\n\t};\r\n\r\n\tgantt._simple_confirm = function (message, title, callback, ok) {\r\n\t\tif (!message)\r\n\t\t\treturn callback();\r\n\t\tvar opts = { text: message };\r\n\t\tif (title)\r\n\t\t\topts.title = title;\r\n\t\tif (ok) {\r\n\t\t\topts.ok = ok;\r\n\t\t}\r\n\t\tif (callback) {\r\n\t\t\topts.callback = function (result) {\r\n\t\t\t\tif (result)\r\n\t\t\t\t\tcallback();\r\n\t\t\t};\r\n\t\t}\r\n\t\tgantt.confirm(opts);\r\n\t};\r\n\r\n\tfunction _get_type_name(type_value) {\r\n\t\tfor (var i in this.config.types) {\r\n\t\t\tif (this.config.types[i] == type_value) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"task\";\r\n\t}\r\n\r\n\tgantt._get_typed_lightbox_config = function (type) {\r\n\t\tif (type === undefined) {\r\n\t\t\ttype = this.getLightboxType();\r\n\t\t}\r\n\r\n\t\tvar field = _get_type_name.call(this, type);\r\n\r\n\t\tif (gantt.config.lightbox[field + \"_sections\"]) {\r\n\t\t\treturn gantt.config.lightbox[field + \"_sections\"];\r\n\t\t} else {\r\n\t\t\treturn gantt.config.lightbox.sections;\r\n\t\t}\r\n\t};\r\n\r\n\tgantt._silent_redraw_lightbox = function (type) {\r\n\t\tvar oldType = this.getLightboxType();\r\n\r\n\t\tif (this.getState().lightbox) {\r\n\t\t\tvar taskId = this.getState().lightbox;\r\n\t\t\tvar formData = this.getLightboxValues(),\r\n\t\t\t\ttask = this.copy(this.getTask(taskId));\r\n\r\n\t\t\tthis.resetLightbox();\r\n\r\n\t\t\tvar updTask = this.mixin(task, formData, true);\r\n\t\t\tvar box = this.getLightbox(type ? type : undefined);\r\n\t\t\tthis._set_lightbox_values(updTask, box);\r\n\t\t\tthis.showCover(box);\r\n\t\t} else {\r\n\t\t\tthis.resetLightbox();\r\n\t\t\tthis.getLightbox(type ? type : undefined);\r\n\t\t}\r\n\t\tthis.callEvent(\"onLightboxChange\", [oldType, this.getLightboxType()]);\r\n\t};\r\n\r\n\tfunction bindLabelsToInputs(sns) {\r\n\t\tvar section;\r\n\t\tvar label;\r\n\t\tvar labelBlock;\r\n\t\tvar inputBlock;\r\n\t\tvar input;\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 0; i < sns.length; i++) {\r\n\t\t\tsection = sns[i];\r\n\t\t\tlabelBlock = gantt._lightbox_root.querySelector(\"#\" + section.id);\r\n\r\n\t\t\tif (!section.id || !labelBlock) continue;\r\n\r\n\t\t\tlabel = labelBlock.querySelector(\"label\");\r\n\t\t\tinputBlock = labelBlock.nextSibling;\r\n\r\n\t\t\tif (!inputBlock) continue;\r\n\r\n\t\t\tinput = inputBlock.querySelector(\"input, select, textarea\");\r\n\t\t\tif (input) {\r\n\t\t\t\tinput.id = input.id || \"input_\" + gantt.uid();\r\n\t\t\t\tsection.inputId = input.id;\r\n\t\t\t\tlabel.setAttribute(\"for\", section.inputId);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getHtmlButtons(buttons, floatRight) {\r\n\t\tvar button;\r\n\t\tvar ariaAttr;\r\n\t\tvar html = \"\";\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 0; i < buttons.length; i++) {\r\n\t\t\t// needed to migrate from 'dhx_something' to 'gantt_something' naming in a lightbox\r\n\t\t\tbutton = gantt.config._migrate_buttons[buttons[i]] ? gantt.config._migrate_buttons[buttons[i]] : buttons[i];\r\n\r\n\t\t\tariaAttr = gantt._waiAria.lightboxButtonAttrString(button);\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\t\treturn html;\r\n\t}\r\n\r\n\tfunction getTimeFormat(sns) {\r\n\t\tvar scale;\r\n\t\tvar unit;\r\n\t\tvar result;\r\n\r\n\t\tif (sns.time_format) return sns.time_format;\r\n\r\n\t\t// default order\r\n\t\tresult = [\"%d\", \"%m\", \"%Y\"];\r\n\t\tscale = gantt.getScale();\r\n\t\tunit = scale ? scale.unit : gantt.config.duration_unit;\r\n\t\tif (helpers.getSecondsInUnit(unit) < helpers.getSecondsInUnit(\"day\")) {\r\n\t\t\tresult.push(\"%H:%i\");\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tfunction getHtmlTimePickerOptions(sns, index, settings) {\r\n\t\tvar range;\r\n\t\tvar offset;\r\n\t\tvar start_year;\r\n\t\tvar end_year;\r\n\t\tvar i;\r\n\t\tvar time;\r\n\t\tvar diff;\r\n\t\tvar tdate;\r\n\t\tvar html = \"\";\r\n\r\n\t\tswitch (settings.timeFormat[index]) {\r\n\t\t\tcase \"%Y\":\r\n\t\t\t\tsns._time_format_order[2] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//year\r\n\r\n\t\t\t\tif (sns.year_range) {\r\n\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t// if\r\n\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trange = range || 10;\r\n\t\t\t\toffset = offset || Math.floor(range / 2);\r\n\t\t\t\tstart_year = start_year || settings.date.getFullYear() - offset;\r\n\t\t\t\tend_year = end_year || gantt.getState().max_date.getFullYear() + offset;\r\n\r\n\t\t\t\tfor (i = start_year; i < end_year; i++)\r\n\t\t\t\t\thtml += \"\" + (i) + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%m\":\r\n\t\t\t\tsns._time_format_order[1] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//month\r\n\t\t\t\tfor (i = 0; i < 12; i++)\r\n\t\t\t\t\thtml += \"\" + gantt.locale.date.month_full[i] + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%d\":\r\n\t\t\t\tsns._time_format_order[0] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//days\r\n\t\t\t\tfor (i = 1; i < 32; i++)\r\n\t\t\t\t\thtml += \"\" + i + \" \";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%H:%i\":\r\n\t\t\t\t// var last = 24*60, first = 0;\r\n\t\t\t\tsns._time_format_order[3] = index;\r\n\t\t\t\tsns._time_format_order.size++;\r\n\t\t\t\t//hours\r\n\t\t\t\ti = settings.first;\r\n\t\t\t\ttdate = settings.date.getDate();\r\n\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\twhile (i < settings.last) {\r\n\t\t\t\t\ttime = gantt.templates.time_picker(settings.date);\r\n\t\t\t\t\thtml += \"\" + time + \" \";\r\n\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\tsettings.date.setTime(settings.date.valueOf() + gantt._get_timepicker_step() * 60 * 1000);\r\n\t\t\t\t\tdiff = (settings.date.getDate() != tdate) ? 1 : 0; // moved or not to the next day\r\n\t\t\t\t\ti = diff * 24 * 60 + settings.date.getHours() * 60 + settings.date.getMinutes();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn html;\r\n\t}\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TemplateControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(TemplateControl, _super);\r\n\r\n\r\n\tTemplateControl.prototype.render = function(sns) {\r\n\t\tlet height = sns.height ? `${sns.height}px` : '';\r\n\t\treturn `
`;\r\n\t};\r\n\r\n\tTemplateControl.prototype.set_value = function(node, value) {\r\n\t\tnode.innerHTML = value || \"\";\r\n\t};\r\n\r\n\tTemplateControl.prototype.get_value = function(node) {\r\n\t\treturn node.innerHTML || \"\";\r\n\t};\r\n\r\n\tTemplateControl.prototype.focus = function() {};\r\n\r\n\treturn TemplateControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TextareaControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(TextareaControl, _super);\r\n\r\n\tTextareaControl.prototype.render = function(sns) {\r\n\t\tconst height = (sns.height || \"130\") + \"px\";\r\n\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\treturn `
`;\r\n\t};\r\n\r\n\tTextareaControl.prototype.set_value = function(node, value) {\r\n\t\tgantt.form_blocks.textarea._get_input(node).value = value || \"\";\r\n\t};\r\n\r\n\tTextareaControl.prototype.get_value = function(node) {\r\n\t\treturn gantt.form_blocks.textarea._get_input(node).value;\r\n\t};\r\n\r\n\tTextareaControl.prototype.focus = function(node) {\r\n\t\tvar a = gantt.form_blocks.textarea._get_input(node);\r\n\t\tgantt._focus(a, true);\r\n\t};\r\n\r\n\tTextareaControl.prototype._get_input = function(node) {\r\n\t\treturn node.querySelector(\"textarea\");\r\n\t};\r\n\r\n\treturn TextareaControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TimeControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TimeControl, _super);\r\n\r\n\tTimeControl.prototype.render = function (sns) {\r\n\t\tvar time = gantt.form_blocks.getTimePicker.call(this, sns);\r\n\t\tlet sectionClassName = \"gantt_section_time\";\r\n\t\tif (sns.name !== \"time\"){\r\n\t\t\tsectionClassName += \" gantt_section_\" + sns.name;\r\n\t\t}\r\n\t\tvar html = \"\";\r\n\t\thtml += time;\r\n\r\n\t\tif (sns.single_date) {\r\n\t\t\ttime = gantt.form_blocks.getTimePicker.call(this, sns, true);\r\n\t\t\thtml += \" \";\r\n\t\t} else {\r\n\t\t\thtml += \" – \";\r\n\t\t}\r\n\r\n\t\thtml += time;\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tTimeControl.prototype.set_value = function (node, value, ev, config) {\r\n\t\tvar cfg = config;\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\r\n\t\tif (cfg.auto_end_date) {\r\n\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\tstart_date = new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, 0, 0);\r\n\t\t\t\tend_date = gantt.calculateEndDate({ start_date: start_date, duration: 1, task: ev });\r\n\t\t\t\tgantt.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\r\n\t\t\t};\r\n\t\t\tfor (var i = 0; i < 4; i++) {\r\n\t\t\t\ts[i].onchange = _update_lightbox_select;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar mapping = gantt._resolve_default_mapping(config);\r\n\r\n\t\tif (typeof (mapping) === \"string\") mapping = { start_date: mapping };\r\n\r\n\t\tvar start_date = ev[mapping.start_date] || new Date();\r\n\t\tvar end_date = ev[mapping.end_date] || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, cfg);\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, map.size, end_date, map, cfg);\r\n\t};\r\n\r\n\tTimeControl.prototype.get_value = function (node, ev, config) {\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar startDate;\r\n\t\tvar map = config._time_format_order;\r\n\t\tfunction _getEndDate(selects, map, startDate) {\r\n\t\t\tvar endDate = gantt.form_blocks.getTimePickerValue(selects, config, map.size);\r\n\t\t\t// GS-1010: We need to add a way to obtain exact end_date for validation\r\n\t\t\tif (endDate <= startDate) { // when end date seems wrong\r\n\t\t\t\tif (config.autofix_end !== false || config.single_date) { // auto correct it in two cases - when the auto correction is not disabled, or when we have 'single date' control and the user don't have the UI to specify the end date\r\n\t\t\t\t\treturn gantt.date.add(startDate, gantt._get_timepicker_step(), \"minute\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn endDate;\r\n\t\t}\r\n\r\n\t\tstartDate = gantt.form_blocks.getTimePickerValue(selects, config);\r\n\r\n\t\tif (typeof gantt._resolve_default_mapping(config) === \"string\") {\r\n\t\t\treturn startDate;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: startDate,\r\n\t\t\tend_date: _getEndDate(selects, map, startDate)\r\n\t\t};\r\n\t};\r\n\r\n\tTimeControl.prototype.focus = function (node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\treturn TimeControl;\r\n};","import * as helpers from \"../../../../utils/helpers\";\r\nimport __extends from \"../../../../utils/extends\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction CheckboxControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(CheckboxControl, _super);\r\n\r\n\tCheckboxControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tif (sns.options && sns.options.length) {\r\n\t\t\tfor (var i = 0; i < sns.options.length; i++) {\r\n\t\t\t\thtml += \" \" + sns.options[i].label + \" \";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tsns.single_value = true;\r\n\t\t\thtml += \" \";\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tCheckboxControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar checkboxes = Array.prototype.slice.call(node.querySelectorAll(\"input[type=checkbox]\"));\r\n\r\n\t\tif (!node._dhx_onchange && sns.onchange) {\r\n\t\t\tnode.onchange = sns.onchange;\r\n\t\t\tnode._dhx_onchange = true;\r\n\t\t}\r\n\r\n\t\tif(sns.single_value){\r\n\t\t\tvar box = checkboxes[0];\r\n\t\t\tbox.checked = !!value;\r\n\t\t}else{\r\n\t\t\thelpers.forEach(checkboxes, function(entry) {\r\n\t\t\t\tentry.checked = value ? value.indexOf(entry.value) >= 0 : false;\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tCheckboxControl.prototype.get_value = function(node, task, sns) {\r\n\t\tif(sns.single_value){\r\n\t\t\tvar box = node.querySelector(\"input[type=checkbox]\");\r\n\t\t\treturn box.checked;\r\n\t\t}else{\r\n\t\t\treturn helpers.arrayMap(Array.prototype.slice.call(node.querySelectorAll(\"input[type=checkbox]:checked\")), function(entry) {\r\n\t\t\t\treturn entry.value;\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tCheckboxControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.querySelector(\"input[type=checkbox]\"));\r\n\t};\r\n\r\n\treturn CheckboxControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\nimport Super from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction RadioControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\t__extends(RadioControl, _super);\r\n\r\n\tRadioControl.prototype.render = function(sns) {\r\n\t\tconst height = sns.height ? `${sns.height}px` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tif (sns.options && sns.options.length) {\r\n\t\t\tfor (var i = 0; i < sns.options.length; i++) {\r\n\t\t\t\thtml += \" \" + sns.options[i].label + \" \";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tRadioControl.prototype.set_value = function(node, value, ev, sns) {\r\n\t\tvar radio;\r\n\r\n\t\tif (!sns.options || !sns.options.length) return;\r\n\r\n\t\tradio = node.querySelector(\"input[type=radio][value='\" + value + \"']\") ||\r\n\t\t\t\tnode.querySelector(\"input[type=radio][value='\" + sns.default_value + \"']\");\r\n\r\n\t\tif (!radio) return;\r\n\r\n\t\tif (!node._dhx_onchange && sns.onchange) {\r\n\t\t\tnode.onchange = sns.onchange;\r\n\t\t\tnode._dhx_onchange = true;\r\n\t\t}\r\n\r\n\t\tradio.checked = true;\r\n\t};\r\n\r\n\tRadioControl.prototype.get_value = function(node, ev) {\r\n\t\tvar result = node.querySelector(\"input[type=radio]:checked\");\r\n\r\n\t\treturn result ? result.value : \"\";\r\n\t};\r\n\r\n\tRadioControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.querySelector(\"input[type=radio]\"));\r\n\t};\r\n\r\n\treturn RadioControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport DurationFormatterNumeric from \"../../../common/duration_formatter_numeric\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction DurationControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || new DurationFormatterNumeric();\r\n\t}\r\n\r\n\t__extends(DurationControl, _super);\r\n\r\n\tDurationControl.prototype.render = function(sns) {\r\n\t\tvar time = \"\" + gantt.form_blocks.getTimePicker.call(this, sns) + \"
\";\r\n\t\tvar label = \" \"+ gantt.locale.labels[gantt.config.duration_unit + \"s\"] +\" \";\r\n\t\tvar singleDate = sns.single_date ? \" style='display:none'\" : \"\";\r\n\t\tvar readonly = sns.readonly ? \" disabled='disabled'\" : \"\";\r\n\t\tvar ariaAttr = gantt._waiAria.lightboxDurationInputAttrString(sns);\r\n\r\n\t\tvar durationInputClass = \"gantt_duration_value\";\r\n\t\tif(sns.formatter) {\r\n\t\t\tlabel = \"\";\r\n\t\t\tdurationInputClass += \" gantt_duration_value_formatted\" ;\r\n\t\t}\r\n\r\n\t\tvar duration = \"\" +\r\n\t\t\t\"\";\r\n\t\tlet sectionClassName = \"gantt_section_time gantt_section_duration\";\r\n\t\tif (sns.name !== \"time\"){\r\n\t\t\tsectionClassName += \" gantt_section_\" + sns.name;\r\n\t\t}\t\r\n\t\tvar html = \"\" + time + \" \" + duration + \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tDurationControl.prototype.set_value = function(node, value, ev, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar inps = node.getElementsByTagName(\"input\");\r\n\t\tvar duration = inps[1];\r\n\t\tvar btns = [inps[0], inps[2]];\r\n\t\tvar endspan = node.getElementsByTagName(\"span\")[0];\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar mapping;\r\n\t\tvar start_date;\r\n\t\tvar end_date;\r\n\t\tvar duration_val;\r\n\r\n\t\tfunction _calc_date() {\r\n\t\t\tvar start_date = _getStartDate.call(gantt, node, config);\r\n\t\t\tvar duration = _getDuration.call(gantt, node, config);\r\n\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: ev});\r\n\r\n\t\t\tvar template = gantt.templates.task_end_date || gantt.templates.task_date;\r\n\t\t\tendspan.innerHTML = template(end_date);\r\n\t\t}\r\n\r\n\t\tfunction _change_duration(step) {\r\n\t\t\tvar value = duration.value;\r\n\r\n\t\t\tvalue = getFormatter(config).parse(value);\r\n\t\t\tif (window.isNaN(value))\r\n\t\t\t\tvalue = 0;\r\n\t\t\tvalue += step;\r\n\t\t\tif (value < 1) value = 1;\r\n\t\t\tduration.value = getFormatter(config).format(value);\r\n\t\t\t_calc_date();\r\n\t\t}\r\n\r\n\t\tbtns[0].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t}, this);\r\n\t\tbtns[1].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t}, this);\r\n\t\ts[0].onchange = _calc_date;\r\n\t\ts[1].onchange = _calc_date;\r\n\t\ts[2].onchange = _calc_date;\r\n\t\tif (s[3]) s[3].onchange = _calc_date;\r\n\r\n\t\tduration.onkeydown = gantt.bind(function(e) {\r\n\t\t\tvar code; \r\n\r\n\t\t\te = e || window.event;\r\n\t\t\tcode = (e.charCode || e.keyCode || e.which);\r\n\t\t\t\r\n\t\t\tif (code == gantt.constants.KEY_CODES.DOWN) {\r\n\t\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (code == gantt.constants.KEY_CODES.UP) {\r\n\t\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\twindow.setTimeout(_calc_date, 1);\r\n\t\t}, this);\r\n\r\n\t\tduration.onchange = gantt.bind(_calc_date, this);\r\n\r\n\t\tmapping = gantt._resolve_default_mapping(config);\r\n\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\r\n\r\n\t\tstart_date = ev[mapping.start_date] || new Date();\r\n\t\tend_date = ev[mapping.end_date] || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\t\tduration_val = Math.round(ev[mapping.duration]) || gantt.calculateDuration({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: end_date,\r\n\t\t\ttask: ev\r\n\t\t});\r\n\t\tduration_val = getFormatter(config).format(duration_val);\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, config);\r\n\t\tduration.value = duration_val;\r\n\t\t_calc_date();\r\n\t};\r\n\r\n\tDurationControl.prototype.get_value = function(node, ev, config) {\r\n\t\tvar startDate = _getStartDate(node, config);\r\n\t\tvar duration = _getDuration(node, config);\r\n\t\tvar endDate = gantt.calculateEndDate({start_date: startDate, duration: duration, task: ev});\r\n\r\n\t\tif (typeof gantt._resolve_default_mapping(config) == \"string\") {\r\n\t\t\treturn startDate;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tstart_date: startDate,\r\n\t\t\tend_date: endDate,\r\n\t\t\tduration: duration\r\n\t\t};\r\n\t};\r\n\r\n\tDurationControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\r\n\tfunction _getStartDate(node, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar hours = 0;\r\n\t\tvar minutes = 0;\r\n\r\n\t\tif (gantt.defined(map[3])) {\r\n\t\t\tvar input = s[map[3]];\r\n\t\t\tvar time = parseInt(input.value, 10);\r\n\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\r\n\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\r\n\t\t\t}\r\n\r\n\t\t\thours = Math.floor(time / 60);\r\n\t\t\tminutes = time % 60;\r\n\t\t}\r\n\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\r\n\t}\r\n\r\n\tfunction _getDuration(node, config) {\r\n\t\tvar duration = node.getElementsByTagName(\"input\")[1];\r\n\r\n\t\tduration = getFormatter(config).parse(duration.value);\r\n\t\tif (!duration || window.isNaN(duration)) duration = 1;\r\n\t\tif (duration < 0) duration *= -1;\r\n\t\treturn duration;\r\n\t}\r\n\r\n\treturn DurationControl; \r\n};","import __extends from \"../../../../utils/extends\";\r\nimport htmlHelpers from \"../../utils/html_helpers\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction ConstraintControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(ConstraintControl, _super);\r\n\r\n\tfunction isNonTimedConstraint(value) {\r\n\t\tif (!value || value === gantt.config.constraint_types.ASAP || value === gantt.config.constraint_types.ALAP) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction toggleTimeSelect(timeSelects, typeValue) {\r\n\t\tvar isNonTimed = isNonTimedConstraint(typeValue);\r\n\t\tfor (var i = 0; i < timeSelects.length; i++) {\r\n\t\t\ttimeSelects[i].disabled = isNonTimed;\r\n\t\t}\r\n\t}\r\n\r\n\tConstraintControl.prototype.render = function (sns) {\r\n\t\tconst height = sns.height ? `height:${sns.height}px;` : '';\r\n\t\tlet html = ``;\r\n\r\n\t\tvar options = [];\r\n\t\tfor (var i in gantt.config.constraint_types) {\r\n\t\t\toptions.push({ key: gantt.config.constraint_types[i], label: gantt.locale.labels[gantt.config.constraint_types[i]] });\r\n\t\t}\r\n\r\n\t\tsns.options = sns.options || options;\r\n\r\n\t\thtml += \"\" + htmlHelpers.getHtmlSelect(sns.options, [{ key: \"data-type\", value: \"constraint-type\" }]) + \" \";\r\n\r\n\t\tvar timeLabel = gantt.locale.labels[\"constraint_date\"] || \"Constraint date\";\r\n\t\thtml += \"\" + timeLabel + \": \" + gantt.form_blocks.getTimePicker.call(this, sns) + \" \";\r\n\r\n\t\thtml += \"
\";\r\n\t\treturn html;\r\n\t};\r\n\r\n\tConstraintControl.prototype.set_value = function (node, value, task, config) {\r\n\t\tvar typeSelect = node.querySelector(\"[data-constraint-type-select] select\");\r\n\t\tvar timeSelects = node.querySelectorAll(\"[data-constraint-time-select] select\");\r\n\t\tvar map = config._time_format_order;\r\n\r\n\t\tvar mapping = gantt._resolve_default_mapping(config);\r\n\r\n\t\tif (!typeSelect._eventsInitialized) {\r\n\t\t\ttypeSelect.addEventListener(\"change\", function (e) {\r\n\t\t\t\ttoggleTimeSelect(timeSelects, e.target.value);\r\n\t\t\t});\r\n\t\t\ttypeSelect._eventsInitialized = true;\r\n\t\t}\r\n\r\n\t\tvar constraintDate = task[mapping.constraint_date] || new Date();\r\n\t\tgantt.form_blocks._fill_lightbox_select(timeSelects, 0, constraintDate, map, config);\r\n\r\n\t\tvar constraintType = task[mapping.constraint_type] || gantt.getConstraintType(task);\r\n\t\ttypeSelect.value = constraintType;\r\n\t\ttoggleTimeSelect(timeSelects, constraintType);\r\n\t};\r\n\r\n\tConstraintControl.prototype.get_value = function (node, task, config) {\r\n\t\tvar typeSelect = node.querySelector(\"[data-constraint-type-select] select\");\r\n\t\tvar timeSelects = node.querySelectorAll(\"[data-constraint-time-select] select\");\r\n\r\n\t\tvar constraintType = typeSelect.value;\r\n\t\tvar constraintDate = null;\r\n\t\tif (!isNonTimedConstraint(constraintType)) {\r\n\t\t\tconstraintDate = gantt.form_blocks.getTimePickerValue(timeSelects, config);\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tconstraint_type: constraintType,\r\n\t\t\tconstraint_date: constraintDate\r\n\t\t};\r\n\t};\r\n\r\n\tConstraintControl.prototype.focus = function (node) {\r\n\t\tgantt._focus(node.querySelector(\"select\"));\r\n\t};\r\n\r\n\treturn ConstraintControl;\r\n};","import __extends from \"../../../../utils/extends\";\r\n\r\nimport Super from \"./select_control\";\r\n\r\nexport default function(gantt) {\r\n\tconst _super = Super(gantt);\r\n\r\n\tfunction TypeselectControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this;\r\n\r\n\t\treturn self;\r\n\t}\r\n\r\n\t__extends(TypeselectControl, _super);\r\n\r\n\tTypeselectControl.prototype.render = function(sns) {\r\n\t\tvar types = gantt.config.types,\r\n\t\t\tlocale = gantt.locale.labels,\r\n\t\t\toptions = [];\r\n\r\n\t\tvar filter = sns.filter || function (typeKey, typeValue) {\r\n\t\t\tif (!types.placeholder || typeValue !== types.placeholder) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\tfor (var i in types) {\r\n\t\t\tif (!filter(i, types[i]) === false) {\r\n\t\t\t\toptions.push({ key: types[i], label: locale[\"type_\" + i] });\r\n\t\t\t}\r\n\t\t}\r\n\t\tsns.options = options;\r\n\r\n\t\tvar oldOnChange = sns.onchange;\r\n\t\tsns.onchange = function () {\r\n\t\t\tgantt._lightbox_current_type = this.value;\r\n\t\t\tgantt.changeLightboxType(this.value);\r\n\t\t\tif (typeof oldOnChange == 'function') {\r\n\t\t\t\toldOnChange.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn _super.prototype.render.apply(this, arguments);\r\n\t};\r\n\r\n\treturn TypeselectControl;\r\n};\r\n","\r\nimport __extends from \"../../../../utils/extends\";\r\nimport DurationFormatterNumeric from \"../../../common/duration_formatter_numeric\";\r\nimport BaseConstrutor from \"./base_control\";\r\n\r\nexport default function(gantt) {\r\n\tvar _super = BaseConstrutor(gantt);\r\n\r\n\tfunction DurationControl() {\r\n\t\tvar self = _super.apply(this, arguments) || this; \r\n\r\n\t\treturn self; \r\n\t}\r\n\r\n\tfunction getFormatter(config) {\r\n\t\treturn config.formatter || new DurationFormatterNumeric();\r\n\t}\r\n\r\n\tfunction _generateBaselineRow (node, baseline, task, config){\r\n\t\tconst time = \"\" + gantt.form_blocks.getTimePicker.call(gantt, config) + \"
\";\r\n\t\tlet durationLabel = \" \"+ gantt.locale.labels[gantt.config.duration_unit + \"s\"] +\" \";\r\n\t\tconst singleDate = config.single_date ? \" style='display:none'\" : \"\";\r\n\t\tconst readonly = config.readonly ? \" disabled='disabled'\" : \"\";\r\n\t\tconst ariaAttr = gantt._waiAria.lightboxDurationInputAttrString(config);\r\n\t\tconst deleteLabel = gantt.locale.labels.baselines_remove_button;\r\n\r\n\t\tlet durationInputClass = \"gantt_duration_value\";\r\n\t\tif(config.formatter) {\r\n\t\t\tdurationLabel = \"\";\r\n\t\t\tdurationInputClass += \" gantt_duration_value_formatted\";\r\n\t\t}\r\n\r\n\t\tconst durationEl = \"\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = ``;\r\n\r\n\t\tconst baselineRow = document.createElement(\"div\");\r\n\t\tbaselineRow.className = \"gantt_section_time gantt_section_duration\";\r\n\t\tbaselineRow.setAttribute(\"data-baseline-id\", baseline.id);\r\n\t\tbaselineRow.innerHTML = time + durationEl + deleteButton + \" \";\r\n\t\tnode.appendChild(baselineRow);\r\n\r\n\t\tvar s = baselineRow.getElementsByTagName(\"select\");\r\n\t\tvar inps = baselineRow.getElementsByTagName(\"input\");\r\n\t\tvar duration = inps[1];\r\n\t\tvar btns = [inps[0], inps[2]];\r\n\t\tvar endspan = baselineRow.getElementsByTagName(\"span\")[0];\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar mapping;\r\n\t\tvar start_date;\r\n\t\tvar end_date;\r\n\t\tvar duration_val;\r\n\r\n\t\tconst deleteEl = baselineRow.querySelector(\".baseline_delete_button\");\r\n\t\tdeleteEl.onclick = function(e){\r\n\t\t\tconst section = baselineRow.parentNode;\r\n\t\t\tbaselineRow.innerHTML = \"\";\r\n\t\t\tbaselineRow.remove();\r\n\t\t\tif (section.innerHTML === \"\"){\r\n\t\t\t\tsection.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\r\n\t\tfunction _calc_date() {\r\n\t\t\tvar start_date = _getStartDate.call(gantt, baselineRow, config);\r\n\t\t\tvar duration = _getDuration.call(gantt, baselineRow, config);\r\n\t\t\tvar end_date = gantt.calculateEndDate({start_date: start_date, duration: duration, task: task});\r\n\r\n\t\t\tvar template = gantt.templates.task_end_date || gantt.templates.task_date;\r\n\t\t\tendspan.innerHTML = template(end_date);\r\n\t\t}\r\n\r\n\t\tfunction _change_duration(step) {\r\n\t\t\tvar value = duration.value;\r\n\r\n\t\t\tvalue = getFormatter(config).parse(value);\r\n\t\t\tif (window.isNaN(value))\r\n\t\t\t\tvalue = 0;\r\n\t\t\tvalue += step;\r\n\t\t\tif (value < 1) value = 1;\r\n\t\t\tduration.value = getFormatter(config).format(value);\r\n\t\t\t_calc_date();\r\n\t\t}\r\n\r\n\t\tbtns[0].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t}, gantt);\r\n\t\tbtns[1].onclick = gantt.bind(function() {\r\n\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t}, gantt);\r\n\t\ts[0].onchange = _calc_date;\r\n\t\ts[1].onchange = _calc_date;\r\n\t\ts[2].onchange = _calc_date;\r\n\t\tif (s[3]) s[3].onchange = _calc_date;\r\n\r\n\t\tduration.onkeydown = gantt.bind(function(e) {\r\n\t\t\tvar code; \r\n\r\n\t\t\te = e || window.event;\r\n\t\t\tcode = (e.charCode || e.keyCode || e.which);\r\n\t\t\t\r\n\t\t\tif (code == gantt.constants.KEY_CODES.DOWN) {\r\n\t\t\t\t_change_duration(-1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (code == gantt.constants.KEY_CODES.UP) {\r\n\t\t\t\t_change_duration(1 * gantt.config.duration_step);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\twindow.setTimeout(_calc_date, 1);\r\n\t\t}, gantt);\r\n\r\n\t\tduration.onchange = gantt.bind(_calc_date, gantt);\r\n\r\n\t\tmapping = gantt._resolve_default_mapping(config);\r\n\t\tif (typeof(mapping) === \"string\") mapping = {start_date: mapping};\r\n\r\n\t\tstart_date = baseline.start_date || new Date();\r\n\t\tend_date = baseline.end_date || gantt.calculateEndDate({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tduration: 1,\r\n\t\t\ttask\r\n\t\t});\r\n\t\tduration_val = gantt.calculateDuration({\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: end_date,\r\n\t\t\ttask\r\n\t\t});\r\n\t\tduration_val = getFormatter(config).format(duration_val);\r\n\r\n\t\tgantt.form_blocks._fill_lightbox_select(s, 0, start_date, map, config);\r\n\t\tduration.value = duration_val;\r\n\t\t_calc_date();\r\n\t}\r\n\r\n\t__extends(DurationControl, _super);\r\n\r\n\tDurationControl.prototype.render = function(sns) {\r\n\t\tconst baselineSection = `
`;\r\n\t\treturn baselineSection;\r\n\t};\r\n\r\n\tDurationControl.prototype.set_value = function(node, value, task, config) {\r\n\t\tif (task.baselines){\r\n\t\t\tnode.innerHTML = \"\";\r\n\r\n\t\t\ttask.baselines.forEach((baseline)=>{\r\n\t\t\t\t_generateBaselineRow(node, baseline, task, config);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tnode.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t}\t\t\r\n\r\n\t};\r\n\r\n\tDurationControl.prototype.get_value = function(node, task, config) {\r\n\t\tconst baselines = [];\r\n\t\tconst baselineRows = node.querySelectorAll(`[data-baseline-id]`);\r\n\t\tbaselineRows.forEach((baselineNode)=>{\r\n\t\t\tconst baselineId = baselineNode.dataset.baselineId;\r\n\t\t\tconst baselineStore = gantt.getDatastore(\"baselines\");\r\n\t\t\tlet baseline = baselineStore.getItem(baselineId);\r\n\t\t\tlet updatedBaseline;\r\n\t\t\tif (baseline){\r\n\t\t\t\tupdatedBaseline = gantt.copy(baseline);\r\n\t\t\t} else {\r\n\t\t\t\tupdatedBaseline = {\r\n\t\t\t\t\tid: gantt.uid(),\r\n\t\t\t\t\ttask_id: task.id,\r\n\t\t\t\t\ttext: \"Baseline 1\"\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tupdatedBaseline.start_date = _getStartDate(baselineNode, config);\r\n\t\t\tupdatedBaseline.duration = _getDuration(baselineNode, config);\r\n\t\t\tupdatedBaseline.end_date = gantt.calculateEndDate({start_date: updatedBaseline.start_date, duration: updatedBaseline.duration, task});\r\n\r\n\t\t\tbaselines.push(updatedBaseline);\r\n\t\t});\r\n\r\n\t\treturn baselines;\r\n\t};\r\n\r\n\tDurationControl.prototype.button_click = function (index, el, section, container) {\r\n\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (el.closest(\".gantt_custom_button.gantt_remove_baselines\")){\r\n\t\t\tcontainer.innerHTML = gantt.locale.labels.baselines_section_placeholder;\r\n\t\t}\r\n\t\tif (el.closest(\".gantt_custom_button.gantt_add_baselines\")){\r\n\t\t\tif (container.innerHTML == gantt.locale.labels.baselines_section_placeholder){\r\n\t\t\t\tcontainer.innerHTML = \"\";\r\n\t\t\t}\r\n\t\t\tconst task = gantt.getTask(gantt._lightbox_id);\r\n\t\t\tconst baseline = {\r\n\t\t\t\tid: gantt.uid(),\r\n\t\t\t\ttask_id: task.id,\r\n\t\t\t\ttext: \"Baseline 1\",\r\n\t\t\t\tstart_date: task.start_date,\r\n\t\t\t\tend_date: task.end_date\r\n\t\t\t};\r\n\t\t\tconst config = gantt._get_typed_lightbox_config()[index];\r\n\t\t\t_generateBaselineRow(container, baseline, task, config);\r\n\t\t}\r\n\t};\r\n\r\n\tDurationControl.prototype.focus = function(node) {\r\n\t\tgantt._focus(node.getElementsByTagName(\"select\")[0]);\r\n\t};\r\n\r\n\r\n\tfunction _getStartDate(node, config) {\r\n\t\tvar s = node.getElementsByTagName(\"select\");\r\n\t\tvar map = config._time_format_order;\r\n\t\tvar hours = 0;\r\n\t\tvar minutes = 0;\r\n\r\n\t\tif (gantt.defined(map[3])) {\r\n\t\t\tvar input = s[map[3]];\r\n\t\t\tvar time = parseInt(input.value, 10);\r\n\t\t\tif (isNaN(time) && input.hasAttribute(\"data-value\")) {\r\n\t\t\t\ttime = parseInt(input.getAttribute(\"data-value\"), 10);\r\n\t\t\t}\r\n\r\n\t\t\thours = Math.floor(time / 60);\r\n\t\t\tminutes = time % 60;\r\n\t\t}\r\n\t\treturn new Date(s[map[2]].value, s[map[1]].value, s[map[0]].value, hours, minutes);\r\n\t}\r\n\r\n\tfunction _getDuration(node, config) {\r\n\t\tvar duration = node.getElementsByTagName(\"input\")[1];\r\n\r\n\t\tduration = getFormatter(config).parse(duration.value);\r\n\t\tif (!duration || window.isNaN(duration)) duration = 1;\r\n\t\tif (duration < 0) duration *= -1;\r\n\t\treturn duration;\r\n\t}\r\n\r\n\treturn DurationControl; \r\n};","import * as utils from \"../utils/utils\";\r\nimport env from \"../utils/env\";\r\nimport isHeadless from \"../utils/is_headless\";\r\nimport * as domHelpers from \"./ui/utils/dom_helpers\";\r\nimport * as codeHelpers from \"../utils/helpers\";\r\nimport domEventScope from \"./ui/utils/dom_event_scope\";\r\nimport messages from \"./ui/message\";\r\nimport ui from \"./ui/index\";\r\nimport createLayoutFacade from \"./facades/layout\";\r\nimport taskLayers from \"./data_task_layers\";\r\n\r\nimport skin from \"./ui/skin\";\r\nimport skyblue from \"../css/skins/skyblue\";\r\nimport meadow from \"../css/skins/meadow\";\r\nimport terrace from \"../css/skins/terrace\";\r\nimport broadway from \"../css/skins/broadway\";\r\nimport material from \"../css/skins/material\";\r\nimport dark from \"../css/skins/dark\";\r\nimport contrast_black from \"../css/skins/contrast_black\";\r\nimport contrast_white from \"../css/skins/contrast_white\";\r\nimport plugins from \"./ui/plugins\";\r\nimport touch from \"./ui/touch\";\r\nimport lightbox from \"./ui/lightbox\";\r\nimport lightbox_optional_time from \"./ui/lightbox/lightbox_optional_time\";\r\nimport wai_aria from \"./ui/wai_aria\";\r\n\r\n\r\nexport default function(gantt) {\r\n\r\n\tif(!env.isNode){\r\n\r\n\t\tgantt.utils = {\r\n\t\t\tarrayFind: codeHelpers.arrayFind,\r\n\t\t\tdom: domHelpers\r\n\t\t};\r\n\r\n\t\tvar domEvents = domEventScope();\r\n\t\tgantt.event = domEvents.attach;\r\n\t\tgantt.eventRemove = domEvents.detach;\r\n\t\tgantt._eventRemoveAll = domEvents.detachAll;\r\n\t\tgantt._createDomEventScope = domEvents.extend;\r\n\r\n\t\tutils.mixin(gantt, messages(gantt));\r\n\t\tvar uiApi = ui.init(gantt);\r\n\t\tgantt.$ui = uiApi.factory;\r\n\t\tgantt.$ui.layers = uiApi.render;\r\n\t\tgantt.$mouseEvents = uiApi.mouseEvents;\r\n\t\tgantt.$services.setService(\"mouseEvents\", function () {\r\n\t\t\treturn gantt.$mouseEvents;\r\n\t\t});\r\n\t\tgantt.mixin(gantt, uiApi.layersApi);\r\n\r\n\t\ttaskLayers(gantt);\r\n\r\n\t\tgantt.$services.setService(\"layers\", function () {\r\n\t\t\treturn uiApi.layersService;\r\n\t\t});\r\n\r\n\t\tgantt.mixin(gantt, createLayoutFacade());\r\n\t\tskin(gantt);\r\n\t\tskyblue(gantt);\r\n\t\tdark(gantt);\r\n\t\tmeadow(gantt);\r\n\t\tterrace(gantt);\r\n\t\tbroadway(gantt);\r\n\t\tmaterial(gantt);\r\n\t\tcontrast_black(gantt);\r\n\t\tcontrast_white(gantt);\r\n\t\tplugins(gantt);\r\n\t\ttouch(gantt);\r\n\t\tlightbox(gantt);\r\n\t\tlightbox_optional_time(gantt);\r\n\t\twai_aria(gantt);\r\n\r\n\t\tgantt.locate = function(e) {\r\n\t\t\tvar trg = domHelpers.getTargetNode(e);\r\n\r\n\t\t\t// ignore empty rows/cells of the timeline\r\n\t\t\tif(domHelpers.closest(trg, \".gantt_task_row\")){\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tvar targetAttribute = arguments[1] || this.config.task_attribute;\r\n\r\n\t\t\tvar node = domHelpers.locateAttribute(trg, targetAttribute);\r\n\t\t\tif(node){\r\n\t\t\t\treturn node.getAttribute(targetAttribute);\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tgantt._locate_css = function(e, classname, strict){\r\n\t\t\treturn domHelpers.locateClassName(e, classname, strict);\r\n\t\t};\r\n\r\n\t\tgantt._locateHTML = function(e, attribute) {\r\n\t\t\treturn domHelpers.locateAttribute(e, attribute || this.config.task_attribute);\r\n\t\t};\r\n\t}\r\n\r\n\tgantt.attachEvent(\"onParse\", function(){\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\tgantt.attachEvent(\"onGanttRender\", function(){\r\n\t\t\t\tif(gantt.config.initial_scroll){\r\n\t\t\t\t\tvar firstTask = gantt.getTaskByIndex(0);\r\n\t\t\t\t\tvar id = firstTask ? firstTask.id : gantt.config.root_id;\r\n\t\t\t\t\t// GS-1450. Don't scroll to the task if there is no timeline\r\n\t\t\t\t\tif(gantt.isTaskExists(id) && gantt.$task && gantt.utils.dom.isChildOf(gantt.$task, gantt.$container)){\r\n\t\t\t\t\t\tgantt.showTask(id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\r\n\t});\r\n\r\n\tgantt.attachEvent(\"onBeforeGanttReady\", function(){\r\n\t\tif (!this.config.scroll_size)\r\n\t\t\tthis.config.scroll_size = domHelpers.getScrollSize() || 15;\r\n\r\n\t\tif(!isHeadless(gantt)){\r\n\t\t\t// detach listeners before clearing old DOM, possible IE errors when accessing detached nodes\r\n\t\t\tthis._eventRemoveAll();\r\n\t\t\tthis.$mouseEvents.reset();\r\n\r\n\t\t\tthis.resetLightbox();\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t// GS-1261: scroll the views to the right side when RTL is enabled\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(!isHeadless(gantt) && gantt.config.rtl){\r\n\t\t\tgantt.$layout.getCellsByType(\"viewCell\").forEach(function(cell){ \r\n\t\t\t\tvar attachedScrollbar = cell.$config.scrollX;\r\n\t\t\t\tif (!attachedScrollbar) return;\r\n\r\n\t\t\t\tvar scrollbar = gantt.$ui.getView(attachedScrollbar);\r\n\t\t\t\tif (scrollbar) scrollbar.scrollTo(scrollbar.$config.scrollSize,0);\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\t// GS-1649: check if extensions are connected via files\r\n\tgantt.attachEvent(\"onGanttReady\", function(){\r\n\t\tif(!isHeadless(gantt)){\r\n\r\n\t\t\tvar activePlugins = gantt.plugins();\r\n\r\n\t\t\tvar availablePlugins = {\r\n\t\t\t\tauto_scheduling: gantt.autoSchedule,\r\n\t\t\t\tclick_drag: gantt.ext.clickDrag,\r\n\t\t\t\tcritical_path: gantt.isCriticalTask,\r\n\t\t\t\tdrag_timeline: gantt.ext.dragTimeline,\r\n\t\t\t\texport_api: gantt.exportToPDF,\r\n\t\t\t\tfullscreen: gantt.ext.fullscreen,\r\n\t\t\t\tgrouping: gantt.groupBy,\r\n\t\t\t\tkeyboard_navigation: gantt.ext.keyboardNavigation,\r\n\t\t\t\tmarker: gantt.addMarker,\r\n\t\t\t\tmultiselect: gantt.eachSelectedTask,\r\n\t\t\t\toverlay: gantt.ext.overlay,\r\n\t\t\t\tquick_info: gantt.templates.quick_info_content,\r\n\t\t\t\ttooltip: gantt.ext.tooltips,\r\n\t\t\t\tundo: gantt.undo\r\n\t\t\t};\r\n\r\n\t\t\tfor (let plugin in availablePlugins){\r\n\t\t\t\tif (availablePlugins[plugin] && !activePlugins[plugin]){\r\n\t\t\t\t\t// eslint-disable-next-line no-console\r\n\t\t\t\t\tconsole.warn(`You connected the '${plugin}' extension via an obsolete file. \r\nTo fix it, you need to remove the obsolete file and connect the extension via the plugins method: https://docs.dhtmlx.com/gantt/api__gantt_plugins.html`);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n};","export default function(gantt) {\r\n\tdelete gantt.addTaskLayer;\r\n\tdelete gantt.addLinkLayer;\r\n};","function createLayoutFacade(){\r\n\r\n\tfunction getTimeline(gantt){\r\n\t\treturn gantt.$ui.getView(\"timeline\");\r\n\t}\r\n\r\n\tfunction getGrid(gantt){\r\n\t\treturn gantt.$ui.getView(\"grid\");\r\n\t}\r\n\r\n\tfunction getBaseCell(gantt){\r\n\t\tvar timeline = getTimeline(gantt);\r\n\t\tif (timeline && !timeline.$config.hidden){\r\n\t\t\treturn timeline;\r\n\t\t} else{\r\n\t\t\tvar grid = getGrid(gantt);\r\n\t\t\tif (grid && !grid.$config.hidden){\r\n\t\t\t\treturn grid;\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction getVerticalScrollbar(gantt){\r\n\t\tvar baseCell = null;\r\n\t\t// GS-1150: if we reorder or resize something in the grid, we should obtain the grid container\r\n\t\tvar gridDrag = false;\r\n\t\tvar gridMarkers = [\r\n\t\t\t\".gantt_drag_marker.gantt_grid_resize_area\",\r\n\t\t\t\".gantt_drag_marker .gantt_row.gantt_row_task\",\r\n\t\t\t\".gantt_drag_marker.gantt_grid_dnd_marker\"\r\n\t\t];\r\n\t\tgridMarkers.forEach(function (selector) {\r\n\t\t\tgridDrag = gridDrag || !!document.querySelector(selector);\r\n\t\t});\r\n\t\tif (gridDrag){\r\n\t\t\tbaseCell = getGrid(gantt);\r\n\t\t} else{\r\n\t\t\tbaseCell = getBaseCell(gantt);\r\n\t\t}\r\n\r\n\t\t// GS-1827. If there is no grid and timeline, there is no scrollbar for them\r\n\t\tif (!baseCell){\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar verticalScrollbar = getAttachedScrollbar(gantt, baseCell, \"scrollY\");\r\n\t\treturn verticalScrollbar;\r\n\t}\r\n\r\n\tfunction getHorizontalScrollbar(gantt){\r\n\t\tvar baseCell = getBaseCell(gantt);\r\n\t\tif (!baseCell || baseCell.id == \"grid\"){\r\n\t\t\treturn null; // if the timeline is not displayed, do not return the scrollbar\r\n\t\t}\r\n\t\tvar horizontalScrollbar = getAttachedScrollbar(gantt, baseCell, \"scrollX\");\r\n\t\treturn horizontalScrollbar;\r\n\t}\r\n\r\n\tfunction getAttachedScrollbar(gantt, cell, type){\r\n\t\tvar attachedScrollbar = cell.$config[type];\r\n\t\tvar scrollbarView = gantt.$ui.getView(attachedScrollbar);\r\n\t\treturn scrollbarView;\r\n\t}\r\n\r\n\tvar DEFAULT_VALUE = \"DEFAULT_VALUE\";\r\n\r\n\tfunction tryCall(getView, method, args, fallback){\r\n\t\tvar view = getView(this);\r\n\t\tif (!(view && view.isVisible())) {\r\n\t\t\tif(fallback){\r\n\t\t\t\treturn fallback();\r\n\t\t\t}else{\r\n\t\t\t\treturn DEFAULT_VALUE;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn view[method].apply(view, args);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\r\n\t\tgetColumnIndex: function(name) {\r\n\t\t\tvar res = tryCall.call(this, getGrid, \"getColumnIndex\", [name]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tdateFromPos: function(x) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"dateFromPos\", Array.prototype.slice.call(arguments));\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn this.getState().min_date;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tposFromDate: function(date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"posFromDate\", [date]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetRowTop: function(index) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getRowTop\", [index],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getRowTop\", [index]);}\r\n\t\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskTop: function(id) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getItemTop\", [id],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemTop\", [id]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tgetTaskPosition: function(task, start_date, end_date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"getItemPosition\", [task, start_date, end_date]);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\tvar top = this.getTaskTop(task.id);\r\n\t\t\t\tvar height = this.getTaskBarHeight(task.id);\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tleft: 0,\r\n\t\t\t\t\ttop: top,\r\n\t\t\t\t\theight: height,\r\n\t\t\t\t\twidth: 0\r\n\t\t\t\t};\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskBarHeight: function(taskId, isMilestoneRender) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getBarHeight\", [taskId, isMilestoneRender],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemHeight\", [taskId]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskHeight: function(taskId) {\r\n\t\t\tvar self = this;\r\n\t\t\tvar res = tryCall.call(self, getTimeline, \"getItemHeight\", [taskId],\r\n\t\t\t\tfunction(){ return tryCall.call(self, getGrid, \"getItemHeight\", [taskId]);}\r\n\t\t\t);\r\n\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tcolumnIndexByDate: function(date) {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"columnIndexByDate\", [date]);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn 0;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\troundTaskDates: function() {\r\n\t\t\ttryCall.call(this, getTimeline, \"roundTaskDates\", []);\r\n\t\t},\r\n\r\n\t\tgetScale: function() {\r\n\t\t\tvar res = tryCall.call(this, getTimeline, \"getScale\", []);\r\n\t\t\tif(res === DEFAULT_VALUE){\r\n\t\t\t\treturn null;\r\n\t\t\t}else{\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetTaskNode: function(id) {\r\n\t\t\tvar timeline = getTimeline(this);\r\n\t\t\tif (!timeline || !timeline.isVisible()) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\tvar node = timeline._taskRenderer.rendered[id];\r\n\t\t\t\tif(!node){\r\n\t\t\t\t\tvar domAttr = timeline.$config.item_attribute;\r\n\t\t\t\t\tnode = timeline.$task_bars.querySelector(\"[\" +domAttr+ \"='\"+id+\"']\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn node || null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tgetLinkNode: function(id) {\r\n\t\t\tvar timeline = getTimeline(this);\r\n\t\t\tif (!timeline.isVisible()) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn timeline._linkRenderer.rendered[id];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tscrollTo: function(left, top){\r\n\t\t\tvar vertical = getVerticalScrollbar(this);\r\n\t\t\tvar horizontal = getHorizontalScrollbar(this);\r\n\r\n\t\t\tvar oldH = {position: 0},\r\n\t\t\t\toldV = {position: 0};\r\n\r\n\t\t\tif(vertical){\r\n\t\t\t\toldV = vertical.getScrollState();\r\n\t\t\t}\r\n\t\t\tif(horizontal){\r\n\t\t\t\toldH = horizontal.getScrollState();\r\n\t\t\t}\r\n\r\n\t\t\tvar scrollHorizontal = (horizontal && left*1 == left);\r\n\t\t\tvar scrollVertical = (vertical && top*1 == top);\r\n\t\t\tvar scrollBoth = scrollHorizontal && scrollVertical;\r\n\r\n\t\t\tif(scrollBoth){\r\n\t\t\t\t// some views will be scrolled both horizontally and vertically and smart rendering can be called twice\r\n\t\t\t\t// set flag in order not to invoke smart rendering at the horizontal scroll stage\r\n\t\t\t\t// so it will repaint only once when the scroll is completed\r\n\t\t\t\tvar verticalViews = vertical._getLinkedViews();\r\n\t\t\t\tvar horizontalViews = horizontal._getLinkedViews();\r\n\r\n\t\t\t\tvar commonViews = [];\r\n\t\t\t\tfor(var i = 0; i < verticalViews.length; i++){\r\n\t\t\t\t\tfor(var j = 0; j < horizontalViews.length; j++){\r\n\r\n\t\t\t\t\t\tif(verticalViews[i].$config.id && horizontalViews[j].$config.id && verticalViews[i].$config.id === horizontalViews[j].$config.id){\r\n\t\t\t\t\t\t\tcommonViews.push(verticalViews[i].$config.id);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (scrollHorizontal){\r\n\t\t\t\tif(commonViews){\r\n\t\t\t\t\tcommonViews.forEach((function(viewId){\r\n\t\t\t\t\t\tthis.$ui.getView(viewId).$config.$skipSmartRenderOnScroll = true;\r\n\t\t\t\t\t}).bind(this));\r\n\t\t\t\t}\r\n\r\n\t\t\t\thorizontal.scroll(left);\r\n\t\t\t\tif(commonViews){\r\n\t\t\t\t\tcommonViews.forEach((function(viewId){\r\n\t\t\t\t\t\tthis.$ui.getView(viewId).$config.$skipSmartRenderOnScroll = false;\r\n\t\t\t\t\t}).bind(this));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(scrollVertical){\r\n\t\t\t\tvertical.scroll(top);\r\n\t\t\t}\r\n\r\n\t\t\tvar newV = {position: 0},\r\n\t\t\t\tnewH = {position: 0};\r\n\t\t\tif(vertical){\r\n\t\t\t\tnewV = vertical.getScrollState();\r\n\t\t\t}\r\n\t\t\tif(horizontal){\r\n\t\t\t\tnewH = horizontal.getScrollState();\r\n\t\t\t}\r\n\r\n\t\t\tthis.callEvent(\"onGanttScroll\", [oldH.position, oldV.position, newH.position, newV.position]);\r\n\t\t},\r\n\r\n\t\tshowDate: function(date){\r\n\t\t\tvar date_x = this.posFromDate(date);\r\n\t\t\tvar scroll_to = Math.max(date_x - this.config.task_scroll_offset, 0);\r\n\t\t\tthis.scrollTo(scroll_to);\r\n\t\t},\r\n\t\tshowTask: function(id) {\r\n\t\t\tvar pos = this.getTaskPosition(this.getTask(id));\r\n\r\n\t\t\t// GS-1261: we need to show the start_date even in the RTL mode\r\n\t\t\tvar leftPos = pos.left;\r\n\t\t\tif (this.config.rtl) leftPos = pos.left + pos.width;\r\n\r\n\t\t\tvar left = Math.max(leftPos - this.config.task_scroll_offset, 0);\r\n\r\n\t\t\tvar dataHeight = this._scroll_state().y;\r\n\t\t\tvar top;\r\n\t\t\tif(!dataHeight){\r\n\t\t\t\ttop = pos.top;\r\n\t\t\t}else{\r\n\t\t\t\ttop = pos.top - (dataHeight - this.getTaskBarHeight(id))/2;\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTo(left, top);\r\n\t\t\t// GS-1150: if the grid and timeline have different scrollbars, we need to scroll thegrid to show the task\r\n\t\t\tvar gridCell = getGrid(this);\r\n\t\t\tvar timelineCell = getTimeline(this);\r\n\t\t\tif (gridCell && timelineCell && gridCell.$config.scrollY != timelineCell.$config.scrollY){\r\n\t\t\t\tvar gridScrollbar = getAttachedScrollbar(this, gridCell, \"scrollY\");\r\n\t\t\t\tgridScrollbar.scrollTo(null, top);\r\n\t\t\t}\r\n\t\t},\r\n\t\t_scroll_state: function(){\r\n\t\t\tvar result = {\r\n\t\t\t\tx: false,\r\n\t\t\t\ty: false,\r\n\t\t\t\tx_pos: 0,\r\n\t\t\t\ty_pos: 0,\r\n\t\t\t\tscroll_size: this.config.scroll_size + 1,//1px for inner content\r\n\t\t\t\tx_inner: 0,\r\n\t\t\t\ty_inner: 0\r\n\t\t\t};\r\n\r\n\t\t\tvar scrollVer = getVerticalScrollbar(this),\r\n\t\t\t\tscrollHor = getHorizontalScrollbar(this);\r\n\t\t\tif(scrollHor){\r\n\t\t\t\tvar horState = scrollHor.getScrollState();\r\n\t\t\t\tif(horState.visible){\r\n\t\t\t\t\tresult.x = horState.size;\r\n\t\t\t\t\tresult.x_inner = horState.scrollSize;\r\n\t\t\t\t}\r\n\t\t\t\tresult.x_pos = horState.position || 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(scrollVer){\r\n\t\t\t\tvar verState = scrollVer.getScrollState();\r\n\t\t\t\tif(verState.visible){\r\n\t\t\t\t\tresult.y = verState.size;\r\n\r\n\t\t\t\t\tresult.y_inner = verState.scrollSize;\r\n\t\t\t\t}\r\n\t\t\t\tresult.y_pos = verState.position || 0;\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tgetScrollState: function(){\r\n\t\t\tvar state = this._scroll_state();\r\n\t\t\treturn { x:state.x_pos, y:state.y_pos, inner_width:state.x, inner_height:state.y, width: state.x_inner, height: state.y_inner };\r\n\t\t},\r\n\r\n\t\tgetLayoutView: function(cellName){\r\n\t\t\treturn this.$ui.getView(cellName);\r\n\t\t},\r\n\r\n\t\tscrollLayoutCell: function(cellName, left, top){\r\n\t\t\tconst cell = this.$ui.getView(cellName);\r\n\t\t\tif (!cell){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (left !== null){\r\n\t\t\t\tconst horizontalScroll = this.$ui.getView(cell.$config.scrollX);\r\n\t\t\t\tif (horizontalScroll){\r\n\t\t\t\t\thorizontalScroll.scrollTo(left, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (top !== null){\r\n\t\t\t\tconst verticalScroll = this.$ui.getView(cell.$config.scrollY);\r\n\t\t\t\tif (verticalScroll){\r\n\t\t\t\t\tverticalScroll.scrollTo(null, top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t};\r\n\r\n}\r\n\r\nexport default createLayoutFacade;","export default function(gantt) {\r\ngantt.skins.skyblue = {\r\n\tconfig:{\r\n\t\tgrid_width:370,\r\n\t\trow_height: 27,\r\n\t\tbar_height_padding:4,\r\n\t\tscale_height: 27,\r\n\t\tlink_line_width:1,\r\n\t\tlink_arrow_size:8,\r\n\t\tlink_radius:2,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:95,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.dark = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 36,\r\n\t\tscale_height: 36,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tbar_height_padding:9,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:70\t\t\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.meadow = {\r\n\tconfig:{\r\n\t\tgrid_width:380,\r\n\t\trow_height: 27,\r\n\t\tscale_height: 30,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:10,\r\n\t\tbar_height_padding:4,\r\n\t\tlightbox_additional_height:72\r\n\t},\r\n\t_second_column_width:95,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins.terrace = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 36,\r\n\t\tscale_height: 36,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tbar_height_padding:9,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:70\t\t\r\n};\r\n\r\n};","export default function(gantt) {\r\n\tgantt.skins.broadway = {\r\n\t\tconfig: {\r\n\t\t\tgrid_width: 390,\r\n\t\t\trow_height: 35,\r\n\t\t\tscale_height: 35,\r\n\t\t\tlink_line_width: 1,\r\n\t\t\tlink_arrow_size: 9,\r\n\t\t\tbar_height_padding:4,\r\n\t\t\tlightbox_additional_height: 86\r\n\t\t},\r\n\t\t_second_column_width: 100,\r\n\t\t_third_column_width: 80,\r\n\r\n\t\t_lightbox_template: \"
\",\r\n\t\t_config_buttons_left: {},\r\n\t\t_config_buttons_right: {\r\n\t\t\t\"gantt_delete_btn\": \"icon_delete\",\r\n\t\t\t\"gantt_save_btn\": \"icon_save\"\r\n\t\t}\r\n\t};\r\n};","export default function(gantt) {\r\n\tgantt.skins.material = {\r\n\t\tconfig: {\r\n\t\t\tgrid_width: 411,\r\n\t\t\trow_height: 34,\r\n\t\t\tscale_height: 36,\r\n\t\t\tlink_line_width: 2,\r\n\t\t\tlink_arrow_size: 12,\r\n\t\t\tbar_height_padding:9,\r\n\t\t\tlightbox_additional_height: 80\r\n\t\t},\r\n\t\t_second_column_width: 110,\r\n\t\t_third_column_width: 75,\r\n\t\t_redefine_lightbox_buttons: {\r\n\t\t\t\"buttons_left\": [\"dhx_delete_btn\"],\r\n\t\t\t\"buttons_right\": [\"dhx_cancel_btn\", \"dhx_save_btn\"]\r\n\t\t}\r\n\t};\r\n\r\n\tgantt.attachEvent(\"onAfterTaskDrag\", function (id) {\r\n\t\tvar t = gantt.getTaskNode(id);\r\n\t\tif (t) {\r\n\t\t\tt.className += \" gantt_drag_animation\";\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tvar indx = t.className.indexOf(\" gantt_drag_animation\");\r\n\t\t\t\tif (indx > -1) {\r\n\t\t\t\t\tt.className = t.className.slice(0, indx);\r\n\t\t\t\t}\r\n\t\t\t}, 200);\r\n\t\t}\r\n\t});\r\n\r\n};","export default function(gantt) {\r\ngantt.skins[\"contrast_black\"] = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 35,\r\n\t\tscale_height: 35,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","export default function(gantt) {\r\ngantt.skins[\"contrast_white\"] = {\r\n\tconfig:{\r\n\t\tgrid_width:390,\r\n\t\trow_height: 35,\r\n\t\tscale_height: 35,\r\n\t\tlink_line_width:2,\r\n\t\tlink_arrow_size:12,\r\n\t\tlightbox_additional_height:75\r\n\t},\r\n\t_second_column_width:100,\r\n\t_third_column_width:80\r\n};\r\n\r\n};","import autoscroll from \"./autoscroll\";\r\nimport jquery_hooks from \"./jquery_hooks\";\r\nimport dhtmlx_hooks from \"./dhtmlx_hooks\";\r\nimport TimelineZoom from \"./timeline_zoom\";\r\n\r\n\r\nexport default function(gantt){\r\n\tif(!gantt.ext){\r\n\t\tgantt.ext = {};\r\n\t}\r\n\r\n\tvar modules = [\r\n\t\tautoscroll,\r\n\t\tjquery_hooks,\r\n\t\tdhtmlx_hooks\r\n\t];\r\n\r\n\tfor(var i = 0; i < modules.length; i++){\r\n\t\tif(modules[i])\r\n\t\t\tmodules[i](gantt);\r\n\t}\r\n\r\n\tgantt.ext.zoom = new TimelineZoom(gantt);\r\n};","export default function(gantt) {\r\n\r\n\tgantt._extend_to_optional = function (lightbox_block) {\r\n\r\n\t\tvar duration = lightbox_block;\r\n\t\tvar optional_time = {\r\n\t\t\trender: duration.render,\r\n\t\t\tfocus: duration.focus,\r\n\t\t\tset_value: function (node, value, task, section) {\r\n\t\t\t\tvar mapping = gantt._resolve_default_mapping(section);\r\n\t\t\t\tif (!task[mapping.start_date] || (mapping.start_date == \"start_date\" && this._isAllowedUnscheduledTask(task))) {\r\n\t\t\t\t\toptional_time.disable(node, section);\r\n\t\t\t\t\tvar val = {};\r\n\r\n\t\t\t\t\tfor (var i in mapping) {\r\n\t\t\t\t\t\t//take default values from the time control from task start/end dates\r\n\t\t\t\t\t\tval[mapping[i]] = task[i];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, val, section);//set default value\r\n\t\t\t\t} else {\r\n\t\t\t\t\toptional_time.enable(node, section);\r\n\t\t\t\t\treturn duration.set_value.call(gantt, node, value, task, section);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget_value: function (node, task, section) {\r\n\t\t\t\tif (section.disabled) {\r\n\t\t\t\t\treturn {start_date: null};\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn duration.get_value.call(gantt, node, task, section);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tupdate_block: function (node, section) {\r\n\t\t\t\tgantt.callEvent(\"onSectionToggle\", [gantt._lightbox_id, section]);\r\n\t\t\t\tnode.style.display = section.disabled ? \"none\" : \"\";\r\n\r\n\t\t\t\tif (section.button) {\r\n\t\t\t\t\tvar button = node.previousSibling.querySelector(\".gantt_custom_button_label\"),\r\n\t\t\t\t\t\tlabels = gantt.locale.labels;\r\n\r\n\t\t\t\t\tvar button_text = section.disabled ? labels[section.name + \"_enable_button\"] : labels[section.name + \"_disable_button\"];\r\n\r\n\t\t\t\t\tbutton.innerHTML = button_text;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdisable: function (node, section) {\r\n\t\t\t\tsection.disabled = true;\r\n\t\t\t\toptional_time.update_block(node, section);\r\n\r\n\t\t\t},\r\n\t\t\tenable: function (node, section) {\r\n\t\t\t\tsection.disabled = false;\r\n\t\t\t\toptional_time.update_block(node, section);\r\n\t\t\t},\r\n\t\t\tbutton_click: function (index, el, section, container) {\r\n\t\t\t\tif (gantt.callEvent(\"onSectionButton\", [gantt._lightbox_id, section]) === false) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar config = gantt._get_typed_lightbox_config()[index];\r\n\t\t\t\tif (config.disabled) {\r\n\t\t\t\t\toptional_time.enable(container, config);\r\n\t\t\t\t} else {\r\n\t\t\t\t\toptional_time.disable(container, config);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn optional_time;\r\n\t};\r\n\r\n\tgantt.form_blocks.duration_optional = gantt._extend_to_optional(gantt.form_blocks.duration);\r\n\tgantt.form_blocks.time_optional = gantt._extend_to_optional(gantt.form_blocks.time);\r\n\r\n};","export default function(gantt){\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tgantt._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\r\n\t\t},\r\n\r\n\t\tgetTimelineCellAttr:function(dateString){\r\n\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\t\t_taskCommonAttr: function(task, div){\r\n\r\n\t\t\tif(!(task.start_date && task.end_date))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(gantt.templates.tooltip_text(task.start_date, task.end_date, task)));\r\n\r\n\t\t\tif(task.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tsetTaskBarAttr: function(task, div){\r\n\t\t\tthis._taskCommonAttr(task, div);\r\n\r\n\t\t\t// task bars are complex elements that should be treated as a single element\r\n\t\t\tdiv.setAttribute(\"role\", \"img\");\r\n\r\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.drag_move){\r\n\t\t\t\tif(task.id != gantt.getState(\"tasksDnd\").drag_id){\r\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdiv.setAttribute(\"aria-grabbed\", true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttaskRowAttr: function(task, div){\r\n\r\n\t\t\tthis._taskCommonAttr(task, div);\r\n\r\n\t\t\tif(!gantt.isReadonly(task) && gantt.config.order_branch){\r\n\t\t\t\tdiv.setAttribute(\"aria-grabbed\", false);\r\n\t\t\t}\r\n\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t\t// selected attribute should be added only to the grid because\r\n\t\t\t// other parts don't have the keyboard navigation\r\n\t\t\tdiv.setAttribute(\"aria-selected\", gantt.isSelectedTask(task.id) ? \"true\" : \"false\");\r\n\r\n\t\t\t// allowed values start from 1, set 1 for non-tree datastores\r\n\t\t\tdiv.setAttribute(\"aria-level\", task.$level + 1 || 1);\r\n\r\n\t\t\tif(gantt.hasChild(task.id)){\r\n\t\t\t\tdiv.setAttribute(\"aria-expanded\", task.$open ? \"true\" : \"false\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tlinkAttr: function(link, div){\r\n\r\n\t\t\tvar linkTypes = gantt.config.links;\r\n\r\n\t\t\tvar toStart = link.type == linkTypes.finish_to_start || link.type == linkTypes.start_to_start;\r\n\t\t\tvar fromStart = link.type == linkTypes.start_to_start || link.type == linkTypes.start_to_finish;\r\n\r\n\t\t\tvar content = gantt.locale.labels.link + \" \" + gantt.templates.drag_link(link.source, fromStart, link.target, toStart);\r\n\r\n\t\t\t// links are complex elements that should be treated as a single element\r\n\t\t\tdiv.setAttribute(\"role\", \"img\");\r\n\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(content));\r\n\t\t\tif(gantt.isReadonly(link)){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgridSeparatorAttr: function(div){\r\n\t\t\t// the only valid role for the grid header\r\n\t\t\tdiv.setAttribute(\"role\", \"columnheader\");\r\n\t\t},\r\n\t\trowResizerAttr: function(div){\r\n\t\t\t// the only valid role for the grid header\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t\tdiv.firstChild.setAttribute(\"aria-level\", \"1\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":gantt.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.years;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.months;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.days;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = gantt.locale.labels.hours + gantt.locale.labels.minutes;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\tlightboxDurationInputAttrString: function(section){\r\n\t\t\treturn this.getAttributeString({\r\n\t\t\t\t\"aria-label\": gantt.locale.labels.column_duration,\r\n\t\t\t\t\"aria-valuemin\": \"0\",\r\n\t\t\t\t\"role\": \"spinbutton\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tinlineEditorAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"row\");\r\n\t\t},\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn [\" role='treegrid'\", gantt.config.multiselect ? \"aria-multiselectable='true'\" : \"aria-multiselectable='false'\", \" \"].join(\" \");\r\n\t\t},\r\n\r\n\r\n\t\tgridScaleRowAttrString: function(){\r\n\t\t\treturn \"role='row'\";\r\n\t\t},\r\n\r\n\t\tgridScaleCellAttrString: function(column, label){\r\n\t\t\tvar attrs = \"\";\r\n\t\t\tif(column.name == \"add\"){\r\n\t\t\t\t// a more precise role is button, but it is not valid for the grid header\r\n\t\t\t\tattrs = this.getAttributeString({\"role\":\"columnheader\", \"aria-label\": gantt.locale.labels.new_task});\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar attributes = {\r\n\t\t\t\t\t\"role\":\"columnheader\",\r\n\t\t\t\t\t\"aria-label\": label\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(gantt._sort && gantt._sort.name == column.name){\r\n\t\t\t\t\tif(gantt._sort.direction == \"asc\"){\r\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"ascending\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tattributes[\"aria-sort\"] = \"descending\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tattrs = this.getAttributeString(attributes);\r\n\t\t\t}\r\n\t\t\treturn attrs;\r\n\t\t},\r\n\r\n\t\tgridDataAttrString: function(){\r\n\t\t\treturn \"role='rowgroup'\";\r\n\t\t},\r\n\r\n\t\treorderMarkerAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"grid\");\r\n\t\t\tdiv.firstChild.removeAttribute(\"aria-level\");\r\n\t\t\tdiv.firstChild.setAttribute(\"aria-grabbed\", \"true\");\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(column, textValue, task){\r\n\t\t\tvar attributes = {\"role\":\"gridcell\", \"aria-label\": textValue};\r\n\t\t\tif(!column.editor || gantt.isReadonly(task)){\r\n\t\t\t\tattributes[\"aria-readonly\"] = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn this.getAttributeString(attributes);\r\n\t\t},\r\n\r\n\t\tgridAddButtonAttrString: function(column){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\": gantt.locale.labels.new_task});\r\n\t\t},\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' aria-level='1' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn gantt._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !gantt.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in gantt._waiAria){\r\n\t\tgantt._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \"\";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(gantt._waiAria[i]);\r\n\t}\r\n\r\n\r\n};","import extensions from \"./ext/extensions_gpl\";\r\nimport base from \"./factory/make_instance_web\";\r\nimport scope from \"./utils/global\";\r\nconst gantt = (scope as any).gantt = base(extensions);\r\n\r\nexport default gantt;\r\nexport { gantt };","import \"../css/dhtmlxgantt.less\";\r\n\r\nimport factory from \"./make_instance_common\";\r\nimport ui from \"../core/ui_core\";\r\nimport ajaxLoading from \"../core/loading/ajax_loading\";\r\nimport dynamicLoading from \"../core/loading/dynamic_loading\";\r\n\r\nexport default function(supportedExtensions) {\r\n\tvar gantt = factory(supportedExtensions);\r\n\r\n\tif(!gantt.env.isNode){\r\n\t\tui(gantt);\r\n\t\tajaxLoading(gantt);\r\n\t\tdynamicLoading(gantt);\r\n\t}\r\n\r\n\treturn gantt;\r\n};","export default function(gantt) {\r\n\tgantt.load = function (url, type, callback) {\r\n\t\tthis._load_url = url;\r\n\t\tthis.assert(arguments.length, \"Invalid load arguments\");\r\n\r\n\t\tvar tp = 'json', cl = null;\r\n\t\tif (arguments.length >= 3) {\r\n\t\t\ttp = type;\r\n\t\t\tcl = callback;\r\n\t\t} else {\r\n\t\t\tif (typeof arguments[1] == \"string\")\r\n\t\t\t\ttp = arguments[1];\r\n\t\t\telse if (typeof arguments[1] == \"function\")\r\n\t\t\t\tcl = arguments[1];\r\n\t\t}\r\n\r\n\t\tthis._load_type = tp;\r\n\r\n\t\tthis.callEvent(\"onLoadStart\", [url, tp]);\r\n\r\n\t\treturn this.ajax.get(url, gantt.bind(function (l) {\r\n\t\t\tthis.on_load(l, tp);\r\n\t\t\tthis.callEvent(\"onLoadEnd\", [url, tp]);\r\n\t\t\tif (typeof cl == \"function\")\r\n\t\t\t\tcl.call(this);\r\n\t\t}, this));\r\n\t};\r\n};"],"names":["getNodePosition","elem","top","left","right","bottom","getBoundingClientRect","box","body","document","docElem","documentElement","parentNode","scrollTop","window","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","offsetWidth","offsetHeight","parseInt","offsetTop","offsetLeft","offsetParent","y","Math","round","x","width","height","isVisible","node","display","visibility","getComputedStyle","style","currentStyle","hasNonNegativeTabIndex","isNaN","getAttribute","hasHref","a","area","nodeName","loLowerCase","isEnabled","input","select","textarea","button","object","toLowerCase","hasAttribute","getFocusableNodes","root","nodes","querySelectorAll","join","nodesArray","Array","prototype","slice","call","i","length","$position","sort","b","tabIndex","splice","getScrollSize","div","createElement","cssText","appendChild","clientWidth","removeChild","max","getClassName","className","baseVal","indexOf","_trimString","addClassName","removeClassName","name","split","regEx","RegExp","replace","toNode","getElementById","querySelector","_slave","insertNode","newone","innerHTML","child","firstChild","removeNode","getChildNodes","css","ch","childNodes","len","out","obj","push","getTargetNode","e","trg","tagName","event","target","srcElement","shadowRoot","composedPath","locateAttribute","attribute","str","String","trim","this","apply","locateClassName","classname","strict","undefined","ind","charAt","getRelativeEventPosition","ev","d","clientX","clientY","getRelativeNodePosition","parent","childPos","parentPos","isChildOf","closest","element","selector","matches","msMatchesSelector","webkitMatchesSelector","el","contains","parentElement","nodeType","console","error","getClosestSizedElement","isShadowDomSupported","head","createShadowRoot","attachShadow","getActiveElement","activeElement","getSelection","focusNode","getRootNode","ShadowRoot","host","classList","test","scope","global","EventsManager$1","gantt","_mouseDown","_gantt","_domEvents","_createDomEventScope","selectedRegion","useKey","ignore","_target","getViewPort","_originPosition","_restoreOriginPosition","position","state","$services","getService","registerProvider","autoscroll","scheduledDndCoordinates","startDragAndDrop","setStart","copy","setPosition","setEnd","attach","filterTargets","utils","dom","_getCoordinates","eventElement","domHelpers.getRootNode","$root","coordinates","dragEnd","dragTimeline","ext","clickDrag","dragTimelineUseKey","config","drag_timeline","abs","relative","render","detachAll","unregisterProvider","detach","viewPort","viewPortBounds","absolute","EventHost","_silent_mode","listeners","_silentStart","_silentEnd","createEventStorage","handlers","index","eventStorage","combinedResult","handlerResult","arguments","addEvent","handler","settings","t","handlerId","id","once","originalHandler","removeEvent","clear","makeEventable","eventHost","attachEvent","eventName","thisObject","bind","attachAll","callback","callEvent","eventArguments","handlerName","concat","checkEvent","detachEvent","list","eventId","detachAllEvents","units","second","minute","hour","day","week","month","quarter","year","getSecondsInUnit","unit","forEach","arr","workArray","arrayFind","find","arrayIncludes","item","includes","isArray","pop","isDate","getFullYear","getMonth","getDate","isValidDate","getTime","delay","timeout","timer","result","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","replaceValidZeroId","rootId","checkZeroId","findBinary","array","prev","low","high","floor","SelectedRegion","view","_el","defaultRender","start","end","min","_singleRow","pos","_getTaskPositionByTop","_startPoint","_view","_viewPort","add","_callback","_endPoint","draw","eventable","singleRow","_useRequestAnimationFrame","useRequestAnimationFrame","requestAnimationFrame","getElement","startPoint","_startDate","dateFromPos","endPoint","_endDate","_positionPoint","positionPoint","getState","max_date","valueOf","tasksByTime","getTaskByTime","tasksByIndex","_getTasksByTop","getInBounds","startValue","endValue","startIndex","endIndex","getTaskByIndex","getItemIndexByTopPosition","task","getItemHeight","getItemTop","n","dataHeight","getTotalHeight","row_height","getTaskCount","EventsManager","_calculateDirectionVector","_trace","dots","vectors","resultVector","vector","magnitude","sqrt","angleDegrees","atan2","PI","_applyDndReadyStyles","_timeline","$task","_clearDndReadyStyles","remove","_getScrollPosition","timeline","$ui","getView","$config","scrollX","getScrollState","scrollY","_countNewScrollPosition","coords","shiftX","shiftY","_scrollState","_setScrollPosition","scrollLayoutCell","$id","_stopDrag","_originalReadonly","readonly","_originAutoscroll","_startDrag","create","destructor","enabled","clickDragUseKey","click_drag","scrollPosition","modals","modalsStack","isModal","afterPopup","$destroyed","focus","startModal","eventRemove","trapFocus","endModal","currentTarget","$keyboardNavigation","traceLightbox","getLightbox","focusElement","QuickInfo","show","_showForTask","_showAtCoordinates","hide","forced","qi","_quickInfoBox","_quickInfoBoxId","taskId","_quickInfoTask","quick_info_detached","getNode","setContainer","container","_container","setContent","content","defaultContent","header","title","date","buttons","quickinfo_buttons","_createQuickInfoElement","titleBox","titleContent","titleDate","main","controls","_waiAria","quickInfoHeader","html","ariaAttr","quickInfoButtonAttrString","locale","labels","_qiButtonClickHandler","_qiKeyPressHandler","_qi_button_click","code","which","_appendAtCoordinates","show_quick_info","_getContainer","_get_event_counter_part","xViewport","yViewport","_init_quick_info","_prepare_quick_info_classname","_fill_quick_data","_show_quick_info","offset","domEv","getTaskNode","getTaskRowNode","scroll","dx","dy","quickInfoAttr","quickInfoHeaderAttrString","getTask","_quickInfoReadonly","isReadonly","getTaskType","template","templates","quick_info_class","start_date","end_date","allowedButtons","isEditor","icon_delete","icon_edit","quick_info_title","quick_info_date","quick_info_content","popupHeight","scrolls","screenWidth","relativePopupBottom","mask","$click","$task_data","$grid_data","$grid","$layout","seed","plainObjectConstructor","constructor","toString","helpers.isDate","Date","helpers.isArray","Object","hasOwnProperty","mixin","source","force","f","defined","uid","functor","capture","addEventListener","removeEventListener","createScope","utils.event","utils.eventRemove","eventScope","staticArray","extend","Tooltip","_tooltipNode","tooltipAttr","_root","domHelpers.isChildOf","_isLikeMouseEvent","_calculateTooltipPosition","tooltipVisibleAttr","tooltipHiddenAttr","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","domHelpers.getRelativeEventPosition","containerPos","domHelpers.getNodePosition","_getViewPort","TooltipManager","_listeners","domEventsScope","_initDelayedFunctions","hideTooltip","delayHide","watchableTarget","eventTarget","domHelpers.getTargetNode","targetNode","domHelpers.closest","doOnMouseEnter","onmouseenter","onmousemove","onmouseleave","listener","cloneDomEvent","clone","createEvent","delayShow","helpers.delay","tooltip_timeout","tooltip_hide_timeout","noTrack","onBeforeUndo","onBeforeRedo","batchActions","Monitor","undo","_batchAction","_batchMode","_ignore","_ignoreMoveEvents","_initialTasks","_initialLinks","_nestedTasks","_nestedLinks","_undo","_attachEvents","type","overwrite","undo_types","_storeTask","link","_storeLink","newValue","startIgnore","stopIgnore","startBatchAction","_timeout","stopBatchAction","action","logAction","_storeTaskCommand","command","update","$local_index","getTaskIndex","oldValue","getInitialTask","getParent","_storeEntityCommand","move","entity","children","childrenLinks","_storeLinkCommand","taskIds","tasks","linkIds","_getLinks","setInitialTask","uniqueLinks","links","setInitialLink","$index","getGlobalTaskIndex","setInitialTaskObject","getLink","deleteCacheCooldown","saveInitialAll","clearInitialTasks","eachTask","clearInitialLinks","getLinks","getMoveObjectByTaskId","clearUndoStack","clearRedoStack","onTaskAdded","onTaskUpdated","onTaskDeleted","onLinkAdded","onLinkUpdated","onLinkDeleted","onTaskMoved","toggleIgnoreMoveEvents","store","nested","setNestedTasks","datastore","getDatastore","tindex","isMoveEventsIgnored","dragId","projectDrag","drag_id","isSummaryTask","drag_project","plugins","multiselect","selectedIds","getSelectedTasks","inlineEditors","onBeforeEditStartId","onEditStart","updateConfigs","undoEnabled","commands","old","actionType","entityType","_storeCommand","isTaskExists","getInitialLink","$source","$target","linkId","Undo","maxSteps","redoEnabled","invert","revert","value","inverseCommands","types","assert","_undoStack","_redoStack","getUndoStack","stack","undo_steps","undo_actions","redo","_pop","_reorderCommands","_applyAction","_push","shift","weights","any","actionWeights","weightA","entities","actions","methods","get","isExists","batchUpdate","method","getMethod","check","prop","startsWith","extensions","defaultConfig","eventsManager","fullscreen","isExpanded","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","isFullscreenAvailable","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","backupBodyPadding","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","backupElementSizes","zIndex","modified","backupPositioning","updateSizes","expandGantt","onFullScreenChange","$container","getFullscreenElement","positions","originalPositioning","record","restoreSizes","cantFullscreen","warning","log","requestArguments","webkitRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","requestExitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","exitFullscreen","collapse","expand","keyboard_navigation","keyboard_navigation_cells","_compose","parts","res","p","shortcuts","createCommand","modifiers","alt","ctrl","meta","keyCode","parse","shortcut","expr","getExpressions","words","getWords","j","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","shiftKey","altKey","ctrlKey","metaKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","tab","enter","esc","space","up","down","home","pageup","pagedown","delete","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","findHandler","hash","doAction","facade","preventDefault","returnValue","unbind","bindAll","map","initKeys","keys","domHelpers.getFocusableNodes","focusable","currentFocus","domHelpers.getActiveElement","currentIndex","lastItem","firstItem","GanttNode","blur","scrollHorizontal","dir","scale","getScale","step","scrollTo","posFromDate","scrollVertical","KeyNavNode","isValid","fallback","moveTo","dispatcher","setActiveNode","compareTo","canStringifyThis","canStringifyThat","eventFacade","setAttribute","$eventAttached","HeaderCell","show_grid","getVisibleTaskCount","getGridColumns","TaskRow","visibleColumns","fromDomElement","cellElement","domHelpers.locateClassName","previousSibling","$grid_scale","columns","taskRow","rootLevel","getChildren","root_id","TaskCell","click","createTask","globalIndex","splitItem","$split_subtask","parentId","nextIndex","locate","isTaskVisible","task_attribute","keptFocus","getTaskPosition","getTaskHeight","viewWidth","viewHeight","inner_width","inner_height","scroll_on_click","show_chart","task_scroll_offset","grid","scrollPositionX","scrollPositionY","attachedScrollbarHorizontal","scrollable","scrollbarHorizontal","attachedScrollbarVertical","scrollbarVertical","nextElement","prevTask","getPrev","nextTask","getNext","hasChild","$open","open","close","prevId","getPrevSibling","moveTask","updateTask","isSelectedTask","unselectTask","selectTask","showLightbox","columnIndex","domHelpers.locateAttribute","row","isActive","activeNode","globalNode","enable","getActiveNode","disable","getDefaultNode","setDefaultNode","inputs","focusGlobalNode","blurNode","focusChanged","keyDownHandler","defaultPrevented","ganttNode","awaitsFocus","clearDelay","isTaskFocused","isInlineEditorCell","isNoKeyboardNavigationElement","focusHandler","$preventDefault","reFocusActiveNode","outsideGantt","localName","domElement","mousedownHandler","locateTask","removeAttribute","onReady","$data","tasksStore","currentNode","gridDataTopScroll","gridDataBottomScroll","_smart_render","updateRender","_redrawTasks","renderers","items","focusedItemVisible","createdTaskId","keepFocusOnNewTask","placeholder","nodeConstructor","placeholder_task","focusOnCreate","oldId","newId","interval","setInterval","getScope","mode","scopes","headerCell","taskCell","findVisibleColumnIndex","columnName","clearInterval","keyNavFacade","addShortcut","scopeObject","getShortcutHandler","getCommandHandler","removeShortcut","column","keyboardNavigation","quick_info","quickInfo","text","substr","details","task_time","events","hidingFunction","clearQuickInfo","hideQuickInfo","showQuickInfo","tooltipManager","tooltips","tooltipFor","touch","touch_tooltip","targetTaskId","tooltip_text","link_source_id","monitor","updTask","changeTaskCommandId","updLink","oldTaskId","newTaskId","changeLinkCommandId","updateTasksIds","entry","updateLinksIds","setUndoStack","getRedoStack","setRedoStack","saveState","getInitialState","marker","render_marker","show_markers","min_date","marker_class","markerHeight","getRowTop","timeline_placeholder","scrollHeight","initMarkerArea","markerArea","$marker_area","_markers","createDatastore","initItem","renderMarkers","createDataRender","defaultContainer","addLayer","getMarker","getItem","addMarker","addItem","deleteMarker","exists","removeItem","updateMarker","refresh","_getMarkers","getItems","multiselect_one_level","_multiselect","_selected","_one_level","_active","_first_selected_when_shift","getDefaultSelected","selected","getSelected","setFirstSelected","getFirstSelected","updateState","active","select_task","reset","setLastSelected","silent","unselect","getLastSelected","last","getSelectedId","afterSelect","toggle","isSelected","forSelected","isSameLevel","calculateTaskLevel","_quickRefresh","refreshTask","doSelection","_is_icon_open_click","target_ev","defaultLast","isLast","multiSelect","singleSelection","controller","cell","locateCell","inline_editors_multiselect_open","getEditorConfig","startEdit","blockSelection","first_indx","target_indx","last_indx","tmp","old_selectTask","old_unselectTask","toggleTaskSelection","eachSelectedTask","getLastSelectedTask","old_isSelected","new_id","task_id","oldSelectedId","oldSelectedTask","newSelectedTask","differentTreeLevel","$level","export_api","_apiUrl","previousDateRage","str_to_date","date_format","data","_serializeHtml","_prepareConfigPDF","_serializeAll","_fixColumns","raw","_preparePDFConfigRaw","version","_sendToExport","_pdfExportRouter","_serializePlain","dates","smartRendering","smart_rendering","visual","convert","_eachTaskTimed","_no_progress_colors","_serializeTimeline","_serializeGrid","rawDates","scales","_serializeScales","worktime","_getWorktimeSettings","formData","File","FormData","append","_sendImportAjaxExcel","_sendImportAjaxMSP","importFromPrimaveraP6","importFromMSProject","skip_circular_links","oldXmlFormat","xml_format","oldFormatDate","format_date","oldXmlDate","xml_date","oldDateFormat","exportServiceDateFormat","date_to_str","_customProjectProperties","_customTaskProperties","_clearRecLinks","_exportConfig","$custom_data","custom","exportToPrimaveraP6","exportToMSProject","label","url","pack","cb","ajax","post","base","$template","server","JSON","stringify","sheet","xhr","XMLHttpRequest","onreadystatechange","readyState","status","onload","info","responseText","setRequestHeader","send","encodeURIComponent","_xdr","loader","xdoc","xmlDoc","col","editor","editor_types","skin","_serializableGanttConfig","_markColumns","_ajaxToExport","form","_createHiddenForm","submit","_hidden_export_form","constraint_date","deadline","key","formatDate","_color_box","_color_hash","color","_getColor","backgroundColor","parsedRanges","minutes","range","startMinute","endMinute","defaultWorkTimes","hours","time","work_time","wTime","_working_time_helper","get_calendar","worktimes","parsed","_getMinutesWorktimeSettings","master","branch","_pull","_originalCopyObject","json","_copyObject","task_text","_copyObjectBase","rgb","match","toISOstring","_copyObjectColumns","_copyObjectPlain","getDayIndex","_day_index_by_date","columnIndexByDate","$start","$end","hiddenCells","scaleCellsWidth","$type","$rendered_type","tmps","$text","$left","leftside_text","$right","rightside_text","_copyObjectTable","$color","ct","val","date_grid","smartScales","smart_scales","_copyObjectAll","_exportSerialize","_scale_helpers","_get_scales","minWidth","min_column_width","autosizeMinWidth","_get_resize_options","autosize_min_width","scale_height","prepareConfigs","availWidth","autosize","_getScales","rtl","$scaleHelper","_copyObjectColors","cellColors","timeline_cell_class","task_cell_class","_getRaw","steps","trace_x","styles","cellCss","_getStyles","Infinity","col_width","format","date_scale","scaleCell","scaleCell_class","scaleCss","exportMode","cols","ccount","tree","xmlFormat","serialize","_lvl","_setLevel","_makeLinksSameLevel","skippedLinks","_clearCircDependencies","_clearLinksSameLevel","_clearLevel","usedTasks","prevLink","sources","$_source","_onCircDependencyFind","targets","curLink","targetTask","_source","targetLvl","linkT","sourceParent","targetParent","$_target","project","projectName","projectDates","getSubtaskDates","start_end","manual","auto_scheduling","durationUnit","projectProperties","taskProperties","exportToPDF","exportToPNG","exportToICal","exportToExcel","exportToJSON","importFromExcel","constants","KEY_CODES","UP","DOWN","LEFT","RIGHT","SPACE","ENTER","DELETE","ESC","TAB","ExtensionsManager","addExtension","_extensions","getExtension","layout","rows","resizer","finish_to_start","start_to_start","finish_to_finish","start_to_finish","milestone","auto_types","duration_unit","correct_work_time","skip_off_time","cascade_delete","autoscroll_speed","deepcopy_on_parse","show_links","show_task_cells","static_background","static_background_cells","branch_loading","branch_loading_property","show_loading","min_duration","start_on_monday","server_utc","show_progress","fit_tasks","preserve_scroll","container_resize_timeout","deadlines","drag_links","drag_progress","drag_resize","drag_move","drag_mode","resize","progress","round_dnd_dates","link_wrapper_width","link_arrow_size","autofit","align","scale_offset_minimal","inherit_scale_class","time_step","duration_step","task_date","time_picker","link_attribute","layer_attribute","buttons_left","_migrate_buttons","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","buttons_right","lightbox","sections","map_to","project_sections","milestone_sections","single_date","drag_lightbox","details_on_create","details_on_dblclick","initial_scroll","order_branch","order_branch_free","task_height","bar_height","bar_height_padding","min_grid_column_width","grid_resizer_column_attribute","keep_grid_width","grid_resize","grid_elastic_columns","show_tasks_outside_timescale","show_unscheduled","resize_rows","task_grid_row_resizer_attribute","min_task_grid_row_height","readonly_property","editable_property","calendar_property","resource_calendars","dynamic_resource_calendars","inherit_calendar","type_renderers","open_tree_initially","optimize_render","prevent_default_scroll","show_errors","wai_aria_attributes","horizontal_scroll_key","drag_multiple","csp","isWindowAwailable","env","isIE","navigator","userAgent","isIE6","isIE7","isIE8","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialized","createConfig","Error","async","headers","fastVersion","utc","dateToStrFn","Function","to_fixed","getISOWeek","getWeek","splt","strToDateFn","dateString","cspVersion","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","getDay","day_full","month_short","month_full","getUTCHours","getHours","getUTCMinutes","getMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","set","temp","month_short_hash","month_full_hash","UTC","canUseCsp","useCsp","cspAutoCheck","dateHelper","init","s","date_part","setHours","hour_start","setTime","time_part","getTimezoneOffset","week_start","month_start","setDate","quarter_start","res_month","m","setMonth","year_start","day_start","setMinutes","minute_start","setSeconds","getMilliseconds","setMilliseconds","_add_days","modifiedDate","inc","originalDate","incCondition","getHoursCondition","getDateCondition","ndate","setYear","add_quarter","num","cspCompliantVersion","_getWeekNumber","isoWeek","nday","first_thursday","year_number","ordinal_date","convert_to_utc","parseDate","parse_date","token","_url","_token","_mode","_seed","_queue","api","_events","Accept","credentials","fetch","then","websocket","_wrapper","connect","_socket","onclose","location","protocol","o","r","WebSocket","onmessage","fire","onError","_send","_resubscribe","Promise","_uid","resolve","reject","onCall","filter","catch","onResponse","remoteEvents","remote","remote_client.Client","req","_ready","load","back","_remote","ready","on","checkTimeout","updPerSecond","_on_timeout","ceil","StateService","stateProviders","internal","utils.mixin","provider","Promise$1","$powerArray","$create","$removeAt","$remove","$find","$insertAt","$each","$map","$filter","isPlaceholderTask","DataStore","pull","$initItem","visibleOrder","powerArray","fullOrder","_skip_refresh","_filterRule","_searchVisibleOrder","_indexRangeCache","_getItemsCache","_attachDataChange","_parseInner","loaded","copyOnParse","utils.copy","isSilent","_updateOrder","updateItem","utils.defined","_removeItemInner","_addItemInner","order","data_size","getVisibleItems","getIndexRange","utils.uid","_changeIdInner","changeId","_moveInner","sindex","getIdByIndex","clearAll","alreadySilent","arraysEqual","arr1","arr2","quick","skipFilter","_quick_refresh","_mark_recompute","oldOrder","count","countVisible","eachItem","rule","filteredOrder","placeholderIds","_ganttConfig","from","to","cacheKey","ret","getIndexById","_getNullIfUndefined","getFirst","getLast","TreeDataStore","_branches","loadedItem","existingItem","$parentProperty","parentProperty","$getRootId","$openInitially","openInitially","_eachItemMainRangeCache","getConfig","splitParents","splitItems","taskOpenState","taskVisibility","haveSplitItems","_isSplitItem","canOpenSplitTasks","open_split_tasks","$expanded_branch","isHeadless","_buildTree","setParent","_add_branch","calculateItemLevel","getBranchIndex","targetIndex","_move_branch","$rendered_parent","_replace_branch_child","_traverseBranches","itemId","sid","source_pid","tbranch","tid","diff","childId","pid","getSiblings","getNextSibling","siblings","nextSibling","level","eachParent","_setParentInner","new_pid","_eachItemCached","cache","_eachItemIterate","startId","itemsStack","reverse","useCache","buildCache","startItem","parentsHash","old_parent","new_parent","old_id","newbranch","field","desc","criteria","original_criteria","els","renderedParent","actualParent","_skipTaskRecalculation","datastoreRender","itemRepainter","renderer","renders","getLayers","render_item","allData","loadedRanges","layer","layerData","get_visible_range","ids","prepare_data","render_items","update_items","extraDataArr","skipRepaint","batch_update","getDataRender","onUpdateRequest","change_id","getDatastores","storeNames","facadeFactory","$StoreType","self","selectedId","deleteItem","subItem","storeAccessName","dropService","storeList","setService","_getDatastores","refreshData","scrollState","stores","refresh_links","refreshLinks","refreshLink","_bulk_dnd","hasSplitParent","isSplitTask","linksStore","_update_flags","userdata","_clear_data","oldSelectId","_skipResourceRepaint","addTask","deleteTask","utils.bind","startTask","changeTaskId","oldid","newid","getLinkCount","isLinkExists","addLink","newLink","updateLink","deleteLink","changeLinkId","ScaleHelper","services","getSum","sizes","summ","setSumWidth","sum_width","adjustSize","full_width","splitSize","full","share","sortScales","cellSize","_isLegacyMode","scaleConfig","scale_unit","subscales","_prepareScaleObject","primaryScale","legacyMode","initTemplate","scale_cell_class","getSubScales","docLink","warn","min_coll_width","container_width","minDate","maxDate","heights","configs","main_scale","cfg","initScaleConfig","processIgnores","initColSizes","limitVisibleRange","unshift","alineScaleColumns","reverseScale","setPosSettings","indexes","trace_indexes","trace_index_transition","_ignore_time_config","skip","probe","isWorkTime","ignore_x","display_count","min_col_width","line_height","cont_width","column_count","ignores","eachColumn","trace_x_ascending","iterateScales","lower_scale","upper_scale","upper_dates","lower_dates","prevUpper","target_index","upper_start","upper_end","lower_start","lower_end","targetWidth","curr","tzOffset","_correct_dst_change","lastDate","outDate","shared","_init_tasks_range","PrimaryScaleHelper","helper","start_interval","onlyProjectTasks","extendRangeForDates","constraint_type","constraint_types","ASAP","ALAP","baselines","baseline","calculateEndDate","duration","_min_date","_max_date","updateTasksRange","old_min","old_max","copyLinkIdsArray","targetHash","copyLinkIds","treeHelper","getSubtreeLinks","getSubtreeTasks","DataProcessorEvents","dp","$gantt","$dp","_dataProcessorHandlers","cascadeDelete","clientSideDelete","setGanttMode","setUpdated","_sendTaskOrder","deleteAfterConfirmation","needDbDelete","needCascadeDelete","dpMode","updateMode","setUpdateMode","cascade","storeItem","sendAllData","_tSend","_waitMode","itemLinks","_links","_dp","_tMode","_serverProcessor","_ganttMode","substring","serverProcessor","pluralizedMode","urlSeparator","upd","xml","_xmlNodeToJSON","isExist","objData","property","assignmentsStore","handleResourceCRUD","handleResourceAssignmentCRUD","handleBaselineCRUD","updated","updatedRows","clientOnly","getUserData","_in_progress","resources","dataprocessor_assignments","resource_assignment_store","insertedTasks","pendingAssignments","insertResourceAssignment","assignment","dataprocessor_resources","resourcesStore","resource_store","resource","dataprocessor_baselines","baselineStore","helpers.forEach","SimpleStorage","_storage","getStoredItem","_Vt","DataProcessor$1","serverProcessorURL","action_param","autoUpdate","_headers","_payload","_postDelim","_routerParametersFormat","_invalid","messages","inserted","deleted","invalid","invalid_cell","enableUTFencoding","total","payload","_serializeAsJson","_router","router","_utf","escape","getSyncState","dnd","rowId","findRow","existing","set_invalid","setUserData","is_invalid","markRow","sendData","_methods","editStop","pendingUpdateModes","modes","checkBeforeUpdate","_beforeSendData","_getRowData","_serializeAsJSON","serialize_one","security_key","pref","valid","_forEachUpdatedRow","_sendData","_getAllData","pattern","_uActions","btag","ganttMode","correct","originalSid","that","_xml","getGanttMode","reqUrl","filePath","tag","processCallback","afterUpdateCallback","finalizeUpdate","xmltop","cleanUpdate","atag","xpath","_initialized","_dp_init","_setDefaultTransactionMode","delete_confirmation","_change_id","_row_style","$dataprocessor_class","_delete_task","$drop_target","setDp","dataProcessorEvents","user","_user","_needUpdate","_updateBusy","afterAutoUpdate","fullSync","loadUpdate","xml_node","getUpdates","vers","_getXmlNodeValue","updates","newState","dataToSend","processedData","_cleanupArgumentsBeforeSend","_cleanupItemBeforeSend","updatedItem","output","taskState","taskAction","getActionByState","_onResolvedCreateUpdate","actionPromise","errorMsgStart","errorMsgEnd","queryParams","afterUpdate","dhxVersion","urlParams","_applyPayload","preprocessedData","query","setTransactionMode","nodeValue","hasOne","traversedObjects","_prepareDate","helpers.arrayIncludes","_prepareArray","_prepareObject","rawItem","processedItem","dataItem","_prepareDataItem","DataProcessor","DEPRECATED_api","DataProcessor.DataProcessor","createDataProcessor","tMode","createMethod","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","restoreMethods","batchUpdatePayload","noRedraw","dp_mode","call_dp","resetProjects","resetProjectDates","createWbs","_needRecalc","_isRecalcNeeded","_isGroupSort","_getWBSCode","_calcWBS","$virtual","$wbs","_setWBSCode","getWBSCode","getByWBSCode","_isFirst","_prevSibling","_wbs","_parent","wbs","resetCache","getTaskByWBSCode","createResourceMethods","resourceTaskCache","singleResourceCacheBuilt","falsyValuePrefix","random","resourceHashFunction","getCacheKey","resourceIds","typeFilter","getResourceTasks","matchingResources","resourceId","resourceValue","resource_id","selectAssignments","resource_property","owners","getTaskBy","propertyName","propertyValue","getResourceAssignments","assignments","resourcePlugin","renderEditableLabel","editable","$task_id","$resource_id","renderSummaryLabel","sum","reduce","Number","editableResourceCellTemplate","$role","editableResourceCellClass","capacity","getSummaryResourceAssignments","childResource","initEditableDiagram","resource_render_empty_cells","timeoutId","makeEditable","cancelAnimationFrame","contentEditable","getCellsByType","$content","assignmentEditInProcess","strValue","innerText","assignmentId","startDate","endDate","assignmentStore","nextChunk","calculateDuration","updateTaskAssignments","editable_resource_diagram","fetchTasks","lightbox_resources","lightboxOptions","resourceStoreConfig","initItems","storeType","$resourcesStore","lightboxOptionsFnc","options","updateCollection","histogram_cell_class","histogram_cell_label","histogram_cell_allocated","histogram_cell_capacity","defaultResourceCellClass","defaultResourceCellTemplate","resource_cell_value","resource_cell_class","resource_assignments","resourceAssignmentsProperty","process_resource_assignments","resourceAssignmentFormats","auto","singleValue","valueArray","resourceValueArray","assignmentsArray","resourceAssignmentFormat","assignmentModes","fixedDates","fixedDuration","default","initAssignmentFields","initDelay","timing","_assignmentTimeFromTask","resourceAssignmentsStore","_makeAssignmentsFromTask","resourceAssignments","detectFormat","usedIds","defaultMode","_updateTaskBack","_assignAssignments","getTaskAssignments","_loadAssignmentsFromTask","_syncAssignments","storeAssignments","taskValues","assignmentsStoreValues","inBoth","inTaskNotInStore","inStoreNotInTask","taskOwner","ownerId","foundOwnerAssignment","taskSearch","storeSearch","processedIds","inTask","inStore","ignoreFields","_syncOnTaskUpdate","totalAssignments","needUpdate","needUpdateFor","undoBatchCancel","assignmentsHash","unscheduled","idsSearch","deleteIds","resourceAssignmentsCache","resourceTaskAssignmentsCache","taskAssignmentsCache","searchTaskId","resourceTaskCacheKey","getTaskResources","uniqueResources","addPlaceholder","callIfEnabled","insertPlaceholder","placeholders","new_task","afterEdit","newTask","dataProcessor","_silencedPlaceholder","isPlaceholderLink","auto_task_types","checkTaskType","changedTypes","targetType","getTaskTypeToUpdate","$needsUpdate","updateParentTypes","group_mode","delTaskParent","allTypes","hasChildren","taskType","originalRowDndParent","originalMoveTaskParent","isParsingDone","updateAfterRemoveChild","DurationFormatterNumeric","canParse","_ie","LinkFormatterSimple","_linkReg","linkPart","exec","_findSource","lag","pred","reqTemplate","_ne","formatters","durationFormatter","DurationFormatter","linkFormatter","LinkFormatter","empty_state_screen","show_empty_state","emptyStateElement","isGanttEmpty","placeholderContainer","empty_state_text_link","empty_state_text_description","clickEvents","detachAddTaskEvents","getContainer","domHelpers","wrapper","marginTop","oldNodes","attachAddTaskEvent","renderContent","emptyStateElementNode","hasBaselinesBelow","baselinesOnDifferentRow","render_mode","childrenHaveBaselines","hasBaselines","isSplitParent","getMaxParentHeight","heightLimit","maxHeight","shrinkHeight","splitChild","parentHeight","getItemPosition","rowHeight","_adjustSplitParentHeight","maxParentHeight","adjustTaskHeightForBaselines","childHeight","_increaseSplitParentHeight","getLayoutView","getBarHeight","subtaskId","subtask","subtaskHeight","baselineSize","baselineAmount","subrowHeight","newBaseline","existingBaseline","shouldRepaint","iteratedBaselines","taskBaselines","exisingBaselines","getTaskBaselines","exisingBaseline","repaint","parsing","jsonParseError","on_load","resp","responseURL","_process_loading","collections","_load_collections","assignmentsByTasks","collections_loaded","collection","serverList","option","option_key","$ignore","dhx_security","serializeTask","serializeLink","_copyLink","rawLinks","baselineCopy","attrs_only","attributes","_getCollections","opts","itms","attrs","k","attr","_getXML","toptag","getXMLTopNode","skey","evs","oldxml","startdate","est","enddate","predecessortasks","message","IsWorkTimeArgument","calendar","ClosestWorkTimeArgument","CalculateEndDateArgument","GetDurationArgument","calendarArgumentsHelper","getWorkHoursArguments","helpers.isValidDate","setWorkTimeArguments","unsetWorkTimeArguments","isWorkTimeArguments","processedConfig","getClosestWorkTimeArguments","arg","_getStartEndConfig","param","argumentType","getDurationArguments","hasDurationArguments","calculateEndDateArguments","WorkTimeCalendarMerger","_getIntervals","hoursArray","_toHoursArray","intervalsArray","formatHHMM","secondsValue","minutePart","_intersectHourRanges","first","baseArray","overridesArray","current","_mergeAdjacentIntervals","_mergeHoursConfig","firstHours","secondHours","merge","firstConfig","secondConfig","mergedSettings","customWeeks","processCalendar","config1","config2","date1","date2","hours2","WorkUnitsMapCache","timestamp","_cache","has","subCache","rawValue","unitCache","yearCache","Map","WorkUnitsObjectCache","LargerUnitsCache","getMinutesPerWeek","weekStart","_weekCache","_calendar","minutesPerWeek","getHoursPerDay","getMinutesPerMonth","monthStart","_monthCache","minutesPerMonth","nextMonth","DateDurationCache","stepCache","durations","endDates","compute","_getCacheObject","startDateTimestamp","_endDateCacheKey","resultTimestamp","_durationCacheKey","endDateTimestamp","CalendarWorkTimeStrategy","argumentsHelper","_workingUnitsCache","_largeUnitsCache","_dateDurationCache","_worktime","_cached_timestamps","_cached_timestamps_count","_clearCaches","_getUnitOrder","_resetTimestampCache","_timestamp","_checkIfWorkingUnit","hasDuration","_is_work_day","_getWorkHours","_is_work_hour","startHour","endHour","_getTimeOfDayStamp","dayEnd","_is_work_minute","checkTime","_nextDate","_getWorkUnitsBetweenGeneric","stepStart","stepEnd","next","checkFirst","checkLast","isLastStep","_isWorkTime","unitOrder","biggerTimeUnit","_getClosestWorkTimeFuture","_getMinutesPerHour","hourStart","hourEnd","_getMinutesPerDay","durationMinutes","durationHours","_getWorkUnitsForRange","getUnitsPerDay","_getMinutesBetweenSingleDay","_getIntervalTimestamp","minuteFrom","minuteTo","_getMinutesBetween","firstDayStart","firstDayEnd","lastDayStart","lastDayEnd","startPart","endPart","_getHoursBetween","_setConfig","_parseSettings","haveCustomWeeks","customWeeksRangeStart","customWeeksRangeEnd","customWeeksBoundaries","_parseHours","minCustomRangeStart","maxCustomRangeEnd","customTime","rangeStart","rangeEnd","fromReadable","toReadable","currentWeek","_tryChangeCalendarSettings","backup","hasWorkTime","_arraysEqual","_compareSettings","mySettings","thatSettings","myDays","otherDates","myHours","otherHours","equals","myWeek","thatWeek","getWorkHours","dateValue","endHours","timestampRanges","part","timerangeConfig","durationSeconds","setWorkTime","calendarConfig","unsetWorkTime","reset_calendar","dateKey","isWorkUnit","setItem","getDuration","_calculateDuration","sign","mult","getEndDate","_calculateEndDate","_calculateMinuteEndDate","_subtractMinuteDate","_calculateHourEndDate","_addInterval","stopAction","added","dstShift","_addHoursUntilDayEnd","rangeHours","addHours","intervalEnd","durationLeft","hoursPerDay","_addMinutesUntilHourEnd","rangeMinutes","addMinutes","_subtractMinutesUntilHourStart","hourStartTimestamp","initialDateTimestamp","minutePrecision","_isMinutePrecision","addedInterval","calculatedDay","daySchedule","minutesInDay","dayStart","iterateFromDayEnd","isWorkHour","workInterval","prevInterval","minutesInHour","_getClosestWorkTimePast","times","lastInterval","getClosestWorkTime","_getClosestWorkTime","inputDate","direction","closestFuture","closestPast","_getClosestWorkTimeGeneric","_findClosestTimeInDay","resultDate","fromDayEnd","_getClosestWorkMinute","increment","hasRegularHours","_checkWorkHours","dayConfig","legacyResourceCalendarConfig","isLegacyResourceCalendarFormat","resourceCalendarsProperty","getResourceProperty","resourceCalendarsConfig","getCalendarIdFromLegacyConfig","calendarId","dynamicResourceCalendars","dynamicCalendars","getCalendarIdFromMultipleResources","manager","getResourceCalendar","tempCalendar","mergeCalendars","addCalendar","CalendarManager","_calendars","_legacyConfig","_isLegacyConfig","createDefaultCalendars","CalendarDisabledTimeStrategy","TimeCalculator","calendarManager","createArgumentsHelper","$disabledCalendar","NoWorkTimeCalendar","_convertWorkTimeSettings","days","calendars","mergeHelper","CalendarMergeHelper","_createCalendarFromConfig","createCalendar","apiCore","preparedConfig","parentCalendar","defaults","fulltime","getCalendar","getCalendars","_getOwnCalendar","resourceProperty","calendarsConfig","getTaskCalendar","taskObject","groupMode","currentTask","$effective_calendar","isCalendar","deleteCalendar","restoreConfigCalendars","possibleCalendar","every","fixedUnits","_getCalendar","worktimeFacadeFactory","timeCalculator","_hasDuration","isUnscheduledTask","_isAllowedUnscheduledTask","_isTaskInTimelineLimits","taskStart","taskEnd","_getProjectEnd","project_end","_getProjectStart","project_start","getDefaultTaskDate","parent_id","schedule_from_end","_set_default_task_timing","$new","showTask","_lightbox_id","_tasks_dnd","drag","getTaskTimingMode","task_type","$no_start","$no_end","scheduled_summary","updateTaskTiming","assignProjectDates","taskTiming","summaryDateFields","manuallyScheduledSummaryDateFields","dateFields","_init_task_timing","getSubtaskInfo","rollup","isScheduledSummary","task_mode","dirty","$calculate_duration","effectiveCalendar","taskMode","$rollup","getSubtaskDuration","_update_parents","updateAll","has_changed","startDateField","$auto_start_date","endDateField","$auto_end_date","oldStart","oldEnd","roundDate","upper","lower","colIndex","correctTaskWorkTime","listenWindowResize","resizeDelay","resizeTimeout","previousSize","getContainerSize","container_resize_method","lowlevelResizeWatcher","$scrollbarRepaint","currentSize","repaintGantt","previousHeight","previousWidth","gantt_core","expire","invalidContainerMessage","validateNode","cloneNode","_reinit","dropLayout","_clearTaskLayers","_clearLinkLayers","rebuildLayout","calculateScaleRange","createView","getPropertyValue","resizeWatcher","contentWindow","resetLayout","initTemplates","domHelpers.toNode","$mouseEvents","edit","question","confirm_deleting","confirm_deleting_title","_simple_confirm","hideLightbox","visibleDate","_sort","posX","_getHorizontalScrollbar","codeScrollLeft","preserveScroll","new_pos","posY","gridCell","attachedScrollbar","verticalScrollbar","$view","setSizes","changeLightboxType","getLightboxType","_silent_redraw_lightbox","_get_link_type","from_start","to_start","isLinkAllowed","prevOffset","time_unit","helpers.getSecondsInUnit","offsetChanged","domHelpers.getClassName","icon_save","icon_cancel","icon_details","confirm_closing","section_description","section_time","section_type","section_deadline","section_baselines","column_wbs","column_text","column_start_date","column_duration","column_add","confirm_link_deleting","link_start","link_end","type_task","type_project","type_milestone","weeks","months","years","message_ok","message_cancel","section_constraint","asap","alap","snet","snlt","fnet","fnlt","mso","mfo","resources_filter_placeholder","resources_filter_label","baselines_section_placeholder","baselines_add_button","baselines_remove_button","baselines_remove_all_button","deadline_enable_button","deadline_disable_button","LocaleManager","addLocale","_locales","getLocale","DHXGantt","license","edit_save","edit_cancel","factory","supportedExtensions","extensionManager","ExtensionManager","activePlugins","plugin","getter","service","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","responseXML","getElementsByTagName","xpathExp","docObj","selectNodes","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","postSync","isQt","noCache","toUpperCase","RemoteEvents","copyDomEvent","pageX","pageY","DnD","_obj","_settings","inputMethods","getInputMethods","_drag_start_timer","clearDragTimer","eventParams","passive","accessor","timeStamp","original_target","original_element_sizes","domHelpers.getClosestSizedElement","dragStart","touch_drag","traceDragEvents","inputMethod","mousemove","dragMove","dragScroll","limited_mousemove","started","updates_per_second","dndActive","cancelable","mousemoveContainer","mouseup","checkPositionChange","diff_x","diff_y","pow","sensitivity","initDnDMarker","backupEventTarget","getEvent","backup_element","touchEventsSupported","touches","elementFromPoint","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","getPosition","_prevent_touch_scroll","_touch_drag","_touch_feedback","targetTouches","templatesLoader","regTemplates","initial","template_name","gantt_save_btn","gantt_cancel_btn","gantt_delete_btn","c","progress_text","grid_header_class","task_class","task_end_date","grid_row_class","task_row_class","timeline_cell_content","scale_row_class","grid_indent","grid_folder","grid_file","grid_open","grid_blank","task_unscheduled_time","grid_date_format","link_class","link_description","drag_link","drag_link_class","tooltip_date_format","baseline_text","stateService","selected_task","deletedLinks","originalTask","checkLinkedTaskVisibility","sync_link","sourceTask","sync_link_delete","sync_links","mapEvents","conf","mapFrom","mapTo","sourceEvent","targetEvent","taskLinks","existingLink","sourceMatch","targetMatch","typeMatch","changedTask","oldState","sourceVisible","targetVisible","onItemLoading","onBeforeAdd","onAfterAdd","onBeforeUpdate","onAfterUpdate","onBeforeDelete","onAfterDelete","onIdChange","onBeforeItemMove","onAfterItemMove","onFilterItem","onItemOpen","onItemClose","onBeforeSelect","onAfterSelect","onAfterUnselect","modules","new_task_placeholder","getGridColumn","activate","_cached_functions","update_if_changed","critical_path_mode","wrap_methods","_prefetch_originals","prefetch","methodname","original","optimizer","argumentsArray","l","get_arguments_hash","cached_values","has_cached_value","get_cached_value","cache_value","arguments_hash","is_date","values","stringify_argument","deactivate","setup","override_gantt","gantt_methods","highlight_critical_path","deactivTimeout","_eventRemoveAll","resetLightbox","i18n","en","ar","be","ca","cn","cs","da","de","es","fa","fi","fr","he","hr","hu","it","jp","kr","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","setLocale","localeObject","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","messageBox","keyboard","cancelBubble","modality","cover","onkeydown","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","btn","onclick","hidden","innerWidth","innerHeight","alertPopup","confirmPopup","boxPopup","box_params","params","messageInfoAttr","insertBefore","timers","hideAll","popups","alert","confirm","modalbox","extendSettings","parentSettings","own","$extendedConfig","setPrototypeOf","configurable$1","parentView","parentConfig","parentTemplates","$getConfig","$getTemplates","uiFactory$1","views","createdViews","creator","configure","configurable","$parent","initUI","registerView","viewConstructor","createMouseHandler","eventHandlers","doubleclick","contextMenu","addEventTarget","onClick","findEventHandlers","callEventHandlers","onContextMenu","src","delegateHandlers","h","onDoubleClick","onMouseMove","_last_move_event","domEvents","delegate","elementHandlers","callHandler","mouseEvents","genericViewPortChecker","x_end","y_end","isLegacyRender","getRowRectangle","getVisibleTasksRange","indexStart","indexEnd","extraTasksIds","inlineEditorId","layerFactory","renderFactory","task_area_pulls","task_area_renderers","getRenderer","renderMethod","updateMethod","getRectangle","renderCallbackMethod","specializedViewPortChecker","basicGetRectangle","onrender","isInViewPort","layerView","viewConfig","rendererViewPort","useBuffer","remove_item","rendered","clear_container","basicGetRange","getVisibleRange","prepareData","buffer","createDocumentFragment","vis","itemsSearch","renderedItems","newElements","nodesToRemove","renderCalledFor","itemNode","restore","replace_item","item_id","newNode","replaceChild","clearRenderers","createGroup","relativeRoot","defaultFilters","initLayer","renderGroup","tempCollection","filters","_add","getLayer","pending","topmost","rel","mergeFilters","requestUpdate","eachLayer","removeLayer","filter_methods","filter_method","barRectangle","startCoord","endCoord","calculated","clearCache","rec","sourceBox","targetBox","initialized","visibleBoxes","isLinkInViewPort","sourceTop","sourceHeight","targetTop","targetHeight","sourceLeft","sourceRight","targetLeft","targetRight","$skipSmartRenderOnScroll","Cell","headerHeight","$domEvents","$name","$factory","_headerClickHandler","final","$preResize","topCont","topSize","getSize","maxWidth","minHeight","setSize","_hide","cellIndex","moveView","$toHTML","canCollapse","$fill","collapsed","size","gravity","getContentSize","$lastSize","contentX","contentY","_getBorderSizes","borders","horizontal","vertical","_currentBorders","_borders","_sizeHeader","_sizeContent","_setBorders","domHelpers.removeClassName","cssHash","domHelpers.addClassName","xLayout","transform","__extends","__","Layout","_super","_this","_parseConfig","domHelpers.removeNode","$cells","_resizeScrollbars","scrollbars","scrollChanged","visibleScrollbars","hiddenScrollbars","scrollbarsToHide","showScrollbar","scrollbar","hideScrollbar","shouldHide","shouldShow","visibleGroups","group","_syncCellSizes","groupName","newSize","groups","_eachChild","_syncGroupSize","cells","_xLayout","newSizeValue","isGravity","ownSize","resizeSibling","siblingSize","totalGravity","totalSize","mainGrid","grid_width","startStage","mainCall","_resizeInProgress","contentViews","setContentSize","_getAutosizeMode","$originalWidthStored","$originalWidth","$originalHeightStored","$originalHeight","isChild","cellId","sub","getCells","domHelpers.insertNode","domHelpers.getChildNodes","contentWidth","contentHeight","_cleanElSize","_getBoxStyles","computed","properties","boxSizing","clientHeight","MozBoxSizing","horPaddings","borderLeftWidth","borderRightWidth","vertPaddings","borderTopWidth","borderBottomWidth","borderBox","outerWidth","outerHeight","boxSizes","contentSizes","_sizes","margin","_calcFreeSpace","side","_free","_gravity","_calcSize","_configureBorders","borderClass","lastVisibleIndex","lastCell","borderColorClass","_updateCellVisibility","oldVisibleCells","_visibleCells","firstCall","visibleCells","parentVisibility","hide_empty","hideCell","cellView","marginSide","ViewLayout","$cell","byMaxSize","otherCell","ViewCell","childConfig","$initialized","unload","_setContentSize","outerX","outerY","childSize","ScrollbarCell","SCROLL_MODIFIER_KEYS","_scrollHorizontalHandler","_scrollVerticalHandler","_outerScrollVerticalHandler","_outerScrollHorizontalHandler","_mouseWheelHandler","scroll_size","_isHorizontal","eachCell","_isVertical","_initVertical","_initHorizontal","_initMouseWheel","_initLinkedViews","_getRootParent","_eachView","_getLinkedViews","$scroll_hor","$scroll_ver","_updateLinkedViews","scrollHorizontally","_scrolling","oldSize","scrollVertically","_wheel_time","_oldLeft","_getScrollSize","scrollSize","outerSize","isHorizontal","linked","scrollProperty","innerSizeProperty","outerProperty","_getScrollOffset","cellScrollSize","nonScrollableSize","outerScroll","innerScroll","visible","scrollSizes","_setScrollSize","toggleVisibility","_getScaleOffset","parentLayout","_oldTop","_checkWheelTarget","connectedViews","wheelSpeed","wheelSpeedConfig","wheel_scroll_sensitivity","ff","deltaX","wheelDeltaX","deltaY","wheelDelta","multiplier","deltaMode","wx","wy","horizontalScrollModifier","oldLeft","detail","oldTop","createMixin","getItemTopCache","getRowTopCache","getItemHeightCache","totalHeightCache","getItemHeightCacheState","quickPosition","cachedRowHeight","canUseSimpleCalc","_getRowHeight","_refreshState","rowStore","globalRowHeight","canUseSimpleCalculation","_resetTopPositionHeight","_resetHeight","getCacheStateTotalHeight","shouldClearHeightCache","all","itemIndex","_fillHeightCache","defaultHeight","globalHeight","itemHeightCache","sumHeight","getHeight","visibleItems","totalHeight","canvasRender","destroy","Timeline","_posFromDateCache","_timelineDragScroll","topPositionMixin","$task_scale","taskBg","$task_bg","$task_baselines","$task_links","$task_bars","$task_constraints","$task_deadlines","_tasks","linksAttr","bindLinks","item_attribute","layers","_createLayerConfig","linkLayers","_attachLayers","backgroundImage","data_els","scrollWidth","scrolled","_refreshScales","_scales","_getScaleChunkHtml","taskFilter","taskLayers","expose","taskBar","hide_bar","_taskLayers","_linkLayers","_bindStore","taskRenderer","bar_layer","_taskRenderer","_initStaticBackgroundRender","linkStore","linkRenderer","linkLayer","_linkRenderer","staticRender","_staticBgHandler","staticBgContainer","$task_bg_static","staticBackgroundHeight","_clearLayers","_render_tasks_scales","scales_html","outer_width","helpers","cfgs","fromPos","toPos","cssClass","tplClass","_prepareScaleHtml","globalConfig","globalTemplates","helpers.findBinary","cssclass","g","floatConfig","sticky","labelPosition","approxLabelWidth","labelPos","translateValue","getTimelineCellAttr","_getColumnDuration","wholeCells","partCell","roundPos","_getNextVisibleColumn","visibleDateIndex","_getPrevVisibleColumn","_getClosestVisibleColumn","dateIndex","visibleIndex","transition","xLeft","xRight","displayStart","displayEnd","isMilestoneRender","_timelineCacheAttached","_unbindStore","ScrollableGrid","_scrollOrder","getCurrentX","_dnd","_scrollView","attachEvents","isScrollable","gridBoundingRect","maxLeft","minLeft","currentX","autoscrollRight","autoscrollStart","autoscrollLeft","autoscrollStop","scrollStep","COLUMN_ID_ATTR_NAME","ColumnsGridDnd","_targetMarker","calculateCurrentPosition","eventX","DND","_scrollableGrid","_draggedCell","draggedColumn","draggedIndex","_gridConfig","outerHTML","lineHeight","_dragX","columnIndexes","findColumnsIndexes","targetColumn","cleanTargetMarker","setMarkerPosition","drawTargetMarker","reorderColumns","draggedId","xBefore","xAfter","currentColumn","startX","endX","columnRelativePos","compare","relativeX","getCorrection","gridOffset","nextPosition","Grid","$state","gridAriaAttr","gridAttrString","gridDataAriaAttr","gridDataAttrString","reorder_grid_columns","gridScaleRowAttrString","doOnRender","_renderHeaderResizers","_mouseDelegates","mouseEventContainer","resizerrow","_task_grid_row_resize","row_before_start","row_id","row_after_start","row_drag_move","dd","itemHeight","itemTop","pointerPosition","markerStartPosition","marker_height","minPointerPosition","row_drag_end","oldItemHeight","finalHeight","dnd_sensitivity","_addLayers","_initEvents","_columnDND","ColumnDnd","_validateColumnWidth","numericWidth","elasticColumns","_setColumnsWidth","columnProperty","newColumnWidth","columnsWidth","_getGridWidth","_gridCacheAttached","_initSmartRenderingPlaceholder","_calculateGridWidth","_renderGridHeader","getColumnIndex","excludeHidden","hiddenIndexShift","getColumn","gridLine","gridTaskRowResizer","_refreshPlaceholderOnStoreUpdate","$rowsPlaceholder","_getColumnWidth","min_width","new_width","max_width","_checkGridColumnMinWidthLimits","_getGridWidthLimits","min_limit","max_limit","newWidth","start_index","columns_width","final_width","extra_width","start_width","iterator","curExtra","_getColsTotalWidth","cols_width","v","parseFloat","unknown","gridWidth","delta","changed","lineHeigth","colWidth","gridScaleCellAttrString","defaultMapping","isChanged","save","onShow","preventKeyNav","shouldPrevent","editPrevCell","editNextCell","onHide","keyNavMappings","onBlurDelay","keyNav","activeCell","editorState","hasEditor","editorType","anyModifier","BaseFactory","BaseEditor","set_value","get_input","get_value","is_changed","currentValue","is_valid","textEditorFactory","TextEditor","numberEditorFactory","NumberEditor","oninput","selectEditorFactory","SelectEditor","optionsHtml","dateEditorFactory","html5DateFormat","dateToStr","strToDate","DateEditor","minValue","maxValue","predecessorEditorFactory","PredecessorEditor","getFormatter","formatter","parseInputString","predecessors","delimiter","formatPredecessors","formatLinkKey","getLinksDiff","predecessorCodes","selectedLinks","Set","existingLinksSearch","linksToAdd","linkKey","linksToDelete","linksDiff","autoSchedule","inputPredecessors","taskPredecessors","durationEditorFactory","linkedPropertiesProcessor","decreaseStartDate","initConfigs","number","predecessor","keyboardMapping","mapping","setMapping","getMapping","eventBus","inlineEditController","createEditors","_createPlaceholder","inlineEditorAttr","updateTaskDateProperties","ganttHandlers","_itemId","_columnName","_editor","_editorType","_placeholder","setValue","editorConfig","getValue","_getItemValue","inline_editors_date_processing","_findEditableCell","nextColumn","getNextCell","getFirstCell","getLastCell","canChangeRow","moveRow","nextItem","editNextRow","skipReadonly","editPrevRow","isBarInViewport","createTaskRenderer","_task_default_render","controlsMargin","padd","milestoneHeight","milestoneWidth","done","pr","markerPos","basic","link_from_start","link_target_id","isCriticalTask","link_landing_area","from_id","link_to_start","dragClass","progressColor","textColor","u","setProperty","_get_link_crossing_css","marginStyle","_render_side_content","setTaskBarAttr","_render_pair","outer","showLinkPoints","cond","ln","tp","marginLeft","marginRight","defaultRenderer","createBaseBarRender","resourceHistogramRenderer","getVisibleCellsRange","firstCellIndex","lastCellIndex","isColumnVisible","cellLeftCoord","cellRightCoord","bgPlaceholder","placeholderConfig","lastTaskId","placeholderTask","calendar_id","createLinkRender","drawer","current_pos","dirs","path","point","get_lines","line_to","get_path","line","_get_line","get_wrapper_sizes","wrapper_size","get_line_sizes","line_size","link_line_width","render_line","innerPos","render_corner","corner","radius","lineWidth","cornerDiv","borderVertical","borderHorizontal","arrow","get_direction","vect","path_builder","point_to","get_points","get_endpoint","xy","e_y","e_x","lineType","get_line_type","forward","getMilestonePosition","splitParams","milestoneTask","siblingBaselines","shapes","lines","link_radius","arrowSize","nextLine","cornerX","cornerY","lastLine","arrowX","arrowY","shape","render_arrow","cssTemplate","isCriticalLink","linkAttr","createResourceTimelineBuilder","assignmentsPassed","timegrid","scaleUnit","scaleStep","precalculatedTimes","firstColumn","minScaleDate","currDate","cachedTimes","timetable","rowDnd","checkPlaceholderTask","getStore","initial_open_state","$transparent","lastTaskOfLevel","last_item","_getGridPos","gridHeight","maxBottom","_getTargetY","scrollPos","_getTaskByY","dropIndex","gridDataSizes","reorderMarkerAttr","containerSize","targetY","allowedLevel","over","nextId","dropTarget","createDropTargetObject","targetId","prevSibling","nextSiblingTarget","dndTaskId","prevSiblingTarget","firstChildTarget","lastChildTarget","findClosesTarget","targetLevel","findTargetAbove","findTargetBelow","getSameLevelDropPosition","relTargetPos","eventTop","targetAbove","targetBelow","gridToPageCoordinates","gridPos","setWidthWithinContainer","higlighter","removeLineHighlight","markerLine","highlightPosition","ePos","pointerEvents","markerFolder","folderHighlightWidth","linePos","indentNode","indent","iconWidth","childCount","markerLineTop","rowDndMarker","opacity","drop_target","getDropPosition","doctype","minTop","firstVisibleTaskIndex","firstVisibleTaskId","firstVisibleTaskPos","hiddenTaskPart","gridPosition","gridBottom","placeholderRowHeight","lockLevel","getLockedLevelTarget","initializer","onCreated","extendGantt","_inlineEditors","onInitialized","initEvents","extendDom","onDestroyed","clearEvents","showDate","sorting_method","totalWidth","taskDnD","createTaskDND","roundTaskDates","round_task_dates","dragMultiple","before_start","before_finish","after_finish","clear_drag_state","set_actions","drag_from_start","stage","_move","_resize","_resize_progress","on_mouse_move","on_mouse_down","on_mouse_up","start_x","start_y","coords_x","_drag_task_coords","minDurationInUnits","_calculateMinDuration","diffValue","_find_max_shift","dragItems","correctShift","minX","maxX","maxShift","minShift","multipleDragShift","new_start","new_end","obj_s_x","obj_e_x","_mouse_position_change","oldPos","newPos","_is_number","isFinite","start_drag","sX","sY","now","_start_dnd","_update_on_move","_update_item_on_move","curr_date","dragHash","_isMultiselect","dragProject","initialDrag","childDrag","_get_drag_mode","_fix_dnd_scale_time","fixStart","_fix_working_times","_finalize_mouse_up","_fireEvent","_dhx_changed","finalizingBulkMove","moveCount","doFinalize","dragProperty","selectedTasksIds","selectedTask","_addSubtasksToDragMultiple","trigger","drag_state","summaryId","initLinksDND","_link_landing","_link_target_task","_link_target_task_start","_link_source_task","_link_source_task_start","getDndState","link_edge_marker","link_landing_hover_area","markerSize","viewportSize","ganttOffsetY","updateMarkedHtml","resetDndState","showDirectingLine","s_x","s_y","_direction","link_direction_class","dist","tan","angle","atan","coordinateCircleQuarter","sin","cos","shiftLeft","shiftTop","eX","eY","_dir_start","landing","prevTarget","prevLanding","prevToStart","targ","absCoords","domHelpers.getRelativeNodePosition","_dir_end","targetChanged","linkDnD","_linksDnD","_tasksDnD","MouseDelegates","_attachDomEvents","_attachStateProvider","_clearDomEvents","_clearStateProvider","_delete_link_handler","coll","coll_date","scale_step","getVerticalScrollbar","getHorizontalScrollbar","_legacyGridResizerClass","resizers","gridResizer","mainTimeline","colsWidth","hideGrid","grid_limits","ganttContainerWidth","verticalScrollbarWidth","gridOverflow","original_grid_width","skinSettings","skins","_initScrollStateEvents","_getVerticalScrollbar","_findGridResizer","gridFirst","_getSiblings","_behind","_front","resizeInfo","initialWidth","prevCellWidth","nextCellWidth","viewCell","limits","newBehindSize","newFrontSize","oldBackSize","oldFrontSize","newBackSize","ui$1","attachInitializer","uiFactory","Scrollbar","mainLayoutInitializer","mainTimelineInitializer","mainGridInitializer","ResourceGrid","ResourceTimeline","ResourceHistogram","layersEngine","createLayerFactory","previusSiblingContainer","defaultContainerSibling","addTaskLayer","rangeFunction","getVisibleTaskRange","_getTaskLayers","removeTaskLayer","addLinkLayer","getVisibleLinksRangeFactory","isLinkInViewport","_getLinkLayers","removeLinkLayer","gridEditorsFactory","layersApi","textValue","aria","gridAddButtonAttrString","justifyContent","center","gridCellAttrString","css_template","taskRowAttr","rowNode","cellNode","external_render","adapter","isElement","renderElement","renderedCells","isRendered","detachRenderedCell","getCellClassTemplate","getCellContentTemplate","renderOneCell","contentTemplate","cssTemplateContent","htmlTemplateContent","customCell","cellCssTemplate","cellHtmlTemplate","odd","placeholderTop","placeholderHeight","renderTaskBar","timedProjectBar","renderTimedProjectBar","taskRollupBar","renderedNodes","checkVisibility","generateChildElement","childCopy","$rendered_at","getKey","renderParentId","rollupKey","taskSplitBar","renderSplitTaskBar","taskConstraints","renderConstraints","taskDeadline","renderDeadline","renderBaselines","renderLink","resourceRow","getResourceLoad","resourceTimetable","renderedResourceLines","renderResourceLineCell","detachRenderedResourceLine","checkedColumns","resourceHistogram","resize_el","rowResizerAttr","layersService","_get_skin","themeVar","themeName","isCssVarTheme","href","_theme_info","theme","cssVarTheme","skinset","_second_column_width","_third_column_width","_lightbox_template","_redefine_lightbox_buttons","scrollRange","scrollDelay","scrollSpeed","isMove","delayTimeout","startPos","eventPos","isDisplayed","isScrollState","dragMarker","isResize","isLink","isClickDrag","defineDelayTimeout","speed","tick","autoscroll_delay","defineScrollInterval","autoscrollInterval","isScroll","gridDrag","need_scroll","currentScrollTop","scrollOuterHeight","scrollInnerHeight","currentScrollLeft","scrollOuterWidth","scrollInnerWidth","autoscroll_step","boxSize","$","jQuery","fn","dhx_gantt","each","newgantt","Gantt","getGanttInstance","jquery_hooks","dhtmlx","attaches","attachGantt","cmp","attachObject","dataType","dataObj","vs","av","border","gridId","gridObj","dhtmlXCellObject","dhtmlx_hooks","USE_KEY","_defaultScales","TimelineZoom","zoomIn","getCurrentLevel","setLevel","zoomOut","_levels","_activeLevelIndex","getLevels","zoomLevel","_getZoomIndexByName","levelName","_getVisibleDate","_visibleDate","cursorOffset","nextConfig","chartConfig","cursorDate","newPosition","middleDate","_attachWheelEvent","_useKey","_handler","_defaultHandler","timelineOffset","wheelUp","stopPropagation","_setScaleSettings","_setScaleDates","_initialStartDate","_initialEndDate","activeLevelIndex","_mapScales","levels","_minColumnWidth","minColumnWidth","_maxColumnWidth","maxColumnWidth","_widthStep","widthStep","_stepUp","_stepDown","nextLevel","addTouchEvents","platform","maxTouchPoints","_touch_events","getTaskDND","tasksDnD","touch_feedback","touch_feedback_duration","vibrate","touchHandlers","names","dblclicktime","actionMode","scrollMode","actionStart","longTapTimer","currentDndId","dndNodes","targetView","multiTouchEvents","newScrollState","block_action","allViews","_locate_css","taskNode","dummy","BaseControl","BaseConstrutor","htmlHelpers","getHtmlSelect","_attributes","getHtmlOption","_getHtmlContainer","getHtmlButton","getHtmlDiv","getHtmlLabel","getHtmlInput","_getHtmlAttributes","ResourcesControlConstructor","Super","SelectControl","sns","_dhx_onchange","onchange","_focus","ParentControlConstructor","ParentControl","_display","allow_root","root_label","form_blocks","tmpDom","newOptions","onselect","TemplateControl","TextareaControl","_get_input","TimeControl","getTimePicker","sectionClassName","_time_format_order","auto_end_date","_update_lightbox_select","_fill_lightbox_select","_resolve_default_mapping","selects","getTimePickerValue","autofix_end","_get_timepicker_step","SelectControlConstructor","CheckboxControl","single_value","checkboxes","checked","resArray","RadioControl","radio","default_value","DurationControl","_getStartDate","_getDuration","singleDate","lightboxDurationInputAttrString","durationInputClass","duration_val","inps","btns","endspan","_calc_date","_change_duration","charCode","ResourcesControl","ConstraintControl","isNonTimedConstraint","toggleTimeSelect","timeSelects","typeValue","isNonTimed","disabled","typeSelect","_eventsInitialized","constraintDate","constraintType","getConstraintType","TypeselectControl","typeKey","oldOnChange","_lightbox_current_type","BaselineControl","_generateBaselineRow","durationLabel","deleteLabel","durationEl","deleteButton","baselineRow","section","baselineNode","baselineId","dataset","updatedBaseline","button_click","_get_typed_lightbox_config","_lightbox_methods","_lightbox_root","showCover","_fill_lightbox","_setLbPosition","lightboxVisibleAttr","getLabel","list_name","_lightbox_type","lightboxDiv","fullWidth","ds","classNames","cspEnvironment","salesforceEnvironment","_lightbox","_is_lightbox_timepicker","wide_form","getHtmlButtons","lightboxAttr","onmousedown","_ready_to_dnd","ontouchstart","onselectstart","cursor","_init_dnd_events","show_cover","_cover","_render_sections","backup_overflow","labelBlock","inputBlock","inputId","_init_lightbox_events","block","_center_lightbox","rootElement","_move_while_dnd","_finish_dnd","_get_type_name","type_value","floatRight","lightboxButtonAttrString","getTimeFormat","time_format","getHtmlTimePickerOptions","start_year","end_year","tdate","timeFormat","year_range","_time_values","lightbox_events","_save_lightbox","_cancel_lightbox","sec","buttonTarget","getLightboxValues","time_optional","duration_optional","lightboxHiddenAttr","hideCover","_custom_lightbox","_set_lightbox_values","lightboxHeader","lightbox_header","getLightboxSection","get_template_control","control","get_select_control","get_textarea_control","get_time_control","_dnd_start_lb","gantt_unselectable","lb","_lb_start","ariaAttrs","limit_time_select","first_hour","last_hour","lightboxSelectAttrString","mapOffset","checkbox","constraint","typeselect","oldType","ui","codeHelpers.arrayFind","domEventScope","uiApi","getTimeline","getGrid","getBaseCell","baseCell","getAttachedScrollbar","DEFAULT_VALUE","tryCall","getTaskTop","getTaskBarHeight","domAttr","getLinkNode","oldH","oldV","verticalViews","horizontalViews","commonViews","viewId","newV","newH","date_x","scroll_to","leftPos","_scroll_state","timelineCell","x_pos","y_pos","x_inner","y_inner","scrollVer","scrollHor","horState","verState","cellName","horizontalScroll","verticalScroll","resetSkin","monitorThemeChange","_addThemeClass","setSkin","monitorIntervalId","csstheme","skyblue","lightbox_additional_height","dark","meadow","terrace","broadway","_config_buttons_left","_config_buttons_right","material","indx","zoom","_extend_to_optional","lightbox_block","optional_time","update_block","button_text","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","_taskCommonAttr","linkTypes","toStart","fromStart","gridSeparatorAttr","buttonName","role","tabindex","headerText","time_option","buttonLabel","targetAttribute","_locateHTML","firstTask","domHelpers.getScrollSize","availablePlugins","critical_path","grouping","groupBy","overlay","_load_url","cl","_load_type"],"mappings":";;;;;;;;;;;AACA,SAASA,EAAgBC,GACxB;AAAA,MAAIC,IAAI,GAAGC,IAAK,GAAGC,IAAM,GAAGC,IAAO;AACnC,MAAIJ,EAAKK,uBAAuB;AAC/B,QAAIC,IAAMN,EAAKK,yBACXE,IAAOC,SAASD,MAChBE,IAAWD,SAASE,mBACvBF,SAASD,KAAKI,cACdH,SAASD,MAENK,IAAYC,OAAOC,eAAeL,EAAQG,aAAaL,EAAKK,WAC5DG,IAAaF,OAAOG,eAAeP,EAAQM,cAAcR,EAAKQ,YAC9DE,IAAYR,EAAQQ,aAAaV,EAAKU,aAAa,GACnDC,IAAaT,EAAQS,cAAcX,EAAKW,cAAc;AAC1DjB,QAAOK,EAAIL,MAAOW,IAAYK,GAC9Bf,IAAOI,EAAIJ,OAAOa,IAAaG,GAE/Bf,IAAQK,SAASD,KAAKY,cAAcb,EAAIH,OACxCC,IAASI,SAASD,KAAKa,eAAed,EAAIF;AAAAA,EAC5C,OAAQ;AACN,WAAMJ,IACLC,MAAYoB,SAASrB,EAAKsB,WAAU,EACpCpB,GAAAA,KAAcmB,SAASrB,EAAKuB,YAAW,EACvCvB,GAAAA,IAAOA,EAAKwB;AAGbrB,IAAAA,IAAQK,SAASD,KAAKY,cAAcnB,EAAKmB,cAAcjB,GACvDE,IAASI,SAASD,KAAKa,eAAepB,EAAKoB,eAAenB;AAAAA,EAC1D;AACD,SAAO,EAAEwB,GAAGC,KAAKC,MAAM1B,CAAAA,GAAM2B,GAAGF,KAAKC,MAAMzB,IAAO2B,OAAM7B,EAAKmB,aAAaW,QAAO9B,EAAKoB,cAAcjB,OAAOu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KAAKmiC,KAAK9d,IAAI2d,GAAKj/B,EAAM4E,KAAK,SAAUuuF,GAAAA;AAC9Cl2F,aAAKysE,QAAQypB,GAAGuyB,IAChBzoH,KAAK8H,UAAU,aAAa,CAACk6B,GAAKymF,KACvBkzB,OAAAA,KAAM,cAChBA,EAAGv/I,KAAK4D,IAAAA;AAAAA,MACZ,GAAKA,IACL,CAAA;AAAA,IAAA;AAAA,EACA,EDfc+C,CAAAA,IAINA;AACR,EDd0C8hB;","x_google_ignoreList":[44]}
\ No newline at end of file
diff --git a/codebase/dhtmlxgantt.js b/codebase/dhtmlxgantt.js
index a774bc9..029e122 100644
--- a/codebase/dhtmlxgantt.js
+++ b/codebase/dhtmlxgantt.js
@@ -1,6 +1,6 @@
(function(yt,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((yt=typeof globalThis<"u"?globalThis:yt||self).dhtmlxgantt={})})(this,function(yt){"use strict";/** @license
-dhtmlxGantt v.9.0.1 Standard
+dhtmlxGantt v.9.0.2 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
@@ -20,7 +20,7 @@ To use dhtmlxGantt in non-GPL projects (and get Pro version of the product), ple
-
`;if(i+='',i+="
",n.innerHTML=i,e.config.quick_info_detached){const a=this._getContainer();e.event(a.parent,"scroll",()=>{this.hide()})}return this._quickInfoBox=n,n}_init_quick_info(e){const n=this._gantt,i=n.getTask(e);return typeof this._quickInfoReadonly=="boolean"&&n.isReadonly(i)!==this._quickInfoReadonly&&(this.hide(!0),this._quickInfoBox=null),this._quickInfoReadonly=n.isReadonly(i),this._quickInfoBox||(this._quickInfoBox=this._createQuickInfoElement()),this._quickInfoBox}_prepare_quick_info_classname(e){const n=this._gantt,i=n.getTask(e);let a=`gantt_cal_quick_info gantt_${n.getTaskType(i)}`;const r=n.templates.quick_info_class(i.start_date,i.end_date,i);return r&&(a+=" "+r),a}_fill_quick_data(e){const n=this._gantt,i=n.getTask(e);this._quickInfoBoxId=e;let a=[];if(this._quickInfoReadonly){const r=n.config.quickinfo_buttons,s={icon_delete:!0,icon_edit:!0};for(let o=0;oc.offsetHeight/2&&(g=e.top-(o+e.height+2*n),g{a.style.left="10px"},1)):(a.style.left="auto",a.style.right="-300px",setTimeout(()=>{a.style.right="10px"},1)),a.className+=" gantt_qi_"+(e.dx===1?"left":"right"),i.$root.appendChild(a)}_qi_button_click(e){const n=this._gantt,i=this._quickInfoBox;if(!e||e===i)return;if(e.closest(".gantt_cal_qi_close_btn"))return void this.hide();const a=e.className;if(a.indexOf("_icon")!==-1){const r=this._quickInfoBoxId;n.$click.buttons[a.split(" ")[1].replace("icon_","")](r)}else this._qi_button_click(e.parentNode)}_getContainer(){const e=this._gantt;let n=this._container?this._container:e.$task_data;return n&&n.offsetHeight&&n.offsetWidth?{parent:n,xViewport:e.$task,yViewport:e.$task_data}:(n=this._container?this._container:e.$grid_data,n&&n.offsetHeight&&n.offsetWidth?{parent:n,xViewport:e.$grid,yViewport:e.$grid_data}:{parent:this._container?this._container:e.$layout,xViewport:e.$layout,yViewport:e.$layout})}}var ae,Rn={}.constructor.toString();function V(t){var e,n;if(t&&typeof t=="object")switch(!0){case X(t):n=new Date(t);break;case ne(t):for(n=new Array(t.length),e=0;ei.bottom&&(r.bottom=i.bottom,r.top=r.bottom-r.height),r.lefti.right&&(r.right=i.right,r.left=r.right-r.width),d.x>=r.left&&d.x<=r.right&&(r.left=d.x-r.width-s,r.right=r.left+r.width),d.y>=r.top&&d.y<=r.bottom&&(r.top=d.y-r.height-o,r.bottom=r.top+r.height),r}_getViewPortSize(){const e=this._gantt,n=this._getViewPort();let i,a=n,r=window.scrollY+document.body.scrollTop,s=window.scrollX+document.body.scrollLeft;return n===e.$task_data?(a=e.$task,r=0,s=0,i=z(e.$task)):i=z(a),{left:i.x+s,top:i.y+r,width:i.width,height:i.height,bottom:i.y+i.height+r,right:i.x+i.width+s}}}class Bn{constructor(e){this._listeners={},this.tooltip=new On(e),this._gantt=e,this._domEvents=re(),this._initDelayedFunctions()}destructor(){this.tooltip.hide(),this._domEvents.detachAll()}hideTooltip(){this.delayHide()}attach(e){let n=document.body;const i=this._gantt;e.global||(n=i.$root);let a=null;const r=s=>{const o=mt(s),l=lt(o,e.selector);if(Y(o,this.tooltip.getNode()))return;const d=()=>{a=l,e.onmouseenter(s,l)};a?l&&l===a?e.onmousemove(s,l):(e.onmouseleave(s,a),a=null,l&&l!==a&&d()):l&&d()};this.detach(e.selector),this._domEvents.attach(n,"mousemove",r),this._listeners[e.selector]={node:n,handler:r}}detach(e){const n=this._listeners[e];n&&this._domEvents.detach(n.node,"mousemove",n.handler)}tooltipFor(e){const n=i=>{let a=i;return document.createEventObject&&!document.createEvent&&(a=document.createEventObject(i)),a};this._initDelayedFunctions(),this.attach({selector:e.selector,global:e.global,onmouseenter:(i,a)=>{const r=e.html(i,a);r&&this.delayShow(n(i),r)},onmousemove:(i,a)=>{const r=e.html(i,a);r?this.delayShow(n(i),r):(this.delayShow.$cancelTimeout(),this.delayHide())},onmouseleave:()=>{this.delayShow.$cancelTimeout(),this.delayHide()}})}_initDelayedFunctions(){const e=this._gantt;this.delayShow&&this.delayShow.$cancelTimeout(),this.delayHide&&this.delayHide.$cancelTimeout(),this.tooltip.hide(),this.delayShow=Re((n,i)=>{e.callEvent("onBeforeTooltip",[n])===!1?this.tooltip.hide():(this.tooltip.setContent(i),this.tooltip.show(n))},e.config.tooltip_timeout||1),this.delayHide=Re(()=>{this.delayShow.$cancelTimeout(),this.tooltip.hide()},e.config.tooltip_hide_timeout||1)}}const ze={onBeforeUndo:"onAfterUndo",onBeforeRedo:"onAfterRedo"},We=["onTaskDragStart","onAfterTaskUpdate","onAfterTaskDelete","onBeforeBatchUpdate"];class zn{constructor(e,n){this._batchAction=null,this._batchMode=!1,this._ignore=!1,this._ignoreMoveEvents=!1,this._initialTasks={},this._initialLinks={},this._nestedTasks={},this._nestedLinks={},this._undo=e,this._gantt=n,this._attachEvents()}store(e,n,i=!1){return n===this._gantt.config.undo_types.task?this._storeTask(e,i):n===this._gantt.config.undo_types.link&&this._storeLink(e,i)}isMoveEventsIgnored(){return this._ignoreMoveEvents}toggleIgnoreMoveEvents(e){this._ignoreMoveEvents=e||!1}startIgnore(){this._ignore=!0}stopIgnore(){this._ignore=!1}startBatchAction(){this._timeout||(this._timeout=setTimeout(()=>{this.stopBatchAction(),this._timeout=null},10)),this._ignore||this._batchMode||(this._batchMode=!0,this._batchAction=this._undo.action.create())}stopBatchAction(){if(this._ignore)return;const e=this._undo;this._batchAction&&e.logAction(this._batchAction),this._batchMode=!1,this._batchAction=null}onTaskAdded(e){this._ignore||this._storeTaskCommand(e,this._undo.command.type.add)}onTaskUpdated(e){this._ignore||this._storeTaskCommand(e,this._undo.command.type.update)}onTaskMoved(e){if(!this._ignore){e.$local_index=this._gantt.getTaskIndex(e.id);const n=this.getInitialTask(e.id);if(e.$local_index===n.$local_index&&this._gantt.getParent(e)===this._gantt.getParent(n))return;this._storeEntityCommand(e,this.getInitialTask(e.id),this._undo.command.type.move,this._undo.command.entity.task)}}onTaskDeleted(e){if(!this._ignore){if(this._storeTaskCommand(e,this._undo.command.type.remove),this._nestedTasks[e.id]){const n=this._nestedTasks[e.id];for(let i=0;i{e||(e=setTimeout(()=>{e=null}),this.clearInitialTasks(),n.eachTask(l=>{this.setInitialTask(l.id)}),this.clearInitialLinks(),n.getLinks().forEach(l=>{this.setInitialLink(l.id)}))},a=l=>n.copy(n.getTask(l));for(const l in ze)n.attachEvent(l,()=>(this.startIgnore(),!0)),n.attachEvent(ze[l],()=>(this.stopIgnore(),!0));for(let l=0;l(this.startBatchAction(),!0));n.attachEvent("onParse",()=>{this._undo.clearUndoStack(),this._undo.clearRedoStack(),i()}),n.attachEvent("onAfterTaskAdd",(l,d)=>{this.setInitialTask(l,!0),this.onTaskAdded(d)}),n.attachEvent("onAfterTaskUpdate",(l,d)=>{this.onTaskUpdated(d)}),n.attachEvent("onAfterTaskDelete",(l,d)=>{this.onTaskDeleted(d)}),n.attachEvent("onAfterLinkAdd",(l,d)=>{this.setInitialLink(l,!0),this.onLinkAdded(d)}),n.attachEvent("onAfterLinkUpdate",(l,d)=>{this.onLinkUpdated(d)}),n.attachEvent("onAfterLinkDelete",(l,d)=>{this.onLinkDeleted(d)}),n.attachEvent("onRowDragEnd",(l,d)=>(this.onTaskMoved(a(l)),this.toggleIgnoreMoveEvents(),!0)),n.attachEvent("onBeforeTaskDelete",l=>{this.store(l,n.config.undo_types.task);const d=[];return i(),n.eachTask(c=>{d.push(c.id)},l),this.setNestedTasks(l,d),!0});const r=n.getDatastore("task");r.attachEvent("onBeforeItemMove",(l,d,c)=>(this.isMoveEventsIgnored()||i(),!0)),r.attachEvent("onAfterItemMove",(l,d,c)=>(this.isMoveEventsIgnored()||this.onTaskMoved(a(l)),!0)),n.attachEvent("onRowDragStart",(l,d,c)=>(this.toggleIgnoreMoveEvents(!0),i(),!0));let s=null,o=!1;if(n.attachEvent("onBeforeTaskDrag",l=>{if(s=n.getState().drag_id,s===l){const d=n.getTask(l);n.isSummaryTask(d)&&n.config.drag_project&&(o=!0)}if(n.plugins().multiselect){const d=n.getSelectedTasks();d.length>1&&d.forEach(c=>{this.store(c,n.config.undo_types.task,!0)})}return this.store(l,n.config.undo_types.task)}),n.attachEvent("onAfterTaskDrag",l=>{(o||n.plugins().multiselect&&n.getSelectedTasks().length>1)&&s===l&&(o=!1,s=null,this.stopBatchAction()),this.store(l,n.config.undo_types.task,!0)}),n.attachEvent("onLightbox",l=>this.store(l,n.config.undo_types.task)),n.attachEvent("onBeforeTaskAutoSchedule",l=>(this.store(l.id,n.config.undo_types.task,!0),!0)),n.ext.inlineEditors){let l=null,d=null;n.attachEvent("onGanttLayoutReady",()=>{l&&n.ext.inlineEditors.detachEvent(l),d&&n.ext.inlineEditors.detachEvent(d),d=n.ext.inlineEditors.attachEvent("onEditStart",c=>{this.store(c.id,n.config.undo_types.task)}),l=n.ext.inlineEditors.attachEvent("onBeforeEditStart",c=>(this.stopBatchAction(),!0))})}}_storeCommand(e){const n=this._undo;if(n.updateConfigs(),n.undoEnabled)if(this._batchMode)this._batchAction.commands.push(e);else{const i=n.action.create([e]);n.logAction(i)}}_storeEntityCommand(e,n,i,a){const r=this._undo.command.create(e,n,i,a);this._storeCommand(r)}_storeTaskCommand(e,n){this._gantt.isTaskExists(e.id)&&(e.$local_index=this._gantt.getTaskIndex(e.id)),this._storeEntityCommand(e,this.getInitialTask(e.id),n,this._undo.command.entity.task)}_storeLinkCommand(e,n){this._storeEntityCommand(e,this.getInitialLink(e.id),n,this._undo.command.entity.link)}_getLinks(e){return e.$source.concat(e.$target)}_storeTask(e,n=!1){const i=this._gantt;return this.setInitialTask(e,n),i.eachTask(a=>{this.setInitialTask(a.id)},e),!0}_storeLink(e,n=!1){return this.setInitialLink(e,n),!0}}class Wn{constructor(e){this.maxSteps=100,this.undoEnabled=!0,this.redoEnabled=!0,this.action={create:n=>({commands:n?n.slice():[]}),invert:n=>{const i=this._gantt.copy(n),a=this.command;for(let r=0;r{const s=this._gantt;return{entity:r,type:a,value:s.copy(n),oldValue:s.copy(i||n)}},invert:n=>{const i=this._gantt.copy(n);return i.type=this.command.inverseCommands(n.type),i},inverseCommands:n=>{const i=this._gantt,a=this.command.type;switch(n){case a.update:return a.update;case a.remove:return a.add;case a.add:return a.remove;case a.move:return a.move;default:return i.assert(!1,"Invalid command "+n),null}}},this._undoStack=[],this._redoStack=[],this._gantt=e}getUndoStack(){return this._undoStack}setUndoStack(e){this._undoStack=e}getRedoStack(){return this._redoStack}setRedoStack(e){this._redoStack=e}clearUndoStack(){this._undoStack=[]}clearRedoStack(){this._redoStack=[]}updateConfigs(){const e=this._gantt;this.maxSteps=e.config.undo_steps||100,this.command.entity=e.config.undo_types,this.command.type=e.config.undo_actions,this.undoEnabled=!!e.config.undo,this.redoEnabled=!!e.config.redo}undo(){const e=this._gantt;if(this.updateConfigs(),!this.undoEnabled)return;const n=this._pop(this._undoStack);if(n&&this._reorderCommands(n),e.callEvent("onBeforeUndo",[n])!==!1&&n)return this._applyAction(this.action.invert(n)),this._push(this._redoStack,e.copy(n)),void e.callEvent("onAfterUndo",[n]);e.callEvent("onAfterUndo",[null])}redo(){const e=this._gantt;if(this.updateConfigs(),!this.redoEnabled)return;const n=this._pop(this._redoStack);if(n&&this._reorderCommands(n),e.callEvent("onBeforeRedo",[n])!==!1&&n)return this._applyAction(n),this._push(this._undoStack,e.copy(n)),void e.callEvent("onAfterRedo",[n]);e.callEvent("onAfterRedo",[null])}logAction(e){this._push(this._undoStack,e),this._redoStack=[]}_push(e,n){const i=this._gantt;if(!n.commands.length)return;const a=e===this._undoStack?"onBeforeUndoStack":"onBeforeRedoStack";if(i.callEvent(a,[n])!==!1&&n.commands.length){for(e.push(n);e.length>this.maxSteps;)e.shift();return n}}_pop(e){return e.pop()}_reorderCommands(e){const n={any:0,link:1,task:2},i={move:1,any:0};e.commands.sort(function(a,r){if(a.entity==="task"&&r.entity==="task")return a.type!==r.type?(i[r.type]||0)-(i[a.type]||0):a.type==="move"&&a.oldValue&&r.oldValue&&r.oldValue.parent===a.oldValue.parent?a.oldValue.$index-r.oldValue.$index:0;{const s=n[a.entity]||n.any;return(n[r.entity]||n.any)-s}})}_applyAction(e){let n=null;const i=this.command.entity,a=this.command.type,r=this._gantt,s={};s[i.task]={add:"addTask",get:"getTask",update:"updateTask",remove:"deleteTask",move:"moveTask",isExists:"isTaskExists"},s[i.link]={add:"addLink",get:"getLink",update:"updateLink",remove:"deleteLink",isExists:"isLinkExists"},r.batchUpdate(function(){for(let o=0;o{const i={viewPort:t.$task_data,...e};if(t.config.click_drag){const a=t.config.click_drag;i.render=a.render||e.render,i.className=a.className||e.className,i.callback=a.callback||e.callback,i.viewPort=a.viewPort||t.$task_data,i.useRequestAnimationFrame=a.useRequestAnimationFrame===void 0?e.useRequestAnimationFrame:a.useRequestAnimationFrame,i.singleRow=a.singleRow===void 0?e.singleRow:a.singleRow;const r=t.$ui.getView("timeline"),s=new Nn(i,t,r);t.ext.clickDrag.attach(s,a.useKey,a.ignore)}}),t.attachEvent("onDestroy",()=>{n.destructor()})},drag_timeline:function(t){t.ext||(t.ext={}),t.ext.dragTimeline={create:()=>ie.create(t)},t.config.drag_timeline={enabled:!0,render:!1}},fullscreen:function(t){function e(){const c=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;return!(!c||c!==document.body)}function n(){try{return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}catch(c){console.error("Fullscreen is not available:",c)}}t.$services.getService("state").registerProvider("fullscreen",()=>n()?{fullscreen:e()}:void 0);let i={overflow:null,padding:null,paddingTop:null,paddingRight:null,paddingBottom:null,paddingLeft:null};const a={width:null,height:null,top:null,left:null,position:null,zIndex:null,modified:!1};let r=null;function s(c,u){u.width=c.width,u.height=c.height,u.top=c.top,u.left=c.left,u.position=c.position,u.zIndex=c.zIndex}let o=!1;function l(){if(!t.$container)return;let c;e()?o&&(c="onExpand",function(){const u=t.ext.fullscreen.getFullscreenElement(),h=document.body;s(u.style,a),i={overflow:h.style.overflow,padding:h.style.padding?h.style.padding:null,paddingTop:h.style.paddingTop?h.style.paddingTop:null,paddingRight:h.style.paddingRight?h.style.paddingRight:null,paddingBottom:h.style.paddingBottom?h.style.paddingBottom:null,paddingLeft:h.style.paddingLeft?h.style.paddingLeft:null},h.style.padding&&(h.style.padding="0"),h.style.paddingTop&&(h.style.paddingTop="0"),h.style.paddingRight&&(h.style.paddingRight="0"),h.style.paddingBottom&&(h.style.paddingBottom="0"),h.style.paddingLeft&&(h.style.paddingLeft="0"),h.style.overflow="hidden",u.style.width="100vw",u.style.height="100vh",u.style.top="0px",u.style.left="0px",u.style.position="absolute",u.style.zIndex=1,a.modified=!0,r=function(g){let f=g.parentNode;const y=[];for(;f&&f.style;)y.push({element:f,originalPositioning:f.style.position}),f.style.position="static",f=f.parentNode;return y}(u)}()):o&&(o=!1,c="onCollapse",function(){const u=t.ext.fullscreen.getFullscreenElement(),h=document.body;a.modified&&(i.padding&&(h.style.padding=i.padding),i.paddingTop&&(h.style.paddingTop=i.paddingTop),i.paddingRight&&(h.style.paddingRight=i.paddingRight),i.paddingBottom&&(h.style.paddingBottom=i.paddingBottom),i.paddingLeft&&(h.style.paddingLeft=i.paddingLeft),h.style.overflow=i.overflow,i={overflow:null,padding:null,paddingTop:null,paddingRight:null,paddingBottom:null,paddingLeft:null},s(a,u.style),a.modified=!1),r.forEach(g=>{g.element.style.position=g.originalPositioning}),r=null}()),setTimeout(()=>{t.render()}),setTimeout(()=>{t.callEvent(c,[t.ext.fullscreen.getFullscreenElement()])})}function d(){return!t.$container||!t.ext.fullscreen.getFullscreenElement()?!0:n()?!1:((console.warning||console.log)("The `fullscreen` feature not being allowed, or full-screen mode not being supported"),!0)}t.ext.fullscreen={expand(){if(d()||e()||!t.callEvent("onBeforeExpand",[this.getFullscreenElement()]))return;o=!0;const c=document.body,u=c.webkitRequestFullscreen?[Element.ALLOW_KEYBOARD_INPUT]:[],h=c.msRequestFullscreen||c.mozRequestFullScreen||c.webkitRequestFullscreen||c.requestFullscreen;h&&h.apply(c,u)},collapse(){if(d()||!e()||!t.callEvent("onBeforeCollapse",[this.getFullscreenElement()]))return;const c=document.msExitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.exitFullscreen;c&&c.apply(document)},toggle(){d()||(e()?this.collapse():this.expand())},getFullscreenElement:()=>t.$root},t.expand=function(){t.ext.fullscreen.expand()},t.collapse=function(){t.ext.fullscreen.collapse()},t.attachEvent("onGanttReady",function(){t.event(document,"webkitfullscreenchange",l),t.event(document,"mozfullscreenchange",l),t.event(document,"MSFullscreenChange",l),t.event(document,"fullscreenChange",l),t.event(document,"fullscreenchange",l)})},keyboard_navigation:function(t){(function(e){e.config.keyboard_navigation=!0,e.config.keyboard_navigation_cells=!1,e.$keyboardNavigation={},e._compose=function(){for(var n=Array.prototype.slice.call(arguments,0),i={},a=0;a=96&&a.keyCode<=105&&(a.keyCode-=48);var r=String.fromCharCode(a.keyCode);return r&&(a.keyCode=r.toLowerCase().charCodeAt(0)),a},getHashFromEvent:function(i){return this.getHash(this.getCommandFromEvent(i))},getHash:function(i){var a=[];for(var r in i.modifiers)i.modifiers[r]&&a.push(r);return a.push(i.keyCode),a.join(this.junctionChar)},getExpressions:function(i){return i.split(this.junctionChar)},getWords:function(i){return i.split(this.combinationChar)},trim:function(i){return i.replace(/\s/g,"")},junctionChar:",",combinationChar:"+",commandKeys:{shift:16,alt:18,ctrl:17,meta:!0},specialKeys:{backspace:8,tab:9,enter:13,esc:27,space:32,up:38,down:40,left:37,right:39,home:36,end:35,pageup:33,pagedown:34,delete:46,insert:45,plus:107,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123}}}(e),function(n){n.$keyboardNavigation.EventHandler={_handlers:null,findHandler:function(i){this._handlers||(this._handlers={});var a=n.$keyboardNavigation.shortcuts.getHash(i);return this._handlers[a]},doAction:function(i,a){var r=this.findHandler(i);if(r){if(n.$keyboardNavigation.facade.callEvent("onBeforeAction",[i,a])===!1)return;r.call(this,a),a.preventDefault?a.preventDefault():a.returnValue=!1}},bind:function(i,a){this._handlers||(this._handlers={});for(var r=n.$keyboardNavigation.shortcuts,s=r.parse(i),o=0;o=r.length-1){var c=r[0];if(c)return c.focus(),a.preventDefault(),!0}return!1}}(e),function(n){n.$keyboardNavigation.GanttNode=function(){},n.$keyboardNavigation.GanttNode.prototype=n._compose(n.$keyboardNavigation.EventHandler,{focus:function(){n.focus()},blur:function(){},isEnabled:function(){return n.$container.hasAttribute("tabindex")},scrollHorizontal:function(i){var a=n.dateFromPos(n.getScrollState().x),r=n.getScale(),s=i<0?-r.step:r.step;a=n.date.add(a,s,r.unit),n.scrollTo(n.posFromDate(a))},scrollVertical:function(i){var a=n.getScrollState().y,r=n.config.row_height;n.scrollTo(null,a+(i<0?-1:1)*r)},keys:{"alt+left":function(i){this.scrollHorizontal(-1)},"alt+right":function(i){this.scrollHorizontal(1)},"alt+up":function(i){this.scrollVertical(-1)},"alt+down":function(i){this.scrollVertical(1)},"ctrl+z":function(){n.undo&&n.undo()},"ctrl+r":function(){n.redo&&n.redo()}}}),n.$keyboardNavigation.GanttNode.prototype.bindAll(n.$keyboardNavigation.GanttNode.prototype.keys)}(e),function(n){n.$keyboardNavigation.KeyNavNode=function(){},n.$keyboardNavigation.KeyNavNode.prototype=n._compose(n.$keyboardNavigation.EventHandler,{isValid:function(){return!0},fallback:function(){return null},moveTo:function(i){n.$keyboardNavigation.dispatcher.setActiveNode(i)},compareTo:function(i){if(!i)return!1;for(var a in this){if(!!this[a]!=!!i[a])return!1;var r=!(!this[a]||!this[a].toString),s=!(!i[a]||!i[a].toString);if(s!=r)return!1;if(s&&r){if(i[a].toString()!=this[a].toString())return!1}else if(i[a]!=this[a])return!1}return!0},getNode:function(){},focus:function(){var i=this.getNode();if(i){var a=n.$keyboardNavigation.facade;a.callEvent("onBeforeFocus",[i])!==!1&&i&&(i.setAttribute("tabindex","-1"),i.$eventAttached||(i.$eventAttached=!0,n.event(i,"focus",function(r){return r.preventDefault(),!1},!1)),n.utils.dom.isChildOf(document.activeElement,i)&&(i=document.activeElement),i.focus&&i.focus(),a.callEvent("onFocus",[this.getNode()]))}},blur:function(){var i=this.getNode();i&&(n.$keyboardNavigation.facade.callEvent("onBlur",[i]),i.setAttribute("tabindex","-1"))}})}(e),function(n){n.$keyboardNavigation.HeaderCell=function(i){this.index=i||0},n.$keyboardNavigation.HeaderCell.prototype=n._compose(n.$keyboardNavigation.KeyNavNode,{_handlers:null,isValid:function(){return!(!n.config.show_grid&&n.getVisibleTaskCount()||!n.getGridColumns()[this.index]&&n.getVisibleTaskCount())},fallback:function(){if(!n.config.show_grid)return n.getVisibleTaskCount()?new n.$keyboardNavigation.TaskRow:null;for(var i=n.getGridColumns(),a=this.index;a>=0&&!i[a];)a--;return i[a]?new n.$keyboardNavigation.HeaderCell(a):null},fromDomElement:function(i){var a=ht(i,"gantt_grid_head_cell");if(a){for(var r=0;a&&a.previousSibling;)a=a.previousSibling,r+=1;return new n.$keyboardNavigation.HeaderCell(r)}return null},getNode:function(){return n.$grid_scale.childNodes[this.index]},keys:{left:function(){this.index>0&&this.moveTo(new n.$keyboardNavigation.HeaderCell(this.index-1))},right:function(){var i=n.getGridColumns();this.index-1},fallback:function(){if(!n.getVisibleTaskCount()){var i=new n.$keyboardNavigation.HeaderCell;return i.isValid()?i:null}if(this.splitItem)return new n.$keyboardNavigation.TaskRow(this.parentId);var a=-1;if(n.getTaskByIndex(this.globalIndex-1))a=this.globalIndex-1;else if(n.getTaskByIndex(this.globalIndex+1))a=this.globalIndex+1;else for(var r=this.globalIndex;r>=0;){if(n.getTaskByIndex(r)){a=r;break}r--}return a>-1?new n.$keyboardNavigation.TaskRow(n.getTaskByIndex(a).id):void 0},fromDomElement:function(i){if(n.config.keyboard_navigation_cells)return null;var a=n.locate(i);return n.isTaskExists(a)?new n.$keyboardNavigation.TaskRow(a):null},getNode:function(){if(n.isTaskExists(this.taskId)&&n.isTaskVisible(this.taskId))return n.config.show_grid?n.$grid.querySelector(".gantt_row["+n.config.task_attribute+"='"+this.taskId+"']"):n.getTaskNode(this.taskId)},focus:function(i){if(!i){const a=n.getTaskPosition(n.getTask(this.taskId)),r=n.getTaskHeight(this.taskId),s=n.getScrollState();let o,l;o=n.$task?n.$task.offsetWidth:s.inner_width,l=n.$grid_data||n.$task_data?(n.$grid_data||n.$task_data).offsetHeight:s.inner_height,a.tops.y+l?n.scrollTo(null,a.top-20):n.config.scroll_on_click&&n.config.show_chart&&(a.left>s.x+o?n.scrollTo(a.left-n.config.task_scroll_offset):a.left+a.width=0&&!r[s];)s--;r[s]&&(a=new n.$keyboardNavigation.TaskCell(i.taskId,s))}return a},fromDomElement:function(i){if(!n.config.keyboard_navigation_cells)return null;var a=n.locate(i);if(n.isTaskExists(a)){var r=0,s=tt(i,"data-column-index");return s&&(r=1*s.getAttribute("data-column-index")),new n.$keyboardNavigation.TaskCell(a,r)}return null},getNode:function(){if(n.isTaskExists(this.taskId)&&n.isTaskVisible(this.taskId)){if(n.config.show_grid){var i=n.$grid.querySelector(".gantt_row["+n.config.task_attribute+"='"+this.taskId+"']");return i?i.querySelector("[data-column-index='"+this.columnIndex+"']"):null}return n.getTaskNode(this.taskId)}},keys:{up:function(){var i=null,a=n.getPrev(this.taskId);i=n.isTaskExists(a)?new n.$keyboardNavigation.TaskCell(a,this.columnIndex):new n.$keyboardNavigation.HeaderCell(this.columnIndex),this.moveTo(i)},down:function(){var i=n.getNext(this.taskId);n.isTaskExists(i)&&this.moveTo(new n.$keyboardNavigation.TaskCell(i,this.columnIndex))},left:function(){this.columnIndex>0&&this.moveTo(new n.$keyboardNavigation.TaskCell(this.taskId,this.columnIndex-1))},right:function(){var i=n.getGridColumns();this.columnIndex=p&&r()}}),e._smart_render){var v=e._smart_render._redrawTasks;e._smart_render._redrawTasks=function(b,_){if(e.config.keyboard_navigation&&n.isEnabled()){var m=n.getActiveNode();if(m&&m.taskId!==void 0){for(var p=!1,k=0;k<_.length;k++)if(_[k].id==m.taskId&&_[k].start_date){p=!0;break}p||_.push(e.getTask(m.taskId))}}return v.apply(this,arguments)}}});let c=null,u=!1;e.attachEvent("onTaskCreated",function(v){return c=v.id,!0}),e.attachEvent("onAfterTaskAdd",function(v,b){if(!e.config.keyboard_navigation)return!0;if(n.isEnabled()){if(v==c&&(u=!0,setTimeout(()=>{u=!1,c=null})),u&&b.type==e.config.types.placeholder)return;var _=0,m=n.activeNode;m instanceof e.$keyboardNavigation.TaskCell&&(_=m.columnIndex);var p=e.config.keyboard_navigation_cells?e.$keyboardNavigation.TaskCell:e.$keyboardNavigation.TaskRow;b.type==e.config.types.placeholder&&e.config.placeholder_task.focusOnCreate===!1||n.setActiveNode(new p(v,_))}}),e.attachEvent("onTaskIdChange",function(v,b){if(!e.config.keyboard_navigation)return!0;var _=n.activeNode;return n.isTaskFocused(v)&&(_.taskId=b),!0});var h=setInterval(function(){e.config.keyboard_navigation&&(n.isEnabled()||n.enable())},500);function g(v){var b={gantt:e.$keyboardNavigation.GanttNode,headerCell:e.$keyboardNavigation.HeaderCell,taskRow:e.$keyboardNavigation.TaskRow,taskCell:e.$keyboardNavigation.TaskCell};return b[v]||b.gantt}function f(v){for(var b=e.getGridColumns(),_=0;_{if(t.config.touch&&!t.config.touch_tooltip)return;const i=t.locate(n);if(t.isTaskExists(i)){const a=t.getTask(i);return t.templates.tooltip_text(a.start_date,a.end_date,a)}return null},global:!1})}),t.attachEvent("onDestroy",function(){e.destructor()}),t.attachEvent("onLightbox",function(){e.hideTooltip()}),t.attachEvent("onBeforeTooltip",function(){if(t.getState().link_source_id)return!1}),t.attachEvent("onGanttScroll",function(){e.hideTooltip()})},undo:function(t){const e=new Wn(t),n=new zn(e,t);function i(d,c,u){d&&(d.id===c&&(d.id=u),d.parent===c&&(d.parent=u))}function a(d,c,u){i(d.value,c,u),i(d.oldValue,c,u)}function r(d,c,u){d&&(d.source===c&&(d.source=u),d.target===c&&(d.target=u))}function s(d,c,u){r(d.value,c,u),r(d.oldValue,c,u)}function o(d,c,u){const h=e;for(let g=0;ge.undo(),redo:()=>e.redo(),getUndoStack:()=>e.getUndoStack(),setUndoStack:d=>e.setUndoStack(d),getRedoStack:()=>e.getRedoStack(),setRedoStack:d=>e.setRedoStack(d),clearUndoStack:()=>e.clearUndoStack(),clearRedoStack:()=>e.clearRedoStack(),saveState:(d,c)=>n.store(d,c,!0),getInitialState:(d,c)=>c===t.config.undo_types.link?n.getInitialLink(d):n.getInitialTask(d)},t.undo=t.ext.undo.undo,t.redo=t.ext.undo.redo,t.getUndoStack=t.ext.undo.getUndoStack,t.getRedoStack=t.ext.undo.getRedoStack,t.clearUndoStack=t.ext.undo.clearUndoStack,t.clearRedoStack=t.ext.undo.clearRedoStack,t.attachEvent("onTaskIdChange",(d,c)=>{const u=e;o(u.getUndoStack(),d,c),o(u.getRedoStack(),d,c)}),t.attachEvent("onLinkIdChange",(d,c)=>{const u=e;l(u.getUndoStack(),d,c),l(u.getRedoStack(),d,c)}),t.attachEvent("onGanttReady",()=>{e.updateConfigs()})},marker:function(t){function e(i){if(!t.config.show_markers||!i.start_date)return!1;var a=t.getState();if(+i.start_date>+a.max_date||(!i.end_date||+i.end_date<+a.min_date)&&+i.start_date<+a.min_date)return;var r=document.createElement("div");r.setAttribute("data-marker-id",i.id);var s="gantt_marker";i.css&&(s+=" "+i.css),i.title&&(r.title=i.title),r.className=s;var o=t.posFromDate(i.start_date);r.style.left=o+"px";let l=Math.max(t.getRowTop(t.getVisibleTaskCount()),0)+"px";if(t.config.timeline_placeholder&&t.$task_data&&(l=t.$task_data.scrollHeight+"px"),r.style.height=l,i.end_date){var d=t.posFromDate(i.end_date);r.style.width=Math.max(d-o,0)+"px"}return i.text&&(r.innerHTML=""+i.text+"
"),r}function n(){if(t.$task_data){var i=document.createElement("div");i.className="gantt_marker_area",t.$task_data.appendChild(i),t.$marker_area=i}}t._markers||(t._markers=t.createDatastore({name:"marker",initItem:function(i){return i.id=i.id||t.uid(),i}})),t.config.show_markers=!0,t.attachEvent("onBeforeGanttRender",function(){t.$marker_area||n()}),t.attachEvent("onDataRender",function(){t.$marker_area||(n(),t.renderMarkers())}),t.attachEvent("onGanttLayoutReady",function(){t.attachEvent("onBeforeGanttRender",function(){n(),t.$services.getService("layers").createDataRender({name:"marker",defaultContainer:function(){return t.$marker_area}}).addLayer(e)},{once:!0})}),t.getMarker=function(i){return this._markers?this._markers.getItem(i):null},t.addMarker=function(i){return this._markers.addItem(i)},t.deleteMarker=function(i){return!!this._markers.exists(i)&&(this._markers.removeItem(i),!0)},t.updateMarker=function(i){this._markers.refresh(i)},t._getMarkers=function(){return this._markers.getItems()},t.renderMarkers=function(){this._markers.refresh()}},multiselect:function(t){t.config.multiselect=!0,t.config.multiselect_one_level=!1,t._multiselect={_selected:{},_one_level:!1,_active:!0,_first_selected_when_shift:null,getDefaultSelected:function(){var e=this.getSelected();return e.length?e[e.length-1]:null},setFirstSelected:function(e){this._first_selected_when_shift=e},getFirstSelected:function(){return this._first_selected_when_shift},isActive:function(){return this.updateState(),this._active},updateState:function(){this._one_level=t.config.multiselect_one_level;var e=this._active;this._active=t.config.select_task,this._active!=e&&this.reset()},reset:function(){this._selected={}},setLastSelected:function(e){t.$data.tasksStore.silent(function(){var n=t.$data.tasksStore;e?n.select(e+""):n.unselect(null)})},getLastSelected:function(){var e=t.$data.tasksStore.getSelectedId();return e&&t.isTaskExists(e)?e:null},select:function(e,n){return!!(e&&t.callEvent("onBeforeTaskMultiSelect",[e,!0,n])&&t.callEvent("onBeforeTaskSelected",[e]))&&(this._selected[e]=!0,this.setLastSelected(e),this.afterSelect(e),t.callEvent("onTaskMultiSelect",[e,!0,n]),t.callEvent("onTaskSelected",[e]),!0)},toggle:function(e,n){this._selected[e]?this.unselect(e,n):this.select(e,n)},unselect:function(e,n){e&&t.callEvent("onBeforeTaskMultiSelect",[e,!1,n])&&(this._selected[e]=!1,this.getLastSelected()==e&&this.setLastSelected(this.getDefaultSelected()),this.afterSelect(e),t.callEvent("onTaskMultiSelect",[e,!1,n]),t.callEvent("onTaskUnselected",[e]))},isSelected:function(e){return!(!t.isTaskExists(e)||!this._selected[e])},getSelected:function(){var e=[];for(var n in this._selected)this._selected[n]&&t.isTaskExists(n)?e.push(n):this._selected[n]=!1;return e.sort(function(i,a){return t.getGlobalTaskIndex(i)>t.getGlobalTaskIndex(a)?1:-1}),e},forSelected:function(e){for(var n=this.getSelected(),i=0;ih?t.getNext(g):t.getPrev(g);for(g=n;t.getGlobalTaskIndex(g)!==c;)this.select(g,e)&&!r&&(r=!0,a=g),g=c>u?t.getNext(g):t.getPrev(g)}}else s=n}).bind(this);return o&&(e.ctrlKey||e.metaKey)?(this.isSelected(n)||this.setFirstSelected(n),n&&this.toggle(n,e)):o&&e.shiftKey?(t.isTaskExists(this.getFirstSelected())&&this.getFirstSelected()!==null||this.setFirstSelected(n),i.length?d():l()):l(),this.isSelected(n)?this.setLastSelected(n):a?n==s&&this.setLastSelected(e.shiftKey?a:this.getDefaultSelected()):this.setLastSelected(null),this.getSelected().length||this.setLastSelected(null),this.getLastSelected()&&this.isSelected(this.getFirstSelected())||this.setFirstSelected(this.getLastSelected()),!0}},function(){var e=t.selectTask;t.selectTask=function(i){if(!(i=at(i,this.config.root_id)))return!1;var a=t._multiselect,r=i;return a.isActive()?(a.select(i,null)&&a.setLastSelected(i),a.setFirstSelected(a.getLastSelected())):r=e.call(this,i),r};var n=t.unselectTask;t.unselectTask=function(i){var a=t._multiselect,r=a.isActive();(i=i||a.getLastSelected())&&r&&(a.unselect(i,null),i==a.getLastSelected()&&a.setLastSelected(null),t.refreshTask(i),a.setFirstSelected(a.getLastSelected()));var s=i;return r||(s=n.call(this,i)),s},t.toggleTaskSelection=function(i){var a=t._multiselect;i&&a.isActive()&&(a.toggle(i),a.setFirstSelected(a.getLastSelected()))},t.getSelectedTasks=function(){var i=t._multiselect;return i.isActive(),i.getSelected()},t.eachSelectedTask=function(i){return this._multiselect.forSelected(i)},t.isSelectedTask=function(i){return this._multiselect.isSelected(i)},t.getLastSelectedTask=function(){return this._multiselect.getLastSelected()},t.attachEvent("onGanttReady",function(){var i=t.$data.tasksStore.isSelected;t.$data.tasksStore.isSelected=function(a){return t._multiselect.isActive()?t._multiselect.isSelected(a):i.call(this,a)}})}(),t.attachEvent("onTaskIdChange",function(e,n){var i=t._multiselect;if(!i.isActive())return!0;t.isSelectedTask(e)&&(i.unselect(e,null),i.select(n,null))}),t.attachEvent("onAfterTaskDelete",function(e,n){var i=t._multiselect;if(!i.isActive())return!0;i._selected[e]&&(i._selected[e]=!1,i.setLastSelected(i.getDefaultSelected())),i.forSelected(function(a){t.isTaskExists(a)||i.unselect(a,null)})}),t.attachEvent("onBeforeTaskMultiSelect",function(e,n,i){var a=t._multiselect;return!(n&&a.isActive()&&a._one_level)||a.isSameLevel(e)}),t.attachEvent("onTaskClick",function(e,n){return t._multiselect.doSelection(n)&&t.callEvent("onMultiSelect",[n]),!0})},export_api:function(t){return t.ext=t.ext||{},t.ext.export_api=t.ext.export_api||{_apiUrl:"https://export.dhtmlx.com/gantt",_preparePDFConfigRaw(e,n){let i=null;e.start&&e.end&&(i={start_date:t.config.start_date,end_date:t.config.end_date},t.config.start_date=t.date.str_to_date(t.config.date_format)(e.start),t.config.end_date=t.date.str_to_date(t.config.date_format)(e.end)),e=t.mixin(e,{name:"gantt."+n,data:t.ext.export_api._serializeHtml()}),i&&(t.config.start_date=i.start_date,t.config.end_date=i.end_date)},_prepareConfigPDF:(e,n)=>(e=t.mixin(e||{},{name:"gantt."+n,data:t.ext.export_api._serializeAll(),config:t.config}),t.ext.export_api._fixColumns(e.config.columns),e),_pdfExportRouter(e,n){e&&e.raw?t.ext.export_api._preparePDFConfigRaw(e,n):e=t.ext.export_api._prepareConfigPDF(e,n),e.version=t.version,t.ext.export_api._sendToExport(e,n)},exportToPDF(e){t.ext.export_api._pdfExportRouter(e,"pdf")},exportToPNG(e){t.ext.export_api._pdfExportRouter(e,"png")},exportToICal(e){e=t.mixin(e||{},{name:"gantt.ical",data:t.ext.export_api._serializePlain().data,version:t.version}),t.ext.export_api._sendToExport(e,"ical")},exportToExcel(e){let n,i,a,r;e=e||{};const s=t.config.smart_rendering;if(e.visual==="base-colors"&&(t.config.smart_rendering=!1),e.start||e.end){a=t.getState(),i=[t.config.start_date,t.config.end_date],r=t.getScrollState();const o=t.date.str_to_date(t.config.date_format);n=t.eachTask,e.start&&(t.config.start_date=o(e.start)),e.end&&(t.config.end_date=o(e.end)),t.render(),t.config.smart_rendering=s,t.eachTask=t.ext.export_api._eachTaskTimed(t.config.start_date,t.config.end_date)}else e.visual==="base-colors"&&(t.render(),t.config.smart_rendering=s);t._no_progress_colors=e.visual==="base-colors",(e=t.mixin(e,{name:"gantt.xlsx",title:"Tasks",data:t.ext.export_api._serializeTimeline(e).data,columns:t.ext.export_api._serializeGrid({rawDates:!0}),version:t.version})).visual&&(e.scales=t.ext.export_api._serializeScales(e)),t.ext.export_api._sendToExport(e,"excel"),(e.start||e.end)&&(t.config.start_date=a.min_date,t.config.end_date=a.max_date,t.eachTask=n,t.render(),t.scrollTo(r.x,r.y),t.config.start_date=i[0],t.config.end_date=i[1])},exportToJSON(e){e=t.mixin(e||{},{name:"gantt.json",data:t.ext.export_api._serializeAll(),config:t.config,columns:t.ext.export_api._serializeGrid(),worktime:t.ext.export_api._getWorktimeSettings(),version:t.version}),t.ext.export_api._sendToExport(e,"json")},importFromExcel(e){try{const n=e.data;if(n instanceof File){const i=new FormData;i.append("file",n),e.data=i}}catch{}t.ext.export_api._sendImportAjaxExcel(e)},importFromMSProject(e){const n=e.data;try{if(n instanceof File){const i=new FormData;i.append("file",n),e.data=i}}catch{}t.ext.export_api._sendImportAjaxMSP(e)},importFromPrimaveraP6:e=>(e.type="primaveraP6-parse",t.importFromMSProject(e)),exportToMSProject(e){(e=e||{}).skip_circular_links=e.skip_circular_links===void 0||!!e.skip_circular_links;const n=t.templates.xml_format,i=t.templates.format_date,a=t.config.xml_date,r=t.config.date_format,s="%d-%m-%Y %H:%i:%s";t.config.xml_date=s,t.config.date_format=s,t.templates.xml_format=t.date.date_to_str(s),t.templates.format_date=t.date.date_to_str(s);const o=t.ext.export_api._serializeAll();t.ext.export_api._customProjectProperties(o,e),t.ext.export_api._customTaskProperties(o,e),e.skip_circular_links&&t.ext.export_api._clearRecLinks(o),e=t.ext.export_api._exportConfig(o,e),t.ext.export_api._sendToExport(e,e.type||"msproject"),t.config.xml_date=a,t.config.date_format=r,t.templates.xml_format=n,t.templates.format_date=i,t.config.$custom_data=null,t.config.custom=null},exportToPrimaveraP6:e=>((e=e||{}).type="primaveraP6",t.exportToMSProject(e)),_fixColumns(e){for(let n=0;n400))try{o=JSON.parse(s.responseText)}catch{}r&&r(o)},s.open("POST",n,!0),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.send(a)},_ajaxToExport(e,n,i){delete e.callback;const a=e.server||t.ext.export_api._apiUrl,r="type="+n+"&store=1&data="+encodeURIComponent(JSON.stringify(e));t.ext.export_api._xdr(a,r,function(s){const o=s.xmlDoc||s;let l=null;if(!(o.status>400))try{l=JSON.parse(o.responseText)}catch{}i(l)})},_serializableGanttConfig(e){const n=t.mixin({},e);return n.columns&&(n.columns=n.columns.map(function(i){const a=t.mixin({},i);return delete a.editor,a})),delete n.editor_types,n},_sendToExport(e,n){const i=t.date.date_to_str(t.config.date_format||t.config.xml_date);if(e.skin||(e.skin=t.skin),e.config&&(e.config=t.copy(t.ext.export_api._serializableGanttConfig(e.config)),t.ext.export_api._markColumns(e,n),e.config.start_date&&e.config.end_date&&(e.config.start_date instanceof Date&&(e.config.start_date=i(e.config.start_date)),e.config.end_date instanceof Date&&(e.config.end_date=i(e.config.end_date)))),e.callback)return t.ext.export_api._ajaxToExport(e,n,e.callback);const a=t.ext.export_api._createHiddenForm();a.firstChild.action=e.server||t.ext.export_api._apiUrl,a.firstChild.childNodes[0].value=JSON.stringify(e),a.firstChild.childNodes[1].value=n,a.firstChild.submit()},_createHiddenForm(){if(!t.ext.export_api._hidden_export_form){const e=t.ext.export_api._hidden_export_form=document.createElement("div");e.style.display="none",e.innerHTML=" ",document.body.appendChild(e)}return t.ext.export_api._hidden_export_form},_copyObjectBase(e){const n={start_date:void 0,end_date:void 0,constraint_date:void 0,deadline:void 0};for(const a in e)a.charAt(0)!=="$"&&a!=="baselines"&&(n[a]=e[a]);const i=t.templates.xml_format||t.templates.format_date;return n.start_date=i(n.start_date),n.end_date&&(n.end_date=i(n.end_date)),n.constraint_date&&(n.constraint_date=i(n.constraint_date)),n.deadline&&(n.deadline=i(n.deadline)),n},_color_box:null,_color_hash:{},_getStyles(e){if(t.ext.export_api._color_box||(t.ext.export_api._color_box=document.createElement("DIV"),t.ext.export_api._color_box.style.cssText="position:absolute; display:none;",document.body.appendChild(t.ext.export_api._color_box)),t.ext.export_api._color_hash[e])return t.ext.export_api._color_hash[e];t.ext.export_api._color_box.className=e;const n=t.ext.export_api._getColor(t.ext.export_api._color_box,"color"),i=t.ext.export_api._getColor(t.ext.export_api._color_box,"backgroundColor");return t.ext.export_api._color_hash[e]=n+";"+i},_getMinutesWorktimeSettings(e){const n=[];return e.forEach(function(i){n.push(i.startMinute),n.push(i.endMinute)}),n},_getWorktimeSettings(){const e={hours:[0,24],minutes:null,dates:{0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0}};let n;if(t.config.work_time){const i=t._working_time_helper;if(i&&i.get_calendar)n=i.get_calendar();else if(i)n={hours:i.hours,minutes:null,dates:i.dates};else if(t.config.worktimes&&t.config.worktimes.global){const a=t.config.worktimes.global;if(a.parsed){n={hours:null,minutes:t.ext.export_api._getMinutesWorktimeSettings(a.parsed.hours),dates:{}};for(const r in a.parsed.dates)Array.isArray(a.parsed.dates[r])?n.dates[r]=t.ext.export_api._getMinutesWorktimeSettings(a.parsed.dates[r]):n.dates[r]=a.parsed.dates[r]}else n={hours:a.hours,minutes:null,dates:a.dates}}else n=e}else n=e;return n},_eachTaskTimed:(e,n)=>function(i,a,r){a=a||t.config.root_id,r=r||t;const s=t.getChildren(a);if(s)for(let o=0;oe)&&(!n||l.start_date-1){let l=0;for(;lr.length&&(r=a[s].trace_x);for(let s=0;s400))try{l=JSON.parse(o.responseText)}catch{}r&&r(l)},o.open("POST",n,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.send(a)}},t.exportToPDF=t.ext.export_api.exportToPDF,t.exportToPNG=t.ext.export_api.exportToPNG,t.exportToICal=t.ext.export_api.exportToICal,t.exportToExcel=t.ext.export_api.exportToExcel,t.exportToJSON=t.ext.export_api.exportToJSON,t.importFromExcel=t.ext.export_api.importFromExcel,t.importFromMSProject=t.ext.export_api.importFromMSProject,t.exportToMSProject=t.ext.export_api.exportToMSProject,t.importFromPrimaveraP6=t.ext.export_api.importFromPrimaveraP6,t.exportToPrimaveraP6=t.ext.export_api.exportToPrimaveraP6,t.ext.export_api}},Fn={KEY_CODES:{UP:38,DOWN:40,LEFT:37,RIGHT:39,SPACE:32,ENTER:13,DELETE:46,ESC:27,TAB:9}};class Vn{constructor(e){this.addExtension=(n,i)=>{this._extensions[n]=i},this.getExtension=n=>this._extensions[n],this._extensions={};for(const n in e)this._extensions[n]=e[n]}}const Un=()=>({layout:{css:"gantt_container",rows:[{cols:[{view:"grid",scrollX:"scrollHor",scrollY:"scrollVer"},{resizer:!0,width:1},{view:"timeline",scrollX:"scrollHor",scrollY:"scrollVer"},{view:"scrollbar",id:"scrollVer"}]},{view:"scrollbar",id:"scrollHor",height:20}]},links:{finish_to_start:"0",start_to_start:"1",finish_to_finish:"2",start_to_finish:"3"},types:{task:"task",project:"project",milestone:"milestone"},auto_types:!1,duration_unit:"day",work_time:!1,correct_work_time:!1,skip_off_time:!1,cascade_delete:!0,autosize:!1,autosize_min_width:0,autoscroll:!0,autoscroll_speed:30,deepcopy_on_parse:!1,show_links:!0,show_task_cells:!0,static_background:!1,static_background_cells:!0,branch_loading:!1,branch_loading_property:"$has_child",show_loading:!1,show_chart:!0,show_grid:!0,min_duration:36e5,date_format:"%d-%m-%Y %H:%i",xml_date:void 0,start_on_monday:!0,server_utc:!1,show_progress:!0,fit_tasks:!1,select_task:!0,scroll_on_click:!0,smart_rendering:!0,preserve_scroll:!0,readonly:!1,container_resize_timeout:20,deadlines:!0,date_grid:"%Y-%m-%d",drag_links:!0,drag_progress:!0,drag_resize:!0,drag_project:!1,drag_move:!0,drag_mode:{resize:"resize",progress:"progress",move:"move",ignore:"ignore"},round_dnd_dates:!0,link_wrapper_width:20,link_arrow_size:12,root_id:0,autofit:!1,columns:[{name:"text",tree:!0,width:"*",resize:!0},{name:"start_date",align:"center",resize:!0},{name:"duration",align:"center"},{name:"add",width:44}],scale_offset_minimal:!0,inherit_scale_class:!1,scales:[{unit:"day",step:1,date:"%d %M"}],time_step:60,duration_step:1,task_date:"%d %F %Y",time_picker:"%H:%i",task_attribute:"data-task-id",link_attribute:"data-link-id",layer_attribute:"data-layer",buttons_left:["gantt_save_btn","gantt_cancel_btn"],_migrate_buttons:{dhx_save_btn:"gantt_save_btn",dhx_cancel_btn:"gantt_cancel_btn",dhx_delete_btn:"gantt_delete_btn"},buttons_right:["gantt_delete_btn"],lightbox:{sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"time",type:"duration",map_to:"auto"}],project_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",readonly:!0,map_to:"auto"}],milestone_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",single_date:!0,map_to:"auto"}]},drag_lightbox:!0,sort:!1,details_on_create:!0,details_on_dblclick:!0,initial_scroll:!0,task_scroll_offset:100,order_branch:!1,order_branch_free:!1,task_height:void 0,bar_height:"full",bar_height_padding:9,min_column_width:70,min_grid_column_width:70,grid_resizer_column_attribute:"data-column-index",keep_grid_width:!1,grid_resize:!1,grid_elastic_columns:!1,show_tasks_outside_timescale:!1,show_unscheduled:!0,resize_rows:!1,task_grid_row_resizer_attribute:"data-row-index",min_task_grid_row_height:30,row_height:36,readonly_property:"readonly",editable_property:"editable",calendar_property:"calendar_id",resource_calendars:{},dynamic_resource_calendars:!1,inherit_calendar:!1,type_renderers:{},open_tree_initially:!1,optimize_render:!0,prevent_default_scroll:!1,show_errors:!0,wai_aria_attributes:!0,smart_scales:!0,rtl:!1,placeholder_task:!1,horizontal_scroll_key:"shiftKey",drag_timeline:{useKey:void 0,ignore:".gantt_task_line, .gantt_task_link",render:!1},drag_multiple:!0,csp:"auto"});var st=typeof window<"u";const _t={isIE:st&&(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0),isIE6:st&&!XMLHttpRequest&&navigator.userAgent.indexOf("MSIE")>=0,isIE7:st&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0,isIE8:st&&navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0,isOpera:st&&navigator.userAgent.indexOf("Opera")>=0,isChrome:st&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:st&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:st&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:st&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:st&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!st||typeof navigator>"u"||!1};function je(t){if(typeof t=="string"||typeof t=="number")return t;let e="";for(const n in t){let i="";t.hasOwnProperty(n)&&(i=typeof t[n]=="string"?encodeURIComponent(t[n]):typeof t[n]=="number"?String(t[n]):encodeURIComponent(JSON.stringify(t[n])),i=n+"="+i,e.length&&(i="&"+i),e+=i)}return e}function $t(t,e){var n={method:t};if(e.length===0)throw new Error("Arguments list of query is wrong.");if(e.length===1)return typeof e[0]=="string"?(n.url=e[0],n.async=!0):(n.url=e[0].url,n.async=e[0].async||!0,n.callback=e[0].callback,n.headers=e[0].headers),e[0].data?typeof e[0].data!="string"?n.data=je(e[0].data):n.data=e[0].data:n.data="",n;switch(n.url=e[0],t){case"GET":case"DELETE":n.callback=e[1],n.headers=e[2];break;case"POST":case"PUT":e[1]?typeof e[1]!="string"?n.data=je(e[1]):n.data=e[1]:n.data="",n.callback=e[2],n.headers=e[3]}return n}const Fe={date_to_str:(t,e,n)=>{t=t.replace(/%[a-zA-Z]/g,a=>{switch(a){case"%d":return`"+to_fixed(date.get${e?"UTC":""}Date())+"`;case"%m":return`"+to_fixed((date.get${e?"UTC":""}Month()+1))+"`;case"%j":return`"+date.get${e?"UTC":""}Date()+"`;case"%n":return`"+(date.get${e?"UTC":""}Month()+1)+"`;case"%y":return`"+to_fixed(date.get${e?"UTC":""}FullYear()%100)+"`;case"%Y":return`"+date.get${e?"UTC":""}FullYear()+"`;case"%D":return`"+locale.date.day_short[date.get${e?"UTC":""}Day()]+"`;case"%l":return`"+locale.date.day_full[date.get${e?"UTC":""}Day()]+"`;case"%M":return`"+locale.date.month_short[date.get${e?"UTC":""}Month()]+"`;case"%F":return`"+locale.date.month_full[date.get${e?"UTC":""}Month()]+"`;case"%h":return`"+to_fixed((date.get${e?"UTC":""}Hours()+11)%12+1)+"`;case"%g":return`"+((date.get${e?"UTC":""}Hours()+11)%12+1)+"`;case"%G":return`"+date.get${e?"UTC":""}Hours()+"`;case"%H":return`"+to_fixed(date.get${e?"UTC":""}Hours())+"`;case"%i":return`"+to_fixed(date.get${e?"UTC":""}Minutes())+"`;case"%a":return`"+(date.get${e?"UTC":""}Hours()>11?"pm":"am")+"`;case"%A":return`"+(date.get${e?"UTC":""}Hours()>11?"PM":"AM")+"`;case"%s":return`"+to_fixed(date.get${e?"UTC":""}Seconds())+"`;case"%W":return'"+to_fixed(getISOWeek(date))+"';case"%w":return'"+to_fixed(getWeek(date))+"';default:return a}});const i=new Function("date","to_fixed","locale","getISOWeek","getWeek",`return "${t}";`);return a=>i(a,n.date.to_fixed,n.locale,n.date.getISOWeek,n.date.getWeek)},str_to_date:(t,e,n)=>{let i="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);";const a=t.match(/%[a-zA-Z]/g);for(let o=0;o50?1900:2000);`;break;case"%g":case"%G":case"%h":case"%H":i+=`set[3]=temp[${o}]||0;`;break;case"%i":i+=`set[4]=temp[${o}]||0;`;break;case"%Y":i+=`set[0]=temp[${o}]||0;`;break;case"%a":case"%A":i+=`set[3]=set[3]%12+((temp[${o}]||'').toLowerCase()=='am'?0:12);`;break;case"%s":i+=`set[5]=temp[${o}]||0;`;break;case"%M":i+=`set[1]=locale.date.month_short_hash[temp[${o}]]||0;`;break;case"%F":i+=`set[1]=locale.date.month_full_hash[temp[${o}]]||0;`}let r="set[0],set[1],set[2],set[3],set[4],set[5]";e&&(r=` Date.UTC(${r})`);const s=new Function("date","locale",`var set=[0,0,1,0,0,0]; ${i} return new Date(${r});`);return o=>s(o,n.locale)}},Ve={date_to_str:(t,e,n)=>i=>t.replace(/%[a-zA-Z]/g,a=>{switch(a){case"%d":return e?n.date.to_fixed(i.getUTCDate()):n.date.to_fixed(i.getDate());case"%m":return e?n.date.to_fixed(i.getUTCMonth()+1):n.date.to_fixed(i.getMonth()+1);case"%j":return e?i.getUTCDate():i.getDate();case"%n":return e?i.getUTCMonth()+1:i.getMonth()+1;case"%y":return e?n.date.to_fixed(i.getUTCFullYear()%100):n.date.to_fixed(i.getFullYear()%100);case"%Y":return e?i.getUTCFullYear():i.getFullYear();case"%D":return e?n.locale.date.day_short[i.getUTCDay()]:n.locale.date.day_short[i.getDay()];case"%l":return e?n.locale.date.day_full[i.getUTCDay()]:n.locale.date.day_full[i.getDay()];case"%M":return e?n.locale.date.month_short[i.getUTCMonth()]:n.locale.date.month_short[i.getMonth()];case"%F":return e?n.locale.date.month_full[i.getUTCMonth()]:n.locale.date.month_full[i.getMonth()];case"%h":return e?n.date.to_fixed((i.getUTCHours()+11)%12+1):n.date.to_fixed((i.getHours()+11)%12+1);case"%g":return e?(i.getUTCHours()+11)%12+1:(i.getHours()+11)%12+1;case"%G":return e?i.getUTCHours():i.getHours();case"%H":return e?n.date.to_fixed(i.getUTCHours()):n.date.to_fixed(i.getHours());case"%i":return e?n.date.to_fixed(i.getUTCMinutes()):n.date.to_fixed(i.getMinutes());case"%a":return e?i.getUTCHours()>11?"pm":"am":i.getHours()>11?"pm":"am";case"%A":return e?i.getUTCHours()>11?"PM":"AM":i.getHours()>11?"PM":"AM";case"%s":return e?n.date.to_fixed(i.getUTCSeconds()):n.date.to_fixed(i.getSeconds());case"%W":return e?n.date.to_fixed(n.date.getUTCISOWeek(i)):n.date.to_fixed(n.date.getISOWeek(i));default:return a}}),str_to_date:(t,e,n)=>i=>{const a=[0,0,1,0,0,0],r=i.match(/[a-zA-Z]+|[0-9]+/g),s=t.match(/%[a-zA-Z]/g);for(let o=0;o50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":a[3]=r[o]||0;break;case"%i":a[4]=r[o]||0;break;case"%Y":a[0]=r[o]||0;break;case"%a":case"%A":a[3]=a[3]%12+((r[o]||"").toLowerCase()==="am"?0:12);break;case"%s":a[5]=r[o]||0;break;case"%M":a[1]=n.locale.date.month_short_hash[r[o]]||0;break;case"%F":a[1]=n.locale.date.month_full_hash[r[o]]||0}return e?new Date(Date.UTC(a[0],a[1],a[2],a[3],a[4],a[5])):new Date(a[0],a[1],a[2],a[3],a[4],a[5])}};function qn(t){var e=null;function n(){var a=!1;return t.config.csp==="auto"?(e===null&&function(){try{new Function("canUseCsp = false;")}catch{e=!0}}(),a=e):a=t.config.csp,a}var i={init:function(){for(var a=t.locale,r=a.date.month_short,s=a.date.month_short_hash={},o=0;o=9?9:s>=6?6:s>=3?3:0,a.setMonth(r),a},year_start:function(a){return a.setMonth(0),this.month_start(a)},day_start:function(a){return this.date_part(a)},hour_start:function(a){return a.getMinutes()&&a.setMinutes(0),this.minute_start(a),a},minute_start:function(a){return a.getSeconds()&&a.setSeconds(0),a.getMilliseconds()&&a.setMilliseconds(0),a},_add_days:function(a,r,s){a.setDate(a.getDate()+r);var o=r>=0,l=!s.getHours()&&a.getHours(),d=a.getDate()<=s.getDate()||a.getMonth()1&&l&&a.setHours(0),a},add:function(a,r,s){var o=new Date(a.valueOf());switch(s){case"day":o=this._add_days(o,r,a);break;case"week":o=this._add_days(o,7*r,a);break;case"month":o.setMonth(o.getMonth()+r);break;case"year":o.setYear(o.getFullYear()+r);break;case"hour":o.setTime(o.getTime()+60*r*60*1e3);break;case"minute":o.setTime(o.getTime()+60*r*1e3);break;default:return this["add_"+s](a,r,s)}return o},add_quarter:function(a,r){return this.add(a,3*r,"month")},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,r){var s=Fe;return n()&&(s=Ve),s.date_to_str(a,r,t)},str_to_date:function(a,r){var s=Fe;return n()&&(s=Ve),s.str_to_date(a,r,t)},getISOWeek:function(a){return t.date._getWeekNumber(a,!0)},_getWeekNumber:function(a,r){if(!a)return!1;var s=a.getDay();r&&s===0&&(s=7);var o=new Date(a.valueOf());o.setDate(a.getDate()+(4-s));var l=o.getFullYear(),d=Math.round((o.getTime()-new Date(l,0,1).getTime())/864e5);return 1+Math.floor(d/7)},getWeek:function(a){return t.date._getWeekNumber(a,t.config.start_on_monday)},getUTCISOWeek:function(a){return t.date.getISOWeek(a)},convert_to_utc:function(a){return new Date(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds())},parseDate:function(a,r){return a&&!a.getFullYear&&(typeof r!="function"&&(r=typeof r=="string"?r==="parse_date"||r==="xml_date"?t.defined(t.templates.xml_date)?t.templates.xml_date:t.templates.parse_date:t.defined(t.templates[r])?t.templates[r]:t.date.str_to_date(r):t.defined(t.templates.xml_date)?t.templates.xml_date:t.templates.parse_date),a=a?r(a):null),a}};return i}class Gn{constructor(e){const{url:n,token:i}=e;this._url=n,this._token=i,this._mode=1,this._seed=1,this._queue=[],this.data={},this.api={},this._events={}}headers(){return{Accept:"application/json","Content-Type":"application/json","Remote-Token":this._token}}fetch(e,n){const i={credentials:"include",headers:this.headers()};return n&&(i.method="POST",i.body=n),fetch(e,i).then(a=>a.json())}load(e){return e&&(this._url=e),this.fetch(this._url).then(n=>this.parse(n))}parse(e){const{key:n,websocket:i}=e;n&&(this._token=e.key);for(const a in e.data)this.data[a]=e.data[a];for(const a in e.api){const r=this.api[a]={},s=e.api[a];for(const o in s)r[o]=this._wrapper(a+"."+o)}return i&&this.connect(),this}connect(){const e=this._socket;e&&(this._socket=null,e.onclose=function(){},e.close()),this._mode=2,this._socket=function(n,i,a,r){let s=i;s[0]==="/"&&(s=document.location.protocol+"//"+document.location.host+i),s=s.replace(/^http(s|):/,"ws$1:");const o=s.indexOf("?")!=-1?"&":"?";s=`${s}${o}token=${a}&ws=1`;const l=new WebSocket(s);return l.onclose=()=>setTimeout(()=>n.connect(),2e3),l.onmessage=d=>{const c=JSON.parse(d.data);switch(c.action){case"result":n.result(c.body,[]);break;case"event":n.fire(c.body.name,c.body.value);break;case"start":r();break;default:n.onError(c.data)}},l}(this,this._url,this._token,()=>(this._mode=3,this._send(),this._resubscribe(),this))}_wrapper(e){return(function(){const n=[].slice.call(arguments);let i=null;const a=new Promise((r,s)=>{i={data:{id:this._uid(),name:e,args:n},status:1,resolve:r,reject:s},this._queue.push(i)});return this.onCall(i,a),this._mode===3?this._send(i):setTimeout(()=>this._send(),1),a}).bind(this)}_uid(){return(this._seed++).toString()}_send(e){if(this._mode==2)return void setTimeout(()=>this._send(),100);const n=e?[e]:this._queue.filter(a=>a.status===1);if(!n.length)return;const i=n.map(a=>(a.status=2,a.data));this._mode!==3?this.fetch(this._url,JSON.stringify(i)).catch(a=>this.onError(a)).then(a=>this.result(a,i)):this._socket.send(JSON.stringify({action:"call",body:i}))}result(e,n){const i={};if(e)for(let a=0;a=0;a--){const r=this._queue[a],s=i[r.data.id];s&&(this.onResponse(r,s),s.error?r.reject(s.error):r.resolve(s.data),this._queue.splice(a,1))}}on(e,n){const i=this._uid();let a=this._events[e];const r=!!a;return r||(a=this._events[e]=[]),a.push({id:i,handler:n}),r||this._mode!=3||this._socket.send(JSON.stringify({action:"subscribe",name:e})),{name:e,id:i}}_resubscribe(){if(this._mode==3)for(const e in this._events)this._socket.send(JSON.stringify({action:"subscribe",name:e}))}detach(e){if(!e){if(this._mode==3)for(const r in this._events)this._socket.send(JSON.stringify({action:"unsubscribe",key:r}));return void(this._events={})}const{id:n,name:i}=e,a=this._events[i];if(a){const r=a.filter(s=>s.id!=n);r.length?this._events[i]=r:(delete this._events[i],this._mode==3&&this._socket.send(JSON.stringify({action:"unsubscribe",name:i})))}}fire(e,n){const i=this._events[e];if(i)for(let a=0;as.json())},this._ready=n.load().then(i=>this._remote=i),this.ready=function(){return this._ready},this.on=function(i,a){this.ready().then(r=>{if(typeof i=="string")r.on(i,a);else for(const s in i)r.on(s,i[s])})}};function Ue(t,e){if(!e)return!0;if(t._on_timeout)return!1;var n=Math.ceil(1e3/e);return n<2||(setTimeout(function(){delete t._on_timeout},n),t._on_timeout=!0),!0}var Jn=function(){var t={};return{getState:function(e){if(t[e])return t[e].method();var n={};for(var i in t)t[i].internal||N(n,t[i].method(),!0);return n},registerProvider:function(e,n,i){t[e]={method:n,internal:i}},unregisterProvider:function(e){delete t[e]}}};const Kn=Promise;var et={$create:function(t){return N(t||[],this)},$removeAt:function(t,e){t>=0&&this.splice(t,e||1)},$remove:function(t){this.$removeAt(this.$find(t))},$insertAt:function(t,e){if(e||e===0){var n=this.splice(e,this.length-e);this[e]=t,this.push.apply(this,n)}else this.push(t)},$find:function(t){for(var e=0;ei&&(e=Math.min(n.length,e))}this.pull[t.id]=t,this.isSilent()||this._updateOrder(function(){this.$find(t.id)===-1&&this.$insertAt(t.id,e)}),this.filter()},isVisible:function(t){return this.visibleOrder.$find(t)>-1},getVisibleItems:function(){return this.getIndexRange()},addItem:function(t,e){return W(t.id)||(t.id=rt()),this.$initItem&&(t=this.$initItem(t)),!(!this.isSilent()&&this.callEvent("onBeforeAdd",[t.id,t])===!1)&&(this._addItemInner(t,e),this.isSilent()||(this.callEvent("onAfterAdd",[t.id,t]),this.callEvent("onStoreUpdated",[t.id,t,"add"])),t.id)},_changeIdInner:function(t,e){this.pull[t]&&(this.pull[e]=this.pull[t]);var n=this._searchVisibleOrder[t];this.pull[e].id=e,this._updateOrder(function(){this[this.$find(t)]=e}),this._searchVisibleOrder[e]=n,delete this._searchVisibleOrder[t],delete this.pull[t]},changeId:function(t,e){this._changeIdInner(t,e),this.callEvent("onIdChange",[t,e])},exists:function(t){return!!this.pull[t]},_moveInner:function(t,e){var n=this.getIdByIndex(t);this._updateOrder(function(){this.$removeAt(t),this.$insertAt(n,Math.min(this.length,e))})},move:function(t,e){var n=this.getIdByIndex(t),i=this.getItem(n);this._moveInner(t,e),this.isSilent()||this.callEvent("onStoreUpdated",[i.id,i,"move"])},clearAll:function(){this.$destroyed||(this.silent(function(){this.unselect()}),this.pull={},this.visibleOrder=et.$create(),this.fullOrder=et.$create(),this.isSilent()||(this.callEvent("onClearAll",[]),this.refresh()))},silent:function(t,e){var n=!1;this.isSilent()&&(n=!0),this._skip_refresh=!0,t.call(e||this),n||(this._skip_refresh=!1)},isSilent:function(){return!!this._skip_refresh},arraysEqual:function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=n.$level)return!1;for(;n&&this.exists(i);){if((n=this.getItem(i))&&n.id==e)return!0;i=this.getParent(n)}return!1},getSiblings:function(t){if(!this.exists(t))return et.$create();var e=this.getParent(t);return this.getChildren(e)},getNextSibling:function(t){for(var e=this.getSiblings(t),n=0,i=e.length;n0&&(a="0"),a||null}return null},getPrevSibling:function(t){for(var e=this.getSiblings(t),n=0,i=e.length;n0&&(a="0"),a||null}return null},getParent:function(t){var e=null;return(e=t.id!==void 0?t:this.getItem(t))?e[this.$parentProperty]:this.$getRootId()},clearAll:function(){this._branches={},ot.prototype.clearAll.call(this)},calculateItemLevel:function(t){var e=0;return this.eachParent(function(){e++},t),e},_setParentInner:function(t,e,n){n||(t.hasOwnProperty("$rendered_parent")?this._move_branch(t,t.$rendered_parent,e):this._move_branch(t,t[this.$parentProperty],e))},setParent:function(t,e,n){this._setParentInner(t,e,n),t[this.$parentProperty]=e},_eachItemCached:function(t,e){for(var n=0,i=e.length;n=0;o--)i.push(s[o])}},eachItem:function(t,e){var n=this.$getRootId();W(e)||(e=n);var i=at(e,n)||n,a=!1,r=!1,s=null;i===n&&(this._eachItemMainRangeCache?(a=!0,s=this._eachItemMainRangeCache):(r=!0,s=this._eachItemMainRangeCache=[])),a?this._eachItemCached(t,s):this._eachItemIterate(t,i,r?s:null)},eachParent:function(t,e){for(var n={},i=e,a=this.getParent(i);this.exists(a);){if(n[a])throw new Error("Invalid tasks tree. Cyclic reference has been detected on task "+a);n[a]=!0,i=this.getItem(a),t.call(this,i),a=this.getParent(i)}},_add_branch:function(t,e,n){var i=n===void 0?this.getParent(t):n;this.hasChild(i)||(this._branches[i]=et.$create());var a=this.getChildren(i);a.indexOf(t.id+"")>-1||a.indexOf(+t.id)>-1||(1*e==e?a.splice(e,0,t.id):a.push(t.id),t.$rendered_parent=i)},_move_branch:function(t,e,n){this._eachItemMainRangeCache=null,this._replace_branch_child(e,t.id),this.exists(n)||n==this.$getRootId()?this._add_branch(t,void 0,n):delete this._branches[t.id],t.$level=this.calculateItemLevel(t),this.eachItem(function(i){i.$level=this.calculateItemLevel(i)},t.id)},_replace_branch_child:function(t,e,n){var i=this.getChildren(t);if(i&&t!==void 0){var a=et.$create();let r=i.indexOf(e+"");r!=-1||isNaN(+e)||(r=i.indexOf(+e)),r>-1&&(n?i.splice(r,1,n):i.splice(r,1)),a=i,this._branches[t]=a}},sort:function(t,e,n){this.exists(n)||(n=this.$getRootId()),t||(t="order");var i=typeof t=="string"?function(l,d){return l[t]==d[t]||X(l[t])&&X(d[t])&&l[t].valueOf()==d[t].valueOf()?0:l[t]>d[t]?1:-1}:t;if(e){var a=i;i=function(l,d){return a(d,l)}}var r=this.getChildren(n);if(r){for(var s=[],o=r.length-1;o>=0;o--)s[o]=this.getItem(r[o]);for(s.sort(i),o=0;o0&&(c=c.filter(u=>u!==void 0),d=d.concat(c))}if((l.start==null||l.end==null)&&l.ids==null)throw new Error("Invalid range returned from 'getVisibleRange' of the layer")}else d=n.getVisibleItems();o.prepare_data&&o.prepare_data(d,o),o.update_items(d)}};function s(o){return!!o.$services.getService("state").getState("batchUpdate").batch_update}n.attachEvent("onStoreUpdated",function(o,l,d){if(F(e))return!0;const c=e.$services.getService("layers").getDataRender(t);c&&(c.onUpdateRequest=function(u){r(u)})}),n.attachEvent("onStoreUpdated",function(o,l,d){s(e)||(o&&d!="move"&&d!="delete"?(n.callEvent("onBeforeRefreshItem",[l.id]),n.callEvent("onAfterRefreshItem",[l.id])):(n.callEvent("onBeforeRefreshAll",[]),n.callEvent("onAfterRefreshAll",[])))}),n.attachEvent("onAfterRefreshAll",function(){if(F(e))return!0;const o=e.$services.getService("layers").getDataRender(t);o&&!s(e)&&a(o)}),n.attachEvent("onAfterRefreshItem",function(o){if(F(e))return!0;const l=e.$services.getService("layers").getDataRender(t);l&&i(o,l)}),n.attachEvent("onItemOpen",function(){if(F(e))return!0;e.render()}),n.attachEvent("onItemClose",function(){if(F(e))return!0;e.render()}),n.attachEvent("onIdChange",function(o,l){if(F(e))return!0;if(n.callEvent("onBeforeIdChange",[o,l]),!s(e)&&!n.isSilent()){const d=e.$services.getService("layers").getDataRender(t);d?(function(c,u,h){for(let g=0;go.length-1||l<=0||s>o.length-1)){var d=i-this.getSum(o,r,s);this.adjustSize(d,o,r,s),this.adjustSize(-d,o,s+1),a.full_width=this.getSum(o)}},splitSize:function(i,a){for(var r=[],s=0;sa(o.unit,o.step)?-1:0});for(var r=0;r