diff --git a/README.md b/README.md index 352e0cc..8145960 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dhtmlxGantt # [![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/) -[![npm: v.9.0.1](https://img.shields.io/badge/npm-v.9.0.1-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt) +[![npm: v.9.0.2](https://img.shields.io/badge/npm-v.9.0.2-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt) [![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) [Getting started](#getting-started) | [Features](#features) | [License](#license) | [Useful links](#links) | [Follow us](#followus) @@ -117,7 +117,7 @@ Resource management, critical path calculation, auto scheduling, and other enhan ## 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. diff --git a/bower.json b/bower.json index ededdc7..3dd7b54 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gantt", - "version": "9.0.1", + "version": "9.0.2", "homepage": "https://dhtmlx.com/docs/products/dhtmlxGantt/", "description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.", "main": [ diff --git a/codebase/dhtmlxgantt.css b/codebase/dhtmlxgantt.css index 1ca4d43..7cffb1e 100644 --- a/codebase/dhtmlxgantt.css +++ b/codebase/dhtmlxgantt.css @@ -1 +1 @@ -@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuOKfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuDyYMZg.ttf) format("truetype")}:root{--dhx-gantt-theme: terrace;--dhx-gantt-font-family: Inter, Helvetica, Arial, sans-serif;--dhx-gantt-font-size: 14px;--dhx-gantt-heading-font-size: calc(var(--dhx-gantt-font-size) + 2px);--dhx-gantt-heading-font-weight: 600;--dhx-gantt-important-font-size: var(--dhx-gantt-font-size);--dhx-gantt-important-line-height: 142%;--dhx-gantt-important-font-weight: 500;--dhx-gantt-regular-font-size: var(--dhx-gantt-font-size);--dhx-gantt-regular-font-weight: 400;--dhx-gantt-regular-line-height: 142%;--dhx-gantt-caption-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-caption-font-weight: 400;--dhx-gantt-caption-line-height: 132%;--dhx-gantt-base-colors-white: #FFFFFF;--dhx-gantt-base-colors-select: #EFF3FF;--dhx-gantt-base-colors-hover-color: #e0e0e0;--dhx-gantt-base-colors-border-light: #F0F0F0;--dhx-gantt-base-colors-border: #DFE0E1;--dhx-gantt-base-colors-icons: #A1A4A6;--dhx-gantt-base-colors-icons-active: #8b8e90;--dhx-gantt-base-colors-icons-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 12.6%);--dhx-gantt-base-colors-icons-hover: #76787a;--dhx-gantt-base-colors-icons-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 28.5%);--dhx-gantt-base-colors-disabled: #E9E9E9;--dhx-gantt-base-colors-select: #E0E5F3;--dhx-gantt-base-colors-readonly: var(--dhx-gantt-base-colors-icons);--dhx-gantt-base-colors-text-light: #555D63;--dhx-gantt-base-colors-text-base: #23272A;--dhx-gantt-base-colors-text-on-fill: rgba(255, 255, 255, .9);--dhx-gantt-base-colors-background: #FFFFFF;--dhx-gantt-base-colors-background-alt: #F2F2F2;--dhx-gantt-base-colors-primary: #537CFA;--dhx-gantt-base-colors-primary-hover: #4269E0;--dhx-gantt-base-colors-primary-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 100%, #000000 6%);--dhx-gantt-base-colors-primary-active: #3365fb;--dhx-gantt-base-colors-primary-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 100%, #000000 16.6%);--dhx-gantt-base-colors-primary-lighter: #537cfa33;--dhx-gantt-base-colors-primary-lighter: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 20%, rgba(0, 0, 0, 0) 100%);--dhx-gantt-base-colors-warning: #FAB936;--dhx-gantt-base-colors-error: #E3334E;--dhx-gantt-base-colors-error-hover: #D3233E;--dhx-gantt-base-colors-error-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 100%, #000000 6%);--dhx-gantt-base-colors-error-active: #C3132E;--dhx-gantt-base-colors-error-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 100%, #000000 16.6%);--dhx-gantt-base-colors-error-lighter: #E3334E33;--dhx-gantt-base-colors-error-lighter: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 20%, rgba(0, 0, 0, 0) 100%);--dhx-gantt-base-colors-error-text: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-base-colors-success: #1BC297;--dhx-gantt-container-background: var(--dhx-gantt-base-colors-background);--dhx-gantt-container-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-offtime-background: var(--dhx-gantt-base-colors-background-alt);--dhx-gantt-scale-background: var(--dhx-gantt-container-background);--dhx-gantt-scale-border-vertical: 1px solid var(--dhx-gantt-base-colors-border-light);--dhx-gantt-scale-border-horizontal: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-grid-body-background: transparent;--dhx-gantt-grid-scale-background: var(--dhx-gantt-scale-background);--dhx-gantt-grid-scale-color: var(--dhx-gantt-scale-color);--dhx-gantt-grid-scale-border-vertical: var(--dhx-gantt-scale-border-vertical);--dhx-gantt-timeline-scale-background: var(--dhx-gantt-scale-background);--dhx-gantt-timeline-scale-color: var(--dhx-gantt-scale-color);--dhx-gantt-timeline-scale-border-vertical: var(--dhx-gantt-scale-border-vertical);--dhx-gantt-grid-cell-border: 1px solid transparent;--dhx-gantt-grid-row-border: var(--dhx-gantt-scale-border-horizontal);--dhx-gantt-base-transition: .2s ease;--dhx-gantt-box-shadow-s: 0px 4px 24px 0px rgba(44, 47, 60, .08);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-icon-size: 1.5em;--dhx-gantt-base-module: 4px;--dhx-gantt-base-padding: 4px;--dhx-gantt-border-radius: var(--dhx-gantt-base-module);--dhx-gantt-transition: all .3s;--dhx-gantt-default-border: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-header-border: var(--dhx-gantt-default-border);--dhx-gantt-task-blue: var(--dhx-gantt-base-colors-primary);--dhx-gantt-task-green: #20B56D;--dhx-gantt-task-violet: #D071EF;--dhx-gantt-task-yellow: linear-gradient(180deg, #FFB725 0%, #FFBB25 31.25%, #FAEA27 100%);--dhx-gantt-baseline-background-0: #00B4FF;--dhx-gantt-baseline-background-1: #DF6DE3;--dhx-gantt-baseline-background-2: #FF957D;--dhx-gantt-baseline-background-3: #25C79D;--dhx-gantt-baseline-background-4: #FF6FB0;--dhx-gantt-baseline-background-5: #FFC470;--dhx-gantt-baseline-background-6: #FDE720;--dhx-gantt-baseline-background-7: #47AFD0;--dhx-gantt-baseline-background-8: #DA9DFF;--dhx-gantt-baseline-background-9: #BEE964;--dhx-gantt-task-font-size: var(--dhx-gantt-regular-font-size);--dhx-gantt-task-line-height: var(--dhx-gantt-regular-line-height);--dhx-gantt-task-font-weight: var(--dhx-gantt-regular-font-weight);--dhx-gantt-task-background-primary: var(--dhx-gantt-base-colors-primary);--dhx-gantt-task-border-radius: var(--dhx-gantt-border-radius);--dhx-gantt-task-background: var(--dhx-gantt-task-blue);--dhx-gantt-task-border: none;--dhx-gantt-task-color: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-project-color: var(--dhx-gantt-task-color);--dhx-gantt-task-line-text: var(--dhx-gantt-container-color);--dhx-gantt-task-row-border: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-task-row-background: var(--dhx-gantt-container-background);--dhx-gantt-task-row-background--odd: var(--dhx-gantt-container-background);--dhx-gantt-task-progress-color: rgba(0, 0, 0, .15);--dhx-gantt-project-progress-color: var(--dhx-gantt-task-progress-color);--dhx-gantt-project-background: var(--dhx-gantt-task-green);--dhx-gantt-milestone-background: var(--dhx-gantt-task-violet);--dhx-gantt-task-marker-color: var(--dhx-gantt-task-background);--dhx-gantt-popup-background: var(--dhx-gantt-container-background);--dhx-gantt-popup-color: var(--dhx-gantt-container-color);--dhx-gantt-popup-border: none;--dhx-gantt-popup-border-radius: var(--dhx-gantt-border-radius);--dhx-gantt-tooltip-background: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-tooltip-color: var(--dhx-gantt-container-background);--dhx-gantt-tooltip-border: none;--dhx-gantt-tooltip-border-radius: var(--dhx-gantt-popup-border-radius);--dhx-gantt-link-background: var(--dhx-gantt-base-colors-icons);--dhx-gantt-link-background-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-link-critical-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-link-handle-offset: 8px;--dhx-gantt-link-handle-size: 10px;--dhx-gantt-link-handle-border: var(--dhx-gantt-base-colors-icons);--dhx-gantt-link-handle-border-hover: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-progress-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-progress-handle-background: var(--dhx-gantt-base-colors-icons);--dhx-gantt-progress-handle-background-hover: var(--dhx-gantt-base-colors-icons-hover);--dhx-gantt-control-height: 32px;--dhx-gantt-checkbox-height: 20px;--dhx-gantt-lightbox_font-family: var(--dhx-gantt-font-family);--dhx-gantt-lightbox-font-size: var(--dhx-gantt-important-font-size);--dhx-gantt-lightbox-font-weight: var(--dhx-gantt-important-font-weight);--dhx-gantt-lightbox-background: var(--dhx-gantt-popup-background);--dhx-gantt-lightbox-border: var(--dhx-gantt-popup-border);--dhx-gantt-lightbox-control-border: var(--dhx-gantt-default-border);--dhx-gantt-lightbox-color: var(--dhx-gantt-popup-color);--dhx-gantt-lightbox-padding: 12px;--dhx-gantt-lightbox-title-background: var(--dhx-gantt-base-colors-select);--dhx-gantt-lightbox-title-color: var(--dhx-gantt-lightbox-color);--dhx-gantt-lightbox-title-font-size: var(--dhx-gantt-heading-font-size);--dhx-gantt-lightbox-max-width: 622px;--dhx-gantt-lightbox-wide-max-width: 738px;--dhx-gantt-lightbox-width: 560px;--dhx-gantt-btn-order: row-reverse;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-base-colors-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-base-colors-disabled);--dhx-gantt-btn-outline-background: transparent;--dhx-gantt-btn-outline-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-outline-border-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-outline-background-hover: var(--dhx-gantt-base-colors-primary-lighter);--dhx-gantt-btn-outline-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-outline-border-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-outline-background-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-outline-color-active: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-outline-border-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-outline-background-disabled: transparent;--dhx-gantt-btn-outline-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-outline-border-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-text-transform: none;--dhx-gantt-info-background: var(--dhx-gantt-popup-background);--dhx-gantt-info-color: var(--dhx-gantt-popup-color);--dhx-gantt-info-border: var(--dhx-gantt-popup-border);--dhx-gantt-info-shadow: var(--dhx-gantt-box-shadow-m);--dhx-gantt-modal-background: var(--dhx-gantt-popup-background);--dhx-gantt-modal-color: var(--dhx-gantt-popup-color);--dhx-gantt-modal-border: var(--dhx-gantt-popup-border);--dhx-gantt-modal-padding: 16px;--dhx-gantt-modal-width: 320px;--dhx-gantt-modal-border-radius: var(--dhx-gantt-popup-border-radius);--dhx-gantt-undo-delete-background: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-undo-delete-color: var(--dhx-gantt-task-color)}:root[data-gantt-theme=dark]{--dhx-gantt-theme: dark;--dhx-gantt-base-colors-disabled: #3d3d3d;--dhx-gantt-base-colors-text-light: #AAA;--dhx-gantt-base-colors-text-base: rgba(255, 255, 255, .9);--dhx-gantt-base-colors-background: #141414;--dhx-gantt-base-colors-background-alt: #383838;--dhx-gantt-base-colors-border: #4B4B4B;--dhx-gantt-base-colors-border-light: #4B4B4B;--dhx-gantt-navline-font-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-base-colors-primary: #3B72F8;--dhx-gantt-base-colors-error: #EB284F;--dhx-gantt-base-colors-select: #2A2A2A;--dhx-gantt-base-colors-hover-color: #2A2A2A;--dhx-gantt-base-colors-icons: #AAAAAA;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #1B1B1C;--dhx-gantt-popup-border: 1px solid #4B4B4B;--dhx-gantt-btn-font-weight: 600;--dhx-gantt-undo-delete-background: var(--dhx-gantt-popup-background);--dhx-gantt-link-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-background)}:root[data-gantt-theme=meadow]{--dhx-gantt-theme: meadow;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-base-colors-select: #ffebbc;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-container-color: #3f3f3f;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-scale-background: #f4f2ea;--dhx-gantt-scale-color: #42464b;--dhx-gantt-task-color: #1e2022;--dhx-gantt-project-background: #c7d8f7;--dhx-gantt-milestone-background: #DB7DC5;--dhx-gantt-task-background: #e1ffd4;--dhx-gantt-task-border: 1px solid #3588c5;--dhx-gantt-task-progress-color: #a7d991;--dhx-gantt-project-progress-color: #9ab9f1;--dhx-gantt-link-background: #ffb96d;--dhx-gantt-lightbox-title-background: #f4f2ea;--dhx-gantt-popup-background: #fcfaf3;--dhx-gantt-popup-color: var(--dhx-gantt-container-color);--dhx-gantt-popup-border: 1px solid #cac8bd}:root[data-gantt-theme=skyblue]{--dhx-gantt-theme: skyblue;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-scale-background: #dfedff;--dhx-gantt-scale-color: #42464b;--dhx-gantt-task-color: #1e2022;--dhx-gantt-project-background: #eff6fb;--dhx-gantt-task-background: #eff6fb;--dhx-gantt-milestone-background: #DB7DC5;--dhx-gantt-task-border: 1px solid #3588c5;--dhx-gantt-task-progress-color: linear-gradient(0deg, #abcee8 0, #5aa0d3 36%, #bfdaee);--dhx-gantt-link-background: #4a8f43;--dhx-gantt-lightbox-title-background: #eff6fb}:root[data-gantt-theme=skyblue] .gantt_grid_scale,:root[data-gantt-theme=skyblue] .gantt_task_scale,:root[data-gantt-theme=skyblue] .gantt_task_vscroll{box-shadow:inset 0 1px 1px #fff;background-image:linear-gradient(to bottom,#e4f0ff,#dfedff,#d5e8ff)}:root[data-gantt-theme=broadway]{--dhx-gantt-theme: broadway;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-base-colors-select: #fff3a1;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-halfhour-border: 1px solid #e8e8e8;--dhx-gantt-task-title-font-size: 12px;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-grid-scale-background: #4f4f4f;--dhx-gantt-grid-scale-border-vertical: 1px solid #c1c1c1;--dhx-gantt-grid-scale-color: #e1e1e1;--dhx-gantt-timeline-scale-background: #dbdbdb;--dhx-gantt-timeline-scale-border-vertical: 1px solid #ebebeb;--dhx-gantt-timeline-scale-color: #494949;--dhx-gantt-grid-body-background: #dbdbdb;--dhx-gantt-lightbox-title-background: #4f4f4f;--dhx-gantt-lightbox-title-color: #e1e1e1;--dhx-gantt-task-color: #FFF;--dhx-gantt-link-background: #ffb96d;--dhx-gantt-project-background: #65c16f;--dhx-gantt-project-progress-color: #46ad51;--dhx-gantt-task-progress-color: #04a4f0;--dhx-gantt-task-background: #17b2fb;--dhx-gantt-milestone-background: #DB7DC5}:root[data-gantt-theme=broadway] .gantt_grid_data{--dhx-gantt-task-row-background: var(--dhx-gantt-grid-body-background);--dhx-gantt-task-row-background--odd: var(--dhx-gantt-grid-body-background)}:root[data-gantt-theme=material]{--dhx-gantt-theme: material;--dhx-gantt-font-family: Roboto, Inter, Helvetica, Arial, sans-serif;--dhx-gantt-base-colors-primary: #448aff;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-project-background: #1de9b6;--dhx-gantt-milestone-background: #ffc107;--dhx-gantt-task-progress-color: rgba(0, 0, 0, .2);--dhx-gantt-project-color: rgba(0, 0, 0, .6);--dhx-gantt-base-colors-border: #e0e0e0;--dhx-gantt-task-title-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-task-text-font-size: var(--dhx-gantt-font-size);--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 20px;--dhx-gantt-caption-font-size: var(--dhx-gantt-font-size);--dhx-gantt-caption-font-weight: 500;--dhx-gantt-btn-font-weight: 500;--dhx-gantt-heading-font-weight: 500;--dhx-gantt-hours-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-base-colors-text-base: rgba(0, 0, 0, .75);--dhx-gantt-base-transition: .15s ease;--dhx-gantt-header-border: 1px solid transparent;--dhx-gantt-scale-color: rgba(0, 0, 0, .54);--dhx-gantt-base-colors-select: rgba(0, 199, 181, .2);--dhx-gantt-base-colors-hover-color: var(--dhx-gantt-base-colors-select);--dhx-gantt-border-radius: 0;--dhx-gantt-task-border-radius: 18px;--dhx-gantt-btn-text-transform: uppercase;--dhx-gantt-btn-padding: 1px 20px 0;--dhx-gantt-link-handle-size: 16px;--dhx-gantt-progress-handle-background: #FFF;--dhx-gantt-progress-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-lightbox-title-background: var(--dhx-gantt-container-background);--dhx-gantt-lightbox-title-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-lightbox-title-font-size: calc(var(--dhx-gantt-font-size) + 2px);--dhx-gantt-lightbox-padding: 30px;--dhx-gantt-lightbox-width: 610px;--dhx-gantt-lightbox-wide-max-width: 640px;--dhx-gantt-btn-order: row;--dhx-gantt-btn-outline-border-color: transparent;--dhx-gantt-btn-outline-border-hover: transparent;--dhx-gantt-btn-outline-border-active: transparent;--dhx-gantt-btn-outline-border-color-disabled: transparent}:root[data-gantt-theme=material] .dhx_cal_ltitle{font-weight:400;text-transform:uppercase;padding:18px var(--dhx-gantt-lightbox-padding) 8px;border-bottom-color:transparent}:root[data-gantt-theme=material] .gantt_grid .gantt_grid_scale .gantt_grid_head_cell,:root[data-gantt-theme=material] .gantt_task .gantt_task_scale .gantt_scale_cell{font-weight:500;text-transform:uppercase}:root[data-gantt-theme=material] .dhx_cal_ltitle_controls{--dhx-gantt-base-colors-icons: var(--dhx-gantt-lightbox-title-color)}:root[data-gantt-theme=material] .gantt_cal_lsection{margin-top:12px;margin-bottom:4px}:root[data-gantt-theme=material] .gantt_cal_ltitle{padding:18px var(--dhx-gantt-lightbox-padding);border-bottom-color:transparent}:root[data-gantt-theme=material] .gantt_cal_lcontrols{padding-bottom:40px;padding-top:30px}:root[data-gantt-theme=material] .gantt_add,:root[data-gantt-theme=material] .gantt_grid_head_add{--dhx-gantt-base-colors-icons: #70d0c2;--dhx-gantt-base-colors-icons-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 12.6%);--dhx-gantt-base-colors-icons-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 28.5%)}:root[data-gantt-theme=material] .gantt_grid_data .gantt_row,:root[data-gantt-theme=material] .gantt_grid_data .gantt_row.odd{transition:background var(--dhx-gantt-base-transition)}:root[data-gantt-theme=material] .gantt_grid_head_cell{transition:border-color ground var(--dhx-gantt-base-transition);border-right:1px solid transparent}:root[data-gantt-theme=material] .gantt_grid_scale:hover .gantt_grid_head_cell{border-right:var(--dhx-gantt-grid-scale-border-vertical)}:root[data-gantt-theme=material] .gantt_grid_column_resize_wrap .gantt_grid_column_resize{transition:background var(--dhx-gantt-base-transition);background-color:transparent}:root[data-gantt-theme=material] .gantt_grid_column_resize_wrap:hover .gantt_grid_column_resize{background-color:var(--dhx-gantt-base-colors-border)}:root[data-gantt-theme=material] div.gantt_grid_scale:after,:root[data-gantt-theme=material] div.gantt_scale_line:last-child:after{content:"";width:100%;display:block;height:1px;background-color:transparent;position:absolute;box-shadow:0 1px 2px #0003,0 2px 3px #0000001a;z-index:1}:root[data-gantt-theme=material] div.gantt_scale_line:last-child:after{bottom:-1px}:root[data-gantt-theme=material] .gantt_link_control{--dhx-gantt-link-handle-border: var(--dhx-gantt-task-background);--dhx-gantt-link-handle-background: #FFF;--dhx-gantt-link-handle-border-hover: var(--dhx-gantt-task-background);--dhx-gantt-link-handle-background-hover: #FFF}:root[data-gantt-theme=material] .gantt_task_line.gantt_milestone{margin-top:-1px;--dhx-gantt-task-border-radius: 2px}:root[data-gantt-theme=contrast-white]{--dhx-gantt-theme: contrast-white;--dhx-gantt-base-colors-disabled: #C2C2C2;--dhx-gantt-base-colors-text-light: #303030;--dhx-gantt-base-colors-text-base: #303030;--dhx-gantt-base-colors-background: #FFFFFF;--dhx-gantt-base-colors-background-alt: #929292;--dhx-gantt-base-colors-border: #4D595B;--dhx-gantt-base-colors-border-light: #4D595B;--dhx-gantt-base-colors-text-on-fill: #FFF;--dhx-gantt-base-colors-primary: #0A47CD;--dhx-gantt-base-colors-text-on-fill: rgba(255, 255, 255, .9);--dhx-gantt-task-background: #0A47CD;--dhx-gantt-task-border: 1px solid rgba(0, 0, 0, .1);--dhx-gantt-base-colors-warning: #FCBA2E;--dhx-gantt-base-colors-success: #77D257;--dhx-gantt-base-colors-error: #ee3d31;--dhx-gantt-base-colors-error-text: #141414;--dhx-gantt-btn-color: #FFFFFF;--dhx-gantt-btn-color-hover: #FFFFFF;--dhx-gantt-btn-color-active: #FFFFFF;--dhx-gantt-base-colors-select: #E7E5E5;--dhx-gantt-base-colors-hover-color: #E7E5E5;--dhx-gantt-base-colors-icons: #303030;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #FFF;--dhx-gantt-popup-border: 1px solid #4D595B;--dhx-gantt-font-size: 16px;--dhx-gantt-heading-font-size: 24px;--dhx-gantt-important-font-size: 16px;--dhx-gantt-regular-font-size: 16px;--dhx-gantt-caption-font-size: 16px;--dhx-gantt-btn-outline-color-hover: #212121;--dhx-gantt-btn-outline-color-active: #FFFFFF}:root[data-gantt-theme=contrast-black]{--dhx-gantt-theme: contrast-black;--dhx-gantt-base-colors-disabled: #3d3d3d;--dhx-gantt-base-colors-text-light: #cfcfcf;--dhx-gantt-base-colors-text-base: #FFFFFF;--dhx-gantt-base-colors-background: #141414;--dhx-gantt-base-colors-background-alt: #4f4f4f;--dhx-gantt-base-colors-border: rgba(255, 255, 255, .8);--dhx-gantt-base-colors-border-light: rgba(255, 255, 255, .8);--dhx-gantt-base-colors-text-on-fill: #141414;--dhx-gantt-base-colors-primary: #A395FF;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-project-background: #77D257;--dhx-gantt-milestone-background: #FCBA2E;--dhx-gantt-task-background: #A395FF;--dhx-gantt-task-border: 1px solid rgba(0, 0, 0, .1);--dhx-gantt-base-colors-warning: #694E02;--dhx-gantt-base-colors-success: #115700;--dhx-gantt-base-colors-error: #FFA7A0;--dhx-gantt-base-colors-error-text: #141414;--dhx-gantt-base-colors-select: #2A2A2A;--dhx-gantt-base-colors-hover-color: #2A2A2A;--dhx-gantt-base-colors-icons: #AAAAAA;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #1B1B1C;--dhx-gantt-undo-delete-background: var(--dhx-gantt-popup-background);--dhx-gantt-undo-delete-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-popup-border: 1px solid #4B4B4B;--dhx-gantt-font-size: 16px;--dhx-gantt-heading-font-size: 24px;--dhx-gantt-important-font-size: 16px;--dhx-gantt-regular-font-size: 16px;--dhx-gantt-caption-font-size: 16px;--dhx-gantt-btn-outline-color-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-btn-outline-color-active: var(--dhx-gantt-base-colors-text-light)}.dhx_gantt_button--mixin{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.dhx_gantt_button--mixin:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.dhx_gantt_button--mixin:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.dhx_gantt_button--mixin:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.dhx_gantt_button_outline--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.dhx_gantt_button_danger--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_button_danger_outline--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-lighter);--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-base-colors-icons)}.dhx_gantt_button_danger_link--mixin{--dhx-gantt-icon-size: 18px;padding:6px 0;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_link--mixin{padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_icon--mixin{min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_icon--mixin:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.dhx_gantt_button_icon--mixin:active{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-active)}.dhx_gantt_button_icon--mixin:disabled{--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color-disabled)}.dhx_gantt_btn,.dhx_gantt_btn_danger,.dhx_gantt_btn_outline,.dhx_gantt_btn_danger_outline,.dhx_gantt_btn_danger_link,.gantt_qi_big_icon,.gantt_btn_set{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.dhx_gantt_btn:hover,.dhx_gantt_btn_danger:hover,.dhx_gantt_btn_outline:hover,.dhx_gantt_btn_danger_outline:hover,.dhx_gantt_btn_danger_link:hover,.gantt_qi_big_icon:hover,.gantt_btn_set:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.dhx_gantt_btn:active,.dhx_gantt_btn_danger:active,.dhx_gantt_btn_outline:active,.dhx_gantt_btn_danger_outline:active,.dhx_gantt_btn_danger_link:active,.gantt_qi_big_icon:active,.gantt_btn_set:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.dhx_gantt_btn:disabled,.dhx_gantt_btn_danger:disabled,.dhx_gantt_btn_outline:disabled,.dhx_gantt_btn_danger_outline:disabled,.dhx_gantt_btn_danger_link:disabled,.gantt_qi_big_icon:disabled,.gantt_btn_set:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_popup_button{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.gantt_popup_button:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.gantt_popup_button:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.gantt_popup_button:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_popup_button:not(.gantt_ok_button){--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.gantt_ok_button{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_btn_outline,.dhx_gantt_btn_danger_outline{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.dhx_gantt_button_danger,.dhx_gantt_button_danger_outline{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_button_link,.gantt_qi_big_icon{padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}@font-face{font-family:dhx-gantt-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAc4AAsAAAAADHgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQQAAAGA9+E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9ECmpAQ0//coJFsevWlK+5rlfv4MabQzczNdF1Z9XOroMHqXQ2mj0c/S/Ky9dcuaB0wZXdu/mXbDq5KZ3ouqtqV9dBlefsG9MHdo1T/+tMZtO45eOGv/hx7OPW4seKSY9VBwrkIL6+5s555u0D27cFg2//646/fPNH8UD88vjP+/dff32xKqlHD/zAstSB//l/82PFjw0T+/Urzl8H32THjRw57pYJ8yKfqE/VJ5F5LKvNj2V/bfylI9YQ6/il8ddsbOCjtbdsuvzccrv4y5rOl0Vrvyyu2e2tsb9b1q8sWXb1qCR5rMitEvIZyY21p2b7D5pDkDvBOQkZpuNiSDThpNhVcQfEAz7eJVhqJUvcNzxmyS9PKwIc4F4oygL8KkUknJXoW/t9+GqsER4ZuuG4V0sUYFn946ugd6upTcOL4cYLNGGGU+VyUvtO5p8mpqJl0ZuM2wN7KgxEtCiXfHGWNACFAnKIhDDv7jZBCDWuCAYeQnPZnCo2aktfb3WhucLqJkQXq6KVgZtr8lmMiVg+hAq2GVaDIFmrSQXPqy39t1YXNsesbipEWRUpafpImgu/ZIV2W257FMn9SJi+wc6hZ0Vrma/+gZMnVHVRKZ/iBAjcC2g17CotthExyjBFdSQUCIHUxHSGUQonMh3K0ri3VIwUM+22HNujSI4fCdM34J059NysAxV1/4GTT7yjqCmomqtPBLs49wI6ZtiHMWkxSePGGFXUZYqKYzemoRykTDGZ1POdYZQC1yFnOlBavZmmpNixEh/5ocCfyj6IiCGmWOISt3jEK77P6Gp+CUhQQhKWiORxd520raat1vbMtLa6GBxvlBPN06Xr4hgowac/M2ES7j1KG8AY3tEkAvqjgQcTBa+/7Ez21ukZ0GfCRv5duaohgMCjwnckqV2AxY99uCiZzhDH2zgtAs5nqM+7jeyue72MVL7XpDegKczprSLTjBr0pW5bT2nxETjLAAA=) format("woff2")}.dhx_gantt_icon:before,.dhx_menu_icon:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.dhx_gantt_icon.dhx_gantt_icon_arrow_down:before,.dhx_menu_icon.dhx_gantt_icon_arrow_down:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_arrow_up:before,.dhx_menu_icon.dhx_gantt_icon_arrow_up:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_close:before,.dhx_menu_icon.dhx_gantt_icon_close:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_left_dotted:before,.dhx_menu_icon.dhx_gantt_icon_constraint_left_dotted:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_left_solid:before,.dhx_menu_icon.dhx_gantt_icon_constraint_left_solid:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_right_dotted:before,.dhx_menu_icon.dhx_gantt_icon_constraint_right_dotted:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_right_solid:before,.dhx_menu_icon.dhx_gantt_icon_constraint_right_solid:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_delete:before,.dhx_menu_icon.dhx_gantt_icon_delete:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_dots_vertical:before,.dhx_menu_icon.dhx_gantt_icon_dots_vertical:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_edit:before,.dhx_menu_icon.dhx_gantt_icon_edit:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_menu_down:before,.dhx_menu_icon.dhx_gantt_icon_menu_down:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_menu_right:before,.dhx_menu_icon.dhx_gantt_icon_menu_right:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_minus:before,.dhx_menu_icon.dhx_gantt_icon_minus:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_plus:before,.dhx_menu_icon.dhx_gantt_icon_plus:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_rounded_arrow_right:before,.dhx_menu_icon.dhx_gantt_icon_rounded_arrow_right:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_timer:before,.dhx_menu_icon.dhx_gantt_icon_timer:before{content:""}.gantt_container{background:var(--dhx-gantt-container-background);color:var(--dhx-gantt-container-color);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);border:1px solid var(--dhx-gantt-base-colors-border);position:relative;white-space:nowrap;overflow-x:hidden;overflow-y:hidden}.gantt_touch_active{overscroll-behavior:none}.gantt_task_scroll{overflow-x:scroll}.gantt_task,.gantt_grid{position:relative;overflow-x:hidden;overflow-y:hidden;display:inline-block;vertical-align:top}.gantt_grid_scale,.gantt_task_scale{font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);border-bottom:var(--dhx-gantt-scale-border-horizontal);box-sizing:border-box}.gantt_grid_scale{background:var(--dhx-gantt-grid-scale-background);color:var(--dhx-gantt-grid-scale-color)}.gantt_task_scale{background:var(--dhx-gantt-timeline-scale-background);color:var(--dhx-gantt-timeline-scale-color)}.gantt_task_vscroll{background:var(--dhx-gantt-container-background)}.gantt_scale_line{box-sizing:border-box;border-top:var(--dhx-gantt-scale-border-horizontal)}.gantt_scale_line:first-child{border-top:none}.gantt_grid_head_cell{display:inline-block;vertical-align:top;border-right:var(--dhx-gantt-grid-scale-border-vertical);text-align:center;position:relative;cursor:default;height:100%;box-sizing:border-box;overflow:hidden}.gantt_scale_line{clear:both}.gantt_grid_data{width:100%;overflow:hidden;position:relative;background:var(--dhx-gantt-grid-body-background)}.gantt_row{position:relative;-webkit-user-select:none;user-select:none}.gantt_add,.gantt_grid_head_add{width:100%;height:100%;cursor:pointer;position:relative;opacity:.6}.gantt_add:before,.gantt_grid_head_add:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_add:before,.gantt_grid_head_add:before{content:""}.gantt_grid_head_cell.gantt_grid_head_add{opacity:.6;top:0}.gantt_grid_head_cell.gantt_grid_head_add:hover{opacity:1}.gantt_grid_data .gantt_row:hover,.gantt_grid_data .gantt_row.odd:hover{background-color:var(--dhx-gantt-base-colors-hover-color)}.gantt_grid_data .gantt_row:hover .gantt_add{opacity:1}.gantt_task_row,.gantt_row{border-bottom:var(--dhx-gantt-task-row-border);background:var(--dhx-gantt-task-row-background)}.gantt_row.odd,.gantt_task_row.odd{background:var(--dhx-gantt-task-row-background--odd)}.gantt_row,.gantt_cell,.gantt_task_row,.gantt_task_cell,.gantt_grid_head_cell,.gantt_scale_cell{box-sizing:border-box}.gantt_grid_head_cell,.gantt_scale_cell{line-height:inherit}.gantt_grid_scale .gantt_grid_column_resize_wrap{cursor:col-resize;position:absolute;width:13px;margin-left:-7px}.gantt_grid_column_resize_wrap .gantt_grid_column_resize{background-color:var(--dhx-gantt-base-colors-border);height:100%;width:1px;margin:0 auto}.gantt_task_grid_row_resize_wrap{cursor:row-resize;position:absolute;height:13px;margin-top:-7px;left:0;width:100%}.gantt_task_grid_row_resize_wrap .gantt_task_grid_row_resize{background-color:var(--dhx-gantt-base-colors-border-light);top:6px;height:1px;width:100%;margin:0 auto;position:relative}.gantt_drag_marker{pointer-events:none}.gantt_drag_marker.gantt_grid_resize_area,.gantt_drag_marker.gantt_row_grid_resize_area{background-color:#e7e7e780;height:100%;width:100%}.gantt_drag_marker.gantt_grid_resize_area{border-left:var(--dhx-gantt-scale-border-vertical);border-right:var(--dhx-gantt-scale-border-vertical)}.gantt_drag_marker.gantt_row_grid_resize_area{border-top:var(--dhx-gantt-scale-border-horizontal);border-bottom:var(--dhx-gantt-scale-border-horizontal)}.gantt_row{display:flex}.gantt_row>div{flex-shrink:0;flex-grow:0}.gantt_cell{vertical-align:top;border-right:var(--dhx-gantt-grid-cell-border);padding-left:6px;padding-right:6px;height:100%;overflow:hidden;white-space:nowrap}.gantt_cell_tree{display:flex;gap:4px;flex-wrap:nowrap}.gantt_grid_scale .gantt_last_cell,.gantt_grid_data .gantt_last_cell,.gantt_task .gantt_task_scale .gantt_scale_cell.gantt_last_cell,.gantt_task_bg .gantt_last_cell{border-right-width:0px}.gantt_task .gantt_task_scale .gantt_scale_cell.gantt_last_cell{border-right-width:1px}.gantt_task_bg{overflow:hidden}.gantt_scale_cell{position:relative;display:inline-block;white-space:nowrap;overflow:hidden;border-right:var(--dhx-gantt-grid-scale-border-vertical);text-align:center;height:100%}.gantt_task_cell{display:inline-block;height:100%;border-right:var(--dhx-gantt-timeline-scale-border-vertical)}.gantt_layout_cell.gantt_ver_scroll{width:0px;background-color:transparent;height:1px;overflow-x:hidden;overflow-y:scroll;position:absolute;right:0;z-index:1}.gantt_ver_scroll>div{width:1px;height:1px}.gantt_hor_scroll{height:0px;background-color:transparent;width:100%;clear:both;overflow-x:scroll;overflow-y:hidden}.gantt_layout_cell .gantt_hor_scroll{position:absolute}.gantt_hor_scroll>div{width:5000px;height:1px}.gantt_tree_indent,.gantt_tree_icon{flex-grow:0;flex-shrink:0}.gantt_tree_indent{width:15px;height:100%}.gantt_tree_content,.gantt_tree_icon{vertical-align:top}.gantt_tree_icon{width:28px;height:100%;background-repeat:no-repeat;background-position:center center}.gantt_tree_content{height:100%;white-space:nowrap;min-width:0;overflow:hidden;width:auto;text-overflow:ellipsis}.gantt_tree_icon.gantt_open,.gantt_tree_icon.gantt_close{width:20px;cursor:pointer}.gantt_tree_icon.gantt_open:before,.gantt_tree_icon.gantt_close:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_tree_icon.gantt_open:before{content:""}.gantt_tree_icon.gantt_close:before{content:""}.gantt_tree_icon.gantt_blank{width:18px}.gantt_tree_icon.gantt_folder_open,.gantt_tree_icon.gantt_folder_closed,.gantt_tree_icon.gantt_file{display:none}.gantt_grid_head_cell .gantt_sort{position:absolute;right:5px;top:0;width:7px;height:13px}.gantt_grid_head_cell .gantt_sort.gantt_asc:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_grid_head_cell .gantt_sort.gantt_asc:before{content:""}.gantt_grid_head_cell .gantt_sort.gantt_desc:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_grid_head_cell .gantt_sort.gantt_desc:before{content:""}.gantt_inserted,.gantt_updated{font-weight:700}.gantt_deleted{text-decoration:line-through}.gantt_invalid{background-color:#ffe0e0}.gantt_error{color:var(--dhx-gantt-base-colors-error)}.gantt_status{right:1px;padding:5px 10px;background:#9b9b9b1a;position:absolute;top:1px;transition:opacity .2s;opacity:0}.gantt_status.gantt_status_visible{opacity:1}#gantt_ajax_dots span{transition:opacity .2s;background-repeat:no-repeat;opacity:0}#gantt_ajax_dots span.gantt_dot_visible{opacity:1}.gantt_column_drag_marker{border:var(--dhx-gantt-grid-scale-border-vertical);opacity:.8;pointer-events:none}.gantt_grid_head_cell_dragged{border:var(--dhx-gantt-grid-scale-border-vertical);opacity:.3}.gantt_grid_target_marker{position:absolute;top:0;width:2px;height:100%;background-color:var(--dhx-gantt-base-colors-primary);transform:translate(-1px)}.gantt_grid_target_marker:before,.gantt_grid_target_marker:after{display:block;content:"";position:absolute;left:-5px;width:0px;height:0px;border:6px solid transparent}.gantt_grid_target_marker:before{border-top-color:var(--dhx-gantt-base-colors-primary)}.gantt_grid_target_marker:after{bottom:0;border-bottom-color:var(--dhx-gantt-base-colors-primary)}.gantt_message_area{position:fixed;right:5px;width:320px;z-index:1000}.gantt-info{min-width:120px;padding:12px;font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);font-weight:var(--dhx-gantt-regular-font-weight);line-height:var(--dhx-gantt-regular-line-height);z-index:14;overflow:hidden;margin:5px 5px 10px;transition:all .5s ease;background:var(--dhx-gantt-info-background);color:var(--dhx-gantt-info-color);border:var(--dhx-gantt-info-border);box-shadow:var(--dhx-gantt-info-shadow)}.gantt-info.hidden{height:0px;padding:0;border-width:0px;margin:0;overflow:hidden}.gantt_modal_box{overflow:hidden;position:fixed;min-width:300px;width:var(--dhx-gantt-modal-width);background:var(--dhx-gantt-modal-background);box-shadow:var(--dhx-gantt-box-shadow-l);border:var(--dhx-gantt-modal-border);z-index:18;border-radius:var(--dhx-gantt-modal-border-radius);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);color:var(--dhx-gantt-popup-color);line-height:150%}.gantt_popup_title{border-top-left-radius:var(--dhx-gantt-modal-border-radius);border-top-right-radius:var(--dhx-gantt-modal-border-radius);text-transform:uppercase;font-weight:var(--dhx-gantt-heading-font-weight);padding:calc(var(--dhx-gantt-modal-padding)/2) var(--dhx-gantt-modal-padding);display:flex;justify-content:center;align-items:center}.gantt_popup_text{padding:var(--dhx-gantt-modal-padding);display:flex;justify-content:center;align-items:center}.gantt_popup_controls{display:flex;flex-direction:var(--dhx-gantt-btn-order);padding:calc(var(--dhx-gantt-modal-padding)/2) var(--dhx-gantt-modal-padding);align-items:center;gap:12px}.gantt-info,.gantt_popup_button,.gantt_button{-webkit-user-select:none;user-select:none;cursor:pointer}.gantt_popup_text{overflow:hidden}div.dhx_modal_cover{background:#44494e;opacity:.2;position:fixed;z-index:17;left:0;top:0;width:100%;height:100%;border:none}.gantt_popup_controls{border-radius:var(--dhx-gantt-border-radius)}.gantt_message_area .gantt-error{--dhx-gantt-info-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-info-color: var(--dhx-gantt-base-colors-text-on-fill)}.gantt_message_area .gantt-warning{--dhx-gantt-info-background: var(--dhx-gantt-base-colors-warning);--dhx-gantt-info-color: var(--dhx-gantt-base-colors-text-on-fill)}.gantt_grid div,.gantt_data_area div{-ms-touch-action:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.gantt_data_area{position:relative;overflow-x:hidden;overflow-y:hidden;-webkit-user-select:none;user-select:none}.gantt_links_area{position:absolute;left:0;top:0}.gantt_task_content,.gantt_task_progress,.gantt_side_content{line-height:inherit;overflow:hidden;height:100%}.gantt_task_content{font-size:var(--dhx-gantt-task-font-size);color:var(--dhx-gantt-task-color);width:100%;padding-top:1px;top:0;cursor:pointer;position:absolute;white-space:nowrap;text-align:center}.gantt_task_progress{text-align:center;z-index:0;background:var(--dhx-gantt-task-progress-color)}.gantt_task_progress_wrapper{border-radius:inherit;position:relative;width:100%;height:100%;overflow:hidden}.gantt_task_line{border-radius:var(--dhx-gantt-task-border-radius);position:absolute;box-sizing:border-box;background:var(--dhx-gantt-task-background);border:var(--dhx-gantt-task-border);-webkit-user-select:none;user-select:none}.gantt_task_line.gantt_drag_move div{cursor:move}.gantt_touch_move,.gantt_touch_progress,.gantt_touch_resize{transform:scale(1.02,1.1);transform-origin:50%}.gantt_touch_progress .gantt_task_progress_drag,.gantt_touch_resize .gantt_task_drag{transform:scaleY(1.3);transform-origin:50%}.gantt_side_content{position:absolute;white-space:nowrap;color:var(--dhx-gantt-base-colors-text-light);top:0;font-size:calc(var(--dhx-gantt-task-font-size) - 1px)}.gantt_side_content.gantt_left{right:100%;padding-right:var(--dhx-gantt-base-padding)}.gantt_side_content.gantt_right{left:100%;padding-left:var(--dhx-gantt-base-padding)}.gantt_side_content.gantt_link_crossing{margin-top:-6px}.gantt_task_link .gantt_line_wrapper,.gantt_link_arrow,.gantt_link_corner{position:absolute;cursor:pointer}.gantt_line_wrapper div{background-color:var(--dhx-gantt-link-background)}.gantt_link_corner{box-sizing:content-box!important;border-color:var(--dhx-gantt-link-background);background-color:transparent}.gantt_task_link:hover{--dhx-gantt-link-background: var(--dhx-gantt-link-background-hover)}.gantt_task_link div.gantt_link_arrow{color:var(--dhx-gantt-link-background)}.gantt_task_link div.gantt_link_arrow:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_task_link div.gantt_link_arrow:before{content:""}.gantt_link_control{position:absolute;width:calc(var(--dhx-gantt-link-handle-offset) + var(--dhx-gantt-link-handle-size));top:50%;display:flex;align-items:center;transition:all var(--dhx-gantt-base-transition)}.gantt_link_control div{display:none;cursor:pointer;box-sizing:border-box;position:relative;border:2px solid var(--dhx-gantt-link-handle-border);border-radius:50%;height:var(--dhx-gantt-link-handle-size);width:var(--dhx-gantt-link-handle-size);background:var(--dhx-gantt-link-handle-background)}.gantt_link_control div:hover{--dhx-gantt-link-handle-background: var(--dhx-gantt-link-handle-background-hover);--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover)}.gantt_link_control.task_left{transform:translate(-100%,-50%);left:0;justify-content:flex-start}.gantt_link_control.task_right{transform:translate(100%,-50%);right:0;justify-content:flex-end}.gantt_task_line.gantt_link_source .gantt_link_control div,.gantt_task_line.gantt_selected .gantt_link_control div,.gantt_task_line:hover .gantt_link_control div,.gantt_task_line.gantt_drag_move .gantt_link_control div,.gantt_task_line.gantt_drag_resize .gantt_link_control div,.gantt_task_line.gantt_link_source .gantt_task_drag,.gantt_task_line.gantt_selected .gantt_task_drag,.gantt_task_line:hover .gantt_task_drag,.gantt_task_line.gantt_drag_move .gantt_task_drag,.gantt_task_line.gantt_drag_resize .gantt_task_drag{display:block}.gantt_task_line.gantt_selected .gantt_task_progress_drag,.gantt_task_line:hover .gantt_task_progress_drag,.gantt_task_line.gantt_drag_progress .gantt_task_progress_drag{display:flex}.gantt_link_target .gantt_link_control div{display:block}.gantt_link_source,.gantt_link_target{box-shadow:0 0 3px var(--dhx-gantt-base-colors-primary)}.gantt_link_target.link_start_allow,.gantt_link_target.link_finish_allow{box-shadow:0 0 3px var(--dhx-gantt-base-colors-success)}.gantt_link_target.link_start_deny,.gantt_link_target.link_finish_deny{box-shadow:0 0 3px var(--dhx-gantt-base-colors-error)}.gantt_link_from_start .gantt_link_control.task_start_date div,.gantt_link_from_end .gantt_link_control.task_end_date div,.link_start_allow .gantt_link_control.task_start_date div,.link_finish_allow .gantt_link_control.task_end_date div{--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-primary)}.link_start_deny .gantt_link_control.task_start_date div,.link_finish_deny .gantt_link_control.task_end_date div{--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-error)}.gantt_link_arrow_left{transform:rotate(180deg)}.gantt_task_drag,.gantt_task_progress_drag{cursor:ew-resize;display:none;position:absolute}.gantt_task_drag.task_right{cursor:e-resize}.gantt_task_drag.task_left{cursor:w-resize}.gantt_task_drag{height:16px;width:8px;z-index:1;top:-1px}.gantt_task_drag.task_left{left:-7px}.gantt_task_drag.task_right{right:-7px}.gantt_task_progress_drag{height:70%;min-height:12px;bottom:-3px;transform:translate(-50%);z-index:1;align-items:flex-end}.gantt_task_progress_drag:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.gantt_link_tooltip{box-shadow:3px 3px 3px #0003;background-color:var(--dhx-gantt-popup-background);border-left:1px solid var(--dhx-gantt-base-colors-border);border-top:1px solid var(--dhx-gantt-base-colors-border);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);color:var(--dhx-gantt-popup-color);padding:var(--dhx-gantt-base-padding);line-height:var(--dhx-gantt-regular-line-height)}.gantt_link_direction{height:0px;border:none;border-bottom:2px dashed var(--dhx-gantt-base-colors-primary);transform-origin:0% 0%;z-index:2;margin-left:1px;position:absolute}.gantt_grid_data .gantt_row.gantt_selected,.gantt_grid_data .gantt_row.odd.gantt_selected{background-color:var(--dhx-gantt-base-colors-select)}.gantt_row_project{font-weight:500}.gantt_task_row.odd.gantt_selected,.gantt_task_row.gantt_selected{background-color:var(--dhx-gantt-base-colors-select)}.gantt_task_line.gantt_selected{box-shadow:var(--dhx-gantt-box-shadow-s)}.gantt_cal_quick_info.gantt_project,.gantt_task_line.gantt_project{--dhx-gantt-task-color: var(--dhx-gantt-project-color);--dhx-gantt-task-background: var(--dhx-gantt-project-background);--dhx-gantt-task-progress-color: var(--dhx-gantt-project-progress-color)}.gantt_task_line.gantt_project.gantt_task_line_planned{--dhx-gantt-task-background: var(--dhx-gantt-base-colors-text-light)}.gantt_task_line_planned{--dhx-gantt-scheduled-summary-bracket-size: 8px}.gantt_task_line_planned:before,.gantt_task_line_planned:after{content:"";position:absolute;top:0;width:0;height:0;border-style:solid;border-color:transparent}.gantt_task_line_planned:before{border-width:var(--dhx-gantt-scheduled-summary-bracket-size) var(--dhx-gantt-scheduled-summary-bracket-size) 0 0;border-right-color:var(--dhx-gantt-task-background);transform:rotate(180deg)}.gantt_task_line_planned:after{border-width:0 var(--dhx-gantt-scheduled-summary-bracket-size) var(--dhx-gantt-scheduled-summary-bracket-size) 0;border-right-color:var(--dhx-gantt-task-background);right:0}.gantt_task_line_actual{opacity:.3;--dhx-gantt-task-border-radius: 2px}.gantt_task_line.gantt_project.gantt_project_scheduling_conflict .gantt_task_line_actual{--dhx-gantt-task-background: var(--dhx-gantt-base-colors-error)}.gantt_task_line.gantt_project.gantt_selected{box-shadow:var(--dhx-gantt-box-shadow-s)}.gantt_task_line.gantt_milestone{--dhx-gantt-task-background: var(--dhx-gantt-milestone-background);visibility:hidden;border:none;box-sizing:content-box}.gantt_task_line.gantt_milestone div{visibility:visible}.gantt_task_line.gantt_milestone .gantt_task_content{background:inherit;border:inherit;border-width:1px;border-radius:inherit;box-sizing:border-box;transform:rotate(45deg)}.gantt_task_line.gantt_task_inline_color{border-color:var(--dhx-gantt-task-background)}.gantt_task_line.gantt_task_inline_color .gantt_task_progress{background-color:var(--dhx-gantt-task-background);opacity:.2}.gantt_task_line.gantt_task_inline_color.gantt_selected,.gantt_task_line.gantt_task_inline_color.gantt_project.gantt_selected{box-shadow:0 0 5px var(--dhx-gantt-task-background)}.gantt_task_link.gantt_link_inline_color:hover .gantt_line_wrapper div{box-shadow:0 0 5px 0 var(--dhx-gantt-task-background)}.gantt_critical_task{--dhx-gantt-task-background: var(--dhx-gantt-link-critical-background)}.gantt_critical_task .gantt_task_progress{--dhx-gantt-task-progress: rgba(0, 0, 0, .4)}.gantt_critical_link{--dhx-gantt-link-background: var(--dhx-gantt-link-critical-background)}.gantt_link_arrow{--dhx-gantt-base-colors-icons: var(--dhx-gantt-link-background)}.gantt_row:focus,.gantt_cell:focus,.gantt_btn_set:focus,.gantt_qi_big_icon:focus,.gantt_popup_button:focus,.gantt_grid_head_cell:focus{box-shadow:inset 0 0 1px 1px var(--dhx-gantt-base-colors-primary)}.gantt_split_parent,.gantt_split_subproject{opacity:.1;pointer-events:none}.gantt_rollup_child .gantt_link_control,.gantt_rollup_child:hover .gantt_link_control{display:none}.gantt_unselectable,.gantt_unselectable div{-webkit-user-select:none;user-select:none}.gantt_common_input{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.gantt_common_input:focus,.gantt_common_input:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_common_input:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_one_line_input{height:var(--dhx-gantt-control-height)}.gantt_cal_cover,.gantt_cal_cover *{box-sizing:border-box}.gantt_cal_light{margin-top:auto;margin-bottom:auto;min-width:var(--dhx-gantt-lightbox-width);width:max-content;max-width:var(--dhx-gantt-lightbox-max-width);height:auto;-webkit-tap-highlight-color:transparent;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);position:absolute;z-index:15;font-family:var(--dhx-gantt-lightbox_font-family);font-size:var(--dhx-gantt-lightbox-font-size);font-weight:var(--dhx-gantt-lightbox-font-weight);line-height:142%;border:var(--dhx-gantt-lightbox-border);border-radius:var(--dhx-gantt-popup-border-radius)}.gantt_cal_light.gantt_cal_light_wide{--dhx-gantt-lightbox-width: var(--dhx-gantt-lightbox-wide-max-width);--dhx-gantt-lightbox-max-width: var(--dhx-gantt-lightbox-wide-max-width)}.gantt_cal_light textarea,.gantt_cal_light input,.gantt_cal_light select{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.gantt_cal_light textarea:focus,.gantt_cal_light input:focus,.gantt_cal_light select:focus,.gantt_cal_light textarea:focus-visible,.gantt_cal_light input:focus-visible,.gantt_cal_light select:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_cal_light textarea:disabled,.gantt_cal_light input:disabled,.gantt_cal_light select:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_cal_light input,.gantt_cal_light select{height:var(--dhx-gantt-control-height)}.gantt_cal_light input[type=select],.gantt_cal_light input[type=checkbox]{height:var(--dhx-gantt-checkbox-height)}.gantt_cal_light .gantt_time{display:none}.gantt_cal_ltitle{font-size:var(--dhx-gantt-lightbox-title-font-size);font-weight:var(--dhx-gantt-heading-font-weight);line-height:142%;background:var(--dhx-gantt-lightbox-title-background);color:var(--dhx-gantt-lightbox-title-color);border-bottom:var(--dhx-gantt-default-border);padding:calc(var(--dhx-gantt-base-padding) * 3) var(--dhx-gantt-lightbox-padding);overflow:hidden;white-space:nowrap;display:flex;flex-direction:row;justify-content:space-between;gap:calc(var(--dhx-gantt-base-padding) * 2);border-top-right-radius:var(--dhx-gantt-popup-border-radius);border-top-left-radius:var(--dhx-gantt-popup-border-radius)}.gantt_cal_ltitle .gantt_mark{display:none}.gantt_cal_ltitle .gantt_cal_ltitle_descr{overflow:hidden;text-overflow:ellipsis}.gantt_cal_ltitle .gantt_cal_ltitle_controls{cursor:pointer;--dhx-gantt-icon-size: 18px}.gantt_cal_light_rtl{direction:rtl}.gantt_cal_light_wide.gantt_cal_light_rtl .gantt_custom_button{right:auto;left:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_section_constraint [data-constraint-time-select]{margin-left:20px}.gantt_cal_larea{border:none;padding:0 var(--dhx-gantt-lightbox-padding) 4px;overflow:hidden;height:auto;gap:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_cal_cover{width:100%;height:100%;position:fixed;z-index:16;top:0;left:0;background-color:#0000004d;display:flex;justify-content:center;align-items:center;overflow:auto}.gantt_lightbox_time_select{min-width:80px}.gantt_lightbox_day_select{min-width:60px}.gantt_lightbox_month_select{min-width:110px}.gantt_lightbox_year_select{min-width:77px}.gantt_cal_light_full{width:auto}.gantt_cal_light_wide .gantt_cal_larea{display:flex;flex-direction:column;padding-top:12px;gap:12px}.gantt_cal_light_wide .gantt_wrap_section{display:flex;flex:0;position:relative}.gantt_cal_light_wide .gantt_cal_lsection{width:120px;justify-content:start;align-items:start;flex-shrink:0;margin-top:0;margin-bottom:0;padding:4px 8px}.gantt_cal_light_wide .gantt_custom_button{position:absolute;left:auto;right:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_cal_light_wide .gantt_cal_ltext{flex:1}.gantt_cal_light_wide .gantt_section_time{justify-content:start}.gantt_cal_light_wide .gantt_fullday{margin-left:unset}.gantt_duration{display:flex;justify-content:flex-start;align-items:center;gap:4px}.gantt_duration .gantt_duration_end_date{color:var(--dhx-gantt-base-colors-text-light);min-width:130px}.gantt_duration .gantt_duration_value,.gantt_duration .gantt_duration_dec,.gantt_duration .gantt_duration_inc{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0;text-align:center}.gantt_duration .gantt_duration_value:focus,.gantt_duration .gantt_duration_dec:focus,.gantt_duration .gantt_duration_inc:focus,.gantt_duration .gantt_duration_value:focus-visible,.gantt_duration .gantt_duration_dec:focus-visible,.gantt_duration .gantt_duration_inc:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_duration .gantt_duration_value:disabled,.gantt_duration .gantt_duration_dec:disabled,.gantt_duration .gantt_duration_inc:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_duration_inputs{display:flex}.gantt_duration .gantt_duration_value{width:40px;padding:3px 4px;border-left-width:0;border-right-width:0;border-radius:0}.gantt_duration .gantt_duration_value.gantt_duration_value_formatted{width:70px}.gantt_duration .gantt_duration_dec,.gantt_duration .gantt_duration_inc{width:26px;padding:1px 4px;color:var(--dhx-gantt-base-colors-primary);font-size:18px;border-radius:var(--dhx-gantt-border-radius);cursor:pointer}.gantt_duration .gantt_duration_dec{border-top-right-radius:0;border-bottom-right-radius:0}.gantt_duration .gantt_duration_inc{border-top-left-radius:0;border-bottom-left-radius:0}.gantt_duration .gantt_duration_inc{margin-right:4px}.gantt_resources{max-height:150px;height:auto;overflow-y:auto}.gantt_resource_row{display:block;padding:10px 0;border-bottom:1px solid var(--dhx-gantt-base-colors-border-light);cursor:pointer}.gantt_resource_row input[type=checkbox]:not(:checked),.gantt_resource_row input[type=checkbox]:not(:checked)~div{opacity:.5}.gantt_resource_toggle{vertical-align:middle}.gantt_section_resources{overflow:hidden;display:flex;flex-direction:column;width:100%}.gantt_resources_filter{display:flex;flex-grow:0;align-items:center}.gantt_resources_filter label{display:inline-flex;gap:2px;align-items:center}.gantt_resources_filter .gantt_resources_filter_input{padding:1px 6px;box-sizing:border-box}.gantt_resources_filter .switch_unsetted{vertical-align:middle}.gantt_resource_cell{display:inline-block}.gantt_resource_cell.gantt_resource_cell_checkbox{width:24px;max-width:24px;min-width:24px;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_label{width:40%;max-width:40%;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_value{width:30%;max-width:30%;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_value input,.gantt_resource_cell.gantt_resource_cell_value select{width:80%;vertical-align:middle;padding:1px 2px;box-sizing:border-box}.gantt_resource_cell.gantt_resource_cell_unit{width:10%;max-width:10%;vertical-align:middle}.gantt_resource_early_value{opacity:.8;font-size:.9em}.gantt_cal_lcontrols{display:flex;flex-direction:var(--dhx-gantt-btn-order);gap:calc(var(--dhx-gantt-base-padding)*2);padding:12px var(--dhx-gantt-lightbox-padding)}.gantt_cal_lcontrols .gantt_btn_set{display:flex;flex-direction:row;gap:var(--dhx-gantt-base-padding)}.gantt_cal_lcontrols .gantt_btn_set.gantt_delete_btn_set{--dhx-gantt-icon-size: 18px;padding:6px 0;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.gantt_cal_lcontrols .gantt_btn_set:not(.gantt_save_btn_set,.gantt_delete_btn_set){--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.gantt_cal_lcontrols .gantt_btn_set .gantt_btn_inner{display:none}.gantt_cal_lcontrols .gantt_btn_set .gantt_delete_btn:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_cal_lcontrols .gantt_btn_set .gantt_delete_btn:before{content:""}.gantt_cal_lcontrols .gantt_cal_lcontrols_push_right{margin-left:auto}.gantt_cal_ltext textarea{width:100%;height:100%;resize:none;font-family:var(--dhx-gantt-lightbox_font-family);font-size:var(--dhx-gantt-lightbox-font-size);font-weight:var(--dhx-gantt-lightbox-font-weight);line-height:142%}.gantt_section_time_spacer,.gantt_lightbox_minical_spacer{visibility:hidden;height:0;flex-basis:100%}.gantt_section_time{--dhx-gantt-lightbox-time-font-size: var(--dhx-gantt-important-font-size);--dhx-gantt-lightbox-time-font-weight: var(--dhx-gantt-important-font-weight);font-size:var(--dhx-gantt-lightbox-time-font-size);font-weight:var(--dhx-gantt-lightbox-time-font-weight);line-height:142%;display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--dhx-gantt-base-padding) * 2);row-gap:var(--dhx-gantt-base-padding)}.gantt_section_time .gantt_section_time_icon{width:calc(var(--dhx-gantt-base-module) * 2);height:calc(var(--dhx-gantt-base-module) * 2);border-radius:2px;background:var(--dhx-gantt-base-colors-primary)}.gantt_section_duration{gap:16px}.gantt_fullday{margin-left:auto}.gantt_cal_light_rtl .gantt_fullday{margin-left:unset;margin-right:auto}.gantt_cal_lsection label{font-weight:var(--dhx-gantt-heading-font-weight);display:flex;align-items:center;gap:4px;width:100%}.gantt_cal_lsection{display:flex;margin-top:12px;margin-bottom:4px}.gantt_cal_lsection .gantt_custom_button{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled);order:1;margin-left:auto;margin-right:unset}.gantt_cal_lsection .gantt_custom_button:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.gantt_cal_lsection .gantt_custom_button:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.gantt_cal_lsection .gantt_custom_button:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_cal_light_rtl .gantt_custom_button{margin-left:unset;margin-right:auto}.gantt_cal_checkbox{display:flex;gap:var(--dhx-gantt-base-padding)}.gantt_cal_wide_checkbox{padding:4px 0}.gantt_cal_radio input{margin:var(--dhx-gantt-base-padding)}.gantt_cal_radio_item{display:flex;gap:var(--dhx-gantt-base-padding);align-items:center}.gantt_cal_radio{display:flex;gap:4px}.gantt_cal_radio_vertical{flex-direction:column;overflow:auto;--dhx-gantt-control-height: 20px}.gantt_cal_lcheckbox,.gantt_cal_lradio{display:flex;flex-wrap:wrap;gap:8px}.gantt_cal_lcheckbox label,.gantt_cal_lradio label{display:flex;align-items:center;gap:4px}.gantt_cal_template{position:relative;padding-top:4px;padding-bottom:4px}.gantt_cal_light .gantt_readonly{color:var(--dhx-gantt-base-colors-readonly)}.gantt_cal_quick_info{--dhx-gantt-quick-info-font-size: var(--dhx-gantt-font-size);position:absolute;z-index:8;font-size:var(--dhx-gantt-quick-info-font-size);background:var(--dhx-gantt-popup-background);color:var(--dhx-gantt-popup-color);border:var(--dhx-gantt-popup-border);padding:calc(var(--dhx-gantt-base-padding)*2) calc(var(--dhx-gantt-base-padding)*3);border-radius:var(--dhx-gantt-border-radius);width:300px;display:flex;flex-direction:column;box-shadow:var(--dhx-gantt-box-shadow-s);transition:left .5s ease,right .5s ease}.gantt_cal_qi_tcontrols{display:flex;justify-content:end;height:8px}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn{min-width:32px;height:32px;border-radius:50%;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent;width:unset;min-width:unset;padding:2px;font-size:18px;cursor:pointer;height:20px;position:relative;z-index:1}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:active{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-active)}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:disabled{--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color-disabled)}.gantt_cal_qi_title,.gantt_cal_qi_controls,.gantt_cal_qi_content{padding:0 calc(var(--dhx-gantt-base-padding) * 3)}.gantt_cal_qi_title{display:flex;flex-direction:column;gap:12px;padding-right:14px}.gantt_cal_qi_tcontent{font-size:var(--dhx-gantt-heading-font-size);font-weight:var(--dhx-gantt-heading-font-weight);line-height:150%;position:relative;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;overflow:hidden;flex-grow:0;text-overflow:ellipsis;white-space:nowrap}.gantt_cal_qi_tcontent>span{text-overflow:ellipsis;overflow:hidden}.gantt_cal_qi_tcontent:before{display:var(--dhx-gantt-quick-info-dot-display, block);content:"";flex-shrink:0;width:8px;height:8px;border-radius:2px;background:var(--dhx-gantt-task-background)}.gantt_cal_qi_tdate{font-size:var(--dhx-gantt-important-font-size);font-weight:var(--dhx-gantt-important-font-weight);line-height:var(--dhx-gantt-important-line-height)}.gantt_cal_qi_content{padding-top:16px;padding-bottom:8px}.gantt_cal_qi_controls{display:flex;flex-direction:row;justify-content:start;align-items:center;padding-top:8px;gap:12px;color:var(--dhx-gantt-base-colors-primary)}.gantt_cal_qi_controls>div:first-child{margin-left:-3px}.gantt_menu_icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color)}.dhx_gantt_icon.dhx_gantt_icon_edit,.dhx_menu_icon.dhx_gantt_icon_edit{--dhx-gantt-icon-size: var(--dhx-gantt-font-size)}.gantt_tooltip{padding:8px 30px 8px 8px;position:absolute;z-index:50;white-space:nowrap;box-shadow:var(--dhx-gantt-box-shadow-m);background:var(--dhx-gantt-tooltip-background);color:var(--dhx-gantt-tooltip-color);border:var(--dhx-gantt-tooltip-border);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);line-height:var(--dhx-gantt-regular-line-height);font-weight:var(--dhx-gantt-regular-font-weight);border-radius:var(--dhx-gantt-tooltip-border-radius);display:flex;flex-direction:column;align-items:flex-start;gap:4px}.gantt_resource_marker{position:absolute;text-align:center;font-size:var(--dhx-gantt-font-size);color:#fff}.gantt_resource_marker_ok{background:var(--dhx-gantt-base-colors-success)}.gantt_resource_marker_overtime{background:var(--dhx-gantt-base-colors-error)}.gantt_histogram_label{width:100%;height:100%;position:absolute;z-index:1;font-weight:700;font-size:var(--dhx-gantt-font-size)}.gantt_histogram_fill{background-color:#537cfa4d;background-color:color-mix(in srgb,var(--dhx-gantt-base-colors-primary),transparent 60%);width:100%;position:absolute;bottom:0}.gantt_histogram_hor_bar{height:1px;position:absolute;background:var(--dhx-gantt-base-colors-primary);margin-top:-1px;margin-left:-1px}.gantt_histogram_vert_bar{width:1px;position:absolute;background:var(--dhx-gantt-base-colors-primary);margin-left:-1px}.gantt_histogram_cell{position:absolute;text-align:center;font-size:var(--dhx-gantt-font-size)}.gantt_marker{height:100%;width:1px;top:0;position:absolute;text-align:center;background-color:var(--dhx-gantt-base-colors-error)}.gantt_marker .gantt_marker_content{padding:2px;background:inherit;color:var(--dhx-gantt-base-colors-white);position:absolute;font-size:var(--dhx-gantt-caption-font-size);line-height:var(--dhx-gantt-caption-line-height);font-weight:var(--dhx-gantt-caption-line-weight)}.gantt_marker_area{position:absolute;top:0;left:0}.gantt_grid_editor_placeholder{position:absolute}.gantt_grid_editor_placeholder>div,.gantt_grid_editor_placeholder input,.gantt_grid_editor_placeholder select{width:100%;height:100%;box-sizing:border-box}.gantt_row_placeholder div{opacity:.5}.gantt_row_placeholder .gantt_file,.gantt_row_placeholder .gantt_add{display:none}.gantt_drag_marker.gantt_grid_dnd_marker{background-color:transparent;transition:all .1s ease}.gantt_grid_dnd_marker_line{height:4px;width:100%;background-color:var(--dhx-gantt-base-colors-primary)}.gantt_grid_dnd_marker_line:before{background:var(--dhx-gantt-base-colors-white);width:12px;height:12px;box-sizing:border-box;border:3px solid var(--dhx-gantt-base-colors-primary);border-radius:6px;content:"";line-height:1px;display:block;position:absolute;margin-left:-11px;margin-top:-4px;pointer-events:none}.gantt_grid_dnd_marker_folder{height:100%;width:100%;position:absolute;pointer-events:none;box-sizing:border-box;box-shadow:0 0 0 2px var(--dhx-gantt-base-colors-primary) inset;background:transparent}.gantt_overlay_area{position:absolute;height:inherit;width:inherit;top:0;left:0;display:none}.gantt_overlay{position:absolute;left:0;top:0;height:inherit;width:inherit}.gantt_click_drag_rect{position:absolute;left:0;top:0;outline:1px solid var(--dhx-gantt-base-colors-primary);background-color:var(--dhx-gantt-base-colors-primary-lighter)}.gantt_timeline_move_available,.gantt_timeline_move_available *{cursor:move}.gantt_constraint_marker{position:absolute;pointer-events:none;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-text-light)}.gantt_constraint_marker.gantt_constraint_marker_snlt,.gantt_constraint_marker.gantt_constraint_marker_fnlt,.gantt_constraint_marker.gantt_constraint_marker_mfo{transform:rotate(180deg)}.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_snlt,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_fnlt,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_mfo{transform:rotate(0)}.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_snet,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_fnet,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_mso{transform:rotate(180deg)}.gantt_rtl .gantt_grid{text-align:right}.gantt_rtl .gantt_row,.gantt_rtl .gantt_cell{flex-direction:row-reverse}.gantt_layout_content{width:100%;overflow:auto;box-sizing:border-box}.gantt_layout_cell{position:relative;box-sizing:border-box}.gantt_layout_cell>.gantt_layout_header{background:#33aae8;color:#fff;font-size:17px;padding:5px 10px;box-sizing:border-box}.gantt_layout_header.collapsed_x{background:#a9a9a9}.gantt_layout_header.collapsed_x .gantt_header_arrow:before{content:"⇧"}.gantt_layout_header.collapsed_y{background:#a9a9a9}.gantt_layout_header.collapsed_y .gantt_header_arrow:before{content:"⇩"}.gantt_layout_header{cursor:pointer}.gantt_layout_header .gantt_header_arrow{float:right;text-align:right}.gantt_layout_header .gantt_header_arrow:before{content:"⇦"}.gantt_layout_header.vertical .gantt_header_arrow:before{content:"⇧"}.gantt_layout_outer_scroll_vertical .gantt_layout_content{overflow-y:hidden}.gantt_layout_outer_scroll_horizontal .gantt_layout_content{overflow-x:hidden}.gantt_layout_x>.gantt_layout_cell{display:inline-block;vertical-align:top}.gantt_layout_x{white-space:nowrap}.gantt_resizing{opacity:.7;background:#f2f2f2}.gantt_layout_cell_border_right.gantt_resizer{overflow:visible;border-right:0}.gantt_resizer{cursor:e-resize;position:relative}.gantt_resizer_y{cursor:n-resize}.gantt_resizer_stick{background:#33aae8;z-index:9999;position:absolute;top:0;width:100%}.gantt_resizer_x .gantt_resizer_x{position:absolute;width:20px;height:100%;margin-left:-10px;top:0;left:0;z-index:1}.gantt_resizer_y .gantt_resizer_y{position:absolute;height:20px;width:100%;top:-10px;left:0;z-index:1}.gantt_resizer_error{background:#cd5c5c!important}.gantt_layout_cell_border_left{border-left:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_right{border-right:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_top{border-top:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_bottom{border-bottom:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_transparent{border-color:transparent}.gantt_window{position:absolute;top:50%;left:50%;z-index:999999999;background:#fff}.gantt_window_content{position:relative}.gantt_window_content_header{background:#39c;color:#fff;height:33px;padding:10px 10px 0;border-bottom:solid 2px #ffffff;position:relative}.gantt_window_content_header_text{padding-left:10%}.gantt_window_content_header_buttons{position:absolute;top:10px;right:10px}.gantt_window_content_header_buttons:hover{color:#000;cursor:pointer}.gantt_window_content_resizer{position:absolute;width:15px;height:15px;bottom:0;line-height:15px;right:-1px;text-align:center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABZJREFUeAFjIAUwUshlpJDLSIhLGAAACQ4AFk79JaMAAAAASUVORK5CYII=);cursor:nw-resize;z-index:999}.gantt_window_content_frame{position:absolute;top:0;left:0;width:100%;height:100%;background:#0000001a;z-index:9999}.gantt_window_drag{cursor:pointer!important}.gantt_window_resizing{overflow:visible}.gantt_window_resizing_body{overflow:hidden!important}.gantt_window_modal{background:#0000001a;z-index:9999;top:0;left:0;width:100%;height:100%;position:fixed}.gantt_container,.gantt_cal_light,.gantt_message_area,.gantt_modal_box,.gantt_cal_quick_info,.gantt_tooltip{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--dhx-gantt-font-family)}.gantt_container,.gantt_container *{box-sizing:border-box}.gantt_noselect{-webkit-user-select:none;user-select:none}.gantt_noselect .gantt_grid_data .gantt_row:hover,.gantt_noselect .gantt_grid_data .gantt_row.odd:hover{background-color:unset}.gantt_drag_marker{position:absolute;top:-1000px;left:-1000px;font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);z-index:1;white-space:nowrap;background:var(--dhx-gantt-base-colors-select)}.gantt_drag_marker .gantt_tree_indent,.gantt_drag_marker .gantt_tree_icon.gantt_blank,.gantt_drag_marker .gantt_tree_icon.gantt_open,.gantt_drag_marker .gantt_tree_icon.gantt_close{display:none}.gantt_empty_state_wrapper{position:relative}.gantt_empty_state{height:100%;max-width:500px;box-sizing:border-box;white-space:pre-line;overflow-wrap:break-word;display:flex;flex-direction:column;justify-content:flex-start;margin:0 auto}.gantt_empty_state_image{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWYAAADjCAYAAAC2LL7JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7L15vGVFfS2+vrX3OXfqvj1BQzMLIoNEQdQXhSg4ECeCE63SAooEYhxinjGTL0mb/HjPl2cSE2MUVMQBIQ1PQEQRiTjE5BlxRhNnZGqg6bnvcM7Zu9bvj6rau/Z0hnvPvef27bP6c/vsoXbt2kOtvepb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btv5hI6YO+wq3P7pF+dXD8/t4VU9T2UxT2zmSyPzxDxPxuwBaNc/EyJioOksjDnLoDMF0Rmsrp7t9eXM+Tb0eadi1/8IO3QIEKHv/zvMnV5enGddzKvC7BFWvVJohsXMMPOMGOoZNjMk5+hAGYNSiFcUzLLALIPzBcLKUpnNLdJSsbS4sLh477dcvLSTp13aDeiIuUOHdeD2hyVfOHtiZqbsz5hsX08U96Rc7DH34GK3VQAAAIhJREFU2PSLTGnSZEiVRJlSpS4NFIEyAWkypSKts8ZJdUdAIH0SiCheI4EAao0UxBTS18qsmb70Res1DdMvYfqc5avLZbmaLa2snOkfXt6swUMdOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0OHcxv8HnRxVygJP8F8AAAAASUVORK5CYII=);background-repeat:no-repeat;width:100%;max-width:500px;max-height:500px;margin-left:auto;margin-right:auto;display:block;min-height:0;height:200px;background-size:contain;background-position-x:center;background-position-y:bottom;margin-top:40px}.gantt_empty_state_text{text-align:center}.gantt_empty_state_text_link{color:var(--dhx-gantt-base-colors-primary);background:none;opacity:1;height:unset;cursor:pointer}.gantt_drag_marker .gantt_row.odd{background-color:var(--dhx-gantt-base-colors-select)}.gantt_drag_marker .gantt_row{border-left:var(--dhx-gantt-scale-border-vertical);border-top:var(--dhx-gantt-scale-border-horizontal)}.gantt_drag_marker .gantt_cell{border-color:var(--dhx-gantt-base-colors-border)}.gantt_row.gantt_over,.gantt_task_row.gantt_over{background-color:var(--dhx-gantt-base-colors-primary-active)}.gantt_row.gantt_transparent .gantt_cell{opacity:.7}.gantt_task_row.gantt_transparent{background-color:#537cfa73}.gantt_container_resize_watcher{background:transparent;width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;pointer-events:none;border:0;box-sizing:border-box;opacity:0}.gantt_task_deadline{position:absolute;z-index:5;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error)}.gantt_task_deadline:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_task_deadline:before{content:""}.gantt_task_baseline{position:absolute;border-radius:2px;opacity:.9;background:#ffd180;z-index:0;overflow:hidden}.gantt_task_baseline.gantt_milestone_baseline{transform:rotate(45deg)}.gantt_task_baseline.gantt_task_baseline_0{background:var(--dhx-gantt-baseline-background-0)}.gantt_task_baseline.gantt_task_baseline_1{background:var(--dhx-gantt-baseline-background-1)}.gantt_task_baseline.gantt_task_baseline_2{background:var(--dhx-gantt-baseline-background-2)}.gantt_task_baseline.gantt_task_baseline_3{background:var(--dhx-gantt-baseline-background-3)}.gantt_task_baseline.gantt_task_baseline_4{background:var(--dhx-gantt-baseline-background-4)}.gantt_task_baseline.gantt_task_baseline_5{background:var(--dhx-gantt-baseline-background-5)}.gantt_task_baseline.gantt_task_baseline_6{background:var(--dhx-gantt-baseline-background-6)}.gantt_task_baseline.gantt_task_baseline_7{background:var(--dhx-gantt-baseline-background-7)}.gantt_task_baseline.gantt_task_baseline_8{background:var(--dhx-gantt-baseline-background-8)}.gantt_task_baseline.gantt_task_baseline_9{background:var(--dhx-gantt-baseline-background-9)}.gantt_section_baselines{overflow-y:auto;display:flex;flex-direction:column;gap:4px}.gantt_custom_button.gantt_add_baselines{margin-left:0} +@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuOKfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf) format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuDyYMZg.ttf) format("truetype")}:root{--dhx-gantt-theme: terrace;--dhx-gantt-font-family: Inter, Helvetica, Arial, sans-serif;--dhx-gantt-font-size: 14px;--dhx-gantt-heading-font-size: calc(var(--dhx-gantt-font-size) + 2px);--dhx-gantt-heading-font-weight: 600;--dhx-gantt-important-font-size: var(--dhx-gantt-font-size);--dhx-gantt-important-line-height: 142%;--dhx-gantt-important-font-weight: 500;--dhx-gantt-regular-font-size: var(--dhx-gantt-font-size);--dhx-gantt-regular-font-weight: 400;--dhx-gantt-regular-line-height: 142%;--dhx-gantt-caption-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-caption-font-weight: 400;--dhx-gantt-caption-line-height: 132%;--dhx-gantt-base-colors-white: #FFFFFF;--dhx-gantt-base-colors-select: #EFF3FF;--dhx-gantt-base-colors-hover-color: #e0e0e0;--dhx-gantt-base-colors-border-light: #F0F0F0;--dhx-gantt-base-colors-border: #DFE0E1;--dhx-gantt-base-colors-icons: #A1A4A6;--dhx-gantt-base-colors-icons-active: #8b8e90;--dhx-gantt-base-colors-icons-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 12.6%);--dhx-gantt-base-colors-icons-hover: #76787a;--dhx-gantt-base-colors-icons-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 28.5%);--dhx-gantt-base-colors-disabled: #E9E9E9;--dhx-gantt-base-colors-select: #E0E5F3;--dhx-gantt-base-colors-readonly: var(--dhx-gantt-base-colors-icons);--dhx-gantt-base-colors-text-light: #555D63;--dhx-gantt-base-colors-text-base: #23272A;--dhx-gantt-base-colors-text-on-fill: rgba(255, 255, 255, .9);--dhx-gantt-base-colors-background: #FFFFFF;--dhx-gantt-base-colors-background-alt: #F2F2F2;--dhx-gantt-base-colors-primary: #537CFA;--dhx-gantt-base-colors-primary-hover: #4269E0;--dhx-gantt-base-colors-primary-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 100%, #000000 6%);--dhx-gantt-base-colors-primary-active: #3365fb;--dhx-gantt-base-colors-primary-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 100%, #000000 16.6%);--dhx-gantt-base-colors-primary-lighter: #537cfa33;--dhx-gantt-base-colors-primary-lighter: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-primary) 20%, rgba(0, 0, 0, 0) 100%);--dhx-gantt-base-colors-warning: #FAB936;--dhx-gantt-base-colors-error: #E3334E;--dhx-gantt-base-colors-error-hover: #D3233E;--dhx-gantt-base-colors-error-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 100%, #000000 6%);--dhx-gantt-base-colors-error-active: #C3132E;--dhx-gantt-base-colors-error-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 100%, #000000 16.6%);--dhx-gantt-base-colors-error-lighter: #E3334E33;--dhx-gantt-base-colors-error-lighter: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-error) 20%, rgba(0, 0, 0, 0) 100%);--dhx-gantt-base-colors-error-text: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-base-colors-success: #1BC297;--dhx-gantt-container-background: var(--dhx-gantt-base-colors-background);--dhx-gantt-container-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-offtime-background: var(--dhx-gantt-base-colors-background-alt);--dhx-gantt-scale-background: var(--dhx-gantt-container-background);--dhx-gantt-scale-border-vertical: 1px solid var(--dhx-gantt-base-colors-border-light);--dhx-gantt-scale-border-horizontal: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-grid-body-background: transparent;--dhx-gantt-grid-scale-background: var(--dhx-gantt-scale-background);--dhx-gantt-grid-scale-color: var(--dhx-gantt-scale-color);--dhx-gantt-grid-scale-border-vertical: var(--dhx-gantt-scale-border-vertical);--dhx-gantt-timeline-scale-background: var(--dhx-gantt-scale-background);--dhx-gantt-timeline-scale-color: var(--dhx-gantt-scale-color);--dhx-gantt-timeline-scale-border-vertical: var(--dhx-gantt-scale-border-vertical);--dhx-gantt-grid-cell-border: 1px solid transparent;--dhx-gantt-grid-row-border: var(--dhx-gantt-scale-border-horizontal);--dhx-gantt-base-transition: .2s ease;--dhx-gantt-box-shadow-s: 0px 4px 24px 0px rgba(44, 47, 60, .08);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-icon-size: 1.5em;--dhx-gantt-base-module: 4px;--dhx-gantt-base-padding: 4px;--dhx-gantt-border-radius: var(--dhx-gantt-base-module);--dhx-gantt-transition: all .3s;--dhx-gantt-default-border: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-header-border: var(--dhx-gantt-default-border);--dhx-gantt-task-blue: var(--dhx-gantt-base-colors-primary);--dhx-gantt-task-green: #20B56D;--dhx-gantt-task-violet: #D071EF;--dhx-gantt-task-yellow: linear-gradient(180deg, #FFB725 0%, #FFBB25 31.25%, #FAEA27 100%);--dhx-gantt-baseline-background-0: #00B4FF;--dhx-gantt-baseline-background-1: #DF6DE3;--dhx-gantt-baseline-background-2: #FF957D;--dhx-gantt-baseline-background-3: #25C79D;--dhx-gantt-baseline-background-4: #FF6FB0;--dhx-gantt-baseline-background-5: #FFC470;--dhx-gantt-baseline-background-6: #FDE720;--dhx-gantt-baseline-background-7: #47AFD0;--dhx-gantt-baseline-background-8: #DA9DFF;--dhx-gantt-baseline-background-9: #BEE964;--dhx-gantt-task-font-size: var(--dhx-gantt-regular-font-size);--dhx-gantt-task-line-height: var(--dhx-gantt-regular-line-height);--dhx-gantt-task-font-weight: var(--dhx-gantt-regular-font-weight);--dhx-gantt-task-background-primary: var(--dhx-gantt-base-colors-primary);--dhx-gantt-task-border-radius: var(--dhx-gantt-border-radius);--dhx-gantt-task-background: var(--dhx-gantt-task-blue);--dhx-gantt-task-border: none;--dhx-gantt-task-color: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-project-color: var(--dhx-gantt-task-color);--dhx-gantt-task-line-text: var(--dhx-gantt-container-color);--dhx-gantt-task-row-border: 1px solid var(--dhx-gantt-base-colors-border);--dhx-gantt-task-row-background: var(--dhx-gantt-container-background);--dhx-gantt-task-row-background--odd: var(--dhx-gantt-container-background);--dhx-gantt-task-progress-color: rgba(0, 0, 0, .15);--dhx-gantt-project-progress-color: var(--dhx-gantt-task-progress-color);--dhx-gantt-project-background: var(--dhx-gantt-task-green);--dhx-gantt-milestone-background: var(--dhx-gantt-task-violet);--dhx-gantt-task-marker-color: var(--dhx-gantt-task-background);--dhx-gantt-popup-background: var(--dhx-gantt-container-background);--dhx-gantt-popup-color: var(--dhx-gantt-container-color);--dhx-gantt-popup-border: none;--dhx-gantt-popup-border-radius: var(--dhx-gantt-border-radius);--dhx-gantt-tooltip-background: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-tooltip-color: var(--dhx-gantt-container-background);--dhx-gantt-tooltip-border: none;--dhx-gantt-tooltip-border-radius: var(--dhx-gantt-popup-border-radius);--dhx-gantt-link-background: var(--dhx-gantt-base-colors-icons);--dhx-gantt-link-background-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-link-critical-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-link-handle-offset: 8px;--dhx-gantt-link-handle-size: 10px;--dhx-gantt-link-handle-border: var(--dhx-gantt-base-colors-icons);--dhx-gantt-link-handle-border-hover: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-progress-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-progress-handle-background: var(--dhx-gantt-base-colors-icons);--dhx-gantt-progress-handle-background-hover: var(--dhx-gantt-base-colors-icons-hover);--dhx-gantt-control-height: 32px;--dhx-gantt-checkbox-height: 20px;--dhx-gantt-lightbox_font-family: var(--dhx-gantt-font-family);--dhx-gantt-lightbox-font-size: var(--dhx-gantt-important-font-size);--dhx-gantt-lightbox-font-weight: var(--dhx-gantt-important-font-weight);--dhx-gantt-lightbox-background: var(--dhx-gantt-popup-background);--dhx-gantt-lightbox-border: var(--dhx-gantt-popup-border);--dhx-gantt-lightbox-control-border: var(--dhx-gantt-default-border);--dhx-gantt-lightbox-color: var(--dhx-gantt-popup-color);--dhx-gantt-lightbox-padding: 12px;--dhx-gantt-lightbox-title-background: var(--dhx-gantt-base-colors-select);--dhx-gantt-lightbox-title-color: var(--dhx-gantt-lightbox-color);--dhx-gantt-lightbox-title-font-size: var(--dhx-gantt-heading-font-size);--dhx-gantt-lightbox-max-width: 622px;--dhx-gantt-lightbox-wide-max-width: 738px;--dhx-gantt-lightbox-width: 560px;--dhx-gantt-btn-order: row-reverse;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-base-colors-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-base-colors-disabled);--dhx-gantt-btn-outline-background: transparent;--dhx-gantt-btn-outline-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-outline-border-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-outline-background-hover: var(--dhx-gantt-base-colors-primary-lighter);--dhx-gantt-btn-outline-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-outline-border-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-outline-background-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-outline-color-active: var(--dhx-gantt-base-colors-text-on-fill);--dhx-gantt-btn-outline-border-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-outline-background-disabled: transparent;--dhx-gantt-btn-outline-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-outline-border-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-text-transform: none;--dhx-gantt-info-background: var(--dhx-gantt-popup-background);--dhx-gantt-info-color: var(--dhx-gantt-popup-color);--dhx-gantt-info-border: var(--dhx-gantt-popup-border);--dhx-gantt-info-shadow: var(--dhx-gantt-box-shadow-m);--dhx-gantt-modal-background: var(--dhx-gantt-popup-background);--dhx-gantt-modal-color: var(--dhx-gantt-popup-color);--dhx-gantt-modal-border: var(--dhx-gantt-popup-border);--dhx-gantt-modal-padding: 16px;--dhx-gantt-modal-width: 320px;--dhx-gantt-modal-border-radius: var(--dhx-gantt-popup-border-radius);--dhx-gantt-undo-delete-background: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-undo-delete-color: var(--dhx-gantt-task-color)}:root[data-gantt-theme=dark]{--dhx-gantt-theme: dark;--dhx-gantt-base-colors-disabled: #3d3d3d;--dhx-gantt-base-colors-text-light: #AAA;--dhx-gantt-base-colors-text-base: rgba(255, 255, 255, .9);--dhx-gantt-base-colors-background: #141414;--dhx-gantt-base-colors-background-alt: #383838;--dhx-gantt-base-colors-border: #4B4B4B;--dhx-gantt-base-colors-border-light: #4B4B4B;--dhx-gantt-navline-font-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-base-colors-primary: #3B72F8;--dhx-gantt-base-colors-error: #EB284F;--dhx-gantt-base-colors-select: #2A2A2A;--dhx-gantt-base-colors-hover-color: #2A2A2A;--dhx-gantt-base-colors-icons: #AAAAAA;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #1B1B1C;--dhx-gantt-popup-border: 1px solid #4B4B4B;--dhx-gantt-btn-font-weight: 600;--dhx-gantt-undo-delete-background: var(--dhx-gantt-popup-background);--dhx-gantt-link-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-background)}:root[data-gantt-theme=meadow]{--dhx-gantt-theme: meadow;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-base-colors-select: #ffebbc;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-container-color: #3f3f3f;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-scale-background: #f4f2ea;--dhx-gantt-scale-color: #42464b;--dhx-gantt-task-color: #1e2022;--dhx-gantt-project-background: #c7d8f7;--dhx-gantt-milestone-background: #DB7DC5;--dhx-gantt-task-background: #e1ffd4;--dhx-gantt-task-border: 1px solid #3588c5;--dhx-gantt-task-progress-color: #a7d991;--dhx-gantt-project-progress-color: #9ab9f1;--dhx-gantt-link-background: #ffb96d;--dhx-gantt-lightbox-title-background: #f4f2ea;--dhx-gantt-popup-background: #fcfaf3;--dhx-gantt-popup-color: var(--dhx-gantt-container-color);--dhx-gantt-popup-border: 1px solid #cac8bd}:root[data-gantt-theme=skyblue]{--dhx-gantt-theme: skyblue;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-scale-background: #dfedff;--dhx-gantt-scale-color: #42464b;--dhx-gantt-task-color: #1e2022;--dhx-gantt-project-background: #eff6fb;--dhx-gantt-task-background: #eff6fb;--dhx-gantt-milestone-background: #DB7DC5;--dhx-gantt-task-border: 1px solid #3588c5;--dhx-gantt-task-progress-color: linear-gradient(0deg, #abcee8 0, #5aa0d3 36%, #bfdaee);--dhx-gantt-link-background: #4a8f43;--dhx-gantt-lightbox-title-background: #eff6fb}:root[data-gantt-theme=skyblue] .gantt_grid_scale,:root[data-gantt-theme=skyblue] .gantt_task_scale,:root[data-gantt-theme=skyblue] .gantt_task_vscroll{box-shadow:inset 0 1px 1px #fff;background-image:linear-gradient(to bottom,#e4f0ff,#dfedff,#d5e8ff)}:root[data-gantt-theme=broadway]{--dhx-gantt-theme: broadway;--dhx-gantt-font-family: Segoe UI, Arial, san-serif;--dhx-gantt-base-colors-primary: #0288D1;--dhx-gantt-base-colors-select: #fff3a1;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-base-colors-border: #cecece;--dhx-gantt-halfhour-border: 1px solid #e8e8e8;--dhx-gantt-task-title-font-size: 12px;--dhx-gantt-task-text-font-size: 14px;--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 22px;--dhx-gantt-heading-font-weight: 300;--dhx-gantt-caption-font-size: 14px;--dhx-gantt-caption-font-weight: 400;--dhx-gantt-scale-color: #767676;--dhx-gantt-border-radius: 0;--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-grid-scale-background: #4f4f4f;--dhx-gantt-grid-scale-border-vertical: 1px solid #c1c1c1;--dhx-gantt-grid-scale-color: #e1e1e1;--dhx-gantt-timeline-scale-background: #dbdbdb;--dhx-gantt-timeline-scale-border-vertical: 1px solid #ebebeb;--dhx-gantt-timeline-scale-color: #494949;--dhx-gantt-grid-body-background: #dbdbdb;--dhx-gantt-lightbox-title-background: #4f4f4f;--dhx-gantt-lightbox-title-color: #e1e1e1;--dhx-gantt-task-color: #FFF;--dhx-gantt-link-background: #ffb96d;--dhx-gantt-project-background: #65c16f;--dhx-gantt-project-progress-color: #46ad51;--dhx-gantt-task-progress-color: #04a4f0;--dhx-gantt-task-background: #17b2fb;--dhx-gantt-milestone-background: #DB7DC5}:root[data-gantt-theme=broadway] .gantt_grid_data{--dhx-gantt-task-row-background: var(--dhx-gantt-grid-body-background);--dhx-gantt-task-row-background--odd: var(--dhx-gantt-grid-body-background)}:root[data-gantt-theme=material]{--dhx-gantt-theme: material;--dhx-gantt-font-family: Roboto, Inter, Helvetica, Arial, sans-serif;--dhx-gantt-base-colors-primary: #448aff;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-project-background: #1de9b6;--dhx-gantt-milestone-background: #ffc107;--dhx-gantt-task-progress-color: rgba(0, 0, 0, .2);--dhx-gantt-project-color: rgba(0, 0, 0, .6);--dhx-gantt-base-colors-border: #e0e0e0;--dhx-gantt-task-title-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-task-text-font-size: var(--dhx-gantt-font-size);--dhx-gantt-task-text-font-weight: 500;--dhx-gantt-heading-font-size: 20px;--dhx-gantt-caption-font-size: var(--dhx-gantt-font-size);--dhx-gantt-caption-font-weight: 500;--dhx-gantt-btn-font-weight: 500;--dhx-gantt-heading-font-weight: 500;--dhx-gantt-hours-font-size: calc(var(--dhx-gantt-font-size) - 2px);--dhx-gantt-base-colors-text-base: rgba(0, 0, 0, .75);--dhx-gantt-base-transition: .15s ease;--dhx-gantt-header-border: 1px solid transparent;--dhx-gantt-scale-color: rgba(0, 0, 0, .54);--dhx-gantt-base-colors-select: rgba(0, 199, 181, .2);--dhx-gantt-base-colors-hover-color: var(--dhx-gantt-base-colors-select);--dhx-gantt-border-radius: 0;--dhx-gantt-task-border-radius: 18px;--dhx-gantt-btn-text-transform: uppercase;--dhx-gantt-btn-padding: 1px 20px 0;--dhx-gantt-link-handle-size: 16px;--dhx-gantt-progress-handle-background: #FFF;--dhx-gantt-progress-handle-border: var(--dhx-gantt-base-colors-border);--dhx-gantt-box-shadow-s: 0 3px 5px 0 rgba(0, 0, 0, .1);--dhx-gantt-box-shadow-m: 0px 4px 24px 0px rgba(44, 47, 60, .36);--dhx-gantt-box-shadow-l: 0px 4px 24px 0px rgba(44, 47, 60, .56);--dhx-gantt-lightbox-title-background: var(--dhx-gantt-container-background);--dhx-gantt-lightbox-title-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-lightbox-title-font-size: calc(var(--dhx-gantt-font-size) + 2px);--dhx-gantt-lightbox-padding: 30px;--dhx-gantt-lightbox-width: 610px;--dhx-gantt-lightbox-wide-max-width: 640px;--dhx-gantt-btn-order: row;--dhx-gantt-btn-outline-border-color: transparent;--dhx-gantt-btn-outline-border-hover: transparent;--dhx-gantt-btn-outline-border-active: transparent;--dhx-gantt-btn-outline-border-color-disabled: transparent}:root[data-gantt-theme=material] .dhx_cal_ltitle{font-weight:400;text-transform:uppercase;padding:18px var(--dhx-gantt-lightbox-padding) 8px;border-bottom-color:transparent}:root[data-gantt-theme=material] .gantt_grid .gantt_grid_scale .gantt_grid_head_cell,:root[data-gantt-theme=material] .gantt_task .gantt_task_scale .gantt_scale_cell{font-weight:500;text-transform:uppercase}:root[data-gantt-theme=material] .dhx_cal_ltitle_controls{--dhx-gantt-base-colors-icons: var(--dhx-gantt-lightbox-title-color)}:root[data-gantt-theme=material] .gantt_cal_lsection{margin-top:12px;margin-bottom:4px}:root[data-gantt-theme=material] .gantt_cal_ltitle{padding:18px var(--dhx-gantt-lightbox-padding);border-bottom-color:transparent}:root[data-gantt-theme=material] .gantt_cal_lcontrols{padding-bottom:40px;padding-top:30px}:root[data-gantt-theme=material] .gantt_add,:root[data-gantt-theme=material] .gantt_grid_head_add{--dhx-gantt-base-colors-icons: #70d0c2;--dhx-gantt-base-colors-icons-active: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 12.6%);--dhx-gantt-base-colors-icons-hover: color-mix(in hsl increasing hue, var(--dhx-gantt-base-colors-icons) 100%, #000000 28.5%)}:root[data-gantt-theme=material] .gantt_grid_data .gantt_row,:root[data-gantt-theme=material] .gantt_grid_data .gantt_row.odd{transition:background var(--dhx-gantt-base-transition)}:root[data-gantt-theme=material] .gantt_grid_head_cell{transition:border-color ground var(--dhx-gantt-base-transition);border-right:1px solid transparent}:root[data-gantt-theme=material] .gantt_grid_scale:hover .gantt_grid_head_cell{border-right:var(--dhx-gantt-grid-scale-border-vertical)}:root[data-gantt-theme=material] .gantt_grid_column_resize_wrap .gantt_grid_column_resize{transition:background var(--dhx-gantt-base-transition);background-color:transparent}:root[data-gantt-theme=material] .gantt_grid_column_resize_wrap:hover .gantt_grid_column_resize{background-color:var(--dhx-gantt-base-colors-border)}:root[data-gantt-theme=material] div.gantt_grid_scale:after,:root[data-gantt-theme=material] div.gantt_scale_line:last-child:after{content:"";width:100%;display:block;height:1px;background-color:transparent;position:absolute;box-shadow:0 1px 2px #0003,0 2px 3px #0000001a;z-index:1}:root[data-gantt-theme=material] div.gantt_scale_line:last-child:after{bottom:-1px}:root[data-gantt-theme=material] .gantt_link_control{--dhx-gantt-link-handle-border: var(--dhx-gantt-task-background);--dhx-gantt-link-handle-background: #FFF;--dhx-gantt-link-handle-border-hover: var(--dhx-gantt-task-background);--dhx-gantt-link-handle-background-hover: #FFF}:root[data-gantt-theme=material] .gantt_task_line.gantt_milestone{margin-top:-1px;--dhx-gantt-task-border-radius: 2px}:root[data-gantt-theme=contrast-white]{--dhx-gantt-theme: contrast-white;--dhx-gantt-base-colors-disabled: #C2C2C2;--dhx-gantt-base-colors-text-light: #303030;--dhx-gantt-base-colors-text-base: #303030;--dhx-gantt-base-colors-background: #FFFFFF;--dhx-gantt-base-colors-background-alt: #929292;--dhx-gantt-base-colors-border: #4D595B;--dhx-gantt-base-colors-border-light: #4D595B;--dhx-gantt-base-colors-text-on-fill: #FFF;--dhx-gantt-base-colors-primary: #0A47CD;--dhx-gantt-base-colors-text-on-fill: rgba(255, 255, 255, .9);--dhx-gantt-task-background: #0A47CD;--dhx-gantt-task-border: 1px solid rgba(0, 0, 0, .1);--dhx-gantt-base-colors-warning: #FCBA2E;--dhx-gantt-base-colors-success: #77D257;--dhx-gantt-base-colors-error: #ee3d31;--dhx-gantt-base-colors-error-text: #141414;--dhx-gantt-btn-color: #FFFFFF;--dhx-gantt-btn-color-hover: #FFFFFF;--dhx-gantt-btn-color-active: #FFFFFF;--dhx-gantt-base-colors-select: #E7E5E5;--dhx-gantt-base-colors-hover-color: #E7E5E5;--dhx-gantt-base-colors-icons: #303030;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #FFF;--dhx-gantt-popup-border: 1px solid #4D595B;--dhx-gantt-font-size: 16px;--dhx-gantt-heading-font-size: 24px;--dhx-gantt-important-font-size: 16px;--dhx-gantt-regular-font-size: 16px;--dhx-gantt-caption-font-size: 16px;--dhx-gantt-btn-outline-color-hover: #212121;--dhx-gantt-btn-outline-color-active: #FFFFFF}:root[data-gantt-theme=contrast-black]{--dhx-gantt-theme: contrast-black;--dhx-gantt-base-colors-disabled: #3d3d3d;--dhx-gantt-base-colors-text-light: #cfcfcf;--dhx-gantt-base-colors-text-base: #FFFFFF;--dhx-gantt-base-colors-background: #141414;--dhx-gantt-base-colors-background-alt: #4f4f4f;--dhx-gantt-base-colors-border: rgba(255, 255, 255, .8);--dhx-gantt-base-colors-border-light: rgba(255, 255, 255, .8);--dhx-gantt-base-colors-text-on-fill: #141414;--dhx-gantt-base-colors-primary: #A395FF;--dhx-gantt-task-background: var(--dhx-gantt-base-colors-primary);--dhx-gantt-project-background: #77D257;--dhx-gantt-milestone-background: #FCBA2E;--dhx-gantt-task-background: #A395FF;--dhx-gantt-task-border: 1px solid rgba(0, 0, 0, .1);--dhx-gantt-base-colors-warning: #694E02;--dhx-gantt-base-colors-success: #115700;--dhx-gantt-base-colors-error: #FFA7A0;--dhx-gantt-base-colors-error-text: #141414;--dhx-gantt-base-colors-select: #2A2A2A;--dhx-gantt-base-colors-hover-color: #2A2A2A;--dhx-gantt-base-colors-icons: #AAAAAA;--dhx-gantt-scale-color: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-popup-background: #1B1B1C;--dhx-gantt-undo-delete-background: var(--dhx-gantt-popup-background);--dhx-gantt-undo-delete-color: var(--dhx-gantt-base-colors-text-base);--dhx-gantt-popup-border: 1px solid #4B4B4B;--dhx-gantt-font-size: 16px;--dhx-gantt-heading-font-size: 24px;--dhx-gantt-important-font-size: 16px;--dhx-gantt-regular-font-size: 16px;--dhx-gantt-caption-font-size: 16px;--dhx-gantt-btn-outline-color-hover: var(--dhx-gantt-base-colors-text-light);--dhx-gantt-btn-outline-color-active: var(--dhx-gantt-base-colors-text-light)}.dhx_gantt_button--mixin{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.dhx_gantt_button--mixin:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.dhx_gantt_button--mixin:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.dhx_gantt_button--mixin:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.dhx_gantt_button_outline--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.dhx_gantt_button_danger--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_button_danger_outline--mixin{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-lighter);--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-base-colors-icons)}.dhx_gantt_button_danger_link--mixin{--dhx-gantt-icon-size: 18px;padding:6px 0;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_link--mixin{padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_icon--mixin{min-width:32px;height:32px;border-radius:50%;padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.dhx_gantt_button_icon--mixin:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.dhx_gantt_button_icon--mixin:active{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-active)}.dhx_gantt_button_icon--mixin:disabled{--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color-disabled)}.dhx_gantt_btn,.dhx_gantt_btn_danger,.dhx_gantt_btn_outline,.dhx_gantt_btn_danger_outline,.dhx_gantt_btn_danger_link,.gantt_qi_big_icon,.gantt_btn_set{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.dhx_gantt_btn:hover,.dhx_gantt_btn_danger:hover,.dhx_gantt_btn_outline:hover,.dhx_gantt_btn_danger_outline:hover,.dhx_gantt_btn_danger_link:hover,.gantt_qi_big_icon:hover,.gantt_btn_set:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.dhx_gantt_btn:active,.dhx_gantt_btn_danger:active,.dhx_gantt_btn_outline:active,.dhx_gantt_btn_danger_outline:active,.dhx_gantt_btn_danger_link:active,.gantt_qi_big_icon:active,.gantt_btn_set:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.dhx_gantt_btn:disabled,.dhx_gantt_btn_danger:disabled,.dhx_gantt_btn_outline:disabled,.dhx_gantt_btn_danger_outline:disabled,.dhx_gantt_btn_danger_link:disabled,.gantt_qi_big_icon:disabled,.gantt_btn_set:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_popup_button{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px}.gantt_popup_button:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.gantt_popup_button:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.gantt_popup_button:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_popup_button:not(.gantt_ok_button){--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.gantt_ok_button{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_btn_outline,.dhx_gantt_btn_danger_outline{--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.dhx_gantt_button_danger,.dhx_gantt_button_danger_outline{--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error-text);--dhx-gantt-btn-border-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-base-colors-error-active)}.dhx_gantt_button_link,.gantt_qi_big_icon{padding:6px 0;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}@font-face{font-family:dhx-gantt-icons;src:url(data:font/woff;base64,d09GRgABAAAAAAc4AAsAAAAADHgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQQAAAGA9+EtyY21hcAAAAYgAAACQAAACQhPM9m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MabQzczNdF1Z9XOroMHqXQ2mj0c/S/Ky9dcuaB0wZXdu/mXbDq5KZ3ouqtqV9dBlefsG9MHdo1T/+tMZtO45eOGv/hx7OPW4seKSY9VBwrkIL6+5s555u0D27cFg2//646/fPNH8UD88vjP+/dff32xKqlHD/zAstSB//l/82PFjw0T+/Urzl8H32THjRw57pYJ8yKfqE/VJ5F5LKvNj2V/bfylI9YQ6/il8ddsbOCjtbdsuvzccrv4y5rOl0Vrvyyu2e2tsb9b1q8sWXb1qCR5rMitEvIZyY21p2b7D5pDkDvBOQkZpuNiSDThpNhVcQfEAz7eJVhqJUvcNzxmyS9PKwIc4F4oygL8KkUknJXoW/t9+GqsER4ZuuG4V0sUYFn946ugd6upTcOL4cYLNGGGU+VyUvtO5p8mpqJl0ZuM2wN7KgxEtCiXfHGWNACFAnKIhDDv7jZBCDWuCAYeQnPZnCo2aktfb3WhucLqJkQXq6KVgZtr8lmMiVg+hAq2GVaDIFmrSQXPqy39t1YXNsesbipEWRUpafpImgu/ZIV2W257FMn9SJi+wc6hZ0Vrma/+gZMnVHVRKZ/iBAjcC2g17CotthExyjBFdSQUCIHUxHSGUQonMh3K0ri3VIwUM+22HNujSI4fCdM34J059NysAxV1/4GTT7yjqCmomqtPBLs49wI6ZtiHMWkxSePGGFXUZYqKYzemoRykTDGZ1POdYZQC1yFnOlBavZmmpNixEh/5ocCfyj6IiCGmWOISt3jEK77P6Gp+CUhQQhKWiORxd520raat1vbMtLa6GBxvlBPN06Xr4hgowac/M2ES7j1KG8AY3tEkAvqjgQcTBa+/7Ez21ukZ0GfCRv5duaohgMCjwnckqV2AxY99uCiZzhDH2zgtAs5nqM+7jeyue72MVL7XpDegKczprSLTjBr0pW5bT2nxETjLAAA=) format("woff2")}.dhx_gantt_icon:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.dhx_gantt_icon.dhx_gantt_icon_arrow_down:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_arrow_up:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_close:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_left_dotted:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_left_solid:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_right_dotted:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_constraint_right_solid:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_delete:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_dots_vertical:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_edit:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_menu_down:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_menu_right:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_minus:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_plus:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_rounded_arrow_right:before{content:""}.dhx_gantt_icon.dhx_gantt_icon_timer:before{content:"";max-width:100%;max-height:100%;font-size:1em}.gantt_container{background:var(--dhx-gantt-container-background);color:var(--dhx-gantt-container-color);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);border:1px solid var(--dhx-gantt-base-colors-border);position:relative;white-space:nowrap;overflow-x:hidden;overflow-y:hidden}.gantt_touch_active{overscroll-behavior:none}.gantt_task_scroll{overflow-x:scroll}.gantt_task,.gantt_grid{position:relative;overflow-x:hidden;overflow-y:hidden;display:inline-block;vertical-align:top}.gantt_grid_scale,.gantt_task_scale{font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);border-bottom:var(--dhx-gantt-scale-border-horizontal);box-sizing:border-box}.gantt_grid_scale{background:var(--dhx-gantt-grid-scale-background);color:var(--dhx-gantt-grid-scale-color)}.gantt_task_scale{background:var(--dhx-gantt-timeline-scale-background);color:var(--dhx-gantt-timeline-scale-color)}.gantt_task_vscroll{background:var(--dhx-gantt-container-background)}.gantt_scale_line{box-sizing:border-box;border-top:var(--dhx-gantt-scale-border-horizontal)}.gantt_scale_line:first-child{border-top:none}.gantt_grid_head_cell{display:inline-block;vertical-align:top;border-right:var(--dhx-gantt-grid-scale-border-vertical);text-align:center;position:relative;cursor:default;height:100%;box-sizing:border-box;overflow:hidden}.gantt_scale_line{clear:both}.gantt_grid_data{width:100%;overflow:hidden;position:relative;background:var(--dhx-gantt-grid-body-background)}.gantt_row{position:relative;-webkit-user-select:none;user-select:none}.gantt_add,.gantt_grid_head_add{width:100%;height:100%;cursor:pointer;position:relative;opacity:.6}.gantt_add:before,.gantt_grid_head_add:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_add:before,.gantt_grid_head_add:before{content:""}.gantt_grid_head_cell.gantt_grid_head_add{opacity:.6;top:0}.gantt_grid_head_cell.gantt_grid_head_add:hover{opacity:1}.gantt_grid_data .gantt_row:hover,.gantt_grid_data .gantt_row.odd:hover{background-color:var(--dhx-gantt-base-colors-hover-color)}.gantt_grid_data .gantt_row:hover .gantt_add{opacity:1}.gantt_task_row,.gantt_row{border-bottom:var(--dhx-gantt-task-row-border);background:var(--dhx-gantt-task-row-background)}.gantt_row.odd,.gantt_task_row.odd{background:var(--dhx-gantt-task-row-background--odd)}.gantt_row,.gantt_cell,.gantt_task_row,.gantt_task_cell,.gantt_grid_head_cell,.gantt_scale_cell{box-sizing:border-box}.gantt_grid_head_cell,.gantt_scale_cell{line-height:inherit}.gantt_grid_scale .gantt_grid_column_resize_wrap{cursor:col-resize;position:absolute;width:13px;margin-left:-7px}.gantt_grid_column_resize_wrap .gantt_grid_column_resize{background-color:var(--dhx-gantt-base-colors-border);height:100%;width:1px;margin:0 auto}.gantt_task_grid_row_resize_wrap{cursor:row-resize;position:absolute;height:13px;margin-top:-7px;left:0;width:100%}.gantt_task_grid_row_resize_wrap .gantt_task_grid_row_resize{background-color:var(--dhx-gantt-base-colors-border-light);top:6px;height:1px;width:100%;margin:0 auto;position:relative}.gantt_drag_marker{pointer-events:none}.gantt_drag_marker.gantt_grid_resize_area,.gantt_drag_marker.gantt_row_grid_resize_area{background-color:#e7e7e780;height:100%;width:100%}.gantt_drag_marker.gantt_grid_resize_area{border-left:var(--dhx-gantt-scale-border-vertical);border-right:var(--dhx-gantt-scale-border-vertical)}.gantt_drag_marker.gantt_row_grid_resize_area{border-top:var(--dhx-gantt-scale-border-horizontal);border-bottom:var(--dhx-gantt-scale-border-horizontal)}.gantt_row{display:flex}.gantt_row>div{flex-shrink:0;flex-grow:0}.gantt_cell{vertical-align:top;border-right:var(--dhx-gantt-grid-cell-border);padding-left:6px;padding-right:6px;height:100%;overflow:hidden;white-space:nowrap}.gantt_cell_tree{display:flex;gap:4px;flex-wrap:nowrap}.gantt_grid_scale .gantt_last_cell,.gantt_grid_data .gantt_last_cell,.gantt_task .gantt_task_scale .gantt_scale_cell.gantt_last_cell,.gantt_task_bg .gantt_last_cell{border-right-width:0px}.gantt_task .gantt_task_scale .gantt_scale_cell.gantt_last_cell{border-right-width:1px}.gantt_task_bg{overflow:hidden}.gantt_scale_cell{position:relative;display:inline-block;white-space:nowrap;overflow:hidden;border-right:var(--dhx-gantt-grid-scale-border-vertical);text-align:center;height:100%}.gantt_task_cell{display:inline-block;height:100%;border-right:var(--dhx-gantt-timeline-scale-border-vertical)}.gantt_layout_cell.gantt_ver_scroll{width:0px;background-color:transparent;height:1px;overflow-x:hidden;overflow-y:scroll;position:absolute;right:0;z-index:1}.gantt_ver_scroll>div{width:1px;height:1px}.gantt_hor_scroll{height:0px;background-color:transparent;width:100%;clear:both;overflow-x:scroll;overflow-y:hidden}.gantt_layout_cell .gantt_hor_scroll{position:absolute}.gantt_hor_scroll>div{width:5000px;height:1px}.gantt_tree_indent,.gantt_tree_icon{flex-grow:0;flex-shrink:0}.gantt_tree_indent{width:15px;height:100%}.gantt_tree_content,.gantt_tree_icon{vertical-align:top}.gantt_tree_icon{width:28px;height:100%;background-repeat:no-repeat;background-position:center center}.gantt_tree_content{height:100%;white-space:nowrap;min-width:0;overflow:hidden;width:auto;text-overflow:ellipsis}.gantt_tree_icon.gantt_open,.gantt_tree_icon.gantt_close{width:20px;cursor:pointer}.gantt_tree_icon.gantt_open:before,.gantt_tree_icon.gantt_close:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_tree_icon.gantt_open:before{content:""}.gantt_tree_icon.gantt_close:before{content:""}.gantt_tree_icon.gantt_blank{width:18px}.gantt_tree_icon.gantt_folder_open,.gantt_tree_icon.gantt_folder_closed,.gantt_tree_icon.gantt_file{display:none}.gantt_grid_head_cell .gantt_sort{position:absolute;right:5px;top:0;width:7px;height:13px}.gantt_grid_head_cell .gantt_sort.gantt_asc:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_grid_head_cell .gantt_sort.gantt_asc:before{content:""}.gantt_grid_head_cell .gantt_sort.gantt_desc:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_grid_head_cell .gantt_sort.gantt_desc:before{content:""}.gantt_inserted,.gantt_updated{font-weight:700}.gantt_deleted{text-decoration:line-through}.gantt_invalid{background-color:#ffe0e0}.gantt_error{color:var(--dhx-gantt-base-colors-error)}.gantt_status{right:1px;padding:5px 10px;background:#9b9b9b1a;position:absolute;top:1px;transition:opacity .2s;opacity:0}.gantt_status.gantt_status_visible{opacity:1}#gantt_ajax_dots span{transition:opacity .2s;background-repeat:no-repeat;opacity:0}#gantt_ajax_dots span.gantt_dot_visible{opacity:1}.gantt_column_drag_marker{border:var(--dhx-gantt-grid-scale-border-vertical);opacity:.8;pointer-events:none}.gantt_grid_head_cell_dragged{border:var(--dhx-gantt-grid-scale-border-vertical);opacity:.3}.gantt_grid_target_marker{position:absolute;top:0;width:2px;height:100%;background-color:var(--dhx-gantt-base-colors-primary);transform:translate(-1px)}.gantt_grid_target_marker:before,.gantt_grid_target_marker:after{display:block;content:"";position:absolute;left:-5px;width:0px;height:0px;border:6px solid transparent}.gantt_grid_target_marker:before{border-top-color:var(--dhx-gantt-base-colors-primary)}.gantt_grid_target_marker:after{bottom:0;border-bottom-color:var(--dhx-gantt-base-colors-primary)}.gantt_message_area{position:fixed;right:5px;width:320px;z-index:1000}.gantt-info{min-width:120px;padding:12px;font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);font-weight:var(--dhx-gantt-regular-font-weight);line-height:var(--dhx-gantt-regular-line-height);z-index:14;overflow:hidden;margin:5px 5px 10px;transition:all .5s ease;background:var(--dhx-gantt-info-background);color:var(--dhx-gantt-info-color);border:var(--dhx-gantt-info-border);box-shadow:var(--dhx-gantt-info-shadow)}.gantt-info.hidden{height:0px;padding:0;border-width:0px;margin:0;overflow:hidden}.gantt_modal_box{overflow:hidden;position:fixed;min-width:300px;width:var(--dhx-gantt-modal-width);background:var(--dhx-gantt-modal-background);box-shadow:var(--dhx-gantt-box-shadow-l);border:var(--dhx-gantt-modal-border);z-index:18;border-radius:var(--dhx-gantt-modal-border-radius);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);color:var(--dhx-gantt-popup-color);line-height:150%}.gantt_popup_title{border-top-left-radius:var(--dhx-gantt-modal-border-radius);border-top-right-radius:var(--dhx-gantt-modal-border-radius);text-transform:uppercase;font-weight:var(--dhx-gantt-heading-font-weight);padding:calc(var(--dhx-gantt-modal-padding)/2) var(--dhx-gantt-modal-padding);display:flex;justify-content:center;align-items:center}.gantt_popup_text{padding:var(--dhx-gantt-modal-padding);display:flex;justify-content:center;align-items:center}.gantt_popup_controls{display:flex;flex-direction:var(--dhx-gantt-btn-order);padding:calc(var(--dhx-gantt-modal-padding)/2) var(--dhx-gantt-modal-padding);align-items:center;gap:12px}.gantt-info,.gantt_popup_button,.gantt_button{-webkit-user-select:none;user-select:none;cursor:pointer}.gantt_popup_text{overflow:hidden}div.dhx_modal_cover{background:#44494e;opacity:.2;position:fixed;z-index:17;left:0;top:0;width:100%;height:100%;border:none}.gantt_popup_controls{border-radius:var(--dhx-gantt-border-radius)}.gantt_message_area .gantt-error{--dhx-gantt-info-background: var(--dhx-gantt-base-colors-error);--dhx-gantt-info-color: var(--dhx-gantt-base-colors-text-on-fill)}.gantt_message_area .gantt-warning{--dhx-gantt-info-background: var(--dhx-gantt-base-colors-warning);--dhx-gantt-info-color: var(--dhx-gantt-base-colors-text-on-fill)}.gantt_grid div,.gantt_data_area div{-ms-touch-action:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.gantt_data_area{position:relative;overflow-x:hidden;overflow-y:hidden;-webkit-user-select:none;user-select:none}.gantt_links_area{position:absolute;left:0;top:0}.gantt_task_content,.gantt_task_progress,.gantt_side_content{line-height:inherit;overflow:hidden;height:100%}.gantt_task_content{font-size:var(--dhx-gantt-task-font-size);color:var(--dhx-gantt-task-color);width:100%;padding-top:1px;top:0;cursor:pointer;position:absolute;white-space:nowrap;text-align:center}.gantt_task_progress{text-align:center;z-index:0;background:var(--dhx-gantt-task-progress-color)}.gantt_task_progress_wrapper{border-radius:inherit;position:relative;width:100%;height:100%;overflow:hidden}.gantt_task_line{border-radius:var(--dhx-gantt-task-border-radius);position:absolute;box-sizing:border-box;background:var(--dhx-gantt-task-background);border:var(--dhx-gantt-task-border);-webkit-user-select:none;user-select:none}.gantt_task_line.gantt_drag_move div{cursor:move}.gantt_touch_move,.gantt_touch_progress,.gantt_touch_resize{transform:scale(1.02,1.1);transform-origin:50%}.gantt_touch_progress .gantt_task_progress_drag,.gantt_touch_resize .gantt_task_drag{transform:scaleY(1.3);transform-origin:50%}.gantt_side_content{position:absolute;white-space:nowrap;color:var(--dhx-gantt-base-colors-text-light);top:0;font-size:calc(var(--dhx-gantt-task-font-size) - 1px)}.gantt_side_content.gantt_left{right:100%;padding-right:var(--dhx-gantt-base-padding)}.gantt_side_content.gantt_right{left:100%;padding-left:var(--dhx-gantt-base-padding)}.gantt_side_content.gantt_link_crossing{margin-top:-6px}.gantt_task_link .gantt_line_wrapper,.gantt_link_arrow,.gantt_link_corner{position:absolute;cursor:pointer}.gantt_line_wrapper div{background-color:var(--dhx-gantt-link-background)}.gantt_link_corner{box-sizing:content-box!important;border-color:var(--dhx-gantt-link-background);background-color:transparent}.gantt_task_link:hover{--dhx-gantt-link-background: var(--dhx-gantt-link-background-hover)}.gantt_task_link:hover>div{z-index:1}.gantt_task_link div.gantt_link_arrow{color:var(--dhx-gantt-link-background)}.gantt_task_link div.gantt_link_arrow:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_task_link div.gantt_link_arrow:before{content:""}.gantt_link_control{position:absolute;width:calc(var(--dhx-gantt-link-handle-offset) + var(--dhx-gantt-link-handle-size));top:50%;display:flex;align-items:center;transition:all var(--dhx-gantt-base-transition)}.gantt_link_control div{display:none;cursor:pointer;box-sizing:border-box;position:relative;border:2px solid var(--dhx-gantt-link-handle-border);border-radius:50%;height:var(--dhx-gantt-link-handle-size);width:var(--dhx-gantt-link-handle-size);background:var(--dhx-gantt-link-handle-background)}.gantt_link_control div:hover{--dhx-gantt-link-handle-background: var(--dhx-gantt-link-handle-background-hover);--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover)}.gantt_link_control.task_left{transform:translate(-100%,-50%);left:0;justify-content:flex-start}.gantt_link_control.task_right{transform:translate(100%,-50%);right:0;justify-content:flex-end}.gantt_task_line.gantt_link_source .gantt_link_control div,.gantt_task_line.gantt_selected .gantt_link_control div,.gantt_task_line:hover .gantt_link_control div,.gantt_task_line.gantt_drag_move .gantt_link_control div,.gantt_task_line.gantt_drag_resize .gantt_link_control div,.gantt_task_line.gantt_link_source .gantt_task_drag,.gantt_task_line.gantt_selected .gantt_task_drag,.gantt_task_line:hover .gantt_task_drag,.gantt_task_line.gantt_drag_move .gantt_task_drag,.gantt_task_line.gantt_drag_resize .gantt_task_drag{display:block}.gantt_task_line.gantt_selected .gantt_task_progress_drag,.gantt_task_line:hover .gantt_task_progress_drag,.gantt_task_line.gantt_drag_progress .gantt_task_progress_drag{display:flex}.gantt_link_target .gantt_link_control div{display:block}.gantt_link_source,.gantt_link_target{box-shadow:0 0 3px var(--dhx-gantt-base-colors-primary)}.gantt_link_target.link_start_allow,.gantt_link_target.link_finish_allow{box-shadow:0 0 3px var(--dhx-gantt-base-colors-success)}.gantt_link_target.link_start_deny,.gantt_link_target.link_finish_deny{box-shadow:0 0 3px var(--dhx-gantt-base-colors-error)}.gantt_link_from_start .gantt_link_control.task_start_date div,.gantt_link_from_end .gantt_link_control.task_end_date div,.link_start_allow .gantt_link_control.task_start_date div,.link_finish_allow .gantt_link_control.task_end_date div{--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-primary)}.link_start_deny .gantt_link_control.task_start_date div,.link_finish_deny .gantt_link_control.task_end_date div{--dhx-gantt-link-handle-border: var(--dhx-gantt-link-handle-border-hover);--dhx-gantt-link-handle-background: var(--dhx-gantt-base-colors-error)}.gantt_link_arrow_left{transform:rotate(180deg)}.gantt_task_drag,.gantt_task_progress_drag{cursor:ew-resize;display:none;position:absolute}.gantt_task_drag.task_right{cursor:e-resize}.gantt_task_drag.task_left{cursor:w-resize}.gantt_task_drag{height:16px;width:8px;z-index:1;top:-1px}.gantt_task_drag.task_left{left:-7px}.gantt_task_drag.task_right{right:-7px}.gantt_task_progress_drag{height:70%;min-height:12px;bottom:-3px;transform:translate(-50%);z-index:1;align-items:flex-end}.gantt_task_progress_drag:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.gantt_link_tooltip{box-shadow:3px 3px 3px #0003;background-color:var(--dhx-gantt-popup-background);border-left:1px solid var(--dhx-gantt-base-colors-border);border-top:1px solid var(--dhx-gantt-base-colors-border);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);color:var(--dhx-gantt-popup-color);padding:var(--dhx-gantt-base-padding);line-height:var(--dhx-gantt-regular-line-height)}.gantt_link_direction{height:0px;border:none;border-bottom:2px dashed var(--dhx-gantt-base-colors-primary);transform-origin:0% 0%;z-index:2;margin-left:1px;position:absolute}.gantt_grid_data .gantt_row.gantt_selected,.gantt_grid_data .gantt_row.odd.gantt_selected{background-color:var(--dhx-gantt-base-colors-select)}.gantt_row_project{font-weight:500}.gantt_task_row.odd.gantt_selected,.gantt_task_row.gantt_selected{background-color:var(--dhx-gantt-base-colors-select)}.gantt_task_line.gantt_selected{box-shadow:var(--dhx-gantt-box-shadow-s)}.gantt_cal_quick_info.gantt_project,.gantt_task_line.gantt_project{--dhx-gantt-task-color: var(--dhx-gantt-project-color);--dhx-gantt-task-background: var(--dhx-gantt-project-background);--dhx-gantt-task-progress-color: var(--dhx-gantt-project-progress-color)}.gantt_task_line.gantt_project.gantt_task_line_planned{--dhx-gantt-task-background: var(--dhx-gantt-base-colors-text-light)}.gantt_task_line_planned{--dhx-gantt-scheduled-summary-bracket-size: 8px}.gantt_task_line_planned:before,.gantt_task_line_planned:after{content:"";position:absolute;top:0;width:0;height:0;border-style:solid;border-color:transparent}.gantt_task_line_planned:before{border-width:var(--dhx-gantt-scheduled-summary-bracket-size) var(--dhx-gantt-scheduled-summary-bracket-size) 0 0;border-right-color:var(--dhx-gantt-task-background);transform:rotate(180deg)}.gantt_task_line_planned:after{border-width:0 var(--dhx-gantt-scheduled-summary-bracket-size) var(--dhx-gantt-scheduled-summary-bracket-size) 0;border-right-color:var(--dhx-gantt-task-background);right:0}.gantt_task_line_actual{opacity:.3;--dhx-gantt-task-border-radius: 2px}.gantt_task_line.gantt_project.gantt_project_scheduling_conflict .gantt_task_line_actual{--dhx-gantt-task-background: var(--dhx-gantt-base-colors-error)}.gantt_task_line.gantt_project.gantt_selected{box-shadow:var(--dhx-gantt-box-shadow-s)}.gantt_task_line.gantt_milestone{--dhx-gantt-task-background: var(--dhx-gantt-milestone-background);visibility:hidden;border:none;box-sizing:content-box}.gantt_task_line.gantt_milestone div{visibility:visible}.gantt_task_line.gantt_milestone .gantt_task_content{background:inherit;border:inherit;border-width:1px;border-radius:inherit;box-sizing:border-box;transform:rotate(45deg)}.gantt_critical_task{--dhx-gantt-task-background: var(--dhx-gantt-link-critical-background)}.gantt_critical_task .gantt_task_progress{--dhx-gantt-task-progress: rgba(0, 0, 0, .4)}.gantt_critical_link{--dhx-gantt-link-background: var(--dhx-gantt-link-critical-background)}.gantt_link_arrow{--dhx-gantt-base-colors-icons: var(--dhx-gantt-link-background)}.gantt_row:focus,.gantt_cell:focus,.gantt_btn_set:focus,.gantt_qi_big_icon:focus,.gantt_popup_button:focus,.gantt_grid_head_cell:focus{box-shadow:inset 0 0 1px 1px var(--dhx-gantt-base-colors-primary)}.gantt_split_parent,.gantt_split_subproject{opacity:.1;pointer-events:none}.gantt_rollup_child .gantt_link_control,.gantt_rollup_child:hover .gantt_link_control{display:none}.gantt_unselectable,.gantt_unselectable div{-webkit-user-select:none;user-select:none}.gantt_common_input{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.gantt_common_input:focus,.gantt_common_input:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_common_input:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_one_line_input{height:var(--dhx-gantt-control-height)}.gantt_cal_cover,.gantt_cal_cover *{box-sizing:border-box}.gantt_cal_light{margin-top:auto;margin-bottom:auto;min-width:var(--dhx-gantt-lightbox-width);width:max-content;max-width:var(--dhx-gantt-lightbox-max-width);height:auto;-webkit-tap-highlight-color:transparent;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);position:absolute;z-index:15;font-family:var(--dhx-gantt-lightbox_font-family);font-size:var(--dhx-gantt-lightbox-font-size);font-weight:var(--dhx-gantt-lightbox-font-weight);line-height:142%;border:var(--dhx-gantt-lightbox-border);border-radius:var(--dhx-gantt-popup-border-radius)}.gantt_cal_light.gantt_cal_light_wide{--dhx-gantt-lightbox-width: var(--dhx-gantt-lightbox-wide-max-width);--dhx-gantt-lightbox-max-width: var(--dhx-gantt-lightbox-wide-max-width)}.gantt_cal_light textarea,.gantt_cal_light input,.gantt_cal_light select{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0}.gantt_cal_light textarea:focus,.gantt_cal_light input:focus,.gantt_cal_light select:focus,.gantt_cal_light textarea:focus-visible,.gantt_cal_light input:focus-visible,.gantt_cal_light select:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_cal_light textarea:disabled,.gantt_cal_light input:disabled,.gantt_cal_light select:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_cal_light input,.gantt_cal_light select{height:var(--dhx-gantt-control-height)}.gantt_cal_light input[type=select],.gantt_cal_light input[type=checkbox]{height:var(--dhx-gantt-checkbox-height)}.gantt_cal_light .gantt_time{display:none}.gantt_cal_ltitle{font-size:var(--dhx-gantt-lightbox-title-font-size);font-weight:var(--dhx-gantt-heading-font-weight);line-height:142%;background:var(--dhx-gantt-lightbox-title-background);color:var(--dhx-gantt-lightbox-title-color);border-bottom:var(--dhx-gantt-default-border);padding:calc(var(--dhx-gantt-base-padding) * 3) var(--dhx-gantt-lightbox-padding);overflow:hidden;white-space:nowrap;display:flex;flex-direction:row;justify-content:space-between;gap:calc(var(--dhx-gantt-base-padding) * 2);border-top-right-radius:var(--dhx-gantt-popup-border-radius);border-top-left-radius:var(--dhx-gantt-popup-border-radius)}.gantt_cal_ltitle .gantt_mark{display:none}.gantt_cal_ltitle .gantt_cal_ltitle_descr{overflow:hidden;text-overflow:ellipsis}.gantt_cal_ltitle .gantt_cal_ltitle_controls{cursor:pointer;--dhx-gantt-icon-size: 18px}.gantt_cal_light_rtl{direction:rtl}.gantt_cal_light_wide.gantt_cal_light_rtl .gantt_custom_button{right:auto;left:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_section_constraint [data-constraint-time-select]{margin-left:20px}.gantt_cal_larea{border:none;padding:0 var(--dhx-gantt-lightbox-padding) 4px;overflow:hidden;height:auto;gap:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_cal_cover{width:100%;height:100%;position:fixed;z-index:16;top:0;left:0;background-color:#0000004d;display:flex;justify-content:center;align-items:center;overflow:auto}.gantt_lightbox_time_select{min-width:80px}.gantt_lightbox_day_select{min-width:60px}.gantt_lightbox_month_select{min-width:110px}.gantt_lightbox_year_select{min-width:77px}.gantt_cal_light_full{width:auto}.gantt_cal_light_wide .gantt_cal_larea{display:flex;flex-direction:column;padding-top:12px;gap:12px}.gantt_cal_light_wide .gantt_wrap_section{display:flex;flex:0;position:relative}.gantt_cal_light_wide .gantt_cal_lsection{width:120px;justify-content:start;align-items:start;flex-shrink:0;margin-top:0;margin-bottom:0;padding:4px 8px}.gantt_cal_light_wide .gantt_custom_button{position:absolute;left:auto;right:calc(var(--dhx-gantt-base-padding) * 2)}.gantt_cal_light_wide .gantt_cal_ltext{flex:1}.gantt_cal_light_wide .gantt_section_time{justify-content:start}.gantt_cal_light_wide .gantt_fullday{margin-left:unset}.gantt_duration{display:flex;justify-content:flex-start;align-items:center;gap:4px}.gantt_duration .gantt_duration_end_date{color:var(--dhx-gantt-base-colors-text-light);min-width:130px}.gantt_duration .gantt_duration_value,.gantt_duration .gantt_duration_dec,.gantt_duration .gantt_duration_inc{border-radius:2px;background-color:var(--dhx-gantt-lightbox-background);color:var(--dhx-gantt-lightbox-color);border:var(--dhx-gantt-lightbox-control-border);font-size:var(--dhx-gantt-lightbox-font-sizeeduler);padding:6px 8px;box-sizing:border-box;margin-top:0;margin-bottom:0;text-align:center}.gantt_duration .gantt_duration_value:focus,.gantt_duration .gantt_duration_dec:focus,.gantt_duration .gantt_duration_inc:focus,.gantt_duration .gantt_duration_value:focus-visible,.gantt_duration .gantt_duration_dec:focus-visible,.gantt_duration .gantt_duration_inc:focus-visible{border-color:var(--dhx-gantt-base-colors-primary);outline:none}.gantt_duration .gantt_duration_value:disabled,.gantt_duration .gantt_duration_dec:disabled,.gantt_duration .gantt_duration_inc:disabled{background-color:var(--dhx-gantt-base-colors-disabled);color:var(--dhx-gantt-base-colors-icons)}.gantt_duration_inputs{display:flex}.gantt_duration .gantt_duration_value{width:40px;padding:3px 4px;border-left-width:0;border-right-width:0;border-radius:0}.gantt_duration .gantt_duration_value.gantt_duration_value_formatted{width:70px}.gantt_duration .gantt_duration_dec,.gantt_duration .gantt_duration_inc{width:26px;padding:1px 4px;color:var(--dhx-gantt-base-colors-primary);font-size:18px;border-radius:var(--dhx-gantt-border-radius);cursor:pointer}.gantt_duration .gantt_duration_dec{border-top-right-radius:0;border-bottom-right-radius:0}.gantt_duration .gantt_duration_inc{border-top-left-radius:0;border-bottom-left-radius:0}.gantt_duration .gantt_duration_inc{margin-right:4px}.gantt_resources{max-height:150px;height:auto;overflow-y:auto}.gantt_resource_row{display:block;padding:10px 0;border-bottom:1px solid var(--dhx-gantt-base-colors-border-light);cursor:pointer}.gantt_resource_row input[type=checkbox]:not(:checked),.gantt_resource_row input[type=checkbox]:not(:checked)~div{opacity:.5}.gantt_resource_toggle{vertical-align:middle}.gantt_section_resources{overflow:hidden;display:flex;flex-direction:column;width:100%}.gantt_resources_filter{display:flex;flex-grow:0;align-items:center}.gantt_resources_filter label{display:inline-flex;gap:2px;align-items:center}.gantt_resources_filter .gantt_resources_filter_input{padding:1px 6px;box-sizing:border-box}.gantt_resources_filter .switch_unsetted{vertical-align:middle}.gantt_resource_cell{display:inline-block}.gantt_resource_cell.gantt_resource_cell_checkbox{width:24px;max-width:24px;min-width:24px;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_label{width:40%;max-width:40%;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_value{width:30%;max-width:30%;vertical-align:middle}.gantt_resource_cell.gantt_resource_cell_value input,.gantt_resource_cell.gantt_resource_cell_value select{width:80%;vertical-align:middle;padding:1px 2px;box-sizing:border-box}.gantt_resource_cell.gantt_resource_cell_unit{width:10%;max-width:10%;vertical-align:middle}.gantt_resource_early_value{opacity:.8;font-size:.9em}.gantt_cal_lcontrols{display:flex;flex-direction:var(--dhx-gantt-btn-order);gap:calc(var(--dhx-gantt-base-padding)*2);padding:12px var(--dhx-gantt-lightbox-padding)}.gantt_cal_lcontrols .gantt_btn_set{display:flex;flex-direction:row;gap:var(--dhx-gantt-base-padding)}.gantt_cal_lcontrols .gantt_btn_set.gantt_delete_btn_set{--dhx-gantt-icon-size: 18px;padding:6px 0;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-error);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-error-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-error-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent}.gantt_cal_lcontrols .gantt_btn_set:not(.gantt_save_btn_set,.gantt_delete_btn_set){--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled)}.gantt_cal_lcontrols .gantt_btn_set .gantt_btn_inner{display:none}.gantt_cal_lcontrols .gantt_btn_set .gantt_delete_btn:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_cal_lcontrols .gantt_btn_set .gantt_delete_btn:before{content:""}.gantt_cal_lcontrols .gantt_cal_lcontrols_push_right{margin-left:auto}.gantt_cal_ltext textarea{width:100%;height:100%;resize:none;font-family:var(--dhx-gantt-lightbox_font-family);font-size:var(--dhx-gantt-lightbox-font-size);font-weight:var(--dhx-gantt-lightbox-font-weight);line-height:142%}.gantt_section_time_spacer,.gantt_lightbox_minical_spacer{visibility:hidden;height:0;flex-basis:100%}.gantt_section_time{--dhx-gantt-lightbox-time-font-size: var(--dhx-gantt-important-font-size);--dhx-gantt-lightbox-time-font-weight: var(--dhx-gantt-important-font-weight);font-size:var(--dhx-gantt-lightbox-time-font-size);font-weight:var(--dhx-gantt-lightbox-time-font-weight);line-height:142%;display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--dhx-gantt-base-padding) * 2);row-gap:var(--dhx-gantt-base-padding)}.gantt_section_time .gantt_section_time_icon{width:calc(var(--dhx-gantt-base-module) * 2);height:calc(var(--dhx-gantt-base-module) * 2);border-radius:2px;background:var(--dhx-gantt-base-colors-primary)}.gantt_section_duration{gap:16px}.gantt_fullday{margin-left:auto}.gantt_cal_light_rtl .gantt_fullday{margin-left:unset;margin-right:auto}.gantt_cal_lsection label{font-weight:var(--dhx-gantt-heading-font-weight);display:flex;align-items:center;gap:4px;width:100%}.gantt_cal_lsection{display:flex;margin-top:12px;margin-bottom:4px}.gantt_cal_lsection .gantt_custom_button{background:var(--dhx-gantt-btn-background);color:var(--dhx-gantt-btn-color);border:1px solid var(--dhx-gantt-btn-border-color);border-radius:var(--dhx-gantt-border-radius);height:var(--dhx-gantt-control-height);padding:var(--dhx-gantt-btn-padding, 0 20px);display:flex;justify-content:center;align-items:center;box-sizing:border-box;gap:4px;flex-shrink:0;font-weight:500;font-size:var(--dhx-gantt-font-size);font-family:var(--dhx-gantt-font-family);font-weight:var(--dhx-gantt-btn-font-weight, normal);line-height:142%;text-transform:var(--dhx-gantt-btn-text-transform);cursor:pointer;--dhx-gantt-icon-size: 18px;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color);--dhx-gantt-btn-background: var(--dhx-gantt-btn-outline-background);--dhx-gantt-btn-color: var(--dhx-gantt-btn-outline-color);--dhx-gantt-btn-border-color: var(--dhx-gantt-btn-outline-border-color);--dhx-gantt-btn-background-hover: var(--dhx-gantt-btn-outline-background-hover);--dhx-gantt-btn-color-hover: var(--dhx-gantt-btn-outline-color-hover);--dhx-gantt-btn-border-hover: var(--dhx-gantt-btn-outline-border-hover);--dhx-gantt-btn-background-active: var(--dhx-gantt-btn-outline-background-active);--dhx-gantt-btn-color-active: var(--dhx-gantt-btn-outline-color-active);--dhx-gantt-btn-border-active: var(--dhx-gantt-btn-outline-border-active);--dhx-gantt-btn-background-disabled: var(--dhx-gantt-btn-outline-background-disabled);--dhx-gantt-btn-color-disabled: var(--dhx-gantt-btn-outline-color-disabled);--dhx-gantt-btn-border-color-disabled: var(--dhx-gantt-btn-outline-border-color-disabled);order:1;margin-left:auto;margin-right:unset}.gantt_cal_lsection .gantt_custom_button:hover{background:var(--dhx-gantt-btn-background-hover);color:var(--dhx-gantt-btn-color-hover);border-color:var(--dhx-gantt-btn-border-hover)}.gantt_cal_lsection .gantt_custom_button:active{background:var(--dhx-gantt-btn-background-active);color:var(--dhx-gantt-btn-color-active);border-color:var(--dhx-gantt-btn-border-active)}.gantt_cal_lsection .gantt_custom_button:disabled{background:var(--dhx-gantt-btn-background-disabled);color:var(--dhx-gantt-btn-color-disabled);border-color:var(--dhx-gantt-btn-border-disabled)}.gantt_cal_light_rtl .gantt_custom_button{margin-left:unset;margin-right:auto}.gantt_cal_checkbox{display:flex;gap:var(--dhx-gantt-base-padding)}.gantt_cal_wide_checkbox{padding:4px 0}.gantt_cal_radio input{margin:var(--dhx-gantt-base-padding)}.gantt_cal_radio_item{display:flex;gap:var(--dhx-gantt-base-padding);align-items:center}.gantt_cal_radio{display:flex;gap:4px}.gantt_cal_radio_vertical{flex-direction:column;overflow:auto;--dhx-gantt-control-height: 20px}.gantt_cal_lcheckbox,.gantt_cal_lradio{display:flex;flex-wrap:wrap;gap:8px}.gantt_cal_lcheckbox label,.gantt_cal_lradio label{display:flex;align-items:center;gap:4px}.gantt_cal_template{position:relative;padding-top:4px;padding-bottom:4px}.gantt_cal_light .gantt_readonly{color:var(--dhx-gantt-base-colors-readonly)}.gantt_cal_quick_info{--dhx-gantt-quick-info-font-size: var(--dhx-gantt-font-size);position:absolute;z-index:8;font-size:var(--dhx-gantt-quick-info-font-size);background:var(--dhx-gantt-popup-background);color:var(--dhx-gantt-popup-color);border:var(--dhx-gantt-popup-border);padding:calc(var(--dhx-gantt-base-padding)*2) calc(var(--dhx-gantt-base-padding)*3);border-radius:var(--dhx-gantt-border-radius);width:300px;display:flex;flex-direction:column;box-shadow:var(--dhx-gantt-box-shadow-s);transition:left .5s ease,right .5s ease}.gantt_cal_qi_tcontrols{display:flex;justify-content:end;height:8px}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn{min-width:32px;height:32px;border-radius:50%;--dhx-gantt-icon-size: 18px;--dhx-gantt-btn-background: transparent;--dhx-gantt-btn-color: var(--dhx-gantt-base-colors-primary);--dhx-gantt-btn-border-color: transparent;--dhx-gantt-btn-background-hover: transparent;--dhx-gantt-btn-color-hover: var(--dhx-gantt-base-colors-primary-hover);--dhx-gantt-btn-border-hover: transparent;--dhx-gantt-btn-background-active: transparent;--dhx-gantt-btn-color-active: var(--dhx-gantt-base-colors-primary-active);--dhx-gantt-btn-border-active: transparent;--dhx-gantt-btn-background-disabled: transparent;--dhx-gantt-btn-color-disabled: var(--dhx-gantt-base-colors-icons);--dhx-gantt-btn-border-color-disabled: transparent;width:unset;min-width:unset;padding:2px;font-size:18px;cursor:pointer;height:20px;position:relative;z-index:1}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:hover{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-hover)}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:active{--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-icons-active)}.gantt_cal_qi_tcontrols .gantt_cal_qi_close_btn:disabled{--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color-disabled)}.gantt_cal_qi_title,.gantt_cal_qi_controls,.gantt_cal_qi_content{padding:0 calc(var(--dhx-gantt-base-padding) * 3)}.gantt_cal_qi_title{display:flex;flex-direction:column;gap:12px;padding-right:14px}.gantt_cal_qi_tcontent{font-size:var(--dhx-gantt-heading-font-size);font-weight:var(--dhx-gantt-heading-font-weight);line-height:150%;position:relative;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;overflow:hidden;flex-grow:0;text-overflow:ellipsis;white-space:nowrap}.gantt_cal_qi_tcontent>span{text-overflow:ellipsis;overflow:hidden}.gantt_cal_qi_tcontent:before{display:var(--dhx-gantt-quick-info-dot-display, block);content:"";flex-shrink:0;width:8px;height:8px;border-radius:2px;background:var(--dhx-gantt-task-background)}.gantt_cal_qi_tdate{font-size:var(--dhx-gantt-important-font-size);font-weight:var(--dhx-gantt-important-font-weight);line-height:var(--dhx-gantt-important-line-height)}.gantt_cal_qi_content{padding-top:16px;padding-bottom:8px}.gantt_cal_qi_controls{display:flex;flex-direction:row;justify-content:start;align-items:center;padding-top:8px;gap:12px;color:var(--dhx-gantt-base-colors-primary)}.gantt_cal_qi_controls>div:first-child{margin-left:-3px}.gantt_menu_icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;--dhx-gantt-base-colors-icons: var(--dhx-gantt-btn-color)}.dhx_gantt_icon.dhx_gantt_icon_edit,.dhx_menu_icon.dhx_gantt_icon_edit{--dhx-gantt-icon-size: var(--dhx-gantt-font-size)}.gantt_cal_quick_info.gantt_qi_hidden{display:none}.gantt_tooltip{padding:8px 30px 8px 8px;position:absolute;z-index:50;white-space:nowrap;box-shadow:var(--dhx-gantt-box-shadow-m);background:var(--dhx-gantt-tooltip-background);color:var(--dhx-gantt-tooltip-color);border:var(--dhx-gantt-tooltip-border);font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-regular-font-size);line-height:var(--dhx-gantt-regular-line-height);font-weight:var(--dhx-gantt-regular-font-weight);border-radius:var(--dhx-gantt-tooltip-border-radius);display:flex;flex-direction:column;align-items:flex-start;gap:4px}.gantt_resource_marker{position:absolute;text-align:center;font-size:var(--dhx-gantt-font-size);color:#fff}.gantt_resource_marker_ok{background:var(--dhx-gantt-base-colors-success)}.gantt_resource_marker_overtime{background:var(--dhx-gantt-base-colors-error)}.gantt_histogram_label{width:100%;height:100%;position:absolute;z-index:1;font-weight:700;font-size:var(--dhx-gantt-font-size)}.gantt_histogram_fill{background-color:#537cfa4d;background-color:color-mix(in srgb,var(--dhx-gantt-base-colors-primary),transparent 60%);width:100%;position:absolute;bottom:0}.gantt_histogram_hor_bar{height:1px;position:absolute;background:var(--dhx-gantt-base-colors-primary);margin-top:-1px;margin-left:-1px}.gantt_histogram_vert_bar{width:1px;position:absolute;background:var(--dhx-gantt-base-colors-primary);margin-left:-1px}.gantt_histogram_cell{position:absolute;text-align:center;font-size:var(--dhx-gantt-font-size)}.gantt_marker{height:100%;width:1px;top:0;position:absolute;text-align:center;background-color:var(--dhx-gantt-base-colors-error)}.gantt_marker .gantt_marker_content{padding:2px;background:inherit;color:var(--dhx-gantt-base-colors-white);position:absolute;font-size:var(--dhx-gantt-caption-font-size);line-height:var(--dhx-gantt-caption-line-height);font-weight:var(--dhx-gantt-caption-line-weight)}.gantt_marker_area{position:absolute;top:0;left:0}.gantt_grid_editor_placeholder{position:absolute}.gantt_grid_editor_placeholder>div,.gantt_grid_editor_placeholder input,.gantt_grid_editor_placeholder select{width:100%;height:100%;box-sizing:border-box}.gantt_row_placeholder div{opacity:.5}.gantt_row_placeholder .gantt_file,.gantt_row_placeholder .gantt_add{display:none}.gantt_drag_marker.gantt_grid_dnd_marker{background-color:transparent;transition:all .1s ease}.gantt_grid_dnd_marker_line{height:4px;width:100%;background-color:var(--dhx-gantt-base-colors-primary)}.gantt_grid_dnd_marker_line:before{background:var(--dhx-gantt-base-colors-white);width:12px;height:12px;box-sizing:border-box;border:3px solid var(--dhx-gantt-base-colors-primary);border-radius:6px;content:"";line-height:1px;display:block;position:absolute;margin-left:-11px;margin-top:-4px;pointer-events:none}.gantt_grid_dnd_marker_folder{height:100%;width:100%;position:absolute;pointer-events:none;box-sizing:border-box;box-shadow:0 0 0 2px var(--dhx-gantt-base-colors-primary) inset;background:transparent}.gantt_overlay_area{position:absolute;height:inherit;width:inherit;top:0;left:0;display:none}.gantt_overlay{position:absolute;left:0;top:0;height:inherit;width:inherit}.gantt_click_drag_rect{position:absolute;left:0;top:0;outline:1px solid var(--dhx-gantt-base-colors-primary);background-color:var(--dhx-gantt-base-colors-primary-lighter)}.gantt_timeline_move_available,.gantt_timeline_move_available *{cursor:move}.gantt_constraint_marker{position:absolute;pointer-events:none;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-text-light)}.gantt_constraint_marker.gantt_constraint_marker_snlt,.gantt_constraint_marker.gantt_constraint_marker_fnlt,.gantt_constraint_marker.gantt_constraint_marker_mfo{transform:rotate(180deg)}.gantt_constraint_marker svg{display:block;max-height:100%;max-width:100%}.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_snlt,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_fnlt,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_mfo{transform:rotate(0)}.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_snet,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_fnet,.gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_mso{transform:rotate(180deg)}.gantt_rtl .gantt_grid{text-align:right}.gantt_rtl .gantt_row,.gantt_rtl .gantt_cell{flex-direction:row-reverse}.gantt_layout_content{width:100%;overflow:auto;box-sizing:border-box}.gantt_layout_cell{position:relative;box-sizing:border-box}.gantt_layout_cell>.gantt_layout_header{background:#33aae8;color:#fff;font-size:17px;padding:5px 10px;box-sizing:border-box}.gantt_layout_header.collapsed_x{background:#a9a9a9}.gantt_layout_header.collapsed_x .gantt_header_arrow:before{content:"⇧"}.gantt_layout_header.collapsed_y{background:#a9a9a9}.gantt_layout_header.collapsed_y .gantt_header_arrow:before{content:"⇩"}.gantt_layout_header{cursor:pointer}.gantt_layout_header .gantt_header_arrow{float:right;text-align:right}.gantt_layout_header .gantt_header_arrow:before{content:"⇦"}.gantt_layout_header.vertical .gantt_header_arrow:before{content:"⇧"}.gantt_layout_outer_scroll_vertical .gantt_layout_content{overflow-y:hidden}.gantt_layout_outer_scroll_horizontal .gantt_layout_content{overflow-x:hidden}.gantt_layout_x>.gantt_layout_cell{display:inline-block;vertical-align:top}.gantt_layout_x{white-space:nowrap}.gantt_resizing{opacity:.7;background:#f2f2f2}.gantt_layout_cell_border_right.gantt_resizer{overflow:visible;border-right:0}.gantt_resizer{cursor:e-resize;position:relative}.gantt_resizer_y{cursor:n-resize}.gantt_resizer_stick{background:#33aae8;z-index:9999;position:absolute;top:0;width:100%}.gantt_resizer_x .gantt_resizer_x{position:absolute;width:20px;height:100%;margin-left:-10px;top:0;left:0;z-index:1}.gantt_resizer_y .gantt_resizer_y{position:absolute;height:20px;width:100%;top:-10px;left:0;z-index:1}.gantt_resizer_error{background:#cd5c5c!important}.gantt_layout_cell_border_left{border-left:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_right{border-right:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_top{border-top:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_bottom{border-bottom:var(--dhx-gantt-default-border)}.gantt_layout_cell_border_transparent{border-color:transparent}.gantt_window{position:absolute;top:50%;left:50%;z-index:999999999;background:#fff}.gantt_window_content{position:relative}.gantt_window_content_header{background:#39c;color:#fff;height:33px;padding:10px 10px 0;border-bottom:solid 2px #ffffff;position:relative}.gantt_window_content_header_text{padding-left:10%}.gantt_window_content_header_buttons{position:absolute;top:10px;right:10px}.gantt_window_content_header_buttons:hover{color:#000;cursor:pointer}.gantt_window_content_resizer{position:absolute;width:15px;height:15px;bottom:0;line-height:15px;right:-1px;text-align:center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABZJREFUeAFjIAUwUshlpJDLSIhLGAAACQ4AFk79JaMAAAAASUVORK5CYII=);cursor:nw-resize;z-index:999}.gantt_window_content_frame{position:absolute;top:0;left:0;width:100%;height:100%;background:#0000001a;z-index:9999}.gantt_window_drag{cursor:pointer!important}.gantt_window_resizing{overflow:visible}.gantt_window_resizing_body{overflow:hidden!important}.gantt_window_modal{background:#0000001a;z-index:9999;top:0;left:0;width:100%;height:100%;position:fixed}.gantt_container,.gantt_cal_light,.gantt_message_area,.gantt_modal_box,.gantt_cal_quick_info,.gantt_tooltip{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--dhx-gantt-font-family)}.gantt_container,.gantt_container *{box-sizing:border-box}.gantt_noselect{-webkit-user-select:none;user-select:none}.gantt_noselect .gantt_grid_data .gantt_row:hover,.gantt_noselect .gantt_grid_data .gantt_row.odd:hover{background-color:unset}.gantt_drag_marker{position:absolute;top:-1000px;left:-1000px;font-family:var(--dhx-gantt-font-family);font-size:var(--dhx-gantt-font-size);z-index:1;white-space:nowrap;background:var(--dhx-gantt-base-colors-select)}.gantt_drag_marker .gantt_tree_indent,.gantt_drag_marker .gantt_tree_icon.gantt_blank,.gantt_drag_marker .gantt_tree_icon.gantt_open,.gantt_drag_marker .gantt_tree_icon.gantt_close{display:none}.gantt_empty_state_wrapper{position:relative}.gantt_empty_state{height:100%;max-width:500px;box-sizing:border-box;white-space:pre-line;overflow-wrap:break-word;display:flex;flex-direction:column;justify-content:flex-start;margin:0 auto}.gantt_empty_state_image{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWYAAADjCAYAAAC2LL7JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7L15vGVFfS2+vrX3OXfqvj1BQzMLIoNEQdQXhSg4ECeCE63SAooEYhxinjGTL0mb/HjPl2cSE2MUVMQBIQ1PQEQRiTjE5BlxRhNnZGqg6bnvcM7Zu9bvj6rau/Z0hnvPvef27bP6c/vsoXbt2kOtvepb3/oWMMQQQwwxxBBDDDHEEEMMMcQQQwwxxBBDDDHEEEMMMcQQQwwxxBBDDDHEEEMMMcQQQwwxxBBDDLG4kEEXYIilgTdeyzUtwZEBcQSAgyA4iMDBANZDsFKISQITIMYhWJ07fALAFICWAPu0YFaIGQqmBGgS2CPADDS2CvAAFB6MBQ/pKTxw9Rtk76Jf7BBDLHEMifkAwuu38OB6CydphRMAPEEEJ4B4HICjCKwcSKGIfQLcT8GDAvyExI8I/FcY4Z4PXiSPDqRMQwwxYAyJeZni0k/yiCDE6SROB/EUAqcJcOigy9Uj7gdwtwi+CY1/r6/BN973ImkMulBDDLHQGBLzMsGl1/MkIc4U4AwAZwI4ZsBFWgjMgPh/BL4UKNz6wVfLPYMu0BBDLASGxLyf4ne3cEUrxnMEeAGFLwBx1KDLtPiQn4vgFgGuvfLV8r1Bl2aIIfqFITHvR9j0SU6OKfyWEpxP4rkiGBl0mZYKSHxPBB8NA3zsnzbKvkGXZ4gh5oMhMS9xbL6L4QOP4MVCvBaC3wQxOugyLXHsFOADrQDv/+hG2TbowgwxxFwwJOYlisv+LzcwwiYQvwPgyEGXZ3+DAFMg/m5ngPfcsFFmBl2eIYboBUNiXmK47Ho+hVq/Q0TOIxAMujz7O4R4gNR/fvhPg+s2bxY96PIMMUQ3G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ZhCRCB6TYn0mUyxRlJQlq2qZVNoMsWqWev3Dh5ePVcIdioQobd/4ewhWiuvBKkrFeGwUPc7Pe9AKA3kGBl+WoqVZ+5624Vnt7tJOwndD77DjsY3fPrJmQP5wcuJ5AoofRFE9m53mzqsC0IKL5m+HBOdPf8sP3LsCzff3B992u5ER8wdzim880mZeemlkxcp6l0IU1zEwGGRbnLfHQeBYcKJkvQLJa0cm5k9eGxXffltEB0xdzi3cccdfPvtP3ZgZZkuYoMLQHIABgdoB/UR7AoQnTWC42Tw1TzHcRydP3HnP6dyu5t1rqIj5g7nJW5/WPLVsy8eVDS73xg5CMIhERzkzsd9QzCQPoHOgHEKQi9JsXKqxysn77zlyuXtbtv5hI6YO+wq3P7pF+dXD8/t4VU9T2UxT2zmSyPzxDxPxuwBaNc/EyJioOksjDnLoDMF0Rmsrp7t9eXM+Tb0eadi1/8IO3QIEKHv/zvMnV5enGddzKvC7BFWvVJohsXMMPOMGOoZNjMk5+hAGYNSiFcUzLLALIPzBcLKUpnNLdJSsbS4sLh477dcvLSTp13aDeiIuUOHdeD2hyVfOHtiZqbsz5hsX08U96Rc7DH34GK3VQAAAIhJREFU2PSLTGnSZEiVRJlSpS4NFIEyAWkypSKts8ZJdUdAIH0SiCheI4EAao0UxBTS18qsmb70Res1DdMvYfqc5avLZbmaLa2snOkfXt6swUMdOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0KFDhw4dOnTo0OHcxv8HnRxVygJP8F8AAAAASUVORK5CYII=);background-repeat:no-repeat;width:100%;max-width:500px;max-height:500px;margin-left:auto;margin-right:auto;display:block;min-height:0;height:200px;background-size:contain;background-position-x:center;background-position-y:bottom;margin-top:40px}.gantt_empty_state_text{text-align:center}.gantt_empty_state_text_link{color:var(--dhx-gantt-base-colors-primary);background:none;opacity:1;height:unset;cursor:pointer}.gantt_drag_marker .gantt_row.odd{background-color:var(--dhx-gantt-base-colors-select)}.gantt_drag_marker .gantt_row{border-left:var(--dhx-gantt-scale-border-vertical);border-top:var(--dhx-gantt-scale-border-horizontal)}.gantt_drag_marker .gantt_cell{border-color:var(--dhx-gantt-base-colors-border)}.gantt_row.gantt_over,.gantt_task_row.gantt_over{background-color:var(--dhx-gantt-base-colors-primary-active)}.gantt_row.gantt_transparent .gantt_cell{opacity:.7}.gantt_task_row.gantt_transparent{background-color:#537cfa73}.gantt_container_resize_watcher{background:transparent;width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;pointer-events:none;border:0;box-sizing:border-box;opacity:0}.gantt_task_deadline{position:absolute;z-index:5;--dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error);pointer-events:none}.gantt_task_deadline:before{font-family:dhx-gantt-icons!important;font-style:normal;font-weight:400!important;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:flex;justify-content:center;align-items:center;color:var(--dhx-gantt-base-colors-icons);font-size:var(--dhx-gantt-icon-size, 1.5em)}.gantt_task_deadline:before{content:"";max-width:100%;max-height:100%;font-size:1em}.gantt_task_baseline{position:absolute;border-radius:2px;opacity:.9;background:#ffd180;z-index:0;overflow:hidden}.gantt_task_baseline.gantt_milestone_baseline{transform:rotate(45deg)}.gantt_task_baseline.gantt_task_baseline_0{background:var(--dhx-gantt-baseline-background-0)}.gantt_task_baseline.gantt_task_baseline_1{background:var(--dhx-gantt-baseline-background-1)}.gantt_task_baseline.gantt_task_baseline_2{background:var(--dhx-gantt-baseline-background-2)}.gantt_task_baseline.gantt_task_baseline_3{background:var(--dhx-gantt-baseline-background-3)}.gantt_task_baseline.gantt_task_baseline_4{background:var(--dhx-gantt-baseline-background-4)}.gantt_task_baseline.gantt_task_baseline_5{background:var(--dhx-gantt-baseline-background-5)}.gantt_task_baseline.gantt_task_baseline_6{background:var(--dhx-gantt-baseline-background-6)}.gantt_task_baseline.gantt_task_baseline_7{background:var(--dhx-gantt-baseline-background-7)}.gantt_task_baseline.gantt_task_baseline_8{background:var(--dhx-gantt-baseline-background-8)}.gantt_task_baseline.gantt_task_baseline_9{background:var(--dhx-gantt-baseline-background-9)}.gantt_section_baselines{overflow-y:auto;display:flex;flex-direction:column;gap:4px}.gantt_custom_button.gantt_add_baselines{margin-left:0} diff --git a/codebase/dhtmlxgantt.d.ts b/codebase/dhtmlxgantt.d.ts index a1665b3..89e97a6 100644 --- a/codebase/dhtmlxgantt.d.ts +++ b/codebase/dhtmlxgantt.d.ts @@ -1,66 +1,66 @@ -// Type definitions for dhtmlxGantt 9.0.1 +// Type definitions for dhtmlxGantt 9.0.2 // Project: https://dhtmlx.com/docs/products/dhtmlxGantt type GanttCallback = (...args: any[]) => any; -export interface GanttEventCallback { +export interface GanttEventCallback { /** * fires when autoscheduling is done * @param taskId the root task id * @param updatedTasks an array with the ids of rescheduled tasks */ - "onAfterAutoSchedule" (taskId: string|number, updatedTasks: any[]): void; + "onAfterAutoSchedule"(taskId: string | number, updatedTasks: any[]): void; /** * fires after the api/gantt_batchupdate.md method was called */ - "onAfterBatchUpdate" (): void; + "onAfterBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after the task branch was loaded to the page * @param settings an object which contains the task id and request URL */ - "onAfterBranchLoading" (settings: any): void; + "onAfterBranchLoading"(settings: any): void; /** * fires after the user has closed the lightbox (edit form) */ - "onAfterLightbox" (): void; + "onAfterLightbox"(): void; /** * fires after a new link is added to the Gantt chart * @param id the link id * @param link the link object */ - "onAfterLinkAdd" (id: string|number, link: Link): void; + "onAfterLinkAdd"(id: string | number, link: Link): void; /** * fires after the user deletes a link * @param id the link id * @param link the link object */ - "onAfterLinkDelete" (id: string|number, link: Link): void; + "onAfterLinkDelete"(id: string | number, link: Link): void; /** * fires after the user updates a link * @param id the link id * @param link the link object */ - "onAfterLinkUpdate" (id: string|number, link: Link): void; + "onAfterLinkUpdate"(id: string | number, link: Link): void; /** * fires after the pop-up edit form is closed * @param taskId the task id */ - "onAfterQuickInfo" (taskId: string|number): void; + "onAfterQuickInfo"(taskId: string | number): void; /** * fires after the redo() method was called * @param action a user action as an array of command objects */ - "onAfterRedo" (action: any[]): void; + "onAfterRedo"(action: any[]): void; /** * fires after resizing of the row height is finished @@ -69,7 +69,7 @@ export interface GanttEventCallback { * @param oldHeight the old height of the row * @param newHeight the new height of the row */ - "onAfterRowResize" (id: string|number, task: Task, oldHeight: number, newHeight: number): void; + "onAfterRowResize"(id: string | number, task: Task, oldHeight: number, newHeight: number): void; /** * fires after tasks are sorted in the grid @@ -77,14 +77,14 @@ export interface GanttEventCallback { * @param desc optional, the sorting direction: true - descending, false - ascending
* @param parent optional, the id of the parent task, if the tasks were sorted only in the branch of the specified parent */ - "onAfterSort" (field: string|GanttCallback, desc?: boolean, parent?: string|number): void; + "onAfterSort"(field: string | GanttCallback, desc?: boolean, parent?: string | number): void; /** * fires after the user adds a task to the Gantt chart * @param id the task id * @param task the task object */ - "onAfterTaskAdd" (id: string|number, task: Task): void; + "onAfterTaskAdd"(id: string | number, task: Task): void; /** * fires for each task which has been autoscheduled @@ -93,14 +93,14 @@ export interface GanttEventCallback { * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ - "onAfterTaskAutoSchedule" (task: Task, start: Date, link: Link, predecessor: Task): void; + "onAfterTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): void; /** * fires after the user deletes a task * @param id the task id * @param task the task object */ - "onAfterTaskDelete" (id: string|number, task: Task): void; + "onAfterTaskDelete"(id: string | number, task: Task): void; /** * fires after the user has finished to drag and released the mouse button @@ -108,7 +108,7 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ - "onAfterTaskDrag" (id: string|number, mode: string, e: Event): void; + "onAfterTaskDrag"(id: string | number, mode: string, e: Event): void; /** * fires after a task was moved to a new vertical position @@ -116,131 +116,131 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onAfterTaskMove" (id: string|number, parent: string|number, tindex: number): void; + "onAfterTaskMove"(id: string | number, parent: string | number, tindex: number): void; /** * fires after the user updates a task * @param id the task id * @param task the task object */ - "onAfterTaskUpdate" (id: string|number, task: Task): void; + "onAfterTaskUpdate"(id: string | number, task: Task): void; /** * fires after the undo() method was called * @param action an array of command objects */ - "onAfterUndo" (action: any[]): void; + "onAfterUndo"(action: any[]): void; /** * fires if the server returns an error * @param request XML HTTP request object */ - "onAjaxError" (request: any): boolean; + "onAjaxError"(request: any): boolean; /** * fires if some dependency loops were found during auto scheduling * @param groups an array of dependency loops found in gantt */ - "onAutoScheduleCircularLink" (groups: any[]): void; + "onAutoScheduleCircularLink"(groups: any[]): void; /** * fires before auto scheduling * @param taskId the root task id */ - "onBeforeAutoSchedule" (taskId: string|number): boolean; + "onBeforeAutoSchedule"(taskId: string | number): boolean; /** * fires before the api/gantt_batchupdate.md method is called */ - "onBeforeBatchUpdate" (): void; + "onBeforeBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after a user expands the task branch but before loading starts * @param settings an object which contains the task id and request URL */ - "onBeforeBranchLoading" (settings: any): boolean; + "onBeforeBranchLoading"(settings: any): boolean; /** * before gantt exits the fullscreen mode and goes back to normal mode */ - "onBeforeCollapse" (): boolean; + "onBeforeCollapse"(): boolean; /** * fires before data is rendered on the page */ - "onBeforeDataRender" (): void; + "onBeforeDataRender"(): void; /** * fires before gantt is expanded to full screen */ - "onBeforeExpand" (): boolean; + "onBeforeExpand"(): boolean; /** * fires before the dhtmlxGantt initialization is started */ - "onBeforeGanttReady" (): void; + "onBeforeGanttReady"(): void; /** * fires before the Gantt chart is rendered on the page */ - "onBeforeGanttRender" (): void; + "onBeforeGanttRender"(): void; /** * fires immediately before the user opens the lightbox (edit form) * @param id the task id */ - "onBeforeLightbox" (id: string|number): boolean; + "onBeforeLightbox"(id: string | number): boolean; /** * fires before a new link is added to the Gantt chart * @param id the link id * @param link the link object */ - "onBeforeLinkAdd" (id: string|number, link: Link): boolean; + "onBeforeLinkAdd"(id: string | number, link: Link): boolean; /** * fires before the user deletes a link * @param id the link id * @param link the link object */ - "onBeforeLinkDelete" (id: string|number, link: Link): boolean; + "onBeforeLinkDelete"(id: string | number, link: Link): boolean; /** * fires after the links have been loaded to the Gantt chart but before they are displayed * @param id the link id * @param link the link object */ - "onBeforeLinkDisplay" (id: string|number, link: Link): boolean; + "onBeforeLinkDisplay"(id: string | number, link: Link): boolean; /** * fires before a link is updated * @param id the link id * @param new_link the new (updated) object of the link */ - "onBeforeLinkUpdate" (id: string|number, new_link: Link): boolean; + "onBeforeLinkUpdate"(id: string | number, new_link: Link): boolean; /** * fires before selecting a task or a range of tasks * @param e a native event object */ - "onBeforeMultiSelect" (e: Event): void; + "onBeforeMultiSelect"(e: Event): void; /** * fires before data started to be parsed */ - "onBeforeParse" (): void; + "onBeforeParse"(): void; /** * fires before the redo() method is called * @param action a user action as an array of command objects */ - "onBeforeRedo" (action: any[]): boolean; + "onBeforeRedo"(action: any[]): boolean; /** * fires before an action is added into the redo stack * @param action a user action as an array of command objects */ - "onBeforeRedoStack" (action: UndoRedoAction): boolean; + "onBeforeRedoStack"(action: UndoRedoAction): boolean; /** * fires before the rollup task is displayed on its parent project @@ -248,7 +248,7 @@ export interface GanttEventCallback { * @param task the rollup task object * @param parentId the id of the parent (project) task */ - "onBeforeRollupTaskDisplay" (taskId: number|string, task: Task, parentId: number|string): boolean; + "onBeforeRollupTaskDisplay"(taskId: number | string, task: Task, parentId: number | string): boolean; /** * fires when a user drops a row in the grid @@ -256,7 +256,7 @@ export interface GanttEventCallback { * @param parent the parent id. If specified, the tindex will refer to the index in the
'parent' branch * @param tindex the index of the position that the task will be moved from
(the index in the whole tree) */ - "onBeforeRowDragEnd" (sid: string|number, parent: string|number, tindex: number): boolean; + "onBeforeRowDragEnd"(sid: string | number, parent: string | number, tindex: number): boolean; /** * fires before a row of the grid is dragged vertically to a different position @@ -264,13 +264,13 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onBeforeRowDragMove" (id: string|number, parent: string|number, tindex: number): boolean; + "onBeforeRowDragMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the user starts to resize the row height by drag-and-drop * @param task the task object */ - "onBeforeRowResize" (task: Task): boolean; + "onBeforeRowResize"(task: Task): boolean; /** * fires before resizing of the row height is completed @@ -278,7 +278,7 @@ export interface GanttEventCallback { * @param task the task object * @param newHeight the new height of the row */ - "onBeforeRowResizeEnd" (id: number|string, task: Task, newHeight: number): boolean; + "onBeforeRowResizeEnd"(id: number | string, task: Task, newHeight: number): boolean; /** * fires before a part of the split task is displayed on the Gantt chart @@ -286,14 +286,14 @@ export interface GanttEventCallback { * @param task the object of the subtask * @param parent the object of the parent task */ - "onBeforeSplitTaskDisplay" (id: number|string, task: Task, parent: any): boolean; + "onBeforeSplitTaskDisplay"(id: number | string, task: Task, parent: any): boolean; /** * fires before a new task is added to the Gantt chart * @param id the task id * @param task the task object */ - "onBeforeTaskAdd" (id: string|number, task: Task): boolean; + "onBeforeTaskAdd"(id: string | number, task: Task): boolean; /** * fires for each task which is rescheduled @@ -302,7 +302,7 @@ export interface GanttEventCallback { * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ - "onBeforeTaskAutoSchedule" (task: Task, start: Date, link: Link, predecessor: Task): boolean; + "onBeforeTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): boolean; /** * fires after the user has finished dragging and released the mouse button but before the changes are applied @@ -310,21 +310,21 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param task the copy of the task object in its original state (before drag and drop) */ - "onBeforeTaskChanged" (id: string|number, mode: string, task: Task): boolean; + "onBeforeTaskChanged"(id: string | number, mode: string, task: Task): boolean; /** * fires before the user deletes a task * @param id the task id * @param task the task object */ - "onBeforeTaskDelete" (id: string|number, task: Task): boolean; + "onBeforeTaskDelete"(id: string | number, task: Task): boolean; /** * fires after the tasks have been loaded to the Gantt chart, but before they are displayed * @param id the task id * @param task the task object */ - "onBeforeTaskDisplay" (id: string|number, task: Task): boolean; + "onBeforeTaskDisplay"(id: string | number, task: Task): boolean; /** * fires after the user has pressed the mouse button and started dragging, but before dhtmlxGantt starts the drag-and-drop operation @@ -332,7 +332,7 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ - "onBeforeTaskDrag" (id: string|number, mode: string, e: Event): boolean; + "onBeforeTaskDrag"(id: string | number, mode: string, e: Event): boolean; /** * fires before a task is moved to a new vertical position @@ -340,7 +340,7 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onBeforeTaskMove" (id: string|number, parent: string|number, tindex: number): boolean; + "onBeforeTaskMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the task selection state is being changed (the task is being selected or unselected) @@ -348,49 +348,49 @@ export interface GanttEventCallback { * @param state true if the task is going to be selected, false - if unselected * @param e a native event object */ - "onBeforeTaskMultiSelect" (id: string|number, state: boolean, e: Event|null): void; + "onBeforeTaskMultiSelect"(id: string | number, state: boolean, e: Event | null): void; /** * fires before the user selects a task * @param id the task id */ - "onBeforeTaskSelected" (id: string|number): boolean; + "onBeforeTaskSelected"(id: string | number): boolean; /** * fires before the user updates a task * @param id the task id * @param new_task the new (updated) object of the task */ - "onBeforeTaskUpdate" (id: string|number, new_task: Task): void; + "onBeforeTaskUpdate"(id: string | number, new_task: Task): void; /** * fires before the undo() method is called * @param action an array of command objects */ - "onBeforeUndo" (action: any[]): boolean; + "onBeforeUndo"(action: any[]): boolean; /** * fires before an action is added into the undo stack * @param action a user action as an array of command objects */ - "onBeforeUndoStack" (action: UndoRedoAction): boolean; + "onBeforeUndoStack"(action: UndoRedoAction): boolean; /** * fires when the circular reference has been detected and auto scheduling is not possible * @param link the link object * @param group a group of tasks and links connected in a loop */ - "onCircularLinkError" (link: Link, group: any): void; + "onCircularLinkError"(link: Link, group: any): void; /** * fires after all tasks were removed from the Gantt chart by the api/gantt_clearall.md method */ - "onClear" (): void; + "onClear"(): void; /** * fires when gantt went back to normal mode from the full screen mode */ - "onCollapse" (): void; + "onCollapse"(): void; /** * fires when the user is dragging the column's border to resize the column @@ -398,7 +398,7 @@ export interface GanttEventCallback { * @param column the column object * @param new_width the new column's width */ - "onColumnResize" (index: number, column: GridColumn, new_width: number): void; + "onColumnResize"(index: number, column: GridColumn, new_width: number): void; /** * fires after the user finished dragging the column's border to resize the column @@ -406,14 +406,14 @@ export interface GanttEventCallback { * @param column the column object * @param new_width the new column's width */ - "onColumnResizeEnd" (index: number, column: GridColumn, new_width: number): boolean; + "onColumnResizeEnd"(index: number, column: GridColumn, new_width: number): boolean; /** * fires before the user starts to drag the column's border to resize the column * @param index the column index * @param column the column object */ - "onColumnResizeStart" (index: number, column: GridColumn): boolean; + "onColumnResizeStart"(index: number, column: GridColumn): boolean; /** * fires when a user clicks the right mouse button inside the Gantt chart (see the details) @@ -421,95 +421,95 @@ export interface GanttEventCallback { * @param linkId the link id * @param e a native event object */ - "onContextMenu" (taskId: string|number, linkId: string|number, e: Event): void; + "onContextMenu"(taskId: string | number, linkId: string | number, e: Event): void; /** * fires on the `dp.init(gantt)` call * @param DataProcessor the DataProcessor object */ - "onDataProcessorReady" (DataProcessor: any): void; + "onDataProcessorReady"(DataProcessor: any): void; /** * fires after data has been rendered on the page */ - "onDataRender" (): void; + "onDataRender"(): void; /** * called after gantt has been cleared by the api/gantt_destructor.md method */ - "onDestroy" (): void; + "onDestroy"(): void; /** * fires when the user clicks on an empty space in the Gantt chart (not on tasks) * @param e a native event object */ - "onEmptyClick" (e: Event): void; + "onEmptyClick"(e: Event): void; /** * fires when api/gantt_assert.md receives 'false' value, i.e. when assertion fails * @param errorMessage a string with an error from the api/gantt_assert.md method */ - "onError" (errorMessage: string): boolean; + "onError"(errorMessage: string): boolean; /** * fires when gantt is expanded to full screen */ - "onExpand" (): void; + "onExpand"(): void; /** * fires after the Gantt layout is ready, but before it is rendered */ - "onGanttLayoutReady" (): void; + "onGanttLayoutReady"(): void; /** * fires after the dhtmlxGantt initialization is complete but the Gantt chart is not rendered on the page yet */ - "onGanttReady" (): void; + "onGanttReady"(): void; /** * fires after the Gantt chart was rendered on the page */ - "onGanttRender" (): void; + "onGanttRender"(): void; /** * fires when the Gantt chart is scrolled to a particular point * @param left the position of horizontal scroll * @param top the position of vertical scroll */ - "onGanttScroll" (left: number, top: number): void; + "onGanttScroll"(left: number, top: number): void; /** * fires when the user clicks on the grid's header * @param name the name attribute of the column which header the user clicks on * @param e a native event object */ - "onGridHeaderClick" (name: string, e: Event): boolean; + "onGridHeaderClick"(name: string, e: Event): boolean; /** * fires when the user is dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ - "onGridResize" (old_width: number, new_width: number): void; + "onGridResize"(old_width: number, new_width: number): void; /** * fires after the user finished dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ - "onGridResizeEnd" (old_width: number, new_width: number): boolean; + "onGridResizeEnd"(old_width: number, new_width: number): boolean; /** * fires before the user starts to drag the grid's border to resize the grid * @param old_width the initial grid's width */ - "onGridResizeStart" (old_width: number): boolean; + "onGridResizeStart"(old_width: number): boolean; /** * fires after the user has opened the lightbox (edit form) * @param task_id the id of the task opened in the lightbox */ - "onLightbox" (task_id: string|number): void; + "onLightbox"(task_id: string | number): void; /** * fires when the user clicks on a custom button in the lightbox @@ -517,26 +517,26 @@ export interface GanttEventCallback { * @param node an HTML element of the clicked button * @param e a native 'click' event object */ - "onLightboxButton" (css: string, node: HTMLElement, e: Event): void; + "onLightboxButton"(css: string, node: HTMLElement, e: Event): void; /** * fires when the user clicks on the 'Cancel' button in the lightbox * @param id the task id ( the task opened in the lightbox) */ - "onLightboxCancel" (id: string|number): void; + "onLightboxCancel"(id: string | number): void; /** * fires when the structure of the lightbox is changed * @param old_type the name of the initial lighbox's structure * @param new_type the name of the new lighbox's structure */ - "onLightboxChange" (old_type: string, new_type: string): void; + "onLightboxChange"(old_type: string, new_type: string): void; /** * fires when the user clicks on the 'Delete' button in the lightbox * @param id the task id (the task opened in the lightbox) */ - "onLightboxDelete" (id: string|number): boolean; + "onLightboxDelete"(id: string | number): boolean; /** * fires when the user clicks on the 'Save' button in the lightbox @@ -544,90 +544,90 @@ export interface GanttEventCallback { * @param task the modified task object * @param is_new specifies whether the user opens the lightbox to create a new task (true)
or update an existing one (false) */ - "onLightboxSave" (id: string|number, task: Task, is_new: boolean): boolean; + "onLightboxSave"(id: string | number, task: Task, is_new: boolean): boolean; /** * fires when the user clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ - "onLinkClick" (id: string|number, e?: Event): void; + "onLinkClick"(id: string | number, e?: Event): void; /** * fires when a user creates a new link between tasks * @param link the object of a new link */ - "onLinkCreated" (link: Link): boolean; + "onLinkCreated"(link: Link): boolean; /** * fires when the user double clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ - "onLinkDblClick" (id: string|number, e?: Event): boolean; + "onLinkDblClick"(id: string | number, e?: Event): boolean; /** * fires when the id of a link is changed * @param id the current link id * @param new_id the new link id */ - "onLinkIdChange" (id: string|number, new_id: string|number): void; + "onLinkIdChange"(id: string | number, new_id: string | number): void; /** * fires when the user adds a new link and dhtmlxGantt checks whether the link is valid * @param link the link object */ - "onLinkValidation" (link: Link): boolean; + "onLinkValidation"(link: Link): boolean; /** * fires after loading data from the data source has been completed * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ - "onLoadEnd" (url: string, type: string): void; + "onLoadEnd"(url: string, type: string): void; /** * fires immediately before loading data from the data source has been started * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ - "onLoadStart" (url: string, type: string): void; + "onLoadStart"(url: string, type: string): void; /** * fires when the mouse is moved over the gantt container * @param id the id of the task that the mouse is moved over * @param e a native event object */ - "onMouseMove" (id: string|number, e: Event): void; + "onMouseMove"(id: string | number, e: Event): void; /** * fires after selection of a task or a range of tasks has been completed * @param e a native event object */ - "onMultiSelect" (e: Event): void; + "onMultiSelect"(e: Event): void; /** * fires after a collection of options has been loaded from the server, but isn't parsed yet */ - "onOptionsLoad" (): void; + "onOptionsLoad"(): void; /** * fires after data was parsed (became available for API) but before it was rendered in the Gantt chart */ - "onParse" (): void; + "onParse"(): void; /** * fires when the pop-up edit form appears * @param taskId the task id */ - "onQuickInfo" (taskId: string|number): void; + "onQuickInfo"(taskId: string | number): void; /** * fires after the user drops a vertically reordered row in the grid * @param id the id of the task that the user has dragged vertically in the grid * @param target the id of the task which place the dragged row has occupied */ - "onRowDragEnd" (id: string|number, target: string|number): void; + "onRowDragEnd"(id: string | number, target: string | number): void; /** * fires before the user drags a row of the grid to vertically reorder it @@ -635,7 +635,7 @@ export interface GanttEventCallback { * @param target an HTML element of the task that the user drags * @param e a native event object */ - "onRowDragStart" (id: string|number, target: HTMLElement, e: Event): boolean; + "onRowDragStart"(id: string | number, target: HTMLElement, e: Event): boolean; /** * fires when the user is dragging the border of the row to resize the row height @@ -643,45 +643,45 @@ export interface GanttEventCallback { * @param task the task object * @param currentHeight the current height of the row */ - "onRowResize" (id: string|number, task: Task, currentHeight: number): void; + "onRowResize"(id: string | number, task: Task, currentHeight: number): void; /** * fires when the scale is re-rendered in order to display all tasks completely */ - "onScaleAdjusted" (): void; + "onScaleAdjusted"(): void; /** * fires when the user clicks on the cell in the time scale * @param e a native event object * @param date the date of the clicked cell */ - "onScaleClick" (e: Event, date: Date): void; + "onScaleClick"(e: Event, date: Date): void; /** * fires when the user clicks on a task row in the grid area (including the 'expand/collapse' and 'add task' buttons) or on a task bar in the timeline area * @param id the id of the clicked task * @param e optional, a native event object */ - "onTaskClick" (id: string|number, e?: Event): boolean; + "onTaskClick"(id: string | number, e?: Event): boolean; /** * fires when a branch has been closed * @param id the branch id */ - "onTaskClosed" (id: string|number): void; + "onTaskClosed"(id: string | number): void; /** * fires when a user creates a new task by pressing the'+' button in a grid, or when the api/gantt_createtask.md method is called * @param task the object of a new task */ - "onTaskCreated" (task: Task): boolean; + "onTaskCreated"(task: Task): boolean; /** * fires when the user double clicks on a task * @param id the id of the double clicked task * @param e a native event object */ - "onTaskDblClick" (id: string, e?: Event): boolean; + "onTaskDblClick"(id: string, e?: Event): boolean; /** * fires when the user drags a task @@ -691,20 +691,20 @@ export interface GanttEventCallback { * @param original the original(initial) task object * @param e a native event object */ - "onTaskDrag" (id: string|number, mode: string, task: Task, original: Task, e: Event): void; + "onTaskDrag"(id: string | number, mode: string, task: Task, original: Task, e: Event): void; /** * fires when the id of a task is changed * @param id the current task's id * @param new_id the new task's id */ - "onTaskIdChange" (id: string|number, new_id: string|number): void; + "onTaskIdChange"(id: string | number, new_id: string | number): void; /** * fires when a task is being loaded from the data source * @param task the object of a task */ - "onTaskLoading" (task: Task): boolean; + "onTaskLoading"(task: Task): boolean; /** * fires after the task selection state has changed (the task has been selected/unselected) @@ -712,46 +712,49 @@ export interface GanttEventCallback { * @param state true if the task has been selected, false - if unselected * @param e a native event object */ - "onTaskMultiSelect" (id: string|number, state: boolean, e: Event): void; + "onTaskMultiSelect"(id: string | number, state: boolean, e: Event): void; /** * fires when a branch has been opened * @param id the branch id */ - "onTaskOpened" (id: string|number): void; + "onTaskOpened"(id: string | number): void; /** * fires when the user clicks on a row in the table * @param id the task id * @param row an HTML element of the clicked row */ - "onTaskRowClick" (id: string|number, row: HTMLElement): void; + "onTaskRowClick"(id: string | number, row: HTMLElement): void; /** * fires when the user selects a task * @param id the task id */ - "onTaskSelected" (id: string|number): void; + "onTaskSelected"(id: string | number): void; /** * fires when the user unselects a task by selecting some other task * @param id the task id (of the unselected task) */ - "onTaskUnselected" (id: string|number): void; + "onTaskUnselected"(id: string | number): void; /** * fires when the dhtmlxGantt templates are initialized */ - "onTemplatesReady" (): void; + "onTemplatesReady"(): void; } -export interface GanttTemplates { +export interface GanttTemplates { /** * specifies the text displayed inside the baseline element + * @param task the task object associated with the baseline + * @param baseline the baseline object + * @param index the index of the baseline in the task's baselines array */ - baseline_text(): void; + baseline_text(task: Task, baseline: Baseline, index: number): string | number | void; /** * specifies the content of columns that show dates (return `Date` values) in grid @@ -768,7 +771,7 @@ export interface GanttTemplates { * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
to the end of the task */ - drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; + drag_link(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string; /** * specifies the CSS class that will be applied to the pop-up that appears when a user drags a link @@ -777,7 +780,7 @@ export interface GanttTemplates { * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
to the end of the task */ - drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; + drag_link_class(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string | void; /** * converts a date object to a date string. Used to send data back to the server @@ -815,7 +818,7 @@ export interface GanttTemplates { * @param columnName the column's name (as specified in the "name" property of the column object) * @param column column object (as specified in the gantt.config.columns config) */ - grid_header_class(columnName: string, column: any): string; + grid_header_class(columnName: string, column: any): string | void; /** * specifies the indent of the child items in a branch (in the tree column) @@ -835,7 +838,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - grid_row_class(start: Date, end: Date, task: Task): string; + grid_row_class(start: Date, end: Date, task: Task): string | void; /** * defines the height of the filled area in the resourceHistogram @@ -845,7 +848,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): number | void; /** * specifies the height of the line that defines the available capacity of the resource @@ -855,7 +858,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): number | void; /** * defines the CSS class which is applied to a cell of the resource panel @@ -865,7 +868,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | void; /** * defines the label inside a cell @@ -875,13 +878,13 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to a link * @param link the link object */ - link_class(link: Link): string; + link_class(link: Link): string | void; /** * specifies the text in the header of the link's "delete" confirm window @@ -901,7 +904,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - progress_text(start: Date, end: Date, task: Task): string; + progress_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the CSS class that will be applied to the pop-up edit form @@ -909,7 +912,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - quick_info_class(start: Date, end: Date, task: Task): void; + quick_info_class(start: Date, end: Date, task: Task): string | void; /** * specifies the content of the pop-up edit form @@ -933,7 +936,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - quick_info_title(start: Date, end: Date, task: Task): string; + quick_info_title(start: Date, end: Date, task: Task): string | number | void; /** * defines the CSS class names of cells in the resource timeline cells @@ -943,7 +946,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): string; + resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | void; /** * defines the HTML content of resource timeline cells @@ -953,19 +956,19 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): string; + resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to cells of the time scale of the timeline area * @param date the date of a cell */ - scale_cell_class(date: Date): string; + scale_cell_class(date: Date): string | void; /** * specifies the CSS class that will be applied to the time scale * @param scale the scale's configuration object */ - scale_row_class(scale: Scale): string; + scale_row_class(scale: Scale): string | void; /** * specifies the CSS class that will be applied to task bars @@ -973,7 +976,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_class(start: Date, end: Date, task: Task): string; + task_class(start: Date, end: Date, task: Task): string | void; /** * specifies the date format of the label in the 'Time period' section of the lightbox @@ -993,7 +996,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_row_class(start: Date, end: Date, task: Task): string; + task_row_class(start: Date, end: Date, task: Task): string | void; /** * specifies the text in the task bars and the header of the lightbox @@ -1001,7 +1004,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_text(start: Date, end: Date, task: Task): string; + task_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the date period in the header of the lightbox @@ -1015,7 +1018,7 @@ export interface GanttTemplates { * specifies the dates of unscheduled tasks * @param task the task object */ - task_unscheduled_time(task: Task): void; + task_unscheduled_time(task: Task): string | void; /** * specifies the format of the drop-down time selector in the lightbox @@ -1028,14 +1031,14 @@ export interface GanttTemplates { * @param item either the task's or resource's object assigned to the row * @param date the date of a cell */ - timeline_cell_class(item: any, date: Date): string; + timeline_cell_class(item: any, date: Date): string | void; /** * specifies custom HTML content in the timeline cells * @param task the task's object * @param date the date of a cell */ - timeline_cell_content(task: Task, date: Date): string; + timeline_cell_content(task: Task, date: Date): string | number | void; /** * specifies the format of start and end dates displayed in the tooltip @@ -1049,7 +1052,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - tooltip_text(start: Date, end: Date, task: Task): string; + tooltip_text(start: Date, end: Date, task: Task): string | void; /** * specifies the text assigned to tasks bars on the right side @@ -1057,7 +1060,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - rightside_text(start: Date, end: Date, task: Task): string; + rightside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the text assigned to tasks bars on the left side @@ -1065,7 +1068,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - leftside_text(start: Date, end: Date, task: Task): string; + leftside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the lightbox's header @@ -1075,15 +1078,21 @@ export interface GanttTemplates { */ lightbox_header(start_date: Date, end_date: Date, task: Task): string; + /** + * specifies the CSS class that will be applied to markers + * @param marker the marker's configuration object + */ + marker_class(marker: any): void; + [customTemplate: string]: any; } -export interface GanttConfigOptions { +export interface GanttConfigOptions { /** * enables auto scheduling */ - auto_scheduling: any; + auto_scheduling: boolean | AutoSchedulingConfig; /** * disables usage of time contraints for tasks @@ -1143,7 +1152,7 @@ export interface GanttConfigOptions { /** * forces the Gantt chart to automatically change its size to show all tasks without scrolling */ - autosize: boolean|string; + autosize: boolean | string; /** * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode @@ -1153,7 +1162,7 @@ export interface GanttConfigOptions { /** * sets the height of task bars in the timeline area */ - bar_height: number|string; + bar_height: number | string; /** * adjusts the padding around task bars in the timeline when `bar_height` is set to "full" @@ -1163,7 +1172,7 @@ export interface GanttConfigOptions { /** * configures the functionality of baselines in the Gantt chart */ - baselines: any; + baselines: BaselineConfig | boolean; /** * enables dynamic loading in the Gantt chart @@ -1198,7 +1207,7 @@ export interface GanttConfigOptions { /** * enables advanced drag-n-drop */ - click_drag: undefined|ClickDrag; + click_drag: undefined | ClickDrag; /** * configures the columns of the table @@ -1230,7 +1239,7 @@ export interface GanttConfigOptions { /** * defines whether the gantt should track resizing of the container at time intervals */ - container_resize_method: string|undefined; + container_resize_method: string | undefined; /** * specifies the delay (in milliseconds) before redrawing the gantt when resizing the container @@ -1245,7 +1254,7 @@ export interface GanttConfigOptions { /** * defines internal implementation of the code of date formatting methods */ - csp: boolean|string; + csp: boolean | string; /** * sets the date format that is used to parse data from a data set and to send dates back to the server @@ -1332,7 +1341,7 @@ export interface GanttConfigOptions { * @param if the property is specified, scrolling the timeline will be activated only when the specified modifier key is pressed. The supported values are: "ctrlKey", "shiftKey", "metaKey", "altKey" * @param if the property is enabled, scrolling the timeline will be rerendered when the scroll is started and when it is ended */ - drag_timeline: null | { + drag_timeline: null | { ignore?: string, useKey?: string | boolean, render?: boolean @@ -1381,7 +1390,7 @@ export interface GanttConfigOptions { /** * sets the end value of the time scale */ - end_date: Date|undefined; + end_date: Date | undefined; /** * renders an external component into the DOM @@ -1390,8 +1399,8 @@ export interface GanttConfigOptions { * @param a DOM element the native component will be attached to. */ external_render: { - isElement ( element: any ): boolean, - renderElement ( element: any, container: HTMLElement ): void + isElement(element: any): boolean, + renderElement(element: any, container: HTMLElement): void } /** @@ -1399,44 +1408,10 @@ export interface GanttConfigOptions { */ fit_tasks: boolean; - /** - * an object of the lightbox controls - * @param the [Checkbox](desktop/checkbox.md) control - * @param the [Constraint](desktop/constraint.md) control - * @param the [Duration](desktop/duration.md) control - * @param the [Duration](desktop/duration.md) control that allows changing the [section visibility](desktop/duration.md#switchingsectionvisibility) - * @param the [Parent](desktop/parent.md) control - * @param the [Radio button](desktop/radio.md) control - * @param the [Resources](desktop/resources.md) control - * @param the [Select](desktop/select.md) control - * @param the [Template](desktop/template.md) control - * @param the [Textarea](desktop/textarea.md) control - * @param the [Time](desktop/time.md) control - * @param the [Time](desktop/time.md) control that allows changing the [section visibility](desktop/time.md#switchingsectionvisibility) - * @param the [Typeselect](desktop/typeselect.md) control - * @param a custom control - */ - form_blocks: { - checkbox?: LightboxControl, - constraint?: LightboxControl, - duration?: LightboxControl, - duration_optional?: LightboxControl, - parent?: LightboxControl, - radio?: LightboxControl, - resources?: LightboxControl, - select?: LightboxControl, - template?: LightboxControl, - textarea?: LightboxControl, - time?: LightboxControl, - time_optional?: LightboxControl, - typeselect?: LightboxControl, - [ControlName: string]: LightboxControl | undefined - } - /** * adjusts the width of columns inside a scrollable grid */ - grid_elastic_columns: boolean|string; + grid_elastic_columns: boolean | string; /** * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index @@ -1456,7 +1431,7 @@ export interface GanttConfigOptions { /** * enables/disables horizontal scroll by the Shift|Alt|Meta key + mouse wheel movement */ - horizontal_scroll_key: string|boolean; + horizontal_scroll_key: string | boolean; /** * defines whether tasks should inherit work calendars from their summary parents @@ -1476,12 +1451,12 @@ export interface GanttConfigOptions { /** * keeps the duration of a task unchanged during editing of the start/end of a task */ - inline_editors_date_processing: string|undefined; + inline_editors_date_processing: string | undefined; /** * defines whether inline editor should be opened after one click on a task when multi-task selection is enabled */ - inline_editors_multiselect_open: boolean|undefined; + inline_editors_multiselect_open: boolean | undefined; /** * 'says' to preserve the initial grid's width while resizing columns within @@ -1600,7 +1575,7 @@ export interface GanttConfigOptions { /** * activates the 'branch' mode that allows vertically reordering tasks within the same tree level */ - order_branch: string|boolean; + order_branch: string | boolean; /** * activates the 'branch' mode that allows reordering tasks within the whole gantt @@ -1625,12 +1600,12 @@ export interface GanttConfigOptions { /** * specifies the end date of a project */ - project_end: Date|undefined; + project_end: Date | undefined; /** * specifies the start date of a project */ - project_start: Date|undefined; + project_start: Date | undefined; /** * defines whether the task form will appear from the left/right side of the screen or near the selected task @@ -1682,7 +1657,7 @@ export interface GanttConfigOptions { * @param mapping of the resource calendar */ resource_calendars: { - [resourceId: string | number]: string | number | {[resourceId: string | number]: string | number | undefined } | undefined + [resourceId: string | number]: string | number | { [resourceId: string | number]: string | number | undefined } | undefined } /** @@ -1712,24 +1687,24 @@ export interface GanttConfigOptions { * @param optional, enables showing all tasks assigned to a certain resource in the resource view panel. This functionality works both for the resource diagram and resource histogram types of layout. * @param an array with resources */ - resources: boolean | { + resources: boolean | { dataprocessor_assignments?: boolean, dataprocessor_resources?: boolean, editable_resource_diagram?: boolean, - resource_store?: { + resource_store?: { type?: string, initItem?: (( item: any, - )=> any ), + ) => any), fetchTasks?: boolean }, - lightbox_resources? ( resourceArray: any ): any + lightbox_resources?(resourceArray: any): any } /** * sets the id of the virtual root element */ - root_id: string|number; + root_id: string | number; /** * enables rounding the task's start and end dates to the nearest scale marks @@ -1864,7 +1839,7 @@ export interface GanttConfigOptions { /** * sets the start value of the time scale */ - start_date: Date|undefined; + start_date: Date | undefined; /** * sets the starting day of the week @@ -1939,12 +1914,12 @@ export interface GanttConfigOptions { /** * enables/disables the touch support for the Gantt chart */ - touch: boolean|string; + touch: boolean | string; /** * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture */ - touch_drag: number|boolean; + touch_drag: number | boolean; /** * returns vibration feedback before/after drag and drop on touch devices @@ -2021,7 +1996,7 @@ export interface GanttConfigOptions { * @param the horizontal speed * @param the vertical speed */ - wheel_scroll_sensitivity: undefined | number | { + wheel_scroll_sensitivity: undefined | number | { x?: number, y?: number } @@ -2039,7 +2014,7 @@ export interface GanttConfigOptions { [customConfig: string]: any; } -export interface GanttHotkeys { +export interface GanttHotkeys { edit_save: number; edit_cancel: number; } @@ -2066,6 +2041,8 @@ export interface GanttLocaleLabels { section_description: string; section_time: string; section_type: string; + section_deadline: string; + section_baselines: string; /* grid columns */ column_wbs: string; @@ -2134,10 +2111,11 @@ export interface GanttPlugins { marker?: boolean; multiselect?: boolean; overlay?: boolean; + export_api?: boolean; } export interface GanttInitializationConfig { - container?: string|HTMLElement; + container?: string | HTMLElement; config?: any; templates?: any; events?: any; @@ -2155,11 +2133,11 @@ export type GanttPlugin = (gantt: GanttStatic) => void; export interface GanttEnterprise { plugin(plugin: GanttPlugin): void; - getGanttInstance(settings?: GanttInitializationConfig) : GanttStatic; + getGanttInstance(settings?: GanttInitializationConfig): GanttStatic; } -export interface GanttStatic { +export interface GanttStatic { /** * redefines the default click behavior for buttons of the Gantt chart @@ -2298,7 +2276,7 @@ export interface GanttStatic { /** * various helper modules */ - utils: {dom: DomHelpers}; + utils: { dom: DomHelpers }; /** * returns the version of dhtmlxGantt @@ -2356,19 +2334,19 @@ export interface GanttStatic { * adds a new dependency link * @param link the link object */ - addLink(link: any): string|number; + addLink(link: any): string | number; /** * displays an additional layer with custom elements for a link in the timeline area * @param func a render function or a config object */ - addLinkLayer(func: AdditionalLinkLayer["LinkLayerRender"]|AdditionalLinkLayer["LinkLayerConfig"]): string; + addLinkLayer(func: AdditionalLinkLayer["LinkLayerRender"] | AdditionalLinkLayer["LinkLayerConfig"]): string; /** * adds a marker to the timeline area * @param marker the marker's configuration object */ - addMarker(marker: MarkerConfig): number|string; + addMarker(marker: MarkerConfig): number | string; /** * adds a new keyboard shortcut @@ -2384,24 +2362,25 @@ export interface GanttStatic { * @param parent optional, the parent's id * @param index optional, the position the task will be added into (0 or greater) */ - addTask(task: NewTask, parent?: string|number, index?: number): string|number; + addTask(task: NewTask, parent?: string | number, index?: number): string | number; /** * displays an additional layer with custom elements for a task in the timeline area * @param func a render function or a config object */ - addTaskLayer(func: AdditionalTaskLayer["TaskLayerRender"]|AdditionalTaskLayer["TaskLayerConfig"]): string; + addTaskLayer(func: AdditionalTaskLayer["TaskLayerRender"] | AdditionalTaskLayer["TaskLayerConfig"]): string; /** * adjusts the task's row height for proper display of baseline elements + * @param task the task object whose `row_height` will be adjusted */ - adjustTaskHeightForBaselines(): void; + adjustTaskHeightForBaselines(task: Task): void; /** * calls an alert message box * @param config either an object with the alert box's configuration or the text to show */ - alert(config: AlertBoxConfig|string|number): HTMLElement; + alert(config: AlertBoxConfig | string | number): HTMLElement; /** * if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen @@ -2416,12 +2395,12 @@ export interface GanttStatic { * @param handler the handler function * @param settings optional, an object with settings for the event handler */ - attachEvent (event: T, handler: GanttEventCallback[T], settings?: HandlerSettings): string + attachEvent(event: T, handler: GanttEventCallback[T], settings?: HandlerSettings): string /** * recalculates the schedule of the project * @param taskId optional, the task id */ - autoSchedule(taskId?: string|number): void; + autoSchedule(taskId?: string | number): void; /** * updates multiple tasks/links at once @@ -2475,14 +2454,14 @@ export interface GanttStatic { * @param id the current link's id * @param new_id the new link's id */ - changeLinkId(id: string|number, new_id: string|number): void; + changeLinkId(id: string | number, new_id: string | number): void; /** * changes the task's id * @param id the current task's id * @param new_id the new task's id */ - changeTaskId(id: string|number, new_id: string|number): void; + changeTaskId(id: string | number, new_id: string | number): void; /** * checks whether an event has some handler(s) specified @@ -2509,7 +2488,7 @@ export interface GanttStatic { * closes the branch with the specified id * @param id the branch id */ - close(id: string|number): void; + close(id: string | number): void; /** * collapses gantt from the full screen mode to the normal mode @@ -2526,7 +2505,7 @@ export interface GanttStatic { * calls a confirm message box * @param config either an object with the confirm box's configuration or the text to show */ - confirm(config: ConfirmBoxConfig|string|number): HTMLElement; + confirm(config: ConfirmBoxConfig | string | number): HTMLElement; /** * creates a deep copy of provided object @@ -2550,7 +2529,7 @@ export interface GanttStatic { * creates a new dataProcessor instance and attaches it to gantt * @param config dataProcessor configuration object */ - createDataProcessor(config: DataProcessorConfig|RouterFunction|RouterConfig): any; + createDataProcessor(config: DataProcessorConfig | RouterFunction | RouterConfig): any; /** * creates a datastore according to the provided configuration @@ -2564,7 +2543,7 @@ export interface GanttStatic { * @param parent optional, the parent's id * @param index optional, the position the task will be added into (0 or greater) */ - createTask(task?: NewTask, parent?: string|number, index?: number): string|number; + createTask(task?: NewTask, parent?: string | number, index?: number): string | number; /** * dataProcessor constructor @@ -2588,25 +2567,25 @@ export interface GanttStatic { * deletes a task calendar by its id * @param id the id of the calendar */ - deleteCalendar(id: string|number): void; + deleteCalendar(id: string | number): void; /** * deletes the specified dependency link * @param id the dependency link's id */ - deleteLink(id: string|number): void; + deleteLink(id: string | number): void; /** * deletes the specified marker * @param markerId the marker's id */ - deleteMarker(markerId: string|number): void; + deleteMarker(markerId: string | number): void; /** * deletes the specified task * @param id the task's id */ - deleteTask(id: string|number): void; + deleteTask(id: string | number): void; /** * destroys the gantt instance @@ -2625,7 +2604,7 @@ export interface GanttStatic { * @param startTask the id of the item the parent tasks of which should be iterated over * @param master the object, that 'this' will refer to */ - eachParent(code: GanttCallback, startTask: string|number, master?: any): void; + eachParent(code: GanttCallback, startTask: string | number, master?: any): void; /** * iterates over all selected tasks in the Gantt chart @@ -2639,7 +2618,7 @@ export interface GanttStatic { * @param parent the parent id. If specified, the function will iterate over children of the
specified parent * @param master the object, that 'this' will refer to */ - eachTask(code: GanttCallback, parent?: string|number, master?: any): void; + eachTask(code: GanttCallback, parent?: string | number, master?: any): void; /** * attaches an event handler to an HTML element @@ -2648,7 +2627,7 @@ export interface GanttStatic { * @param handler the event handler * @param options optional, the value of either the useCapture or options parameter. Read details */ - event(node: HTMLElement|string, event: string, handler: GanttCallback, options?: boolean|HandlerSettings): void; + event(node: HTMLElement | string, event: string, handler: GanttCallback, options?: boolean | HandlerSettings): void; /** * removes an event handler from an HTML element @@ -2657,7 +2636,7 @@ export interface GanttStatic { * @param handler the event handler * @param options optional, the value of either the useCapture or options parameter. Read details */ - eventRemove(node: HTMLElement|string, event: string, handler: GanttCallback, options?: boolean|HandlerSettings): void; + eventRemove(node: HTMLElement | string, event: string, handler: GanttCallback, options?: boolean | HandlerSettings): void; /** * expands gantt to the full screen mode @@ -2720,7 +2699,7 @@ export interface GanttStatic { * gets worktime calendar by id * @param calendarId optional, the id of the global calendar or "global" */ - getCalendar(calendarId?: string|number): Calendar; + getCalendar(calendarId?: string | number): Calendar; /** * gets all the calendars added into Gantt @@ -2731,7 +2710,7 @@ export interface GanttStatic { * returns the 1st-level child tasks of the specified parent branch * @param id the parent branch's id */ - getChildren(id: string|number): any[]; + getChildren(id: string | number): any[]; /** * returns the closest working time @@ -2744,13 +2723,13 @@ export interface GanttStatic { * @param name the name of the column * @param excludeHidden skips indexes of the hidden columns */ - getColumnIndex(name: string|number, excludeHidden?: boolean): number; + getColumnIndex(name: string | number, excludeHidden?: boolean): number; /** * returns all tasks and links that a task is connected with * @param id optional, the id of a task */ - getConnectedGroup(id?: string|number): any; + getConnectedGroup(id?: string | number): any; /** * returns the earliest and latest dates allowed by the constraint applied to a task @@ -2780,13 +2759,13 @@ export interface GanttStatic { * gets the index of a task in the tree * @param id the task id */ - getGlobalTaskIndex(id: string|number): number; + getGlobalTaskIndex(id: string | number): number; /** * gets the configuration object of a column * @param name the column's name */ - getGridColumn(name: string|number): GridColumn; + getGridColumn(name: string | number): GridColumn; /** * gets columns of the Gantt chart @@ -2798,12 +2777,12 @@ export interface GanttStatic { * @param property the name of a data property that the control is mapped to * @param key the option's id. This parameter is compared with the task's data property to
assign the select's option to the task */ - getLabel(property: string, key: string|number): string; + getLabel(property: string, key: string | number): string; /** * returns the id of the last selected task */ - getLastSelectedTask(): string|number; + getLastSelectedTask(): string | number; /** * returns the object of the layout view by its name @@ -2820,7 +2799,7 @@ export interface GanttStatic { * returns the object of the lightbox's section * @param name the name of the section */ - getLightboxSection(name: string|number): LightboxSectionState; + getLightboxSection(name: string | number): LightboxSectionState; /** * returns the name of the active lighbox's structure @@ -2836,7 +2815,7 @@ export interface GanttStatic { * returns the dependency link object by the specified id * @param id the link id */ - getLink(id: string|number): Link; + getLink(id: string | number): Link; /** * returns the number of all dependency links presented in the Gantt chart @@ -2847,48 +2826,48 @@ export interface GanttStatic { * returns the HTML element of the specified dependency link * @param id the link id */ - getLinkNode(id: string|number): HTMLElement; + getLinkNode(id: string | number): HTMLElement; /** * returns all links presented in the Gantt chart */ - getLinks(): Array ; + getLinks(): Array; /** * gets the marker's object * @param markerId the marker's id */ - getMarker(markerId: string|number): any; + getMarker(markerId: string | number): any; /** * returns the id of the next item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getNext(id: string|number): string|number; + getNext(id: string | number): string | number; /** * returns the id of the next task of the same level * @param id the task id */ - getNextSibling(id: string|number): string|number; + getNextSibling(id: string | number): string | number; /** * returns the id of the parent task * @param id the task id */ - getParent(id: string|number): string|number; + getParent(id: string | number): string | number; /** * returns the id of the previous item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getPrev(id: string|number): string|number; + getPrev(id: string | number): string | number; /** * returns the id of the previous task of the same level * @param id the task id */ - getPrevSibling(id: string|number): string|number; + getPrevSibling(id: string | number): string | number; /** * returns the stack of stored redo user actions @@ -2900,7 +2879,7 @@ export interface GanttStatic { * @param resourceId the id of the resource * @param taskId the id of the task */ - getResourceAssignments(resourceId: string|number, taskId?: string|number): ResourceAssignment[]; + getResourceAssignments(resourceId: string | number, taskId?: string | number): ResourceAssignment[]; /** * returns a calendar which the resource is assigned to @@ -2916,7 +2895,7 @@ export interface GanttStatic { /** * returns the scroll position */ - getScrollState(): {x: number, y: number}; + getScrollState(): { x: number, y: number }; /** * returns the id of the selected task @@ -2939,7 +2918,7 @@ export interface GanttStatic { * returns siblings of the specified task (including itself) * @param id the task id */ - getSiblings(id: string|number): any[]; + getSiblings(id: string | number): any[]; /** * gets the current state of the Gantt chart @@ -2950,37 +2929,37 @@ export interface GanttStatic { * calculates the combined start/end dates of tasks nested in a project or another task * @param task_id the task's id, api/gantt_root_id_config.md will be used if not specified */ - getSubtaskDates(task_id?: string|number): any; + getSubtaskDates(task_id?: string | number): any; /** * calculates the combined duration of tasks nested in a project or another task. * @param task_id the task's id, api/gantt_root_id_config.md will be used if not specified */ - getSubtaskDuration(task_id?: string|number): number; + getSubtaskDuration(task_id?: string | number): number; /** * returns the task object * @param id the task id */ - getTask(id: string|number): Task; + getTask(id: string | number): Task; /** * returns the parsed resource assignments of a specific task from the datastore * @param taskId the task id */ - getTaskAssignments(taskId: string|number): ResourceAssignment[]; + getTaskAssignments(taskId: string | number): ResourceAssignment[]; /** * returns the height (in pixels) of the DOM element of the task * @param taskId the task's id */ - getTaskBarHeight(taskId: number|string): number; + getTaskBarHeight(taskId: number | string): number; /** * returns an array of baselines of a specific task from the datastore * @param taskId the task id */ - getTaskBaselines(taskId: string|number): any; + getTaskBaselines(taskId: string | number): Baseline[]; /** * finds a task by the specified criteria @@ -2988,20 +2967,20 @@ export interface GanttStatic { * @param propertyValue the property value * @param types an object with types of the tasks which should be returned */ - getTaskBy(propertyName: string|GanttCallback, propertyValue?: string|number|boolean|any[], types?: any): Array ; + getTaskBy(propertyName: string | GanttCallback, propertyValue?: string | number | boolean | any[], types?: any): Array; /** * returns a task by its global task index * @param index the task index in the tree (zero-based numbering) */ - getTaskByIndex(index: number|string): Task; + getTaskByIndex(index: number | string): Task; /** * returns a collection of tasks which occur during the specified period * @param from the start date of the period * @param to the end date of the period */ - getTaskByTime(from?: Date, to?: Date): Array ; + getTaskByTime(from?: Date, to?: Date): Array; /** * returns a task by its WBS code @@ -3024,19 +3003,19 @@ export interface GanttStatic { * returns the visible height of a task * @param id the task's id */ - getTaskHeight(id?: string|number): number; + getTaskHeight(id?: string | number): number; /** * gets the index of a task in the branch * @param id the task id */ - getTaskIndex(id: string|number): number; + getTaskIndex(id: string | number): number; /** * returns the HTML element of the task bar * @param id the task id */ - getTaskNode(id: string|number): HTMLElement; + getTaskNode(id: string | number): HTMLElement; /** * calculates the position and size of the task's DOM element in the timeline area @@ -3050,19 +3029,19 @@ export interface GanttStatic { * returns the array of unique resources assigned to a specific task from the datastore * @param taskId the task id */ - getTaskResources(taskId: string|number): any; + getTaskResources(taskId: string | number): ResourceItem[]; /** * returns the HTML element of the task row in the table * @param id the task id */ - getTaskRowNode(id: string|number): HTMLElement; + getTaskRowNode(id: string | number): HTMLElement; /** * gets the top position of the task's DOM element in the timeline area * @param id the task's id */ - getTaskTop(id: number|string): number; + getTaskTop(id: number | string): number; /** * returns the type of a task @@ -3074,7 +3053,7 @@ export interface GanttStatic { * returns the total slack of a task * @param task optional, the object of a task or its ID */ - getTotalSlack(task?: Task|string|number): any; + getTotalSlack(task?: Task | string | number): any; /** * returns the stack of stored undo user actions @@ -3102,13 +3081,13 @@ export interface GanttStatic { * groups tasks by the specified task's attribute * @param config the grouping configuration object, or false to ungroup tasks */ - groupBy(config: GroupConfig|boolean): void; + groupBy(config: GroupConfig | boolean): void; /** * returns the number of child task(s) * @param id the task id */ - hasChild(id: string|number): number|undefined; + hasChild(id: string | number): number | undefined; /** * hides the lightbox modal overlay that blocks interactions with the remaining screen @@ -3150,14 +3129,14 @@ export interface GanttStatic { * @param from the start value of the time scale (X–Axis) * @param to the end value of the time scale (X–Axis) */ - init(container: string|HTMLElement, from?: Date, to?: Date): void; + init(container: string | HTMLElement, from?: Date, to?: Date): void; /** * checks whether a task is a child of a different task * @param childId the id of a task that you want to check as a child * @param parentId the id of a task that you want to check as a parent */ - isChildOf(childId: string|number, parentId: string|number): boolean; + isChildOf(childId: string | number, parentId: string | number): boolean; /** * checks whether the link is circular @@ -3184,25 +3163,25 @@ export interface GanttStatic { * @param to optional, the ID of the target (successor) task. Can have the *null* or *undefined* value if the target task isn't specified yet. Not needed at all when the first parameter is specified as an object * @param to_start optional, specifies if the link is being dragged to the start of the target (successor) task (*true*) or from its end (*false*). Not needed at all when the first parameter is specified as an object */ - isLinkAllowed(linkOrFrom: string|number|LinkForValidation, from_start?: boolean, to?: string|number|null|undefined, to_start?: boolean): boolean; + isLinkAllowed(linkOrFrom: string | number | LinkForValidation, from_start?: boolean, to?: string | number | null | undefined, to_start?: boolean): boolean; /** * checks whether the specified link exists * @param id the link id */ - isLinkExists(id: string|number): boolean; + isLinkExists(id: string | number): boolean; /** * checks whether the specified task/link, or the whole Gantt is read-only * @param item optional, the id or an object of the task/link. If not specified, the method checks whether the Gantt is read-only */ - isReadonly(item?: number|string|Task|Link): boolean; + isReadonly(item?: number | string | Task | Link): boolean; /** * checks whether the specified task is currently selected * @param task the task's id */ - isSelectedTask(task: string|number): boolean; + isSelectedTask(task: string | number): boolean; /** * checks whether the specified task is split @@ -3220,13 +3199,13 @@ export interface GanttStatic { * checks whether the specified task exists * @param id the task id */ - isTaskExists(id: string|number): boolean; + isTaskExists(id: string | number): boolean; /** * checks whether the specifies task is currently rendered in the Gantt chart * @param id the task's id */ - isTaskVisible(id: string|number): boolean; + isTaskVisible(id: string | number): boolean; /** * checks if the task is unscheduled @@ -3252,14 +3231,14 @@ export interface GanttStatic { * gets the id of a task from the specified HTML event * @param e a native event */ - locate(e: Event): string|number; + locate(e: Event): string | number; /** * merges several working calendars into one * @param calendars an array of calendars' objects or the first calendar object * @param calendar2 optional, the second calendar object */ - mergeCalendars(calendars: Calendar[]|Calendar, calendar2?: Calendar): void; + mergeCalendars(calendars: Calendar[] | Calendar, calendar2?: Calendar): void; /** * calls a message box of the specified type @@ -3287,20 +3266,20 @@ export interface GanttStatic { * @param tindex the index of the position that the task will be moved to
(the index within a branch) * @param parent the parent id. If specified, the tindex will refer to the index in the
'parent' branch */ - moveTask(sid: string|number, tindex: number, parent?: string|number): boolean|void; + moveTask(sid: string | number, tindex: number, parent?: string | number): boolean | void; /** * opens the branch with the specified id * @param id the branch id */ - open(id: string|number): void; + open(id: string | number): void; /** * loads data from a client-side resource * @param data a string or object which represents data * @param type optional, ('json', 'xml') the data type. The default value - 'json' */ - parse(data: string|DataToLoad1 | DataToLoad2, type?: string): void; + parse(data: string | DataToLoad1 | DataToLoad2, type?: string): void; /** * activates the specified extensions @@ -3328,20 +3307,20 @@ export interface GanttStatic { * refreshes the specifies link * @param id the link id */ - refreshLink(id: string|number): void; + refreshLink(id: string | number): void; /** * refreshes the task and its related links * @param id the task id * @param refresh_links optional, defines whether links related to the task should be refreshed, true by default */ - refreshTask(id: string|number, refresh_links?: boolean): void; + refreshTask(id: string | number, refresh_links?: boolean): void; /** * removes the specified layer related to a link * @param layerId a DOM element that will be displayed in the layer */ - removeLinkLayer(layerId: string|number): void; + removeLinkLayer(layerId: string | number): void; /** * removes a keyboard shortcut @@ -3354,7 +3333,7 @@ export interface GanttStatic { * removes the specified layer related to a task * @param layerId a DOM element that will be displayed in the layer */ - removeTaskLayer(layerId: string|number): void; + removeTaskLayer(layerId: string | number): void; /** * renders the whole Gantt chart @@ -3387,11 +3366,16 @@ export interface GanttStatic { */ resetSkin(): void; + /** + * forces the lightbox to resize + */ + resizeLightbox(): void; + /** * rounds the specified date to the nearest date in the time scale * @param date the Date object to round or an object with settings */ - roundDate(date: Date|RoundDateConfig): Date; + roundDate(date: Date | RoundDateConfig): Date; /** * rounds the start and end task's dates to the nearest dates in the time scale @@ -3405,20 +3389,20 @@ export interface GanttStatic { * @param x optional, the value of the horizontal scroll or 'null' (if the scroll position shouldn't be changed) * @param y optional, the value of the vertical scroll or 'null' (if the scroll position shouldn't be changed) */ - scrollLayoutCell(name: string, x: number|null, y: number|null): void; + scrollLayoutCell(name: string, x: number | null, y: number | null): void; /** * scrolls the Gantt container to the specified position * @param x optional, the value of the horizontal scroll or 'null' (if the scroll position shouldn't be changed) * @param y optional, the value of the vertical scroll or 'null' (if the scroll position shouldn't be changed) */ - scrollTo(x?: number|null, y?: number|null): void; + scrollTo(x?: number | null, y?: number | null): void; /** * selects the specified task * @param id the task id */ - selectTask(id: string|number): string|number; + selectTask(id: string | number): string | number; /** * serializes the data into JSON or XML format @@ -3431,14 +3415,14 @@ export interface GanttStatic { * @param list_name the name of a list * @param options an array of options */ - serverList(list_name: string|number, options?: any[]): any[]; + serverList(list_name: string | number, options?: any[]): any[]; /** * set the parent for a task * @param task the task object * @param pid the parent task id */ - setParent(task: Task, pid: number|string): void; + setParent(task: Task, pid: number | string): void; /** * resizes the Gantt chart @@ -3473,19 +3457,19 @@ export interface GanttStatic { * opens the lightbox for the specified task * @param id the task id */ - showLightbox(id: string|number): void; + showLightbox(id: string | number): void; /** * displays the pop-up task form for the specified task * @param id the task id */ - showQuickInfo(id: string|number): void; + showQuickInfo(id: string | number): void; /** * makes the specified task visible on the screen * @param id the task id */ - showTask(id: string|number): void; + showTask(id: string | number): void; /** * makes all code inside it not to trigger internal events or server-side calls @@ -3500,13 +3484,13 @@ export interface GanttStatic { * @param parent the id of the parent task. Specify the parameter if you want to sort tasks only in the branch of the specified parent. * @param silent specifies whether rendering should be invoked after reordering items */ - sort(field: string|((task1: Task, task2: Task) => 1 | 0 | -1), desc?: boolean, parent?: string|number, silent?: boolean): void; + sort(field: string | ((task1: Task, task2: Task) => 1 | 0 | -1), desc?: boolean, parent?: string | number, silent?: boolean): void; /** * selects the specified task if it was unselected and vice versa * @param taskId the task's id */ - toggleTaskSelection(taskId: string|number): void; + toggleTaskSelection(taskId: string | number): void; /** * returns a unique id @@ -3522,7 +3506,7 @@ export interface GanttStatic { * removes selection from the selected task * @param id optional, the id of the task to remove selection from, see details */ - unselectTask(id?: string|number): void; + unselectTask(id?: string | number): void; /** * unsets a working time in the Gantt Chart @@ -3535,61 +3519,60 @@ export interface GanttStatic { * @param collection the name of the collection to update * @param options the new values of the collection */ - updateCollection(collection: string|number, options: any[]): boolean; + updateCollection(collection: string | number, options: any[]): boolean; /** * updates the specified dependency link * @param id the task id */ - updateLink(id: string|number): void; + updateLink(id: string | number): void; /** * updates the specified marker * @param markerId the marker's id */ - updateMarker(markerId: string|number): void; + updateMarker(markerId: string | number): void; /** * updates the specified task * @param id the task id * @param newState optional, the new values of the task */ - updateTask(id: string|number, newState?: Task): void; + updateTask(id: string | number, newState?: Task): void; /** * updates the resource property of the task object with the values of the resource assignments from the datastore * @param taskId the task id */ - updateTaskAssignments(taskId: number|string): void; + updateTaskAssignments(taskId: number | string): void; } -export interface CustomTypeRenderers { - +export interface CustomTypeRenderers { + /** * a custom render function for the *task* type - * @param optional, a custom render function for the *task* type * @param optional, a custom render function for the *project* type * @param optional, a custom render function for the *milestone* type * @param optional, a custom render function for the custom task type */ - type_renderers: { + type_renderers: { task?: CustomTypeRenderers["typeRenderer"], project?: CustomTypeRenderers["typeRenderer"], milestone?: CustomTypeRenderers["typeRenderer"], [typeName: string]: CustomTypeRenderers["typeRenderer"] | undefined } - + /** * a function takes a task's object as a parameter and must return a DOM element that will be displayed instead of the task bar. * @param the task object * @param optional, the default render function used in the dhtmlxGantt */ - typeRenderer ( task: Task, defaultRender?: AdditionalTaskLayer["TaskLayerRender"] ): HTMLElement | boolean | void | undefined + typeRenderer(task: Task, defaultRender?: AdditionalTaskLayer["TaskLayerRender"]): HTMLElement | boolean | void | undefined } -export interface AdditionalTaskLayer { - +export interface AdditionalTaskLayer { + /** * a function takes a task's object as a parameter and must return a DOM element that will be displayed in the layer. * @param the task object @@ -3597,16 +3580,15 @@ export interface AdditionalTaskLayer { * @param the Gantt configuration object * @param the viewport object */ - TaskLayerRender ( + TaskLayerRender( task: Task, timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"] - ): HTMLElement|boolean|void - + ): HTMLElement | boolean | void + /** * the configuration object for the additional task layer. Has the following properties: - * @param optional, the layer ID * @param mandatory, a function that answers for rendering the layer's elements * @param the function that returns HTML element that should be rendered @@ -3636,7 +3618,7 @@ export interface AdditionalTaskLayer { * @param optional, a function that takes a task object as a parameter. If returns 'false', the 'renderer' function won't be called for a task * @param the task object */ - TaskLayerConfig: { + TaskLayerConfig: { id?: string | number, renderer: { render: AdditionalTaskLayer["TaskLayerRender"], @@ -3646,36 +3628,35 @@ export interface AdditionalTaskLayer { timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> void ), + ) => void), onrender?: (( task: Task, node: HTMLElement, view?: any, - )=> void ), + ) => void), getRectangle?: (( task: Task, view?: any, config?: GanttConfigOptions, gantt?: GanttStatic, - )=> { left: number, top: number, height: number, width: number } | void ), + ) => { left: number, top: number, height: number, width: number } | void), getVisibleRange: (( gantt?: GanttStatic, view?: any, config?: GanttConfigOptions, datastore?: any, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> {start: number, end: number} | undefined | void ), + ) => { start: number, end: number } | undefined | void), }, container?: HTMLElement, topmost?: boolean, filter?: (( task: Task, - )=> boolean ) + ) => boolean) } - + /** * the layer viewport object - * @param the left rectangle position * @param the right rectangle position * @param the top rectangle position @@ -3683,7 +3664,7 @@ export interface AdditionalTaskLayer { * @param the rectangle width * @param the rectangle height */ - LayerViewport: { + LayerViewport: { x: number, x_end: number, y: number, @@ -3693,8 +3674,8 @@ export interface AdditionalTaskLayer { } } -export interface AdditionalLinkLayer { - +export interface AdditionalLinkLayer { + /** * a function takes a link's object as a parameter and must return a DOM element that will be displayed in the layer. * @param the link object @@ -3702,16 +3683,15 @@ export interface AdditionalLinkLayer { * @param optional, the Gantt configuration object * @param optional, the viewport object */ - LinkLayerRender ( + LinkLayerRender( link: Link, timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"] - ): HTMLElement|boolean|void - + ): HTMLElement | boolean | void + /** * the configuration object for the additional link layer. Has the following properties: - * @param optional, the layer ID * @param mandatory, a function that answers for rendering the layer's elements * @param the function that returns HTML element that should be rendered @@ -3741,7 +3721,7 @@ export interface AdditionalLinkLayer { * @param optional, a function that takes a link object as a parameter. If returns 'false', the 'renderer' function won't be called for a link * @param the link object */ - LinkLayerConfig: { + LinkLayerConfig: { id?: string | number, renderer: { render: AdditionalLinkLayer["LinkLayerRender"], @@ -3751,36 +3731,35 @@ export interface AdditionalLinkLayer { timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> void ), + ) => void), onrender?: (( link: Link, node: HTMLElement, view?: any, - )=> void ), + ) => void), getRectangle?: (( link: Link, view?: any, config?: GanttConfigOptions, gantt?: GanttStatic, - )=> { left: number, top: number, height: number, width: number } | void ), + ) => { left: number, top: number, height: number, width: number } | void), getVisibleRange: (( gantt?: GanttStatic, view?: any, config?: GanttConfigOptions, datastore?: any, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> {start: number, end: number} | undefined | void ), + ) => { start: number, end: number } | undefined | void), }, container?: HTMLElement, topmost?: boolean, filter?: (( link: Link, - )=> boolean ) + ) => boolean) } - + /** * the layer viewport object - * @param the left rectangle position * @param the right rectangle position * @param the top rectangle position @@ -3788,7 +3767,7 @@ export interface AdditionalLinkLayer { * @param the rectangle width * @param the rectangle height */ - LayerViewport: { + LayerViewport: { x: number, x_end: number, y: number, @@ -3798,393 +3777,525 @@ export interface AdditionalLinkLayer { } } -export interface Task { - +export interface Task { + /** * The task id, auto-generated if not set */ id: string | number, - + /** * The date when a task is scheduled to begin. If not specified, Gantt will calculate it based on the end_date and duration properties.The property becomes optional when setting unscheduled: true. */ start_date?: Date, - + /** * The date when a task is scheduled to be completed. If not specified, Gantt will calculate it based on the start_date and duration properties.The property becomes optional when setting unscheduled: true. */ end_date?: Date, - + /** * The task duration. If not specified, Gantt will calculate it based on the start_date and end_date properties. */ duration?: number, - + /** * Defines whether gantt should do auto-scheduling of the task (true or not specified) or not (false) */ auto_scheduling?: boolean, - + /** * Sets the height of the DOM element of the task in the timeline area */ bar_height?: number, - + + /** + * An array with the baselines + */ + baselines?: Baseline[], + /** * Sets the id of the custom calendar to be assigned to the task. The name of the property depends on the value of the calendar_property option */ calendar_id?: number | string, - + /** * Sets the color of the task in the timeline area (i.e. sets background-color for the gantt_task_line element of the task) */ color?: string, - + /** * The date of the task constraint. It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled. */ constraint_date?: Date, - + /** * The type of the task constraint ("asap", "alap", "snet", "snlt", "fnet", "fnlt", "mso", "mfo"). It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled. */ constraint_type?: string, - + /** * Specifies the deadline date for the task. A [visual indicator](desktop/inbuilt_baselines.md#deadlinesandconstraints) is displayed in the timeline when this property is set. */ - deadline?: Date | string, - + deadline?: Date, + /** * Defines whether the task can be editable in the read-only Gantt chart. The name of the property depends on the value of the editable_property option */ editable?: boolean, - + /** * The group's id. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an object. */ group_id?: string | number, - + /** * Defines whether a task (type:"task") or milestone (type:"milestone") should be hidden in the timeline area */ hide_bar?: boolean, - + /** * The key of the group. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an array.It is also added to the tasks with the name of the group (for example, to the "High", "Normal", "Low" tasks if you've grouped tasks by priority. Check the example). */ key?: string | number, - + /** * The label of the group. It is added to the tasks with the name of the group (for example, if you've grouped tasks by priority, the property will be added to the tasks with "High", "Normal", "Low" names. Check the example). */ label?: string, - + /** * Specifies whether the task branch will be opened initially (to show child tasks). To close/open the branch after Gantt initialization, use the related methods: close() and open() */ open?: boolean, - + /** * The id of the parent task. If the specified parent doesn't exist, the task won't be rendered in the Gantt. The id of the root task is specified by the api/gantt_root_id_config.md config. */ parent?: number | string, - + /** * The task's progress (from 0 to 1) */ progress?: number, - + /** * The color of the task progress in the timeline area (i.e. sets background-color for the gantt_task_progress element of the task progress) */ progressColor?: string, - + /** * Defines whether the task must be readonly. The name of the property depends on the value of the readonly_property option */ readonly?: boolean, - + /** * Defines how subtasks of the task must be displayed. Values: "split" | "". If set to "split", the subtasks will be displayed in one row. In addition, if you enable the open_split_tasks property, the subtasks will be rendered in one row only if the task is collapsed. */ render?: string, - + /** * An array with resources assigned to the task. It is added to the task object when importing data from MS Project/Primavera */ - resource?: Array , - + resource?: Array, + /** * Specifies whether a task (type:"task") or milestone (type:"milestone") should appear on the parent projects. */ rollup?: boolean, - + /** * Sets the height for the task's row */ row_height?: number, - + /** * The id of the target task. The property displays the same value as the $drop_target property. The property is added to the task object only if Data Processor is enabled, after the task is updated and data is sent to the server. */ target?: string, - + /** * The name of the task. If necessary you may use any other name for this property.The property is used in default configurations of different parts of Gantt. */ text?: any, - + /** * The color of the task's text in the timeline area (i.e. sets color for the gantt_task_line element of the task) */ textColor?: string, - + /** * the task type. The available values are stored in the api/gantt_types_config.md object: - "task" - a regular task (default value). + "task" - a regular task (default value). "project" - a task that starts, when its earliest child task starts, and ends, when its latest child ends. - The start_date, end_date, duration properties are ignored for such tasks. - + The start_date, end_date, duration properties are ignored for such tasks. "milestone" - a zero-duration task that is used to mark out important dates of the project. - The duration, progress, end_date properties are ignored for such tasks. + The duration, progress, end_date properties are ignored for such tasks. */ type?: string, - + /** * Defines whether the task must be unscheduled. By default, the unscheduled task isn't displayed in the timeline area, empty values are displayed in the grid instead of the start and end dates. */ unscheduled?: boolean, - + + /** + * A computed end date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled. + */ + $auto_end_date?: Date, + + /** + * A computed start date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled. + */ + $auto_start_date?: Date, + /** * A system property that is used in internal calculations. */ $calculate_duration?: boolean, - + /** * An object which contains custom properties of a task which were defined in the importFromMSProject() and importFromPrimaveraP6() methods */ $custom_data?: object, - + /** * A system property which defines whether the task has been updated. It is added to the task object when Data Processor is enabled. If the value of the property is "updated", the task's text will be bold in the grid but it is possible to define your own styles via CSS. */ $dataprocessor_class?: string, - + /** * The id of the target task. A temporary property which is added to the task object when dragging the task vertically. */ $drop_target?: string, - + /** * The id of the calendar (or resource calendar) assigned to the task. A system property that is used in internal calculations. */ $effective_calendar?: string, - + /** * A system property which shows whether the task is visible depending on whether the task's parents are expanded or not. If at least one parent is collapsed, the task won't be visible. The exception is only split tasks (subtasks). */ $expanded_branch?: boolean, - + /** * Defines whether the Gantt should send a request to the server to load the first-level subtasks of the task. The property is used when the branch_loading property is enabled. The name of the property depends on the value of the branch_loading_property option. */ $has_child?: boolean, - + /** * The global vertical position of the task. It is bound to the task and changes if the tasks below or above are open or closed. If the parent of the task is collapsed, the property doesn't show the actual position of the task. */ $index?: number, - + /** * The task's level in the tasks hierarchy (zero-based numbering) */ $level?: number, - + /** * The vertical position of the task in the branch (under the parent). It isn't bound to the task and doesn't change if the tasks below or above are open or closed as inside the branch as globally. If the parent of the task is collapsed, the property doesn't show the actual position of the task. */ $local_index?: number, - + /** * It is added for a new task when it is created via the createTask() method or via the "+" button. The property is added to the task object when you open the lightbox, and is removed after you save the task. */ $new?: boolean, - + /** * Required, a system property which is added to the task object. True if the end_date property couldn't be calculated (when the start_date property is loaded but there is no duration or end_date one). In this case, you cannot move or resize the task. The end_date property will depend on the end_date of the subtasks (if any). The start_date property will be fixed and won't change. Auto-scheduling won't work for such a task. If the $no_start property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task. */ $no_end?: boolean, - + /** * Required, a system property which is added to the task object. True if the start_date property couldn't be calculated (when the end_date property is loaded but there is no duration or start_date one). The start_date property will depend on the start_date of the subtasks (if any) or on the start date of the first task. The end_date property will be fixed and will change only if the start date of the subtasks/first task is bigger than the end date of the task. Auto-scheduling won't work for such a task. If the $no_end property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task. */ $no_start?: boolean, - + /** * A system property which specifies whether the task is currently opened (true). If you change the value of the property and re-draw the Gantt, it will open or close the task. To change the state of the task, you may also apply the open() or close() methods. */ $open?: boolean, - + /** * An object with original names of task properties which were imported from MS Project / Primavera into the export module (export server). The properties appear in the $raw object while the file is converted into JSON-format but before they are converted into names and format expected by Gantt. */ $raw?: object, - + /** * The id of a row the rollup item / split task is rendered at. This is the temporary property which appears in the object of the rollup/split task only when it's been rendering on the page. */ $rendered_at?: string | number, - + /** * The id of the parent under which the task is rendered (not id of the real parent of the task). The property is used in internal calculations and on tasks' grouping. */ $rendered_parent?: number | string, - + /** * The type of the rendered task (a temporary property). */ $rendered_type?: string, - + /** * An array with ids of resources assigned to the task (a temporary property). But the most actual data is stored in the store of resource assignments not in this property. */ - $resourceAssignments?: Array , - + $resourceAssignments?: Array, + /** * An array with ids of tasks and milestones which have appeared on the current task */ - $rollup?: Array , - + $rollup?: Array, + /** * Required, an array with ids of all links that come out of the task */ - $source?: Array , - + $source?: Array, + /** * Appears if the task is a subtask of a split task (i.e. arranges in one row with other subtasks) */ $split_subtask?: boolean, - + /** * Required, an array with ids of links that come into task */ - $target?: Array , - + $target?: Array, + /** * A temporary property which is added to the task object when dragging the task vertically. The task looks a little bit transparent in grid on vertical dragging due to this property. */ $transparent?: boolean, - + /** * It is added to the tasks grouped by some criterion. After the grouping is reset, tasks with $virtual: true are removed */ $virtual?: boolean, - + /** * The WBS code of the task (a temporary property). It is added to the task object after applying the getWBSCode() method. If the value of the code has changed (the task's parent or position has been changed), you need to call the getWBSCode() method again to get the updated value of the code. */ $wbs?: string, - + [customProperty: string]: any; } -export interface Link { - +export interface Link { + /** * the link id */ id: string | number, - + /** * the id of a task that the dependency will start from */ source: string | number, - + /** * the id of a task that the dependency will end with. */ target: string | number, - + /** * the dependency type. The available values are stored in the api/gantt_links_config.md object. By default, they are: - "0" - 'finish_to_start'. + "0" - 'finish_to_start'. "1" - 'start_to_start'. "2" - 'finish_to_finish'. "3" - 'start_to_finish'. */ type: string, - + /** * the task's lag */ lag?: number, - + /** * can mark link as readonly */ readonly?: boolean, - + /** * can mark link as editable */ editable?: boolean, - + [customProperty: string]: any; } -export interface GridColumn { - +export interface Baseline { + + /** + * the baseline ID + */ + id: string | number, + + /** + * the ID of the task the baseline belongs to + */ + task_id: string | number, + + /** + * the start date of the baseline + */ + start_date: Date, + + /** + * the duration of the baseline + */ + duration: number, + + /** + * the end date of the baseline + */ + end_date: Date | number, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface ResourceItem { + + /** + * the ID of the resource item + */ + id: string | number, + + /** + * indicates whether the resource item is expanded in the tree (*true*) or collapsed (*false*) + */ + open?: boolean, + + /** + * the ID of the resource item's parent + */ + parent?: string | number, + + /** + * the resource name + */ + text?: string, + + /** + * the unit for the assignments + */ + unit?: string, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface ResourceAssignment { + + /** + * the id of the assignment + */ + id: string | number, + + /** + * the ID of the task the resource is assigned to. + */ + task_id: string | number, + + /** + * the ID of the resource that is assigned to the task. + */ + resource_id: string | number, + + /** + * the quantity of the resources assigned to a task + */ + value: number | string, + + /** + * the difference between the assignment start date and the task start date + */ + delay: number, + + /** + * the date the assignment should start + */ + start_date: Date, + + /** + * the date the assignment should end + */ + end_date: Date, + + /** + * the duration of the assignment + */ + duration: number, + + /** + * the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + */ + mode: string, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface GridColumn { + /** * sets the horizontal title alignment. Possible values: *'left'*, *'center'*, or *'right'* */ align?: string, - + /** * hides/shows a column (PRO) */ hide?: boolean, - + /** * specifies the title of the column */ label?: string | number, - + /** * sets the maximum column width in case of resize operations */ max_width?: number, - + /** * sets the minimum column width in case of resize operations */ min_width?: number, - + /** * defines the column's id. The name 'add' allows you to add a column with the '+' sign */ name?: string | number, - + /** * enables the possibility to resize a column by dragging the column's border (PRO) */ resize?: boolean, - + /** * indicates that the related column should display a tree */ tree?: boolean, - + /** * defines the width of the column */ width?: number | string, - + /** * attached inline editor - * @param the type of the inline editor * @param specifies which property of the task should be updated by the inline editor * @param minimal value for the date and duration types @@ -4192,185 +4303,184 @@ export interface GridColumn { * @param an array with the options for the select types * @param formatter for the date and predecessor types */ - editor?: { + editor?: { type: string, map_to: string, min?: Date | number, max?: Date | number, - options?: Array , + options?: Array, formatter?: DurationFormatter | LinkFormatter }, - + /** * sets a data template * @param the Task object */ - template? ( task: Task ): any, - + template?(task: Task): any, + /** * optional, a callback function for rendering a cell into the DOM. The function takes a task object and the DOM element of the grid cell as parameters and may return a component of the framework. See details here * @param the Task object * @param the HTML element of the Grid cell */ - onrender? ( task: Task, node: HTMLElement ): any, - + onrender?(task: Task, node: HTMLElement): any, + /** * the configuration of sorting after clicking on the column header. When the property is set to *false*, sorting is disabled. You can also set a different task property in the *string* to sort the column or use a custom sorting function: * @param an object of the first task that will be sorted * @param an object of the second task that will be sorted */ - sort?: boolean | string | ( (task1: Task, task2: Task, ) => any ) + sort?: boolean | string | ((task1: Task, task2: Task,) => any) } -export interface LightboxSections { - +export interface LightboxSections { + /** * optional, the lightbox sections array for regular tasks */ sections?: LightboxSection[], - + /** * optional, the lightbox sections array for project tasks */ project_sections?: LightboxSection[], - + /** * optional, the lightbox sections array for milestones */ milestone_sections?: LightboxSection[], - + /** * the lightbox sections array for the custom type */ [lightboxType: string]: LightboxSection[] | undefined } -export interface LightboxSection { - +export interface LightboxSection { + /** * the section's name (according to this name, dhtmlxGantt will take the section's label from the *locale.labels* collection). */ name: string, - + /** * the name of a data property that will be mapped to the section. */ map_to: string, - + /** * the [type of the section control](desktop/default_edit_form.md#lightboxcontrols) (editor). */ type: string, - + /** * optional, the section's height. Not used with the [checkbox](desktop/checkbox.md) and [radio](desktop/radio.md) sections. */ height?: number, - + /** * optional, if set to *true*, the section will take focus on opening the lightbox */ focus?: boolean, - + /** * optional, a formatter for the section */ formatter?: DurationFormatter | LinkFormatter, - + /** * optional, if you set the "true" value, the section will be read-only */ readonly?: boolean, - + /** * optional, sets a range for the year selector. Can be set in 2 ways: */ year_range?: number | number[], - + /** * optional, if you set the "true" value, just the 'start Date' selector will be presented in the section. */ single_date?: boolean, - + /** * optional, sets the order of date-time selectors */ time_format?: string[], - + /** * optional, defines whether the end date will be corrected automatically if the selected start date is greater than the end date, *true* by default. The disabled mode allows validating the dates, but if you enable the mode and don't validate the dates, you can get tasks with 0 duration when the *start_date* is greater than the *end_date*. */ autofix_end?: boolean, - + /** * optional, defines select options of the control.Each object in the array specifies a single option and takes the following properties: - * @param the option's id. This attribute is compared with the task's data property to assign select options to tasks * @param the option's label * @param optional, the unit of measurement of the resource (for the Resources control) */ - options?: { + options?: { key: number | string, label: string, unit?: string | number }[], - + /** * optional, the default value of the section's control. Applied only if the input value is underfined. For the resources control is applied if the value of the resource is underfined. */ default_value?: any, - + /** * optional, if set to "true", the options list will contain an additional option that will allow users to set the root level as the parent for tasks. Used in pair with the **root_label** property */ allow_root?: boolean, - + /** * optional, sets a label for the root-level parent. Used in pair with the **allow_root** property */ root_label?: string, - + /** * optional, specifies the 'onChange' event handler function for the section's control * @param a native event object. */ - onchange? ( e: Event ): any, - + onchange?(e: Event): any, + /** * optional, sets a sorting function for the select options * @param an object of the first task that will be sorted * @param an object of the second task that will be sorted */ - sort? ( task1: Task, task2: Task ): number, - + sort?(task1: Task, task2: Task): number, + /** * optional, sets a filtering function for the select options. Takes the task id and task object as parameters * @param the ID of the task object * @param the Task object */ - filter? ( id: string | number, task: Task ): boolean, - + filter?(id: string | number, task: Task): boolean, + /** * optional, sets a template for select options * @param the start date of the task object * @param the end date of the task object * @param the Task object */ - template? ( + template?( start_date: Date | number, end_date: Date | number, task: Task - ): string|number + ): string | number } -export interface LightboxControl { - +export interface LightboxControl { + /** * a function that returns a string with the HTML elements of the section * @param the section's configuration object */ - render ( sns: LightboxSection ): string, - + render(sns: LightboxSection): string, + /** * a function that obtains the value from the **Task** object and sets it to the section * @param an html object related to the html defined above @@ -4378,37 +4488,36 @@ export interface LightboxControl { * @param the task object * @param the section's configuration object */ - set_value ( + set_value( node: HTMLElement, value: any, task: Task, section: LightboxSection ): any, - + /** * a function that obtains the value from the section and saves it to the **Task** object * @param an html object related to the html defined above * @param the task object * @param the section's configuration object */ - get_value ( + get_value( node: HTMLElement, task: Task, section: LightboxSection ): any, - + /** * a function to set focus to the section * @param an html object related to the html defined above */ - focus ( node: HTMLElement ): void + focus(node: HTMLElement): void } -export interface LightboxSectionState { - +export interface LightboxSectionState { + /** * the configuration object of the section - * @param the section id * @param the section name. According to the name, the gantt takes the label for the section from the **locale.labels** collection. For example, for the 'description' section, the label will be taken as **gantt.locale.labels.section_description** * @param the section height @@ -4416,7 +4525,7 @@ export interface LightboxSectionState { * @param the editor type * @param if set to *true*, the related field will take the focus on opening the lightbox */ - section: { + section: { id: string, name: string, height: number, @@ -4424,779 +4533,764 @@ export interface LightboxSectionState { type: string, focus: boolean }, - + /** * a div with the section body */ node: HTMLElement, - + /** * a div with the section header */ header: HTMLElement, - + /** * a collection of controls used in the section */ control: HTMLCollection, - + /** * returns an object with the section's data */ - getValue ( ): any, - + getValue(): any, + /** * sets the value(s) for the section. As a parameter the method takes a value (or an object with values if the section has several controls) that should be set * @param a value for the section * @param optional, an object with any properties */ - setValue ( value: any, valueObject?: CustomObject ): any + setValue(value: any, valueObject?: CustomObject): any } -export interface DataToLoad1 { - - /** - * the array with the task data - */ - data: [] | NewTask[] - tasks?: undefined +export interface MarkerConfig { + /** - * the array with the link data + * the marker id */ - links?: Link[] - + id?: string | number, + /** - * the array with the resource data + * a Date object that sets the marker's start date */ - resources?: NewResourceItem[] - + start_date: Date, + /** - * the array with the assignment data + * a Date object that sets the marker's end date */ - assignments?: NewAssignmentItem[] - + end_date?: Date, + /** - * the object that has the arrays with the custom data + * a CSS class applied to the marker */ - collections?: Сollections -} + css?: string, -export interface DataToLoad2 { - /** - * the array with the task data + * the marker title */ - tasks: [] | NewTask[] - data?: undefined + text?: string | number, + /** - * the array with the link data + * the marker's tooltip */ - links?: Link[] - + title?: string | number +} + +export interface HandlerSettings { + /** - * the array with the resource data + * the id of the event handler. */ - resources?: NewResourceItem[] - + id?: string | number, + /** - * the array with the assignment data + * defines whether the event will be executed only once. */ - assignments?: NewAssignmentItem[] - + once?: boolean, + /** - * the object that has the arrays with the custom data + * specifies the `this` object for the listener. */ - collections?: Сollections -} - -/** - * the task object that will be added to Gantt. It can have the following properties: - - * @param optional, the task ID, auto-generated if not set. - * @param optional, the date when a task is scheduled to begin. - * @param optional, the task duration. - * @param optional, the date when a task is scheduled to be completed. - * @param optional, the task name. - * @param optional, specifies if the task will be opened on load (to show child tasks). - * @param optional, the ID of the parent task. - * @param optional, the date of the task constraint. - * @param any other property you want to add, including the ones from the [**Task** object](desktop/task_properties.md) -*/ -export type NewTask = string | {} | { - id?: string | number, - start_date?: string | Date, - duration?: number, - end_date?: string | Date, - text?: string, - open?: boolean, - parent?: string | number, - constraint_date?: string | Date, - [customProperty: string]: any + thisObject?: any } - -/** - * the resource item object that will be added to Gantt. It can have the following properties: +export interface GanttUIState { - * @param optional, the resource ID, auto-generated if not set - * @param optional, the ID of the parent resource - * @param optional, the resource name - * @param optional, specifies if the resource will be opened on load (to show child items) - * @param optional, the unit of the resource assignment - * @param optional, the value that is assigned by default when adding the assignment in the lightbox section - * @param any other property you want to add -*/ -export type NewResourceItem = { - id?: string | number, - parent?: string | number, - text?: string, - open?: boolean, - unit?: string | number, - default_value?: string | number, - [customProperty: string]: any -} + /** + * reveals if Gantt is auto-scrolled (*true*). Added only when the + */ + autoscroll: boolean, - -/** - * the assignment item object that will be added to Gantt. It can have the following properties: + /** + * the update mode. *true* if the method is called inside the [*batchUpdate*](api/gantt_batchupdate.md) method. + */ + batch_update: boolean, - * @param optional, the assignment ID, auto-generated if not set - * @param the ID of the task the resource is assigned to - * @param the ID of the resource that is assigned to the task - * @param optional, the assignment value - * @param optional, the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" - * @param optional, the difference between the assignment start date and the task start date - * @param optional, the date the assignment should start - * @param optional, the assignment duration - * @param optional, the date the assignment should end - * @param any other property you want to add -*/ -export type NewAssignmentItem = { - id?: string | number, - task_id: string | number, - resource_id: string | number, - value: number | string, - mode?: string, - delay?: number, - start_date?: string | Date, - duration?: number, - end_date?: string | Date, - [customProperty: string]: any -} + /** + * the resizing mode of a task. *true* means the task is resized from the start, *false* means that the task is resized from the end. When the task is not resized, it is *null*. + */ + drag_from_start: boolean | null, + /** + * the id of a task that the user is currently dragging in the Gantt chart. *undefined* or *null*, if no tasks are being dragged in the Gantt chart. + */ + drag_id: string | null | undefined, -export interface Сollections { - /** - * an array that contains the collection items. + * the drag mode. Has these values: 'move','resize','progress', 'ignore' when a task is dragged. Otherwise, has *null* or *undefined* value. */ - [collectionName: string]: [] | СollectionItem[] -} + drag_mode: string | null | undefined, -export interface СollectionItem { - /** - * any custom property of the collection item. + * the flag for the fullscreen mode. *true*, if the Gantt chart is in the fullscreen mode, *false* otherwise. */ - [itemProperty: string]: any -} + fullscreen: boolean, -export interface ScaleArray extends Array { - 0: ScaleObj -} + /** + * the id of a task that is currently opened in the lightbox. *undefined* or *null*, if no tasks are opened in the lightbox. + */ + lightbox: string | null | undefined, -export type Scales = ScaleArray; + /** + * the new link creation state, returns *true* when the link is created from the start of the predecessor task. + */ + link_from_start: boolean | null, -export interface Scale { - /** - * the name of the scale unit. The available values are: "minute", "hour", "day" (default), "week", "quarter", "month", "year". + * the new link creation state, returns *true* if the mouse points to the link drag element (bubble). */ - unit: string, - + link_landing_area: boolean, + /** - * the step of the time scale (X-Axis), 1 by default. + * the new link creation state. the id of the source (predecessor) task. */ - step?: number, - + link_source_id: string | number | null, + /** - * a function that returns the name of a CSS class that will be applied to the scale units. Takes a date object as a parameter. - * @param a date that will be checked + * the new link creation state. the id of the target (successor) task. */ - css? ( date: Date ): any, - + link_target_id: string | number | null, + /** - * the format of the scale's labels. If set as a function, expects a date object as a parameter. - * @param a date that will be converted + * the new link creation state, returns *true* when the link is created to the start of the successor task. */ - format?: string | ( (date: Date, ) => any ), - + link_to_start: boolean, + /** - * the format of the scale's labels. If set as a function, expects a date object as a parameter. - * @param a date that will be converted + * the date that tasks are displayed in the chart from */ - date?: string | ( (date: Date, ) => any ) -} + min_date: Date, -export interface MessagePopupConfig { - /** - * optional, the ID of the popup message + * the date that tasks are displayed in the chart till */ - id?: number | string - + max_date: Date, + /** - * the content of the popup message + * the unit of the background grid of the timeline */ - text: number | string - + scale_unit: string, + /** - * optional, the class name of the popup message + * the step of the background grid of the timeline */ - type?: string - + scale_step: number, + /** - * optional, the time period until the popup message disappears. -1 means, it won't hide by itself + * the id of the currently selected task. *undefined* or *null*, if no tasks are selected in the Gantt chart. */ - expire?: number + selected_task: string | null | undefined } -export interface MessagePopupObject { +export interface RoundDateConfig { /** - * calls a message box of the specified type - */ - (config: string | number | MessagePopupConfig): string | number | HTMLElement - - /** - * the position of the popup message. Possible values are: "top", "bottom", "left", "right" + * the Date object to round; */ - position: string - + date: Date, + /** - * specifies if Gantt should block keyboard events. *true* by default. + * the time unit ("minute", "hour", "day", "week", "month", "year"); */ - keyboard: boolean - + unit?: string, + /** - * a function that hides the popup message. Uses **id** as a parameter: - * @param the ID of the popup message + * the step of the time scale (X-Axis), 1 by default. */ - hide ( id: number | string ): any + step?: number } -export interface AlertBoxConfig { - +export interface LinkForValidation { + /** - * optional, the ID of the alert box + * the ID of the source (predecessor) task. */ - id?: number | string - + source: string | number, + /** - * the text of the alert box's body + * the ID of the target (successor) task. */ - text: number | string - + target: string | number, + /** - * optional, the text of the header + * the link type. */ - title?: number | string - + type: string +} + +export interface GroupConfig { + /** - * optional, the text of the "OK" button + * a property of a task object that will be used to group items. */ - ok?: number | string - + relation_property: string, + /** - * optional, the position of the alert box for now supports only one value - "top", any other value will result in "center-align" + * an array of the groups (summary) items. Each item should have the properties set in the **group_id** and **group_text** parameters (by default, *key* and *label*). */ - position?: string - + groups: СollectionItem[], + /** - * optional, the width of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * optional, the group's id. The default value is 'key'. */ - width?: string - + group_id?: string, + /** - * optional, the height of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * optional, the group's label. The default value is 'label'. */ - height?: string - + group_text?: string, + /** - * optional, the function called on button click. Takes *true* as a parameter (subject to the clicked button) - * @param result of the clicked button, always returns **true** (because there is only the "OK" button) + * optional, the delimiter is used for automatic creation of groups for tasks with multiple resources. The default value is ",". */ - callback? ( result: boolean ): void -} + delimiter?: string, -export interface ConfirmBoxConfig { - /** - * optional, the ID of the confirm box + * optional, the name of the default group. Optional. The default value is 'None'. */ - id?: number | string - + default_group_label?: string, + /** - * the text of the confirm box's body + * optional, defines whether the gantt should save its tree structure inside groups. If not specified or set to *false*, gantt tasks will be displayed in a flat list view. */ - text: number | string - + save_tree_structure?: boolean +} + +export interface AutoSchedulingConfig { + /** - * optional, the text of the header + * turns auto-scheduling on or off (same as using a boolean value directly). */ - title?: number | string - + enabled: boolean, + /** - * optional, the text of the "OK" button + * controls the display of task constraints on the Gantt chart. */ - ok?: number | string - + show_constraints?: boolean +} + +export interface BaselineConfig { + /** - * optional, the text of the "Cancel" button + * the name of the datastore used for storing baseline entries. For related functionality, */ - cancel?: number | string - + datastore: string, + /** - * optional, the position of the confirm box for now supports only one value - "top", any other value will result in "center-align" + * determines how baselines are displayed: */ - position?: string - + render_mode: boolean | string, + /** - * optional, the width of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * specifies whether baseline updates trigger the DataProcessor as individual entries. */ - width?: string - + dataprocessor_baselines: boolean, + /** - * optional, the height of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * defines the height of the subrow for baselines, applicable only when `render_mode` */ - height?: string - + row_height: number, + /** - * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) - * @param result of the clicked button: **true** for "OK", **false** for "Cancel". + * sets the height of the baseline bar. */ - callback? ( result: boolean ): void + bar_height: number } -export interface ModalBoxConfig { - - /** - * optional, the ID of the modal box - */ - id?: number | string - +export interface DataToLoad1 { + /** - * the text of the modal box's body + * the array with the task data */ - text: number | string - + data: [] | NewTask[] + tasks?: undefined /** - * optional, the text of the header + * the array with the link data */ - title?: number | string - + links?: Link[] + /** - * the array of buttons + * the array with the resource data */ - buttons: string[] | number[] | ModalboxButton[] - + resources?: NewResourceItem[] + /** - * optional, the position of the modal box for now supports only one value - "top", any other value will result in "center-align" + * the array with the assignment data */ - position?: string - + assignments?: NewAssignmentItem[] + /** - * optional, the width of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * the object that has the arrays with the custom data */ - width?: string - + collections?: Сollections +} + +export interface DataToLoad2 { + /** - * optional, the height of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * the array with the task data */ - height?: string - + tasks: [] | NewTask[] + data?: undefined /** - * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) - * @param The result of the callback function will be equal to the stringified index of a pressed button from the array ("0", "1", "2",...) + * the array with the link data */ - callback? ( result: string | number | boolean ): void -} + links?: Link[] -export interface ModalboxButton { - /** - * the text of the button + * the array with the resource data */ - label: string | number - + resources?: NewResourceItem[] + /** - * optional, the value that is returned in the *result* argument of the *callback* function. + * the array with the assignment data */ - value?: string | number | boolean - + assignments?: NewAssignmentItem[] + /** - * optional, a custom class name for the button, prefixed with the "gantt_" string. + * the object that has the arrays with the custom data */ - css?: string | number + collections?: Сollections } -export type WorkDayConfig = string | number | boolean | Array +/** + * the task object that will be added to Gantt. It can have the following properties: + * @param optional, the task ID, auto-generated if not set. + * @param optional, the date when a task is scheduled to begin. + * @param optional, the task duration. + * @param optional, the date when a task is scheduled to be completed. + * @param optional, the task name. + * @param optional, specifies if the task will be opened on load (to show child tasks). + * @param optional, the ID of the parent task. + * @param optional, the date of the task constraint. + * @param any other property you want to add, including the ones from the [**Task** object](desktop/task_properties.md) +*/ +export type NewTask = string | {} | { + id?: string | number, + start_date?: string | Date, + duration?: number, + end_date?: string | Date, + text?: string, + open?: boolean, + parent?: string | number, + constraint_date?: string | Date, + [customProperty: string]: any +} -export type WorkDaysTuple = [WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, ] -export interface CalendarConfig { - - /** - * optional, the calendar id - */ +/** + * the resource item object that will be added to Gantt. It can have the following properties: + * @param optional, the resource ID, auto-generated if not set + * @param optional, the ID of the parent resource + * @param optional, the resource name + * @param optional, specifies if the resource will be opened on load (to show child items) + * @param optional, the unit of the resource assignment + * @param optional, the value that is assigned by default when adding the assignment in the lightbox section + * @param any other property you want to add +*/ +export type NewResourceItem = { id?: string | number, - - /** - * an object that sets the worktime in days and hours. It can include: - - * @param optional, an array with global working hours, sets the start and end hours of the task - * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day - * @param optional, an object with different working-time rules for different periods of time. The object can contain a set of key:value pairs where key is the name of a time span and value is an object with a list of attributes. - * @param the time span with the working time settings. The name of that object is used as the name of the time span - * @param the date when the time span is scheduled to begin - * @param the date when the time span is scheduled to be completed - * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) - * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. - */ - worktime?: { - hours?: string[] | number[] | boolean, - days?: WorkDaysTuple, - customWeeks?: { - [timespan: string]: { - from: Date, - to: Date, - hours?: Array, - days?: WorkDaysTuple | boolean, - }, - } - } + parent?: string | number, + text?: string, + open?: boolean, + unit?: string | number, + default_value?: string | number, + [customProperty: string]: any } -export interface MarkerConfig { - - /** - * the marker id - */ + +/** + * the assignment item object that will be added to Gantt. It can have the following properties: + * @param optional, the assignment ID, auto-generated if not set + * @param the ID of the task the resource is assigned to + * @param the ID of the resource that is assigned to the task + * @param optional, the assignment value + * @param optional, the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + * @param optional, the difference between the assignment start date and the task start date + * @param optional, the date the assignment should start + * @param optional, the assignment duration + * @param optional, the date the assignment should end + * @param any other property you want to add +*/ +export type NewAssignmentItem = { id?: string | number, - + task_id: string | number, + resource_id: string | number, + value: number | string, + mode?: string, + delay?: number, + start_date?: string | Date, + duration?: number, + end_date?: string | Date, + [customProperty: string]: any +} + + +export interface Сollections { + /** - * a Date object that sets the marker's start date + * an array that contains the collection items. */ - start_date: Date, - + [collectionName: string]: [] | СollectionItem[] +} + +export interface СollectionItem { + /** - * a Date object that sets the marker's end date + * any custom property of the collection item. */ - end_date?: Date, - + [itemProperty: string]: any +} + +export interface ScaleArray extends Array { + 0: ScaleObj +} + +export type Scales = ScaleArray; + +export interface Scale { + /** - * a CSS class applied to the marker + * the name of the scale unit. The available values are: "minute", "hour", "day" (default), "week", "quarter", "month", "year". */ - css?: string, - + unit: string, + /** - * the marker title + * the step of the time scale (X-Axis), 1 by default. */ - text?: string | number, - + step?: number, + /** - * the marker's tooltip + * makes the scale label visible if the scale cell is larger than the viewport width */ - title?: string | number -} + sticky?: boolean, -export interface HandlerSettings { - /** - * the id of the event handler. + * a function that returns the name of a CSS class that will be applied to the scale units. Takes a date object as a parameter. + * @param a date that will be checked */ - id?: string | number, - + css?(date: Date): any, + /** - * defines whether the event will be executed only once. + * the format of the scale's labels. If set as a function, expects a date object as a parameter. + * @param a date that will be converted */ - once?: boolean, - + format?: string | ((date: Date,) => any), + /** - * specifies the `this` object for the listener. + * the format of the scale's labels. If set as a function, expects a date object as a parameter. + * @param a date that will be converted */ - thisObject?: any + date?: string | ((date: Date,) => any) } -export interface GanttUIState { - - /** - * reveals if Gantt is auto-scrolled (*true*). Added only when the - */ - autoscroll: boolean, - +export interface MessagePopupConfig { + /** - * the update mode. *true* if the method is called inside the [*batchUpdate*](api/gantt_batchupdate.md) method. + * optional, the ID of the popup message */ - batch_update: boolean, - + id?: number | string + /** - * the resizing mode of a task. *true* means the task is resized from the start, *false* means that the task is resized from the end. When the task is not resized, it is *null*. + * the content of the popup message */ - drag_from_start: boolean | null, - + text: number | string + /** - * the id of a task that the user is currently dragging in the Gantt chart. *undefined* or *null*, if no tasks are being dragged in the Gantt chart. + * optional, the class name of the popup message */ - drag_id: string | null | undefined, - + type?: string + /** - * the drag mode. Has these values: 'move','resize','progress', 'ignore' when a task is dragged. Otherwise, has *null* or *undefined* value. + * optional, the time period until the popup message disappears. -1 means, it won't hide by itself */ - drag_mode: string | null | undefined, - + expire?: number +} + +export interface MessagePopupObject { + /** - * the flag for the fullscreen mode. *true*, if the Gantt chart is in the fullscreen mode, *false* otherwise. + * calls a message box of the specified type */ - fullscreen: boolean, - + (config: string | number | MessagePopupConfig): string | number | HTMLElement + /** - * the id of a task that is currently opened in the lightbox. *undefined* or *null*, if no tasks are opened in the lightbox. + * the position of the popup message. Possible values are: "top", "bottom", "left", "right" */ - lightbox: string | null | undefined, - + position: string + /** - * the new link creation state, returns *true* when the link is created from the start of the predecessor task. + * specifies if Gantt should block keyboard events. *true* by default. */ - link_from_start: boolean | null, - + keyboard: boolean + /** - * the new link creation state, returns *true* if the mouse points to the link drag element (bubble). + * a function that hides the popup message. Uses **id** as a parameter: + * @param the ID of the popup message */ - link_landing_area: boolean, - + hide(id: number | string): any +} + +export interface AlertBoxConfig { + /** - * the new link creation state. the id of the source (predecessor) task. + * optional, the ID of the alert box */ - link_source_id: string | number | null, - + id?: number | string + /** - * the new link creation state. the id of the target (successor) task. + * the text of the alert box's body */ - link_target_id: string | number | null, - + text: number | string + /** - * the new link creation state, returns *true* when the link is created to the start of the successor task. + * optional, the text of the header */ - link_to_start: boolean, - + title?: number | string + /** - * the date that tasks are displayed in the chart from + * optional, the text of the "OK" button */ - min_date: Date, - + ok?: number | string + /** - * the date that tasks are displayed in the chart till + * optional, the position of the alert box for now supports only one value - "top", any other value will result in "center-align" */ - max_date: Date, - + position?: string + /** - * the unit of the background grid of the timeline + * optional, the width of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - scale_unit: string, - + width?: string + /** - * the step of the background grid of the timeline + * optional, the height of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - scale_step: number, - + height?: string + /** - * the id of the currently selected task. *undefined* or *null*, if no tasks are selected in the Gantt chart. + * optional, the function called on button click. Takes *true* as a parameter (subject to the clicked button) + * @param result of the clicked button, always returns **true** (because there is only the "OK" button) */ - selected_task: string | null | undefined + callback?(result: boolean): void } -export interface RoundDateConfig { - - /** - * the Date object to round; - */ - date: Date, - +export interface ConfirmBoxConfig { + /** - * the time unit ("minute", "hour", "day", "week", "month", "year"); + * optional, the ID of the confirm box */ - unit?: string, - + id?: number | string + /** - * the step of the time scale (X-Axis), 1 by default. + * the text of the confirm box's body */ - step?: number -} + text: number | string -export interface LinkForValidation { - /** - * the ID of the source (predecessor) task. + * optional, the text of the header */ - source: string | number, - + title?: number | string + /** - * the ID of the target (successor) task. + * optional, the text of the "OK" button */ - target: string | number, - + ok?: number | string + /** - * the link type. + * optional, the text of the "Cancel" button */ - type: string -} + cancel?: number | string -export interface GroupConfig { - /** - * a property of a task object that will be used to group items. + * optional, the position of the confirm box for now supports only one value - "top", any other value will result in "center-align" */ - relation_property: string, - + position?: string + /** - * an array of the groups (summary) items. Each item should have the properties set in the **group_id** and **group_text** parameters (by default, *key* and *label*). + * optional, the width of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - groups: СollectionItem[], - + width?: string + /** - * optional, the group's id. The default value is 'key'. + * optional, the height of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - group_id?: string, - + height?: string + /** - * optional, the group's label. The default value is 'label'. + * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) + * @param result of the clicked button: **true** for "OK", **false** for "Cancel". */ - group_text?: string, - + callback?(result: boolean): void +} + +export interface ModalBoxConfig { + /** - * optional, the delimiter is used for automatic creation of groups for tasks with multiple resources. The default value is ",". + * optional, the ID of the modal box */ - delimiter?: string, - + id?: number | string + /** - * optional, the name of the default group. Optional. The default value is 'None'. + * the text of the modal box's body */ - default_group_label?: string, - + text: number | string + /** - * optional, defines whether the gantt should save its tree structure inside groups. If not specified or set to *false*, gantt tasks will be displayed in a flat list view. + * optional, the text of the header */ - save_tree_structure?: boolean -} - -/** - * an object that stores the commands of the Undo or Redo action - - * @param an array that stores the changes (commands) of the Undo or Redo action. -*/ -export type UndoRedoAction = { commands: UndoRedoCommand[] } - - -/** - * an object that stores the initial and updated state of the **Task** or **Link** objects: - - * @param the type of a command: "add/remove/update" - * @param the type of the object which was changed: "task" or "link" - * @param the changed task/link object - * @param the task/link object before changes -*/ -export type UndoRedoCommand = { - type: string, - entity: string, - value: Task | Link, - oldValue: Task | Link -} - + title?: number | string -export interface ResourceAssignment { - /** - * the id of the assignment + * the array of buttons */ - id: string | number, - + buttons: string[] | number[] | ModalboxButton[] + /** - * the ID of the task the resource is assigned to. + * optional, the position of the modal box for now supports only one value - "top", any other value will result in "center-align" */ - task_id: string | number, - + position?: string + /** - * the ID of the resource that is assigned to the task. + * optional, the width of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - resource_id: string | number, - + width?: string + /** - * the quantity of the resources assigned to a task + * optional, the height of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - value: number | string, - + height?: string + /** - * the difference between the assignment start date and the task start date + * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) + * @param The result of the callback function will be equal to the stringified index of a pressed button from the array ("0", "1", "2",...) */ - delay: number, - + callback?(result: string | number | boolean): void +} + +export interface ModalboxButton { + /** - * the date the assignment should start + * the text of the button */ - start_date: Date, - + label: string | number + /** - * the date the assignment should end + * optional, the value that is returned in the *result* argument of the *callback* function. */ - end_date: Date, - + value?: string | number | boolean + /** - * the duration of the assignment + * optional, a custom class name for the button, prefixed with the "gantt_" string. */ - duration: number, - + css?: string | number +} + +export type WorkDayConfig = string | number | boolean | Array + +export type WorkDaysTuple = [WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig,] + +export interface CalendarConfig { + /** - * the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + * optional, the calendar id */ - mode: string, - + id?: string | number, + /** - * any custom property + * an object that sets the worktime in days and hours. It can include: + * @param optional, an array with global working hours, sets the start and end hours of the task + * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day + * @param optional, an object with different working-time rules for different periods of time. The object can contain a set of key:value pairs where key is the name of a time span and value is an object with a list of attributes. + * @param the time span with the working time settings. The name of that object is used as the name of the time span + * @param the date when the time span is scheduled to begin + * @param the date when the time span is scheduled to be completed + * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) + * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. */ - [customProperty: string]: any + worktime?: { + hours?: string[] | number[] | boolean, + days?: WorkDaysTuple, + customWeeks?: { + [timespan: string]: { + from: Date, + to: Date, + hours?: Array, + days?: WorkDaysTuple | boolean, + }, + } + } } - + /** - * object specifying one of the predefined modes of sending the data + * an object that stores the commands of the Undo or Redo action + * @param an array that stores the changes (commands) of the Undo or Redo action. +*/ +export type UndoRedoAction = { commands: UndoRedoCommand[] } + + +/** + * an object that stores the initial and updated state of the **Task** or **Link** objects: + * @param the type of a command: "add/remove/update" + * @param the type of the object which was changed: "task" or "link" + * @param the changed task/link object + * @param the task/link object before changes +*/ +export type UndoRedoCommand = { + type: string, + entity: string, + value: Task | Link, + oldValue: Task | Link +} + +/** + * object specifying one of the predefined modes of sending the data * @param the URL to the server side * @param optional, the mode of sending data to the server: "JSON" | "REST-JSON" | "JSON" | "POST" | "GET" * @param optional, defines whether the task must be deleted from the gantt only after a successful response from the server. Dependency links and subtasks will be deleted after the deletion of the parent task is confirmed. */ -export type DataProcessorConfig = { +export type DataProcessorConfig = { url: string, mode?: string, deleteAfterConfirmation?: boolean } - + /** * the router configuration for different entities - * @param the router object for tasks * @param the router object for links * @param the router object for resources * @param the router object for assignments */ -export type RouterConfig = { +export type RouterConfig = { task?: RouterForEntity, link?: RouterForEntity, resource?: RouterForEntity, assignment?: RouterForEntity } - + /** * the router function to process changes in Gantt * @param the name of the relevant entity. Possible values are: "task"|"link"|"resource"|"assignment" @@ -5212,173 +5306,173 @@ export type RouterFunction = ( ) => Promise -export interface RouterForEntity { - +export interface RouterForEntity { + /** * a function to process adding of items * @param the processed item */ - create ( data: Task | Link | ResourceAssignment | CustomObject ): Promise - + create(data: Task | Link | ResourceAssignment | CustomObject): Promise + /** * a function to process updating of items * @param the processed item * @param the id of a processed item */ - update ( data: Task | Link | ResourceAssignment | CustomObject, id: string | number ): Promise - + update(data: Task | Link | ResourceAssignment | CustomObject, id: string | number): Promise + /** * a function to process deleting of items * @param the id of a processed item */ - delete ( id: string | number ): Promise + delete(id: string | number): Promise } -export interface CustomObject { +export interface CustomObject { /* * @param Any custom property with any type */ [propertyName: string]: any } -export interface DateHelpers { - +export interface DateHelpers { + /** * adds/subtracts the specified time interval to/from the date * @param the date object that you need to add a time to/subtract a time from * @param the number of units to add. If this number is positive - the time will be added to the date, if negative - the time will be subtracted * @param the time unit. Values: 'minute', 'hour', 'day', 'week', 'month', 'year'. */ - add (date: Date, number: number, unit: string): Date, - + add(date: Date, number: number, unit: string): Date, + /** * adds/subtracts the specified number of quarters to/from the date * @param the date object that you need to add quarters to/subtract quarters from * @param the number of quarters */ - add_quarter (date: Date, number: number): Date, - + add_quarter(date: Date, number: number): Date, + /** * converts local time to UTC * @param the date object to convert */ - convert_to_utc (date: Date): Date, - + convert_to_utc(date: Date): Date, + /** * makes a copy of a Date object * @param the date object to copy */ - copy (date: Date): Date, - + copy(date: Date): Date, + /** * resets the time part of the provided date to 00:00:00 * @param the date object to format */ - date_part (date: Date): Date, - + date_part(date: Date): Date, + /** * returns a function that converts a Date object to a string of the specified format * @param the date format * @param specifies whether local time should be converted to UTC */ - date_to_str (format: string, utc?: boolean): Function, - + date_to_str(format: string, utc?: boolean): Function, + /** * resets the time part of the provided date to 00:00:00. Alias of the date_part method. Used by the Day view to set the display date and can be redefined to provide the default behaviour * @param the date object to format */ - day_start (date: Date): Date, - + day_start(date: Date): Date, + /** * returns the ISO-8601 week number of the date, weeks starts on Monday * @param the date object to format */ - getISOWeek (date: Date): number, - + getISOWeek(date: Date): number, + /** * returns the week number of the date, but previously converts local time to UTC * @param the date object to format */ - getUTCISOWeek (date: Date): number, - + getUTCISOWeek(date: Date): number, + /** * returns the week number of the date. Weeks start either on Monday or Sunday, depending on the value of the api/gantt_start_on_monday_config.md property. * @param the date object to format */ - getWeek (date: Date): number, - + getWeek(date: Date): number, + /** * returns a Date object of the first day of the month for the specified date and clears the time part to zero * @param the date object to format */ - month_start (date: Date): Date, - + month_start(date: Date): Date, + /** * converts a string of the specified format to a Date object * @param a date as a string * @param the date format */ - parseDate (date: string, format: string): Date, - + parseDate(date: string, format: string): Date, + /** * returns a function that converts a string of the specified format to a Date object * @param the date format * @param specifies whether local time should be converted to UTC */ - str_to_date (format: string, utc?: boolean): Function, - + str_to_date(format: string, utc?: boolean): Function, + /** * returns the time of a Date object as a number of seconds counted from the midnight (00:00:00) * @param the date object to format */ - time_part (date: Date): number, - + time_part(date: Date): number, + /** * adds the leading zero to numbers less than 10 and returns the result as a string. Doesn't affect numbers from 10 * @param the number to format */ - to_fixed (num: number): string, - + to_fixed(num: number): string, + /** * returns a Date object of the specified date and clears the part with seconds to zero * @param the date object to format */ - minute_start (date: Date): Date, - + minute_start(date: Date): Date, + /** * returns a Date object of the specified date and clears the part with minutes and seconds to zero * @param the date object to format */ - hour_start (date: Date): Date, - + hour_start(date: Date): Date, + /** * returns a Date object of the first day of the week for the specified date and clears the time part to zero * @param the date object to format */ - week_start (date: Date): Date, - + week_start(date: Date): Date, + /** * returns a Date object of the first month of the quarter for the specified date and clears the time part to zero * @param the date object to format */ - quarter_start (date: Date): Date, - + quarter_start(date: Date): Date, + /** * returns a Date object of the first day of the year for the specified date and clears the time part to zero * @param the date object to format */ - year_start (date: Date): Date + year_start(date: Date): Date [customTemplate: string]: any; } -export interface Calendar { - +export interface Calendar { + /** * the id of a task's calendar */ id: string | number, - + /** * sets the working time for the Gantt chart * @param the [configuration object](api/gantt_setworktime.md#configurationobjectproperties) of a time span: @@ -5392,7 +5486,7 @@ export interface Calendar { * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. */ - setWorkTime ( + setWorkTime( config: { day?: string | number, date?: Date, @@ -5407,7 +5501,7 @@ export interface Calendar { }, } ): boolean, - + /** * unsets a working time in the Gantt Chart * @param the [configuration object](api/gantt_unsetworktime.md#configurationobjectproperties) of a time span: @@ -5415,14 +5509,14 @@ export interface Calendar { * @param optional, a specific date to set as a working day or day off * @param optional, an array of working hours as 'from'-'to' pairs. */ - unsetWorkTime ( + unsetWorkTime( config: { day?: string | number, date?: Date, hours?: string[] | number[] | boolean, } ): void, - + /** * checks whether the specified date is working * @param either a date to check or the [configuration object](api/gantt_isworktime.md#configurationobjectproperties) of a time span: @@ -5431,7 +5525,7 @@ export interface Calendar { * @param optional, the object of the task the duration of which should be calculated * @param optional, a time unit: "minute", "hour", "day", "week", "month", "year". Not needed at all when the first parameter is specified as an object */ - isWorkTime ( + isWorkTime( config: Date | { date: Date, unit?: string, @@ -5439,7 +5533,7 @@ export interface Calendar { }, time_unit?: string ): boolean, - + /** * returns the closest working time * @param the [configuration object](api/gantt_getclosestworktime.md#configurationobjectproperties): @@ -5448,7 +5542,7 @@ export interface Calendar { * @param optional, a time unit to search for the closest working time * @param optional, the object of the task to use its calendar */ - getClosestWorkTime ( + getClosestWorkTime( config: Date | { date: Date, dir?: string, @@ -5456,7 +5550,7 @@ export interface Calendar { task?: Task, } ): Date, - + /** * calculates the end date of a task * @param either the date when a task is scheduled to begin or the [configuration object](api/gantt_calculateenddate.md#configurationobjectproperties) of a time span: @@ -5467,7 +5561,7 @@ export interface Calendar { * @param optional, the duration of a task. Not needed at all when the first parameter is specified as an object * @param optional, the time unit of the duration. Not needed at all when the first parameter is specified as an object */ - calculateEndDate ( + calculateEndDate( config: Date | { start_date: Date, duration: number, @@ -5477,7 +5571,7 @@ export interface Calendar { duration?: number, unit?: string ): Date, - + /** * calculates the duration of a task * @param either the date when a task is scheduled to begin or the [configuration object](api/gantt_calculateduration.md#configurationobjectproperties) of a time span: @@ -5486,7 +5580,7 @@ export interface Calendar { * @param optional, the object of the task the duration of which should be calculated * @param the date when a task is scheduled to be completed. Not needed at all when the first parameter is specified as an object */ - calculateDuration ( + calculateDuration( config: Date | { start_date: Date, end_date: Date, @@ -5498,172 +5592,172 @@ export interface Calendar { [customMethod: string]: any; } -export interface DomHelpers { - +export interface DomHelpers { + /** * returns position of the element on the screen in the format of `{x:number, y:number,width:number, height:number}` object * @param DOM element that will be checked */ - getNodePosition ( node: HTMLElement ): object, - + getNodePosition(node: HTMLElement): object, + /** * returns mouse coordinates relatively to the DOM element in the format of `{x:number, y:number}` object * @param event that occured * @param DOM element that will be checked */ - getRelativeEventPosition ( e: Event, node: HTMLElement ): object, - + getRelativeEventPosition(e: Event, node: HTMLElement): object, + /** * returns `true` if the node provided as the first argument is DOM child of the node provided as the second argument * @param child node that will be checked * @param parent node that will be checked */ - isChildOf ( child: HTMLElement, parent: HTMLElement ): boolean, - + isChildOf(child: HTMLElement, parent: HTMLElement): boolean, + /** * returns `true` if the class list of the provided `node` contains a specified css class * @param DOM element that will be checked * @param class name that will be checked */ - hasClass ( node: HTMLElement, className: string ): boolean, - + hasClass(node: HTMLElement, className: string): boolean, + /** * returns the first node that matches the provided css selector, starting from the `node` attribute, up to its DOM parents' branch. * @param DOM element will be checked * @param a class name for the target node */ - closest ( node: HTMLElement, cssSelector: string ): HTMLElement + closest(node: HTMLElement, cssSelector: string): HTMLElement [customMethod: string]: any; } -export interface DatastoreConfig { - +export interface DatastoreConfig { + /** * an arbitrary string name of the datastore. The datastore can be accessed by its name using api/gantt_getdatastore.md. */ name: string, - + /** * optional, accepts only one fixed value **"treeDatastore"**. If the type:"treeDatastore" is specified, the datastore will support hierarchical data, with the **id** property as a primary key, and **parent** as a link to the parent id. Any other value will produce a flat list datastore. */ type?: string, - + /** * optional, enables showing all tasks assigned to a certain resource in the resource view panel. This functionality works both for the resource diagram and resource histogram types of layout. */ fetchTasks?: boolean, - + /** * optional, preprocesses items loaded into the datastore. It is a good place to set the default values of the datastore items. The function takes the following parameter: * @param the resource item. */ - initItem? ( item: any ): any + initItem?(item: any): any } -export interface DatastoreMethods { - +export interface DatastoreMethods { + /** * loads data from an array * @param the data to load */ - parse ( data: Array ): void, - + parse(data: Array): void, + /** * returns the item by its id * @param the id of the item */ - getItem ( id: string | number ): object | void, - + getItem(id: string | number): object | void, + /** * updates the specified item * @param the id of the item * @param an object the item */ - updateItem ( id: string | number, item?: object ): void, - + updateItem(id: string | number, item?: object): void, + /** * deletes the specified item * @param the id of the item */ - removeItem ( id: string | number ): void, - + removeItem(id: string | number): void, + /** * checks whether the specified item is visible or hidden via filters * @param the id of the item */ - isVisible ( id: string | number ): boolean, - + isVisible(id: string | number): boolean, + /** * returns the array of visible items */ - getVisibleItems (): Array, - + getVisibleItems(): Array, + /** * adds a new item to the datastore * @param the item object * @param the position the task will be added into (0 or greater) */ - addItem ( item: object, index?: number ): number | string, - + addItem(item: object, index?: number): number | string, + /** * changes the id of the item * @param the current item's id * @param the new item's id */ - changeId ( oldId: string | number, newId: string | number ): void, - + changeId(oldId: string | number, newId: string | number): void, + /** * checks whether the specified item exists in the datastore * @param the item's id */ - exists ( id: string | number ): boolean, - + exists(id: string | number): boolean, + /** * moves an item to a new position * @param the index of the current position of the task * @param the index of the position that the item will be moved to */ - move ( sindex: number, tindex: number ): void, - + move(sindex: number, tindex: number): void, + /** * clears the datastore */ - clearAll (): void, - + clearAll(): void, + /** * execute the code without firing API events of the datastore * @param the callback function */ - silent ( callback: Function ): void, - + silent(callback: Function): void, + /** * fires repainting of events of the specified record, runs filters * @param optional, the id of the record */ - refresh ( id?: string | number ): void, - + refresh(id?: string | number): void, + /** * returns the number of items that are currently loaded into the datastore */ - count (): number, - + count(): number, + /** * returns the number of items that are currently visible */ - countVisible (): number, - + countVisible(): number, + /** * iterates over all tasks of the datastore * @param the callback function */ - eachItem ( callback: Function ): void, - + eachItem(callback: Function): void, + /** * runs the filters and updates visible array of items */ - filter (): void, - + filter(): void, + /** * sorts items in the resource grid * @param the name of the column that the resource grid will be sorted by or a custom sorting function @@ -5671,188 +5765,188 @@ export interface DatastoreMethods { * @param the id of the parent item. Specify the parameter if you want to sort items only in the branch of the specified parent. * @param specifies whether rendering should be invoked after reordering items */ - sort ( field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean ): void, - + sort(field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean): void, + /** * returns records between the specified indexes * @param the position of the start record * @param the position of the end record */ - getIndexRange ( from: number, to: number ): Array, - + getIndexRange(from: number, to: number): Array, + /** * returns all records of the datastore */ - getItems (): Array, - + getItems(): Array, + /** * returns the id of the item by its index. Returns `undefined` if there is no item at the specified index. * @param the position of the item */ - getIdByIndex ( index: number ): string | number | void, - + getIdByIndex(index: number): string | number | void, + /** * returns the index of the item by its id. Returns `-1` if no such item exists in the datastore. * @param the id of the item */ - getIndexById ( id: string | number ): number, - + getIndexById(id: string | number): number, + /** * returns the id of the first item of the datastore */ - getFirst (): string | number | null, - + getFirst(): string | number | null, + /** * returns the id of the last item of the datastore */ - getLast (): string | number | null, - + getLast(): string | number | null, + /** * returns the id of the next item of the datastore * @param the item's id */ - getNext ( id: string | number ): string | number | null, - + getNext(id: string | number): string | number | null, + /** * returns the id of the previous item of the datastore * @param the item's id */ - getPrev ( id: string | number ): string | number | null, - + getPrev(id: string | number): string | number | null, + /** * clears the datastore and removes all attached event handlers. The datastore is not usable after this method is called. */ - destructor (): void, - + destructor(): void, + /** * attaches the handler to an inner event of DataStore * @param the event's name, case-insensitive * @param the handler function * @param optional, an object with settings for the event handler */ - attachEvent (event: T, handler: TreeDatastoreEvents[T], settings?: object): boolean, - + attachEvent(event: T, handler: TreeDatastoreEvents[T], settings?: object): boolean, + /** * calls an inner event * @param the event's name, case-insensitive * @param an array of the event-related data */ - callEvent ( name: string, params: Array ): boolean, - + callEvent(name: string, params: Array): boolean, + /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param the event's id */ - detachEvent ( id: string ): void + detachEvent(id: string): void } -export interface DatastoreEvents { - +export interface DatastoreEvents { + /** * fires when an item is being loaded from the data source * @param the object of an item */ - "onItemLoading": ( item: any ) => any, - + "onItemLoading": (item: any) => any, + /** * fires before data started to be parsed * @param the array with the data that was loaded */ - "onBeforeParse": ( data: Array ) => any, - + "onBeforeParse": (data: Array) => any, + /** * fires after data were parsed (became available for API) but before they were rendered in the Gantt chart * @param the array with the data that was loaded */ - "onParse": ( data: Array ) => any, - + "onParse": (data: Array) => any, + /** * fires before an item is updated * @param the id of an item * @param the new (updated) object of the item */ - "onBeforeUpdate": ( id: string | number, item: any ) => any, - + "onBeforeUpdate": (id: string | number, item: any) => any, + /** * fires after an item is updated * @param the id of an item * @param the object of the item */ - "onAfterUpdate": ( id: string | number, item: any ) => any, - + "onAfterUpdate": (id: string | number, item: any) => any, + /** * fires before an item is deleted * @param the id of an item * @param the object of the item */ - "onBeforeDelete": ( id: string | number, item: any ) => any, - + "onBeforeDelete": (id: string | number, item: any) => any, + /** * fires after an item is deleted * @param the id of an item * @param the object of the item */ - "onAfterDelete": ( id: string | number, item: any ) => any, - + "onAfterDelete": (id: string | number, item: any) => any, + /** * fires before a new item is added to the datastore * @param the id of an item * @param the object of the item */ - "onBeforeAdd": ( id: string | number, item: any ) => any, - + "onBeforeAdd": (id: string | number, item: any) => any, + /** * fires after an item is added to the datastore * @param the id of an item * @param the object of the item */ - "onAfterAdd": ( id: string | number, item: any ) => any, - + "onAfterAdd": (id: string | number, item: any) => any, + /** * fires when the id of an item is changed * @param the id of an item * @param the new id of the item */ - "onIdChange": ( id: string | number, newId: string | number ) => any, - + "onIdChange": (id: string | number, newId: string | number) => any, + /** * fires after all items were removed from the datastore */ "onClearAll": () => any, - + /** * fires before the datastore is refreshed * @param the id of an item or null * @param the item object or null * @param the action type ("paint", "move", "add", "delete", null) */ - "onBeforeStoreUpdate": ( id: string | number | null, item: any | null, action: string | null ) => any, - + "onBeforeStoreUpdate": (id: string | number | null, item: any | null, action: string | null) => any, + /** * fires after the datastore has been refreshed * @param the id of an item or null * @param the item object or null * @param the action type ("paint", "move", "add", "delete", null) */ - "onStoreUpdated": ( id: string | number | null, item: any | null, action: string | null ) => any, - + "onStoreUpdated": (id: string | number | null, item: any | null, action: string | null) => any, + /** * fires before filtering is applied */ "onBeforeFilter": () => any, - + /** * fires after the datastore has update the filtering state */ "onFilter": () => any, - + /** * fires for each item during the filtering stage, returning `false` will mark item as not visible * @param the id of an item * @param the item object */ - "onFilterItem": ( id: string | number, item: any ) => any, - + "onFilterItem": (id: string | number, item: any) => any, + /** * fires after the destructor() method of the datastore is called */ @@ -5862,7 +5956,7 @@ export interface DatastoreEvents { } export interface TreeDatastoreMethods extends DatastoreMethods { - + /** * moves an item to the new position or to a new parent * @param the id of the item to move @@ -5870,96 +5964,96 @@ export interface TreeDatastoreMethods extends DatastoreMethods { * @param the parent id. If specified, the tindex will refer to the index in the 'parent' branch */ - move ( sid: string | number, tindex: number, parent?: string | number ): boolean | void, - + move(sid: string | number, tindex: number, parent?: string | number): boolean | void, + /** * returns the index of an item in the branch * @param the id of the item */ - getBranchIndex ( id: string | number ): number, - + getBranchIndex(id: string | number): number, + /** * checks whether the specified item has child items * @param the id of the item */ - hasChild ( id: string | number ): number | void, - + hasChild(id: string | number): number | void, + /** * returns the 1st-level child items of the specified parent branch * @param the id of the parent branch */ - getChildren ( id: string | number ): Array, - + getChildren(id: string | number): Array, + /** * checks whether an item is a child of a different item * @param the id of an item that you want to check as a child * @param the id of an item that you want to check as a parent */ - isChildOf ( childId: string | number, parentId: string | number ): boolean, - + isChildOf(childId: string | number, parentId: string | number): boolean, + /** * returns siblings of the specified item (including itself) * @param the id of the item */ - getSiblings ( id: string | number ): Array, - + getSiblings(id: string | number): Array, + /** * returns the id of the next item of the same level * @param the id of the item */ - getNextSibling ( id: string | number ): number | string | null, - + getNextSibling(id: string | number): number | string | null, + /** * returns the id of the previous item of the same level * @param the id of the item */ - getPrevSibling ( id: string | number ): number | string | null, - + getPrevSibling(id: string | number): number | string | null, + /** * returns the id of the parent item or 0. * @param the id of the item */ - getParent ( id: string | number ): number| string, - + getParent(id: string | number): number | string, + /** * calculates the level of nesting of an item * @param the item's object */ - calculateItemLevel ( item: object ): number, - + calculateItemLevel(item: object): number, + /** * sets the parent for an item. The parent id will be writen to the property specified by `parentProperty` config, "item.parent" by default. * @param the item's object * @param the id of the parent */ - setParent ( item: object, newParentId: string | number | null ): void, - + setParent(item: object, newParentId: string | number | null): void, + /** * iterates over all children of a specific item * @param the callback function * @param the id of the parent */ - eachItem ( callback: Function, parentId?: string | number ): void, - + eachItem(callback: Function, parentId?: string | number): void, + /** * iterates over all parent items of the specified item * @param the callback function * @param the id of the item the parent item of which should be iterated over */ - eachParent ( callback: Function, startItem: string | number ): void, - + eachParent(callback: Function, startItem: string | number): void, + /** * opens the branch with the specified id * @param the branch id */ - open ( id: string | number ): void, - + open(id: string | number): void, + /** * closes the branch with the specified id * @param the branch id */ - close ( id: string | number ): void, - + close(id: string | number): void, + /** * sorts items in the resource grid * @param the name of the column that the resource grid will be sorted by or a custom sorting function @@ -5967,42 +6061,42 @@ export interface TreeDatastoreMethods extends DatastoreMethods { * @param the id of the parent item. Specify the parameter if you want to sort items only in the branch of the specified parent. * @param specifies whether rendering should be invoked after reordering items */ - sort ( field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean ): void + sort(field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean): void } export interface TreeDatastoreEvents extends DatastoreEvents { - + /** * fires before an item is moved to a new position * @param the id of the item to move * @param the parent id * @param the index of the position in the parent branch that the item will be moved to */ - "onBeforeItemMove": ( id: string | number, parent: string | number, tindex: number ) => any, - + "onBeforeItemMove": (id: string | number, parent: string | number, tindex: number) => any, + /** * fires after an item was moved to a new position * @param the id of the item to move * @param the parent id * @param the index of the position in the parent branch that the item will be moved to */ - "onAfterItemMove": ( id: string | number, parent: string | number, tindex: number ) => any, - + "onAfterItemMove": (id: string | number, parent: string | number, tindex: number) => any, + /** * fires on opening a branch * @param the id of the branch */ - "onItemOpen": ( id: string | number ) => any, - + "onItemOpen": (id: string | number) => any, + /** * fires on closing a branch * @param the id of the branch */ - "onItemClose": ( id: string | number ) => any + "onItemClose": (id: string | number) => any } -export interface InlineEditor { - +export interface InlineEditor { + /** * the function is called when you open the inline editor. Here, you can add a container for the DOM elements and initialize the third * @param task ID @@ -6010,18 +6104,18 @@ export interface InlineEditor { * @param the configuration object of the custom inline editor * @param the DOM element of the inline editor */ - show ( + show( id: string | number, column: GridColumn, config: any, placeholder: HTMLElement ): void, - + /** * optional, the function is called when hiding the inline editor */ - hide? ( ): void, - + hide?(): void, + /** * the function is called after the **show** function. There, you need to set the values to the inline editor elements from the **task** object. The parameters are: * @param the value of the task property @@ -6029,25 +6123,25 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - set_value ( + set_value( value: any, id: string | number, column: GridColumn, node: HTMLElement ): void, - + /** * the function is called before hiding the inline editor. You need to obtain the values from the inline editor and add it to the **task** object. The parameters are: * @param task ID * @param the column configuration object * @param the DOM element of the inline editor */ - get_value ( + get_value( id: string | number, column: GridColumn, node: HTMLElement ): any, - + /** * optional, the function is called before hiding the inline editor. If you return **true** the changes will be saved, otherwise, they will be cancelled. The parameters are: * @param the value of the task property @@ -6055,13 +6149,13 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - is_changed? ( + is_changed?( value: any, id: string | number, column: GridColumn, node: HTMLElement ): boolean, - + /** * optional, the function where you can add validation. If you return **false**, the changes will be cancelled. The parameters are: * @param the value of the task property @@ -6069,149 +6163,149 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - is_valid? ( + is_valid?( value: any, id: string | number, column: GridColumn, node: HTMLElement ): boolean, - + /** * optional, the function for a complex save behavior, when the editor has the `map_to:auto` property. The parameters are: * @param task ID * @param the column configuration object * @param the Task object */ - save? ( + save?( id: string | number, column: GridColumn, node: HTMLElement ): void, - + /** * optional, this function is called when the inline editor receives focus. * @param the DOM element of the inline editor */ - focus? ( node: HTMLElement ): void + focus?(node: HTMLElement): void [customMethod: string]: any; } -export interface InlineEditorMethods { - +export interface InlineEditorMethods { + /** * opens an editor in the specified task/cell, sets the mapped value and puts browser focus on the editor * @param the task ID * @param the column name */ - startEdit ( taskId: number | string, columnName: string ): void, - + startEdit(taskId: number | string, columnName: string): void, + /** * opens an empty editor in specified task/cell * @param the task ID * @param the column name */ - show ( taskId: number | string, columnName: string ): void, - + show(taskId: number | string, columnName: string): void, + /** * populates an opened editor with values from the task */ - setValue ( ): void, - + setValue(): void, + /** * saves changes and hides an editor */ - save ( ): void, - + save(): void, + /** * hides an editor without saving changes */ - hide ( ): void, - + hide(): void, + /** * puts browser focus on the editor */ - focus ( ): void, - + focus(): void, + /** * gets the state object {id: taskId, columnName: columnName, placeholder: HTMLElement} */ - getState ( ): object, - + getState(): object, + /** * gets the current value of the editor */ - getValue ( ): string, - + getValue(): string, + /** * checks whether the current value of the editor differs from the initial value */ - isChanged ( ): boolean, - + isChanged(): boolean, + /** * checks whether the editor is opened */ - isVisible ( ): boolean, - + isVisible(): boolean, + /** * attaches an event handler to inlineEditors object * @param the name of the event handler * @param the function that will be called when the event fires */ - attachEvent (event: T, handler: InlineEditorEvents[T]): string, - + attachEvent(event: T, handler: InlineEditorEvents[T]): string, + /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param the id of the attached event handler */ - detachEvent ( id: string ): void, - + detachEvent(id: string): void, + /** * saves the current editor and moves editor to the next cell * @param the parameter specifies whether it can move the editor to the first cell of the next row after the last cell of the current one */ - editNextCell ( canChangeRow?: boolean ): void, - + editNextCell(canChangeRow?: boolean): void, + /** * saves the current editor and opens an editor in the same cell of the task below * @param the parameter specifies whether it can skip the read-only task and open an editor in the cell of the first editable task. The default *false* state of the parameter closes the editor if the next task is read-only. */ - editNextRow ( skipReadonly?: boolean ): void, - + editNextRow(skipReadonly?: boolean): void, + /** * saves the current editor and moves editor to the previous cell * @param the parameter specifies whether it can move editor to the last cell of the row above after reaching the first cell of the current row */ - editPrevCell ( canChangeRow?: boolean ): void, - + editPrevCell(canChangeRow?: boolean): void, + /** * saves the current editor and opens an editor in the same cell of the task above * @param the parameter specifies whether it can skip the read-only task and open an editor in the cell of the first editable task. The default *false* state of the parameter closes the editor if the previous task is read-only. */ - editPrevRow ( skipReadonly?: boolean ): void, - + editPrevRow(skipReadonly?: boolean): void, + /** * gets the name of the first editable column in the grid */ - getFirstCell ( ): string, - + getFirstCell(): string, + /** * gets the name of the last editable column in the grid */ - getLastCell ( ): string, - + getLastCell(): string, + /** * returns the name of the next editable column * @param the parameter specifies in which direction it should iterate the following cell. `1` - right, `-1` - left. */ - getNextCell ( direction: number ): string | null, - + getNextCell(direction: number): string | null, + /** * checks whether a provided DOM element is a task cell object and returns an editor state object, if it is so: {id: taskId, columnName: columnName} * @param the HTML element */ - locateCell ( node: HTMLElement ): object | null, - + locateCell(node: HTMLElement): object | null, + /** * sets a mapping object * @param an object with the mapping configuration: @@ -6228,61 +6322,61 @@ export interface InlineEditorMethods { * @param the Grid layout view * @param the method to destroy mapping */ - setMapping ( + setMapping( mapping: { init: (( inlineEditors: InlineEditorMethods, grid: any, - )=> void ), + ) => void), onShow: (( inlineEditors: InlineEditorMethods, node: HTMLElement, grid: any, - )=> void ), + ) => void), onHide: (( inlineEditors: InlineEditorMethods, node: HTMLElement, grid: any, - )=> void ), - destroy: (()=> void ), + ) => void), + destroy: (() => void), } ): void, - + /** * returns a currently applied mapping object */ - getMapping ( ): object + getMapping(): object [customMethod: string]: any; } -export interface InlineEditorEvents { - - "onBeforeEditStart": ( state: { +export interface InlineEditorEvents { + + "onBeforeEditStart": (state: { id: number | string, columnName: string, }) => any, - - "onEditStart": ( state: { + + "onEditStart": (state: { id: number | string, columnName: string, }) => any, - - "onBeforeSave": ( state: { + + "onBeforeSave": (state: { id: number | string, columnName: string, oldValue: any, newValue: any, }) => any, - - "onSave": ( state: { + + "onSave": (state: { id: number | string, columnName: string, oldValue: any, newValue: any, }) => any, - - "onEditEnd": ( state: { + + "onEditEnd": (state: { id: number | string, columnName: string, }) => any @@ -6290,33 +6384,33 @@ export interface InlineEditorEvents { [customEvent: string]: any; } -export interface Fullscreen { - +export interface Fullscreen { + /** * expands gantt to the full screen mode */ - expand ( ): void, - + expand(): void, + /** * collapses gantt from the fullscreen mode to the normal mode */ - collapse ( ): void, - + collapse(): void, + /** * calls the **collapse()** method if gantt is expanded to full screen, and the **expand()** method otherwise */ - toggle ( ): void, - + toggle(): void, + /** * returns a DOM element that will be expanded to full screen by the **expand()** method. */ - getFullscreenElement ( ): HTMLElement + getFullscreenElement(): HTMLElement [customMethod: string]: any; } -export interface KeyNav { - +export interface KeyNav { + /** * allows selecting any cell in the grid. Works only if the Grid already has the focus * @param the config object @@ -6324,54 +6418,54 @@ export interface KeyNav { * @param the column name * @param type of the scope. Possible values: "gantt", "taskRow", "taskCell", "headerCell" */ - focus ( + focus( config: { id: number | string, column: string, type: string, } ): void, - + /** * allows obtaining information about the active cell */ - getActiveNode ( ): boolean | void + getActiveNode(): boolean | void [customMethod: string]: any; } -export interface QuickInfo { - +export interface QuickInfo { + /** * displays the quick info popup for a specified element * @param the task ID */ - show ( id: number | string ): void, - + show(id: number | string): void, + /** * displays the quick info popup at specific coordinates * @param horizontal coordinate * @param vertical coordinate */ - show ( x: number | string, y: number | string ): void, - + show(x: number | string, y: number | string): void, + /** * hides the quick info popup. When **gantt.config.quick_info_detached** is set to *false*, the quick info will not disappear immediately, but after a short animation. Providing *true* value as an argument will cancel the animation and will remove the popup immediately. * @param defines whether the quick info popup will be hidden immediately without animation */ - hide ( force?: boolean ): HTMLElement, - + hide(force?: boolean): HTMLElement, + /** * sets a container where the quick info will be displayed. If no custom container specified, QuickInfo will be placed into the first of the found nodes: **gantt.$task, gantt.$grid, gantt.$root** * @param container element or its ID */ - setContainer ( container: HTMLElement | string ): void, - + setContainer(container: HTMLElement | string): void, + /** * returns the HTMLElement of the quick info popup. Returns *null* if the quick info is not initialized */ - getNode ( ): HTMLElement | null, - + getNode(): HTMLElement | null, + /** * puts the content into the quick info * @param optional, the configuration object of a quick info which can include the following attributes: @@ -6382,7 +6476,7 @@ export interface QuickInfo { * @param optional, the content of the pop-up edit form * @param optional, buttons to be placed in the pop-up edit form */ - setContent ( + setContent( config?: { taskId?: string | number, header?: { @@ -6397,90 +6491,92 @@ export interface QuickInfo { [customMethod: string]: any; } -export interface Undo { - +export interface Undo { + /** * reverts the changes made in the gantt */ - undo ( ): void, - + undo(): void, + /** * applies the reverted changes to the gantt once again */ - redo ( ): void, - + redo(): void, + /** * returns the stack of stored undo user actions */ - getUndoStack ( ): UndoRedoAction[], - + getUndoStack(): UndoRedoAction[], + /** * returns the stack of stored redo user actions */ - getRedoStack ( ): UndoRedoAction[], - + getRedoStack(): UndoRedoAction[], + /** * sets the stack of stored undo user actions + * @param the undo stack */ - setUndoStack ( ): UndoRedoAction[] , - + setUndoStack(stack: UndoRedoAction[]): void, + /** * sets the stack of stored redo user actions + * @param the redo stack */ - setRedoStack ( ): UndoRedoAction[] , - + setRedoStack(stack: UndoRedoAction[]): void, + /** * clears the stack of stored undo commands */ - clearUndoStack ( ): void, - + clearUndoStack(): void, + /** * clears the stack of stored redo commands */ - clearRedoStack ( ): void, - + clearRedoStack(): void, + /** * saves the current state of a task/link before the changes are made * @param the id of a task/link, * @param the type of an entry for which the id is provided as the first argument. */ - saveState ( id: string | number, type: string ): boolean + saveState(id: string | number, type: string): boolean [customMethod: string]: any; } -export interface ClickDrag { - +export interface ClickDrag { + /** * sets a custom CSS class for a selected element */ className?: string, - + /** * the element to attach an event to and select */ viewPort?: HTMLElement, - + /** * defines whether requestAnimationFrame is used during rendering */ useRequestAnimationFrame?: boolean, - + /** * true to add selection only in one row equal to the height of a task */ singleRow?: boolean, - + /** * CSS selector. Drag-n-drop won't be activated for the elements that match the selector */ ignore?: string, - + /** * if the property is specified, drag-n-drop will be activated only when the specified modifier key is pressed. Supported values: "ctrlKey", "shiftKey", "metaKey", "altKey" */ useKey?: string | boolean, - + /** * a function that will be called when the mouse button is released. Takes 6 parameters: * @param an object with the following attributes: @@ -6502,7 +6598,7 @@ export interface ClickDrag { * @param an array of tasks between the start and end date points * @param an array of tasks selected between the start and end coordinates vertically */ - callback? ( + callback?( startPoint?: { absolute: { left: number, @@ -6528,7 +6624,7 @@ export interface ClickDrag { tasksBetweenDates?: Array, tasksInRows?: Array ): any, - + /** * a function that creates an element rendered during dragging. Takes two parameters: * @param an object with the attributes: @@ -6546,7 +6642,7 @@ export interface ClickDrag { * @param the left coordinate * @param the top coordinate */ - render? ( + render?( startPoint?: { absolute: { left: number, @@ -6572,89 +6668,89 @@ export interface ClickDrag { [customMethod: string]: any; } -export interface Overlay { - +export interface Overlay { + /** * adds a new overlay into the Gantt Chart and returns its id * @param the render function. Takes a container with custom content as a parameter * @param the overlay container * @param optional, the ID of the overlay */ - addOverlay ( + addOverlay( render: (( container: HTMLElement, - )=> HTMLElement ), + ) => HTMLElement), id?: number | string ): string | number, - + /** * removes an overlay by its id * @param the ID of the overlay */ - deleteOverlay ( id: number | string ): boolean, - + deleteOverlay(id: number | string): boolean, + /** * returns an array with ids of overlays added into the chart */ - getOverlaysIds ( ): Array, - + getOverlaysIds(): Array, + /** * repaints the specified overlay. * @param the ID of the overlay */ - refreshOverlay ( id: number | string ): void, - + refreshOverlay(id: number | string): void, + /** * shows an overlay by its id. * @param the ID of the overlay */ - showOverlay ( id: number | string ): void, - + showOverlay(id: number | string): void, + /** * hides an overlay by its id * @param the ID of the overlay */ - hideOverlay ( id: number | string ): void, - + hideOverlay(id: number | string): void, + /** * checks visibility of the specified overlay. Returns *true* if the overlay is visible. * @param the ID of the overlay */ - isOverlayVisible ( id: number | string ): boolean + isOverlayVisible(id: number | string): boolean [customMethod: string]: any; } -export interface ZoomLevel { - +export interface ZoomLevel { + /** * the name of the level */ name: string - + /** * the height of the scale */ scale_height?: number - + /** * the height of the scale */ height?: number - + /** * the minimal width of a column. It has a higher priority than minColumnWidth and maxColumnWidth */ min_column_width?: number - + /** * an array of scales to switch between while zooming in/out on this level */ scales: Scales } -export interface ZoomMethods { - +export interface ZoomMethods { + /** * initializes the extension with the provided configuration. * @param an object with configuration settings that contains the *levels* array of zooming levels and a number of additional properties: @@ -6671,12 +6767,12 @@ export interface ZoomMethods { * @param the trigger of zooming: "wheel" | null | undefined * @param a DOM element over which zooming is triggered or a function that returns a DOM element */ - init ( + init( zoomConfig: { levels: ZoomLevel[], handler?: (( e: Event, - )=> void ), + ) => void), startDate?: Date, endDate?: Date, activeLevelIndex?: number, @@ -6685,112 +6781,112 @@ export interface ZoomMethods { maxColumnWidth?: number, useKey?: string, trigger?: string | null | undefined, - element?: HTMLElement | (()=> HTMLElement ), + element?: HTMLElement | (() => HTMLElement), } ): void, - + /** * returns the number (index) of the current zooming level */ - getCurrentLevel ( ): number, - + getCurrentLevel(): number, + /** * switches to the specified zooming level. * @param The level is defined either by a string (the name of the level from the config, e.g. "year"), or by its number in the array of levels */ - setLevel ( level: number | string ): void, - + setLevel(level: number | string): void, + /** * allows getting all zooming levels */ - getLevels ( ): any[], - + getLevels(): ZoomLevel[], + /** * increases the current zooming level */ - zoomIn ( ): void, - + zoomIn(): void, + /** * decreases the current zooming level */ - zoomOut ( ): void, - + zoomOut(): void, + /** * attaches an event handler * @param the name of the event handler * @param the function that will be called when the event fires */ - attachEvent (event: T, handler: ZoomEvents[T]): string, - + attachEvent(event: T, handler: ZoomEvents[T]): string, + /** * detaches a handler from an event * @param the id of the attached event handler */ - detachEvent ( id: string ): void, - + detachEvent(id: string): void, + /** * calls an inner event * @param the event's name, case-insensitive * @param optional, an array of the event-related data */ - callEvent ( name: string, params: Array ): boolean, - + callEvent(name: string, params: Array): boolean, + /** * checks whether an event has some handler(s) specified * @param the event's name */ - checkEvent ( name: string ): boolean, + checkEvent(name: string): boolean, } -export interface ZoomEvents { - +export interface ZoomEvents { + /** * fires during switching of the zooming level. * @param the number of the level * @param the config of the level */ - "onAfterZoom": ( level: number | string, config: ZoomLevel ) => any + "onAfterZoom": (level: number | string, config: ZoomLevel) => any } -export interface Tooltip { - +export interface Tooltip { + /** * returns the HTML element of the tooltip */ - getNode ( ): HTMLElement, - + getNode(): HTMLElement, + /** * locks the position of tooltip to the boundaries of the specified HTML element * @param the HTML element under the question */ - setViewport ( node: HTMLElement ): object, - + setViewport(node: HTMLElement): object, + /** * displays the tooltip at specific coordinates (relative to document.body). The method can take different parameters, depending on the position you want to show the tooltip at. To display tooltip at specific coordinates (relative to document.body), pass x,y coordinates. To display tooltip at the mouse event coordinates pass the Event object. The *tooltip_offset_x/y* and viewport will be taken into account. * @param the X coordinate or the mouse event object * @param the Y coordinate */ - show ( config?: number | Event, top?: number ): object, - + show(config?: number | Event, top?: number): object, + /** * hides the tooltip element */ - hide ( ): object, - + hide(): object, + /** * puts HTML content into the tooltip. Takes as a parameter: * @param a string with HTML content for the tooltip */ - setContent ( html: string ): object, + setContent(html: string): object, } -export interface Tooltips { +export interface Tooltips { /** * Tooltip object */ - tooltip: Tooltip, - + tooltip: Tooltip, + /** * adds tooltip with extended configuration. The method takes one parameter: * @param an object with the tooltip settings. The settings are: @@ -6806,25 +6902,25 @@ export interface Tooltips { * @param the HTML node * @param optional, defines whether the module listens to mouse events on the whole page (*true*) or only inside a gantt element (*false*). By default the option is set to *false*. */ - attach ( + attach( config: { selector: string, onmouseenter: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), onmousemove?: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), onmouseleave: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), global?: boolean, } ): void, - + /** * adds a tooltip for the specified Gantt element. It is a more simplified version of the **attach()** method. The method takes one parameter: * @param an object with the tooltip settings. The settings are: @@ -6834,70 +6930,70 @@ export interface Tooltips { * @param the HTML node and returns a string with a template. * @param optional, defines whether the module listens to mouse events on the whole page (*true*) or only inside a gantt element (*false*). By default the option is set to *false*. */ - tooltipFor ( + tooltipFor( config: { selector: string, html: (( event: Event, node: HTMLElement, - )=> HTMLElement | string | number | void ), + ) => HTMLElement | string | number | void), global?: boolean, } ): void, - + /** * removes tooltip. As a parameter the method takes: * @param the CSS selector of a Gantt element */ - detach ( selector: string ): void, + detach(selector: string): void, } -export interface DurationFormatter { +export interface DurationFormatter { /** * returns *true* if the provided string can be parsed into the duration value, otherwise * @param the string that will be checked */ - canParse ( value: string ): boolean, - + canParse(value: string): boolean, + /** * converts the provided duration value into the duration string * @param the duration value that will be converted */ - format ( value: number ): string, - + format(value: number): string, + /** * parses the provided string into the duration value. If the value can’t be parsed, ‘null’ will be returned * @param the string that will be converted */ - parse ( value: string ): number, - + parse(value: string): number, + } -export interface LinkFormatter { +export interface LinkFormatter { /** * returns *true* if the provided string can be parsed into the link object, otherwise * @param the string that will be checked */ - canParse ( value: string ): boolean, + canParse(value: string): boolean, /** * converts the provided link value into the string * @param the link object that will be converted */ - format ( value: Link ): string, + format(value: Link): string, /** * parses the provided string into the link object. If the value can’t be parsed, ‘null’ will be returned. **Note** that the *link.target* of the given link will have "null" value * @param the string that will be converted */ - parse ( value: string ): object, + parse(value: string): object, } -export interface Formatters { - +export interface Formatters { + /** * creates a Duration Formatter * @param optional, a configuration object which can include the following attributes: @@ -6936,11 +7032,11 @@ export interface Formatters { * @param plural text label for years * @param short text label for years */ - durationFormatter ( + durationFormatter( config?: { enter?: string, store?: string, - format?: string | Array , + format?: string | Array, short?: boolean, minutesPerHour?: number, hoursPerDay?: number, @@ -6981,7 +7077,7 @@ export interface Formatters { }, } ): DurationFormatter, - + /** * create a Link Formatter * @param optional, a configuration object which can include the following attributes: @@ -6992,7 +7088,7 @@ export interface Formatters { * @param labels for the Finish to Finish links * @param labels for the Start to Finish links */ - linkFormatter ( + linkFormatter( config?: { durationFormatter?: DurationFormatter, labels?: { @@ -7005,71 +7101,71 @@ export interface Formatters { ): LinkFormatter, } -export interface EmptyState { - +export interface EmptyState { + /** * an array with the IDs of the attached handlers. It is modified by the *attachAddTaskEvent* and *detachAddTaskEvents* methods. */ clickEvents?: Array, - + /** * returns *true* if there is no data loaded into the Gantt chart, otherwise */ - isGanttEmpty ( ): boolean, - + isGanttEmpty(): boolean, + /** * returns *true* if the api/gantt_show_empty_state_config.md property is enabled, otherwise */ - isEnabled ( ): boolean, - + isEnabled(): boolean, + /** * puts an HTML content into the empty state element. The method can be redefined. * @param the container element */ - renderContent ( container: HTMLElement ): void, - + renderContent(container: HTMLElement): void, + /** * returns the DOM element where the empty state will be attached to. By default, returns the grid element (the "empty state" will be displayed in the grid). If there is no grid, returns the timeline element (the "empty state" will be displayed in the timeline). The method can be redefined. */ - getContainer ( ): HTMLElement | null, - + getContainer(): HTMLElement | null, + /** * returns the DOM node of the empty state element */ - getNode ( ): HTMLElement | null, - + getNode(): HTMLElement | null, + /** * displays the "empty state". Returns *null* if there is no container for the Empty State Element. The extension calls the method by itself */ - show ( ): null | void, - + show(): null | void, + /** * hides the "empty state". Returns *false* if there is no Empty State Element node, so there is nothing to hide. The extension calls the method by itself */ - hide ( ): boolean | void, - + hide(): boolean | void, + /** * adds the handler that will fire after clicking on the Empty State Element. By default, it is used to add a new task. */ - attachAddTaskEvent ( ): void, - + attachAddTaskEvent(): void, + /** * removes the handlers that were used to add a task after clicking on the Empty State Element */ - detachAddTaskEvents ( ): void + detachAddTaskEvents(): void } -export interface Ext { - inlineEditors: InlineEditorMethods, - emptyStateElement: EmptyState, - fullscreen: Fullscreen, - formatters: Formatters, - keyboardNavigation: KeyNav, - quickInfo: QuickInfo, - undo: Undo, - overlay: Overlay, - tooltips: Tooltips, - zoom: ZoomMethods, +export interface Ext { + inlineEditors: InlineEditorMethods, + emptyStateElement: EmptyState, + fullscreen: Fullscreen, + formatters: Formatters, + keyboardNavigation: KeyNav, + quickInfo: QuickInfo, + undo: Undo, + overlay: Overlay, + tooltips: Tooltips, + zoom: ZoomMethods, [customMethod: string]: any; } @@ -7078,4 +7174,4 @@ declare var gantt: GanttStatic; declare var Gantt: GanttEnterprise; -export {gantt, Gantt}; \ No newline at end of file +export { gantt, Gantt }; \ No newline at end of file diff --git a/codebase/dhtmlxgantt.es.d.ts b/codebase/dhtmlxgantt.es.d.ts index a1665b3..89e97a6 100644 --- a/codebase/dhtmlxgantt.es.d.ts +++ b/codebase/dhtmlxgantt.es.d.ts @@ -1,66 +1,66 @@ -// Type definitions for dhtmlxGantt 9.0.1 +// Type definitions for dhtmlxGantt 9.0.2 // Project: https://dhtmlx.com/docs/products/dhtmlxGantt type GanttCallback = (...args: any[]) => any; -export interface GanttEventCallback { +export interface GanttEventCallback { /** * fires when autoscheduling is done * @param taskId the root task id * @param updatedTasks an array with the ids of rescheduled tasks */ - "onAfterAutoSchedule" (taskId: string|number, updatedTasks: any[]): void; + "onAfterAutoSchedule"(taskId: string | number, updatedTasks: any[]): void; /** * fires after the api/gantt_batchupdate.md method was called */ - "onAfterBatchUpdate" (): void; + "onAfterBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after the task branch was loaded to the page * @param settings an object which contains the task id and request URL */ - "onAfterBranchLoading" (settings: any): void; + "onAfterBranchLoading"(settings: any): void; /** * fires after the user has closed the lightbox (edit form) */ - "onAfterLightbox" (): void; + "onAfterLightbox"(): void; /** * fires after a new link is added to the Gantt chart * @param id the link id * @param link the link object */ - "onAfterLinkAdd" (id: string|number, link: Link): void; + "onAfterLinkAdd"(id: string | number, link: Link): void; /** * fires after the user deletes a link * @param id the link id * @param link the link object */ - "onAfterLinkDelete" (id: string|number, link: Link): void; + "onAfterLinkDelete"(id: string | number, link: Link): void; /** * fires after the user updates a link * @param id the link id * @param link the link object */ - "onAfterLinkUpdate" (id: string|number, link: Link): void; + "onAfterLinkUpdate"(id: string | number, link: Link): void; /** * fires after the pop-up edit form is closed * @param taskId the task id */ - "onAfterQuickInfo" (taskId: string|number): void; + "onAfterQuickInfo"(taskId: string | number): void; /** * fires after the redo() method was called * @param action a user action as an array of command objects */ - "onAfterRedo" (action: any[]): void; + "onAfterRedo"(action: any[]): void; /** * fires after resizing of the row height is finished @@ -69,7 +69,7 @@ export interface GanttEventCallback { * @param oldHeight the old height of the row * @param newHeight the new height of the row */ - "onAfterRowResize" (id: string|number, task: Task, oldHeight: number, newHeight: number): void; + "onAfterRowResize"(id: string | number, task: Task, oldHeight: number, newHeight: number): void; /** * fires after tasks are sorted in the grid @@ -77,14 +77,14 @@ export interface GanttEventCallback { * @param desc optional, the sorting direction: true - descending, false - ascending
* @param parent optional, the id of the parent task, if the tasks were sorted only in the branch of the specified parent */ - "onAfterSort" (field: string|GanttCallback, desc?: boolean, parent?: string|number): void; + "onAfterSort"(field: string | GanttCallback, desc?: boolean, parent?: string | number): void; /** * fires after the user adds a task to the Gantt chart * @param id the task id * @param task the task object */ - "onAfterTaskAdd" (id: string|number, task: Task): void; + "onAfterTaskAdd"(id: string | number, task: Task): void; /** * fires for each task which has been autoscheduled @@ -93,14 +93,14 @@ export interface GanttEventCallback { * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ - "onAfterTaskAutoSchedule" (task: Task, start: Date, link: Link, predecessor: Task): void; + "onAfterTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): void; /** * fires after the user deletes a task * @param id the task id * @param task the task object */ - "onAfterTaskDelete" (id: string|number, task: Task): void; + "onAfterTaskDelete"(id: string | number, task: Task): void; /** * fires after the user has finished to drag and released the mouse button @@ -108,7 +108,7 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ - "onAfterTaskDrag" (id: string|number, mode: string, e: Event): void; + "onAfterTaskDrag"(id: string | number, mode: string, e: Event): void; /** * fires after a task was moved to a new vertical position @@ -116,131 +116,131 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onAfterTaskMove" (id: string|number, parent: string|number, tindex: number): void; + "onAfterTaskMove"(id: string | number, parent: string | number, tindex: number): void; /** * fires after the user updates a task * @param id the task id * @param task the task object */ - "onAfterTaskUpdate" (id: string|number, task: Task): void; + "onAfterTaskUpdate"(id: string | number, task: Task): void; /** * fires after the undo() method was called * @param action an array of command objects */ - "onAfterUndo" (action: any[]): void; + "onAfterUndo"(action: any[]): void; /** * fires if the server returns an error * @param request XML HTTP request object */ - "onAjaxError" (request: any): boolean; + "onAjaxError"(request: any): boolean; /** * fires if some dependency loops were found during auto scheduling * @param groups an array of dependency loops found in gantt */ - "onAutoScheduleCircularLink" (groups: any[]): void; + "onAutoScheduleCircularLink"(groups: any[]): void; /** * fires before auto scheduling * @param taskId the root task id */ - "onBeforeAutoSchedule" (taskId: string|number): boolean; + "onBeforeAutoSchedule"(taskId: string | number): boolean; /** * fires before the api/gantt_batchupdate.md method is called */ - "onBeforeBatchUpdate" (): void; + "onBeforeBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after a user expands the task branch but before loading starts * @param settings an object which contains the task id and request URL */ - "onBeforeBranchLoading" (settings: any): boolean; + "onBeforeBranchLoading"(settings: any): boolean; /** * before gantt exits the fullscreen mode and goes back to normal mode */ - "onBeforeCollapse" (): boolean; + "onBeforeCollapse"(): boolean; /** * fires before data is rendered on the page */ - "onBeforeDataRender" (): void; + "onBeforeDataRender"(): void; /** * fires before gantt is expanded to full screen */ - "onBeforeExpand" (): boolean; + "onBeforeExpand"(): boolean; /** * fires before the dhtmlxGantt initialization is started */ - "onBeforeGanttReady" (): void; + "onBeforeGanttReady"(): void; /** * fires before the Gantt chart is rendered on the page */ - "onBeforeGanttRender" (): void; + "onBeforeGanttRender"(): void; /** * fires immediately before the user opens the lightbox (edit form) * @param id the task id */ - "onBeforeLightbox" (id: string|number): boolean; + "onBeforeLightbox"(id: string | number): boolean; /** * fires before a new link is added to the Gantt chart * @param id the link id * @param link the link object */ - "onBeforeLinkAdd" (id: string|number, link: Link): boolean; + "onBeforeLinkAdd"(id: string | number, link: Link): boolean; /** * fires before the user deletes a link * @param id the link id * @param link the link object */ - "onBeforeLinkDelete" (id: string|number, link: Link): boolean; + "onBeforeLinkDelete"(id: string | number, link: Link): boolean; /** * fires after the links have been loaded to the Gantt chart but before they are displayed * @param id the link id * @param link the link object */ - "onBeforeLinkDisplay" (id: string|number, link: Link): boolean; + "onBeforeLinkDisplay"(id: string | number, link: Link): boolean; /** * fires before a link is updated * @param id the link id * @param new_link the new (updated) object of the link */ - "onBeforeLinkUpdate" (id: string|number, new_link: Link): boolean; + "onBeforeLinkUpdate"(id: string | number, new_link: Link): boolean; /** * fires before selecting a task or a range of tasks * @param e a native event object */ - "onBeforeMultiSelect" (e: Event): void; + "onBeforeMultiSelect"(e: Event): void; /** * fires before data started to be parsed */ - "onBeforeParse" (): void; + "onBeforeParse"(): void; /** * fires before the redo() method is called * @param action a user action as an array of command objects */ - "onBeforeRedo" (action: any[]): boolean; + "onBeforeRedo"(action: any[]): boolean; /** * fires before an action is added into the redo stack * @param action a user action as an array of command objects */ - "onBeforeRedoStack" (action: UndoRedoAction): boolean; + "onBeforeRedoStack"(action: UndoRedoAction): boolean; /** * fires before the rollup task is displayed on its parent project @@ -248,7 +248,7 @@ export interface GanttEventCallback { * @param task the rollup task object * @param parentId the id of the parent (project) task */ - "onBeforeRollupTaskDisplay" (taskId: number|string, task: Task, parentId: number|string): boolean; + "onBeforeRollupTaskDisplay"(taskId: number | string, task: Task, parentId: number | string): boolean; /** * fires when a user drops a row in the grid @@ -256,7 +256,7 @@ export interface GanttEventCallback { * @param parent the parent id. If specified, the tindex will refer to the index in the
'parent' branch * @param tindex the index of the position that the task will be moved from
(the index in the whole tree) */ - "onBeforeRowDragEnd" (sid: string|number, parent: string|number, tindex: number): boolean; + "onBeforeRowDragEnd"(sid: string | number, parent: string | number, tindex: number): boolean; /** * fires before a row of the grid is dragged vertically to a different position @@ -264,13 +264,13 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onBeforeRowDragMove" (id: string|number, parent: string|number, tindex: number): boolean; + "onBeforeRowDragMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the user starts to resize the row height by drag-and-drop * @param task the task object */ - "onBeforeRowResize" (task: Task): boolean; + "onBeforeRowResize"(task: Task): boolean; /** * fires before resizing of the row height is completed @@ -278,7 +278,7 @@ export interface GanttEventCallback { * @param task the task object * @param newHeight the new height of the row */ - "onBeforeRowResizeEnd" (id: number|string, task: Task, newHeight: number): boolean; + "onBeforeRowResizeEnd"(id: number | string, task: Task, newHeight: number): boolean; /** * fires before a part of the split task is displayed on the Gantt chart @@ -286,14 +286,14 @@ export interface GanttEventCallback { * @param task the object of the subtask * @param parent the object of the parent task */ - "onBeforeSplitTaskDisplay" (id: number|string, task: Task, parent: any): boolean; + "onBeforeSplitTaskDisplay"(id: number | string, task: Task, parent: any): boolean; /** * fires before a new task is added to the Gantt chart * @param id the task id * @param task the task object */ - "onBeforeTaskAdd" (id: string|number, task: Task): boolean; + "onBeforeTaskAdd"(id: string | number, task: Task): boolean; /** * fires for each task which is rescheduled @@ -302,7 +302,7 @@ export interface GanttEventCallback { * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ - "onBeforeTaskAutoSchedule" (task: Task, start: Date, link: Link, predecessor: Task): boolean; + "onBeforeTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): boolean; /** * fires after the user has finished dragging and released the mouse button but before the changes are applied @@ -310,21 +310,21 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param task the copy of the task object in its original state (before drag and drop) */ - "onBeforeTaskChanged" (id: string|number, mode: string, task: Task): boolean; + "onBeforeTaskChanged"(id: string | number, mode: string, task: Task): boolean; /** * fires before the user deletes a task * @param id the task id * @param task the task object */ - "onBeforeTaskDelete" (id: string|number, task: Task): boolean; + "onBeforeTaskDelete"(id: string | number, task: Task): boolean; /** * fires after the tasks have been loaded to the Gantt chart, but before they are displayed * @param id the task id * @param task the task object */ - "onBeforeTaskDisplay" (id: string|number, task: Task): boolean; + "onBeforeTaskDisplay"(id: string | number, task: Task): boolean; /** * fires after the user has pressed the mouse button and started dragging, but before dhtmlxGantt starts the drag-and-drop operation @@ -332,7 +332,7 @@ export interface GanttEventCallback { * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ - "onBeforeTaskDrag" (id: string|number, mode: string, e: Event): boolean; + "onBeforeTaskDrag"(id: string | number, mode: string, e: Event): boolean; /** * fires before a task is moved to a new vertical position @@ -340,7 +340,7 @@ export interface GanttEventCallback { * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ - "onBeforeTaskMove" (id: string|number, parent: string|number, tindex: number): boolean; + "onBeforeTaskMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the task selection state is being changed (the task is being selected or unselected) @@ -348,49 +348,49 @@ export interface GanttEventCallback { * @param state true if the task is going to be selected, false - if unselected * @param e a native event object */ - "onBeforeTaskMultiSelect" (id: string|number, state: boolean, e: Event|null): void; + "onBeforeTaskMultiSelect"(id: string | number, state: boolean, e: Event | null): void; /** * fires before the user selects a task * @param id the task id */ - "onBeforeTaskSelected" (id: string|number): boolean; + "onBeforeTaskSelected"(id: string | number): boolean; /** * fires before the user updates a task * @param id the task id * @param new_task the new (updated) object of the task */ - "onBeforeTaskUpdate" (id: string|number, new_task: Task): void; + "onBeforeTaskUpdate"(id: string | number, new_task: Task): void; /** * fires before the undo() method is called * @param action an array of command objects */ - "onBeforeUndo" (action: any[]): boolean; + "onBeforeUndo"(action: any[]): boolean; /** * fires before an action is added into the undo stack * @param action a user action as an array of command objects */ - "onBeforeUndoStack" (action: UndoRedoAction): boolean; + "onBeforeUndoStack"(action: UndoRedoAction): boolean; /** * fires when the circular reference has been detected and auto scheduling is not possible * @param link the link object * @param group a group of tasks and links connected in a loop */ - "onCircularLinkError" (link: Link, group: any): void; + "onCircularLinkError"(link: Link, group: any): void; /** * fires after all tasks were removed from the Gantt chart by the api/gantt_clearall.md method */ - "onClear" (): void; + "onClear"(): void; /** * fires when gantt went back to normal mode from the full screen mode */ - "onCollapse" (): void; + "onCollapse"(): void; /** * fires when the user is dragging the column's border to resize the column @@ -398,7 +398,7 @@ export interface GanttEventCallback { * @param column the column object * @param new_width the new column's width */ - "onColumnResize" (index: number, column: GridColumn, new_width: number): void; + "onColumnResize"(index: number, column: GridColumn, new_width: number): void; /** * fires after the user finished dragging the column's border to resize the column @@ -406,14 +406,14 @@ export interface GanttEventCallback { * @param column the column object * @param new_width the new column's width */ - "onColumnResizeEnd" (index: number, column: GridColumn, new_width: number): boolean; + "onColumnResizeEnd"(index: number, column: GridColumn, new_width: number): boolean; /** * fires before the user starts to drag the column's border to resize the column * @param index the column index * @param column the column object */ - "onColumnResizeStart" (index: number, column: GridColumn): boolean; + "onColumnResizeStart"(index: number, column: GridColumn): boolean; /** * fires when a user clicks the right mouse button inside the Gantt chart (see the details) @@ -421,95 +421,95 @@ export interface GanttEventCallback { * @param linkId the link id * @param e a native event object */ - "onContextMenu" (taskId: string|number, linkId: string|number, e: Event): void; + "onContextMenu"(taskId: string | number, linkId: string | number, e: Event): void; /** * fires on the `dp.init(gantt)` call * @param DataProcessor the DataProcessor object */ - "onDataProcessorReady" (DataProcessor: any): void; + "onDataProcessorReady"(DataProcessor: any): void; /** * fires after data has been rendered on the page */ - "onDataRender" (): void; + "onDataRender"(): void; /** * called after gantt has been cleared by the api/gantt_destructor.md method */ - "onDestroy" (): void; + "onDestroy"(): void; /** * fires when the user clicks on an empty space in the Gantt chart (not on tasks) * @param e a native event object */ - "onEmptyClick" (e: Event): void; + "onEmptyClick"(e: Event): void; /** * fires when api/gantt_assert.md receives 'false' value, i.e. when assertion fails * @param errorMessage a string with an error from the api/gantt_assert.md method */ - "onError" (errorMessage: string): boolean; + "onError"(errorMessage: string): boolean; /** * fires when gantt is expanded to full screen */ - "onExpand" (): void; + "onExpand"(): void; /** * fires after the Gantt layout is ready, but before it is rendered */ - "onGanttLayoutReady" (): void; + "onGanttLayoutReady"(): void; /** * fires after the dhtmlxGantt initialization is complete but the Gantt chart is not rendered on the page yet */ - "onGanttReady" (): void; + "onGanttReady"(): void; /** * fires after the Gantt chart was rendered on the page */ - "onGanttRender" (): void; + "onGanttRender"(): void; /** * fires when the Gantt chart is scrolled to a particular point * @param left the position of horizontal scroll * @param top the position of vertical scroll */ - "onGanttScroll" (left: number, top: number): void; + "onGanttScroll"(left: number, top: number): void; /** * fires when the user clicks on the grid's header * @param name the name attribute of the column which header the user clicks on * @param e a native event object */ - "onGridHeaderClick" (name: string, e: Event): boolean; + "onGridHeaderClick"(name: string, e: Event): boolean; /** * fires when the user is dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ - "onGridResize" (old_width: number, new_width: number): void; + "onGridResize"(old_width: number, new_width: number): void; /** * fires after the user finished dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ - "onGridResizeEnd" (old_width: number, new_width: number): boolean; + "onGridResizeEnd"(old_width: number, new_width: number): boolean; /** * fires before the user starts to drag the grid's border to resize the grid * @param old_width the initial grid's width */ - "onGridResizeStart" (old_width: number): boolean; + "onGridResizeStart"(old_width: number): boolean; /** * fires after the user has opened the lightbox (edit form) * @param task_id the id of the task opened in the lightbox */ - "onLightbox" (task_id: string|number): void; + "onLightbox"(task_id: string | number): void; /** * fires when the user clicks on a custom button in the lightbox @@ -517,26 +517,26 @@ export interface GanttEventCallback { * @param node an HTML element of the clicked button * @param e a native 'click' event object */ - "onLightboxButton" (css: string, node: HTMLElement, e: Event): void; + "onLightboxButton"(css: string, node: HTMLElement, e: Event): void; /** * fires when the user clicks on the 'Cancel' button in the lightbox * @param id the task id ( the task opened in the lightbox) */ - "onLightboxCancel" (id: string|number): void; + "onLightboxCancel"(id: string | number): void; /** * fires when the structure of the lightbox is changed * @param old_type the name of the initial lighbox's structure * @param new_type the name of the new lighbox's structure */ - "onLightboxChange" (old_type: string, new_type: string): void; + "onLightboxChange"(old_type: string, new_type: string): void; /** * fires when the user clicks on the 'Delete' button in the lightbox * @param id the task id (the task opened in the lightbox) */ - "onLightboxDelete" (id: string|number): boolean; + "onLightboxDelete"(id: string | number): boolean; /** * fires when the user clicks on the 'Save' button in the lightbox @@ -544,90 +544,90 @@ export interface GanttEventCallback { * @param task the modified task object * @param is_new specifies whether the user opens the lightbox to create a new task (true)
or update an existing one (false) */ - "onLightboxSave" (id: string|number, task: Task, is_new: boolean): boolean; + "onLightboxSave"(id: string | number, task: Task, is_new: boolean): boolean; /** * fires when the user clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ - "onLinkClick" (id: string|number, e?: Event): void; + "onLinkClick"(id: string | number, e?: Event): void; /** * fires when a user creates a new link between tasks * @param link the object of a new link */ - "onLinkCreated" (link: Link): boolean; + "onLinkCreated"(link: Link): boolean; /** * fires when the user double clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ - "onLinkDblClick" (id: string|number, e?: Event): boolean; + "onLinkDblClick"(id: string | number, e?: Event): boolean; /** * fires when the id of a link is changed * @param id the current link id * @param new_id the new link id */ - "onLinkIdChange" (id: string|number, new_id: string|number): void; + "onLinkIdChange"(id: string | number, new_id: string | number): void; /** * fires when the user adds a new link and dhtmlxGantt checks whether the link is valid * @param link the link object */ - "onLinkValidation" (link: Link): boolean; + "onLinkValidation"(link: Link): boolean; /** * fires after loading data from the data source has been completed * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ - "onLoadEnd" (url: string, type: string): void; + "onLoadEnd"(url: string, type: string): void; /** * fires immediately before loading data from the data source has been started * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ - "onLoadStart" (url: string, type: string): void; + "onLoadStart"(url: string, type: string): void; /** * fires when the mouse is moved over the gantt container * @param id the id of the task that the mouse is moved over * @param e a native event object */ - "onMouseMove" (id: string|number, e: Event): void; + "onMouseMove"(id: string | number, e: Event): void; /** * fires after selection of a task or a range of tasks has been completed * @param e a native event object */ - "onMultiSelect" (e: Event): void; + "onMultiSelect"(e: Event): void; /** * fires after a collection of options has been loaded from the server, but isn't parsed yet */ - "onOptionsLoad" (): void; + "onOptionsLoad"(): void; /** * fires after data was parsed (became available for API) but before it was rendered in the Gantt chart */ - "onParse" (): void; + "onParse"(): void; /** * fires when the pop-up edit form appears * @param taskId the task id */ - "onQuickInfo" (taskId: string|number): void; + "onQuickInfo"(taskId: string | number): void; /** * fires after the user drops a vertically reordered row in the grid * @param id the id of the task that the user has dragged vertically in the grid * @param target the id of the task which place the dragged row has occupied */ - "onRowDragEnd" (id: string|number, target: string|number): void; + "onRowDragEnd"(id: string | number, target: string | number): void; /** * fires before the user drags a row of the grid to vertically reorder it @@ -635,7 +635,7 @@ export interface GanttEventCallback { * @param target an HTML element of the task that the user drags * @param e a native event object */ - "onRowDragStart" (id: string|number, target: HTMLElement, e: Event): boolean; + "onRowDragStart"(id: string | number, target: HTMLElement, e: Event): boolean; /** * fires when the user is dragging the border of the row to resize the row height @@ -643,45 +643,45 @@ export interface GanttEventCallback { * @param task the task object * @param currentHeight the current height of the row */ - "onRowResize" (id: string|number, task: Task, currentHeight: number): void; + "onRowResize"(id: string | number, task: Task, currentHeight: number): void; /** * fires when the scale is re-rendered in order to display all tasks completely */ - "onScaleAdjusted" (): void; + "onScaleAdjusted"(): void; /** * fires when the user clicks on the cell in the time scale * @param e a native event object * @param date the date of the clicked cell */ - "onScaleClick" (e: Event, date: Date): void; + "onScaleClick"(e: Event, date: Date): void; /** * fires when the user clicks on a task row in the grid area (including the 'expand/collapse' and 'add task' buttons) or on a task bar in the timeline area * @param id the id of the clicked task * @param e optional, a native event object */ - "onTaskClick" (id: string|number, e?: Event): boolean; + "onTaskClick"(id: string | number, e?: Event): boolean; /** * fires when a branch has been closed * @param id the branch id */ - "onTaskClosed" (id: string|number): void; + "onTaskClosed"(id: string | number): void; /** * fires when a user creates a new task by pressing the'+' button in a grid, or when the api/gantt_createtask.md method is called * @param task the object of a new task */ - "onTaskCreated" (task: Task): boolean; + "onTaskCreated"(task: Task): boolean; /** * fires when the user double clicks on a task * @param id the id of the double clicked task * @param e a native event object */ - "onTaskDblClick" (id: string, e?: Event): boolean; + "onTaskDblClick"(id: string, e?: Event): boolean; /** * fires when the user drags a task @@ -691,20 +691,20 @@ export interface GanttEventCallback { * @param original the original(initial) task object * @param e a native event object */ - "onTaskDrag" (id: string|number, mode: string, task: Task, original: Task, e: Event): void; + "onTaskDrag"(id: string | number, mode: string, task: Task, original: Task, e: Event): void; /** * fires when the id of a task is changed * @param id the current task's id * @param new_id the new task's id */ - "onTaskIdChange" (id: string|number, new_id: string|number): void; + "onTaskIdChange"(id: string | number, new_id: string | number): void; /** * fires when a task is being loaded from the data source * @param task the object of a task */ - "onTaskLoading" (task: Task): boolean; + "onTaskLoading"(task: Task): boolean; /** * fires after the task selection state has changed (the task has been selected/unselected) @@ -712,46 +712,49 @@ export interface GanttEventCallback { * @param state true if the task has been selected, false - if unselected * @param e a native event object */ - "onTaskMultiSelect" (id: string|number, state: boolean, e: Event): void; + "onTaskMultiSelect"(id: string | number, state: boolean, e: Event): void; /** * fires when a branch has been opened * @param id the branch id */ - "onTaskOpened" (id: string|number): void; + "onTaskOpened"(id: string | number): void; /** * fires when the user clicks on a row in the table * @param id the task id * @param row an HTML element of the clicked row */ - "onTaskRowClick" (id: string|number, row: HTMLElement): void; + "onTaskRowClick"(id: string | number, row: HTMLElement): void; /** * fires when the user selects a task * @param id the task id */ - "onTaskSelected" (id: string|number): void; + "onTaskSelected"(id: string | number): void; /** * fires when the user unselects a task by selecting some other task * @param id the task id (of the unselected task) */ - "onTaskUnselected" (id: string|number): void; + "onTaskUnselected"(id: string | number): void; /** * fires when the dhtmlxGantt templates are initialized */ - "onTemplatesReady" (): void; + "onTemplatesReady"(): void; } -export interface GanttTemplates { +export interface GanttTemplates { /** * specifies the text displayed inside the baseline element + * @param task the task object associated with the baseline + * @param baseline the baseline object + * @param index the index of the baseline in the task's baselines array */ - baseline_text(): void; + baseline_text(task: Task, baseline: Baseline, index: number): string | number | void; /** * specifies the content of columns that show dates (return `Date` values) in grid @@ -768,7 +771,7 @@ export interface GanttTemplates { * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
to the end of the task */ - drag_link(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; + drag_link(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string; /** * specifies the CSS class that will be applied to the pop-up that appears when a user drags a link @@ -777,7 +780,7 @@ export interface GanttTemplates { * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start true, if the link is being dragged to the start of the target task, false - if
to the end of the task */ - drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string; + drag_link_class(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string | void; /** * converts a date object to a date string. Used to send data back to the server @@ -815,7 +818,7 @@ export interface GanttTemplates { * @param columnName the column's name (as specified in the "name" property of the column object) * @param column column object (as specified in the gantt.config.columns config) */ - grid_header_class(columnName: string, column: any): string; + grid_header_class(columnName: string, column: any): string | void; /** * specifies the indent of the child items in a branch (in the tree column) @@ -835,7 +838,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - grid_row_class(start: Date, end: Date, task: Task): string; + grid_row_class(start: Date, end: Date, task: Task): string | void; /** * defines the height of the filled area in the resourceHistogram @@ -845,7 +848,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): number | void; /** * specifies the height of the line that defines the available capacity of the resource @@ -855,7 +858,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): number | void; /** * defines the CSS class which is applied to a cell of the resource panel @@ -865,7 +868,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | void; /** * defines the label inside a cell @@ -875,13 +878,13 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): void; + histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to a link * @param link the link object */ - link_class(link: Link): string; + link_class(link: Link): string | void; /** * specifies the text in the header of the link's "delete" confirm window @@ -901,7 +904,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - progress_text(start: Date, end: Date, task: Task): string; + progress_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the CSS class that will be applied to the pop-up edit form @@ -909,7 +912,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - quick_info_class(start: Date, end: Date, task: Task): void; + quick_info_class(start: Date, end: Date, task: Task): string | void; /** * specifies the content of the pop-up edit form @@ -933,7 +936,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - quick_info_title(start: Date, end: Date, task: Task): string; + quick_info_title(start: Date, end: Date, task: Task): string | number | void; /** * defines the CSS class names of cells in the resource timeline cells @@ -943,7 +946,7 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): string; + resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | void; /** * defines the HTML content of resource timeline cells @@ -953,19 +956,19 @@ export interface GanttTemplates { * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ - resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: Array , assignments: any[]): string; + resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: Array, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to cells of the time scale of the timeline area * @param date the date of a cell */ - scale_cell_class(date: Date): string; + scale_cell_class(date: Date): string | void; /** * specifies the CSS class that will be applied to the time scale * @param scale the scale's configuration object */ - scale_row_class(scale: Scale): string; + scale_row_class(scale: Scale): string | void; /** * specifies the CSS class that will be applied to task bars @@ -973,7 +976,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_class(start: Date, end: Date, task: Task): string; + task_class(start: Date, end: Date, task: Task): string | void; /** * specifies the date format of the label in the 'Time period' section of the lightbox @@ -993,7 +996,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_row_class(start: Date, end: Date, task: Task): string; + task_row_class(start: Date, end: Date, task: Task): string | void; /** * specifies the text in the task bars and the header of the lightbox @@ -1001,7 +1004,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - task_text(start: Date, end: Date, task: Task): string; + task_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the date period in the header of the lightbox @@ -1015,7 +1018,7 @@ export interface GanttTemplates { * specifies the dates of unscheduled tasks * @param task the task object */ - task_unscheduled_time(task: Task): void; + task_unscheduled_time(task: Task): string | void; /** * specifies the format of the drop-down time selector in the lightbox @@ -1028,14 +1031,14 @@ export interface GanttTemplates { * @param item either the task's or resource's object assigned to the row * @param date the date of a cell */ - timeline_cell_class(item: any, date: Date): string; + timeline_cell_class(item: any, date: Date): string | void; /** * specifies custom HTML content in the timeline cells * @param task the task's object * @param date the date of a cell */ - timeline_cell_content(task: Task, date: Date): string; + timeline_cell_content(task: Task, date: Date): string | number | void; /** * specifies the format of start and end dates displayed in the tooltip @@ -1049,7 +1052,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - tooltip_text(start: Date, end: Date, task: Task): string; + tooltip_text(start: Date, end: Date, task: Task): string | void; /** * specifies the text assigned to tasks bars on the right side @@ -1057,7 +1060,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - rightside_text(start: Date, end: Date, task: Task): string; + rightside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the text assigned to tasks bars on the left side @@ -1065,7 +1068,7 @@ export interface GanttTemplates { * @param end the date when a task is scheduled to be completed * @param task the task object */ - leftside_text(start: Date, end: Date, task: Task): string; + leftside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the lightbox's header @@ -1075,15 +1078,21 @@ export interface GanttTemplates { */ lightbox_header(start_date: Date, end_date: Date, task: Task): string; + /** + * specifies the CSS class that will be applied to markers + * @param marker the marker's configuration object + */ + marker_class(marker: any): void; + [customTemplate: string]: any; } -export interface GanttConfigOptions { +export interface GanttConfigOptions { /** * enables auto scheduling */ - auto_scheduling: any; + auto_scheduling: boolean | AutoSchedulingConfig; /** * disables usage of time contraints for tasks @@ -1143,7 +1152,7 @@ export interface GanttConfigOptions { /** * forces the Gantt chart to automatically change its size to show all tasks without scrolling */ - autosize: boolean|string; + autosize: boolean | string; /** * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode @@ -1153,7 +1162,7 @@ export interface GanttConfigOptions { /** * sets the height of task bars in the timeline area */ - bar_height: number|string; + bar_height: number | string; /** * adjusts the padding around task bars in the timeline when `bar_height` is set to "full" @@ -1163,7 +1172,7 @@ export interface GanttConfigOptions { /** * configures the functionality of baselines in the Gantt chart */ - baselines: any; + baselines: BaselineConfig | boolean; /** * enables dynamic loading in the Gantt chart @@ -1198,7 +1207,7 @@ export interface GanttConfigOptions { /** * enables advanced drag-n-drop */ - click_drag: undefined|ClickDrag; + click_drag: undefined | ClickDrag; /** * configures the columns of the table @@ -1230,7 +1239,7 @@ export interface GanttConfigOptions { /** * defines whether the gantt should track resizing of the container at time intervals */ - container_resize_method: string|undefined; + container_resize_method: string | undefined; /** * specifies the delay (in milliseconds) before redrawing the gantt when resizing the container @@ -1245,7 +1254,7 @@ export interface GanttConfigOptions { /** * defines internal implementation of the code of date formatting methods */ - csp: boolean|string; + csp: boolean | string; /** * sets the date format that is used to parse data from a data set and to send dates back to the server @@ -1332,7 +1341,7 @@ export interface GanttConfigOptions { * @param if the property is specified, scrolling the timeline will be activated only when the specified modifier key is pressed. The supported values are: "ctrlKey", "shiftKey", "metaKey", "altKey" * @param if the property is enabled, scrolling the timeline will be rerendered when the scroll is started and when it is ended */ - drag_timeline: null | { + drag_timeline: null | { ignore?: string, useKey?: string | boolean, render?: boolean @@ -1381,7 +1390,7 @@ export interface GanttConfigOptions { /** * sets the end value of the time scale */ - end_date: Date|undefined; + end_date: Date | undefined; /** * renders an external component into the DOM @@ -1390,8 +1399,8 @@ export interface GanttConfigOptions { * @param a DOM element the native component will be attached to. */ external_render: { - isElement ( element: any ): boolean, - renderElement ( element: any, container: HTMLElement ): void + isElement(element: any): boolean, + renderElement(element: any, container: HTMLElement): void } /** @@ -1399,44 +1408,10 @@ export interface GanttConfigOptions { */ fit_tasks: boolean; - /** - * an object of the lightbox controls - * @param the [Checkbox](desktop/checkbox.md) control - * @param the [Constraint](desktop/constraint.md) control - * @param the [Duration](desktop/duration.md) control - * @param the [Duration](desktop/duration.md) control that allows changing the [section visibility](desktop/duration.md#switchingsectionvisibility) - * @param the [Parent](desktop/parent.md) control - * @param the [Radio button](desktop/radio.md) control - * @param the [Resources](desktop/resources.md) control - * @param the [Select](desktop/select.md) control - * @param the [Template](desktop/template.md) control - * @param the [Textarea](desktop/textarea.md) control - * @param the [Time](desktop/time.md) control - * @param the [Time](desktop/time.md) control that allows changing the [section visibility](desktop/time.md#switchingsectionvisibility) - * @param the [Typeselect](desktop/typeselect.md) control - * @param a custom control - */ - form_blocks: { - checkbox?: LightboxControl, - constraint?: LightboxControl, - duration?: LightboxControl, - duration_optional?: LightboxControl, - parent?: LightboxControl, - radio?: LightboxControl, - resources?: LightboxControl, - select?: LightboxControl, - template?: LightboxControl, - textarea?: LightboxControl, - time?: LightboxControl, - time_optional?: LightboxControl, - typeselect?: LightboxControl, - [ControlName: string]: LightboxControl | undefined - } - /** * adjusts the width of columns inside a scrollable grid */ - grid_elastic_columns: boolean|string; + grid_elastic_columns: boolean | string; /** * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index @@ -1456,7 +1431,7 @@ export interface GanttConfigOptions { /** * enables/disables horizontal scroll by the Shift|Alt|Meta key + mouse wheel movement */ - horizontal_scroll_key: string|boolean; + horizontal_scroll_key: string | boolean; /** * defines whether tasks should inherit work calendars from their summary parents @@ -1476,12 +1451,12 @@ export interface GanttConfigOptions { /** * keeps the duration of a task unchanged during editing of the start/end of a task */ - inline_editors_date_processing: string|undefined; + inline_editors_date_processing: string | undefined; /** * defines whether inline editor should be opened after one click on a task when multi-task selection is enabled */ - inline_editors_multiselect_open: boolean|undefined; + inline_editors_multiselect_open: boolean | undefined; /** * 'says' to preserve the initial grid's width while resizing columns within @@ -1600,7 +1575,7 @@ export interface GanttConfigOptions { /** * activates the 'branch' mode that allows vertically reordering tasks within the same tree level */ - order_branch: string|boolean; + order_branch: string | boolean; /** * activates the 'branch' mode that allows reordering tasks within the whole gantt @@ -1625,12 +1600,12 @@ export interface GanttConfigOptions { /** * specifies the end date of a project */ - project_end: Date|undefined; + project_end: Date | undefined; /** * specifies the start date of a project */ - project_start: Date|undefined; + project_start: Date | undefined; /** * defines whether the task form will appear from the left/right side of the screen or near the selected task @@ -1682,7 +1657,7 @@ export interface GanttConfigOptions { * @param mapping of the resource calendar */ resource_calendars: { - [resourceId: string | number]: string | number | {[resourceId: string | number]: string | number | undefined } | undefined + [resourceId: string | number]: string | number | { [resourceId: string | number]: string | number | undefined } | undefined } /** @@ -1712,24 +1687,24 @@ export interface GanttConfigOptions { * @param optional, enables showing all tasks assigned to a certain resource in the resource view panel. This functionality works both for the resource diagram and resource histogram types of layout. * @param an array with resources */ - resources: boolean | { + resources: boolean | { dataprocessor_assignments?: boolean, dataprocessor_resources?: boolean, editable_resource_diagram?: boolean, - resource_store?: { + resource_store?: { type?: string, initItem?: (( item: any, - )=> any ), + ) => any), fetchTasks?: boolean }, - lightbox_resources? ( resourceArray: any ): any + lightbox_resources?(resourceArray: any): any } /** * sets the id of the virtual root element */ - root_id: string|number; + root_id: string | number; /** * enables rounding the task's start and end dates to the nearest scale marks @@ -1864,7 +1839,7 @@ export interface GanttConfigOptions { /** * sets the start value of the time scale */ - start_date: Date|undefined; + start_date: Date | undefined; /** * sets the starting day of the week @@ -1939,12 +1914,12 @@ export interface GanttConfigOptions { /** * enables/disables the touch support for the Gantt chart */ - touch: boolean|string; + touch: boolean | string; /** * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture */ - touch_drag: number|boolean; + touch_drag: number | boolean; /** * returns vibration feedback before/after drag and drop on touch devices @@ -2021,7 +1996,7 @@ export interface GanttConfigOptions { * @param the horizontal speed * @param the vertical speed */ - wheel_scroll_sensitivity: undefined | number | { + wheel_scroll_sensitivity: undefined | number | { x?: number, y?: number } @@ -2039,7 +2014,7 @@ export interface GanttConfigOptions { [customConfig: string]: any; } -export interface GanttHotkeys { +export interface GanttHotkeys { edit_save: number; edit_cancel: number; } @@ -2066,6 +2041,8 @@ export interface GanttLocaleLabels { section_description: string; section_time: string; section_type: string; + section_deadline: string; + section_baselines: string; /* grid columns */ column_wbs: string; @@ -2134,10 +2111,11 @@ export interface GanttPlugins { marker?: boolean; multiselect?: boolean; overlay?: boolean; + export_api?: boolean; } export interface GanttInitializationConfig { - container?: string|HTMLElement; + container?: string | HTMLElement; config?: any; templates?: any; events?: any; @@ -2155,11 +2133,11 @@ export type GanttPlugin = (gantt: GanttStatic) => void; export interface GanttEnterprise { plugin(plugin: GanttPlugin): void; - getGanttInstance(settings?: GanttInitializationConfig) : GanttStatic; + getGanttInstance(settings?: GanttInitializationConfig): GanttStatic; } -export interface GanttStatic { +export interface GanttStatic { /** * redefines the default click behavior for buttons of the Gantt chart @@ -2298,7 +2276,7 @@ export interface GanttStatic { /** * various helper modules */ - utils: {dom: DomHelpers}; + utils: { dom: DomHelpers }; /** * returns the version of dhtmlxGantt @@ -2356,19 +2334,19 @@ export interface GanttStatic { * adds a new dependency link * @param link the link object */ - addLink(link: any): string|number; + addLink(link: any): string | number; /** * displays an additional layer with custom elements for a link in the timeline area * @param func a render function or a config object */ - addLinkLayer(func: AdditionalLinkLayer["LinkLayerRender"]|AdditionalLinkLayer["LinkLayerConfig"]): string; + addLinkLayer(func: AdditionalLinkLayer["LinkLayerRender"] | AdditionalLinkLayer["LinkLayerConfig"]): string; /** * adds a marker to the timeline area * @param marker the marker's configuration object */ - addMarker(marker: MarkerConfig): number|string; + addMarker(marker: MarkerConfig): number | string; /** * adds a new keyboard shortcut @@ -2384,24 +2362,25 @@ export interface GanttStatic { * @param parent optional, the parent's id * @param index optional, the position the task will be added into (0 or greater) */ - addTask(task: NewTask, parent?: string|number, index?: number): string|number; + addTask(task: NewTask, parent?: string | number, index?: number): string | number; /** * displays an additional layer with custom elements for a task in the timeline area * @param func a render function or a config object */ - addTaskLayer(func: AdditionalTaskLayer["TaskLayerRender"]|AdditionalTaskLayer["TaskLayerConfig"]): string; + addTaskLayer(func: AdditionalTaskLayer["TaskLayerRender"] | AdditionalTaskLayer["TaskLayerConfig"]): string; /** * adjusts the task's row height for proper display of baseline elements + * @param task the task object whose `row_height` will be adjusted */ - adjustTaskHeightForBaselines(): void; + adjustTaskHeightForBaselines(task: Task): void; /** * calls an alert message box * @param config either an object with the alert box's configuration or the text to show */ - alert(config: AlertBoxConfig|string|number): HTMLElement; + alert(config: AlertBoxConfig | string | number): HTMLElement; /** * if the specified expression is false, an errorMessage is shown in the red popup at the top right corner of the screen @@ -2416,12 +2395,12 @@ export interface GanttStatic { * @param handler the handler function * @param settings optional, an object with settings for the event handler */ - attachEvent (event: T, handler: GanttEventCallback[T], settings?: HandlerSettings): string + attachEvent(event: T, handler: GanttEventCallback[T], settings?: HandlerSettings): string /** * recalculates the schedule of the project * @param taskId optional, the task id */ - autoSchedule(taskId?: string|number): void; + autoSchedule(taskId?: string | number): void; /** * updates multiple tasks/links at once @@ -2475,14 +2454,14 @@ export interface GanttStatic { * @param id the current link's id * @param new_id the new link's id */ - changeLinkId(id: string|number, new_id: string|number): void; + changeLinkId(id: string | number, new_id: string | number): void; /** * changes the task's id * @param id the current task's id * @param new_id the new task's id */ - changeTaskId(id: string|number, new_id: string|number): void; + changeTaskId(id: string | number, new_id: string | number): void; /** * checks whether an event has some handler(s) specified @@ -2509,7 +2488,7 @@ export interface GanttStatic { * closes the branch with the specified id * @param id the branch id */ - close(id: string|number): void; + close(id: string | number): void; /** * collapses gantt from the full screen mode to the normal mode @@ -2526,7 +2505,7 @@ export interface GanttStatic { * calls a confirm message box * @param config either an object with the confirm box's configuration or the text to show */ - confirm(config: ConfirmBoxConfig|string|number): HTMLElement; + confirm(config: ConfirmBoxConfig | string | number): HTMLElement; /** * creates a deep copy of provided object @@ -2550,7 +2529,7 @@ export interface GanttStatic { * creates a new dataProcessor instance and attaches it to gantt * @param config dataProcessor configuration object */ - createDataProcessor(config: DataProcessorConfig|RouterFunction|RouterConfig): any; + createDataProcessor(config: DataProcessorConfig | RouterFunction | RouterConfig): any; /** * creates a datastore according to the provided configuration @@ -2564,7 +2543,7 @@ export interface GanttStatic { * @param parent optional, the parent's id * @param index optional, the position the task will be added into (0 or greater) */ - createTask(task?: NewTask, parent?: string|number, index?: number): string|number; + createTask(task?: NewTask, parent?: string | number, index?: number): string | number; /** * dataProcessor constructor @@ -2588,25 +2567,25 @@ export interface GanttStatic { * deletes a task calendar by its id * @param id the id of the calendar */ - deleteCalendar(id: string|number): void; + deleteCalendar(id: string | number): void; /** * deletes the specified dependency link * @param id the dependency link's id */ - deleteLink(id: string|number): void; + deleteLink(id: string | number): void; /** * deletes the specified marker * @param markerId the marker's id */ - deleteMarker(markerId: string|number): void; + deleteMarker(markerId: string | number): void; /** * deletes the specified task * @param id the task's id */ - deleteTask(id: string|number): void; + deleteTask(id: string | number): void; /** * destroys the gantt instance @@ -2625,7 +2604,7 @@ export interface GanttStatic { * @param startTask the id of the item the parent tasks of which should be iterated over * @param master the object, that 'this' will refer to */ - eachParent(code: GanttCallback, startTask: string|number, master?: any): void; + eachParent(code: GanttCallback, startTask: string | number, master?: any): void; /** * iterates over all selected tasks in the Gantt chart @@ -2639,7 +2618,7 @@ export interface GanttStatic { * @param parent the parent id. If specified, the function will iterate over children of the
specified parent * @param master the object, that 'this' will refer to */ - eachTask(code: GanttCallback, parent?: string|number, master?: any): void; + eachTask(code: GanttCallback, parent?: string | number, master?: any): void; /** * attaches an event handler to an HTML element @@ -2648,7 +2627,7 @@ export interface GanttStatic { * @param handler the event handler * @param options optional, the value of either the useCapture or options parameter. Read details */ - event(node: HTMLElement|string, event: string, handler: GanttCallback, options?: boolean|HandlerSettings): void; + event(node: HTMLElement | string, event: string, handler: GanttCallback, options?: boolean | HandlerSettings): void; /** * removes an event handler from an HTML element @@ -2657,7 +2636,7 @@ export interface GanttStatic { * @param handler the event handler * @param options optional, the value of either the useCapture or options parameter. Read details */ - eventRemove(node: HTMLElement|string, event: string, handler: GanttCallback, options?: boolean|HandlerSettings): void; + eventRemove(node: HTMLElement | string, event: string, handler: GanttCallback, options?: boolean | HandlerSettings): void; /** * expands gantt to the full screen mode @@ -2720,7 +2699,7 @@ export interface GanttStatic { * gets worktime calendar by id * @param calendarId optional, the id of the global calendar or "global" */ - getCalendar(calendarId?: string|number): Calendar; + getCalendar(calendarId?: string | number): Calendar; /** * gets all the calendars added into Gantt @@ -2731,7 +2710,7 @@ export interface GanttStatic { * returns the 1st-level child tasks of the specified parent branch * @param id the parent branch's id */ - getChildren(id: string|number): any[]; + getChildren(id: string | number): any[]; /** * returns the closest working time @@ -2744,13 +2723,13 @@ export interface GanttStatic { * @param name the name of the column * @param excludeHidden skips indexes of the hidden columns */ - getColumnIndex(name: string|number, excludeHidden?: boolean): number; + getColumnIndex(name: string | number, excludeHidden?: boolean): number; /** * returns all tasks and links that a task is connected with * @param id optional, the id of a task */ - getConnectedGroup(id?: string|number): any; + getConnectedGroup(id?: string | number): any; /** * returns the earliest and latest dates allowed by the constraint applied to a task @@ -2780,13 +2759,13 @@ export interface GanttStatic { * gets the index of a task in the tree * @param id the task id */ - getGlobalTaskIndex(id: string|number): number; + getGlobalTaskIndex(id: string | number): number; /** * gets the configuration object of a column * @param name the column's name */ - getGridColumn(name: string|number): GridColumn; + getGridColumn(name: string | number): GridColumn; /** * gets columns of the Gantt chart @@ -2798,12 +2777,12 @@ export interface GanttStatic { * @param property the name of a data property that the control is mapped to * @param key the option's id. This parameter is compared with the task's data property to
assign the select's option to the task */ - getLabel(property: string, key: string|number): string; + getLabel(property: string, key: string | number): string; /** * returns the id of the last selected task */ - getLastSelectedTask(): string|number; + getLastSelectedTask(): string | number; /** * returns the object of the layout view by its name @@ -2820,7 +2799,7 @@ export interface GanttStatic { * returns the object of the lightbox's section * @param name the name of the section */ - getLightboxSection(name: string|number): LightboxSectionState; + getLightboxSection(name: string | number): LightboxSectionState; /** * returns the name of the active lighbox's structure @@ -2836,7 +2815,7 @@ export interface GanttStatic { * returns the dependency link object by the specified id * @param id the link id */ - getLink(id: string|number): Link; + getLink(id: string | number): Link; /** * returns the number of all dependency links presented in the Gantt chart @@ -2847,48 +2826,48 @@ export interface GanttStatic { * returns the HTML element of the specified dependency link * @param id the link id */ - getLinkNode(id: string|number): HTMLElement; + getLinkNode(id: string | number): HTMLElement; /** * returns all links presented in the Gantt chart */ - getLinks(): Array ; + getLinks(): Array; /** * gets the marker's object * @param markerId the marker's id */ - getMarker(markerId: string|number): any; + getMarker(markerId: string | number): any; /** * returns the id of the next item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getNext(id: string|number): string|number; + getNext(id: string | number): string | number; /** * returns the id of the next task of the same level * @param id the task id */ - getNextSibling(id: string|number): string|number; + getNextSibling(id: string | number): string | number; /** * returns the id of the parent task * @param id the task id */ - getParent(id: string|number): string|number; + getParent(id: string | number): string | number; /** * returns the id of the previous item (no matter what the level of nesting is: the same or different) * @param id the task id */ - getPrev(id: string|number): string|number; + getPrev(id: string | number): string | number; /** * returns the id of the previous task of the same level * @param id the task id */ - getPrevSibling(id: string|number): string|number; + getPrevSibling(id: string | number): string | number; /** * returns the stack of stored redo user actions @@ -2900,7 +2879,7 @@ export interface GanttStatic { * @param resourceId the id of the resource * @param taskId the id of the task */ - getResourceAssignments(resourceId: string|number, taskId?: string|number): ResourceAssignment[]; + getResourceAssignments(resourceId: string | number, taskId?: string | number): ResourceAssignment[]; /** * returns a calendar which the resource is assigned to @@ -2916,7 +2895,7 @@ export interface GanttStatic { /** * returns the scroll position */ - getScrollState(): {x: number, y: number}; + getScrollState(): { x: number, y: number }; /** * returns the id of the selected task @@ -2939,7 +2918,7 @@ export interface GanttStatic { * returns siblings of the specified task (including itself) * @param id the task id */ - getSiblings(id: string|number): any[]; + getSiblings(id: string | number): any[]; /** * gets the current state of the Gantt chart @@ -2950,37 +2929,37 @@ export interface GanttStatic { * calculates the combined start/end dates of tasks nested in a project or another task * @param task_id the task's id, api/gantt_root_id_config.md will be used if not specified */ - getSubtaskDates(task_id?: string|number): any; + getSubtaskDates(task_id?: string | number): any; /** * calculates the combined duration of tasks nested in a project or another task. * @param task_id the task's id, api/gantt_root_id_config.md will be used if not specified */ - getSubtaskDuration(task_id?: string|number): number; + getSubtaskDuration(task_id?: string | number): number; /** * returns the task object * @param id the task id */ - getTask(id: string|number): Task; + getTask(id: string | number): Task; /** * returns the parsed resource assignments of a specific task from the datastore * @param taskId the task id */ - getTaskAssignments(taskId: string|number): ResourceAssignment[]; + getTaskAssignments(taskId: string | number): ResourceAssignment[]; /** * returns the height (in pixels) of the DOM element of the task * @param taskId the task's id */ - getTaskBarHeight(taskId: number|string): number; + getTaskBarHeight(taskId: number | string): number; /** * returns an array of baselines of a specific task from the datastore * @param taskId the task id */ - getTaskBaselines(taskId: string|number): any; + getTaskBaselines(taskId: string | number): Baseline[]; /** * finds a task by the specified criteria @@ -2988,20 +2967,20 @@ export interface GanttStatic { * @param propertyValue the property value * @param types an object with types of the tasks which should be returned */ - getTaskBy(propertyName: string|GanttCallback, propertyValue?: string|number|boolean|any[], types?: any): Array ; + getTaskBy(propertyName: string | GanttCallback, propertyValue?: string | number | boolean | any[], types?: any): Array; /** * returns a task by its global task index * @param index the task index in the tree (zero-based numbering) */ - getTaskByIndex(index: number|string): Task; + getTaskByIndex(index: number | string): Task; /** * returns a collection of tasks which occur during the specified period * @param from the start date of the period * @param to the end date of the period */ - getTaskByTime(from?: Date, to?: Date): Array ; + getTaskByTime(from?: Date, to?: Date): Array; /** * returns a task by its WBS code @@ -3024,19 +3003,19 @@ export interface GanttStatic { * returns the visible height of a task * @param id the task's id */ - getTaskHeight(id?: string|number): number; + getTaskHeight(id?: string | number): number; /** * gets the index of a task in the branch * @param id the task id */ - getTaskIndex(id: string|number): number; + getTaskIndex(id: string | number): number; /** * returns the HTML element of the task bar * @param id the task id */ - getTaskNode(id: string|number): HTMLElement; + getTaskNode(id: string | number): HTMLElement; /** * calculates the position and size of the task's DOM element in the timeline area @@ -3050,19 +3029,19 @@ export interface GanttStatic { * returns the array of unique resources assigned to a specific task from the datastore * @param taskId the task id */ - getTaskResources(taskId: string|number): any; + getTaskResources(taskId: string | number): ResourceItem[]; /** * returns the HTML element of the task row in the table * @param id the task id */ - getTaskRowNode(id: string|number): HTMLElement; + getTaskRowNode(id: string | number): HTMLElement; /** * gets the top position of the task's DOM element in the timeline area * @param id the task's id */ - getTaskTop(id: number|string): number; + getTaskTop(id: number | string): number; /** * returns the type of a task @@ -3074,7 +3053,7 @@ export interface GanttStatic { * returns the total slack of a task * @param task optional, the object of a task or its ID */ - getTotalSlack(task?: Task|string|number): any; + getTotalSlack(task?: Task | string | number): any; /** * returns the stack of stored undo user actions @@ -3102,13 +3081,13 @@ export interface GanttStatic { * groups tasks by the specified task's attribute * @param config the grouping configuration object, or false to ungroup tasks */ - groupBy(config: GroupConfig|boolean): void; + groupBy(config: GroupConfig | boolean): void; /** * returns the number of child task(s) * @param id the task id */ - hasChild(id: string|number): number|undefined; + hasChild(id: string | number): number | undefined; /** * hides the lightbox modal overlay that blocks interactions with the remaining screen @@ -3150,14 +3129,14 @@ export interface GanttStatic { * @param from the start value of the time scale (X–Axis) * @param to the end value of the time scale (X–Axis) */ - init(container: string|HTMLElement, from?: Date, to?: Date): void; + init(container: string | HTMLElement, from?: Date, to?: Date): void; /** * checks whether a task is a child of a different task * @param childId the id of a task that you want to check as a child * @param parentId the id of a task that you want to check as a parent */ - isChildOf(childId: string|number, parentId: string|number): boolean; + isChildOf(childId: string | number, parentId: string | number): boolean; /** * checks whether the link is circular @@ -3184,25 +3163,25 @@ export interface GanttStatic { * @param to optional, the ID of the target (successor) task. Can have the *null* or *undefined* value if the target task isn't specified yet. Not needed at all when the first parameter is specified as an object * @param to_start optional, specifies if the link is being dragged to the start of the target (successor) task (*true*) or from its end (*false*). Not needed at all when the first parameter is specified as an object */ - isLinkAllowed(linkOrFrom: string|number|LinkForValidation, from_start?: boolean, to?: string|number|null|undefined, to_start?: boolean): boolean; + isLinkAllowed(linkOrFrom: string | number | LinkForValidation, from_start?: boolean, to?: string | number | null | undefined, to_start?: boolean): boolean; /** * checks whether the specified link exists * @param id the link id */ - isLinkExists(id: string|number): boolean; + isLinkExists(id: string | number): boolean; /** * checks whether the specified task/link, or the whole Gantt is read-only * @param item optional, the id or an object of the task/link. If not specified, the method checks whether the Gantt is read-only */ - isReadonly(item?: number|string|Task|Link): boolean; + isReadonly(item?: number | string | Task | Link): boolean; /** * checks whether the specified task is currently selected * @param task the task's id */ - isSelectedTask(task: string|number): boolean; + isSelectedTask(task: string | number): boolean; /** * checks whether the specified task is split @@ -3220,13 +3199,13 @@ export interface GanttStatic { * checks whether the specified task exists * @param id the task id */ - isTaskExists(id: string|number): boolean; + isTaskExists(id: string | number): boolean; /** * checks whether the specifies task is currently rendered in the Gantt chart * @param id the task's id */ - isTaskVisible(id: string|number): boolean; + isTaskVisible(id: string | number): boolean; /** * checks if the task is unscheduled @@ -3252,14 +3231,14 @@ export interface GanttStatic { * gets the id of a task from the specified HTML event * @param e a native event */ - locate(e: Event): string|number; + locate(e: Event): string | number; /** * merges several working calendars into one * @param calendars an array of calendars' objects or the first calendar object * @param calendar2 optional, the second calendar object */ - mergeCalendars(calendars: Calendar[]|Calendar, calendar2?: Calendar): void; + mergeCalendars(calendars: Calendar[] | Calendar, calendar2?: Calendar): void; /** * calls a message box of the specified type @@ -3287,20 +3266,20 @@ export interface GanttStatic { * @param tindex the index of the position that the task will be moved to
(the index within a branch) * @param parent the parent id. If specified, the tindex will refer to the index in the
'parent' branch */ - moveTask(sid: string|number, tindex: number, parent?: string|number): boolean|void; + moveTask(sid: string | number, tindex: number, parent?: string | number): boolean | void; /** * opens the branch with the specified id * @param id the branch id */ - open(id: string|number): void; + open(id: string | number): void; /** * loads data from a client-side resource * @param data a string or object which represents data * @param type optional, ('json', 'xml') the data type. The default value - 'json' */ - parse(data: string|DataToLoad1 | DataToLoad2, type?: string): void; + parse(data: string | DataToLoad1 | DataToLoad2, type?: string): void; /** * activates the specified extensions @@ -3328,20 +3307,20 @@ export interface GanttStatic { * refreshes the specifies link * @param id the link id */ - refreshLink(id: string|number): void; + refreshLink(id: string | number): void; /** * refreshes the task and its related links * @param id the task id * @param refresh_links optional, defines whether links related to the task should be refreshed, true by default */ - refreshTask(id: string|number, refresh_links?: boolean): void; + refreshTask(id: string | number, refresh_links?: boolean): void; /** * removes the specified layer related to a link * @param layerId a DOM element that will be displayed in the layer */ - removeLinkLayer(layerId: string|number): void; + removeLinkLayer(layerId: string | number): void; /** * removes a keyboard shortcut @@ -3354,7 +3333,7 @@ export interface GanttStatic { * removes the specified layer related to a task * @param layerId a DOM element that will be displayed in the layer */ - removeTaskLayer(layerId: string|number): void; + removeTaskLayer(layerId: string | number): void; /** * renders the whole Gantt chart @@ -3387,11 +3366,16 @@ export interface GanttStatic { */ resetSkin(): void; + /** + * forces the lightbox to resize + */ + resizeLightbox(): void; + /** * rounds the specified date to the nearest date in the time scale * @param date the Date object to round or an object with settings */ - roundDate(date: Date|RoundDateConfig): Date; + roundDate(date: Date | RoundDateConfig): Date; /** * rounds the start and end task's dates to the nearest dates in the time scale @@ -3405,20 +3389,20 @@ export interface GanttStatic { * @param x optional, the value of the horizontal scroll or 'null' (if the scroll position shouldn't be changed) * @param y optional, the value of the vertical scroll or 'null' (if the scroll position shouldn't be changed) */ - scrollLayoutCell(name: string, x: number|null, y: number|null): void; + scrollLayoutCell(name: string, x: number | null, y: number | null): void; /** * scrolls the Gantt container to the specified position * @param x optional, the value of the horizontal scroll or 'null' (if the scroll position shouldn't be changed) * @param y optional, the value of the vertical scroll or 'null' (if the scroll position shouldn't be changed) */ - scrollTo(x?: number|null, y?: number|null): void; + scrollTo(x?: number | null, y?: number | null): void; /** * selects the specified task * @param id the task id */ - selectTask(id: string|number): string|number; + selectTask(id: string | number): string | number; /** * serializes the data into JSON or XML format @@ -3431,14 +3415,14 @@ export interface GanttStatic { * @param list_name the name of a list * @param options an array of options */ - serverList(list_name: string|number, options?: any[]): any[]; + serverList(list_name: string | number, options?: any[]): any[]; /** * set the parent for a task * @param task the task object * @param pid the parent task id */ - setParent(task: Task, pid: number|string): void; + setParent(task: Task, pid: number | string): void; /** * resizes the Gantt chart @@ -3473,19 +3457,19 @@ export interface GanttStatic { * opens the lightbox for the specified task * @param id the task id */ - showLightbox(id: string|number): void; + showLightbox(id: string | number): void; /** * displays the pop-up task form for the specified task * @param id the task id */ - showQuickInfo(id: string|number): void; + showQuickInfo(id: string | number): void; /** * makes the specified task visible on the screen * @param id the task id */ - showTask(id: string|number): void; + showTask(id: string | number): void; /** * makes all code inside it not to trigger internal events or server-side calls @@ -3500,13 +3484,13 @@ export interface GanttStatic { * @param parent the id of the parent task. Specify the parameter if you want to sort tasks only in the branch of the specified parent. * @param silent specifies whether rendering should be invoked after reordering items */ - sort(field: string|((task1: Task, task2: Task) => 1 | 0 | -1), desc?: boolean, parent?: string|number, silent?: boolean): void; + sort(field: string | ((task1: Task, task2: Task) => 1 | 0 | -1), desc?: boolean, parent?: string | number, silent?: boolean): void; /** * selects the specified task if it was unselected and vice versa * @param taskId the task's id */ - toggleTaskSelection(taskId: string|number): void; + toggleTaskSelection(taskId: string | number): void; /** * returns a unique id @@ -3522,7 +3506,7 @@ export interface GanttStatic { * removes selection from the selected task * @param id optional, the id of the task to remove selection from, see details */ - unselectTask(id?: string|number): void; + unselectTask(id?: string | number): void; /** * unsets a working time in the Gantt Chart @@ -3535,61 +3519,60 @@ export interface GanttStatic { * @param collection the name of the collection to update * @param options the new values of the collection */ - updateCollection(collection: string|number, options: any[]): boolean; + updateCollection(collection: string | number, options: any[]): boolean; /** * updates the specified dependency link * @param id the task id */ - updateLink(id: string|number): void; + updateLink(id: string | number): void; /** * updates the specified marker * @param markerId the marker's id */ - updateMarker(markerId: string|number): void; + updateMarker(markerId: string | number): void; /** * updates the specified task * @param id the task id * @param newState optional, the new values of the task */ - updateTask(id: string|number, newState?: Task): void; + updateTask(id: string | number, newState?: Task): void; /** * updates the resource property of the task object with the values of the resource assignments from the datastore * @param taskId the task id */ - updateTaskAssignments(taskId: number|string): void; + updateTaskAssignments(taskId: number | string): void; } -export interface CustomTypeRenderers { - +export interface CustomTypeRenderers { + /** * a custom render function for the *task* type - * @param optional, a custom render function for the *task* type * @param optional, a custom render function for the *project* type * @param optional, a custom render function for the *milestone* type * @param optional, a custom render function for the custom task type */ - type_renderers: { + type_renderers: { task?: CustomTypeRenderers["typeRenderer"], project?: CustomTypeRenderers["typeRenderer"], milestone?: CustomTypeRenderers["typeRenderer"], [typeName: string]: CustomTypeRenderers["typeRenderer"] | undefined } - + /** * a function takes a task's object as a parameter and must return a DOM element that will be displayed instead of the task bar. * @param the task object * @param optional, the default render function used in the dhtmlxGantt */ - typeRenderer ( task: Task, defaultRender?: AdditionalTaskLayer["TaskLayerRender"] ): HTMLElement | boolean | void | undefined + typeRenderer(task: Task, defaultRender?: AdditionalTaskLayer["TaskLayerRender"]): HTMLElement | boolean | void | undefined } -export interface AdditionalTaskLayer { - +export interface AdditionalTaskLayer { + /** * a function takes a task's object as a parameter and must return a DOM element that will be displayed in the layer. * @param the task object @@ -3597,16 +3580,15 @@ export interface AdditionalTaskLayer { * @param the Gantt configuration object * @param the viewport object */ - TaskLayerRender ( + TaskLayerRender( task: Task, timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"] - ): HTMLElement|boolean|void - + ): HTMLElement | boolean | void + /** * the configuration object for the additional task layer. Has the following properties: - * @param optional, the layer ID * @param mandatory, a function that answers for rendering the layer's elements * @param the function that returns HTML element that should be rendered @@ -3636,7 +3618,7 @@ export interface AdditionalTaskLayer { * @param optional, a function that takes a task object as a parameter. If returns 'false', the 'renderer' function won't be called for a task * @param the task object */ - TaskLayerConfig: { + TaskLayerConfig: { id?: string | number, renderer: { render: AdditionalTaskLayer["TaskLayerRender"], @@ -3646,36 +3628,35 @@ export interface AdditionalTaskLayer { timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> void ), + ) => void), onrender?: (( task: Task, node: HTMLElement, view?: any, - )=> void ), + ) => void), getRectangle?: (( task: Task, view?: any, config?: GanttConfigOptions, gantt?: GanttStatic, - )=> { left: number, top: number, height: number, width: number } | void ), + ) => { left: number, top: number, height: number, width: number } | void), getVisibleRange: (( gantt?: GanttStatic, view?: any, config?: GanttConfigOptions, datastore?: any, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> {start: number, end: number} | undefined | void ), + ) => { start: number, end: number } | undefined | void), }, container?: HTMLElement, topmost?: boolean, filter?: (( task: Task, - )=> boolean ) + ) => boolean) } - + /** * the layer viewport object - * @param the left rectangle position * @param the right rectangle position * @param the top rectangle position @@ -3683,7 +3664,7 @@ export interface AdditionalTaskLayer { * @param the rectangle width * @param the rectangle height */ - LayerViewport: { + LayerViewport: { x: number, x_end: number, y: number, @@ -3693,8 +3674,8 @@ export interface AdditionalTaskLayer { } } -export interface AdditionalLinkLayer { - +export interface AdditionalLinkLayer { + /** * a function takes a link's object as a parameter and must return a DOM element that will be displayed in the layer. * @param the link object @@ -3702,16 +3683,15 @@ export interface AdditionalLinkLayer { * @param optional, the Gantt configuration object * @param optional, the viewport object */ - LinkLayerRender ( + LinkLayerRender( link: Link, timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"] - ): HTMLElement|boolean|void - + ): HTMLElement | boolean | void + /** * the configuration object for the additional link layer. Has the following properties: - * @param optional, the layer ID * @param mandatory, a function that answers for rendering the layer's elements * @param the function that returns HTML element that should be rendered @@ -3741,7 +3721,7 @@ export interface AdditionalLinkLayer { * @param optional, a function that takes a link object as a parameter. If returns 'false', the 'renderer' function won't be called for a link * @param the link object */ - LinkLayerConfig: { + LinkLayerConfig: { id?: string | number, renderer: { render: AdditionalLinkLayer["LinkLayerRender"], @@ -3751,36 +3731,35 @@ export interface AdditionalLinkLayer { timeline?: any, config?: GanttConfigOptions, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> void ), + ) => void), onrender?: (( link: Link, node: HTMLElement, view?: any, - )=> void ), + ) => void), getRectangle?: (( link: Link, view?: any, config?: GanttConfigOptions, gantt?: GanttStatic, - )=> { left: number, top: number, height: number, width: number } | void ), + ) => { left: number, top: number, height: number, width: number } | void), getVisibleRange: (( gantt?: GanttStatic, view?: any, config?: GanttConfigOptions, datastore?: any, viewport?: AdditionalTaskLayer["LayerViewport"], - )=> {start: number, end: number} | undefined | void ), + ) => { start: number, end: number } | undefined | void), }, container?: HTMLElement, topmost?: boolean, filter?: (( link: Link, - )=> boolean ) + ) => boolean) } - + /** * the layer viewport object - * @param the left rectangle position * @param the right rectangle position * @param the top rectangle position @@ -3788,7 +3767,7 @@ export interface AdditionalLinkLayer { * @param the rectangle width * @param the rectangle height */ - LayerViewport: { + LayerViewport: { x: number, x_end: number, y: number, @@ -3798,393 +3777,525 @@ export interface AdditionalLinkLayer { } } -export interface Task { - +export interface Task { + /** * The task id, auto-generated if not set */ id: string | number, - + /** * The date when a task is scheduled to begin. If not specified, Gantt will calculate it based on the end_date and duration properties.The property becomes optional when setting unscheduled: true. */ start_date?: Date, - + /** * The date when a task is scheduled to be completed. If not specified, Gantt will calculate it based on the start_date and duration properties.The property becomes optional when setting unscheduled: true. */ end_date?: Date, - + /** * The task duration. If not specified, Gantt will calculate it based on the start_date and end_date properties. */ duration?: number, - + /** * Defines whether gantt should do auto-scheduling of the task (true or not specified) or not (false) */ auto_scheduling?: boolean, - + /** * Sets the height of the DOM element of the task in the timeline area */ bar_height?: number, - + + /** + * An array with the baselines + */ + baselines?: Baseline[], + /** * Sets the id of the custom calendar to be assigned to the task. The name of the property depends on the value of the calendar_property option */ calendar_id?: number | string, - + /** * Sets the color of the task in the timeline area (i.e. sets background-color for the gantt_task_line element of the task) */ color?: string, - + /** * The date of the task constraint. It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled. */ constraint_date?: Date, - + /** * The type of the task constraint ("asap", "alap", "snet", "snlt", "fnet", "fnlt", "mso", "mfo"). It is added to the task object when auto-scheduling with time constraints is enabled. The property isn't used if auto_scheduling_compatibility is enabled. */ constraint_type?: string, - + /** * Specifies the deadline date for the task. A [visual indicator](desktop/inbuilt_baselines.md#deadlinesandconstraints) is displayed in the timeline when this property is set. */ - deadline?: Date | string, - + deadline?: Date, + /** * Defines whether the task can be editable in the read-only Gantt chart. The name of the property depends on the value of the editable_property option */ editable?: boolean, - + /** * The group's id. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an object. */ group_id?: string | number, - + /** * Defines whether a task (type:"task") or milestone (type:"milestone") should be hidden in the timeline area */ hide_bar?: boolean, - + /** * The key of the group. It is added to the tasks grouped by some criterion if the property used for grouping tasks (relation_property in the groupBy() method) is specified as an array.It is also added to the tasks with the name of the group (for example, to the "High", "Normal", "Low" tasks if you've grouped tasks by priority. Check the example). */ key?: string | number, - + /** * The label of the group. It is added to the tasks with the name of the group (for example, if you've grouped tasks by priority, the property will be added to the tasks with "High", "Normal", "Low" names. Check the example). */ label?: string, - + /** * Specifies whether the task branch will be opened initially (to show child tasks). To close/open the branch after Gantt initialization, use the related methods: close() and open() */ open?: boolean, - + /** * The id of the parent task. If the specified parent doesn't exist, the task won't be rendered in the Gantt. The id of the root task is specified by the api/gantt_root_id_config.md config. */ parent?: number | string, - + /** * The task's progress (from 0 to 1) */ progress?: number, - + /** * The color of the task progress in the timeline area (i.e. sets background-color for the gantt_task_progress element of the task progress) */ progressColor?: string, - + /** * Defines whether the task must be readonly. The name of the property depends on the value of the readonly_property option */ readonly?: boolean, - + /** * Defines how subtasks of the task must be displayed. Values: "split" | "". If set to "split", the subtasks will be displayed in one row. In addition, if you enable the open_split_tasks property, the subtasks will be rendered in one row only if the task is collapsed. */ render?: string, - + /** * An array with resources assigned to the task. It is added to the task object when importing data from MS Project/Primavera */ - resource?: Array , - + resource?: Array, + /** * Specifies whether a task (type:"task") or milestone (type:"milestone") should appear on the parent projects. */ rollup?: boolean, - + /** * Sets the height for the task's row */ row_height?: number, - + /** * The id of the target task. The property displays the same value as the $drop_target property. The property is added to the task object only if Data Processor is enabled, after the task is updated and data is sent to the server. */ target?: string, - + /** * The name of the task. If necessary you may use any other name for this property.The property is used in default configurations of different parts of Gantt. */ text?: any, - + /** * The color of the task's text in the timeline area (i.e. sets color for the gantt_task_line element of the task) */ textColor?: string, - + /** * the task type. The available values are stored in the api/gantt_types_config.md object: - "task" - a regular task (default value). + "task" - a regular task (default value). "project" - a task that starts, when its earliest child task starts, and ends, when its latest child ends. - The start_date, end_date, duration properties are ignored for such tasks. - + The start_date, end_date, duration properties are ignored for such tasks. "milestone" - a zero-duration task that is used to mark out important dates of the project. - The duration, progress, end_date properties are ignored for such tasks. + The duration, progress, end_date properties are ignored for such tasks. */ type?: string, - + /** * Defines whether the task must be unscheduled. By default, the unscheduled task isn't displayed in the timeline area, empty values are displayed in the grid instead of the start and end dates. */ unscheduled?: boolean, - + + /** + * A computed end date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled. + */ + $auto_end_date?: Date, + + /** + * A computed start date of the project task from its subtasks. Added and updated when "auto_scheduling" is disabled. + */ + $auto_start_date?: Date, + /** * A system property that is used in internal calculations. */ $calculate_duration?: boolean, - + /** * An object which contains custom properties of a task which were defined in the importFromMSProject() and importFromPrimaveraP6() methods */ $custom_data?: object, - + /** * A system property which defines whether the task has been updated. It is added to the task object when Data Processor is enabled. If the value of the property is "updated", the task's text will be bold in the grid but it is possible to define your own styles via CSS. */ $dataprocessor_class?: string, - + /** * The id of the target task. A temporary property which is added to the task object when dragging the task vertically. */ $drop_target?: string, - + /** * The id of the calendar (or resource calendar) assigned to the task. A system property that is used in internal calculations. */ $effective_calendar?: string, - + /** * A system property which shows whether the task is visible depending on whether the task's parents are expanded or not. If at least one parent is collapsed, the task won't be visible. The exception is only split tasks (subtasks). */ $expanded_branch?: boolean, - + /** * Defines whether the Gantt should send a request to the server to load the first-level subtasks of the task. The property is used when the branch_loading property is enabled. The name of the property depends on the value of the branch_loading_property option. */ $has_child?: boolean, - + /** * The global vertical position of the task. It is bound to the task and changes if the tasks below or above are open or closed. If the parent of the task is collapsed, the property doesn't show the actual position of the task. */ $index?: number, - + /** * The task's level in the tasks hierarchy (zero-based numbering) */ $level?: number, - + /** * The vertical position of the task in the branch (under the parent). It isn't bound to the task and doesn't change if the tasks below or above are open or closed as inside the branch as globally. If the parent of the task is collapsed, the property doesn't show the actual position of the task. */ $local_index?: number, - + /** * It is added for a new task when it is created via the createTask() method or via the "+" button. The property is added to the task object when you open the lightbox, and is removed after you save the task. */ $new?: boolean, - + /** * Required, a system property which is added to the task object. True if the end_date property couldn't be calculated (when the start_date property is loaded but there is no duration or end_date one). In this case, you cannot move or resize the task. The end_date property will depend on the end_date of the subtasks (if any). The start_date property will be fixed and won't change. Auto-scheduling won't work for such a task. If the $no_start property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task. */ $no_end?: boolean, - + /** * Required, a system property which is added to the task object. True if the start_date property couldn't be calculated (when the end_date property is loaded but there is no duration or start_date one). The start_date property will depend on the start_date of the subtasks (if any) or on the start date of the first task. The end_date property will be fixed and will change only if the start date of the subtasks/first task is bigger than the end date of the task. Auto-scheduling won't work for such a task. If the $no_end property is enabled, the task will fully depend on the dates of its subtasks or on the date of the first task. */ $no_start?: boolean, - + /** * A system property which specifies whether the task is currently opened (true). If you change the value of the property and re-draw the Gantt, it will open or close the task. To change the state of the task, you may also apply the open() or close() methods. */ $open?: boolean, - + /** * An object with original names of task properties which were imported from MS Project / Primavera into the export module (export server). The properties appear in the $raw object while the file is converted into JSON-format but before they are converted into names and format expected by Gantt. */ $raw?: object, - + /** * The id of a row the rollup item / split task is rendered at. This is the temporary property which appears in the object of the rollup/split task only when it's been rendering on the page. */ $rendered_at?: string | number, - + /** * The id of the parent under which the task is rendered (not id of the real parent of the task). The property is used in internal calculations and on tasks' grouping. */ $rendered_parent?: number | string, - + /** * The type of the rendered task (a temporary property). */ $rendered_type?: string, - + /** * An array with ids of resources assigned to the task (a temporary property). But the most actual data is stored in the store of resource assignments not in this property. */ - $resourceAssignments?: Array , - + $resourceAssignments?: Array, + /** * An array with ids of tasks and milestones which have appeared on the current task */ - $rollup?: Array , - + $rollup?: Array, + /** * Required, an array with ids of all links that come out of the task */ - $source?: Array , - + $source?: Array, + /** * Appears if the task is a subtask of a split task (i.e. arranges in one row with other subtasks) */ $split_subtask?: boolean, - + /** * Required, an array with ids of links that come into task */ - $target?: Array , - + $target?: Array, + /** * A temporary property which is added to the task object when dragging the task vertically. The task looks a little bit transparent in grid on vertical dragging due to this property. */ $transparent?: boolean, - + /** * It is added to the tasks grouped by some criterion. After the grouping is reset, tasks with $virtual: true are removed */ $virtual?: boolean, - + /** * The WBS code of the task (a temporary property). It is added to the task object after applying the getWBSCode() method. If the value of the code has changed (the task's parent or position has been changed), you need to call the getWBSCode() method again to get the updated value of the code. */ $wbs?: string, - + [customProperty: string]: any; } -export interface Link { - +export interface Link { + /** * the link id */ id: string | number, - + /** * the id of a task that the dependency will start from */ source: string | number, - + /** * the id of a task that the dependency will end with. */ target: string | number, - + /** * the dependency type. The available values are stored in the api/gantt_links_config.md object. By default, they are: - "0" - 'finish_to_start'. + "0" - 'finish_to_start'. "1" - 'start_to_start'. "2" - 'finish_to_finish'. "3" - 'start_to_finish'. */ type: string, - + /** * the task's lag */ lag?: number, - + /** * can mark link as readonly */ readonly?: boolean, - + /** * can mark link as editable */ editable?: boolean, - + [customProperty: string]: any; } -export interface GridColumn { - +export interface Baseline { + + /** + * the baseline ID + */ + id: string | number, + + /** + * the ID of the task the baseline belongs to + */ + task_id: string | number, + + /** + * the start date of the baseline + */ + start_date: Date, + + /** + * the duration of the baseline + */ + duration: number, + + /** + * the end date of the baseline + */ + end_date: Date | number, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface ResourceItem { + + /** + * the ID of the resource item + */ + id: string | number, + + /** + * indicates whether the resource item is expanded in the tree (*true*) or collapsed (*false*) + */ + open?: boolean, + + /** + * the ID of the resource item's parent + */ + parent?: string | number, + + /** + * the resource name + */ + text?: string, + + /** + * the unit for the assignments + */ + unit?: string, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface ResourceAssignment { + + /** + * the id of the assignment + */ + id: string | number, + + /** + * the ID of the task the resource is assigned to. + */ + task_id: string | number, + + /** + * the ID of the resource that is assigned to the task. + */ + resource_id: string | number, + + /** + * the quantity of the resources assigned to a task + */ + value: number | string, + + /** + * the difference between the assignment start date and the task start date + */ + delay: number, + + /** + * the date the assignment should start + */ + start_date: Date, + + /** + * the date the assignment should end + */ + end_date: Date, + + /** + * the duration of the assignment + */ + duration: number, + + /** + * the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + */ + mode: string, + + /** + * any custom property + */ + [customProperty: string]: any +} + +export interface GridColumn { + /** * sets the horizontal title alignment. Possible values: *'left'*, *'center'*, or *'right'* */ align?: string, - + /** * hides/shows a column (PRO) */ hide?: boolean, - + /** * specifies the title of the column */ label?: string | number, - + /** * sets the maximum column width in case of resize operations */ max_width?: number, - + /** * sets the minimum column width in case of resize operations */ min_width?: number, - + /** * defines the column's id. The name 'add' allows you to add a column with the '+' sign */ name?: string | number, - + /** * enables the possibility to resize a column by dragging the column's border (PRO) */ resize?: boolean, - + /** * indicates that the related column should display a tree */ tree?: boolean, - + /** * defines the width of the column */ width?: number | string, - + /** * attached inline editor - * @param the type of the inline editor * @param specifies which property of the task should be updated by the inline editor * @param minimal value for the date and duration types @@ -4192,185 +4303,184 @@ export interface GridColumn { * @param an array with the options for the select types * @param formatter for the date and predecessor types */ - editor?: { + editor?: { type: string, map_to: string, min?: Date | number, max?: Date | number, - options?: Array , + options?: Array, formatter?: DurationFormatter | LinkFormatter }, - + /** * sets a data template * @param the Task object */ - template? ( task: Task ): any, - + template?(task: Task): any, + /** * optional, a callback function for rendering a cell into the DOM. The function takes a task object and the DOM element of the grid cell as parameters and may return a component of the framework. See details here * @param the Task object * @param the HTML element of the Grid cell */ - onrender? ( task: Task, node: HTMLElement ): any, - + onrender?(task: Task, node: HTMLElement): any, + /** * the configuration of sorting after clicking on the column header. When the property is set to *false*, sorting is disabled. You can also set a different task property in the *string* to sort the column or use a custom sorting function: * @param an object of the first task that will be sorted * @param an object of the second task that will be sorted */ - sort?: boolean | string | ( (task1: Task, task2: Task, ) => any ) + sort?: boolean | string | ((task1: Task, task2: Task,) => any) } -export interface LightboxSections { - +export interface LightboxSections { + /** * optional, the lightbox sections array for regular tasks */ sections?: LightboxSection[], - + /** * optional, the lightbox sections array for project tasks */ project_sections?: LightboxSection[], - + /** * optional, the lightbox sections array for milestones */ milestone_sections?: LightboxSection[], - + /** * the lightbox sections array for the custom type */ [lightboxType: string]: LightboxSection[] | undefined } -export interface LightboxSection { - +export interface LightboxSection { + /** * the section's name (according to this name, dhtmlxGantt will take the section's label from the *locale.labels* collection). */ name: string, - + /** * the name of a data property that will be mapped to the section. */ map_to: string, - + /** * the [type of the section control](desktop/default_edit_form.md#lightboxcontrols) (editor). */ type: string, - + /** * optional, the section's height. Not used with the [checkbox](desktop/checkbox.md) and [radio](desktop/radio.md) sections. */ height?: number, - + /** * optional, if set to *true*, the section will take focus on opening the lightbox */ focus?: boolean, - + /** * optional, a formatter for the section */ formatter?: DurationFormatter | LinkFormatter, - + /** * optional, if you set the "true" value, the section will be read-only */ readonly?: boolean, - + /** * optional, sets a range for the year selector. Can be set in 2 ways: */ year_range?: number | number[], - + /** * optional, if you set the "true" value, just the 'start Date' selector will be presented in the section. */ single_date?: boolean, - + /** * optional, sets the order of date-time selectors */ time_format?: string[], - + /** * optional, defines whether the end date will be corrected automatically if the selected start date is greater than the end date, *true* by default. The disabled mode allows validating the dates, but if you enable the mode and don't validate the dates, you can get tasks with 0 duration when the *start_date* is greater than the *end_date*. */ autofix_end?: boolean, - + /** * optional, defines select options of the control.Each object in the array specifies a single option and takes the following properties: - * @param the option's id. This attribute is compared with the task's data property to assign select options to tasks * @param the option's label * @param optional, the unit of measurement of the resource (for the Resources control) */ - options?: { + options?: { key: number | string, label: string, unit?: string | number }[], - + /** * optional, the default value of the section's control. Applied only if the input value is underfined. For the resources control is applied if the value of the resource is underfined. */ default_value?: any, - + /** * optional, if set to "true", the options list will contain an additional option that will allow users to set the root level as the parent for tasks. Used in pair with the **root_label** property */ allow_root?: boolean, - + /** * optional, sets a label for the root-level parent. Used in pair with the **allow_root** property */ root_label?: string, - + /** * optional, specifies the 'onChange' event handler function for the section's control * @param a native event object. */ - onchange? ( e: Event ): any, - + onchange?(e: Event): any, + /** * optional, sets a sorting function for the select options * @param an object of the first task that will be sorted * @param an object of the second task that will be sorted */ - sort? ( task1: Task, task2: Task ): number, - + sort?(task1: Task, task2: Task): number, + /** * optional, sets a filtering function for the select options. Takes the task id and task object as parameters * @param the ID of the task object * @param the Task object */ - filter? ( id: string | number, task: Task ): boolean, - + filter?(id: string | number, task: Task): boolean, + /** * optional, sets a template for select options * @param the start date of the task object * @param the end date of the task object * @param the Task object */ - template? ( + template?( start_date: Date | number, end_date: Date | number, task: Task - ): string|number + ): string | number } -export interface LightboxControl { - +export interface LightboxControl { + /** * a function that returns a string with the HTML elements of the section * @param the section's configuration object */ - render ( sns: LightboxSection ): string, - + render(sns: LightboxSection): string, + /** * a function that obtains the value from the **Task** object and sets it to the section * @param an html object related to the html defined above @@ -4378,37 +4488,36 @@ export interface LightboxControl { * @param the task object * @param the section's configuration object */ - set_value ( + set_value( node: HTMLElement, value: any, task: Task, section: LightboxSection ): any, - + /** * a function that obtains the value from the section and saves it to the **Task** object * @param an html object related to the html defined above * @param the task object * @param the section's configuration object */ - get_value ( + get_value( node: HTMLElement, task: Task, section: LightboxSection ): any, - + /** * a function to set focus to the section * @param an html object related to the html defined above */ - focus ( node: HTMLElement ): void + focus(node: HTMLElement): void } -export interface LightboxSectionState { - +export interface LightboxSectionState { + /** * the configuration object of the section - * @param the section id * @param the section name. According to the name, the gantt takes the label for the section from the **locale.labels** collection. For example, for the 'description' section, the label will be taken as **gantt.locale.labels.section_description** * @param the section height @@ -4416,7 +4525,7 @@ export interface LightboxSectionState { * @param the editor type * @param if set to *true*, the related field will take the focus on opening the lightbox */ - section: { + section: { id: string, name: string, height: number, @@ -4424,779 +4533,764 @@ export interface LightboxSectionState { type: string, focus: boolean }, - + /** * a div with the section body */ node: HTMLElement, - + /** * a div with the section header */ header: HTMLElement, - + /** * a collection of controls used in the section */ control: HTMLCollection, - + /** * returns an object with the section's data */ - getValue ( ): any, - + getValue(): any, + /** * sets the value(s) for the section. As a parameter the method takes a value (or an object with values if the section has several controls) that should be set * @param a value for the section * @param optional, an object with any properties */ - setValue ( value: any, valueObject?: CustomObject ): any + setValue(value: any, valueObject?: CustomObject): any } -export interface DataToLoad1 { - - /** - * the array with the task data - */ - data: [] | NewTask[] - tasks?: undefined +export interface MarkerConfig { + /** - * the array with the link data + * the marker id */ - links?: Link[] - + id?: string | number, + /** - * the array with the resource data + * a Date object that sets the marker's start date */ - resources?: NewResourceItem[] - + start_date: Date, + /** - * the array with the assignment data + * a Date object that sets the marker's end date */ - assignments?: NewAssignmentItem[] - + end_date?: Date, + /** - * the object that has the arrays with the custom data + * a CSS class applied to the marker */ - collections?: Сollections -} + css?: string, -export interface DataToLoad2 { - /** - * the array with the task data + * the marker title */ - tasks: [] | NewTask[] - data?: undefined + text?: string | number, + /** - * the array with the link data + * the marker's tooltip */ - links?: Link[] - + title?: string | number +} + +export interface HandlerSettings { + /** - * the array with the resource data + * the id of the event handler. */ - resources?: NewResourceItem[] - + id?: string | number, + /** - * the array with the assignment data + * defines whether the event will be executed only once. */ - assignments?: NewAssignmentItem[] - + once?: boolean, + /** - * the object that has the arrays with the custom data + * specifies the `this` object for the listener. */ - collections?: Сollections -} - -/** - * the task object that will be added to Gantt. It can have the following properties: - - * @param optional, the task ID, auto-generated if not set. - * @param optional, the date when a task is scheduled to begin. - * @param optional, the task duration. - * @param optional, the date when a task is scheduled to be completed. - * @param optional, the task name. - * @param optional, specifies if the task will be opened on load (to show child tasks). - * @param optional, the ID of the parent task. - * @param optional, the date of the task constraint. - * @param any other property you want to add, including the ones from the [**Task** object](desktop/task_properties.md) -*/ -export type NewTask = string | {} | { - id?: string | number, - start_date?: string | Date, - duration?: number, - end_date?: string | Date, - text?: string, - open?: boolean, - parent?: string | number, - constraint_date?: string | Date, - [customProperty: string]: any + thisObject?: any } - -/** - * the resource item object that will be added to Gantt. It can have the following properties: +export interface GanttUIState { - * @param optional, the resource ID, auto-generated if not set - * @param optional, the ID of the parent resource - * @param optional, the resource name - * @param optional, specifies if the resource will be opened on load (to show child items) - * @param optional, the unit of the resource assignment - * @param optional, the value that is assigned by default when adding the assignment in the lightbox section - * @param any other property you want to add -*/ -export type NewResourceItem = { - id?: string | number, - parent?: string | number, - text?: string, - open?: boolean, - unit?: string | number, - default_value?: string | number, - [customProperty: string]: any -} + /** + * reveals if Gantt is auto-scrolled (*true*). Added only when the + */ + autoscroll: boolean, - -/** - * the assignment item object that will be added to Gantt. It can have the following properties: + /** + * the update mode. *true* if the method is called inside the [*batchUpdate*](api/gantt_batchupdate.md) method. + */ + batch_update: boolean, - * @param optional, the assignment ID, auto-generated if not set - * @param the ID of the task the resource is assigned to - * @param the ID of the resource that is assigned to the task - * @param optional, the assignment value - * @param optional, the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" - * @param optional, the difference between the assignment start date and the task start date - * @param optional, the date the assignment should start - * @param optional, the assignment duration - * @param optional, the date the assignment should end - * @param any other property you want to add -*/ -export type NewAssignmentItem = { - id?: string | number, - task_id: string | number, - resource_id: string | number, - value: number | string, - mode?: string, - delay?: number, - start_date?: string | Date, - duration?: number, - end_date?: string | Date, - [customProperty: string]: any -} + /** + * the resizing mode of a task. *true* means the task is resized from the start, *false* means that the task is resized from the end. When the task is not resized, it is *null*. + */ + drag_from_start: boolean | null, + /** + * the id of a task that the user is currently dragging in the Gantt chart. *undefined* or *null*, if no tasks are being dragged in the Gantt chart. + */ + drag_id: string | null | undefined, -export interface Сollections { - /** - * an array that contains the collection items. + * the drag mode. Has these values: 'move','resize','progress', 'ignore' when a task is dragged. Otherwise, has *null* or *undefined* value. */ - [collectionName: string]: [] | СollectionItem[] -} + drag_mode: string | null | undefined, -export interface СollectionItem { - /** - * any custom property of the collection item. + * the flag for the fullscreen mode. *true*, if the Gantt chart is in the fullscreen mode, *false* otherwise. */ - [itemProperty: string]: any -} + fullscreen: boolean, -export interface ScaleArray extends Array { - 0: ScaleObj -} + /** + * the id of a task that is currently opened in the lightbox. *undefined* or *null*, if no tasks are opened in the lightbox. + */ + lightbox: string | null | undefined, -export type Scales = ScaleArray; + /** + * the new link creation state, returns *true* when the link is created from the start of the predecessor task. + */ + link_from_start: boolean | null, -export interface Scale { - /** - * the name of the scale unit. The available values are: "minute", "hour", "day" (default), "week", "quarter", "month", "year". + * the new link creation state, returns *true* if the mouse points to the link drag element (bubble). */ - unit: string, - + link_landing_area: boolean, + /** - * the step of the time scale (X-Axis), 1 by default. + * the new link creation state. the id of the source (predecessor) task. */ - step?: number, - + link_source_id: string | number | null, + /** - * a function that returns the name of a CSS class that will be applied to the scale units. Takes a date object as a parameter. - * @param a date that will be checked + * the new link creation state. the id of the target (successor) task. */ - css? ( date: Date ): any, - + link_target_id: string | number | null, + /** - * the format of the scale's labels. If set as a function, expects a date object as a parameter. - * @param a date that will be converted + * the new link creation state, returns *true* when the link is created to the start of the successor task. */ - format?: string | ( (date: Date, ) => any ), - + link_to_start: boolean, + /** - * the format of the scale's labels. If set as a function, expects a date object as a parameter. - * @param a date that will be converted + * the date that tasks are displayed in the chart from */ - date?: string | ( (date: Date, ) => any ) -} + min_date: Date, -export interface MessagePopupConfig { - /** - * optional, the ID of the popup message + * the date that tasks are displayed in the chart till */ - id?: number | string - + max_date: Date, + /** - * the content of the popup message + * the unit of the background grid of the timeline */ - text: number | string - + scale_unit: string, + /** - * optional, the class name of the popup message + * the step of the background grid of the timeline */ - type?: string - + scale_step: number, + /** - * optional, the time period until the popup message disappears. -1 means, it won't hide by itself + * the id of the currently selected task. *undefined* or *null*, if no tasks are selected in the Gantt chart. */ - expire?: number + selected_task: string | null | undefined } -export interface MessagePopupObject { +export interface RoundDateConfig { /** - * calls a message box of the specified type - */ - (config: string | number | MessagePopupConfig): string | number | HTMLElement - - /** - * the position of the popup message. Possible values are: "top", "bottom", "left", "right" + * the Date object to round; */ - position: string - + date: Date, + /** - * specifies if Gantt should block keyboard events. *true* by default. + * the time unit ("minute", "hour", "day", "week", "month", "year"); */ - keyboard: boolean - + unit?: string, + /** - * a function that hides the popup message. Uses **id** as a parameter: - * @param the ID of the popup message + * the step of the time scale (X-Axis), 1 by default. */ - hide ( id: number | string ): any + step?: number } -export interface AlertBoxConfig { - +export interface LinkForValidation { + /** - * optional, the ID of the alert box + * the ID of the source (predecessor) task. */ - id?: number | string - + source: string | number, + /** - * the text of the alert box's body + * the ID of the target (successor) task. */ - text: number | string - + target: string | number, + /** - * optional, the text of the header + * the link type. */ - title?: number | string - + type: string +} + +export interface GroupConfig { + /** - * optional, the text of the "OK" button + * a property of a task object that will be used to group items. */ - ok?: number | string - + relation_property: string, + /** - * optional, the position of the alert box for now supports only one value - "top", any other value will result in "center-align" + * an array of the groups (summary) items. Each item should have the properties set in the **group_id** and **group_text** parameters (by default, *key* and *label*). */ - position?: string - + groups: СollectionItem[], + /** - * optional, the width of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * optional, the group's id. The default value is 'key'. */ - width?: string - + group_id?: string, + /** - * optional, the height of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * optional, the group's label. The default value is 'label'. */ - height?: string - + group_text?: string, + /** - * optional, the function called on button click. Takes *true* as a parameter (subject to the clicked button) - * @param result of the clicked button, always returns **true** (because there is only the "OK" button) + * optional, the delimiter is used for automatic creation of groups for tasks with multiple resources. The default value is ",". */ - callback? ( result: boolean ): void -} + delimiter?: string, -export interface ConfirmBoxConfig { - /** - * optional, the ID of the confirm box + * optional, the name of the default group. Optional. The default value is 'None'. */ - id?: number | string - + default_group_label?: string, + /** - * the text of the confirm box's body + * optional, defines whether the gantt should save its tree structure inside groups. If not specified or set to *false*, gantt tasks will be displayed in a flat list view. */ - text: number | string - + save_tree_structure?: boolean +} + +export interface AutoSchedulingConfig { + /** - * optional, the text of the header + * turns auto-scheduling on or off (same as using a boolean value directly). */ - title?: number | string - + enabled: boolean, + /** - * optional, the text of the "OK" button + * controls the display of task constraints on the Gantt chart. */ - ok?: number | string - + show_constraints?: boolean +} + +export interface BaselineConfig { + /** - * optional, the text of the "Cancel" button + * the name of the datastore used for storing baseline entries. For related functionality, */ - cancel?: number | string - + datastore: string, + /** - * optional, the position of the confirm box for now supports only one value - "top", any other value will result in "center-align" + * determines how baselines are displayed: */ - position?: string - + render_mode: boolean | string, + /** - * optional, the width of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * specifies whether baseline updates trigger the DataProcessor as individual entries. */ - width?: string - + dataprocessor_baselines: boolean, + /** - * optional, the height of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * defines the height of the subrow for baselines, applicable only when `render_mode` */ - height?: string - + row_height: number, + /** - * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) - * @param result of the clicked button: **true** for "OK", **false** for "Cancel". + * sets the height of the baseline bar. */ - callback? ( result: boolean ): void + bar_height: number } -export interface ModalBoxConfig { - - /** - * optional, the ID of the modal box - */ - id?: number | string - +export interface DataToLoad1 { + /** - * the text of the modal box's body + * the array with the task data */ - text: number | string - + data: [] | NewTask[] + tasks?: undefined /** - * optional, the text of the header + * the array with the link data */ - title?: number | string - + links?: Link[] + /** - * the array of buttons + * the array with the resource data */ - buttons: string[] | number[] | ModalboxButton[] - + resources?: NewResourceItem[] + /** - * optional, the position of the modal box for now supports only one value - "top", any other value will result in "center-align" + * the array with the assignment data */ - position?: string - + assignments?: NewAssignmentItem[] + /** - * optional, the width of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * the object that has the arrays with the custom data */ - width?: string - + collections?: Сollections +} + +export interface DataToLoad2 { + /** - * optional, the height of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or + * the array with the task data */ - height?: string - + tasks: [] | NewTask[] + data?: undefined /** - * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) - * @param The result of the callback function will be equal to the stringified index of a pressed button from the array ("0", "1", "2",...) + * the array with the link data */ - callback? ( result: string | number | boolean ): void -} + links?: Link[] -export interface ModalboxButton { - /** - * the text of the button + * the array with the resource data */ - label: string | number - + resources?: NewResourceItem[] + /** - * optional, the value that is returned in the *result* argument of the *callback* function. + * the array with the assignment data */ - value?: string | number | boolean - + assignments?: NewAssignmentItem[] + /** - * optional, a custom class name for the button, prefixed with the "gantt_" string. + * the object that has the arrays with the custom data */ - css?: string | number + collections?: Сollections } -export type WorkDayConfig = string | number | boolean | Array +/** + * the task object that will be added to Gantt. It can have the following properties: + * @param optional, the task ID, auto-generated if not set. + * @param optional, the date when a task is scheduled to begin. + * @param optional, the task duration. + * @param optional, the date when a task is scheduled to be completed. + * @param optional, the task name. + * @param optional, specifies if the task will be opened on load (to show child tasks). + * @param optional, the ID of the parent task. + * @param optional, the date of the task constraint. + * @param any other property you want to add, including the ones from the [**Task** object](desktop/task_properties.md) +*/ +export type NewTask = string | {} | { + id?: string | number, + start_date?: string | Date, + duration?: number, + end_date?: string | Date, + text?: string, + open?: boolean, + parent?: string | number, + constraint_date?: string | Date, + [customProperty: string]: any +} -export type WorkDaysTuple = [WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, ] -export interface CalendarConfig { - - /** - * optional, the calendar id - */ +/** + * the resource item object that will be added to Gantt. It can have the following properties: + * @param optional, the resource ID, auto-generated if not set + * @param optional, the ID of the parent resource + * @param optional, the resource name + * @param optional, specifies if the resource will be opened on load (to show child items) + * @param optional, the unit of the resource assignment + * @param optional, the value that is assigned by default when adding the assignment in the lightbox section + * @param any other property you want to add +*/ +export type NewResourceItem = { id?: string | number, - - /** - * an object that sets the worktime in days and hours. It can include: - - * @param optional, an array with global working hours, sets the start and end hours of the task - * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day - * @param optional, an object with different working-time rules for different periods of time. The object can contain a set of key:value pairs where key is the name of a time span and value is an object with a list of attributes. - * @param the time span with the working time settings. The name of that object is used as the name of the time span - * @param the date when the time span is scheduled to begin - * @param the date when the time span is scheduled to be completed - * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) - * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. - */ - worktime?: { - hours?: string[] | number[] | boolean, - days?: WorkDaysTuple, - customWeeks?: { - [timespan: string]: { - from: Date, - to: Date, - hours?: Array, - days?: WorkDaysTuple | boolean, - }, - } - } + parent?: string | number, + text?: string, + open?: boolean, + unit?: string | number, + default_value?: string | number, + [customProperty: string]: any } -export interface MarkerConfig { - - /** - * the marker id - */ + +/** + * the assignment item object that will be added to Gantt. It can have the following properties: + * @param optional, the assignment ID, auto-generated if not set + * @param the ID of the task the resource is assigned to + * @param the ID of the resource that is assigned to the task + * @param optional, the assignment value + * @param optional, the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + * @param optional, the difference between the assignment start date and the task start date + * @param optional, the date the assignment should start + * @param optional, the assignment duration + * @param optional, the date the assignment should end + * @param any other property you want to add +*/ +export type NewAssignmentItem = { id?: string | number, - + task_id: string | number, + resource_id: string | number, + value: number | string, + mode?: string, + delay?: number, + start_date?: string | Date, + duration?: number, + end_date?: string | Date, + [customProperty: string]: any +} + + +export interface Сollections { + /** - * a Date object that sets the marker's start date + * an array that contains the collection items. */ - start_date: Date, - + [collectionName: string]: [] | СollectionItem[] +} + +export interface СollectionItem { + /** - * a Date object that sets the marker's end date + * any custom property of the collection item. */ - end_date?: Date, - + [itemProperty: string]: any +} + +export interface ScaleArray extends Array { + 0: ScaleObj +} + +export type Scales = ScaleArray; + +export interface Scale { + /** - * a CSS class applied to the marker + * the name of the scale unit. The available values are: "minute", "hour", "day" (default), "week", "quarter", "month", "year". */ - css?: string, - + unit: string, + /** - * the marker title + * the step of the time scale (X-Axis), 1 by default. */ - text?: string | number, - + step?: number, + /** - * the marker's tooltip + * makes the scale label visible if the scale cell is larger than the viewport width */ - title?: string | number -} + sticky?: boolean, -export interface HandlerSettings { - /** - * the id of the event handler. + * a function that returns the name of a CSS class that will be applied to the scale units. Takes a date object as a parameter. + * @param a date that will be checked */ - id?: string | number, - + css?(date: Date): any, + /** - * defines whether the event will be executed only once. + * the format of the scale's labels. If set as a function, expects a date object as a parameter. + * @param a date that will be converted */ - once?: boolean, - + format?: string | ((date: Date,) => any), + /** - * specifies the `this` object for the listener. + * the format of the scale's labels. If set as a function, expects a date object as a parameter. + * @param a date that will be converted */ - thisObject?: any + date?: string | ((date: Date,) => any) } -export interface GanttUIState { - - /** - * reveals if Gantt is auto-scrolled (*true*). Added only when the - */ - autoscroll: boolean, - +export interface MessagePopupConfig { + /** - * the update mode. *true* if the method is called inside the [*batchUpdate*](api/gantt_batchupdate.md) method. + * optional, the ID of the popup message */ - batch_update: boolean, - + id?: number | string + /** - * the resizing mode of a task. *true* means the task is resized from the start, *false* means that the task is resized from the end. When the task is not resized, it is *null*. + * the content of the popup message */ - drag_from_start: boolean | null, - + text: number | string + /** - * the id of a task that the user is currently dragging in the Gantt chart. *undefined* or *null*, if no tasks are being dragged in the Gantt chart. + * optional, the class name of the popup message */ - drag_id: string | null | undefined, - + type?: string + /** - * the drag mode. Has these values: 'move','resize','progress', 'ignore' when a task is dragged. Otherwise, has *null* or *undefined* value. + * optional, the time period until the popup message disappears. -1 means, it won't hide by itself */ - drag_mode: string | null | undefined, - + expire?: number +} + +export interface MessagePopupObject { + /** - * the flag for the fullscreen mode. *true*, if the Gantt chart is in the fullscreen mode, *false* otherwise. + * calls a message box of the specified type */ - fullscreen: boolean, - + (config: string | number | MessagePopupConfig): string | number | HTMLElement + /** - * the id of a task that is currently opened in the lightbox. *undefined* or *null*, if no tasks are opened in the lightbox. + * the position of the popup message. Possible values are: "top", "bottom", "left", "right" */ - lightbox: string | null | undefined, - + position: string + /** - * the new link creation state, returns *true* when the link is created from the start of the predecessor task. + * specifies if Gantt should block keyboard events. *true* by default. */ - link_from_start: boolean | null, - + keyboard: boolean + /** - * the new link creation state, returns *true* if the mouse points to the link drag element (bubble). + * a function that hides the popup message. Uses **id** as a parameter: + * @param the ID of the popup message */ - link_landing_area: boolean, - + hide(id: number | string): any +} + +export interface AlertBoxConfig { + /** - * the new link creation state. the id of the source (predecessor) task. + * optional, the ID of the alert box */ - link_source_id: string | number | null, - + id?: number | string + /** - * the new link creation state. the id of the target (successor) task. + * the text of the alert box's body */ - link_target_id: string | number | null, - + text: number | string + /** - * the new link creation state, returns *true* when the link is created to the start of the successor task. + * optional, the text of the header */ - link_to_start: boolean, - + title?: number | string + /** - * the date that tasks are displayed in the chart from + * optional, the text of the "OK" button */ - min_date: Date, - + ok?: number | string + /** - * the date that tasks are displayed in the chart till + * optional, the position of the alert box for now supports only one value - "top", any other value will result in "center-align" */ - max_date: Date, - + position?: string + /** - * the unit of the background grid of the timeline + * optional, the width of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - scale_unit: string, - + width?: string + /** - * the step of the background grid of the timeline + * optional, the height of the alert box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - scale_step: number, - + height?: string + /** - * the id of the currently selected task. *undefined* or *null*, if no tasks are selected in the Gantt chart. + * optional, the function called on button click. Takes *true* as a parameter (subject to the clicked button) + * @param result of the clicked button, always returns **true** (because there is only the "OK" button) */ - selected_task: string | null | undefined + callback?(result: boolean): void } -export interface RoundDateConfig { - - /** - * the Date object to round; - */ - date: Date, - +export interface ConfirmBoxConfig { + /** - * the time unit ("minute", "hour", "day", "week", "month", "year"); + * optional, the ID of the confirm box */ - unit?: string, - + id?: number | string + /** - * the step of the time scale (X-Axis), 1 by default. + * the text of the confirm box's body */ - step?: number -} + text: number | string -export interface LinkForValidation { - /** - * the ID of the source (predecessor) task. + * optional, the text of the header */ - source: string | number, - + title?: number | string + /** - * the ID of the target (successor) task. + * optional, the text of the "OK" button */ - target: string | number, - + ok?: number | string + /** - * the link type. + * optional, the text of the "Cancel" button */ - type: string -} + cancel?: number | string -export interface GroupConfig { - /** - * a property of a task object that will be used to group items. + * optional, the position of the confirm box for now supports only one value - "top", any other value will result in "center-align" */ - relation_property: string, - + position?: string + /** - * an array of the groups (summary) items. Each item should have the properties set in the **group_id** and **group_text** parameters (by default, *key* and *label*). + * optional, the width of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - groups: СollectionItem[], - + width?: string + /** - * optional, the group's id. The default value is 'key'. + * optional, the height of the confirm box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - group_id?: string, - + height?: string + /** - * optional, the group's label. The default value is 'label'. + * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) + * @param result of the clicked button: **true** for "OK", **false** for "Cancel". */ - group_text?: string, - + callback?(result: boolean): void +} + +export interface ModalBoxConfig { + /** - * optional, the delimiter is used for automatic creation of groups for tasks with multiple resources. The default value is ",". + * optional, the ID of the modal box */ - delimiter?: string, - + id?: number | string + /** - * optional, the name of the default group. Optional. The default value is 'None'. + * the text of the modal box's body */ - default_group_label?: string, - + text: number | string + /** - * optional, defines whether the gantt should save its tree structure inside groups. If not specified or set to *false*, gantt tasks will be displayed in a flat list view. + * optional, the text of the header */ - save_tree_structure?: boolean -} - -/** - * an object that stores the commands of the Undo or Redo action - - * @param an array that stores the changes (commands) of the Undo or Redo action. -*/ -export type UndoRedoAction = { commands: UndoRedoCommand[] } - - -/** - * an object that stores the initial and updated state of the **Task** or **Link** objects: - - * @param the type of a command: "add/remove/update" - * @param the type of the object which was changed: "task" or "link" - * @param the changed task/link object - * @param the task/link object before changes -*/ -export type UndoRedoCommand = { - type: string, - entity: string, - value: Task | Link, - oldValue: Task | Link -} - + title?: number | string -export interface ResourceAssignment { - /** - * the id of the assignment + * the array of buttons */ - id: string | number, - + buttons: string[] | number[] | ModalboxButton[] + /** - * the ID of the task the resource is assigned to. + * optional, the position of the modal box for now supports only one value - "top", any other value will result in "center-align" */ - task_id: string | number, - + position?: string + /** - * the ID of the resource that is assigned to the task. + * optional, the width of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - resource_id: string | number, - + width?: string + /** - * the quantity of the resources assigned to a task + * optional, the height of the modal box (set as CSS [](https://developer.mozilla.org/en-US/docs/Web/CSS/length) or */ - value: number | string, - + height?: string + /** - * the difference between the assignment start date and the task start date + * optional, the function called on button click. Takes *true* or *false* as a parameter (subject to the clicked button) + * @param The result of the callback function will be equal to the stringified index of a pressed button from the array ("0", "1", "2",...) */ - delay: number, - + callback?(result: string | number | boolean): void +} + +export interface ModalboxButton { + /** - * the date the assignment should start + * the text of the button */ - start_date: Date, - + label: string | number + /** - * the date the assignment should end + * optional, the value that is returned in the *result* argument of the *callback* function. */ - end_date: Date, - + value?: string | number | boolean + /** - * the duration of the assignment + * optional, a custom class name for the button, prefixed with the "gantt_" string. */ - duration: number, - + css?: string | number +} + +export type WorkDayConfig = string | number | boolean | Array + +export type WorkDaysTuple = [WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig, WorkDayConfig,] + +export interface CalendarConfig { + /** - * the calculation mode of the time of the resource assignment: "default"|"fixedDates"|"fixedDuration" + * optional, the calendar id */ - mode: string, - + id?: string | number, + /** - * any custom property + * an object that sets the worktime in days and hours. It can include: + * @param optional, an array with global working hours, sets the start and end hours of the task + * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day + * @param optional, an object with different working-time rules for different periods of time. The object can contain a set of key:value pairs where key is the name of a time span and value is an object with a list of attributes. + * @param the time span with the working time settings. The name of that object is used as the name of the time span + * @param the date when the time span is scheduled to begin + * @param the date when the time span is scheduled to be completed + * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) + * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. */ - [customProperty: string]: any + worktime?: { + hours?: string[] | number[] | boolean, + days?: WorkDaysTuple, + customWeeks?: { + [timespan: string]: { + from: Date, + to: Date, + hours?: Array, + days?: WorkDaysTuple | boolean, + }, + } + } } - + /** - * object specifying one of the predefined modes of sending the data + * an object that stores the commands of the Undo or Redo action + * @param an array that stores the changes (commands) of the Undo or Redo action. +*/ +export type UndoRedoAction = { commands: UndoRedoCommand[] } + + +/** + * an object that stores the initial and updated state of the **Task** or **Link** objects: + * @param the type of a command: "add/remove/update" + * @param the type of the object which was changed: "task" or "link" + * @param the changed task/link object + * @param the task/link object before changes +*/ +export type UndoRedoCommand = { + type: string, + entity: string, + value: Task | Link, + oldValue: Task | Link +} + +/** + * object specifying one of the predefined modes of sending the data * @param the URL to the server side * @param optional, the mode of sending data to the server: "JSON" | "REST-JSON" | "JSON" | "POST" | "GET" * @param optional, defines whether the task must be deleted from the gantt only after a successful response from the server. Dependency links and subtasks will be deleted after the deletion of the parent task is confirmed. */ -export type DataProcessorConfig = { +export type DataProcessorConfig = { url: string, mode?: string, deleteAfterConfirmation?: boolean } - + /** * the router configuration for different entities - * @param the router object for tasks * @param the router object for links * @param the router object for resources * @param the router object for assignments */ -export type RouterConfig = { +export type RouterConfig = { task?: RouterForEntity, link?: RouterForEntity, resource?: RouterForEntity, assignment?: RouterForEntity } - + /** * the router function to process changes in Gantt * @param the name of the relevant entity. Possible values are: "task"|"link"|"resource"|"assignment" @@ -5212,173 +5306,173 @@ export type RouterFunction = ( ) => Promise -export interface RouterForEntity { - +export interface RouterForEntity { + /** * a function to process adding of items * @param the processed item */ - create ( data: Task | Link | ResourceAssignment | CustomObject ): Promise - + create(data: Task | Link | ResourceAssignment | CustomObject): Promise + /** * a function to process updating of items * @param the processed item * @param the id of a processed item */ - update ( data: Task | Link | ResourceAssignment | CustomObject, id: string | number ): Promise - + update(data: Task | Link | ResourceAssignment | CustomObject, id: string | number): Promise + /** * a function to process deleting of items * @param the id of a processed item */ - delete ( id: string | number ): Promise + delete(id: string | number): Promise } -export interface CustomObject { +export interface CustomObject { /* * @param Any custom property with any type */ [propertyName: string]: any } -export interface DateHelpers { - +export interface DateHelpers { + /** * adds/subtracts the specified time interval to/from the date * @param the date object that you need to add a time to/subtract a time from * @param the number of units to add. If this number is positive - the time will be added to the date, if negative - the time will be subtracted * @param the time unit. Values: 'minute', 'hour', 'day', 'week', 'month', 'year'. */ - add (date: Date, number: number, unit: string): Date, - + add(date: Date, number: number, unit: string): Date, + /** * adds/subtracts the specified number of quarters to/from the date * @param the date object that you need to add quarters to/subtract quarters from * @param the number of quarters */ - add_quarter (date: Date, number: number): Date, - + add_quarter(date: Date, number: number): Date, + /** * converts local time to UTC * @param the date object to convert */ - convert_to_utc (date: Date): Date, - + convert_to_utc(date: Date): Date, + /** * makes a copy of a Date object * @param the date object to copy */ - copy (date: Date): Date, - + copy(date: Date): Date, + /** * resets the time part of the provided date to 00:00:00 * @param the date object to format */ - date_part (date: Date): Date, - + date_part(date: Date): Date, + /** * returns a function that converts a Date object to a string of the specified format * @param the date format * @param specifies whether local time should be converted to UTC */ - date_to_str (format: string, utc?: boolean): Function, - + date_to_str(format: string, utc?: boolean): Function, + /** * resets the time part of the provided date to 00:00:00. Alias of the date_part method. Used by the Day view to set the display date and can be redefined to provide the default behaviour * @param the date object to format */ - day_start (date: Date): Date, - + day_start(date: Date): Date, + /** * returns the ISO-8601 week number of the date, weeks starts on Monday * @param the date object to format */ - getISOWeek (date: Date): number, - + getISOWeek(date: Date): number, + /** * returns the week number of the date, but previously converts local time to UTC * @param the date object to format */ - getUTCISOWeek (date: Date): number, - + getUTCISOWeek(date: Date): number, + /** * returns the week number of the date. Weeks start either on Monday or Sunday, depending on the value of the api/gantt_start_on_monday_config.md property. * @param the date object to format */ - getWeek (date: Date): number, - + getWeek(date: Date): number, + /** * returns a Date object of the first day of the month for the specified date and clears the time part to zero * @param the date object to format */ - month_start (date: Date): Date, - + month_start(date: Date): Date, + /** * converts a string of the specified format to a Date object * @param a date as a string * @param the date format */ - parseDate (date: string, format: string): Date, - + parseDate(date: string, format: string): Date, + /** * returns a function that converts a string of the specified format to a Date object * @param the date format * @param specifies whether local time should be converted to UTC */ - str_to_date (format: string, utc?: boolean): Function, - + str_to_date(format: string, utc?: boolean): Function, + /** * returns the time of a Date object as a number of seconds counted from the midnight (00:00:00) * @param the date object to format */ - time_part (date: Date): number, - + time_part(date: Date): number, + /** * adds the leading zero to numbers less than 10 and returns the result as a string. Doesn't affect numbers from 10 * @param the number to format */ - to_fixed (num: number): string, - + to_fixed(num: number): string, + /** * returns a Date object of the specified date and clears the part with seconds to zero * @param the date object to format */ - minute_start (date: Date): Date, - + minute_start(date: Date): Date, + /** * returns a Date object of the specified date and clears the part with minutes and seconds to zero * @param the date object to format */ - hour_start (date: Date): Date, - + hour_start(date: Date): Date, + /** * returns a Date object of the first day of the week for the specified date and clears the time part to zero * @param the date object to format */ - week_start (date: Date): Date, - + week_start(date: Date): Date, + /** * returns a Date object of the first month of the quarter for the specified date and clears the time part to zero * @param the date object to format */ - quarter_start (date: Date): Date, - + quarter_start(date: Date): Date, + /** * returns a Date object of the first day of the year for the specified date and clears the time part to zero * @param the date object to format */ - year_start (date: Date): Date + year_start(date: Date): Date [customTemplate: string]: any; } -export interface Calendar { - +export interface Calendar { + /** * the id of a task's calendar */ id: string | number, - + /** * sets the working time for the Gantt chart * @param the [configuration object](api/gantt_setworktime.md#configurationobjectproperties) of a time span: @@ -5392,7 +5486,7 @@ export interface Calendar { * @param optional, an array of working hours as 'from'-'to' pairs.'false' value sets a day-off, 'true' (default value) applies the default hours (["8:00-17:00"]) * @param optional, an array of 7 days of the week (from 0 - Sunday, to 6 - Saturday), where 1/true stands for a working day and 0/false - a non-working day. */ - setWorkTime ( + setWorkTime( config: { day?: string | number, date?: Date, @@ -5407,7 +5501,7 @@ export interface Calendar { }, } ): boolean, - + /** * unsets a working time in the Gantt Chart * @param the [configuration object](api/gantt_unsetworktime.md#configurationobjectproperties) of a time span: @@ -5415,14 +5509,14 @@ export interface Calendar { * @param optional, a specific date to set as a working day or day off * @param optional, an array of working hours as 'from'-'to' pairs. */ - unsetWorkTime ( + unsetWorkTime( config: { day?: string | number, date?: Date, hours?: string[] | number[] | boolean, } ): void, - + /** * checks whether the specified date is working * @param either a date to check or the [configuration object](api/gantt_isworktime.md#configurationobjectproperties) of a time span: @@ -5431,7 +5525,7 @@ export interface Calendar { * @param optional, the object of the task the duration of which should be calculated * @param optional, a time unit: "minute", "hour", "day", "week", "month", "year". Not needed at all when the first parameter is specified as an object */ - isWorkTime ( + isWorkTime( config: Date | { date: Date, unit?: string, @@ -5439,7 +5533,7 @@ export interface Calendar { }, time_unit?: string ): boolean, - + /** * returns the closest working time * @param the [configuration object](api/gantt_getclosestworktime.md#configurationobjectproperties): @@ -5448,7 +5542,7 @@ export interface Calendar { * @param optional, a time unit to search for the closest working time * @param optional, the object of the task to use its calendar */ - getClosestWorkTime ( + getClosestWorkTime( config: Date | { date: Date, dir?: string, @@ -5456,7 +5550,7 @@ export interface Calendar { task?: Task, } ): Date, - + /** * calculates the end date of a task * @param either the date when a task is scheduled to begin or the [configuration object](api/gantt_calculateenddate.md#configurationobjectproperties) of a time span: @@ -5467,7 +5561,7 @@ export interface Calendar { * @param optional, the duration of a task. Not needed at all when the first parameter is specified as an object * @param optional, the time unit of the duration. Not needed at all when the first parameter is specified as an object */ - calculateEndDate ( + calculateEndDate( config: Date | { start_date: Date, duration: number, @@ -5477,7 +5571,7 @@ export interface Calendar { duration?: number, unit?: string ): Date, - + /** * calculates the duration of a task * @param either the date when a task is scheduled to begin or the [configuration object](api/gantt_calculateduration.md#configurationobjectproperties) of a time span: @@ -5486,7 +5580,7 @@ export interface Calendar { * @param optional, the object of the task the duration of which should be calculated * @param the date when a task is scheduled to be completed. Not needed at all when the first parameter is specified as an object */ - calculateDuration ( + calculateDuration( config: Date | { start_date: Date, end_date: Date, @@ -5498,172 +5592,172 @@ export interface Calendar { [customMethod: string]: any; } -export interface DomHelpers { - +export interface DomHelpers { + /** * returns position of the element on the screen in the format of `{x:number, y:number,width:number, height:number}` object * @param DOM element that will be checked */ - getNodePosition ( node: HTMLElement ): object, - + getNodePosition(node: HTMLElement): object, + /** * returns mouse coordinates relatively to the DOM element in the format of `{x:number, y:number}` object * @param event that occured * @param DOM element that will be checked */ - getRelativeEventPosition ( e: Event, node: HTMLElement ): object, - + getRelativeEventPosition(e: Event, node: HTMLElement): object, + /** * returns `true` if the node provided as the first argument is DOM child of the node provided as the second argument * @param child node that will be checked * @param parent node that will be checked */ - isChildOf ( child: HTMLElement, parent: HTMLElement ): boolean, - + isChildOf(child: HTMLElement, parent: HTMLElement): boolean, + /** * returns `true` if the class list of the provided `node` contains a specified css class * @param DOM element that will be checked * @param class name that will be checked */ - hasClass ( node: HTMLElement, className: string ): boolean, - + hasClass(node: HTMLElement, className: string): boolean, + /** * returns the first node that matches the provided css selector, starting from the `node` attribute, up to its DOM parents' branch. * @param DOM element will be checked * @param a class name for the target node */ - closest ( node: HTMLElement, cssSelector: string ): HTMLElement + closest(node: HTMLElement, cssSelector: string): HTMLElement [customMethod: string]: any; } -export interface DatastoreConfig { - +export interface DatastoreConfig { + /** * an arbitrary string name of the datastore. The datastore can be accessed by its name using api/gantt_getdatastore.md. */ name: string, - + /** * optional, accepts only one fixed value **"treeDatastore"**. If the type:"treeDatastore" is specified, the datastore will support hierarchical data, with the **id** property as a primary key, and **parent** as a link to the parent id. Any other value will produce a flat list datastore. */ type?: string, - + /** * optional, enables showing all tasks assigned to a certain resource in the resource view panel. This functionality works both for the resource diagram and resource histogram types of layout. */ fetchTasks?: boolean, - + /** * optional, preprocesses items loaded into the datastore. It is a good place to set the default values of the datastore items. The function takes the following parameter: * @param the resource item. */ - initItem? ( item: any ): any + initItem?(item: any): any } -export interface DatastoreMethods { - +export interface DatastoreMethods { + /** * loads data from an array * @param the data to load */ - parse ( data: Array ): void, - + parse(data: Array): void, + /** * returns the item by its id * @param the id of the item */ - getItem ( id: string | number ): object | void, - + getItem(id: string | number): object | void, + /** * updates the specified item * @param the id of the item * @param an object the item */ - updateItem ( id: string | number, item?: object ): void, - + updateItem(id: string | number, item?: object): void, + /** * deletes the specified item * @param the id of the item */ - removeItem ( id: string | number ): void, - + removeItem(id: string | number): void, + /** * checks whether the specified item is visible or hidden via filters * @param the id of the item */ - isVisible ( id: string | number ): boolean, - + isVisible(id: string | number): boolean, + /** * returns the array of visible items */ - getVisibleItems (): Array, - + getVisibleItems(): Array, + /** * adds a new item to the datastore * @param the item object * @param the position the task will be added into (0 or greater) */ - addItem ( item: object, index?: number ): number | string, - + addItem(item: object, index?: number): number | string, + /** * changes the id of the item * @param the current item's id * @param the new item's id */ - changeId ( oldId: string | number, newId: string | number ): void, - + changeId(oldId: string | number, newId: string | number): void, + /** * checks whether the specified item exists in the datastore * @param the item's id */ - exists ( id: string | number ): boolean, - + exists(id: string | number): boolean, + /** * moves an item to a new position * @param the index of the current position of the task * @param the index of the position that the item will be moved to */ - move ( sindex: number, tindex: number ): void, - + move(sindex: number, tindex: number): void, + /** * clears the datastore */ - clearAll (): void, - + clearAll(): void, + /** * execute the code without firing API events of the datastore * @param the callback function */ - silent ( callback: Function ): void, - + silent(callback: Function): void, + /** * fires repainting of events of the specified record, runs filters * @param optional, the id of the record */ - refresh ( id?: string | number ): void, - + refresh(id?: string | number): void, + /** * returns the number of items that are currently loaded into the datastore */ - count (): number, - + count(): number, + /** * returns the number of items that are currently visible */ - countVisible (): number, - + countVisible(): number, + /** * iterates over all tasks of the datastore * @param the callback function */ - eachItem ( callback: Function ): void, - + eachItem(callback: Function): void, + /** * runs the filters and updates visible array of items */ - filter (): void, - + filter(): void, + /** * sorts items in the resource grid * @param the name of the column that the resource grid will be sorted by or a custom sorting function @@ -5671,188 +5765,188 @@ export interface DatastoreMethods { * @param the id of the parent item. Specify the parameter if you want to sort items only in the branch of the specified parent. * @param specifies whether rendering should be invoked after reordering items */ - sort ( field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean ): void, - + sort(field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean): void, + /** * returns records between the specified indexes * @param the position of the start record * @param the position of the end record */ - getIndexRange ( from: number, to: number ): Array, - + getIndexRange(from: number, to: number): Array, + /** * returns all records of the datastore */ - getItems (): Array, - + getItems(): Array, + /** * returns the id of the item by its index. Returns `undefined` if there is no item at the specified index. * @param the position of the item */ - getIdByIndex ( index: number ): string | number | void, - + getIdByIndex(index: number): string | number | void, + /** * returns the index of the item by its id. Returns `-1` if no such item exists in the datastore. * @param the id of the item */ - getIndexById ( id: string | number ): number, - + getIndexById(id: string | number): number, + /** * returns the id of the first item of the datastore */ - getFirst (): string | number | null, - + getFirst(): string | number | null, + /** * returns the id of the last item of the datastore */ - getLast (): string | number | null, - + getLast(): string | number | null, + /** * returns the id of the next item of the datastore * @param the item's id */ - getNext ( id: string | number ): string | number | null, - + getNext(id: string | number): string | number | null, + /** * returns the id of the previous item of the datastore * @param the item's id */ - getPrev ( id: string | number ): string | number | null, - + getPrev(id: string | number): string | number | null, + /** * clears the datastore and removes all attached event handlers. The datastore is not usable after this method is called. */ - destructor (): void, - + destructor(): void, + /** * attaches the handler to an inner event of DataStore * @param the event's name, case-insensitive * @param the handler function * @param optional, an object with settings for the event handler */ - attachEvent (event: T, handler: TreeDatastoreEvents[T], settings?: object): boolean, - + attachEvent(event: T, handler: TreeDatastoreEvents[T], settings?: object): boolean, + /** * calls an inner event * @param the event's name, case-insensitive * @param an array of the event-related data */ - callEvent ( name: string, params: Array ): boolean, - + callEvent(name: string, params: Array): boolean, + /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param the event's id */ - detachEvent ( id: string ): void + detachEvent(id: string): void } -export interface DatastoreEvents { - +export interface DatastoreEvents { + /** * fires when an item is being loaded from the data source * @param the object of an item */ - "onItemLoading": ( item: any ) => any, - + "onItemLoading": (item: any) => any, + /** * fires before data started to be parsed * @param the array with the data that was loaded */ - "onBeforeParse": ( data: Array ) => any, - + "onBeforeParse": (data: Array) => any, + /** * fires after data were parsed (became available for API) but before they were rendered in the Gantt chart * @param the array with the data that was loaded */ - "onParse": ( data: Array ) => any, - + "onParse": (data: Array) => any, + /** * fires before an item is updated * @param the id of an item * @param the new (updated) object of the item */ - "onBeforeUpdate": ( id: string | number, item: any ) => any, - + "onBeforeUpdate": (id: string | number, item: any) => any, + /** * fires after an item is updated * @param the id of an item * @param the object of the item */ - "onAfterUpdate": ( id: string | number, item: any ) => any, - + "onAfterUpdate": (id: string | number, item: any) => any, + /** * fires before an item is deleted * @param the id of an item * @param the object of the item */ - "onBeforeDelete": ( id: string | number, item: any ) => any, - + "onBeforeDelete": (id: string | number, item: any) => any, + /** * fires after an item is deleted * @param the id of an item * @param the object of the item */ - "onAfterDelete": ( id: string | number, item: any ) => any, - + "onAfterDelete": (id: string | number, item: any) => any, + /** * fires before a new item is added to the datastore * @param the id of an item * @param the object of the item */ - "onBeforeAdd": ( id: string | number, item: any ) => any, - + "onBeforeAdd": (id: string | number, item: any) => any, + /** * fires after an item is added to the datastore * @param the id of an item * @param the object of the item */ - "onAfterAdd": ( id: string | number, item: any ) => any, - + "onAfterAdd": (id: string | number, item: any) => any, + /** * fires when the id of an item is changed * @param the id of an item * @param the new id of the item */ - "onIdChange": ( id: string | number, newId: string | number ) => any, - + "onIdChange": (id: string | number, newId: string | number) => any, + /** * fires after all items were removed from the datastore */ "onClearAll": () => any, - + /** * fires before the datastore is refreshed * @param the id of an item or null * @param the item object or null * @param the action type ("paint", "move", "add", "delete", null) */ - "onBeforeStoreUpdate": ( id: string | number | null, item: any | null, action: string | null ) => any, - + "onBeforeStoreUpdate": (id: string | number | null, item: any | null, action: string | null) => any, + /** * fires after the datastore has been refreshed * @param the id of an item or null * @param the item object or null * @param the action type ("paint", "move", "add", "delete", null) */ - "onStoreUpdated": ( id: string | number | null, item: any | null, action: string | null ) => any, - + "onStoreUpdated": (id: string | number | null, item: any | null, action: string | null) => any, + /** * fires before filtering is applied */ "onBeforeFilter": () => any, - + /** * fires after the datastore has update the filtering state */ "onFilter": () => any, - + /** * fires for each item during the filtering stage, returning `false` will mark item as not visible * @param the id of an item * @param the item object */ - "onFilterItem": ( id: string | number, item: any ) => any, - + "onFilterItem": (id: string | number, item: any) => any, + /** * fires after the destructor() method of the datastore is called */ @@ -5862,7 +5956,7 @@ export interface DatastoreEvents { } export interface TreeDatastoreMethods extends DatastoreMethods { - + /** * moves an item to the new position or to a new parent * @param the id of the item to move @@ -5870,96 +5964,96 @@ export interface TreeDatastoreMethods extends DatastoreMethods { * @param the parent id. If specified, the tindex will refer to the index in the 'parent' branch */ - move ( sid: string | number, tindex: number, parent?: string | number ): boolean | void, - + move(sid: string | number, tindex: number, parent?: string | number): boolean | void, + /** * returns the index of an item in the branch * @param the id of the item */ - getBranchIndex ( id: string | number ): number, - + getBranchIndex(id: string | number): number, + /** * checks whether the specified item has child items * @param the id of the item */ - hasChild ( id: string | number ): number | void, - + hasChild(id: string | number): number | void, + /** * returns the 1st-level child items of the specified parent branch * @param the id of the parent branch */ - getChildren ( id: string | number ): Array, - + getChildren(id: string | number): Array, + /** * checks whether an item is a child of a different item * @param the id of an item that you want to check as a child * @param the id of an item that you want to check as a parent */ - isChildOf ( childId: string | number, parentId: string | number ): boolean, - + isChildOf(childId: string | number, parentId: string | number): boolean, + /** * returns siblings of the specified item (including itself) * @param the id of the item */ - getSiblings ( id: string | number ): Array, - + getSiblings(id: string | number): Array, + /** * returns the id of the next item of the same level * @param the id of the item */ - getNextSibling ( id: string | number ): number | string | null, - + getNextSibling(id: string | number): number | string | null, + /** * returns the id of the previous item of the same level * @param the id of the item */ - getPrevSibling ( id: string | number ): number | string | null, - + getPrevSibling(id: string | number): number | string | null, + /** * returns the id of the parent item or 0. * @param the id of the item */ - getParent ( id: string | number ): number| string, - + getParent(id: string | number): number | string, + /** * calculates the level of nesting of an item * @param the item's object */ - calculateItemLevel ( item: object ): number, - + calculateItemLevel(item: object): number, + /** * sets the parent for an item. The parent id will be writen to the property specified by `parentProperty` config, "item.parent" by default. * @param the item's object * @param the id of the parent */ - setParent ( item: object, newParentId: string | number | null ): void, - + setParent(item: object, newParentId: string | number | null): void, + /** * iterates over all children of a specific item * @param the callback function * @param the id of the parent */ - eachItem ( callback: Function, parentId?: string | number ): void, - + eachItem(callback: Function, parentId?: string | number): void, + /** * iterates over all parent items of the specified item * @param the callback function * @param the id of the item the parent item of which should be iterated over */ - eachParent ( callback: Function, startItem: string | number ): void, - + eachParent(callback: Function, startItem: string | number): void, + /** * opens the branch with the specified id * @param the branch id */ - open ( id: string | number ): void, - + open(id: string | number): void, + /** * closes the branch with the specified id * @param the branch id */ - close ( id: string | number ): void, - + close(id: string | number): void, + /** * sorts items in the resource grid * @param the name of the column that the resource grid will be sorted by or a custom sorting function @@ -5967,42 +6061,42 @@ export interface TreeDatastoreMethods extends DatastoreMethods { * @param the id of the parent item. Specify the parameter if you want to sort items only in the branch of the specified parent. * @param specifies whether rendering should be invoked after reordering items */ - sort ( field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean ): void + sort(field: string | Function, desc?: boolean, parent?: string | number, silent?: boolean): void } export interface TreeDatastoreEvents extends DatastoreEvents { - + /** * fires before an item is moved to a new position * @param the id of the item to move * @param the parent id * @param the index of the position in the parent branch that the item will be moved to */ - "onBeforeItemMove": ( id: string | number, parent: string | number, tindex: number ) => any, - + "onBeforeItemMove": (id: string | number, parent: string | number, tindex: number) => any, + /** * fires after an item was moved to a new position * @param the id of the item to move * @param the parent id * @param the index of the position in the parent branch that the item will be moved to */ - "onAfterItemMove": ( id: string | number, parent: string | number, tindex: number ) => any, - + "onAfterItemMove": (id: string | number, parent: string | number, tindex: number) => any, + /** * fires on opening a branch * @param the id of the branch */ - "onItemOpen": ( id: string | number ) => any, - + "onItemOpen": (id: string | number) => any, + /** * fires on closing a branch * @param the id of the branch */ - "onItemClose": ( id: string | number ) => any + "onItemClose": (id: string | number) => any } -export interface InlineEditor { - +export interface InlineEditor { + /** * the function is called when you open the inline editor. Here, you can add a container for the DOM elements and initialize the third * @param task ID @@ -6010,18 +6104,18 @@ export interface InlineEditor { * @param the configuration object of the custom inline editor * @param the DOM element of the inline editor */ - show ( + show( id: string | number, column: GridColumn, config: any, placeholder: HTMLElement ): void, - + /** * optional, the function is called when hiding the inline editor */ - hide? ( ): void, - + hide?(): void, + /** * the function is called after the **show** function. There, you need to set the values to the inline editor elements from the **task** object. The parameters are: * @param the value of the task property @@ -6029,25 +6123,25 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - set_value ( + set_value( value: any, id: string | number, column: GridColumn, node: HTMLElement ): void, - + /** * the function is called before hiding the inline editor. You need to obtain the values from the inline editor and add it to the **task** object. The parameters are: * @param task ID * @param the column configuration object * @param the DOM element of the inline editor */ - get_value ( + get_value( id: string | number, column: GridColumn, node: HTMLElement ): any, - + /** * optional, the function is called before hiding the inline editor. If you return **true** the changes will be saved, otherwise, they will be cancelled. The parameters are: * @param the value of the task property @@ -6055,13 +6149,13 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - is_changed? ( + is_changed?( value: any, id: string | number, column: GridColumn, node: HTMLElement ): boolean, - + /** * optional, the function where you can add validation. If you return **false**, the changes will be cancelled. The parameters are: * @param the value of the task property @@ -6069,149 +6163,149 @@ export interface InlineEditor { * @param the column configuration object * @param the DOM element of the inline editor */ - is_valid? ( + is_valid?( value: any, id: string | number, column: GridColumn, node: HTMLElement ): boolean, - + /** * optional, the function for a complex save behavior, when the editor has the `map_to:auto` property. The parameters are: * @param task ID * @param the column configuration object * @param the Task object */ - save? ( + save?( id: string | number, column: GridColumn, node: HTMLElement ): void, - + /** * optional, this function is called when the inline editor receives focus. * @param the DOM element of the inline editor */ - focus? ( node: HTMLElement ): void + focus?(node: HTMLElement): void [customMethod: string]: any; } -export interface InlineEditorMethods { - +export interface InlineEditorMethods { + /** * opens an editor in the specified task/cell, sets the mapped value and puts browser focus on the editor * @param the task ID * @param the column name */ - startEdit ( taskId: number | string, columnName: string ): void, - + startEdit(taskId: number | string, columnName: string): void, + /** * opens an empty editor in specified task/cell * @param the task ID * @param the column name */ - show ( taskId: number | string, columnName: string ): void, - + show(taskId: number | string, columnName: string): void, + /** * populates an opened editor with values from the task */ - setValue ( ): void, - + setValue(): void, + /** * saves changes and hides an editor */ - save ( ): void, - + save(): void, + /** * hides an editor without saving changes */ - hide ( ): void, - + hide(): void, + /** * puts browser focus on the editor */ - focus ( ): void, - + focus(): void, + /** * gets the state object {id: taskId, columnName: columnName, placeholder: HTMLElement} */ - getState ( ): object, - + getState(): object, + /** * gets the current value of the editor */ - getValue ( ): string, - + getValue(): string, + /** * checks whether the current value of the editor differs from the initial value */ - isChanged ( ): boolean, - + isChanged(): boolean, + /** * checks whether the editor is opened */ - isVisible ( ): boolean, - + isVisible(): boolean, + /** * attaches an event handler to inlineEditors object * @param the name of the event handler * @param the function that will be called when the event fires */ - attachEvent (event: T, handler: InlineEditorEvents[T]): string, - + attachEvent(event: T, handler: InlineEditorEvents[T]): string, + /** * detaches a handler from an event (which was attached before by the attachEvent() method) * @param the id of the attached event handler */ - detachEvent ( id: string ): void, - + detachEvent(id: string): void, + /** * saves the current editor and moves editor to the next cell * @param the parameter specifies whether it can move the editor to the first cell of the next row after the last cell of the current one */ - editNextCell ( canChangeRow?: boolean ): void, - + editNextCell(canChangeRow?: boolean): void, + /** * saves the current editor and opens an editor in the same cell of the task below * @param the parameter specifies whether it can skip the read-only task and open an editor in the cell of the first editable task. The default *false* state of the parameter closes the editor if the next task is read-only. */ - editNextRow ( skipReadonly?: boolean ): void, - + editNextRow(skipReadonly?: boolean): void, + /** * saves the current editor and moves editor to the previous cell * @param the parameter specifies whether it can move editor to the last cell of the row above after reaching the first cell of the current row */ - editPrevCell ( canChangeRow?: boolean ): void, - + editPrevCell(canChangeRow?: boolean): void, + /** * saves the current editor and opens an editor in the same cell of the task above * @param the parameter specifies whether it can skip the read-only task and open an editor in the cell of the first editable task. The default *false* state of the parameter closes the editor if the previous task is read-only. */ - editPrevRow ( skipReadonly?: boolean ): void, - + editPrevRow(skipReadonly?: boolean): void, + /** * gets the name of the first editable column in the grid */ - getFirstCell ( ): string, - + getFirstCell(): string, + /** * gets the name of the last editable column in the grid */ - getLastCell ( ): string, - + getLastCell(): string, + /** * returns the name of the next editable column * @param the parameter specifies in which direction it should iterate the following cell. `1` - right, `-1` - left. */ - getNextCell ( direction: number ): string | null, - + getNextCell(direction: number): string | null, + /** * checks whether a provided DOM element is a task cell object and returns an editor state object, if it is so: {id: taskId, columnName: columnName} * @param the HTML element */ - locateCell ( node: HTMLElement ): object | null, - + locateCell(node: HTMLElement): object | null, + /** * sets a mapping object * @param an object with the mapping configuration: @@ -6228,61 +6322,61 @@ export interface InlineEditorMethods { * @param the Grid layout view * @param the method to destroy mapping */ - setMapping ( + setMapping( mapping: { init: (( inlineEditors: InlineEditorMethods, grid: any, - )=> void ), + ) => void), onShow: (( inlineEditors: InlineEditorMethods, node: HTMLElement, grid: any, - )=> void ), + ) => void), onHide: (( inlineEditors: InlineEditorMethods, node: HTMLElement, grid: any, - )=> void ), - destroy: (()=> void ), + ) => void), + destroy: (() => void), } ): void, - + /** * returns a currently applied mapping object */ - getMapping ( ): object + getMapping(): object [customMethod: string]: any; } -export interface InlineEditorEvents { - - "onBeforeEditStart": ( state: { +export interface InlineEditorEvents { + + "onBeforeEditStart": (state: { id: number | string, columnName: string, }) => any, - - "onEditStart": ( state: { + + "onEditStart": (state: { id: number | string, columnName: string, }) => any, - - "onBeforeSave": ( state: { + + "onBeforeSave": (state: { id: number | string, columnName: string, oldValue: any, newValue: any, }) => any, - - "onSave": ( state: { + + "onSave": (state: { id: number | string, columnName: string, oldValue: any, newValue: any, }) => any, - - "onEditEnd": ( state: { + + "onEditEnd": (state: { id: number | string, columnName: string, }) => any @@ -6290,33 +6384,33 @@ export interface InlineEditorEvents { [customEvent: string]: any; } -export interface Fullscreen { - +export interface Fullscreen { + /** * expands gantt to the full screen mode */ - expand ( ): void, - + expand(): void, + /** * collapses gantt from the fullscreen mode to the normal mode */ - collapse ( ): void, - + collapse(): void, + /** * calls the **collapse()** method if gantt is expanded to full screen, and the **expand()** method otherwise */ - toggle ( ): void, - + toggle(): void, + /** * returns a DOM element that will be expanded to full screen by the **expand()** method. */ - getFullscreenElement ( ): HTMLElement + getFullscreenElement(): HTMLElement [customMethod: string]: any; } -export interface KeyNav { - +export interface KeyNav { + /** * allows selecting any cell in the grid. Works only if the Grid already has the focus * @param the config object @@ -6324,54 +6418,54 @@ export interface KeyNav { * @param the column name * @param type of the scope. Possible values: "gantt", "taskRow", "taskCell", "headerCell" */ - focus ( + focus( config: { id: number | string, column: string, type: string, } ): void, - + /** * allows obtaining information about the active cell */ - getActiveNode ( ): boolean | void + getActiveNode(): boolean | void [customMethod: string]: any; } -export interface QuickInfo { - +export interface QuickInfo { + /** * displays the quick info popup for a specified element * @param the task ID */ - show ( id: number | string ): void, - + show(id: number | string): void, + /** * displays the quick info popup at specific coordinates * @param horizontal coordinate * @param vertical coordinate */ - show ( x: number | string, y: number | string ): void, - + show(x: number | string, y: number | string): void, + /** * hides the quick info popup. When **gantt.config.quick_info_detached** is set to *false*, the quick info will not disappear immediately, but after a short animation. Providing *true* value as an argument will cancel the animation and will remove the popup immediately. * @param defines whether the quick info popup will be hidden immediately without animation */ - hide ( force?: boolean ): HTMLElement, - + hide(force?: boolean): HTMLElement, + /** * sets a container where the quick info will be displayed. If no custom container specified, QuickInfo will be placed into the first of the found nodes: **gantt.$task, gantt.$grid, gantt.$root** * @param container element or its ID */ - setContainer ( container: HTMLElement | string ): void, - + setContainer(container: HTMLElement | string): void, + /** * returns the HTMLElement of the quick info popup. Returns *null* if the quick info is not initialized */ - getNode ( ): HTMLElement | null, - + getNode(): HTMLElement | null, + /** * puts the content into the quick info * @param optional, the configuration object of a quick info which can include the following attributes: @@ -6382,7 +6476,7 @@ export interface QuickInfo { * @param optional, the content of the pop-up edit form * @param optional, buttons to be placed in the pop-up edit form */ - setContent ( + setContent( config?: { taskId?: string | number, header?: { @@ -6397,90 +6491,92 @@ export interface QuickInfo { [customMethod: string]: any; } -export interface Undo { - +export interface Undo { + /** * reverts the changes made in the gantt */ - undo ( ): void, - + undo(): void, + /** * applies the reverted changes to the gantt once again */ - redo ( ): void, - + redo(): void, + /** * returns the stack of stored undo user actions */ - getUndoStack ( ): UndoRedoAction[], - + getUndoStack(): UndoRedoAction[], + /** * returns the stack of stored redo user actions */ - getRedoStack ( ): UndoRedoAction[], - + getRedoStack(): UndoRedoAction[], + /** * sets the stack of stored undo user actions + * @param the undo stack */ - setUndoStack ( ): UndoRedoAction[] , - + setUndoStack(stack: UndoRedoAction[]): void, + /** * sets the stack of stored redo user actions + * @param the redo stack */ - setRedoStack ( ): UndoRedoAction[] , - + setRedoStack(stack: UndoRedoAction[]): void, + /** * clears the stack of stored undo commands */ - clearUndoStack ( ): void, - + clearUndoStack(): void, + /** * clears the stack of stored redo commands */ - clearRedoStack ( ): void, - + clearRedoStack(): void, + /** * saves the current state of a task/link before the changes are made * @param the id of a task/link, * @param the type of an entry for which the id is provided as the first argument. */ - saveState ( id: string | number, type: string ): boolean + saveState(id: string | number, type: string): boolean [customMethod: string]: any; } -export interface ClickDrag { - +export interface ClickDrag { + /** * sets a custom CSS class for a selected element */ className?: string, - + /** * the element to attach an event to and select */ viewPort?: HTMLElement, - + /** * defines whether requestAnimationFrame is used during rendering */ useRequestAnimationFrame?: boolean, - + /** * true to add selection only in one row equal to the height of a task */ singleRow?: boolean, - + /** * CSS selector. Drag-n-drop won't be activated for the elements that match the selector */ ignore?: string, - + /** * if the property is specified, drag-n-drop will be activated only when the specified modifier key is pressed. Supported values: "ctrlKey", "shiftKey", "metaKey", "altKey" */ useKey?: string | boolean, - + /** * a function that will be called when the mouse button is released. Takes 6 parameters: * @param an object with the following attributes: @@ -6502,7 +6598,7 @@ export interface ClickDrag { * @param an array of tasks between the start and end date points * @param an array of tasks selected between the start and end coordinates vertically */ - callback? ( + callback?( startPoint?: { absolute: { left: number, @@ -6528,7 +6624,7 @@ export interface ClickDrag { tasksBetweenDates?: Array, tasksInRows?: Array ): any, - + /** * a function that creates an element rendered during dragging. Takes two parameters: * @param an object with the attributes: @@ -6546,7 +6642,7 @@ export interface ClickDrag { * @param the left coordinate * @param the top coordinate */ - render? ( + render?( startPoint?: { absolute: { left: number, @@ -6572,89 +6668,89 @@ export interface ClickDrag { [customMethod: string]: any; } -export interface Overlay { - +export interface Overlay { + /** * adds a new overlay into the Gantt Chart and returns its id * @param the render function. Takes a container with custom content as a parameter * @param the overlay container * @param optional, the ID of the overlay */ - addOverlay ( + addOverlay( render: (( container: HTMLElement, - )=> HTMLElement ), + ) => HTMLElement), id?: number | string ): string | number, - + /** * removes an overlay by its id * @param the ID of the overlay */ - deleteOverlay ( id: number | string ): boolean, - + deleteOverlay(id: number | string): boolean, + /** * returns an array with ids of overlays added into the chart */ - getOverlaysIds ( ): Array, - + getOverlaysIds(): Array, + /** * repaints the specified overlay. * @param the ID of the overlay */ - refreshOverlay ( id: number | string ): void, - + refreshOverlay(id: number | string): void, + /** * shows an overlay by its id. * @param the ID of the overlay */ - showOverlay ( id: number | string ): void, - + showOverlay(id: number | string): void, + /** * hides an overlay by its id * @param the ID of the overlay */ - hideOverlay ( id: number | string ): void, - + hideOverlay(id: number | string): void, + /** * checks visibility of the specified overlay. Returns *true* if the overlay is visible. * @param the ID of the overlay */ - isOverlayVisible ( id: number | string ): boolean + isOverlayVisible(id: number | string): boolean [customMethod: string]: any; } -export interface ZoomLevel { - +export interface ZoomLevel { + /** * the name of the level */ name: string - + /** * the height of the scale */ scale_height?: number - + /** * the height of the scale */ height?: number - + /** * the minimal width of a column. It has a higher priority than minColumnWidth and maxColumnWidth */ min_column_width?: number - + /** * an array of scales to switch between while zooming in/out on this level */ scales: Scales } -export interface ZoomMethods { - +export interface ZoomMethods { + /** * initializes the extension with the provided configuration. * @param an object with configuration settings that contains the *levels* array of zooming levels and a number of additional properties: @@ -6671,12 +6767,12 @@ export interface ZoomMethods { * @param the trigger of zooming: "wheel" | null | undefined * @param a DOM element over which zooming is triggered or a function that returns a DOM element */ - init ( + init( zoomConfig: { levels: ZoomLevel[], handler?: (( e: Event, - )=> void ), + ) => void), startDate?: Date, endDate?: Date, activeLevelIndex?: number, @@ -6685,112 +6781,112 @@ export interface ZoomMethods { maxColumnWidth?: number, useKey?: string, trigger?: string | null | undefined, - element?: HTMLElement | (()=> HTMLElement ), + element?: HTMLElement | (() => HTMLElement), } ): void, - + /** * returns the number (index) of the current zooming level */ - getCurrentLevel ( ): number, - + getCurrentLevel(): number, + /** * switches to the specified zooming level. * @param The level is defined either by a string (the name of the level from the config, e.g. "year"), or by its number in the array of levels */ - setLevel ( level: number | string ): void, - + setLevel(level: number | string): void, + /** * allows getting all zooming levels */ - getLevels ( ): any[], - + getLevels(): ZoomLevel[], + /** * increases the current zooming level */ - zoomIn ( ): void, - + zoomIn(): void, + /** * decreases the current zooming level */ - zoomOut ( ): void, - + zoomOut(): void, + /** * attaches an event handler * @param the name of the event handler * @param the function that will be called when the event fires */ - attachEvent (event: T, handler: ZoomEvents[T]): string, - + attachEvent(event: T, handler: ZoomEvents[T]): string, + /** * detaches a handler from an event * @param the id of the attached event handler */ - detachEvent ( id: string ): void, - + detachEvent(id: string): void, + /** * calls an inner event * @param the event's name, case-insensitive * @param optional, an array of the event-related data */ - callEvent ( name: string, params: Array ): boolean, - + callEvent(name: string, params: Array): boolean, + /** * checks whether an event has some handler(s) specified * @param the event's name */ - checkEvent ( name: string ): boolean, + checkEvent(name: string): boolean, } -export interface ZoomEvents { - +export interface ZoomEvents { + /** * fires during switching of the zooming level. * @param the number of the level * @param the config of the level */ - "onAfterZoom": ( level: number | string, config: ZoomLevel ) => any + "onAfterZoom": (level: number | string, config: ZoomLevel) => any } -export interface Tooltip { - +export interface Tooltip { + /** * returns the HTML element of the tooltip */ - getNode ( ): HTMLElement, - + getNode(): HTMLElement, + /** * locks the position of tooltip to the boundaries of the specified HTML element * @param the HTML element under the question */ - setViewport ( node: HTMLElement ): object, - + setViewport(node: HTMLElement): object, + /** * displays the tooltip at specific coordinates (relative to document.body). The method can take different parameters, depending on the position you want to show the tooltip at. To display tooltip at specific coordinates (relative to document.body), pass x,y coordinates. To display tooltip at the mouse event coordinates pass the Event object. The *tooltip_offset_x/y* and viewport will be taken into account. * @param the X coordinate or the mouse event object * @param the Y coordinate */ - show ( config?: number | Event, top?: number ): object, - + show(config?: number | Event, top?: number): object, + /** * hides the tooltip element */ - hide ( ): object, - + hide(): object, + /** * puts HTML content into the tooltip. Takes as a parameter: * @param a string with HTML content for the tooltip */ - setContent ( html: string ): object, + setContent(html: string): object, } -export interface Tooltips { +export interface Tooltips { /** * Tooltip object */ - tooltip: Tooltip, - + tooltip: Tooltip, + /** * adds tooltip with extended configuration. The method takes one parameter: * @param an object with the tooltip settings. The settings are: @@ -6806,25 +6902,25 @@ export interface Tooltips { * @param the HTML node * @param optional, defines whether the module listens to mouse events on the whole page (*true*) or only inside a gantt element (*false*). By default the option is set to *false*. */ - attach ( + attach( config: { selector: string, onmouseenter: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), onmousemove?: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), onmouseleave: (( event: MouseEvent, node: HTMLElement, - )=> void ), + ) => void), global?: boolean, } ): void, - + /** * adds a tooltip for the specified Gantt element. It is a more simplified version of the **attach()** method. The method takes one parameter: * @param an object with the tooltip settings. The settings are: @@ -6834,70 +6930,70 @@ export interface Tooltips { * @param the HTML node and returns a string with a template. * @param optional, defines whether the module listens to mouse events on the whole page (*true*) or only inside a gantt element (*false*). By default the option is set to *false*. */ - tooltipFor ( + tooltipFor( config: { selector: string, html: (( event: Event, node: HTMLElement, - )=> HTMLElement | string | number | void ), + ) => HTMLElement | string | number | void), global?: boolean, } ): void, - + /** * removes tooltip. As a parameter the method takes: * @param the CSS selector of a Gantt element */ - detach ( selector: string ): void, + detach(selector: string): void, } -export interface DurationFormatter { +export interface DurationFormatter { /** * returns *true* if the provided string can be parsed into the duration value, otherwise * @param the string that will be checked */ - canParse ( value: string ): boolean, - + canParse(value: string): boolean, + /** * converts the provided duration value into the duration string * @param the duration value that will be converted */ - format ( value: number ): string, - + format(value: number): string, + /** * parses the provided string into the duration value. If the value can’t be parsed, ‘null’ will be returned * @param the string that will be converted */ - parse ( value: string ): number, - + parse(value: string): number, + } -export interface LinkFormatter { +export interface LinkFormatter { /** * returns *true* if the provided string can be parsed into the link object, otherwise * @param the string that will be checked */ - canParse ( value: string ): boolean, + canParse(value: string): boolean, /** * converts the provided link value into the string * @param the link object that will be converted */ - format ( value: Link ): string, + format(value: Link): string, /** * parses the provided string into the link object. If the value can’t be parsed, ‘null’ will be returned. **Note** that the *link.target* of the given link will have "null" value * @param the string that will be converted */ - parse ( value: string ): object, + parse(value: string): object, } -export interface Formatters { - +export interface Formatters { + /** * creates a Duration Formatter * @param optional, a configuration object which can include the following attributes: @@ -6936,11 +7032,11 @@ export interface Formatters { * @param plural text label for years * @param short text label for years */ - durationFormatter ( + durationFormatter( config?: { enter?: string, store?: string, - format?: string | Array , + format?: string | Array, short?: boolean, minutesPerHour?: number, hoursPerDay?: number, @@ -6981,7 +7077,7 @@ export interface Formatters { }, } ): DurationFormatter, - + /** * create a Link Formatter * @param optional, a configuration object which can include the following attributes: @@ -6992,7 +7088,7 @@ export interface Formatters { * @param labels for the Finish to Finish links * @param labels for the Start to Finish links */ - linkFormatter ( + linkFormatter( config?: { durationFormatter?: DurationFormatter, labels?: { @@ -7005,71 +7101,71 @@ export interface Formatters { ): LinkFormatter, } -export interface EmptyState { - +export interface EmptyState { + /** * an array with the IDs of the attached handlers. It is modified by the *attachAddTaskEvent* and *detachAddTaskEvents* methods. */ clickEvents?: Array, - + /** * returns *true* if there is no data loaded into the Gantt chart, otherwise */ - isGanttEmpty ( ): boolean, - + isGanttEmpty(): boolean, + /** * returns *true* if the api/gantt_show_empty_state_config.md property is enabled, otherwise */ - isEnabled ( ): boolean, - + isEnabled(): boolean, + /** * puts an HTML content into the empty state element. The method can be redefined. * @param the container element */ - renderContent ( container: HTMLElement ): void, - + renderContent(container: HTMLElement): void, + /** * returns the DOM element where the empty state will be attached to. By default, returns the grid element (the "empty state" will be displayed in the grid). If there is no grid, returns the timeline element (the "empty state" will be displayed in the timeline). The method can be redefined. */ - getContainer ( ): HTMLElement | null, - + getContainer(): HTMLElement | null, + /** * returns the DOM node of the empty state element */ - getNode ( ): HTMLElement | null, - + getNode(): HTMLElement | null, + /** * displays the "empty state". Returns *null* if there is no container for the Empty State Element. The extension calls the method by itself */ - show ( ): null | void, - + show(): null | void, + /** * hides the "empty state". Returns *false* if there is no Empty State Element node, so there is nothing to hide. The extension calls the method by itself */ - hide ( ): boolean | void, - + hide(): boolean | void, + /** * adds the handler that will fire after clicking on the Empty State Element. By default, it is used to add a new task. */ - attachAddTaskEvent ( ): void, - + attachAddTaskEvent(): void, + /** * removes the handlers that were used to add a task after clicking on the Empty State Element */ - detachAddTaskEvents ( ): void + detachAddTaskEvents(): void } -export interface Ext { - inlineEditors: InlineEditorMethods, - emptyStateElement: EmptyState, - fullscreen: Fullscreen, - formatters: Formatters, - keyboardNavigation: KeyNav, - quickInfo: QuickInfo, - undo: Undo, - overlay: Overlay, - tooltips: Tooltips, - zoom: ZoomMethods, +export interface Ext { + inlineEditors: InlineEditorMethods, + emptyStateElement: EmptyState, + fullscreen: Fullscreen, + formatters: Formatters, + keyboardNavigation: KeyNav, + quickInfo: QuickInfo, + undo: Undo, + overlay: Overlay, + tooltips: Tooltips, + zoom: ZoomMethods, [customMethod: string]: any; } @@ -7078,4 +7174,4 @@ declare var gantt: GanttStatic; declare var Gantt: GanttEnterprise; -export {gantt, Gantt}; \ No newline at end of file +export { gantt, Gantt }; \ No newline at end of file diff --git a/codebase/dhtmlxgantt.es.js b/codebase/dhtmlxgantt.es.js index f9a95b9..092f83a 100644 --- a/codebase/dhtmlxgantt.es.js +++ b/codebase/dhtmlxgantt.es.js @@ -1,6 +1,6 @@ /** @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. @@ -1825,7 +1825,7 @@ const Vn = { click_drag: function(t) { 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; + t.templates.marker_class && (s += " " + t.templates.marker_class(i)), i.css && (s += " " + i.css), t.templates.marker_class && (s += " " + t.templates.marker_class(i)), 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"; @@ -1925,7 +1925,9 @@ const Vn = { click_drag: function(t) { }).bind(this), d = (function() { if (s) { if (n) { - for (var c = t.getGlobalTaskIndex(this.getFirstSelected()), u = t.getGlobalTaskIndex(n), h = t.getGlobalTaskIndex(s), g = s; t.getGlobalTaskIndex(g) !== c; ) this.unselect(g, e), g = c > h ? t.getNext(g) : t.getPrev(g); + var c = t.getGlobalTaskIndex(this.getFirstSelected()), u = t.getGlobalTaskIndex(n), h = t.getGlobalTaskIndex(s); + c != -1 && h != -1 || (c = u, this.reset()); + for (var g = s; t.getGlobalTaskIndex(g) !== c; ) this.unselect(g, e), g = c > h ? 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; @@ -1973,8 +1975,15 @@ const Vn = { click_drag: function(t) { 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); + const a = t._multiselect; + if (n && a.isActive()) { + let r = t.getSelectedId(), s = null; + r && (s = t.getTask(r)); + let o = t.getTask(e), l = !1; + if (s && s.$level != o.$level && (l = !0), t.config.multiselect_one_level && l && !i.ctrlKey && !i.shiftKey) return !0; + if (a._one_level) return a.isSameLevel(e); + } + return !0; }), t.attachEvent("onTaskClick", function(e, n) { return t._multiselect.doSelection(n) && t.callEvent("onMultiSelect", [n]), !0; }); @@ -2239,7 +2248,7 @@ const Vn = { click_drag: function(t) { t.exportMode = !0; const n = [], i = t.config.columns; let a = 0; - for (let r = 0; r < i.length; r++) i[r].name !== "add" && i[r].name !== "buttons" && (n[a] = { id: i[r].template ? "_" + r : i[r].name, header: i[r].label || t.locale.labels["column_" + i[r].name], width: i[r].width ? Math.floor(i[r].width / 4) : "" }, i[r].name === "duration" && (n[a].type = "number"), i[r].name !== "start_date" && i[r].name !== "end_date" || (n[a].type = "date", e && e.rawDates && (n[a].id = i[r].name)), a++); + for (let r = 0; r < i.length; r++) i[r].name !== "add" && i[r].name !== "buttons" && (n[a] = { id: i[r].template ? "_" + r : i[r].name, header: i[r].label || t.locale.labels["column_" + i[r].name], width: i[r].width ? Math.floor(i[r].width / 4) : "", tree: i[r].tree || !1 }, i[r].name === "duration" && (n[a].type = "number"), i[r].name !== "start_date" && i[r].name !== "end_date" || (n[a].type = "date", e && e.rawDates && (n[a].id = i[r].name)), a++); return t.exportMode = !1, n; }, _exportSerialize() { t.exportMode = !0; @@ -5000,7 +5009,8 @@ function pi(t) { t.config.baselines = { datastore: "baselines", render_mode: !1, dataprocessor_baselines: !1, row_height: 16, bar_height: 8 }; const e = t.createDatastore({ name: t.config.baselines.datastore, initItem: function(a) { return a.id || (a.id = t.uid()), function(r) { - r.start_date ? r.start_date = t.date.parseDate(r.start_date, "parse_date") : r.start_date = null, r.end_date ? r.end_date = t.date.parseDate(r.end_date, "parse_date") : r.end_date = null, r.task_id; + if (!r.task_id || !r.start_date && !r.end_date) return !1; + r.start_date ? r.start_date = t.date.parseDate(r.start_date, "parse_date") : r.start_date = null, r.end_date ? r.end_date = t.date.parseDate(r.end_date, "parse_date") : r.end_date = null, r.duration = r.duration || 1, r.start_date && !r.end_date ? r.end_date = t.calculateEndDate(r.start_date, r.duration) : r.end_date && !r.start_date && (r.start_date = t.calculateEndDate(r.end_date, -r.duration)); }(a), a; } }); function n(a) { @@ -6459,7 +6469,7 @@ class Gi { } const Yi = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { new_task: "Ny oppgave", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Rediger", icon_delete: "Slett", confirm_closing: "", confirm_deleting: "Hendelsen vil bli slettet permanent. Er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Avbryt", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, Ji = { date: { month_full: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"], day_short: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"] }, labels: { new_task: "Nieuwe taak", icon_save: "Opslaan", icon_cancel: "Annuleren", icon_details: "Details", icon_edit: "Bewerken", icon_delete: "Verwijderen", confirm_closing: "", confirm_deleting: "Item zal permanent worden verwijderd, doorgaan?", section_description: "Beschrijving", section_time: "Tijd periode", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Taak omschrijving", column_start_date: "Startdatum", column_duration: "Duur", column_add: "", link: "Koppeling", confirm_link_deleting: "zal worden verwijderd", link_start: " (start)", link_end: " (eind)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "minuten", hours: "uren", days: "dagen", weeks: "weken", months: "maanden", years: "jaren", message_ok: "OK", message_cancel: "Annuleren", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, Ki = { date: { month_full: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], month_short: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], day_full: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"], day_short: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"] }, labels: { new_task: "Ny oppgave", icon_save: "Lagre", icon_cancel: "Avbryt", icon_details: "Detaljer", icon_edit: "Endre", icon_delete: "Slett", confirm_closing: "Endringer blir ikke lagret, er du sikker?", confirm_deleting: "Oppføringen vil bli slettet, er du sikker?", section_description: "Beskrivelse", section_time: "Tidsperiode", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Avbryt", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, Xi = { date: { month_full: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], month_short: ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], day_full: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], day_short: ["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"] }, labels: { new_task: "Nowe zadanie", icon_save: "Zapisz", icon_cancel: "Anuluj", icon_details: "Szczegóły", icon_edit: "Edytuj", icon_delete: "Usuń", confirm_closing: "", confirm_deleting: "Zdarzenie zostanie usunięte na zawsze, kontynuować?", section_description: "Opis", section_time: "Okres czasu", section_type: "Typ", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Nazwa zadania", column_start_date: "Początek", column_duration: "Czas trwania", column_add: "", link: "Link", confirm_link_deleting: "zostanie usunięty", link_start: " (początek)", link_end: " (koniec)", type_task: "Zadanie", type_project: "Projekt", type_milestone: "Milestone", minutes: "Minuty", hours: "Godziny", days: "Dni", weeks: "Tydzień", months: "Miesiące", years: "Lata", message_ok: "OK", message_cancel: "Anuluj", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, Zi = { date: { month_full: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], month_short: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], day_full: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], day_short: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"] }, labels: { new_task: "Nova tarefa", icon_save: "Salvar", icon_cancel: "Cancelar", icon_details: "Detalhes", icon_edit: "Editar", icon_delete: "Excluir", confirm_closing: "", confirm_deleting: "As tarefas serão excluidas permanentemente, confirme?", section_description: "Descrição", section_time: "Período", section_type: "Tipo", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "EAP", column_text: "Nome tarefa", column_start_date: "Data início", column_duration: "Duração", column_add: "", link: "Link", confirm_link_deleting: "Será excluído!", link_start: " (início)", link_end: " (fim)", type_task: "Task", type_project: "Projeto", type_milestone: "Marco", minutes: "Minutos", hours: "Horas", days: "Dias", weeks: "Semanas", months: "Meses", years: "Anos", message_ok: "OK", message_cancel: "Cancelar", section_constraint: "Restrição", constraint_type: "Tipo Restrição", constraint_date: "Data restrição", asap: "Mais breve possível", alap: "Mais tarde possível", snet: "Não começar antes de", snlt: "Não começar depois de", fnet: "Não terminar antes de", fnlt: "Não terminar depois de", mso: "Precisa começar em", mfo: "Precisa terminar em", resources_filter_placeholder: "Tipo de filtros", resources_filter_label: "Ocultar vazios", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, Qi = { date: { month_full: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "November", "December"], month_short: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full: ["Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata"], day_short: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sa"] }, labels: { new_task: "Sarcina noua", icon_save: "Salveaza", icon_cancel: "Anuleaza", icon_details: "Detalii", icon_edit: "Editeaza", icon_delete: "Sterge", confirm_closing: "Schimbarile nu vor fi salvate, esti sigur?", confirm_deleting: "Evenimentul va fi sters permanent, esti sigur?", section_description: "Descriere", section_time: "Interval", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Anuleaza", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, ta = { date: { month_full: ["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"], month_short: ["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"], day_full: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], day_short: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"] }, labels: { new_task: "Новое задание", icon_save: "Сохранить", icon_cancel: "Отменить", icon_details: "Детали", icon_edit: "Изменить", icon_delete: "Удалить", confirm_closing: "", confirm_deleting: "Событие будет удалено безвозвратно, продолжить?", section_description: "Описание", section_time: "Период времени", section_type: "Тип", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "ИСР", column_text: "Задача", column_start_date: "Начало", column_duration: "Длительность", column_add: "", link: "Связь", confirm_link_deleting: "будет удалена", link_start: " (начало)", link_end: " (конец)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Минута", hours: "Час", days: "День", weeks: "Неделя", months: "Месяц", years: "Год", message_ok: "OK", message_cancel: "Отменить", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "начните вводить слово для фильтрации", resources_filter_label: "спрятать не установленные", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, ea = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { new_task: "Nova naloga", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Prekliči", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, na = { date: { month_full: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sept", "Okt", "Nov", "Dec"], day_full: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"], day_short: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"] }, labels: { new_task: "Nová úloha", icon_save: "Uložiť", icon_cancel: "Späť", icon_details: "Detail", icon_edit: "Edituj", icon_delete: "Zmazať", confirm_closing: "Vaše zmeny nebudú uložené. Skutočne?", confirm_deleting: "Udalosť bude natrvalo vymazaná. Skutočne?", section_description: "Poznámky", section_time: "Doba platnosti", section_type: "Type", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Späť", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, ia = { date: { month_full: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"], day_short: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"] }, labels: { new_task: "Ny uppgift", icon_save: "Spara", icon_cancel: "Avbryt", icon_details: "Detajer", icon_edit: "Ändra", icon_delete: "Ta bort", confirm_closing: "", confirm_deleting: "Är du säker på att du vill ta bort händelsen permanent?", section_description: "Beskrivning", section_time: "Tid", section_type: "Typ", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Uppgiftsnamn", column_start_date: "Starttid", column_duration: "Varaktighet", column_add: "", link: "Länk", confirm_link_deleting: "kommer tas bort", link_start: " (start)", link_end: " (slut)", type_task: "Uppgift", type_project: "Projekt", type_milestone: "Milstolpe", minutes: "Minuter", hours: "Timmar", days: "Dagar", weeks: "Veckor", months: "Månader", years: "År", message_ok: "OK", message_cancel: "Avbryt", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, aa = { date: { month_full: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], month_short: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], day_full: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], day_short: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"] }, labels: { new_task: "Yeni görev", icon_save: "Kaydet", icon_cancel: "İptal", icon_details: "Detaylar", icon_edit: "Düzenle", icon_delete: "Sil", confirm_closing: "", confirm_deleting: "Görev silinecek, emin misiniz?", section_description: "Açıklama", section_time: "Zaman Aralığı", section_type: "Tip", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Görev Adı", column_start_date: "Başlangıç", column_duration: "Süre", column_add: "", link: "Bağlantı", confirm_link_deleting: "silinecek", link_start: " (başlangıç)", link_end: " (bitiş)", type_task: "Görev", type_project: "Proje", type_milestone: "Kilometretaşı", minutes: "Dakika", hours: "Saat", days: "Gün", weeks: "Hafta", months: "Ay", years: "Yıl", message_ok: "OK", message_cancel: "Ýptal", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }, ra = { date: { month_full: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], month_short: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], day_full: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"], day_short: ["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"] }, labels: { new_task: "Нове завдання", icon_save: "Зберегти", icon_cancel: "Відміна", icon_details: "Деталі", icon_edit: "Редагувати", icon_delete: "Вилучити", confirm_closing: "", confirm_deleting: "Подія вилучиться назавжди. Ви впевнені?", section_description: "Опис", section_time: "Часовий проміжок", section_type: "Тип", section_deadline: "Deadline", section_baselines: "Baselines", column_wbs: "WBS", column_text: "Task name", column_start_date: "Start time", column_duration: "Duration", column_add: "", link: "Link", confirm_link_deleting: "will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", message_ok: "OK", message_cancel: "Відміна", section_constraint: "Constraint", constraint_type: "Constraint type", constraint_date: "Constraint date", asap: "As Soon As Possible", alap: "As Late As Possible", snet: "Start No Earlier Than", snlt: "Start No Later Than", fnet: "Finish No Earlier Than", fnlt: "Finish No Later Than", mso: "Must Start On", mfo: "Must Finish On", resources_filter_placeholder: "type to filter", resources_filter_label: "hide empty", empty_state_text_link: "Click here", empty_state_text_description: "to create your first task", baselines_section_placeholder: "Start adding a new baseline", baselines_add_button: "Add Baseline", baselines_remove_button: "Remove", baselines_remove_all_button: "Remove All", deadline_enable_button: "Set", deadline_disable_button: "Remove" } }; function sa() { - this.constants = Un, this.version = "9.0.1", this.license = "gpl", this.templates = {}, this.ext = {}, this.keys = { edit_save: this.constants.KEY_CODES.ENTER, edit_cancel: this.constants.KEY_CODES.ESC }; + this.constants = Un, this.version = "9.0.2", this.license = "gpl", this.templates = {}, this.ext = {}, this.keys = { edit_save: this.constants.KEY_CODES.ENTER, edit_cancel: this.constants.KEY_CODES.ESC }; } function oa(t) { var e = new sa(), n = new qn(t), i = {}; @@ -6728,7 +6738,7 @@ function oa(t) { var m = null; (_.duration || _.duration === 0) && (_.duration = m = 1 * _.duration), m && (_.start_date && !_.end_date ? _.end_date = this.calculateEndDate(_) : !_.start_date && _.end_date && (_.start_date = this.calculateEndDate({ start_date: _.end_date, duration: -_.duration, task: _ }))), l.config.deadlines !== !1 && _.deadline && (_.deadline = l.date.parseDate(_.deadline, "parse_date")), _.progress = Number(_.progress) || 0, this._isAllowedUnscheduledTask(_) && this._set_default_task_timing(_), this._init_task_timing(_), _.start_date && _.end_date && this.correctTaskWorkTime(_), _.$source = [], _.$target = []; var p = this.$data.tasksStore.getItem(_.id); - return p && !W(_.open) && (_.$open = p.$open), _.parent === void 0 && (_.parent = this.config.root_id), _; + return p && !W(_.open) && (_.$open = p.$open), _.parent === void 0 && (_.parent = this.config.root_id), _.open && (_.$open = !0), _; }, l), getConfig: function() { return l.config; } }), h = l.createDatastore({ name: "link", initItem: R(function(_) { @@ -9291,13 +9301,13 @@ function Na(t) { this.clear(), this.point({ x: l.x, y: l.y }); var f = 2 * d.link_arrow_size, y = this.get_line_type(a, r.$getConfig()), v = l.e_x > l.x; if (y.from_start && y.to_start) this.point_to(h.left, f), v ? (this.point_to(h.down, c), this.point_to(h.right, u)) : (this.point_to(h.right, u), this.point_to(h.down, c)), this.point_to(h.right, f); - else if (!y.from_start && y.to_start) if (v = l.e_x > l.x + 2 * f, this.point_to(h.right, f), v) u -= f, this.point_to(h.down, c), this.point_to(h.right, u); + else if (!y.from_start && y.to_start) if (c !== 0 && (v = l.e_x > l.x + 2 * f), this.point_to(h.right, f), v) u -= f, this.point_to(h.down, c), this.point_to(h.right, u); else { u -= 2 * f; var b = c > 0 ? 1 : -1; this.point_to(h.down, b * (g / 2)), this.point_to(h.right, u), this.point_to(h.down, b * (Math.abs(c) - g / 2)), this.point_to(h.right, f); } - else y.from_start || y.to_start ? y.from_start && !y.to_start && (v = l.e_x > l.x - 2 * f, this.point_to(h.left, f), v ? (u += 2 * f, b = c > 0 ? 1 : -1, this.point_to(h.down, b * (g / 2)), this.point_to(h.right, u), this.point_to(h.down, b * (Math.abs(c) - g / 2)), this.point_to(h.left, f)) : (u += f, this.point_to(h.down, c), this.point_to(h.right, u))) : (this.point_to(h.right, f), v ? (this.point_to(h.right, u), this.point_to(h.down, c)) : (this.point_to(h.down, c), this.point_to(h.right, u)), this.point_to(h.left, f)); + else y.from_start || y.to_start ? y.from_start && !y.to_start && (c !== 0 && (v = l.e_x > l.x - 2 * f), this.point_to(h.left, f), v ? (u += 2 * f, b = c > 0 ? 1 : -1, this.point_to(h.down, b * (g / 2)), this.point_to(h.right, u), this.point_to(h.down, b * (Math.abs(c) - g / 2)), this.point_to(h.left, f)) : (u += f, this.point_to(h.down, c), this.point_to(h.right, u))) : (this.point_to(h.right, f), v ? (this.point_to(h.right, u), this.point_to(h.down, c)) : (this.point_to(h.down, c), this.point_to(h.right, u)), this.point_to(h.left, f)); return this.path; }, get_line_type: function(a, r) { var s = r.links, o = !1, l = !1; @@ -10935,7 +10945,8 @@ function Qa(t) { return m.apply(this, arguments) || this; } return B(p, m), p.prototype.render = function(k) { - return `
`; + const $ = (k.height || "130") + "px", w = k.placeholder ? `placeholder='${k.placeholder}'` : ""; + return `
`; }, p.prototype.set_value = function(k, $) { _.form_blocks.textarea._get_input(k).value = $ || ""; }, p.prototype.get_value = function(k) { diff --git a/codebase/dhtmlxgantt.es.js.map b/codebase/dhtmlxgantt.es.js.map index 956f61e..644d543 100644 --- a/codebase/dhtmlxgantt.es.js.map +++ b/codebase/dhtmlxgantt.es.js.map @@ -1 +1 @@ -{"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\t\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\r\n\tif(marker.css){\r\n\t\tcss += \" \" + marker.css;\r\n\t}\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\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\tvar multiselect = gantt._multiselect;\r\n\tif (state && multiselect.isActive()) {\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 = 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 = [];\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 = [];\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 = [];\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 = [];\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};\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 \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 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 if (!item.task_id) {\r\n return false;\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\t
Start date: ${gantt.templates.tooltip_date_format(start)}
\r\n\t\t\t\t
End 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\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 \"
\" + text + \"
\";\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 += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, gantt.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, gantt.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"gantt_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\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 = \"
\" + collapseIcon + \"
\" + obj.header + \"
\";\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\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\tforward = (pt.e_x > (pt.x + 2 * shiftX));\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\r\n\t\t\tforward = (pt.e_x > (pt.x - 2 * shiftX));\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 || \"\") + \"\";\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
\r\n\t\r\n\r\n
`;\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 = \"
\" + this.locale.labels[\"button_\" + sns[i].button] + \"
\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"
\" + this.locale.labels.baselines_remove_all_button + \"
\" +\r\n\t\t\t\t\"
\" + this.locale.labels.baselines_add_button + \"
\";\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 += \"
\" + 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 += \"\";\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 += \"
\" + gantt.locale.labels[button] + \"
\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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\"
\" +\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\"
\"+label+\"
\" +\r\n\t\t\t\"
\" +\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 += \"\";\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\"
\" +\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\"
\"+durationLabel+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = `
${deleteLabel}
`;\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,GACpCpB,KAAcmB,SAASrB,EAAKuB,YAAW,EAAA,GACvCvB,IAAOA,EAAKwB;AAGbrB,IAAAA,IAAQK,SAASD,KAAKY,cAAcnB,EAAKmB,cAAcjB,GACvDE,IAASI,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List":[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\t\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 \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\t
Start date: ${gantt.templates.tooltip_date_format(start)}
\r\n\t\t\t\t
End 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 \"
\" + text + \"
\";\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 += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, gantt.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, gantt.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"gantt_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\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 = \"
\" + collapseIcon + \"
\" + obj.header + \"
\";\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\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 || \"\") + \"\";\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
\r\n\t\r\n\r\n
`;\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 = \"
\" + this.locale.labels[\"button_\" + sns[i].button] + \"
\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"
\" + this.locale.labels.baselines_remove_all_button + \"
\" +\r\n\t\t\t\t\"
\" + this.locale.labels.baselines_add_button + \"
\";\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 += \"
\" + 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 += \"\";\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 += \"
\" + gantt.locale.labels[button] + \"
\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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\"
\" +\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\"
\"+label+\"
\" +\r\n\t\t\t\"
\" +\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 += \"\";\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\"
\" +\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\"
\"+durationLabel+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = `
${deleteLabel}
`;\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":";;;;;;;;;;;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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`;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";t.templates.marker_class&&(s+=" "+t.templates.marker_class(i)),i.css&&(s+=" "+i.css),t.templates.marker_class&&(s+=" "+t.templates.marker_class(i)),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){const a=t._multiselect;if(n&&a.isActive()){let r=t.getSelectedId(),s=null;r&&(s=t.getTask(r));let o=t.getTask(e),l=!1;if(s&&s.$level!=o.$level&&(l=!0),t.config.multiselect_one_level&&l&&!i.ctrlKey&&!i.shiftKey)return!0;if(a._one_level)return a.isSameLevel(e)}return!0}),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=0;g--){var f=g==i.length-1,y=this.initScaleConfig(i[g],o,l);f&&this.processIgnores(y),this.initColSizes(y,a,u,c[g]),this.limitVisibleRange(y),f&&(u=y.full_width),h.unshift(y)}for(g=0;g=+d&&(d=e.add(c,a,i));+c<+d;){o.call(this,new Date(c));var u=c.getTimezoneOffset();c=e.add(c,a,i),c=t._correct_dst_change(c,u,a,i),e[i+"_start"]&&(c=e[i+"_start"](c))}},limitVisibleRange:function(i){var a=i.trace_x,r=i.width.length-1,s=0;if(+a[0]<+i.min_date&&r!=0){var o=Math.floor(i.width[0]*((a[1]-i.min_date)/(a[1]-a[0])));s+=i.width[0]-o,i.width[0]=o,a[0]=new Date(i.min_date)}var l=a.length-1,d=a[l],c=e.add(d,i.step,i.unit);if(+c>+i.max_date&&l>0&&(o=i.width[l]-Math.floor(i.width[l]*((c-i.max_date)/(c-d))),s+=i.width[l]-o,i.width[l]=o),s){for(var u=this.getSum(i.width),h=0,g=0;gt.end_date&&(t.end_date=new Date(n))}function de(t){Qn(t),function(e){if(e.config.fit_tasks){var n=+e._min_date,i=+e._max_date;if(+e._min_date!=n||+e._max_date!=i)return e.render(),e.callEvent("onScaleAdjusted",[]),!0}}(t)}function Ge(t,e,n){for(var i=0;ithis.clientSideDelete(o,e,n);this._dataProcessorHandlers.push(n.attachEvent("onAfterTaskAdd",function(o,l){n.isTaskExists(o)&&(e.setGanttMode("tasks"),e.setUpdated(o,!0,"inserted"))})),this._dataProcessorHandlers.push(n.attachEvent("onAfterTaskUpdate",function(o,l){n.isTaskExists(o)&&(e.setGanttMode("tasks"),e.setUpdated(o,!0),n._sendTaskOrder&&n._sendTaskOrder(o,l))})),this._dataProcessorHandlers.push(n.attachEvent("onBeforeTaskDelete",function(o,l){return n.config.cascade_delete&&(i[o]={tasks:ce.getSubtreeTasks(n,o),links:ce.getSubtreeLinks(n,o)}),!e.deleteAfterConfirmation||(e.setGanttMode("tasks"),e.setUpdated(o,!0,"deleted"),!1)})),this._dataProcessorHandlers.push(n.attachEvent("onAfterTaskDelete",function(o,l){e.setGanttMode("tasks");const d=!a(o),c=n.config.cascade_delete&&i[o];if(d||c){if(c){const u=e.updateMode;e.setUpdateMode("off");const h=i[o];for(const g in h.tasks)a(g)||(e.storeItem(h.tasks[g]),e.setUpdated(g,!0,"deleted"));e.setGanttMode("links");for(const g in h.links)a(g)||(e.storeItem(h.links[g]),e.setUpdated(g,!0,"deleted"));i[o]=null,u!=="off"&&e.sendAllData(),e.setGanttMode("tasks"),e.setUpdateMode(u)}d&&(e.storeItem(l),e.deleteAfterConfirmation||e.setUpdated(o,!0,"deleted")),e.updateMode==="off"||e._tSend||e.sendAllData()}})),this._dataProcessorHandlers.push(n.attachEvent("onAfterLinkUpdate",function(o,l){n.isLinkExists(o)&&(e.setGanttMode("links"),e.setUpdated(o,!0))})),this._dataProcessorHandlers.push(n.attachEvent("onAfterLinkAdd",function(o,l){n.isLinkExists(o)&&(e.setGanttMode("links"),e.setUpdated(o,!0,"inserted"))})),this._dataProcessorHandlers.push(n.attachEvent("onAfterLinkDelete",function(o,l){e.setGanttMode("links"),!a(o)&&(e.storeItem(l),e.setUpdated(o,!0,"deleted"))})),this._dataProcessorHandlers.push(n.attachEvent("onRowDragEnd",function(o,l){n._sendTaskOrder(o,n.getTask(o))}));let r=null,s=null;this._dataProcessorHandlers.push(n.attachEvent("onTaskIdChange",function(o,l){if(!e._waitMode)return;const d=n.getChildren(l);if(d.length){r=r||{};for(let u=0;u-1?o.indexOf("?"):o.length),this.serverProcessor=o+(o.slice(-1)==="/"?"":"/")+l}else{const l=this._ganttMode+"s";this.serverProcessor=o+n.ajax.urlSeparator(o)+"gantt_mode="+l}return!0}),e.attachEvent("insertCallback",function(o,l,d,c){const u=o.data||n.xml._xmlNodeToJSON(o.firstChild),h={add:n.addTask,isExist:n.isTaskExists};c==="links"&&(h.add=n.addLink,h.isExist=n.isLinkExists),h.isExist.call(n,l)||(u.id=l,h.add.call(n,u))}),e.attachEvent("updateCallback",function(o,l){const d=o.data||n.xml._xmlNodeToJSON(o.firstChild);if(!n.isTaskExists(l))return;const c=n.getTask(l);for(const u in d){let h=d[u];switch(u){case"id":continue;case"start_date":case"end_date":h=n.defined(n.templates.xml_date)?n.templates.xml_date(h):n.templates.parse_date(h);break;case"duration":c.end_date=n.calculateEndDate({start_date:c.start_date,duration:h,task:c})}c[u]=h}n.updateTask(l),n.refreshData()}),e.attachEvent("deleteCallback",function(o,l,d,c){const u={delete:n.deleteTask,isExist:n.isTaskExists};c==="links"?(u.delete=n.deleteLink,u.isExist=n.isLinkExists):c==="assignment"&&(u.delete=function(h){n.$data.assignmentsStore.remove(h)},u.isExist=function(h){return n.$data.assignmentsStore.exists(h)}),u.isExist.call(n,l)&&u.delete.call(n,l)}),this.handleResourceCRUD(e,n),this.handleResourceAssignmentCRUD(e,n),this.handleBaselineCRUD(e,n)}clientSideDelete(e,n,i){const a=n.updatedRows.slice();let r=!1;i.getUserData(e,"!nativeeditor_status",n._ganttMode)==="true_deleted"&&(r=!0,n.setUpdated(e,!1));for(let s=0;s{a[l.task_id]?function(d){r[d.id]=d,a[d.task_id]=!0}(l):s(l)}),i.attachEvent("onAfterUpdate",(o,l)=>{i.exists(o)&&(r[o]?s(l):(e.setGanttMode("assignment"),e.setUpdated(o,!0)))}),i.attachEvent("onAfterDelete",(o,l)=>{e.setGanttMode("assignment"),!this.clientSideDelete(o,e,n)&&(e.storeItem(l),e.setUpdated(o,!0,"deleted"))})}handleResourceCRUD(e,n){if(!n.config.resources||n.config.resources.dataprocessor_resources!==!0)return;const i=n.getDatastore(n.config.resource_store);i.attachEvent("onAfterAdd",(a,r)=>{(function(s){const o=s.id;i.exists(o)&&(e.setGanttMode("resource"),e.setUpdated(o,!0,"inserted"))})(r)}),i.attachEvent("onAfterUpdate",(a,r)=>{i.exists(a)&&(e.setGanttMode("resource"),e.setUpdated(a,!0))}),i.attachEvent("onAfterDelete",(a,r)=>{e.setGanttMode("resource"),!this.clientSideDelete(a,e,n)&&(e.storeItem(r),e.setUpdated(a,!0,"deleted"))})}handleBaselineCRUD(e,n){if(!n.config.baselines||n.config.baselines.dataprocessor_baselines!==!0)return;const i=n.getDatastore(n.config.baselines.datastore);i.attachEvent("onAfterAdd",(a,r)=>{(function(s){const o=s.id;i.exists(o)&&(e.setGanttMode("baseline"),e.setUpdated(o,!0,"inserted"))})(r)}),i.attachEvent("onAfterUpdate",(a,r)=>{i.exists(a)&&(e.setGanttMode("baseline"),e.setUpdated(a,!0))}),i.attachEvent("onAfterDelete",(a,r)=>{e.setGanttMode("baseline"),!this.clientSideDelete(a,e,n)&&(e.storeItem(r),e.setUpdated(a,!0,"deleted"))})}detach(){kt(this._dataProcessorHandlers,e=>{this.$gantt.detachEvent(e)}),this._dataProcessorHandlers=[]}}const Yt=class Yt{constructor(){this.clear=()=>{this._storage={}},this.storeItem=e=>{this._storage[e.id]=V(e)},this.getStoredItem=e=>this._storage[e]||null,this._storage={}}};Yt.create=()=>new Yt;let Wt=Yt,Je=class{constructor(t){this.serverProcessor=t,this.action_param="!nativeeditor_status",this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._headers=null,this._payload=null,this._postDelim="_",this._routerParametersFormat="parameters",this._waitMode=0,this._in_progress={},this._storage=Wt.create(),this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),it(this)}setTransactionMode(t,e){typeof t=="object"?(this._tMode=t.mode||this._tMode,W(t.headers)&&(this._headers=t.headers),W(t.payload)&&(this._payload=t.payload),this._tSend=!!e):(this._tMode=t,this._tSend=e),this._tMode==="REST"&&(this._tSend=!1),this._tMode==="JSON"||this._tMode==="REST-JSON"?(this._tSend=!1,this._serializeAsJson=!0,this._headers=this._headers||{},this._headers["Content-Type"]="application/json"):this._headers&&!this._headers["Content-Type"]&&(this._headers["Content-Type"]="application/x-www-form-urlencoded"),this._tMode==="CUSTOM"&&(this._tSend=!1,this._router=t.router)}escape(t){return this._utf?encodeURIComponent(t):escape(t)}enableUTFencoding(t){this._utf=!!t}getSyncState(){return!this.updatedRows.length}setUpdateMode(t,e){this.autoUpdate=t==="cell",this.updateMode=t,this.dnd=e}ignore(t,e){this._silent_mode=!0,t.call(e||dt),this._silent_mode=!1}setUpdated(t,e,n){if(this._silent_mode)return;const i=this.findRow(t);n=n||"updated";const a=this.$gantt.getUserData(t,this.action_param,this._ganttMode);a&&n==="updated"&&(n=a),e?(this.set_invalid(t,!1),this.updatedRows[i]=t,this.$gantt.setUserData(t,this.action_param,n,this._ganttMode),this._in_progress[t]&&(this._in_progress[t]="wait")):this.is_invalid(t)||(this.updatedRows.splice(i,1),this.$gantt.setUserData(t,this.action_param,"",this._ganttMode)),this.markRow(t,e,n),e&&this.autoUpdate&&this.sendData(t)}markRow(t,e,n){let i="";const a=this.is_invalid(t);if(a&&(i=this.styles[a],e=!0),this.callEvent("onRowMark",[t,e,n,a])&&(i=this.styles[e?n:"clear"]+" "+i,this.$gantt[this._methods[0]](t,i),a&&a.details)){i+=this.styles[a+"_cell"];for(let r=0;r{this.modes[n]&&this.modes[n].updatedRows.length&&e.push(n)}),e.length){for(let n=0;n{this.$gantt.deleteTask(t)}),this.$gantt.callEvent("onAfterTaskDelete",[t,l]),this.$gantt.render(),delete this._in_progress[r]}return this.callEvent("onAfterUpdate",[t,n,e,i])}return this.$gantt.setUserData(t,this.action_param,"true_deleted",this._ganttMode),this.$gantt[this._methods[3]](t),delete this._in_progress[r],this.callEvent("onAfterUpdate",[t,n,e,i])}this._in_progress[r]!=="wait"?(s&&this.$gantt.setUserData(t,this.action_param,"",this._ganttMode),delete this._in_progress[r]):(delete this._in_progress[r],this.setUpdated(e,!0,this.$gantt.getUserData(t,this.action_param,this._ganttMode))),this.callEvent("onAfterUpdate",[o,n,e,i])}afterUpdate(t,e,n){let i;i=arguments.length===3?arguments[1]:arguments[4];let a=this.getGanttMode();const r=i.filePath||i.url;a=this._tMode!=="REST"&&this._tMode!=="REST-JSON"?r.indexOf("gantt_mode=links")!==-1?"link":r.indexOf("gantt_mode=assignments")!==-1?"assignment":r.indexOf("gantt_mode=baselines")!==-1?"baseline":"task":r.indexOf("/link")>=0?"link":r.indexOf("/assignment")>=0?"assignment":r.indexOf("/baseline")>=0?"baseline":"task",this.setGanttMode(a);const s=this.$gantt.ajax;let o;try{o=JSON.parse(e.xmlDoc.responseText)}catch{e.xmlDoc.responseText.length||(o={})}const l=u=>{const h=o.action||this.getState(u)||"updated",g=o.sid||u[0],f=o.tid||u[0];t.afterUpdateCallback(g,f,h,o,a)};if(o)return Array.isArray(n)&&n.length>1?n.forEach(u=>l(u)):l(n),t.finalizeUpdate(),void this.setGanttMode(a);const d=s.xmltop("data",e.xmlDoc);if(!d)return this.cleanUpdate(n);const c=s.xpath("//data/action",d);if(!c.length)return this.cleanUpdate(n);for(let u=0;u{this.loadUpdate()},t)}afterAutoUpdate(t,e,n,i){return e!=="collision"||(this._needUpdate=!0,!1)}fullSync(){return this._needUpdate&&(this._needUpdate=!1,this.loadUpdate()),!0}getUpdates(t,e){const n=this.$gantt.ajax;if(this._updateBusy)return!1;this._updateBusy=!0,n.get(t,e)}loadUpdate(){const t=this.$gantt.ajax,e=this.$gantt.getUserData(0,"version",this._ganttMode);let n=this.serverProcessor+t.urlSeparator(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+e].join("&");n=n.replace("editing=true&",""),this.getUpdates(n,i=>{const a=t.xpath("//userdata",i);this.$gantt.setUserData(0,"version",this._getXmlNodeValue(a[0]),this._ganttMode);const r=t.xpath("//update",i);if(r.length){this._silent_mode=!0;for(let s=0;s{let f=l||"updated",y=e,v=e;g&&(f=g.action||l,y=g.sid||y,v=g.id||g.tid||v),this.afterUpdateCallback(y,v,f,g,c)};let h;if(this._router instanceof Function)if(this._routerParametersFormat==="object"){const g={entity:c,action:d,data:t,id:e};h=this._router(g)}else h=this._router(c,d,t,e);else if(this._router[c]instanceof Function)h=this._router[c](d,t,e);else{const g="Incorrect configuration of gantt.createDataProcessor",f=` @@ -28,12 +28,12 @@ You need to either add missing properties to the dataProcessor router object or See https://docs.dhtmlx.com/gantt/desktop__server_side.html#customrouting and https://docs.dhtmlx.com/gantt/api__gantt_createdataprocessor.html for details.`;if(!this._router[c])throw new Error(`${g}: router for the **${c}** entity is not defined. ${f}`);switch(l){case"inserted":if(!this._router[c].create)throw new Error(`${g}: **create** action for the **${c}** entity is not defined. ${f}`);h=this._router[c].create(t);break;case"deleted":if(!this._router[c].delete)throw new Error(`${g}: **delete** action for the **${c}** entity is not defined. ${f}`);h=this._router[c].delete(e);break;default:if(!this._router[c].update)throw new Error(`${g}: **update**" action for the **${c}** entity is not defined. ${f}`);h=this._router[c].update(t,e)}}if(h){if(!h.then&&h.id===void 0&&h.tid===void 0&&h.action===void 0)throw new Error("Incorrect router return value. A Promise or a response object is expected");h.then?h.then(u).catch(g=>{g&&g.action?u(g):u({action:"error",value:g})}):u(h)}else u(null);return}let i;i={callback:l=>{const d=[];if(e)d.push(e);else if(t)for(const c in t)d.push(c);return this.afterUpdate(this,l,d)},headers:this._headers};const a="dhx_version="+this.$gantt.getUserData(0,"version",this._ganttMode),r=this.serverProcessor+(this._user?n.urlSeparator(this.serverProcessor)+["dhx_user="+this._user,a].join("&"):"");let s,o=this._applyPayload(r);switch(this._tMode){case"GET":s=this._cleanupArgumentsBeforeSend(t),i.url=o+n.urlSeparator(o)+this.serialize(s,e),i.method="GET";break;case"POST":s=this._cleanupArgumentsBeforeSend(t),i.url=o,i.method="POST",i.data=this.serialize(s,e);break;case"JSON":s={};const l=this._cleanupItemBeforeSend(t);for(const d in l)d!==this.action_param&&d!=="id"&&d!=="gr_id"&&(s[d]=l[d]);i.url=o,i.method="POST",i.data=JSON.stringify({id:e,action:t[this.action_param],data:s});break;case"REST":case"REST-JSON":switch(o=r.replace(/(&|\?)editing=true/,""),s="",this.getState(e)){case"inserted":i.method="POST",i.data=this.serialize(t,e);break;case"deleted":i.method="DELETE",o=o+(o.slice(-1)==="/"?"":"/")+e;break;default:i.method="PUT",i.data=this.serialize(t,e),o=o+(o.slice(-1)==="/"?"":"/")+e}i.url=this._applyPayload(o)}return this._waitMode++,n.query(i)}_forEachUpdatedRow(t){const e=this.updatedRows.slice();for(let n=0;nX(n)?this._prepareDate(n):Array.isArray(n)&&!zt(e,n)?this._prepareArray(n,e):n&&typeof n=="object"&&!zt(e,n)?this._prepareObject(n,e):n)}_prepareObject(t,e){const n={};e.push(t);for(const i in t){if(i.substr(0,1)==="$")continue;const a=t[i];X(a)?n[i]=this._prepareDate(a):a===null?n[i]="":Array.isArray(a)&&!zt(e,a)?n[i]=this._prepareArray(a,e):a&&typeof a=="object"&&!zt(e,a)?n[i]=this._prepareObject(a,e):n[i]=a}return n}_prepareDataItem(t){const e=this._prepareObject(t,[]);return e[this.action_param]=this.$gantt.getUserData(t.id,this.action_param,this._ganttMode),e}getStoredItem(t){return this._storage.getStoredItem(t)}_getRowData(t){let e;const n=this.$gantt;return this.getGanttMode()==="task"?n.isTaskExists(t)&&(e=this.$gantt.getTask(t)):this.getGanttMode()==="assignment"?this.$gantt.$data.assignmentsStore.exists(t)&&(e=this.$gantt.$data.assignmentsStore.getItem(t)):this.getGanttMode()==="baseline"?this.$gantt.$data.baselineStore.exists(t)&&(e=this.$gantt.$data.baselineStore.getItem(t)):n.isLinkExists(t)&&(e=this.$gantt.getLink(t)),e||(e=this.getStoredItem(t)),e||(e={id:t}),this._prepareDataItem(e)}};const Ke={DEPRECATED_api:function(t){return new Je(t)},createDataProcessor:function(t){let e,n,i;t instanceof Function?e=t:t.hasOwnProperty("router")?e=t.router:t.hasOwnProperty("assignment")||t.hasOwnProperty("baseline")||t.hasOwnProperty("link")||t.hasOwnProperty("task")?e=t:t.hasOwnProperty("headers")&&(i=t.headers),n=e?"CUSTOM":t.mode||"REST-JSON";const a=new Je(t.url);return a.init(this),a.setTransactionMode({mode:n,router:e,headers:i},t.batchUpdate),t.deleteAfterConfirmation&&(a.deleteAfterConfirmation=t.deleteAfterConfirmation),a}};function ei(t){var e={},n=!1;function i(l,d){d=typeof d=="function"?d:function(){},e[l]||(e[l]=this[l],this[l]=d)}function a(l){e[l]&&(this[l]=e[l],e[l]=null)}function r(l){for(var d in l)i.call(this,d,l[d])}function s(){for(var l in e)a.call(this,l)}function o(l){try{l()}catch(d){dt.console.error(d)}}return t.$services.getService("state").registerProvider("batchUpdate",function(){return{batch_update:n}},!1),function(l,d){if(n)o(l);else{var c,u=this._dp&&this._dp.updateMode!="off";u&&(c=this._dp.updateMode,this._dp.setUpdateMode("off"));var h={},g={render:!0,refreshData:!0,refreshTask:!0,refreshLink:!0,resetProjectDates:function(y){h[y.id]=y}};for(var f in r.call(this,g),n=!0,this.callEvent("onBeforeBatchUpdate",[]),o(l),this.callEvent("onAfterBatchUpdate",[]),s.call(this),h)this.resetProjectDates(h[f]);n=!1,d||this.render(),u&&(this._dp.setUpdateMode(c),this._dp.setGanttMode("task"),this._dp.sendData(),this._dp.setGanttMode("link"),this._dp.sendData())}}}function ni(t){t.batchUpdate=ei(t)}var ii=function(t){return{_needRecalc:!0,reset:function(){this._needRecalc=!0},_isRecalcNeeded:function(){return!this._isGroupSort()&&this._needRecalc},_isGroupSort:function(){return!!t.getState().group_mode},_getWBSCode:function(e){return e?(this._isRecalcNeeded()&&this._calcWBS(),e.$virtual?"":this._isGroupSort()?e.$wbs||"":(e.$wbs||(this.reset(),this._calcWBS()),e.$wbs)):""},_setWBSCode:function(e,n){e.$wbs=n},getWBSCode:function(e){return this._getWBSCode(e)},getByWBSCode:function(e){for(var n=e.split("."),i=t.config.root_id,a=0;al.start_date){for(let h=0;h"+g.value+""}return"
-
"}return""},renderSummaryLabel:function(s,o,l,d,c){let u=c.reduce(function(h,g){return h+Number(g.value)},0);return u%1&&(u=Math.round(10*u)/10),u?"
"+u+"
":""},editableResourceCellTemplate:function(s,o,l,d,c){return l.$role==="task"?r.renderEditableLabel(s,o,l,d,c):r.renderSummaryLabel(s,o,l,d,c)},editableResourceCellClass:function(s,o,l,d,c){const u=[];u.push("resource_marker"),l.$role==="task"?u.push("task_cell"):u.push("resource_cell");const h=c.reduce(function(f,y){return f+Number(y.value)},0);let g=Number(l.capacity);return isNaN(g)&&(g=8),h<=g?u.push("workday_ok"):u.push("workday_over"),u.join(" ")},getSummaryResourceAssignments:function(s){let o;const l=a.getDatastore(a.config.resource_store),d=l.getItem(s);return d.$role==="task"?o=a.getResourceAssignments(d.$resource_id,d.$task_id):(o=a.getResourceAssignments(s),l.eachItem&&l.eachItem(function(c){c.$role!=="task"&&(o=o.concat(a.getResourceAssignments(c.id)))},s)),o},initEditableDiagram:function(){a.config.resource_render_empty_cells=!0,function(){let s=null;function o(){return s&&cancelAnimationFrame(s),s=requestAnimationFrame(function(){a.$container&&Array.prototype.slice.call(a.$container.querySelectorAll(".resourceTimeline_cell [data-assignment-cell]")).forEach(function(l){l.contentEditable=!0})}),!0}a.attachEvent("onGanttReady",function(){a.getDatastore(a.config.resource_assignment_store).attachEvent("onStoreUpdated",o),a.getDatastore(a.config.resource_store).attachEvent("onStoreUpdated",o)},{once:!0}),a.attachEvent("onGanttLayoutReady",function(){a.$layout.getCellsByType("viewCell").forEach(function(l){l.$config&&l.$config.view==="resourceTimeline"&&l.$content&&l.$content.attachEvent("onScroll",o)})})}(),a.attachEvent("onGanttReady",function(){let s=!1;a.event(a.$container,"keypress",function(o){var l=o.target.closest(".resourceTimeline_cell [data-assignment-cell]");l&&(o.keyCode!==13&&o.keyCode!==27||l.blur())}),a.event(a.$container,"focusout",function(o){if(!s){s=!0,setTimeout(function(){s=!1},300);var l=o.target.closest(".resourceTimeline_cell [data-assignment-cell]");if(l){var d=(l.innerText||"").trim();d=="-"&&(d="0");var c=Number(d),u=l.getAttribute("data-row-id"),h=l.getAttribute("data-assignment-id"),g=l.getAttribute("data-task"),f=l.getAttribute("data-resource-id"),y=a.templates.parse_date(l.getAttribute("data-start-date")),v=a.templates.parse_date(l.getAttribute("data-end-date")),b=a.getDatastore(a.config.resource_assignment_store);if(isNaN(c))a.getDatastore(a.config.resource_store).refresh(u);else{var _=a.getTask(g);if(a.plugins().undo&&a.ext.undo.saveState(g,"task"),h){if(c===(p=b.getItem(h)).value)return;if(p.start_date.valueOf()===y.valueOf()&&p.end_date.valueOf()===v.valueOf())p.value=c,c?b.updateItem(p.id):b.removeItem(p.id);else{if(p.end_date.valueOf()>v.valueOf()){var m=a.copy(p);m.id=a.uid(),m.start_date=v,m.duration=a.calculateDuration({start_date:m.start_date,end_date:m.end_date,task:_}),m.delay=a.calculateDuration({start_date:_.start_date,end_date:m.start_date,task:_}),m.mode=p.mode||"default",m.duration!==0&&b.addItem(m)}p.start_date.valueOf(){x!="$id"&&(w[x]=p[x])}),w.start_date&&w.start_date.getMonth&&w.end_date&&w.end_date.getMonth&&typeof w.duration=="number"||r(w,f),b.push(w)})}return b}function d(f){if(t.isTaskExists(f)){var y=t.getTask(f);c(y,t.getTaskAssignments(y.id))}}function c(f,y){y.sort(function(v,b){return v.start_date&&b.start_date&&v.start_date.valueOf()!=b.start_date.valueOf()?v.start_date-b.start_date:0}),i==n.assignmentsArray?f[t.config.resource_property]=y:i==n.resourceValueArray&&(f[t.config.resource_property]=y.map(function(v){return{$id:v.id,start_date:v.start_date,duration:v.duration,end_date:v.end_date,delay:v.delay,resource_id:v.resource_id,value:v.value,mode:v.mode}})),f[e]=y}function u(f){var y=l(f);return y.forEach(function(v){v.id=v.id||t.uid()}),y}function h(f,y){var v=function(b,_){var m={inBoth:[],inTaskNotInStore:[],inStoreNotInTask:[]};if(i==n.singleValue){var p=b[0],k=p?p.resource_id:null,$=!1;_.forEach(function(T){T.resource_id!=k?m.inStoreNotInTask.push(T):T.resource_id==k&&(m.inBoth.push({store:T,task:p}),$=!0)}),!$&&p&&m.inTaskNotInStore.push(p)}else if(i==n.valueArray){var w={},x={},S={};b.forEach(function(T){w[T.resource_id]=T}),_.forEach(function(T){x[T.resource_id]=T}),b.concat(_).forEach(function(T){if(!S[T.resource_id]){S[T.resource_id]=!0;var C=w[T.resource_id],E=x[T.resource_id];C&&E?m.inBoth.push({store:E,task:C}):C&&!E?m.inTaskNotInStore.push(C):!C&&E&&m.inStoreNotInTask.push(E)}})}else i!=n.assignmentsArray&&i!=n.resourceValueArray||(w={},x={},S={},b.forEach(function(T){w[T.id||T.$id]=T}),_.forEach(function(T){x[T.id]=T}),b.concat(_).forEach(function(T){var C=T.id||T.$id;if(!S[C]){S[C]=!0;var E=w[C],D=x[C];E&&D?m.inBoth.push({store:D,task:E}):E&&!D?m.inTaskNotInStore.push(E):!E&&D&&m.inStoreNotInTask.push(D)}}));return m}(l(f),y);v.inStoreNotInTask.forEach(function(b){s.removeItem(b.id)}),v.inTaskNotInStore.forEach(function(b){s.addItem(b)}),v.inBoth.forEach(function(b){if(function(m,p){var k={id:!0};for(var $ in m)if(!k[$]&&String(m[$])!==String(p[$]))return!0;return!1}(b.task,b.store))(function(m,p){var k={id:!0};for(var $ in m)k[$]||(p[$]=m[$])})(b.task,b.store),s.updateItem(b.store.id);else if(b.task.start_date&&b.task.end_date&&b.task.mode!==a.fixedDates){var _=o(b.store,f);b.store.start_date.valueOf()==_.start_date.valueOf()&&b.store.end_date.valueOf()==_.end_date.valueOf()||(b.store.start_date=_.start_date,b.store.end_date=_.end_date,b.store.duration=_.duration,s.updateItem(b.store.id))}}),d(f.id)}function g(f){var y=f[e]||s.find(function(v){return v.task_id==f.id});h(f,y)}t.$data.assignmentsStore=s,t.attachEvent("onGanttReady",function(){if(t.config.process_resource_assignments){t.attachEvent("onParse",function(){t.silent(function(){s.clearAll();var k=[];t.eachTask(function($){if($.type!==t.config.types.project){var w=u($);c($,w),w.forEach(function(x){k.push(x)})}}),s.parse(k)})});var f=!1,y=!1,v={},b=!1;t.attachEvent("onBeforeBatchUpdate",function(){f=!0}),t.attachEvent("onAfterBatchUpdate",function(){if(y){var k={};for(var $ in v)k[$]=t.getTaskAssignments(v[$].id);for(var $ in v)h(v[$],k[$])}y=!1,f=!1,v={}}),t.attachEvent("onTaskCreated",function(k){var $=u(k);return s.parse($),c(k,$),!0}),t.attachEvent("onAfterTaskUpdate",function(k,$){f?(y=!0,v[k]=$):$.unscheduled||g($)}),t.attachEvent("onAfterTaskAdd",function(k,$){f?(y=!0,v[k]=$):g($)}),t.attachEvent("onRowDragEnd",function(k){g(t.getTask(k))}),t.$data.tasksStore.attachEvent("onAfterDeleteConfirmed",function(k,$){var w,x=[k];t.eachTask(function(S){x.push(S.id)},k),w={},x.forEach(function(S){w[S]=!0}),s.find(function(S){return w[S.task_id]}).forEach(function(S){s.removeItem(S.id)})}),t.$data.tasksStore.attachEvent("onClearAll",function(){return _=null,m=null,p=null,s.clearAll(),!0}),t.attachEvent("onTaskIdChange",function(k,$){s.find(function(w){return w.task_id==k}).forEach(function(w){w.task_id=$,s.updateItem(w.id)}),d($)}),t.attachEvent("onBeforeUndo",function(k){return b=!0,!0}),t.attachEvent("onAfterUndo",function(k){b=!0});var _=null,m=null,p=null;s.attachEvent("onStoreUpdated",function(){return f&&!b||(_=null,m=null,p=null),!0}),t.getResourceAssignments=function(k,$){var w=t.defined($)&&$!==null;return _===null&&(_={},m={},s.eachItem(function(x){_[x.resource_id]||(_[x.resource_id]=[]),_[x.resource_id].push(x);var S=x.resource_id+"-"+x.task_id;m[S]||(m[S]=[]),m[S].push(x)})),w?(m[k+"-"+$]||[]).slice():(_[k]||[]).slice()},t.getTaskAssignments=function(k){if(p===null){var $=[];p={},s.eachItem(function(w){p[w.task_id]||(p[w.task_id]=[]),p[w.task_id].push(w),w.task_id==k&&$.push(w)})}return(p[k]||[]).slice()},t.getTaskResources=function(k){const $=t.getDatastore("resource"),w=t.getTaskAssignments(k),x={};w.forEach(function(T){x[T.resource_id]||(x[T.resource_id]=T.resource_id)});const S=[];for(const T in x){const C=$.getItem(x[T]);C&&S.push(C)}return S},t.updateTaskAssignments=d}},{once:!0})}function li(t){function e(o){return function(){return!t.config.placeholder_task||o.apply(this,arguments)}}function n(){var o=t.getTaskBy("type",t.config.types.placeholder);if(!o.length||!t.isTaskExists(o[0].id)){var l={unscheduled:!0,type:t.config.types.placeholder,duration:0,text:t.locale.labels.new_task};if(t.callEvent("onTaskCreated",[l])===!1)return;t.addTask(l)}}function i(o){var l=t.getTask(o);l.type==t.config.types.placeholder&&(l.start_date&&l.end_date&&l.unscheduled&&(l.unscheduled=!1),t.batchUpdate(function(){var d=t.copy(l);t.silent(function(){t.deleteTask(l.id)}),delete d["!nativeeditor_status"],d.type=t.config.types.task,d.id=t.uid(),t.addTask(d)}))}t.config.types.placeholder="placeholder",t.attachEvent("onDataProcessorReady",e(function(o){o&&!o._silencedPlaceholder&&(o._silencedPlaceholder=!0,o.attachEvent("onBeforeUpdate",e(function(l,d,c){return c.type!=t.config.types.placeholder||(o.setUpdated(l,!1),!1)})))}));var a=!1;function r(o){return!!(t.config.types.placeholder&&t.isTaskExists(o)&&t.getTask(o).type==t.config.types.placeholder)}function s(o){return!(!r(o.source)&&!r(o.target))}t.attachEvent("onGanttReady",function(){a||(a=!0,t.attachEvent("onAfterTaskUpdate",e(i)),t.attachEvent("onAfterTaskAdd",e(function(o,l){l.type!=t.config.types.placeholder&&(t.getTaskBy("type",t.config.types.placeholder).forEach(function(d){t.silent(function(){t.isTaskExists(d.id)&&t.deleteTask(d.id)})}),n())})),t.attachEvent("onParse",e(n)))}),t.attachEvent("onLinkValidation",function(o){return!s(o)}),t.attachEvent("onBeforeLinkAdd",function(o,l){return!s(l)}),t.attachEvent("onBeforeUndoStack",function(o){for(var l=0;l!isNaN(this.parse(e)),this.format=e=>String(e),this.parse=e=>parseInt(e,10)}};Jt.create=(e=null)=>new Jt;let Et=Jt;const Kt=class Kt{constructor(e){this.format=n=>this._getWBSCode(n.source),this.canParse=n=>this._linkReg.test(n),this.parse=n=>{if(!this.canParse(n))return null;const i=this._linkReg.exec(n)[0].trim();return{id:void 0,source:this._findSource(i)||null,target:null,type:this._gantt.config.links.finish_to_start,lag:0}},this._getWBSCode=n=>{const i=this._gantt.getTask(n);return this._gantt.getWBSCode(i)},this._findSource=n=>{const i=new RegExp("^[0-9.]+","i");if(i.exec(n)){const a=i.exec(n)[0],r=this._gantt.getTaskByWBSCode(a);if(r)return r.id}return null},this._linkReg=/^[0-9\.]+/,this._gantt=e}};Kt.create=(e=null,n)=>new Kt(n);let ue=Kt;function ci(t){t.ext.formatters={durationFormatter:function(e){return e||(e={}),e.store||(e.store=t.config.duration_unit),e.enter||(e.enter=t.config.duration_unit),Et.create(e,t)},linkFormatter:function(e){return ue.create(e,t)}}}function ui(t){t.ext=t.ext||{},t.config.show_empty_state=!1,t.ext.emptyStateElement=t.ext.emptyStateElement||{isEnabled:()=>t.config.show_empty_state===!0,isGanttEmpty:()=>!t.getTaskByTime().length,renderContent(e){const n=`
${`
${t.locale.labels.empty_state_text_description}
-
`}
`;e.innerHTML=n},clickEvents:[],attachAddTaskEvent(){const e=t.attachEvent("onEmptyClick",function(n){t.utils.dom.closest(n.target,"[data-empty-state-create-task]")&&t.createTask({id:t.uid(),text:"New Task"})});this.clickEvents.push(e)},detachAddTaskEvents(){this.clickEvents.forEach(function(e){t.detachEvent(e)}),this.clickEvents=[]},getContainer(){if(t.$container){const e=t.utils.dom;if(t.$container.contains(t.$grid_data))return e.closest(t.$grid_data,".gantt_layout_content");if(t.$container.contains(t.$task_data))return e.closest(t.$task_data,".gantt_layout_content")}return null},getNode(){const e=this.getContainer();return e?e.querySelector(".gantt_empty_state_wrapper"):null},show(){const e=this.getContainer();if(!e&&this.isGanttEmpty())return null;const n=document.createElement("div");n.className="gantt_empty_state_wrapper",n.style.marginTop=t.config.scale_height-e.offsetHeight+"px";const i=t.$container.querySelectorAll(".gantt_empty_state_wrapper");Array.prototype.forEach.call(i,function(a){a.parentNode.removeChild(a)}),this.detachAddTaskEvents(),this.attachAddTaskEvent(),e.appendChild(n),this.renderContent(n)},hide(){const e=this.getNode();if(!e)return!1;e.parentNode.removeChild(e)},init(){}},t.attachEvent("onDataRender",function(){const e=t.ext.emptyStateElement;e.isEnabled()&&e.isGanttEmpty()?e.show():e.hide()})}const Xe=function(t,e){const n=e.baselines&&e.baselines.length,i=t.config.baselines.render_mode=="separateRow"||t.config.baselines.render_mode=="individualRow";if(n&&i)return!0},hi=function(t,e){let n=!1;return t.eachTask(function(i){n||(n=Xe(t,i))},e),n},wt=function(t){return t.render&&t.render=="split"&&!t.$open},_i=function(t,e,n,i){let a=i||e.$task_data.scrollHeight,r=!1,s=!1;return t.eachParent(function(o){if(wt(o)){s=!0;const l=e.getItemPosition(o).rowHeight;lr&&(r=o)},a.id),a.row_heighto&&(o=c)}),r.row_height=o,r.bar_height=r.bar_height||s}},a.id)}t.$data.baselineStore=e,t.adjustTaskHeightForBaselines=function(a){let r,s,o=a.baselines&&a.baselines.length||0;const l=t.config.baselines.row_height;switch(t.config.baselines.render_mode){case"taskRow":a.row_height=a.bar_height+4;break;case"separateRow":r=t.getLayoutView("timeline").getBarHeight(a.id),o?(a.bar_height=a.bar_height||r,a.bar_height>r&&(r=a.bar_height),a.row_height=r+l):a.bar_height&&(a.row_height=a.bar_height+4),i(a);break;case"individualRow":r=t.getLayoutView("timeline").getBarHeight(a.id),o?(a.bar_height=a.bar_height||r,a.bar_height>r&&(r=a.bar_height),s=l*o,a.row_height=r+s+2):a.bar_height&&(a.row_height=a.bar_height+4),i(a)}},t.attachEvent("onGanttReady",function(){t.config.baselines!==!1&&(t.attachEvent("onParse",function(){e.eachItem(function(a){const r=a.task_id;if(t.isTaskExists(r)){const s=t.getTask(r);s.baselines=s.baselines||[];let o=!0;for(let l=0;l"+n.xmlDoc.responseURL+", server returns 404");else if(!t.$destroyed){this.callEvent("onBeforeParse",[]),i||(i="json"),this.assert(this[i],"Invalid data type:'"+i+"'");var a=n.xmlDoc.responseText,r=this[i].parse(a,n);this._process_loading(r)}},t._process_loading=function(n){n.collections&&this._load_collections(n.collections),n.resources&&this.$data.resourcesStore&&this.$data.resourcesStore.parse(n.resources),t.config.baselines!==!1&&n.baselines&&this.$data.baselineStore&&this.$data.baselineStore.parse(n.baselines);const i=n.data||n.tasks;n.assignments&&function(r,s){const o={};s.forEach(l=>{o[l.task_id]||(o[l.task_id]=[]),o[l.task_id].push(l)}),r.forEach(l=>{l[t.config.resource_property]=o[l.id]||[]})}(i,n.assignments),this.$data.tasksStore.parse(i);var a=n.links||(n.collections?n.collections.links:[]);this.$data.linksStore.parse(a),this.callEvent("onParse",[]),this.render()},t._load_collections=function(n){var i=!1;for(var a in n)if(n.hasOwnProperty(a)){i=!0;var r=n[a];this.serverList[a]=this.serverList[a]||[];var s=this.serverList[a];if(!s)continue;s.splice(0,s.length);for(var o=0;o"},_copyObject:function(n){return""},serialize:function(){for(var n=[],i=[],a=t.json.serialize(),r=0,s=a.data.length;r"+n.join("")+""+i.join("")+""}},t.oldxml={parse:function(n,i){i=t.xml._getXML(n,i,"projects");for(var a={collections:{links:[]}},r=a.data=[],s=t.ajax.xpath("//task",i),o=0;oe.length?t:e,a=t===i?e:t;i=i.slice(),a=a.slice(),n=[];for(var r=0;rs.start&&(n.push({start:Math.max(s.start,l.start),end:Math.min(s.end,l.end)}),s.end>l.end&&(a.splice(o,1),o--,r--))}return n},_mergeAdjacentIntervals:function(t){var e=t.slice();e.sort(function(r,s){return r.start-s.start});for(var n=e[0],i=1;in.end&&(n.end=a.end),e.splice(i,1),i--):n=a}return e},_mergeHoursConfig:function(t,e){return this._mergeAdjacentIntervals(this._intersectHourRanges(t,e))},merge:function(t,e){var n=V(t.getConfig().parsed),i=V(e.getConfig().parsed),a={hours:this._toHoursArray(this._mergeHoursConfig(n.hours,i.hours)),dates:{},customWeeks:{}};const r=(o,l)=>{for(let d in o.dates){const c=o.dates[d];+d>1e3&&(a.dates[d]=!1);for(const u in l.dates){const h=l.dates[u];if(u==d&&(a.dates[d]=!(!c||!h)),Array.isArray(c)){const g=Array.isArray(h)?h:l.hours;a.dates[d]=this._toHoursArray(this._mergeHoursConfig(c,g))}}}};if(r(n,i),r(i,n),n.customWeeks)for(var s in n.customWeeks)a.customWeeks[s]=n.customWeeks[s];if(i.customWeeks)for(var s in i.customWeeks)a.customWeeks[s]=i.customWeeks[s];return a}};class mi{constructor(){this.clear()}getItem(e,n,i){if(this._cache.has(e)){const a=this._cache.get(e)[i.getFullYear()];if(a&&a.has(n))return a.get(n)}return-1}setItem(e,n,i,a){if(!e||!n)return;const r=this._cache,s=a.getFullYear();let o;r.has(e)?o=r.get(e):(o=[],r.set(e,o));let l=o[s];l||(l=o[s]=new Map),l.set(n,i)}clear(){this._cache=new Map}}class vi{constructor(){this.clear()}getItem(e,n,i){const a=this._cache;if(a&&a[e]){const r=a[e];if(r===void 0)return-1;const s=r[i.getFullYear()];if(s&&s[n]!==void 0)return s[n]}return-1}setItem(e,n,i,a){if(!e||!n)return;const r=this._cache;if(!r)return;r[e]||(r[e]=[]);const s=r[e],o=a.getFullYear();let l=s[o];l||(l=s[o]={}),l[n]=i}clear(){this._cache={}}}class ki{constructor(e){this.getMinutesPerWeek=n=>{const i=n.valueOf();if(this._weekCache.has(i))return this._weekCache.get(i);const a=this._calendar,r=this._calendar.$gantt;let s=0,o=r.date.week_start(new Date(n));for(let l=0;l<7;l++)s+=60*a.getHoursPerDay(o),o=r.date.add(o,1,"day");return this._weekCache.set(i,s),s},this.getMinutesPerMonth=n=>{const i=n.valueOf();if(this._monthCache.has(i))return this._monthCache.get(i);const a=this._calendar,r=this._calendar.$gantt;let s=0,o=r.date.week_start(new Date(n));const l=r.date.add(o,1,"month").valueOf();for(;o.valueOf(){this._weekCache=new Map,this._monthCache=new Map},this.clear(),this._calendar=e}}class yi{constructor(){this.clear()}_getCacheObject(e,n,i){const a=this._cache;a[n]||(a[n]=[]);let r=a[n];r||(r=a[n]={});let s=r[i];s||(s=r[i]={});const o=e.getFullYear();let l=s[o];return l||(l=s[o]={durations:{},endDates:{}}),l}_endDateCacheKey(e,n){return String(e)+"-"+String(n)}_durationCacheKey(e,n){return String(e)+"-"+String(n)}getEndDate(e,n,i,a,r){const s=this._getCacheObject(e,i,a),o=e.valueOf(),l=this._endDateCacheKey(o,n);let d;if(s.endDates[l]===void 0){const c=r(),u=c.valueOf();s.endDates[l]=u,s.durations[this._durationCacheKey(o,u)]=n,d=c}else d=new Date(s.endDates[l]);return d}getDuration(e,n,i,a,r){const s=this._getCacheObject(e,i,a),o=e.valueOf(),l=n.valueOf(),d=this._durationCacheKey(o,l);let c;if(s.durations[d]===void 0){const u=r();s.durations[d]=u.valueOf(),c=u}else c=s.durations[d];return c}clear(){this._cache={}}}function fe(t,e){this.argumentsHelper=e,this.$gantt=t,this._workingUnitsCache=typeof Map<"u"?new mi:new vi,this._largeUnitsCache=new ki(this),this._dateDurationCache=new yi,this._worktime=null,this._cached_timestamps={},this._cached_timestamps_count=0}fe.prototype={units:["year","month","week","day","hour","minute"],_clearCaches:function(){this._workingUnitsCache.clear(),this._largeUnitsCache.clear(),this._dateDurationCache.clear()},_getUnitOrder:function(t){for(var e=0,n=this.units.length;e1e6&&this._resetTimestampCache();var e=null;if(t.day||t.day===0)e=t.day;else if(t.date){var n=String(t.date.valueOf());this._cached_timestamps[n]?e=this._cached_timestamps[n]:(e=Date.UTC(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this._cached_timestamps[n]=e,this._cached_timestamps_count++)}return e},_checkIfWorkingUnit:function(t,e){if(!this["_is_work_"+e]){const n=this.$gantt.date[`${e}_start`](new Date(t)),i=this.$gantt.date.add(n,1,e);return this.hasDuration(n,i)}return this["_is_work_"+e](t)},_is_work_day:function(t){var e=this._getWorkHours(t);return!!Array.isArray(e)&&e.length>0},_is_work_hour:function(t){for(var e=this._getWorkHours(t),n=t.getHours(),i=0;i=e[i].startHour&&n=e[i].start&&ns.valueOf(),this._isWorkTime(r,n))(u||h&&g)&&(o=a[n+"_start"](new Date(r)),l=a.add(o,i,n)),u?(u=!1,c=this._nextDate(o,n,i),d+=(l.valueOf()-r.valueOf())/(l.valueOf()-o.valueOf())):h&&g?(h=!1,d+=(s.valueOf()-r.valueOf())/(l.valueOf()-o.valueOf())):d++;else{var f=this._getUnitOrder(n),y=this.units[f-1];y&&!this._isWorkTime(r,y)&&(c=this._getClosestWorkTimeFuture(r,y))}r=c}return d},_getMinutesPerHour:function(t){var e=this._getTimeOfDayStamp(t),n=this._getTimeOfDayStamp(this._nextDate(t,"hour",1));n===0&&(n=86400);for(var i=this._getWorkHours(t),a=0;a=r.start&&n<=r.end)return 60;if(er.start)return(Math.min(n,r.end)-Math.max(e,r.start))/60}return 0},_getMinutesPerDay:function(t){var e=this._getWorkHours(t),n=0;return e.forEach(function(i){n+=i.durationMinutes}),n},getHoursPerDay:function(t){var e=this._getWorkHours(t),n=0;return e.forEach(function(i){n+=i.durationHours}),n},_getWorkUnitsForRange:function(t,e,n,i){var a,r=0,s=new Date(t),o=new Date(e);for(a=R(n=="minute"?this._getMinutesPerDay:this.getHoursPerDay,this);s.valueOf()27648e5&&s.getDate()===0){var l=this._largeUnitsCache.getMinutesPerMonth(s);n=="hour"&&(l/=60),r+=l,s=this.$gantt.date.add(s,1,"month")}else{if(o-s>13824e5){var d=this.$gantt.date.week_start(new Date(s));if(s.valueOf()===d.valueOf()){l=this._largeUnitsCache.getMinutesPerWeek(s),n=="hour"&&(l/=60),r+=l,s=this.$gantt.date.add(s,7,"day");continue}}r+=a(s),s=this._nextDate(s,"day",1)}return r/i},_getMinutesBetweenSingleDay:function(t,e){for(var n=this._getIntervalTimestamp(t,e),i=this._getWorkHours(t),a=0,r=0;r=s.start&&n.start<=s.end){var o=Math.max(s.start,n.start),l=Math.min(s.end,n.end);a+=(l-o)/60,n.start=l}}return Math.floor(a)},_getMinutesBetween:function(t,e,n,i){var a=new Date(t),r=new Date(e);i=i||1;var s=new Date(a),o=this.$gantt.date.add(this.$gantt.date.day_start(new Date(a)),1,"day");if(r.valueOf()<=o.valueOf())return this._getMinutesBetweenSingleDay(t,e);var l=this.$gantt.date.day_start(new Date(r)),d=r,c=this._getMinutesBetweenSingleDay(s,o),u=this._getMinutesBetweenSingleDay(l,d);return c+this._getWorkUnitsForRange(o,l,n,i)+u},_getHoursBetween:function(t,e,n,i){var a=new Date(t),r=new Date(e);i=i||1;var s=new Date(a),o=this.$gantt.date.add(this.$gantt.date.day_start(new Date(a)),1,"day");if(r.valueOf()<=o.valueOf())return Math.round(this._getMinutesBetweenSingleDay(t,e)/60);var l=this.$gantt.date.day_start(new Date(r)),d=r,c=this._getMinutesBetweenSingleDay(s,o,n,i)/60,u=this._getMinutesBetweenSingleDay(l,d,n,i)/60,h=c+this._getWorkUnitsForRange(o,l,n,i)+u;return Math.round(h)},getConfig:function(){return this._worktime},_setConfig:function(t){this._worktime=t,this._parseSettings(),this._clearCaches()},_parseSettings:function(){var t=this.getConfig();for(var e in t.parsed={dates:{},hours:null,haveCustomWeeks:!1,customWeeks:{},customWeeksRangeStart:null,customWeeksRangeEnd:null,customWeeksBoundaries:[]},t.parsed.hours=this._parseHours(t.hours),t.dates)t.parsed.dates[e]=this._parseHours(t.dates[e]);if(t.customWeeks){var n=null,i=null;for(var e in t.customWeeks){var a=t.customWeeks[e];if(a.from&&a.to){var r=a.from,s=a.to;(!n||n>r.valueOf())&&(n=r.valueOf()),(!i||ii){for(var a=0;ai){n=n.customWeeks[n.customWeeksBoundaries[a].name];break}}var r=!0;return n.dates[i]!==void 0?r=n.dates[i]:n.dates[t.getDay()]!==void 0&&(r=n.dates[t.getDay()]),r===!0?n.hours:r||[]},_getIntervalTimestamp:function(t,e){var n={start:0,end:0};n.start=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds();var i=e.getHours();return!i&&!e.getMinutes()&&!e.getSeconds()&&t.valueOf()e.valueOf()){var s=e;e=t,t=s,r=-1}return a=n=="hour"&&i==1?this._getHoursBetween(t,e,n,i):n=="minute"&&i==1?this._getMinutesBetween(t,e,n,i):this._getWorkUnitsBetweenGeneric(t,e,n,i),r*Math.round(a)},hasDuration:function(){var t=this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper,arguments),e=t.start_date,n=t.end_date,i=t.unit,a=t.step;if(!i)return!1;var r=new Date(e),s=new Date(n);for(a=a||1;r.valueOf()=0?1:-1;n=Math.abs(1*n);var s=this;return this._dateDurationCache.getEndDate(e,n,i,a*r,function(){return s._calculateEndDate(e,n,i,a*r)})},_calculateEndDate:function(t,e,n,i){return!!n&&(i==1&&n=="minute"?this._calculateMinuteEndDate(t,e,i):i==-1&&n=="minute"?this._subtractMinuteDate(t,e,i):i==1&&n=="hour"?this._calculateHourEndDate(t,e,i):this._addInterval(t,e,n,i,null).end)},_addInterval:function(t,e,n,i,a){for(var r=0,s=t,o=!1;r0&&(d=new Date(l.valueOf()-1)),this._isWorkTime(d,n)&&!o&&r++,s=l}return{end:s,start:t,added:r}},_addHoursUntilDayEnd:function(t,e){for(var n=this.$gantt.date.add(this.$gantt.date.day_start(new Date(t)),1,"day"),i=0,a=e,r=this._getIntervalTimestamp(t,n),s=this._getWorkHours(t),o=0;o=l.start&&r.start<=l.end){var d=Math.max(l.start,r.start),c=Math.min(l.end,r.end),u=(c-d)/3600;u>a&&(u=a,c=d+60*a*60);var h=Math.round((c-d)/3600);i+=h,a-=h,r.start=c}}var g=n;return i===e&&(g=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,r.start)),{added:i,end:g}},_calculateHourEndDate:function(t,e,n){var i=new Date(t),a=0;n=n||1,e=Math.abs(1*e);var r=this._addHoursUntilDayEnd(i,e);if(a=r.added,i=r.end,d=e-a){for(var s=i;a0?this.getHoursPerDay(new Date(o.valueOf()-1)):this.getHoursPerDay(new Date(o.valueOf()+1)))>=e)break;a+=l,s=o}i=s}if(a=l.start&&r.start<=l.end){var d=Math.max(l.start,r.start),c=Math.min(l.end,r.end),u=(c-d)/60;u>a&&(u=a,c=d+60*a);var h=Math.round((c-d)/60);a-=h,i+=h,r.start=c}}var g=n;return i===e&&(g=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,r.start)),{added:i,end:g}},_subtractMinutesUntilHourStart:function(t,e){for(var n=this.$gantt.date.hour_start(new Date(t)),i=0,a=e,r=60*n.getHours()*60+60*n.getMinutes()+n.getSeconds(),s=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds(),o=this._getWorkHours(t),l=o.length-1;l>=0&&id.start&&r<=d.end){var c=Math.min(s,d.end),u=Math.max(r,d.start),h=(c-u)/60;h>a&&(h=a,u=c-60*a);var g=Math.abs(Math.round((c-u)/60));a-=g,i+=g,s=u}}var f=n;return i===e&&(f=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,s)),{added:i,end:f}},_subtractMinuteDate:function(t,e,n){var i=new Date(t),a=0;n=n||-1,e=Math.abs(1*e),e=Math.round(e);const r=this._isMinutePrecision(i);let s=this._subtractMinutesUntilHourStart(i,e);a+=s.added,i=s.end;for(var o=0,l=[],d=0;ad)a+=d,i=this.$gantt.date.add(i,-1,"day");else{for(var y=!1,v=null,b=null,_=l.length-1;_>=0;_--)if(l[_].start=f-1){y=!0,v=l[_],b=l[_-1];break}if(y)if(f===v.end&&g>=v.durationMinutes)a+=v.durationMinutes,i=this.$gantt.date.add(i,-v.durationMinutes,"minute");else if(!r&&g<=f/60-v.startMinute)a+=g,i=this.$gantt.date.add(i,-g,"minute");else if(r)g<=f/60-v.startMinute?(a+=g,i=this.$gantt.date.add(i,-g,"minute")):(a+=f/60-v.startMinute,i=b?new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,b.end):this.$gantt.date.day_start(i));else{var m=this._getMinutesPerHour(i);m<=g?(a+=m,i=this._nextDate(i,"hour",n)):(s=this._subtractMinutesUntilHourStart(i,g),a+=s.added,i=s.end)}else if(i.getHours()===0&&i.getMinutes()===0&&i.getSeconds()===0){if((p=this._getClosestWorkTimePast(i,"hour")).valueOf()===i.valueOf()){var p=this.$gantt.date.add(i,-1,"day"),k=this._getWorkHours(p);if(k.length){var $=k[k.length-1];p.setSeconds($.durationSeconds)}}i=p}else i=this._getClosestWorkTimePast(new Date(i-1),"hour")}else i=this.$gantt.date.add(i,-1,"day")}if(a=h&&u>=l){if(a+=l,u==l){i=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,o[o.length-1].end);break}i=this.$gantt.date.add(i,1,"day"),i=this.$gantt.date.day_start(i)}else{for(var g=!1,f=null,y=0;yh){g=!0,f=o[y];break}if(g)if(h===f.start&&u>=f.durationMinutes)a+=f.durationMinutes,i=this.$gantt.date.add(i,f.durationMinutes,"minute");else if(u<=f.endMinute-h/60)a+=u,i=this.$gantt.date.add(i,u,"minute");else{var v=this._getMinutesPerHour(i);v<=u?(a+=v,i=d?this.$gantt.date.add(i,v,"minute"):this._nextDate(i,"hour",n)):(a+=(r=this._addMinutesUntilHourEnd(i,u)).added,i=r.end)}else i=this._getClosestWorkTimeFuture(i,"hour")}else i=this.$gantt.date.add(this.$gantt.date.day_start(i),1,"day")}if(a0){for(var o=0;o=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[o].start);break}}else for(o=n.length-1;o>=0;o--){if(n[o].end<=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[o].end);break}if(n[o].end>s&&n[o].start<=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,s);break}}return a},_getClosestWorkMinute:function(t,e,n){var i=new Date(t),a=this._getWorkHours(i),r=this._findClosestTimeInDay(i,n,a);return r||(i=this.calculateEndDate(i,n,"day"),n>0?i=this.$gantt.date.day_start(i):(i=this.$gantt.date.day_start(i),i=this.$gantt.date.add(i,1,"day"),i=new Date(i.valueOf()-1)),a=this._getWorkHours(i),r=this._findClosestTimeInDay(i,n,a)),n<0&&(r=this.$gantt.date.add(r,-1,e)),r},_getClosestWorkTimeGeneric:function(t,e,n){if(e==="hour"||e==="minute")return this._getClosestWorkMinute(t,e,n);for(var i=this._getUnitOrder(e),a=this.units[i-1],r=t,s=0;!this._isWorkTime(r,e)&&(!a||this._isWorkTime(r,a)||(r=n>0?this._getClosestWorkTimeFuture(r,a):this._getClosestWorkTimePast(r,a),!this._isWorkTime(r,e)));){if(++s>3e3)return this.$gantt.assert(!1,"Invalid working time check"),!1;var o=r.getTimezoneOffset();r=this.$gantt.date.add(r,n,e),r=this.$gantt._correct_dst_change(r,o,n,e),this.$gantt.date[e+"_start"]&&(r=this.$gantt.date[e+"_start"](r))}return r},hasWorkTime:function(){var t=this.getConfig(),e=t.dates;for(var n in t.dates);var i=this._checkWorkHours(t.hours),a=!1;return[0,1,2,3,4,5,6].forEach((function(r){if(!a){var s=e[r];s===!0?a=i:Array.isArray(s)&&(a=this._checkWorkHours(s))}}).bind(this)),a},_checkWorkHours:function(t){if(t.length===0)return!1;for(var e=!1,n=0;ntask="+s+" of gantt.isUnscheduledTask. Task object was expected"),!!s.unscheduled||!s.start_date},t._isAllowedUnscheduledTask=function(s){return!(!s.unscheduled||!t.config.show_unscheduled)},t._isTaskInTimelineLimits=function(s){var o=s.start_date?s.start_date.valueOf():null,l=s.end_date?s.end_date.valueOf():null;return!!(o&&l&&o<=this._max_date.valueOf()&&l>=this._min_date.valueOf())},t.isTaskVisible=function(s){if(!this.isTaskExists(s))return!1;var o=this.getTask(s);return!(!this._isAllowedUnscheduledTask(o)&&!this._isTaskInTimelineLimits(o))&&this.getGlobalTaskIndex(s)>=0},t._getProjectEnd=function(){if(t.config.project_end)return t.config.project_end;var s=t.getTaskByTime();return(s=s.sort(function(o,l){return+o.end_date>+l.end_date?1:-1})).length?s[s.length-1].end_date:null},t._getProjectStart=function(){if(t.config.project_start)return t.config.project_start;if(t.config.start_date)return t.config.start_date;if(t.getState().min_date)return t.getState().min_date;var s=t.getTaskByTime();return(s=s.sort(function(o,l){return+o.start_date>+l.start_date?1:-1})).length?s[0].start_date:null};var e=function(s,o){var l=!!(o&&o!=t.config.root_id&&t.isTaskExists(o))&&t.getTask(o),d=null;if(l)if(t.config.schedule_from_end)d=t.calculateEndDate({start_date:l.end_date,duration:-t.config.duration_step,task:s});else{if(!l.start_date)return e(l,t.getParent(l));d=l.start_date}else if(t.config.schedule_from_end)d=t.calculateEndDate({start_date:t._getProjectEnd(),duration:-t.config.duration_step,task:s});else{const c=t.getTaskByIndex(0),u=t.config.start_date||t.getState().min_date;d=c?c.start_date?c.start_date:c.end_date?t.calculateEndDate({start_date:c.end_date,duration:-t.config.duration_step,task:s}):u:u}return t.assert(d,"Invalid dates"),new Date(d)};t._set_default_task_timing=function(s){s.start_date=s.start_date||e(s,t.getParent(s)),s.duration=s.duration||t.config.duration_step,s.end_date=s.end_date||t.calculateEndDate(s)},t.createTask=function(s,o,l){return s=s||{},t.defined(s.id)||(s.id=t.uid()),s.start_date||(s.start_date=e(s,o)),s.text===void 0&&(s.text=t.locale.labels.new_task),s.duration===void 0&&(s.duration=1),this.isTaskExists(o)&&(this.setParent(s,o,!0),this.getTask(o).$open=!0),this.callEvent("onTaskCreated",[s])?(this.config.details_on_create?(t.isTaskExists(s.id)?t.getTask(s.id).$index!=s.$index&&(s.start_date&&typeof s.start_date=="string"&&(s.start_date=this.date.parseDate(s.start_date,"parse_date")),s.end_date&&typeof s.end_date=="string"&&(s.end_date=this.date.parseDate(s.end_date,"parse_date")),this.$data.tasksStore.updateItem(s.id,s)):(s.$new=!0,this.silent(function(){t.$data.tasksStore.addItem(s,l)})),this.selectTask(s.id),this.refreshData(),this.showLightbox(s.id)):this.addTask(s,o,l)&&(this.showTask(s.id),this.selectTask(s.id)),s.id):null},t._update_flags=function(s,o){var l=t.$data.tasksStore;s===void 0?(this._lightbox_id=null,l.silent(function(){l.unselect()}),this.getSelectedTasks&&this._multiselect.reset(),this._tasks_dnd&&this._tasks_dnd.drag&&(this._tasks_dnd.drag.id=null)):(this._lightbox_id==s&&(this._lightbox_id=o),l.getSelectedId()==s&&l.silent(function(){l.unselect(s),l.select(o)}),this._tasks_dnd&&this._tasks_dnd.drag&&this._tasks_dnd.drag.id==s&&(this._tasks_dnd.drag.id=o))};var n=function(s,o){var l=t.getTaskType(s.type),d={type:l,$no_start:!1,$no_end:!1,scheduled_summary:!1};return l===t.config.types.project&&s.auto_scheduling===!1&&(d.scheduled_summary=!0),o||l!=s.$rendered_type?(l==t.config.types.project?d.$no_end=d.$no_start=!0:l!=t.config.types.milestone&&(d.$no_end=!(s.end_date||s.duration),d.$no_start=!s.start_date,t._isAllowedUnscheduledTask(s)&&(d.$no_end=d.$no_start=!1)),d):(d.$no_start=s.$no_start,d.$no_end=s.$no_end,d)};function i(s){s.$effective_calendar=t.getTaskCalendar(s).id,s.start_date=t.getClosestWorkTime({dir:"future",date:s.start_date,unit:t.config.duration_unit,task:s}),s.end_date=t.calculateEndDate(s)}function a(s,o,l,d){const c={start:"start_date",end:"end_date"},u={start:"$auto_start_date",end:"$auto_end_date"};let h;h=s.type===t.config.types.project&&s.auto_scheduling===!1?u:c,o.$no_start&&(s[h.start]=l?new Date(l):e(s,this.getParent(s))),o.$no_end&&(s[h.end]=d?new Date(d):this.calculateEndDate({start_date:s[h.start],duration:this.config.duration_step,task:s})),(o.$no_start||o.$no_end)&&this._init_task_timing(s)}function r(s){var o=null,l=null,d=s!==void 0?s:t.config.root_id,c=[];return t.eachTask(function(u){const h=t.getTaskType(u.type)==t.config.types.project&&u.auto_scheduling===!1;t.getTaskType(u.type)==t.config.types.project&&!h||t.isUnscheduledTask(u)||(u.rollup&&c.push(u.id),!u.start_date||u.$no_start&&!h||o&&!(o>u.start_date.valueOf())||(o=u.start_date.valueOf()),!u.end_date||u.$no_end&&!h||l&&!(ltask="+s+" of gantt.isSummaryTask. Task object was expected");var o=n(s);return!(!o.$no_end&&!o.$no_start)},t.resetProjectDates=function(s){var o=n(s);if(o.$no_end||o.$no_start){var l=r(s.id);a.call(this,s,o,l.start_date,l.end_date),s.$rollup=l.rollup}},t.getSubtaskDuration=function(s){var o=0,l=s!==void 0?s:t.config.root_id;return this.eachTask(function(d){this.getTaskType(d.type)==t.config.types.project||this.isUnscheduledTask(d)||(o+=d.duration)},l),o},t.getSubtaskDates=function(s){var o=r(s);return{start_date:o.start_date,end_date:o.end_date}},t._update_parents=function(s,o,l){if(s){var d=this.getTask(s);d.rollup&&(l=!0);var c=this.getParent(d),u=n(d),h=!0;if(l||d.start_date&&d.end_date&&(u.$no_start||u.$no_end)){const y=d.$auto_start_date?"$auto_start_date":"start_date",v=d.$auto_end_date?"$auto_end_date":"end_date";var g=d[y].valueOf(),f=d[v].valueOf();t.resetProjectDates(d),l||g!=d[y].valueOf()||f!=d[v].valueOf()||(h=!1),h&&!o&&this.refreshTask(d.id,!0),u.scheduled_summary&&(h=!0)}h&&c&&this.isTaskExists(c)&&this._update_parents(c,o,l)}},t.roundDate=function(s){var o=t.getScale();X(s)&&(s={date:s,unit:o?o.unit:t.config.duration_unit,step:o?o.step:t.config.duration_step});var l,d,c,u=s.date,h=s.step,g=s.unit;if(!o)return u;if(g==o.unit&&h==o.step&&+u>=+o.min_date&&+u<=+o.max_date)c=Math.floor(t.columnIndexByDate(u)),o.trace_x[c]||(c-=1,o.rtl&&(c=0)),d=new Date(o.trace_x[c]),l=t.date.add(d,h,g);else{for(c=Math.floor(t.columnIndexByDate(u)),l=t.date[g+"_start"](new Date(o.min_date)),o.trace_x[c]&&(l=t.date[g+"_start"](o.trace_x[c]));+l<+u;){var f=(l=t.date[g+"_start"](t.date.add(l,h,g))).getTimezoneOffset();l=t._correct_dst_change(l,f,l,g),t.date[g+"_start"]&&(l=t.date[g+"_start"](l))}d=t.date.add(l,-1*h,g)}return s.dir&&s.dir=="future"?l:s.dir&&s.dir=="past"||Math.abs(u-d)3600&&d<86400){var c=r.getTimezoneOffset()-s;c&&(r=t.date.add(r,c,"minute"))}return r},t.isSplitTask=function(r){return t.assert(r&&r instanceof Object,"Invalid argument task="+r+" of gantt.isSplitTask. Task object was expected"),this.$data.tasksStore._isSplitItem(r)},t._is_icon_open_click=function(r){if(!r)return!1;var s=r.target||r.srcElement;if(!s||!s.className)return!1;var o=K(s);return o.indexOf("gantt_tree_icon")!==-1&&(o.indexOf("gantt_close")!==-1||o.indexOf("gantt_open")!==-1)}}const Si={date:{month_full:["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],month_short:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],day_full:["الأحد","الأثنين","ألثلاثاء","الأربعاء","ألحميس","ألجمعة","السبت"],day_short:["احد","اثنين","ثلاثاء","اربعاء","خميس","جمعة","سبت"]},labels:{new_task:"مهمة جديد",icon_save:"اخزن",icon_cancel:"الغاء",icon_details:"تفاصيل",icon_edit:"تحرير",icon_delete:"حذف",confirm_closing:"التغييرات سوف تضيع, هل انت متأكد؟",confirm_deleting:"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟",section_description:"الوصف",section_time:"الفترة الزمنية",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"الغاء",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ti={date:{month_full:["Студзень","Люты","Сакавік","Красавік","Maй","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],month_short:["Студз","Лют","Сак","Крас","Maй","Чэр","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],day_full:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"],day_short:["Нд","Пн","Аўт","Ср","Чцв","Пт","Сб"]},labels:{new_task:"Новае заданне",icon_save:"Захаваць",icon_cancel:"Адмяніць",icon_details:"Дэталі",icon_edit:"Змяніць",icon_delete:"Выдаліць",confirm_closing:"",confirm_deleting:"Падзея будзе выдалена незваротна, працягнуць?",section_description:"Апісанне",section_time:"Перыяд часу",section_type:"Тып",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"ІСР",column_text:"Задача",column_start_date:"Пачатак",column_duration:"Працяг",column_add:"",link:"Сувязь",confirm_link_deleting:"будзе выдалена",link_start:"(пачатак)",link_end:"(канец)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Хвiлiна",hours:"Гадзiна",days:"Дзень",weeks:"Тыдзень",months:"Месяц",years:"Год",message_ok:"OK",message_cancel:"Адмяніць",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ci={date:{month_full:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],month_short:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],day_full:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],day_short:["Dg","Dl","Dm","Dc","Dj","Dv","Ds"]},labels:{new_task:"Nova tasca",icon_save:"Guardar",icon_cancel:"Cancel·lar",icon_details:"Detalls",icon_edit:"Editar",icon_delete:"Esborrar",confirm_closing:"",confirm_deleting:"L'esdeveniment s'esborrarà definitivament, continuar ?",section_description:"Descripció",section_time:"Periode de temps",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Cancel·lar",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ei={date:{month_full:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],month_short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],day_full:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],day_short:["日","一","二","三","四","五","六"]},labels:{new_task:"新任務",icon_save:"保存",icon_cancel:"关闭",icon_details:"详细",icon_edit:"编辑",icon_delete:"删除",confirm_closing:"请确认是否撤销修改!",confirm_deleting:"是否删除日程?",section_description:"描述",section_time:"时间范围",section_type:"类型",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"工作分解结构",column_text:"任务名",column_start_date:"开始时间",column_duration:"持续时间",column_add:"",link:"关联",confirm_link_deleting:"将被删除",link_start:" (开始)",link_end:" (结束)",type_task:"任务",type_project:"项目",type_milestone:"里程碑",minutes:"分钟",hours:"小时",days:"天",weeks:"周",months:"月",years:"年",message_ok:"OK",message_cancel:"关闭",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Di={date:{month_full:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],month_short:["Led","Ún","Bře","Dub","Kvě","Čer","Čec","Srp","Září","Říj","List","Pro"],day_full:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],day_short:["Ne","Po","Út","St","Čt","Pá","So"]},labels:{new_task:"Nová práce",icon_save:"Uložit",icon_cancel:"Zpět",icon_details:"Detail",icon_edit:"Edituj",icon_delete:"Smazat",confirm_closing:"",confirm_deleting:"Událost bude trvale smazána, opravdu?",section_description:"Poznámky",section_time:"Doba platnosti",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Zpět",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ai={date:{month_full:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny opgave",icon_save:"Gem",icon_cancel:"Fortryd",icon_details:"Detaljer",icon_edit:"Tilret",icon_delete:"Slet",confirm_closing:"Dine rettelser vil gå tabt.. Er dy sikker?",confirm_deleting:"Bigivenheden vil blive slettet permanent. Er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Fortryd",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ii={date:{month_full:[" Januar"," Februar"," März "," April"," Mai"," Juni"," Juli"," August"," September "," Oktober"," November "," Dezember"],month_short:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],day_full:["Sonntag","Montag","Dienstag"," Mittwoch"," Donnerstag","Freitag","Samstag"],day_short:["So","Mo","Di","Mi","Do","Fr","Sa"]},labels:{new_task:"Neue Aufgabe",icon_save:"Speichern",icon_cancel:"Abbrechen",icon_details:"Details",icon_edit:"Ändern",icon_delete:"Löschen",confirm_closing:"",confirm_deleting:"Der Eintrag wird gelöscht",section_description:"Beschreibung",section_time:"Zeitspanne",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"PSP",column_text:"Task-Namen",column_start_date:"Startzeit",column_duration:"Dauer",column_add:"",link:"Link",confirm_link_deleting:"werden gelöscht",link_start:"(starten)",link_end:"(ende)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minuten",hours:"Stunden",days:"Tage",weeks:"Wochen",months:"Monate",years:"Jahre",message_ok:"OK",message_cancel:"Abbrechen",section_constraint:"Regel",constraint_type:"Regel",constraint_date:"Regel - Datum",asap:"So bald wie möglich",alap:"So spät wie möglich",snet:"Beginn nicht vor",snlt:"Beginn nicht später als",fnet:"Fertigstellung nicht vor",fnlt:"Fertigstellung nicht später als",mso:"Muss beginnen am",mfo:"Muss fertig sein am",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Mi={date:{month_full:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάϊος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],month_short:["ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥΝ","ΙΟΥΛ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ"],day_full:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Κυριακή"],day_short:["ΚΥ","ΔΕ","ΤΡ","ΤΕ","ΠΕ","ΠΑ","ΣΑ"]},labels:{new_task:"Νέα εργασία",icon_save:"Αποθήκευση",icon_cancel:"Άκυρο",icon_details:"Λεπτομέρειες",icon_edit:"Επεξεργασία",icon_delete:"Διαγραφή",confirm_closing:"",confirm_deleting:"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;",section_description:"Περιγραφή",section_time:"Χρονική περίοδος",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Άκυρο",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ni={date:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},labels:{new_task:"New task",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details",icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Task will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Cancel",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Li={date:{month_full:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],month_short:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],day_full:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],day_short:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"]},labels:{new_task:"Nueva tarea",icon_save:"Guardar",icon_cancel:"Cancelar",icon_details:"Detalles",icon_edit:"Editar",icon_delete:"Eliminar",confirm_closing:"",confirm_deleting:"El evento se borrará definitivamente, ¿continuar?",section_description:"Descripción",section_time:"Período",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"EDT",column_text:"Tarea",column_start_date:"Inicio",column_duration:"Duración",column_add:"",link:"Enlace",confirm_link_deleting:"será borrada",link_start:" (inicio)",link_end:" (fin)",type_task:"Tarea",type_project:"Proyecto",type_milestone:"Hito",minutes:"Minutos",hours:"Horas",days:"Días",weeks:"Semanas",months:"Meses",years:"Años",message_ok:"OK",message_cancel:"Cancelar",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Pi={date:{month_full:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],month_short:["1","2","3","4","5","6","7","8","9","10","11","12"],day_full:["يکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],day_short:["ی","د","س","چ","پ","ج","ش"]},labels:{new_task:"وظیفه جدید",icon_save:"ذخیره",icon_cancel:"لغو",icon_details:"جزییات",icon_edit:"ویرایش",icon_delete:"حذف",confirm_closing:"تغییرات شما ازدست خواهد رفت، آیا مطمئن هستید؟",confirm_deleting:"این مورد برای همیشه حذف خواهد شد، آیا مطمئن هستید؟",section_description:"توضیحات",section_time:"مدت زمان",section_type:"نوع",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"عنوان",column_start_date:"زمان شروع",column_duration:"مدت",column_add:"",link:"ارتباط",confirm_link_deleting:"حذف خواهد شد",link_start:" (آغاز)",link_end:" (پایان)",type_task:"وظیفه",type_project:"پروژه",type_milestone:"نگارش",minutes:"دقایق",hours:"ساعات",days:"روزها",weeks:"هفته",months:"ماه‌ها",years:"سال‌ها",message_ok:"تایید",message_cancel:"لغو",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ri={date:{month_full:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],month_short:["Tam","Hel","Maa","Huh","Tou","Kes","Hei","Elo","Syy","Lok","Mar","Jou"],day_full:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],day_short:["Su","Ma","Ti","Ke","To","Pe","La"]},labels:{new_task:"Uusi tehtävä",icon_save:"Tallenna",icon_cancel:"Peru",icon_details:"Tiedot",icon_edit:"Muokkaa",icon_delete:"Poista",confirm_closing:"",confirm_deleting:"Haluatko varmasti poistaa tapahtuman?",section_description:"Kuvaus",section_time:"Aikajakso",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Peru",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Hi={date:{month_full:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],month_short:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aoû","Sep","Oct","Nov","Déc"],day_full:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],day_short:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"]},labels:{new_task:"Nouvelle tâche",icon_save:"Enregistrer",icon_cancel:"Annuler",icon_details:"Détails",icon_edit:"Modifier",icon_delete:"Effacer",confirm_closing:"",confirm_deleting:"L'événement sera effacé sans appel, êtes-vous sûr ?",section_description:"Description",section_time:"Période",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"OTP",column_text:"Nom de la tâche",column_start_date:"Date initiale",column_duration:"Durée",column_add:"",link:"Le lien",confirm_link_deleting:"sera supprimé",link_start:"(début)",link_end:"(fin)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Heures",days:"Jours",weeks:"Semaines",months:"Mois",years:"Années",message_ok:"OK",message_cancel:"Annuler",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Oi={date:{month_full:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],month_short:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],day_full:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],day_short:["א","ב","ג","ד","ה","ו","ש"]},labels:{new_task:"משימה חדש",icon_save:"שמור",icon_cancel:"בטל",icon_details:"פרטים",icon_edit:"ערוך",icon_delete:"מחק",confirm_closing:"",confirm_deleting:"ארוע ימחק סופית.להמשיך?",section_description:"הסבר",section_time:"תקופה",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"בטל",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Bi={date:{month_full:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],month_short:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],day_full:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],day_short:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"]},labels:{new_task:"Novi Zadatak",icon_save:"Spremi",icon_cancel:"Odustani",icon_details:"Detalji",icon_edit:"Izmjeni",icon_delete:"Obriši",confirm_closing:"",confirm_deleting:"Zadatak će biti trajno izbrisan, jeste li sigurni?",section_description:"Opis",section_time:"Vremenski Period",section_type:"Tip",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Naziv Zadatka",column_start_date:"Početno Vrijeme",column_duration:"Trajanje",column_add:"",link:"Poveznica",confirm_link_deleting:"će biti izbrisan",link_start:" (početak)",link_end:" (kraj)",type_task:"Zadatak",type_project:"Projekt",type_milestone:"Milestone",minutes:"Minute",hours:"Sati",days:"Dani",weeks:"Tjedni",months:"Mjeseci",years:"Godine",message_ok:"OK",message_cancel:"Odustani",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},zi={date:{month_full:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],month_short:["Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],day_full:["Vasárnap","Hétfõ","Kedd","Szerda","Csütörtök","Péntek","szombat"],day_short:["Va","Hé","Ke","Sze","Csü","Pé","Szo"]},labels:{new_task:"Új feladat",icon_save:"Mentés",icon_cancel:"Mégse",icon_details:"Részletek",icon_edit:"Szerkesztés",icon_delete:"Törlés",confirm_closing:"",confirm_deleting:"Az esemény törölve lesz, biztosan folytatja?",section_description:"Leírás",section_time:"Idõszak",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Mégse",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Wi={date:{month_full:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],day_full:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],day_short:["Ming","Sen","Sel","Rab","Kam","Jum","Sab"]},labels:{new_task:"Tugas baru",icon_save:"Simpan",icon_cancel:"Batal",icon_details:"Detail",icon_edit:"Edit",icon_delete:"Hapus",confirm_closing:"",confirm_deleting:"Acara akan dihapus",section_description:"Keterangan",section_time:"Periode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Batal",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ji={date:{month_full:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],month_short:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],day_full:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],day_short:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"]},labels:{new_task:"Nuovo compito",icon_save:"Salva",icon_cancel:"Chiudi",icon_details:"Dettagli",icon_edit:"Modifica",icon_delete:"Elimina",confirm_closing:"",confirm_deleting:"Sei sicuro di confermare l'eliminazione?",section_description:"Descrizione",section_time:"Periodo di tempo",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Nome Attività",column_start_date:"Inizio",column_duration:"Durata",column_add:"",link:"Link",confirm_link_deleting:"sarà eliminato",link_start:" (inizio)",link_end:" (fine)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minuti",hours:"Ore",days:"Giorni",weeks:"Settimane",months:"Mesi",years:"Anni",message_ok:"OK",message_cancel:"Chiudi",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Fi={date:{month_full:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],month_short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],day_full:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],day_short:["日","月","火","水","木","金","土"]},labels:{new_task:"新しい仕事",icon_save:"保存",icon_cancel:"キャンセル",icon_details:"詳細",icon_edit:"編集",icon_delete:"削除",confirm_closing:"",confirm_deleting:"イベント完全に削除されます、宜しいですか?",section_description:"デスクリプション",section_time:"期間",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"キャンセル",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Vi={date:{month_full:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],month_short:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],day_full:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],day_short:["일","월","화","수","목","금","토"]},labels:{new_task:"이름없는 작업",icon_save:"저장",icon_cancel:"취소",icon_details:"세부 사항",icon_edit:"수정",icon_delete:"삭제",confirm_closing:"",confirm_deleting:"작업을 삭제하시겠습니까?",section_description:"설명",section_time:"기간",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"작업명",column_start_date:"시작일",column_duration:"기간",column_add:"",link:"전제",confirm_link_deleting:"삭제 하시겠습니까?",link_start:" (start)",link_end:" (end)",type_task:"작업",type_project:"프로젝트",type_milestone:"마일스톤",minutes:"분",hours:"시간",days:"일",weeks:"주",months:"달",years:"년",message_ok:"OK",message_cancel:"취소",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}};class Ui{constructor(e){this.addLocale=(n,i)=>{this._locales[n]=i},this.getLocale=n=>this._locales[n],this._locales={};for(const n in e)this._locales[n]=e[n]}}const qi={date:{month_full:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Mon","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny oppgave",icon_save:"Lagre",icon_cancel:"Avbryt",icon_details:"Detaljer",icon_edit:"Rediger",icon_delete:"Slett",confirm_closing:"",confirm_deleting:"Hendelsen vil bli slettet permanent. Er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Gi={date:{month_full:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],month_short:["Jan","Feb","mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],day_short:["Zo","Ma","Di","Wo","Do","Vr","Za"]},labels:{new_task:"Nieuwe taak",icon_save:"Opslaan",icon_cancel:"Annuleren",icon_details:"Details",icon_edit:"Bewerken",icon_delete:"Verwijderen",confirm_closing:"",confirm_deleting:"Item zal permanent worden verwijderd, doorgaan?",section_description:"Beschrijving",section_time:"Tijd periode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Taak omschrijving",column_start_date:"Startdatum",column_duration:"Duur",column_add:"",link:"Koppeling",confirm_link_deleting:"zal worden verwijderd",link_start:" (start)",link_end:" (eind)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"minuten",hours:"uren",days:"dagen",weeks:"weken",months:"maanden",years:"jaren",message_ok:"OK",message_cancel:"Annuleren",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Yi={date:{month_full:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny oppgave",icon_save:"Lagre",icon_cancel:"Avbryt",icon_details:"Detaljer",icon_edit:"Endre",icon_delete:"Slett",confirm_closing:"Endringer blir ikke lagret, er du sikker?",confirm_deleting:"Oppføringen vil bli slettet, er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ji={date:{month_full:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],month_short:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],day_full:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],day_short:["Nie","Pon","Wto","Śro","Czw","Pią","Sob"]},labels:{new_task:"Nowe zadanie",icon_save:"Zapisz",icon_cancel:"Anuluj",icon_details:"Szczegóły",icon_edit:"Edytuj",icon_delete:"Usuń",confirm_closing:"",confirm_deleting:"Zdarzenie zostanie usunięte na zawsze, kontynuować?",section_description:"Opis",section_time:"Okres czasu",section_type:"Typ",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Nazwa zadania",column_start_date:"Początek",column_duration:"Czas trwania",column_add:"",link:"Link",confirm_link_deleting:"zostanie usunięty",link_start:" (początek)",link_end:" (koniec)",type_task:"Zadanie",type_project:"Projekt",type_milestone:"Milestone",minutes:"Minuty",hours:"Godziny",days:"Dni",weeks:"Tydzień",months:"Miesiące",years:"Lata",message_ok:"OK",message_cancel:"Anuluj",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ki={date:{month_full:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],month_short:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],day_full:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],day_short:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]},labels:{new_task:"Nova tarefa",icon_save:"Salvar",icon_cancel:"Cancelar",icon_details:"Detalhes",icon_edit:"Editar",icon_delete:"Excluir",confirm_closing:"",confirm_deleting:"As tarefas serão excluidas permanentemente, confirme?",section_description:"Descrição",section_time:"Período",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"EAP",column_text:"Nome tarefa",column_start_date:"Data início",column_duration:"Duração",column_add:"",link:"Link",confirm_link_deleting:"Será excluído!",link_start:" (início)",link_end:" (fim)",type_task:"Task",type_project:"Projeto",type_milestone:"Marco",minutes:"Minutos",hours:"Horas",days:"Dias",weeks:"Semanas",months:"Meses",years:"Anos",message_ok:"OK",message_cancel:"Cancelar",section_constraint:"Restrição",constraint_type:"Tipo Restrição",constraint_date:"Data restrição",asap:"Mais breve possível",alap:"Mais tarde possível",snet:"Não começar antes de",snlt:"Não começar depois de",fnet:"Não terminar antes de",fnlt:"Não terminar depois de",mso:"Precisa começar em",mfo:"Precisa terminar em",resources_filter_placeholder:"Tipo de filtros",resources_filter_label:"Ocultar vazios",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Xi={date:{month_full:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","November","December"],month_short:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],day_full:["Duminica","Luni","Marti","Miercuri","Joi","Vineri","Sambata"],day_short:["Du","Lu","Ma","Mi","Jo","Vi","Sa"]},labels:{new_task:"Sarcina noua",icon_save:"Salveaza",icon_cancel:"Anuleaza",icon_details:"Detalii",icon_edit:"Editeaza",icon_delete:"Sterge",confirm_closing:"Schimbarile nu vor fi salvate, esti sigur?",confirm_deleting:"Evenimentul va fi sters permanent, esti sigur?",section_description:"Descriere",section_time:"Interval",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Anuleaza",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Zi={date:{month_full:["Январь","Февраль","Март","Апрель","Maй","Июнь","Июль","Август","Сентябрь","Oктябрь","Ноябрь","Декабрь"],month_short:["Янв","Фев","Maр","Aпр","Maй","Июн","Июл","Aвг","Сен","Окт","Ноя","Дек"],day_full:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],day_short:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"]},labels:{new_task:"Новое задание",icon_save:"Сохранить",icon_cancel:"Отменить",icon_details:"Детали",icon_edit:"Изменить",icon_delete:"Удалить",confirm_closing:"",confirm_deleting:"Событие будет удалено безвозвратно, продолжить?",section_description:"Описание",section_time:"Период времени",section_type:"Тип",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"ИСР",column_text:"Задача",column_start_date:"Начало",column_duration:"Длительность",column_add:"",link:"Связь",confirm_link_deleting:"будет удалена",link_start:" (начало)",link_end:" (конец)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Минута",hours:"Час",days:"День",weeks:"Неделя",months:"Месяц",years:"Год",message_ok:"OK",message_cancel:"Отменить",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"начните вводить слово для фильтрации",resources_filter_label:"спрятать не установленные",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Qi={date:{month_full:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],day_short:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"]},labels:{new_task:"Nova naloga",icon_save:"Shrani",icon_cancel:"Prekliči",icon_details:"Podrobnosti",icon_edit:"Uredi",icon_delete:"Izbriši",confirm_closing:"",confirm_deleting:"Dogodek bo izbrisan. Želite nadaljevati?",section_description:"Opis",section_time:"Časovni okvir",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Prekliči",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ta={date:{month_full:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],month_short:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sept","Okt","Nov","Dec"],day_full:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],day_short:["Ne","Po","Ut","St","Št","Pi","So"]},labels:{new_task:"Nová úloha",icon_save:"Uložiť",icon_cancel:"Späť",icon_details:"Detail",icon_edit:"Edituj",icon_delete:"Zmazať",confirm_closing:"Vaše zmeny nebudú uložené. Skutočne?",confirm_deleting:"Udalosť bude natrvalo vymazaná. Skutočne?",section_description:"Poznámky",section_time:"Doba platnosti",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Späť",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ea={date:{month_full:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],day_short:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},labels:{new_task:"Ny uppgift",icon_save:"Spara",icon_cancel:"Avbryt",icon_details:"Detajer",icon_edit:"Ändra",icon_delete:"Ta bort",confirm_closing:"",confirm_deleting:"Är du säker på att du vill ta bort händelsen permanent?",section_description:"Beskrivning",section_time:"Tid",section_type:"Typ",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Uppgiftsnamn",column_start_date:"Starttid",column_duration:"Varaktighet",column_add:"",link:"Länk",confirm_link_deleting:"kommer tas bort",link_start:" (start)",link_end:" (slut)",type_task:"Uppgift",type_project:"Projekt",type_milestone:"Milstolpe",minutes:"Minuter",hours:"Timmar",days:"Dagar",weeks:"Veckor",months:"Månader",years:"År",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},na={date:{month_full:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],month_short:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],day_full:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],day_short:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},labels:{new_task:"Yeni görev",icon_save:"Kaydet",icon_cancel:"İptal",icon_details:"Detaylar",icon_edit:"Düzenle",icon_delete:"Sil",confirm_closing:"",confirm_deleting:"Görev silinecek, emin misiniz?",section_description:"Açıklama",section_time:"Zaman Aralığı",section_type:"Tip",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Görev Adı",column_start_date:"Başlangıç",column_duration:"Süre",column_add:"",link:"Bağlantı",confirm_link_deleting:"silinecek",link_start:" (başlangıç)",link_end:" (bitiş)",type_task:"Görev",type_project:"Proje",type_milestone:"Kilometretaşı",minutes:"Dakika",hours:"Saat",days:"Gün",weeks:"Hafta",months:"Ay",years:"Yıl",message_ok:"OK",message_cancel:"Ýptal",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ia={date:{month_full:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],month_short:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],day_full:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"],day_short:["Нед","Пон","Вів","Сер","Чет","Птн","Суб"]},labels:{new_task:"Нове завдання",icon_save:"Зберегти",icon_cancel:"Відміна",icon_details:"Деталі",icon_edit:"Редагувати",icon_delete:"Вилучити",confirm_closing:"",confirm_deleting:"Подія вилучиться назавжди. Ви впевнені?",section_description:"Опис",section_time:"Часовий проміжок",section_type:"Тип",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Відміна",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}};function aa(){this.constants=Fn,this.version="9.0.1",this.license="gpl",this.templates={},this.ext={},this.keys={edit_save:this.constants.KEY_CODES.ENTER,edit_cancel:this.constants.KEY_CODES.ESC}}function ra(t){var e=new aa,n=new Vn(t),i={};e.plugins=function(l){for(var d in l)if(l[d]&&!i[d]){var c=n.getExtension(d);c&&(c(e),i[d]=!0)}return i},e.$services=function(){var l={};return{services:{},setService:function(d,c){l[d]=c},getService:function(d){return l[d]?l[d]():null},dropService:function(d){l[d]&&delete l[d]},destructor:function(){for(var d in l)if(l[d]){var c=l[d];c&&c.destructor&&c.destructor()}l=null}}}(),e.config=Un(),e.ajax=function(l){return{cache:!0,method:"get",parse:function(d){return typeof d!="string"?d:(d=d.replace(/^[\s]+/,""),typeof DOMParser>"u"||_t.isIE?dt.ActiveXObject!==void 0&&((c=new dt.ActiveXObject("Microsoft.XMLDOM")).async="false",c.loadXML(d)):c=new DOMParser().parseFromString(d,"text/xml"),c);var c},xmltop:function(d,c,u){if(c.status===void 0||c.status<400){var h=c.responseXML?c.responseXML||c:this.parse(c.responseText||c);if(h&&h.documentElement!==null&&!h.getElementsByTagName("parsererror").length)return h.getElementsByTagName(d)[0]}return u!==-1&&l.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],u]),document.createElement("DIV")},xpath:function(d,c){if(c.nodeName||(c=c.responseXML||c),_t.isIE)return c.selectNodes(d)||[];for(var u,h=[],g=(c.ownerDocument||c).evaluate(d,c,null,XPathResult.ANY_TYPE,null);u=g.iterateNext();)h.push(u);return h},query:function(d){return this._call(d.method||"GET",d.url,d.data||"",d.async||!0,d.callback,d.headers)},get:function(d,c,u){var h=$t("GET",arguments);return this.query(h)},getSync:function(d,c){var u=$t("GET",arguments);return u.async=!1,this.query(u)},put:function(d,c,u,h){var g=$t("PUT",arguments);return this.query(g)},del:function(d,c,u){var h=$t("DELETE",arguments);return this.query(h)},post:function(d,c,u,h){arguments.length==1?c="":arguments.length==2&&typeof c=="function"&&(u=c,c="");var g=$t("POST",arguments);return this.query(g)},postSync:function(d,c,u){c=c===null?"":String(c);var h=$t("POST",arguments);return h.async=!1,this.query(h)},_call:function(d,c,u,h,g,f){return new l.Promise(function(y,v){var b=typeof XMLHttpRequest!==void 0?new XMLHttpRequest:new dt.ActiveXObject("Microsoft.XMLHTTP"),_=navigator.userAgent.match(/AppleWebKit/)!==null&&navigator.userAgent.match(/Qt/)!==null&&navigator.userAgent.match(/Safari/)!==null;h&&(b.onreadystatechange=function(){if(b.readyState==4||_&&b.readyState==3){if((b.status!=200||b.responseText==="")&&!l.callEvent("onAjaxError",[b]))return;setTimeout(function(){typeof g=="function"&&g.apply(dt,[{xmlDoc:b,filePath:c}]),y(b),typeof g=="function"&&(g=null,b=null)},0)}});var m=!this||!this.cache;if(d=="GET"&&m&&(c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"),b.open(d,c,h),f)for(var p in f)b.setRequestHeader(p,f[p]);else d.toUpperCase()=="POST"||d=="PUT"||d=="DELETE"?b.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):d=="GET"&&(u=null);if(b.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.send(u),!h)return{xmlDoc:b,filePath:c}})},urlSeparator:function(d){return d.indexOf("?")!=-1?"&":"?"}}}(e),e.date=qn(e),e.RemoteEvents=Yn;var a=function(l){function d(u){return{target:u.target||u.srcElement,pageX:u.pageX,pageY:u.pageY,clientX:u.clientX,clientY:u.clientY,metaKey:u.metaKey,shiftKey:u.shiftKey,ctrlKey:u.ctrlKey,altKey:u.altKey}}function c(u,h){this._obj=u,this._settings=h||{},it(this);var g=this.getInputMethods();this._drag_start_timer=null,l.attachEvent("onGanttScroll",R(function(v,b){this.clearDragTimer()},this));for(var f={passive:!1},y=0;ythis.config.sensitivity},initDnDMarker:function(){var u=this.config.marker=document.createElement("div");u.className="gantt_drag_marker",u.innerHTML="",document.body.appendChild(u)},backupEventTarget:function(u,h){if(l.config.touch){var g=h(u),f=g.target||g.srcElement,y=f.cloneNode(!0);this.config.original_target=d(g),this.config.original_target.target=y,this.config.backup_element=f,f.parentNode.appendChild(y),f.style.display="none",(this.config.mousemoveContainer||document.body).appendChild(f)}},getInputMethods:function(){var u=[];if(u.push({move:"mousemove",down:"mousedown",up:"mouseup",accessor:function(g){return g}}),l.config.touch){var h=!0;try{document.createEvent("TouchEvent")}catch{h=!1}h?u.push({move:"touchmove",down:"touchstart",up:"touchend",accessor:function(g){return g.touches&&g.touches.length>1?null:g.touches[0]?{target:document.elementFromPoint(g.touches[0].clientX,g.touches[0].clientY),pageX:g.touches[0].pageX,pageY:g.touches[0].pageY,clientX:g.touches[0].clientX,clientY:g.touches[0].clientY}:g}}):dt.navigator.pointerEnabled?u.push({move:"pointermove",down:"pointerdown",up:"pointerup",accessor:function(g){return g.pointerType=="mouse"?null:g}}):dt.navigator.msPointerEnabled&&u.push({move:"MSPointerMove",down:"MSPointerDown",up:"MSPointerUp",accessor:function(g){return g.pointerType==g.MSPOINTER_TYPE_MOUSE?null:g}})}return u},clearDragTimer:function(){this._drag_start_timer&&(clearTimeout(this._drag_start_timer),this._drag_start_timer=null)},dragStart:function(u,h,g){this.config&&this.config.started||(this.config={obj:u,marker:null,started:!1,pos:this.getPosition(h),sensitivity:4},this._settings&&N(this.config,this._settings,!0),this.traceDragEvents(u,g),l._prevent_touch_scroll=!0,document.body.className+=" gantt_noselect",l.config.touch&&this.dragMove(u,h,g.accessor))},dragMove:function(u,h,g){var f=g(h);if(!f)return!1;if(!this.config.marker&&!this.config.started){var y=this.getPosition(f);if(l.config.touch||this.checkPositionChange(y)){if(this.config.started=!0,this.config.ignore=!1,l._touch_drag=!0,this.callEvent("onBeforeDragStart",[u,this.config.original_target])===!1)return this.config.ignore=!0,!1;this.backupEventTarget(h,g),this.initDnDMarker(),l._touch_feedback(),this.callEvent("onAfterDragStart",[u,this.config.original_target])}else this.config.ignore=!0}return this.config.ignore?!1:h.targetTouches&&!f.target?void 0:(f.pos=this.getPosition(f),this.config.marker.style.left=f.pos.x+"px",this.config.marker.style.top=f.pos.y+"px",this.callEvent("onDragMove",[u,f]),!0)},dragEnd:function(u){var h=this.config.backup_element;h&&h.parentNode&&h.parentNode.removeChild(h),l._prevent_touch_scroll=!1,this.config.marker&&(this.config.marker.parentNode.removeChild(this.config.marker),this.config.marker=null,this.callEvent("onDragEnd",[])),this.config.started=!1,l._touch_drag=!1,document.body.className=document.body.className.replace(" gantt_noselect","")},getPosition:function(u){var h=0,g=0;return u.pageX||u.pageY?(h=u.pageX,g=u.pageY):(u.clientX||u.clientY)&&(h=u.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,g=u.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:h,y:g}}},c}(e);e.$services.setService("dnd",function(){return a});var r=function(l){var d={};function c(u,h,g){g=g||u;var f=l.config,y=l.templates;l.config[u]&&d[g]!=f[u]&&(h&&y[g]||(y[g]=l.date.date_to_str(f[u]),d[g]=f[u]))}return{initTemplates:function(){var u=l.locale.labels;u.gantt_save_btn=u.icon_save,u.gantt_cancel_btn=u.icon_cancel,u.gantt_delete_btn=u.icon_delete;var h=l.date,g=h.date_to_str,f=l.config,y=g(f.xml_date||f.date_format,f.server_utc),v=h.str_to_date(f.xml_date||f.date_format,f.server_utc);c("date_scale",!0,void 0,l.config,l.templates),c("date_grid",!0,"grid_date_format",l.config,l.templates),c("task_date",!0,void 0,l.config,l.templates),l.mixin(l.templates,{xml_format:void 0,format_date:y,xml_date:void 0,parse_date:v,progress_text:function(b,_,m){return""},grid_header_class:function(b,_){return""},task_text:function(b,_,m){return m.text},task_class:function(b,_,m){return""},task_end_date:function(b){return l.templates.task_date(b)},grid_row_class:function(b,_,m){return""},task_row_class:function(b,_,m){return""},timeline_cell_class:function(b,_){return""},timeline_cell_content:function(b,_){return""},scale_cell_class:function(b){return""},scale_row_class:function(b){return""},grid_indent:function(b){return"
"},grid_folder:function(b){return"
"},grid_file:function(b){return"
"},grid_open:function(b){return"
"},grid_blank:function(b){return"
"},date_grid:function(b,_,m){return _&&l.isUnscheduledTask(_)&&l.config.show_unscheduled?l.templates.task_unscheduled_time(_):l.templates.grid_date_format(b,m)},task_time:function(b,_,m){return l.isUnscheduledTask(m)&&l.config.show_unscheduled?l.templates.task_unscheduled_time(m):l.templates.task_date(b)+" - "+l.templates.task_end_date(_)},task_unscheduled_time:function(b){return""},time_picker:g(f.time_picker),link_class:function(b){return""},link_description:function(b){var _=l.getTask(b.source),m=l.getTask(b.target);return""+_.text+""+m.text+""},drag_link:function(b,_,m,p){b=l.getTask(b);var k=l.locale.labels,$=""+b.text+" "+(_?k.link_start:k.link_end)+"
";return m&&($+=" "+(m=l.getTask(m)).text+" "+(p?k.link_start:k.link_end)+"
"),$},drag_link_class:function(b,_,m,p){var k="";return b&&m&&(k=" "+(l.isLinkAllowed(b,m,_,p)?"gantt_link_allow":"gantt_link_deny")),"gantt_link_tooltip"+k},tooltip_date_format:h.date_to_str("%Y-%m-%d"),tooltip_text:function(b,_,m){return`
Task: ${m.text}
+ `}`;e.innerHTML=n},clickEvents:[],attachAddTaskEvent(){const e=t.attachEvent("onEmptyClick",function(n){t.utils.dom.closest(n.target,"[data-empty-state-create-task]")&&t.createTask({id:t.uid(),text:"New Task"})});this.clickEvents.push(e)},detachAddTaskEvents(){this.clickEvents.forEach(function(e){t.detachEvent(e)}),this.clickEvents=[]},getContainer(){if(t.$container){const e=t.utils.dom;if(t.$container.contains(t.$grid_data))return e.closest(t.$grid_data,".gantt_layout_content");if(t.$container.contains(t.$task_data))return e.closest(t.$task_data,".gantt_layout_content")}return null},getNode(){const e=this.getContainer();return e?e.querySelector(".gantt_empty_state_wrapper"):null},show(){const e=this.getContainer();if(!e&&this.isGanttEmpty())return null;const n=document.createElement("div");n.className="gantt_empty_state_wrapper",n.style.marginTop=t.config.scale_height-e.offsetHeight+"px";const i=t.$container.querySelectorAll(".gantt_empty_state_wrapper");Array.prototype.forEach.call(i,function(a){a.parentNode.removeChild(a)}),this.detachAddTaskEvents(),this.attachAddTaskEvent(),e.appendChild(n),this.renderContent(n)},hide(){const e=this.getNode();if(!e)return!1;e.parentNode.removeChild(e)},init(){}},t.attachEvent("onDataRender",function(){const e=t.ext.emptyStateElement;e.isEnabled()&&e.isGanttEmpty()?e.show():e.hide()})}const Xe=function(t,e){const n=e.baselines&&e.baselines.length,i=t.config.baselines.render_mode=="separateRow"||t.config.baselines.render_mode=="individualRow";if(n&&i)return!0},hi=function(t,e){let n=!1;return t.eachTask(function(i){n||(n=Xe(t,i))},e),n},wt=function(t){return t.render&&t.render=="split"&&!t.$open},_i=function(t,e,n,i){let a=i||e.$task_data.scrollHeight,r=!1,s=!1;return t.eachParent(function(o){if(wt(o)){s=!0;const l=e.getItemPosition(o).rowHeight;lr&&(r=o)},a.id),a.row_heighto&&(o=c)}),r.row_height=o,r.bar_height=r.bar_height||s}},a.id)}t.$data.baselineStore=e,t.adjustTaskHeightForBaselines=function(a){let r,s,o=a.baselines&&a.baselines.length||0;const l=t.config.baselines.row_height;switch(t.config.baselines.render_mode){case"taskRow":a.row_height=a.bar_height+4;break;case"separateRow":r=t.getLayoutView("timeline").getBarHeight(a.id),o?(a.bar_height=a.bar_height||r,a.bar_height>r&&(r=a.bar_height),a.row_height=r+l):a.bar_height&&(a.row_height=a.bar_height+4),i(a);break;case"individualRow":r=t.getLayoutView("timeline").getBarHeight(a.id),o?(a.bar_height=a.bar_height||r,a.bar_height>r&&(r=a.bar_height),s=l*o,a.row_height=r+s+2):a.bar_height&&(a.row_height=a.bar_height+4),i(a)}},t.attachEvent("onGanttReady",function(){t.config.baselines!==!1&&(t.attachEvent("onParse",function(){e.eachItem(function(a){const r=a.task_id;if(t.isTaskExists(r)){const s=t.getTask(r);s.baselines=s.baselines||[];let o=!0;for(let l=0;l"+n.xmlDoc.responseURL+", server returns 404");else if(!t.$destroyed){this.callEvent("onBeforeParse",[]),i||(i="json"),this.assert(this[i],"Invalid data type:'"+i+"'");var a=n.xmlDoc.responseText,r=this[i].parse(a,n);this._process_loading(r)}},t._process_loading=function(n){n.collections&&this._load_collections(n.collections),n.resources&&this.$data.resourcesStore&&this.$data.resourcesStore.parse(n.resources),t.config.baselines!==!1&&n.baselines&&this.$data.baselineStore&&this.$data.baselineStore.parse(n.baselines);const i=n.data||n.tasks;n.assignments&&function(r,s){const o={};s.forEach(l=>{o[l.task_id]||(o[l.task_id]=[]),o[l.task_id].push(l)}),r.forEach(l=>{l[t.config.resource_property]=o[l.id]||[]})}(i,n.assignments),this.$data.tasksStore.parse(i);var a=n.links||(n.collections?n.collections.links:[]);this.$data.linksStore.parse(a),this.callEvent("onParse",[]),this.render()},t._load_collections=function(n){var i=!1;for(var a in n)if(n.hasOwnProperty(a)){i=!0;var r=n[a];this.serverList[a]=this.serverList[a]||[];var s=this.serverList[a];if(!s)continue;s.splice(0,s.length);for(var o=0;o"},_copyObject:function(n){return""},serialize:function(){for(var n=[],i=[],a=t.json.serialize(),r=0,s=a.data.length;r"+n.join("")+""+i.join("")+""}},t.oldxml={parse:function(n,i){i=t.xml._getXML(n,i,"projects");for(var a={collections:{links:[]}},r=a.data=[],s=t.ajax.xpath("//task",i),o=0;oe.length?t:e,a=t===i?e:t;i=i.slice(),a=a.slice(),n=[];for(var r=0;rs.start&&(n.push({start:Math.max(s.start,l.start),end:Math.min(s.end,l.end)}),s.end>l.end&&(a.splice(o,1),o--,r--))}return n},_mergeAdjacentIntervals:function(t){var e=t.slice();e.sort(function(r,s){return r.start-s.start});for(var n=e[0],i=1;in.end&&(n.end=a.end),e.splice(i,1),i--):n=a}return e},_mergeHoursConfig:function(t,e){return this._mergeAdjacentIntervals(this._intersectHourRanges(t,e))},merge:function(t,e){var n=V(t.getConfig().parsed),i=V(e.getConfig().parsed),a={hours:this._toHoursArray(this._mergeHoursConfig(n.hours,i.hours)),dates:{},customWeeks:{}};const r=(o,l)=>{for(let d in o.dates){const c=o.dates[d];+d>1e3&&(a.dates[d]=!1);for(const u in l.dates){const h=l.dates[u];if(u==d&&(a.dates[d]=!(!c||!h)),Array.isArray(c)){const g=Array.isArray(h)?h:l.hours;a.dates[d]=this._toHoursArray(this._mergeHoursConfig(c,g))}}}};if(r(n,i),r(i,n),n.customWeeks)for(var s in n.customWeeks)a.customWeeks[s]=n.customWeeks[s];if(i.customWeeks)for(var s in i.customWeeks)a.customWeeks[s]=i.customWeeks[s];return a}};class mi{constructor(){this.clear()}getItem(e,n,i){if(this._cache.has(e)){const a=this._cache.get(e)[i.getFullYear()];if(a&&a.has(n))return a.get(n)}return-1}setItem(e,n,i,a){if(!e||!n)return;const r=this._cache,s=a.getFullYear();let o;r.has(e)?o=r.get(e):(o=[],r.set(e,o));let l=o[s];l||(l=o[s]=new Map),l.set(n,i)}clear(){this._cache=new Map}}class vi{constructor(){this.clear()}getItem(e,n,i){const a=this._cache;if(a&&a[e]){const r=a[e];if(r===void 0)return-1;const s=r[i.getFullYear()];if(s&&s[n]!==void 0)return s[n]}return-1}setItem(e,n,i,a){if(!e||!n)return;const r=this._cache;if(!r)return;r[e]||(r[e]=[]);const s=r[e],o=a.getFullYear();let l=s[o];l||(l=s[o]={}),l[n]=i}clear(){this._cache={}}}class ki{constructor(e){this.getMinutesPerWeek=n=>{const i=n.valueOf();if(this._weekCache.has(i))return this._weekCache.get(i);const a=this._calendar,r=this._calendar.$gantt;let s=0,o=r.date.week_start(new Date(n));for(let l=0;l<7;l++)s+=60*a.getHoursPerDay(o),o=r.date.add(o,1,"day");return this._weekCache.set(i,s),s},this.getMinutesPerMonth=n=>{const i=n.valueOf();if(this._monthCache.has(i))return this._monthCache.get(i);const a=this._calendar,r=this._calendar.$gantt;let s=0,o=r.date.week_start(new Date(n));const l=r.date.add(o,1,"month").valueOf();for(;o.valueOf(){this._weekCache=new Map,this._monthCache=new Map},this.clear(),this._calendar=e}}class yi{constructor(){this.clear()}_getCacheObject(e,n,i){const a=this._cache;a[n]||(a[n]=[]);let r=a[n];r||(r=a[n]={});let s=r[i];s||(s=r[i]={});const o=e.getFullYear();let l=s[o];return l||(l=s[o]={durations:{},endDates:{}}),l}_endDateCacheKey(e,n){return String(e)+"-"+String(n)}_durationCacheKey(e,n){return String(e)+"-"+String(n)}getEndDate(e,n,i,a,r){const s=this._getCacheObject(e,i,a),o=e.valueOf(),l=this._endDateCacheKey(o,n);let d;if(s.endDates[l]===void 0){const c=r(),u=c.valueOf();s.endDates[l]=u,s.durations[this._durationCacheKey(o,u)]=n,d=c}else d=new Date(s.endDates[l]);return d}getDuration(e,n,i,a,r){const s=this._getCacheObject(e,i,a),o=e.valueOf(),l=n.valueOf(),d=this._durationCacheKey(o,l);let c;if(s.durations[d]===void 0){const u=r();s.durations[d]=u.valueOf(),c=u}else c=s.durations[d];return c}clear(){this._cache={}}}function fe(t,e){this.argumentsHelper=e,this.$gantt=t,this._workingUnitsCache=typeof Map<"u"?new mi:new vi,this._largeUnitsCache=new ki(this),this._dateDurationCache=new yi,this._worktime=null,this._cached_timestamps={},this._cached_timestamps_count=0}fe.prototype={units:["year","month","week","day","hour","minute"],_clearCaches:function(){this._workingUnitsCache.clear(),this._largeUnitsCache.clear(),this._dateDurationCache.clear()},_getUnitOrder:function(t){for(var e=0,n=this.units.length;e1e6&&this._resetTimestampCache();var e=null;if(t.day||t.day===0)e=t.day;else if(t.date){var n=String(t.date.valueOf());this._cached_timestamps[n]?e=this._cached_timestamps[n]:(e=Date.UTC(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this._cached_timestamps[n]=e,this._cached_timestamps_count++)}return e},_checkIfWorkingUnit:function(t,e){if(!this["_is_work_"+e]){const n=this.$gantt.date[`${e}_start`](new Date(t)),i=this.$gantt.date.add(n,1,e);return this.hasDuration(n,i)}return this["_is_work_"+e](t)},_is_work_day:function(t){var e=this._getWorkHours(t);return!!Array.isArray(e)&&e.length>0},_is_work_hour:function(t){for(var e=this._getWorkHours(t),n=t.getHours(),i=0;i=e[i].startHour&&n=e[i].start&&ns.valueOf(),this._isWorkTime(r,n))(u||h&&g)&&(o=a[n+"_start"](new Date(r)),l=a.add(o,i,n)),u?(u=!1,c=this._nextDate(o,n,i),d+=(l.valueOf()-r.valueOf())/(l.valueOf()-o.valueOf())):h&&g?(h=!1,d+=(s.valueOf()-r.valueOf())/(l.valueOf()-o.valueOf())):d++;else{var f=this._getUnitOrder(n),y=this.units[f-1];y&&!this._isWorkTime(r,y)&&(c=this._getClosestWorkTimeFuture(r,y))}r=c}return d},_getMinutesPerHour:function(t){var e=this._getTimeOfDayStamp(t),n=this._getTimeOfDayStamp(this._nextDate(t,"hour",1));n===0&&(n=86400);for(var i=this._getWorkHours(t),a=0;a=r.start&&n<=r.end)return 60;if(er.start)return(Math.min(n,r.end)-Math.max(e,r.start))/60}return 0},_getMinutesPerDay:function(t){var e=this._getWorkHours(t),n=0;return e.forEach(function(i){n+=i.durationMinutes}),n},getHoursPerDay:function(t){var e=this._getWorkHours(t),n=0;return e.forEach(function(i){n+=i.durationHours}),n},_getWorkUnitsForRange:function(t,e,n,i){var a,r=0,s=new Date(t),o=new Date(e);for(a=R(n=="minute"?this._getMinutesPerDay:this.getHoursPerDay,this);s.valueOf()27648e5&&s.getDate()===0){var l=this._largeUnitsCache.getMinutesPerMonth(s);n=="hour"&&(l/=60),r+=l,s=this.$gantt.date.add(s,1,"month")}else{if(o-s>13824e5){var d=this.$gantt.date.week_start(new Date(s));if(s.valueOf()===d.valueOf()){l=this._largeUnitsCache.getMinutesPerWeek(s),n=="hour"&&(l/=60),r+=l,s=this.$gantt.date.add(s,7,"day");continue}}r+=a(s),s=this._nextDate(s,"day",1)}return r/i},_getMinutesBetweenSingleDay:function(t,e){for(var n=this._getIntervalTimestamp(t,e),i=this._getWorkHours(t),a=0,r=0;r=s.start&&n.start<=s.end){var o=Math.max(s.start,n.start),l=Math.min(s.end,n.end);a+=(l-o)/60,n.start=l}}return Math.floor(a)},_getMinutesBetween:function(t,e,n,i){var a=new Date(t),r=new Date(e);i=i||1;var s=new Date(a),o=this.$gantt.date.add(this.$gantt.date.day_start(new Date(a)),1,"day");if(r.valueOf()<=o.valueOf())return this._getMinutesBetweenSingleDay(t,e);var l=this.$gantt.date.day_start(new Date(r)),d=r,c=this._getMinutesBetweenSingleDay(s,o),u=this._getMinutesBetweenSingleDay(l,d);return c+this._getWorkUnitsForRange(o,l,n,i)+u},_getHoursBetween:function(t,e,n,i){var a=new Date(t),r=new Date(e);i=i||1;var s=new Date(a),o=this.$gantt.date.add(this.$gantt.date.day_start(new Date(a)),1,"day");if(r.valueOf()<=o.valueOf())return Math.round(this._getMinutesBetweenSingleDay(t,e)/60);var l=this.$gantt.date.day_start(new Date(r)),d=r,c=this._getMinutesBetweenSingleDay(s,o,n,i)/60,u=this._getMinutesBetweenSingleDay(l,d,n,i)/60,h=c+this._getWorkUnitsForRange(o,l,n,i)+u;return Math.round(h)},getConfig:function(){return this._worktime},_setConfig:function(t){this._worktime=t,this._parseSettings(),this._clearCaches()},_parseSettings:function(){var t=this.getConfig();for(var e in t.parsed={dates:{},hours:null,haveCustomWeeks:!1,customWeeks:{},customWeeksRangeStart:null,customWeeksRangeEnd:null,customWeeksBoundaries:[]},t.parsed.hours=this._parseHours(t.hours),t.dates)t.parsed.dates[e]=this._parseHours(t.dates[e]);if(t.customWeeks){var n=null,i=null;for(var e in t.customWeeks){var a=t.customWeeks[e];if(a.from&&a.to){var r=a.from,s=a.to;(!n||n>r.valueOf())&&(n=r.valueOf()),(!i||ii){for(var a=0;ai){n=n.customWeeks[n.customWeeksBoundaries[a].name];break}}var r=!0;return n.dates[i]!==void 0?r=n.dates[i]:n.dates[t.getDay()]!==void 0&&(r=n.dates[t.getDay()]),r===!0?n.hours:r||[]},_getIntervalTimestamp:function(t,e){var n={start:0,end:0};n.start=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds();var i=e.getHours();return!i&&!e.getMinutes()&&!e.getSeconds()&&t.valueOf()e.valueOf()){var s=e;e=t,t=s,r=-1}return a=n=="hour"&&i==1?this._getHoursBetween(t,e,n,i):n=="minute"&&i==1?this._getMinutesBetween(t,e,n,i):this._getWorkUnitsBetweenGeneric(t,e,n,i),r*Math.round(a)},hasDuration:function(){var t=this.argumentsHelper.getDurationArguments.apply(this.argumentsHelper,arguments),e=t.start_date,n=t.end_date,i=t.unit,a=t.step;if(!i)return!1;var r=new Date(e),s=new Date(n);for(a=a||1;r.valueOf()=0?1:-1;n=Math.abs(1*n);var s=this;return this._dateDurationCache.getEndDate(e,n,i,a*r,function(){return s._calculateEndDate(e,n,i,a*r)})},_calculateEndDate:function(t,e,n,i){return!!n&&(i==1&&n=="minute"?this._calculateMinuteEndDate(t,e,i):i==-1&&n=="minute"?this._subtractMinuteDate(t,e,i):i==1&&n=="hour"?this._calculateHourEndDate(t,e,i):this._addInterval(t,e,n,i,null).end)},_addInterval:function(t,e,n,i,a){for(var r=0,s=t,o=!1;r0&&(d=new Date(l.valueOf()-1)),this._isWorkTime(d,n)&&!o&&r++,s=l}return{end:s,start:t,added:r}},_addHoursUntilDayEnd:function(t,e){for(var n=this.$gantt.date.add(this.$gantt.date.day_start(new Date(t)),1,"day"),i=0,a=e,r=this._getIntervalTimestamp(t,n),s=this._getWorkHours(t),o=0;o=l.start&&r.start<=l.end){var d=Math.max(l.start,r.start),c=Math.min(l.end,r.end),u=(c-d)/3600;u>a&&(u=a,c=d+60*a*60);var h=Math.round((c-d)/3600);i+=h,a-=h,r.start=c}}var g=n;return i===e&&(g=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,r.start)),{added:i,end:g}},_calculateHourEndDate:function(t,e,n){var i=new Date(t),a=0;n=n||1,e=Math.abs(1*e);var r=this._addHoursUntilDayEnd(i,e);if(a=r.added,i=r.end,d=e-a){for(var s=i;a0?this.getHoursPerDay(new Date(o.valueOf()-1)):this.getHoursPerDay(new Date(o.valueOf()+1)))>=e)break;a+=l,s=o}i=s}if(a=l.start&&r.start<=l.end){var d=Math.max(l.start,r.start),c=Math.min(l.end,r.end),u=(c-d)/60;u>a&&(u=a,c=d+60*a);var h=Math.round((c-d)/60);a-=h,i+=h,r.start=c}}var g=n;return i===e&&(g=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,r.start)),{added:i,end:g}},_subtractMinutesUntilHourStart:function(t,e){for(var n=this.$gantt.date.hour_start(new Date(t)),i=0,a=e,r=60*n.getHours()*60+60*n.getMinutes()+n.getSeconds(),s=60*t.getHours()*60+60*t.getMinutes()+t.getSeconds(),o=this._getWorkHours(t),l=o.length-1;l>=0&&id.start&&r<=d.end){var c=Math.min(s,d.end),u=Math.max(r,d.start),h=(c-u)/60;h>a&&(h=a,u=c-60*a);var g=Math.abs(Math.round((c-u)/60));a-=g,i+=g,s=u}}var f=n;return i===e&&(f=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,s)),{added:i,end:f}},_subtractMinuteDate:function(t,e,n){var i=new Date(t),a=0;n=n||-1,e=Math.abs(1*e),e=Math.round(e);const r=this._isMinutePrecision(i);let s=this._subtractMinutesUntilHourStart(i,e);a+=s.added,i=s.end;for(var o=0,l=[],d=0;ad)a+=d,i=this.$gantt.date.add(i,-1,"day");else{for(var y=!1,v=null,b=null,_=l.length-1;_>=0;_--)if(l[_].start=f-1){y=!0,v=l[_],b=l[_-1];break}if(y)if(f===v.end&&g>=v.durationMinutes)a+=v.durationMinutes,i=this.$gantt.date.add(i,-v.durationMinutes,"minute");else if(!r&&g<=f/60-v.startMinute)a+=g,i=this.$gantt.date.add(i,-g,"minute");else if(r)g<=f/60-v.startMinute?(a+=g,i=this.$gantt.date.add(i,-g,"minute")):(a+=f/60-v.startMinute,i=b?new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,b.end):this.$gantt.date.day_start(i));else{var m=this._getMinutesPerHour(i);m<=g?(a+=m,i=this._nextDate(i,"hour",n)):(s=this._subtractMinutesUntilHourStart(i,g),a+=s.added,i=s.end)}else if(i.getHours()===0&&i.getMinutes()===0&&i.getSeconds()===0){if((p=this._getClosestWorkTimePast(i,"hour")).valueOf()===i.valueOf()){var p=this.$gantt.date.add(i,-1,"day"),k=this._getWorkHours(p);if(k.length){var $=k[k.length-1];p.setSeconds($.durationSeconds)}}i=p}else i=this._getClosestWorkTimePast(new Date(i-1),"hour")}else i=this.$gantt.date.add(i,-1,"day")}if(a=h&&u>=l){if(a+=l,u==l){i=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,o[o.length-1].end);break}i=this.$gantt.date.add(i,1,"day"),i=this.$gantt.date.day_start(i)}else{for(var g=!1,f=null,y=0;yh){g=!0,f=o[y];break}if(g)if(h===f.start&&u>=f.durationMinutes)a+=f.durationMinutes,i=this.$gantt.date.add(i,f.durationMinutes,"minute");else if(u<=f.endMinute-h/60)a+=u,i=this.$gantt.date.add(i,u,"minute");else{var v=this._getMinutesPerHour(i);v<=u?(a+=v,i=d?this.$gantt.date.add(i,v,"minute"):this._nextDate(i,"hour",n)):(a+=(r=this._addMinutesUntilHourEnd(i,u)).added,i=r.end)}else i=this._getClosestWorkTimeFuture(i,"hour")}else i=this.$gantt.date.add(this.$gantt.date.day_start(i),1,"day")}if(a0){for(var o=0;o=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[o].start);break}}else for(o=n.length-1;o>=0;o--){if(n[o].end<=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,n[o].end);break}if(n[o].end>s&&n[o].start<=s){a=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,s);break}}return a},_getClosestWorkMinute:function(t,e,n){var i=new Date(t),a=this._getWorkHours(i),r=this._findClosestTimeInDay(i,n,a);return r||(i=this.calculateEndDate(i,n,"day"),n>0?i=this.$gantt.date.day_start(i):(i=this.$gantt.date.day_start(i),i=this.$gantt.date.add(i,1,"day"),i=new Date(i.valueOf()-1)),a=this._getWorkHours(i),r=this._findClosestTimeInDay(i,n,a)),n<0&&(r=this.$gantt.date.add(r,-1,e)),r},_getClosestWorkTimeGeneric:function(t,e,n){if(e==="hour"||e==="minute")return this._getClosestWorkMinute(t,e,n);for(var i=this._getUnitOrder(e),a=this.units[i-1],r=t,s=0;!this._isWorkTime(r,e)&&(!a||this._isWorkTime(r,a)||(r=n>0?this._getClosestWorkTimeFuture(r,a):this._getClosestWorkTimePast(r,a),!this._isWorkTime(r,e)));){if(++s>3e3)return this.$gantt.assert(!1,"Invalid working time check"),!1;var o=r.getTimezoneOffset();r=this.$gantt.date.add(r,n,e),r=this.$gantt._correct_dst_change(r,o,n,e),this.$gantt.date[e+"_start"]&&(r=this.$gantt.date[e+"_start"](r))}return r},hasWorkTime:function(){var t=this.getConfig(),e=t.dates;for(var n in t.dates);var i=this._checkWorkHours(t.hours),a=!1;return[0,1,2,3,4,5,6].forEach((function(r){if(!a){var s=e[r];s===!0?a=i:Array.isArray(s)&&(a=this._checkWorkHours(s))}}).bind(this)),a},_checkWorkHours:function(t){if(t.length===0)return!1;for(var e=!1,n=0;ntask="+s+" of gantt.isUnscheduledTask. Task object was expected"),!!s.unscheduled||!s.start_date},t._isAllowedUnscheduledTask=function(s){return!(!s.unscheduled||!t.config.show_unscheduled)},t._isTaskInTimelineLimits=function(s){var o=s.start_date?s.start_date.valueOf():null,l=s.end_date?s.end_date.valueOf():null;return!!(o&&l&&o<=this._max_date.valueOf()&&l>=this._min_date.valueOf())},t.isTaskVisible=function(s){if(!this.isTaskExists(s))return!1;var o=this.getTask(s);return!(!this._isAllowedUnscheduledTask(o)&&!this._isTaskInTimelineLimits(o))&&this.getGlobalTaskIndex(s)>=0},t._getProjectEnd=function(){if(t.config.project_end)return t.config.project_end;var s=t.getTaskByTime();return(s=s.sort(function(o,l){return+o.end_date>+l.end_date?1:-1})).length?s[s.length-1].end_date:null},t._getProjectStart=function(){if(t.config.project_start)return t.config.project_start;if(t.config.start_date)return t.config.start_date;if(t.getState().min_date)return t.getState().min_date;var s=t.getTaskByTime();return(s=s.sort(function(o,l){return+o.start_date>+l.start_date?1:-1})).length?s[0].start_date:null};var e=function(s,o){var l=!!(o&&o!=t.config.root_id&&t.isTaskExists(o))&&t.getTask(o),d=null;if(l)if(t.config.schedule_from_end)d=t.calculateEndDate({start_date:l.end_date,duration:-t.config.duration_step,task:s});else{if(!l.start_date)return e(l,t.getParent(l));d=l.start_date}else if(t.config.schedule_from_end)d=t.calculateEndDate({start_date:t._getProjectEnd(),duration:-t.config.duration_step,task:s});else{const c=t.getTaskByIndex(0),u=t.config.start_date||t.getState().min_date;d=c?c.start_date?c.start_date:c.end_date?t.calculateEndDate({start_date:c.end_date,duration:-t.config.duration_step,task:s}):u:u}return t.assert(d,"Invalid dates"),new Date(d)};t._set_default_task_timing=function(s){s.start_date=s.start_date||e(s,t.getParent(s)),s.duration=s.duration||t.config.duration_step,s.end_date=s.end_date||t.calculateEndDate(s)},t.createTask=function(s,o,l){return s=s||{},t.defined(s.id)||(s.id=t.uid()),s.start_date||(s.start_date=e(s,o)),s.text===void 0&&(s.text=t.locale.labels.new_task),s.duration===void 0&&(s.duration=1),this.isTaskExists(o)&&(this.setParent(s,o,!0),this.getTask(o).$open=!0),this.callEvent("onTaskCreated",[s])?(this.config.details_on_create?(t.isTaskExists(s.id)?t.getTask(s.id).$index!=s.$index&&(s.start_date&&typeof s.start_date=="string"&&(s.start_date=this.date.parseDate(s.start_date,"parse_date")),s.end_date&&typeof s.end_date=="string"&&(s.end_date=this.date.parseDate(s.end_date,"parse_date")),this.$data.tasksStore.updateItem(s.id,s)):(s.$new=!0,this.silent(function(){t.$data.tasksStore.addItem(s,l)})),this.selectTask(s.id),this.refreshData(),this.showLightbox(s.id)):this.addTask(s,o,l)&&(this.showTask(s.id),this.selectTask(s.id)),s.id):null},t._update_flags=function(s,o){var l=t.$data.tasksStore;s===void 0?(this._lightbox_id=null,l.silent(function(){l.unselect()}),this.getSelectedTasks&&this._multiselect.reset(),this._tasks_dnd&&this._tasks_dnd.drag&&(this._tasks_dnd.drag.id=null)):(this._lightbox_id==s&&(this._lightbox_id=o),l.getSelectedId()==s&&l.silent(function(){l.unselect(s),l.select(o)}),this._tasks_dnd&&this._tasks_dnd.drag&&this._tasks_dnd.drag.id==s&&(this._tasks_dnd.drag.id=o))};var n=function(s,o){var l=t.getTaskType(s.type),d={type:l,$no_start:!1,$no_end:!1,scheduled_summary:!1};return l===t.config.types.project&&s.auto_scheduling===!1&&(d.scheduled_summary=!0),o||l!=s.$rendered_type?(l==t.config.types.project?d.$no_end=d.$no_start=!0:l!=t.config.types.milestone&&(d.$no_end=!(s.end_date||s.duration),d.$no_start=!s.start_date,t._isAllowedUnscheduledTask(s)&&(d.$no_end=d.$no_start=!1)),d):(d.$no_start=s.$no_start,d.$no_end=s.$no_end,d)};function i(s){s.$effective_calendar=t.getTaskCalendar(s).id,s.start_date=t.getClosestWorkTime({dir:"future",date:s.start_date,unit:t.config.duration_unit,task:s}),s.end_date=t.calculateEndDate(s)}function a(s,o,l,d){const c={start:"start_date",end:"end_date"},u={start:"$auto_start_date",end:"$auto_end_date"};let h;h=s.type===t.config.types.project&&s.auto_scheduling===!1?u:c,o.$no_start&&(s[h.start]=l?new Date(l):e(s,this.getParent(s))),o.$no_end&&(s[h.end]=d?new Date(d):this.calculateEndDate({start_date:s[h.start],duration:this.config.duration_step,task:s})),(o.$no_start||o.$no_end)&&this._init_task_timing(s)}function r(s){var o=null,l=null,d=s!==void 0?s:t.config.root_id,c=[];return t.eachTask(function(u){const h=t.getTaskType(u.type)==t.config.types.project&&u.auto_scheduling===!1;t.getTaskType(u.type)==t.config.types.project&&!h||t.isUnscheduledTask(u)||(u.rollup&&c.push(u.id),!u.start_date||u.$no_start&&!h||o&&!(o>u.start_date.valueOf())||(o=u.start_date.valueOf()),!u.end_date||u.$no_end&&!h||l&&!(ltask="+s+" of gantt.isSummaryTask. Task object was expected");var o=n(s);return!(!o.$no_end&&!o.$no_start)},t.resetProjectDates=function(s){var o=n(s);if(o.$no_end||o.$no_start){var l=r(s.id);a.call(this,s,o,l.start_date,l.end_date),s.$rollup=l.rollup}},t.getSubtaskDuration=function(s){var o=0,l=s!==void 0?s:t.config.root_id;return this.eachTask(function(d){this.getTaskType(d.type)==t.config.types.project||this.isUnscheduledTask(d)||(o+=d.duration)},l),o},t.getSubtaskDates=function(s){var o=r(s);return{start_date:o.start_date,end_date:o.end_date}},t._update_parents=function(s,o,l){if(s){var d=this.getTask(s);d.rollup&&(l=!0);var c=this.getParent(d),u=n(d),h=!0;if(l||d.start_date&&d.end_date&&(u.$no_start||u.$no_end)){const y=d.$auto_start_date?"$auto_start_date":"start_date",v=d.$auto_end_date?"$auto_end_date":"end_date";var g=d[y].valueOf(),f=d[v].valueOf();t.resetProjectDates(d),l||g!=d[y].valueOf()||f!=d[v].valueOf()||(h=!1),h&&!o&&this.refreshTask(d.id,!0),u.scheduled_summary&&(h=!0)}h&&c&&this.isTaskExists(c)&&this._update_parents(c,o,l)}},t.roundDate=function(s){var o=t.getScale();X(s)&&(s={date:s,unit:o?o.unit:t.config.duration_unit,step:o?o.step:t.config.duration_step});var l,d,c,u=s.date,h=s.step,g=s.unit;if(!o)return u;if(g==o.unit&&h==o.step&&+u>=+o.min_date&&+u<=+o.max_date)c=Math.floor(t.columnIndexByDate(u)),o.trace_x[c]||(c-=1,o.rtl&&(c=0)),d=new Date(o.trace_x[c]),l=t.date.add(d,h,g);else{for(c=Math.floor(t.columnIndexByDate(u)),l=t.date[g+"_start"](new Date(o.min_date)),o.trace_x[c]&&(l=t.date[g+"_start"](o.trace_x[c]));+l<+u;){var f=(l=t.date[g+"_start"](t.date.add(l,h,g))).getTimezoneOffset();l=t._correct_dst_change(l,f,l,g),t.date[g+"_start"]&&(l=t.date[g+"_start"](l))}d=t.date.add(l,-1*h,g)}return s.dir&&s.dir=="future"?l:s.dir&&s.dir=="past"||Math.abs(u-d)3600&&d<86400){var c=r.getTimezoneOffset()-s;c&&(r=t.date.add(r,c,"minute"))}return r},t.isSplitTask=function(r){return t.assert(r&&r instanceof Object,"Invalid argument task="+r+" of gantt.isSplitTask. Task object was expected"),this.$data.tasksStore._isSplitItem(r)},t._is_icon_open_click=function(r){if(!r)return!1;var s=r.target||r.srcElement;if(!s||!s.className)return!1;var o=K(s);return o.indexOf("gantt_tree_icon")!==-1&&(o.indexOf("gantt_close")!==-1||o.indexOf("gantt_open")!==-1)}}const Si={date:{month_full:["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],month_short:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],day_full:["الأحد","الأثنين","ألثلاثاء","الأربعاء","ألحميس","ألجمعة","السبت"],day_short:["احد","اثنين","ثلاثاء","اربعاء","خميس","جمعة","سبت"]},labels:{new_task:"مهمة جديد",icon_save:"اخزن",icon_cancel:"الغاء",icon_details:"تفاصيل",icon_edit:"تحرير",icon_delete:"حذف",confirm_closing:"التغييرات سوف تضيع, هل انت متأكد؟",confirm_deleting:"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟",section_description:"الوصف",section_time:"الفترة الزمنية",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"الغاء",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ti={date:{month_full:["Студзень","Люты","Сакавік","Красавік","Maй","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],month_short:["Студз","Лют","Сак","Крас","Maй","Чэр","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],day_full:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"],day_short:["Нд","Пн","Аўт","Ср","Чцв","Пт","Сб"]},labels:{new_task:"Новае заданне",icon_save:"Захаваць",icon_cancel:"Адмяніць",icon_details:"Дэталі",icon_edit:"Змяніць",icon_delete:"Выдаліць",confirm_closing:"",confirm_deleting:"Падзея будзе выдалена незваротна, працягнуць?",section_description:"Апісанне",section_time:"Перыяд часу",section_type:"Тып",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"ІСР",column_text:"Задача",column_start_date:"Пачатак",column_duration:"Працяг",column_add:"",link:"Сувязь",confirm_link_deleting:"будзе выдалена",link_start:"(пачатак)",link_end:"(канец)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Хвiлiна",hours:"Гадзiна",days:"Дзень",weeks:"Тыдзень",months:"Месяц",years:"Год",message_ok:"OK",message_cancel:"Адмяніць",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ci={date:{month_full:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],month_short:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],day_full:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],day_short:["Dg","Dl","Dm","Dc","Dj","Dv","Ds"]},labels:{new_task:"Nova tasca",icon_save:"Guardar",icon_cancel:"Cancel·lar",icon_details:"Detalls",icon_edit:"Editar",icon_delete:"Esborrar",confirm_closing:"",confirm_deleting:"L'esdeveniment s'esborrarà definitivament, continuar ?",section_description:"Descripció",section_time:"Periode de temps",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Cancel·lar",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ei={date:{month_full:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],month_short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],day_full:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],day_short:["日","一","二","三","四","五","六"]},labels:{new_task:"新任務",icon_save:"保存",icon_cancel:"关闭",icon_details:"详细",icon_edit:"编辑",icon_delete:"删除",confirm_closing:"请确认是否撤销修改!",confirm_deleting:"是否删除日程?",section_description:"描述",section_time:"时间范围",section_type:"类型",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"工作分解结构",column_text:"任务名",column_start_date:"开始时间",column_duration:"持续时间",column_add:"",link:"关联",confirm_link_deleting:"将被删除",link_start:" (开始)",link_end:" (结束)",type_task:"任务",type_project:"项目",type_milestone:"里程碑",minutes:"分钟",hours:"小时",days:"天",weeks:"周",months:"月",years:"年",message_ok:"OK",message_cancel:"关闭",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Di={date:{month_full:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],month_short:["Led","Ún","Bře","Dub","Kvě","Čer","Čec","Srp","Září","Říj","List","Pro"],day_full:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"],day_short:["Ne","Po","Út","St","Čt","Pá","So"]},labels:{new_task:"Nová práce",icon_save:"Uložit",icon_cancel:"Zpět",icon_details:"Detail",icon_edit:"Edituj",icon_delete:"Smazat",confirm_closing:"",confirm_deleting:"Událost bude trvale smazána, opravdu?",section_description:"Poznámky",section_time:"Doba platnosti",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Zpět",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ai={date:{month_full:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny opgave",icon_save:"Gem",icon_cancel:"Fortryd",icon_details:"Detaljer",icon_edit:"Tilret",icon_delete:"Slet",confirm_closing:"Dine rettelser vil gå tabt.. Er dy sikker?",confirm_deleting:"Bigivenheden vil blive slettet permanent. Er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Fortryd",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ii={date:{month_full:[" Januar"," Februar"," März "," April"," Mai"," Juni"," Juli"," August"," September "," Oktober"," November "," Dezember"],month_short:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],day_full:["Sonntag","Montag","Dienstag"," Mittwoch"," Donnerstag","Freitag","Samstag"],day_short:["So","Mo","Di","Mi","Do","Fr","Sa"]},labels:{new_task:"Neue Aufgabe",icon_save:"Speichern",icon_cancel:"Abbrechen",icon_details:"Details",icon_edit:"Ändern",icon_delete:"Löschen",confirm_closing:"",confirm_deleting:"Der Eintrag wird gelöscht",section_description:"Beschreibung",section_time:"Zeitspanne",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"PSP",column_text:"Task-Namen",column_start_date:"Startzeit",column_duration:"Dauer",column_add:"",link:"Link",confirm_link_deleting:"werden gelöscht",link_start:"(starten)",link_end:"(ende)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minuten",hours:"Stunden",days:"Tage",weeks:"Wochen",months:"Monate",years:"Jahre",message_ok:"OK",message_cancel:"Abbrechen",section_constraint:"Regel",constraint_type:"Regel",constraint_date:"Regel - Datum",asap:"So bald wie möglich",alap:"So spät wie möglich",snet:"Beginn nicht vor",snlt:"Beginn nicht später als",fnet:"Fertigstellung nicht vor",fnlt:"Fertigstellung nicht später als",mso:"Muss beginnen am",mfo:"Muss fertig sein am",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Mi={date:{month_full:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάϊος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],month_short:["ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥΝ","ΙΟΥΛ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ"],day_full:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Κυριακή"],day_short:["ΚΥ","ΔΕ","ΤΡ","ΤΕ","ΠΕ","ΠΑ","ΣΑ"]},labels:{new_task:"Νέα εργασία",icon_save:"Αποθήκευση",icon_cancel:"Άκυρο",icon_details:"Λεπτομέρειες",icon_edit:"Επεξεργασία",icon_delete:"Διαγραφή",confirm_closing:"",confirm_deleting:"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;",section_description:"Περιγραφή",section_time:"Χρονική περίοδος",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Άκυρο",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ni={date:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},labels:{new_task:"New task",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details",icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Task will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Cancel",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Li={date:{month_full:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],month_short:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],day_full:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],day_short:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"]},labels:{new_task:"Nueva tarea",icon_save:"Guardar",icon_cancel:"Cancelar",icon_details:"Detalles",icon_edit:"Editar",icon_delete:"Eliminar",confirm_closing:"",confirm_deleting:"El evento se borrará definitivamente, ¿continuar?",section_description:"Descripción",section_time:"Período",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"EDT",column_text:"Tarea",column_start_date:"Inicio",column_duration:"Duración",column_add:"",link:"Enlace",confirm_link_deleting:"será borrada",link_start:" (inicio)",link_end:" (fin)",type_task:"Tarea",type_project:"Proyecto",type_milestone:"Hito",minutes:"Minutos",hours:"Horas",days:"Días",weeks:"Semanas",months:"Meses",years:"Años",message_ok:"OK",message_cancel:"Cancelar",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Pi={date:{month_full:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],month_short:["1","2","3","4","5","6","7","8","9","10","11","12"],day_full:["يکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],day_short:["ی","د","س","چ","پ","ج","ش"]},labels:{new_task:"وظیفه جدید",icon_save:"ذخیره",icon_cancel:"لغو",icon_details:"جزییات",icon_edit:"ویرایش",icon_delete:"حذف",confirm_closing:"تغییرات شما ازدست خواهد رفت، آیا مطمئن هستید؟",confirm_deleting:"این مورد برای همیشه حذف خواهد شد، آیا مطمئن هستید؟",section_description:"توضیحات",section_time:"مدت زمان",section_type:"نوع",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"عنوان",column_start_date:"زمان شروع",column_duration:"مدت",column_add:"",link:"ارتباط",confirm_link_deleting:"حذف خواهد شد",link_start:" (آغاز)",link_end:" (پایان)",type_task:"وظیفه",type_project:"پروژه",type_milestone:"نگارش",minutes:"دقایق",hours:"ساعات",days:"روزها",weeks:"هفته",months:"ماه‌ها",years:"سال‌ها",message_ok:"تایید",message_cancel:"لغو",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ri={date:{month_full:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],month_short:["Tam","Hel","Maa","Huh","Tou","Kes","Hei","Elo","Syy","Lok","Mar","Jou"],day_full:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],day_short:["Su","Ma","Ti","Ke","To","Pe","La"]},labels:{new_task:"Uusi tehtävä",icon_save:"Tallenna",icon_cancel:"Peru",icon_details:"Tiedot",icon_edit:"Muokkaa",icon_delete:"Poista",confirm_closing:"",confirm_deleting:"Haluatko varmasti poistaa tapahtuman?",section_description:"Kuvaus",section_time:"Aikajakso",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Peru",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Hi={date:{month_full:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],month_short:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aoû","Sep","Oct","Nov","Déc"],day_full:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],day_short:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"]},labels:{new_task:"Nouvelle tâche",icon_save:"Enregistrer",icon_cancel:"Annuler",icon_details:"Détails",icon_edit:"Modifier",icon_delete:"Effacer",confirm_closing:"",confirm_deleting:"L'événement sera effacé sans appel, êtes-vous sûr ?",section_description:"Description",section_time:"Période",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"OTP",column_text:"Nom de la tâche",column_start_date:"Date initiale",column_duration:"Durée",column_add:"",link:"Le lien",confirm_link_deleting:"sera supprimé",link_start:"(début)",link_end:"(fin)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Heures",days:"Jours",weeks:"Semaines",months:"Mois",years:"Années",message_ok:"OK",message_cancel:"Annuler",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Oi={date:{month_full:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],month_short:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],day_full:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],day_short:["א","ב","ג","ד","ה","ו","ש"]},labels:{new_task:"משימה חדש",icon_save:"שמור",icon_cancel:"בטל",icon_details:"פרטים",icon_edit:"ערוך",icon_delete:"מחק",confirm_closing:"",confirm_deleting:"ארוע ימחק סופית.להמשיך?",section_description:"הסבר",section_time:"תקופה",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"בטל",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Bi={date:{month_full:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],month_short:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],day_full:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],day_short:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"]},labels:{new_task:"Novi Zadatak",icon_save:"Spremi",icon_cancel:"Odustani",icon_details:"Detalji",icon_edit:"Izmjeni",icon_delete:"Obriši",confirm_closing:"",confirm_deleting:"Zadatak će biti trajno izbrisan, jeste li sigurni?",section_description:"Opis",section_time:"Vremenski Period",section_type:"Tip",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Naziv Zadatka",column_start_date:"Početno Vrijeme",column_duration:"Trajanje",column_add:"",link:"Poveznica",confirm_link_deleting:"će biti izbrisan",link_start:" (početak)",link_end:" (kraj)",type_task:"Zadatak",type_project:"Projekt",type_milestone:"Milestone",minutes:"Minute",hours:"Sati",days:"Dani",weeks:"Tjedni",months:"Mjeseci",years:"Godine",message_ok:"OK",message_cancel:"Odustani",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},zi={date:{month_full:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],month_short:["Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],day_full:["Vasárnap","Hétfõ","Kedd","Szerda","Csütörtök","Péntek","szombat"],day_short:["Va","Hé","Ke","Sze","Csü","Pé","Szo"]},labels:{new_task:"Új feladat",icon_save:"Mentés",icon_cancel:"Mégse",icon_details:"Részletek",icon_edit:"Szerkesztés",icon_delete:"Törlés",confirm_closing:"",confirm_deleting:"Az esemény törölve lesz, biztosan folytatja?",section_description:"Leírás",section_time:"Idõszak",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Mégse",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Wi={date:{month_full:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],day_full:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],day_short:["Ming","Sen","Sel","Rab","Kam","Jum","Sab"]},labels:{new_task:"Tugas baru",icon_save:"Simpan",icon_cancel:"Batal",icon_details:"Detail",icon_edit:"Edit",icon_delete:"Hapus",confirm_closing:"",confirm_deleting:"Acara akan dihapus",section_description:"Keterangan",section_time:"Periode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Batal",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ji={date:{month_full:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],month_short:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],day_full:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],day_short:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"]},labels:{new_task:"Nuovo compito",icon_save:"Salva",icon_cancel:"Chiudi",icon_details:"Dettagli",icon_edit:"Modifica",icon_delete:"Elimina",confirm_closing:"",confirm_deleting:"Sei sicuro di confermare l'eliminazione?",section_description:"Descrizione",section_time:"Periodo di tempo",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Nome Attività",column_start_date:"Inizio",column_duration:"Durata",column_add:"",link:"Link",confirm_link_deleting:"sarà eliminato",link_start:" (inizio)",link_end:" (fine)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minuti",hours:"Ore",days:"Giorni",weeks:"Settimane",months:"Mesi",years:"Anni",message_ok:"OK",message_cancel:"Chiudi",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Fi={date:{month_full:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],month_short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],day_full:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],day_short:["日","月","火","水","木","金","土"]},labels:{new_task:"新しい仕事",icon_save:"保存",icon_cancel:"キャンセル",icon_details:"詳細",icon_edit:"編集",icon_delete:"削除",confirm_closing:"",confirm_deleting:"イベント完全に削除されます、宜しいですか?",section_description:"デスクリプション",section_time:"期間",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"キャンセル",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Vi={date:{month_full:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],month_short:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],day_full:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],day_short:["일","월","화","수","목","금","토"]},labels:{new_task:"이름없는 작업",icon_save:"저장",icon_cancel:"취소",icon_details:"세부 사항",icon_edit:"수정",icon_delete:"삭제",confirm_closing:"",confirm_deleting:"작업을 삭제하시겠습니까?",section_description:"설명",section_time:"기간",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"작업명",column_start_date:"시작일",column_duration:"기간",column_add:"",link:"전제",confirm_link_deleting:"삭제 하시겠습니까?",link_start:" (start)",link_end:" (end)",type_task:"작업",type_project:"프로젝트",type_milestone:"마일스톤",minutes:"분",hours:"시간",days:"일",weeks:"주",months:"달",years:"년",message_ok:"OK",message_cancel:"취소",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}};class Ui{constructor(e){this.addLocale=(n,i)=>{this._locales[n]=i},this.getLocale=n=>this._locales[n],this._locales={};for(const n in e)this._locales[n]=e[n]}}const qi={date:{month_full:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Mon","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny oppgave",icon_save:"Lagre",icon_cancel:"Avbryt",icon_details:"Detaljer",icon_edit:"Rediger",icon_delete:"Slett",confirm_closing:"",confirm_deleting:"Hendelsen vil bli slettet permanent. Er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Gi={date:{month_full:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],month_short:["Jan","Feb","mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],day_short:["Zo","Ma","Di","Wo","Do","Vr","Za"]},labels:{new_task:"Nieuwe taak",icon_save:"Opslaan",icon_cancel:"Annuleren",icon_details:"Details",icon_edit:"Bewerken",icon_delete:"Verwijderen",confirm_closing:"",confirm_deleting:"Item zal permanent worden verwijderd, doorgaan?",section_description:"Beschrijving",section_time:"Tijd periode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Taak omschrijving",column_start_date:"Startdatum",column_duration:"Duur",column_add:"",link:"Koppeling",confirm_link_deleting:"zal worden verwijderd",link_start:" (start)",link_end:" (eind)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"minuten",hours:"uren",days:"dagen",weeks:"weken",months:"maanden",years:"jaren",message_ok:"OK",message_cancel:"Annuleren",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Yi={date:{month_full:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],month_short:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],day_full:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],day_short:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},labels:{new_task:"Ny oppgave",icon_save:"Lagre",icon_cancel:"Avbryt",icon_details:"Detaljer",icon_edit:"Endre",icon_delete:"Slett",confirm_closing:"Endringer blir ikke lagret, er du sikker?",confirm_deleting:"Oppføringen vil bli slettet, er du sikker?",section_description:"Beskrivelse",section_time:"Tidsperiode",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ji={date:{month_full:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],month_short:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],day_full:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],day_short:["Nie","Pon","Wto","Śro","Czw","Pią","Sob"]},labels:{new_task:"Nowe zadanie",icon_save:"Zapisz",icon_cancel:"Anuluj",icon_details:"Szczegóły",icon_edit:"Edytuj",icon_delete:"Usuń",confirm_closing:"",confirm_deleting:"Zdarzenie zostanie usunięte na zawsze, kontynuować?",section_description:"Opis",section_time:"Okres czasu",section_type:"Typ",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Nazwa zadania",column_start_date:"Początek",column_duration:"Czas trwania",column_add:"",link:"Link",confirm_link_deleting:"zostanie usunięty",link_start:" (początek)",link_end:" (koniec)",type_task:"Zadanie",type_project:"Projekt",type_milestone:"Milestone",minutes:"Minuty",hours:"Godziny",days:"Dni",weeks:"Tydzień",months:"Miesiące",years:"Lata",message_ok:"OK",message_cancel:"Anuluj",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Ki={date:{month_full:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],month_short:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],day_full:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],day_short:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]},labels:{new_task:"Nova tarefa",icon_save:"Salvar",icon_cancel:"Cancelar",icon_details:"Detalhes",icon_edit:"Editar",icon_delete:"Excluir",confirm_closing:"",confirm_deleting:"As tarefas serão excluidas permanentemente, confirme?",section_description:"Descrição",section_time:"Período",section_type:"Tipo",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"EAP",column_text:"Nome tarefa",column_start_date:"Data início",column_duration:"Duração",column_add:"",link:"Link",confirm_link_deleting:"Será excluído!",link_start:" (início)",link_end:" (fim)",type_task:"Task",type_project:"Projeto",type_milestone:"Marco",minutes:"Minutos",hours:"Horas",days:"Dias",weeks:"Semanas",months:"Meses",years:"Anos",message_ok:"OK",message_cancel:"Cancelar",section_constraint:"Restrição",constraint_type:"Tipo Restrição",constraint_date:"Data restrição",asap:"Mais breve possível",alap:"Mais tarde possível",snet:"Não começar antes de",snlt:"Não começar depois de",fnet:"Não terminar antes de",fnlt:"Não terminar depois de",mso:"Precisa começar em",mfo:"Precisa terminar em",resources_filter_placeholder:"Tipo de filtros",resources_filter_label:"Ocultar vazios",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Xi={date:{month_full:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","November","December"],month_short:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],day_full:["Duminica","Luni","Marti","Miercuri","Joi","Vineri","Sambata"],day_short:["Du","Lu","Ma","Mi","Jo","Vi","Sa"]},labels:{new_task:"Sarcina noua",icon_save:"Salveaza",icon_cancel:"Anuleaza",icon_details:"Detalii",icon_edit:"Editeaza",icon_delete:"Sterge",confirm_closing:"Schimbarile nu vor fi salvate, esti sigur?",confirm_deleting:"Evenimentul va fi sters permanent, esti sigur?",section_description:"Descriere",section_time:"Interval",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Anuleaza",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Zi={date:{month_full:["Январь","Февраль","Март","Апрель","Maй","Июнь","Июль","Август","Сентябрь","Oктябрь","Ноябрь","Декабрь"],month_short:["Янв","Фев","Maр","Aпр","Maй","Июн","Июл","Aвг","Сен","Окт","Ноя","Дек"],day_full:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],day_short:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"]},labels:{new_task:"Новое задание",icon_save:"Сохранить",icon_cancel:"Отменить",icon_details:"Детали",icon_edit:"Изменить",icon_delete:"Удалить",confirm_closing:"",confirm_deleting:"Событие будет удалено безвозвратно, продолжить?",section_description:"Описание",section_time:"Период времени",section_type:"Тип",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"ИСР",column_text:"Задача",column_start_date:"Начало",column_duration:"Длительность",column_add:"",link:"Связь",confirm_link_deleting:"будет удалена",link_start:" (начало)",link_end:" (конец)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Минута",hours:"Час",days:"День",weeks:"Неделя",months:"Месяц",years:"Год",message_ok:"OK",message_cancel:"Отменить",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"начните вводить слово для фильтрации",resources_filter_label:"спрятать не установленные",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},Qi={date:{month_full:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],day_short:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"]},labels:{new_task:"Nova naloga",icon_save:"Shrani",icon_cancel:"Prekliči",icon_details:"Podrobnosti",icon_edit:"Uredi",icon_delete:"Izbriši",confirm_closing:"",confirm_deleting:"Dogodek bo izbrisan. Želite nadaljevati?",section_description:"Opis",section_time:"Časovni okvir",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Prekliči",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ta={date:{month_full:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],month_short:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sept","Okt","Nov","Dec"],day_full:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],day_short:["Ne","Po","Ut","St","Št","Pi","So"]},labels:{new_task:"Nová úloha",icon_save:"Uložiť",icon_cancel:"Späť",icon_details:"Detail",icon_edit:"Edituj",icon_delete:"Zmazať",confirm_closing:"Vaše zmeny nebudú uložené. Skutočne?",confirm_deleting:"Udalosť bude natrvalo vymazaná. Skutočne?",section_description:"Poznámky",section_time:"Doba platnosti",section_type:"Type",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Späť",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ea={date:{month_full:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],month_short:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],day_full:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],day_short:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},labels:{new_task:"Ny uppgift",icon_save:"Spara",icon_cancel:"Avbryt",icon_details:"Detajer",icon_edit:"Ändra",icon_delete:"Ta bort",confirm_closing:"",confirm_deleting:"Är du säker på att du vill ta bort händelsen permanent?",section_description:"Beskrivning",section_time:"Tid",section_type:"Typ",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Uppgiftsnamn",column_start_date:"Starttid",column_duration:"Varaktighet",column_add:"",link:"Länk",confirm_link_deleting:"kommer tas bort",link_start:" (start)",link_end:" (slut)",type_task:"Uppgift",type_project:"Projekt",type_milestone:"Milstolpe",minutes:"Minuter",hours:"Timmar",days:"Dagar",weeks:"Veckor",months:"Månader",years:"År",message_ok:"OK",message_cancel:"Avbryt",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},na={date:{month_full:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],month_short:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],day_full:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],day_short:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},labels:{new_task:"Yeni görev",icon_save:"Kaydet",icon_cancel:"İptal",icon_details:"Detaylar",icon_edit:"Düzenle",icon_delete:"Sil",confirm_closing:"",confirm_deleting:"Görev silinecek, emin misiniz?",section_description:"Açıklama",section_time:"Zaman Aralığı",section_type:"Tip",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Görev Adı",column_start_date:"Başlangıç",column_duration:"Süre",column_add:"",link:"Bağlantı",confirm_link_deleting:"silinecek",link_start:" (başlangıç)",link_end:" (bitiş)",type_task:"Görev",type_project:"Proje",type_milestone:"Kilometretaşı",minutes:"Dakika",hours:"Saat",days:"Gün",weeks:"Hafta",months:"Ay",years:"Yıl",message_ok:"OK",message_cancel:"Ýptal",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}},ia={date:{month_full:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],month_short:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],day_full:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"],day_short:["Нед","Пон","Вів","Сер","Чет","Птн","Суб"]},labels:{new_task:"Нове завдання",icon_save:"Зберегти",icon_cancel:"Відміна",icon_details:"Деталі",icon_edit:"Редагувати",icon_delete:"Вилучити",confirm_closing:"",confirm_deleting:"Подія вилучиться назавжди. Ви впевнені?",section_description:"Опис",section_time:"Часовий проміжок",section_type:"Тип",section_deadline:"Deadline",section_baselines:"Baselines",column_wbs:"WBS",column_text:"Task name",column_start_date:"Start time",column_duration:"Duration",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",minutes:"Minutes",hours:"Hours",days:"Days",weeks:"Week",months:"Months",years:"Years",message_ok:"OK",message_cancel:"Відміна",section_constraint:"Constraint",constraint_type:"Constraint type",constraint_date:"Constraint date",asap:"As Soon As Possible",alap:"As Late As Possible",snet:"Start No Earlier Than",snlt:"Start No Later Than",fnet:"Finish No Earlier Than",fnlt:"Finish No Later Than",mso:"Must Start On",mfo:"Must Finish On",resources_filter_placeholder:"type to filter",resources_filter_label:"hide empty",empty_state_text_link:"Click here",empty_state_text_description:"to create your first task",baselines_section_placeholder:"Start adding a new baseline",baselines_add_button:"Add Baseline",baselines_remove_button:"Remove",baselines_remove_all_button:"Remove All",deadline_enable_button:"Set",deadline_disable_button:"Remove"}};function aa(){this.constants=Fn,this.version="9.0.2",this.license="gpl",this.templates={},this.ext={},this.keys={edit_save:this.constants.KEY_CODES.ENTER,edit_cancel:this.constants.KEY_CODES.ESC}}function ra(t){var e=new aa,n=new Vn(t),i={};e.plugins=function(l){for(var d in l)if(l[d]&&!i[d]){var c=n.getExtension(d);c&&(c(e),i[d]=!0)}return i},e.$services=function(){var l={};return{services:{},setService:function(d,c){l[d]=c},getService:function(d){return l[d]?l[d]():null},dropService:function(d){l[d]&&delete l[d]},destructor:function(){for(var d in l)if(l[d]){var c=l[d];c&&c.destructor&&c.destructor()}l=null}}}(),e.config=Un(),e.ajax=function(l){return{cache:!0,method:"get",parse:function(d){return typeof d!="string"?d:(d=d.replace(/^[\s]+/,""),typeof DOMParser>"u"||_t.isIE?dt.ActiveXObject!==void 0&&((c=new dt.ActiveXObject("Microsoft.XMLDOM")).async="false",c.loadXML(d)):c=new DOMParser().parseFromString(d,"text/xml"),c);var c},xmltop:function(d,c,u){if(c.status===void 0||c.status<400){var h=c.responseXML?c.responseXML||c:this.parse(c.responseText||c);if(h&&h.documentElement!==null&&!h.getElementsByTagName("parsererror").length)return h.getElementsByTagName(d)[0]}return u!==-1&&l.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],u]),document.createElement("DIV")},xpath:function(d,c){if(c.nodeName||(c=c.responseXML||c),_t.isIE)return c.selectNodes(d)||[];for(var u,h=[],g=(c.ownerDocument||c).evaluate(d,c,null,XPathResult.ANY_TYPE,null);u=g.iterateNext();)h.push(u);return h},query:function(d){return this._call(d.method||"GET",d.url,d.data||"",d.async||!0,d.callback,d.headers)},get:function(d,c,u){var h=$t("GET",arguments);return this.query(h)},getSync:function(d,c){var u=$t("GET",arguments);return u.async=!1,this.query(u)},put:function(d,c,u,h){var g=$t("PUT",arguments);return this.query(g)},del:function(d,c,u){var h=$t("DELETE",arguments);return this.query(h)},post:function(d,c,u,h){arguments.length==1?c="":arguments.length==2&&typeof c=="function"&&(u=c,c="");var g=$t("POST",arguments);return this.query(g)},postSync:function(d,c,u){c=c===null?"":String(c);var h=$t("POST",arguments);return h.async=!1,this.query(h)},_call:function(d,c,u,h,g,f){return new l.Promise(function(y,v){var b=typeof XMLHttpRequest!==void 0?new XMLHttpRequest:new dt.ActiveXObject("Microsoft.XMLHTTP"),_=navigator.userAgent.match(/AppleWebKit/)!==null&&navigator.userAgent.match(/Qt/)!==null&&navigator.userAgent.match(/Safari/)!==null;h&&(b.onreadystatechange=function(){if(b.readyState==4||_&&b.readyState==3){if((b.status!=200||b.responseText==="")&&!l.callEvent("onAjaxError",[b]))return;setTimeout(function(){typeof g=="function"&&g.apply(dt,[{xmlDoc:b,filePath:c}]),y(b),typeof g=="function"&&(g=null,b=null)},0)}});var m=!this||!this.cache;if(d=="GET"&&m&&(c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"),b.open(d,c,h),f)for(var p in f)b.setRequestHeader(p,f[p]);else d.toUpperCase()=="POST"||d=="PUT"||d=="DELETE"?b.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):d=="GET"&&(u=null);if(b.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.send(u),!h)return{xmlDoc:b,filePath:c}})},urlSeparator:function(d){return d.indexOf("?")!=-1?"&":"?"}}}(e),e.date=qn(e),e.RemoteEvents=Yn;var a=function(l){function d(u){return{target:u.target||u.srcElement,pageX:u.pageX,pageY:u.pageY,clientX:u.clientX,clientY:u.clientY,metaKey:u.metaKey,shiftKey:u.shiftKey,ctrlKey:u.ctrlKey,altKey:u.altKey}}function c(u,h){this._obj=u,this._settings=h||{},it(this);var g=this.getInputMethods();this._drag_start_timer=null,l.attachEvent("onGanttScroll",R(function(v,b){this.clearDragTimer()},this));for(var f={passive:!1},y=0;ythis.config.sensitivity},initDnDMarker:function(){var u=this.config.marker=document.createElement("div");u.className="gantt_drag_marker",u.innerHTML="",document.body.appendChild(u)},backupEventTarget:function(u,h){if(l.config.touch){var g=h(u),f=g.target||g.srcElement,y=f.cloneNode(!0);this.config.original_target=d(g),this.config.original_target.target=y,this.config.backup_element=f,f.parentNode.appendChild(y),f.style.display="none",(this.config.mousemoveContainer||document.body).appendChild(f)}},getInputMethods:function(){var u=[];if(u.push({move:"mousemove",down:"mousedown",up:"mouseup",accessor:function(g){return g}}),l.config.touch){var h=!0;try{document.createEvent("TouchEvent")}catch{h=!1}h?u.push({move:"touchmove",down:"touchstart",up:"touchend",accessor:function(g){return g.touches&&g.touches.length>1?null:g.touches[0]?{target:document.elementFromPoint(g.touches[0].clientX,g.touches[0].clientY),pageX:g.touches[0].pageX,pageY:g.touches[0].pageY,clientX:g.touches[0].clientX,clientY:g.touches[0].clientY}:g}}):dt.navigator.pointerEnabled?u.push({move:"pointermove",down:"pointerdown",up:"pointerup",accessor:function(g){return g.pointerType=="mouse"?null:g}}):dt.navigator.msPointerEnabled&&u.push({move:"MSPointerMove",down:"MSPointerDown",up:"MSPointerUp",accessor:function(g){return g.pointerType==g.MSPOINTER_TYPE_MOUSE?null:g}})}return u},clearDragTimer:function(){this._drag_start_timer&&(clearTimeout(this._drag_start_timer),this._drag_start_timer=null)},dragStart:function(u,h,g){this.config&&this.config.started||(this.config={obj:u,marker:null,started:!1,pos:this.getPosition(h),sensitivity:4},this._settings&&N(this.config,this._settings,!0),this.traceDragEvents(u,g),l._prevent_touch_scroll=!0,document.body.className+=" gantt_noselect",l.config.touch&&this.dragMove(u,h,g.accessor))},dragMove:function(u,h,g){var f=g(h);if(!f)return!1;if(!this.config.marker&&!this.config.started){var y=this.getPosition(f);if(l.config.touch||this.checkPositionChange(y)){if(this.config.started=!0,this.config.ignore=!1,l._touch_drag=!0,this.callEvent("onBeforeDragStart",[u,this.config.original_target])===!1)return this.config.ignore=!0,!1;this.backupEventTarget(h,g),this.initDnDMarker(),l._touch_feedback(),this.callEvent("onAfterDragStart",[u,this.config.original_target])}else this.config.ignore=!0}return this.config.ignore?!1:h.targetTouches&&!f.target?void 0:(f.pos=this.getPosition(f),this.config.marker.style.left=f.pos.x+"px",this.config.marker.style.top=f.pos.y+"px",this.callEvent("onDragMove",[u,f]),!0)},dragEnd:function(u){var h=this.config.backup_element;h&&h.parentNode&&h.parentNode.removeChild(h),l._prevent_touch_scroll=!1,this.config.marker&&(this.config.marker.parentNode.removeChild(this.config.marker),this.config.marker=null,this.callEvent("onDragEnd",[])),this.config.started=!1,l._touch_drag=!1,document.body.className=document.body.className.replace(" gantt_noselect","")},getPosition:function(u){var h=0,g=0;return u.pageX||u.pageY?(h=u.pageX,g=u.pageY):(u.clientX||u.clientY)&&(h=u.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,g=u.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:h,y:g}}},c}(e);e.$services.setService("dnd",function(){return a});var r=function(l){var d={};function c(u,h,g){g=g||u;var f=l.config,y=l.templates;l.config[u]&&d[g]!=f[u]&&(h&&y[g]||(y[g]=l.date.date_to_str(f[u]),d[g]=f[u]))}return{initTemplates:function(){var u=l.locale.labels;u.gantt_save_btn=u.icon_save,u.gantt_cancel_btn=u.icon_cancel,u.gantt_delete_btn=u.icon_delete;var h=l.date,g=h.date_to_str,f=l.config,y=g(f.xml_date||f.date_format,f.server_utc),v=h.str_to_date(f.xml_date||f.date_format,f.server_utc);c("date_scale",!0,void 0,l.config,l.templates),c("date_grid",!0,"grid_date_format",l.config,l.templates),c("task_date",!0,void 0,l.config,l.templates),l.mixin(l.templates,{xml_format:void 0,format_date:y,xml_date:void 0,parse_date:v,progress_text:function(b,_,m){return""},grid_header_class:function(b,_){return""},task_text:function(b,_,m){return m.text},task_class:function(b,_,m){return""},task_end_date:function(b){return l.templates.task_date(b)},grid_row_class:function(b,_,m){return""},task_row_class:function(b,_,m){return""},timeline_cell_class:function(b,_){return""},timeline_cell_content:function(b,_){return""},scale_cell_class:function(b){return""},scale_row_class:function(b){return""},grid_indent:function(b){return"
"},grid_folder:function(b){return"
"},grid_file:function(b){return"
"},grid_open:function(b){return"
"},grid_blank:function(b){return"
"},date_grid:function(b,_,m){return _&&l.isUnscheduledTask(_)&&l.config.show_unscheduled?l.templates.task_unscheduled_time(_):l.templates.grid_date_format(b,m)},task_time:function(b,_,m){return l.isUnscheduledTask(m)&&l.config.show_unscheduled?l.templates.task_unscheduled_time(m):l.templates.task_date(b)+" - "+l.templates.task_end_date(_)},task_unscheduled_time:function(b){return""},time_picker:g(f.time_picker),link_class:function(b){return""},link_description:function(b){var _=l.getTask(b.source),m=l.getTask(b.target);return""+_.text+""+m.text+""},drag_link:function(b,_,m,p){b=l.getTask(b);var k=l.locale.labels,$=""+b.text+" "+(_?k.link_start:k.link_end)+"
";return m&&($+=" "+(m=l.getTask(m)).text+" "+(p?k.link_start:k.link_end)+"
"),$},drag_link_class:function(b,_,m,p){var k="";return b&&m&&(k=" "+(l.isLinkAllowed(b,m,_,p)?"gantt_link_allow":"gantt_link_deny")),"gantt_link_tooltip"+k},tooltip_date_format:h.date_to_str("%Y-%m-%d"),tooltip_text:function(b,_,m){return`
Task: ${m.text}
Start date: ${l.templates.tooltip_date_format(b)}
-
End date: ${l.templates.tooltip_date_format(_)}
`},baseline_text:function(b,_,m){return""}})},initTemplate:c}}(e);e.$services.setService("templateLoader",function(){return r}),it(e);var s=new Jn;s.registerProvider("global",function(){var l={min_date:e._min_date,max_date:e._max_date,selected_task:null};return e.$data&&e.$data.tasksStore&&(l.selected_task=e.$data.tasksStore.getSelectedId()),l}),e.getState=s.getState,e.$services.setService("state",function(){return s}),N(e,Hn),e.Promise=Kn,e.env=_t,function(l){var d=Zn.create();N(l,d);var c,u=l.createDatastore({name:"task",type:"treeDatastore",rootId:function(){return l.config.root_id},initItem:R(function(_){this.defined(_.id)||(_.id=this.uid()),_.start_date&&(_.start_date=l.date.parseDate(_.start_date,"parse_date")),_.end_date&&(_.end_date=l.date.parseDate(_.end_date,"parse_date"));var m=null;(_.duration||_.duration===0)&&(_.duration=m=1*_.duration),m&&(_.start_date&&!_.end_date?_.end_date=this.calculateEndDate(_):!_.start_date&&_.end_date&&(_.start_date=this.calculateEndDate({start_date:_.end_date,duration:-_.duration,task:_}))),l.config.deadlines!==!1&&_.deadline&&(_.deadline=l.date.parseDate(_.deadline,"parse_date")),_.progress=Number(_.progress)||0,this._isAllowedUnscheduledTask(_)&&this._set_default_task_timing(_),this._init_task_timing(_),_.start_date&&_.end_date&&this.correctTaskWorkTime(_),_.$source=[],_.$target=[];var p=this.$data.tasksStore.getItem(_.id);return p&&!W(_.open)&&(_.$open=p.$open),_.parent===void 0&&(_.parent=this.config.root_id),_},l),getConfig:function(){return l.config}}),h=l.createDatastore({name:"link",initItem:R(function(_){return this.defined(_.id)||(_.id=this.uid()),_},l)});function g(_){var m=l.isTaskVisible(_);if(!m&&l.isTaskExists(_)){var p=l.getParent(_);l.isTaskExists(p)&&l.isTaskVisible(p)&&(p=l.getTask(p),l.isSplitTask(p)&&(m=!0))}return m}function f(_){if(l.isTaskExists(_.source)){var m=l.getTask(_.source);m.$source=m.$source||[],m.$source.push(_.id)}if(l.isTaskExists(_.target)){var p=l.getTask(_.target);p.$target=p.$target||[],p.$target.push(_.id)}}function y(_){if(l.isTaskExists(_.source)){for(var m=l.getTask(_.source),p=0;pk||+m.end_date<+p)return!1}return!0}),u.attachEvent("onIdChange",function(_,m){l._update_flags(_,m);var p=l.getTask(m);u.isSilent()||(p.$split_subtask||p.rollup)&&l.eachParent(function(k){l.refreshTask(k.id)},m)}),u.attachEvent("onAfterUpdate",function(_){if(l._update_parents(_),l.getState("batchUpdate").batch_update)return!0;var m=u.getItem(_);m.$source||(m.$source=[]);for(var p=0;p-1&&k.click?k.click():(i(n,!0),p=!0)}m==27&&(i(n,!1),p=!0)}return p?(_.preventDefault&&_.preventDefault(),!(_.cancelBubble=!0)):void 0}}var r=vt(t.$root)||document;function s(_){s.cover||(s.cover=document.createElement("div"),s.cover.onkeydown=a,s.cover.className="dhx_modal_cover",document.body.appendChild(s.cover)),s.cover.style.display=_?"inline-block":"none"}function o(_,m,p){return"
"+_+"
"}function l(){for(var _=[].slice.apply(arguments,[0]),m=0;m<_.length;m++)if(_[m])return _[m]}function d(_,m,p){var k=_.tagName?_:function(x,S,T){var C=document.createElement("div"),E=rt();t._waiAria.messageModalAttr(C,E),C.className=" gantt_modal_box gantt-"+x.type,C.setAttribute(e,1);var D="";if(x.width&&(C.style.width=x.width),x.height&&(C.style.height=x.height),x.title&&(D+='
'+x.title+"
"),D+='
'+(x.content?"":x.text)+'
',S&&(D+=o(l(x.ok,t.locale.labels.message_ok,"OK"),"ok",!0)),T&&(D+=o(l(x.cancel,t.locale.labels.message_cancel,"Cancel"),"cancel",!1)),x.buttons)for(var A=0;A",C.innerHTML=D,x.content){var M=x.content;typeof M=="string"&&(M=document.getElementById(M)),M.style.display=="none"&&(M.style.display=""),C.childNodes[x.title?1:0].appendChild(M)}return C.onclick=function(L){var P=L.target||L.srcElement;if(P.className||(P=P.parentNode),lt(P,".gantt_popup_button")){var H=P.getAttribute("data-result");i(x,H=H=="true"||H!="false"&&H)}},x.box=C,(S||T)&&(n=x),C}(_,m,p);_.hidden||s(!0),document.body.appendChild(k);var $=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-k.offsetWidth)/2)),w=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-k.offsetHeight)/2));return _.position=="top"?k.style.top="-3px":k.style.top=w+"px",k.style.left=$+"px",k.onkeydown=a,y.focus(k),_.hidden&&y.hide(k),t.callEvent("onMessagePopup",[k]),k}function c(_){return d(_,!0,!1)}function u(_){return d(_,!0,!0)}function h(_){return d(_)}function g(_,m,p){return typeof _!="object"&&(typeof m=="function"&&(p=m,m=""),_={text:_,type:m,callback:p}),_}function f(_,m,p,k){return typeof _!="object"&&(_={text:_,type:m,expire:p,id:k}),_.id=_.id||rt(),_.expire=_.expire||v.expire,_}t.event(r,"keydown",a,!0);var y=function(){var _=g.apply(this,arguments);return _.type=_.type||"alert",h(_)};y.hide=function(_){for(;_&&_.getAttribute&&!_.getAttribute(e);)_=_.parentNode;_&&(_.parentNode.removeChild(_),s(!1),t.callEvent("onAfterMessagePopup",[_]))},y.focus=function(_){setTimeout(function(){var m=Zt(_);m.length&&m[0].focus&&m[0].focus()},1)};var v=function(_,m,p,k){switch((_=f.apply(this,arguments)).type=_.type||"info",_.type.split("-")[0]){case"alert":return c(_);case"confirm":return u(_);case"modalbox":return h(_);default:return function($){v.area||(v.area=document.createElement("div"),v.area.className="gantt_message_area",v.area.style[v.position]="5px",document.body.appendChild(v.area)),v.hide($.id);var w=document.createElement("div");return w.innerHTML="
"+$.text+"
",w.className="gantt-info gantt-"+$.type,w.onclick=function(){v.hide($.id),$=null},t._waiAria.messageInfoAttr(w),v.position=="bottom"&&v.area.firstChild?v.area.insertBefore(w,v.area.firstChild):v.area.appendChild(w),$.expire>0&&(v.timers[$.id]=window.setTimeout(function(){v&&v.hide($.id)},$.expire)),v.pull[$.id]=w,w=null,$.id}(_)}};v.seed=new Date().valueOf(),v.uid=rt,v.expire=4e3,v.keyboard=!0,v.position="top",v.pull={},v.timers={},v.hideAll=function(){for(var _ in v.pull)v.hide(_)},v.hide=function(_){var m=v.pull[_];m&&m.parentNode&&(window.setTimeout(function(){m.parentNode.removeChild(m),m=null},2e3),m.className+=" hidden",v.timers[_]&&window.clearTimeout(v.timers[_]),delete v.pull[_])};var b=[];return t.attachEvent("onMessagePopup",function(_){b.push(_)}),t.attachEvent("onAfterMessagePopup",function(_){for(var m=0;mt.x_end||e.left+e.widtht.y_end||e.top+e.heightd.x&&g.topd.y&&c.push(h.id)}return{ids:c}}}function cn(t,e,n,i,a){var r=n.$gantt.getTask(t.source),s=n.$gantt.getTask(t.target),o=n.getItemTop(r.id),l=n.getItemHeight(r.id),d=n.getItemTop(s.id),c=n.getItemHeight(s.id);if(e.y>o+l&&e.y>d+c||e.y_endg){var v=g;g=h,h=v}return f>y&&(v=y,y=f,f=v),h+=-100,g+=u,f+=-100,y+=u,!(e.x>g&&e.x>y)&&!(e.x_endr.maxWidth&&(i=r.maxWidth),ar.maxHeight&&(a=r.maxHeight),this.setSize(i,a),this.$preResize,this.$preResize=!1},t.prototype.hide=function(){this._hide(!0),this.resize()},t.prototype.show=function(e){this._hide(!1),e&&this.$parent&&this.$parent.show(),this.resize()},t.prototype._hide=function(e){if(e===!0&&this.$view.parentNode)this.$view.parentNode.removeChild(this.$view);else if(e===!1&&!this.$view.parentNode){var n=this.$parent.cellIndex(this.$id);this.$parent.moveView(this,n)}this.$config.hidden=e},t.prototype.$toHTML=function(e,n){e===void 0&&(e=""),n=[n||"",this.$config.css||""].join(" ");var i=this.$config,a="";return i.raw?e=typeof i.raw=="string"?i.raw:"":(e||(e="
"+(i.html||"")+"
"),i.header&&(a="
"+(i.canCollapse?"
":"")+"
"+i.header+"
")),"
"+a+e+"
"},t.prototype.$fill=function(e,n){this.$view=e,this.$parent=n,this.init()},t.prototype.getNode=function(){return this.$view.querySelector("gantt_layout_cell")||this.$view},t.prototype.init=function(){var e=this;this._headerClickHandler=function(n){tt(n,"data-cell-id")==e.$id&&e.toggle()},this.$gantt.$services.getService("mouseEvents").delegate("click","gantt_header_arrow",this._headerClickHandler),this.callEvent("onReady",[])},t.prototype.toggle=function(){this.$config.collapsed=!this.$config.collapsed,this.resize()},t.prototype.getSize=function(){var e={height:this.$config.height||0,width:this.$config.width||0,gravity:this.$config.gravity||1,minHeight:this.$config.minHeight||0,minWidth:this.$config.minWidth||0,maxHeight:this.$config.maxHeight||1e11,maxWidth:this.$config.maxWidth||1e11};if(this.$config.collapsed){var n=this.$config.mode==="x";e[n?"width":"height"]=e[n?"maxWidth":"maxHeight"]=this.$config.headerHeight}return e},t.prototype.getContentSize=function(){var e=this.$lastSize.contentX;e!==1*e&&(e=this.$lastSize.width);var n=this.$lastSize.contentY;return n!==1*n&&(n=this.$lastSize.height),{width:e,height:n}},t.prototype._getBorderSizes=function(){var e={top:0,right:0,bottom:0,left:0,horizontal:0,vertical:0};return this._currentBorders&&(this._currentBorders[this._borders.left]&&(e.left=1,e.horizontal++),this._currentBorders[this._borders.right]&&(e.right=1,e.horizontal++),this._currentBorders[this._borders.top]&&(e.top=1,e.vertical++),this._currentBorders[this._borders.bottom]&&(e.bottom=1,e.vertical++)),e},t.prototype.setSize=function(e,n){this.$view.style.width=e+"px",this.$view.style.height=n+"px";var i=this._getBorderSizes(),a=n-i.vertical,r=e-i.horizontal;this.$lastSize={x:e,y:n,contentX:r,contentY:a},this.$config.header?this._sizeHeader():this._sizeContent()},t.prototype._borders={left:"gantt_layout_cell_border_left",right:"gantt_layout_cell_border_right",top:"gantt_layout_cell_border_top",bottom:"gantt_layout_cell_border_bottom"},t.prototype._setBorders=function(e,n){n||(n=this);var i=n.$view;for(var a in this._borders)Ht(i,this._borders[a]);typeof e=="string"&&(e=[e]);var r={};for(a=0;a0?n[l].$parent.getNextSibling(n[l].$id):n[l].$parent.getPrevSibling(n[l].$id);c.$name=="resizer"&&(c=r>0?c.$parent.getNextSibling(c.$id):c.$parent.getPrevSibling(c.$id));var u=c.getSize();if(o)n[l].$config.gravity=s;else if(c[a]){var h=d.gravity+u.gravity,g=d[a]+u[a],f=h/g;n[l].$config.gravity=f*s,c.$config[a]=g-s,c.$config.gravity=h-f*s}else n[l].$config[a]=s;var y=this.$gantt.$ui.getView("grid");!y||n[l].$content!==y||y.$config.scrollable||o||(this.$gantt.config.grid_width=s)}},e.prototype.resize=function(n){var i=!1;if(this.$root&&!this._resizeInProgress&&(this.callEvent("onBeforeResize",[]),i=!0,this._resizeInProgress=!0),t.prototype.resize.call(this,!0),t.prototype.resize.call(this,!1),i){var a=[];a=(a=(a=a.concat(this.getCellsByType("viewCell"))).concat(this.getCellsByType("viewLayout"))).concat(this.getCellsByType("hostCell"));for(var r=this.getCellsByType("scroller"),s=0;s=0&&this.$cells[i+1]?this.$cells[i+1]:null},e.prototype.getPrevSibling=function(n){var i=this.cellIndex(n);return i>=0&&this.$cells[i-1]?this.$cells[i-1]:null},e.prototype.cell=function(n){for(var i=0;i=a.childNodes.length?a.appendChild(n.$view):a.insertBefore(n.$view,a.childNodes[i])},e.prototype._parseConfig=function(n){this.$cells=[],this._xLayout=!n.rows;for(var i=n.rows||n.cols||n.views,a=0;a=0;r--){var s=this.$cells[r];s.$fill(a[r],this),s.$config.hidden&&s.$view.parentNode.removeChild(s.$view)}},e.prototype.$toHTML=function(){for(var n=this._xLayout?"x":"y",i=[],a=0;a=1e5&&(c.maxWidth=a),c.maxHeight>=1e5&&(c.maxHeight=s),c.minWidth=c.minWidth!=c.minWidth?0:c.minWidth,c.minHeight=c.minHeight!=c.minHeight?0:c.minHeight,this._xLayout?(c.minWidth+=this.$config.margin*this.$cells.length||0,c.minWidth+=2*this.$config.padding||0,c.minHeight+=2*this.$config.padding||0):(c.minHeight+=this.$config.margin*this.$cells.length||0,c.minHeight+=2*this.$config.padding||0),c},e.prototype._calcFreeSpace=function(n,i,a){var r=a?i.minWidth:i.minHeight,s=i.maxWidth,o=n;return o?(o>s&&(o=s),os&&(o=s,this._free-=o,this._gravity-=i.gravity),oo&&(r=o),r=0;r--)if(!i[r].$config.hidden){a=r;break}for(r=0;r=a,o="";!s&&i[r+1]&&i[r+1].$config.view=="scrollbar"&&(this._xLayout?s=!0:o="gantt_layout_cell_border_transparent"),this._setBorders(s?[]:[n,o],i[r])}},e.prototype._updateCellVisibility=function(){for(var n=this._visibleCells||{},i=!this._visibleCells,a={},r=null,s=[],o=0;o
"},n.prototype._getRootParent=function(){for(var a=this.$parent;a&&a.$parent;)a=a.$parent;if(a)return a},n.prototype._eachView=function(){var a=[];return i(this._getRootParent(),a),a},n.prototype._getLinkedViews=function(){for(var a=this._eachView(),r=[],s=0;sy[u]&&y[c]>r&&f>y[u]-h+2&&(r=f+(o?0:2),s=y[u]);else{var v=Math.max(y[c]-f,0);(f+=v)>Math.max(y[u]-v,0)&&f>r&&(r=f,s=y[u])}}return{outerScroll:s,innerScroll:r}},n.prototype.scroll=function(a){this._isHorizontal()?this.scrollHorizontally(a):this.scrollVertically(a)},n.prototype.getScrollState=function(){return{visible:this.isVisible(),direction:this.$config.scroll,size:this.$config.outerSize,scrollSize:this.$config.scrollSize||0,position:this.$config.scrollPosition||0}},n.prototype.setSize=function(a,r){t.prototype.setSize.apply(this,arguments);var s=this._getScrollSize(),o=(this._isVertical()?r:a)-this._getScrollOffset()+(this._isHorizontal()?1:0);s.innerScroll&&o>s.outerScroll&&(s.innerScroll+=o-s.outerScroll),this.$config.scrollSize=s.innerScroll,this.$config.width=a,this.$config.height=r,this._setScrollSize(s.innerScroll)},n.prototype.isVisible=function(){return!(!this.$parent||!this.$parent.$view.parentNode)},n.prototype.shouldShow=function(){var a=this._getScrollSize();return!(!a.innerScroll&&this.$parent&&this.$parent.$view.parentNode)&&!(!a.innerScroll||this.$parent&&this.$parent.$view.parentNode)},n.prototype.shouldHide=function(){return!(this._getScrollSize().innerScroll||!this.$parent||!this.$parent.$view.parentNode)},n.prototype.toggleVisibility=function(){this.shouldHide()?this.hide():this.shouldShow()&&this.show()},n.prototype._getScaleOffset=function(a){var r=0;return!a||a.$config.view!="timeline"&&a.$config.view!="grid"||(r=a.$content.$getConfig().scale_height),r},n.prototype._getScrollOffset=function(){var a=0;if(this._isVertical()){var r=this.$parent.$parent;a=Math.max(this._getScaleOffset(r.getPrevSibling(this.$parent.$id)),this._getScaleOffset(r.getNextSibling(this.$parent.$id)))}else for(var s=this._getLinkedViews(),o=0;o=0&&(!a[y]||a.deltaX||a.wheelDeltaX||(g=2*f,f=0)),g&&Math.abs(g)>Math.abs(f)){if(this._isVertical())return;if(s.x||!this.$scroll_hor||!this.$scroll_hor.offsetWidth)return!0;var v=g/-40,b=this._oldLeft,_=b+30*v;if(this.scrollHorizontally(_),this.$scroll_hor.scrollLeft=_,b==this.$scroll_hor.scrollLeft)return!0;this._oldLeft=this.$scroll_hor.scrollLeft}else{if(this._isHorizontal())return;if(s.y||!this.$scroll_ver||!this.$scroll_ver.offsetHeight)return!0;v=f/-40,f===void 0&&(v=a.detail);var m=this._oldTop,p=this.$scroll_ver.scrollTop+30*v;if(this.scrollVertically(p),this.$scroll_ver.scrollTop=p,m==this.$scroll_ver.scrollTop)return!0;this._oldTop=this.$scroll_ver.scrollTop}return a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,!1}},n}(It);function hn(t){var e={},n={},i=null,a=-1,r=null,s=function(o){var l=-1,d=-1;return{resetCache:function(){l=-1,d=-1},_getRowHeight:function(){return l===-1&&(l=o.$getConfig().row_height),l},_refreshState:function(){this.resetCache(),d=!0;var c=o.$config.rowStore;if(c)for(var u=this._getRowHeight(),h=0;h=c&&o",this.$task=t.childNodes[0],this.$task.innerHTML="
",this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_data.innerHTML="
",this.$task_bg=this.$task_data.childNodes[0],this.$task_baselines=this.$task_data.childNodes[1],this.$task_links=this.$task_data.childNodes[2],this.$task_bars=this.$task_data.childNodes[3],this.$task_constraints=this.$task_data.childNodes[4],this.$task_deadlines=this.$task_data.childNodes[5],this._tasks={col_width:0,width:[],full_width:0,trace_x:[],rendered:{}};var e=this.$getConfig(),n=e[this.$config.bind+"_attribute"],i=e[this.$config.bindLinks+"_attribute"];!n&&this.$config.bind&&(n="data-"+this.$config.bind+"-id"),!i&&this.$config.bindLinks&&(i="data-"+this.$config.bindLinks+"-id"),this.$config.item_attribute=n||null,this.$config.link_attribute=i||null;var a=this._createLayerConfig();this.$config.layers||(this.$config.layers=a.tasks),this.$config.linkLayers||(this.$config.linkLayers=a.links),this._attachLayers(this.$gantt),this.callEvent("onReady",[]),this.$gantt.ext.dragTimeline&&(this._timelineDragScroll=this.$gantt.ext.dragTimeline.create(),this._timelineDragScroll.attach(this))},setSize:function(t,e){var n=this.$getConfig();if(1*t===t&&(this.$config.width=t),1*e===e){this.$config.height=e;var i=Math.max(this.$config.height-n.scale_height);this.$task_data.style.height=i+"px"}this.refresh(),this.$task_bg.style.backgroundImage="",n.smart_rendering&&this.$config.rowStore?this.$task_bg.style.height=this.getTotalHeight()+"px":this.$task_bg.style.height="";for(var a=this._tasks,r=this.$task_data.childNodes,s=0,o=r.length;s'+this._prepareScaleHtml(t[r],e,n,r)+"")}return i.join("")},_prepareScaleHtml:function(t,e,n,i){var a=this.$getConfig(),r=this.$gantt.templates,s=[],o=null,l=null,d=t.format||t.template||t.date;typeof d=="string"&&(d=this.$gantt.date.date_to_str(d));var c=0,u=t.count;!a.smart_scales||isNaN(e)||isNaN(n)||(c=Tt(t.left,e),u=Tt(t.left,n)+1),l=t.css||function(){},!t.css&&a.inherit_scale_class&&(l=r.scale_cell_class);for(var h=c;hw||k===!0){if(yp.x_end&&f>w){let x=p.x_end-y-10,S="-100%";x${g}`;s.push(m)}}return s.join("")},dateFromPos:function(t){var e=this._tasks;if(t<0||t>e.full_width||!e.full_width)return null;var n=Tt(this._tasks.left,t),i=this._tasks.left[n],a=e.width[n]||e.col_width,r=0;a&&(r=(t-i)/a,e.rtl&&(r=1-r));var s=0;return r&&(s=this._getColumnDuration(e,e.trace_x[n])),new Date(e.trace_x[n].valueOf()+Math.round(r*s))},posFromDate:function(t){if(!this.isVisible()||!t)return 0;var e=String(t.valueOf());if(this._posFromDateCache[e]!==void 0)return this._posFromDateCache[e];var n=this.columnIndexByDate(t);this.$gantt.assert(n>=0,"Invalid day index");var i=Math.floor(n),a=n%1,r=this._tasks.left[Math.min(i,this._tasks.width.length-1)];i==this._tasks.width.length&&(r+=this._tasks.width[this._tasks.width.length-1]),a&&(i=a.max_date)return this._tasks.rtl?0:n.length;var r=Tt(n,e),s=this._getClosestVisibleColumn(r,n,i),o=n[s],l=this._tasks.trace_index_transition;if(!o)return l?l[0]:0;var d=(t-n[s])/this._getColumnDuration(this._tasks,n[s]);return l?l[s]+(1-d):s+d},getItemPosition:function(t,e,n){var i,a,r;let s=e||t.start_date||t.$auto_start_date,o=n||t.end_date||t.$auto_end_date;return this._tasks.rtl?(a=this.posFromDate(s),i=this.posFromDate(o)):(i=this.posFromDate(s),a=this.posFromDate(o)),r=Math.max(a-i,0),{left:i,top:this.getItemTop(t.id),height:this.getBarHeight(t.id),width:r,rowHeight:this.getItemHeight(t.id)}},getBarHeight:function(t,e){var n=this.$getConfig(),i=this.$config.rowStore.getItem(t),a=i.task_height||i.bar_height||n.bar_height||n.task_height,r=this.getItemHeight(t);return a=="full"&&(a=r-(n.bar_height_padding||3)),a=Math.min(a,r),e&&(a=Math.round(a/Math.sqrt(2))),Math.max(a,0)},getScale:function(){return this._tasks},_getScales:function(){var t=this.$getConfig(),e=this.$scaleHelper,n=[e.primaryScale(t)].concat(e.getSubScales(t));return e.sortScales(n),n},_getColumnDuration:function(t,e){return this.$gantt.date.add(e,t.step,t.unit)-e},_bindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);if(this.$config.rowStore=t,t&&!t._timelineCacheAttached){var e=this;t._timelineCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})}}},_unbindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);t&&t._timelineCacheAttached&&(t.detachEvent(t._timelineCacheAttached),t._timelineCacheAttached=!1)}},refresh:function(){this._bindStore(),this.$config.bindLinks&&(this.$config.linkStore=this.$gantt.getDatastore(this.$config.bindLinks)),this._resetTopPositionHeight(),this._resetHeight(),this._initStaticBackgroundRender(),this._render_tasks_scales()},destructor:function(){var t=this.$gantt;this._clearLayers(t),this._unbindStore(),this.$task=null,this.$task_scale=null,this.$task_data=null,this.$task_bg=null,this.$task_links=null,this.$task_bars=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.$config.linkStore&&(this.$config.linkStore=null),this._timelineDragScroll&&(this._timelineDragScroll.destructor(),this._timelineDragScroll=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}};class ma{constructor(e){this._scrollOrder=0;const{gantt:n,grid:i,dnd:a,getCurrentX:r}=e;this.$gantt=n,this.$grid=i,this._dnd=a,this.getCurrentX=r,this._scrollView=this.$gantt.$ui.getView(this.$grid.$config.scrollX),this.attachEvents()}attachEvents(){this.isScrollable()&&(this._dnd.attachEvent("onDragMove",(e,n)=>{const i=this.$grid.$grid.getBoundingClientRect(),a=i.right,r=i.left,s=this.getCurrentX(n.clientX);return s>=a-20&&(this.autoscrollRight(),this.autoscrollStart()),s<=r+20&&(this.autoscrollLeft(),this.autoscrollStart()),sr+20&&this.autoscrollStop(),!0}),this._dnd.attachEvent("onDragEnd",()=>{this.autoscrollStop()}))}autoscrollStart(){if(this._scrollOrder===0)return;const e=10*this._scrollOrder,n=this._scrollView.getScrollState();this._scrollView.scrollTo(n.position+e),setTimeout(()=>{this.autoscrollStart()},50)}autoscrollRight(){this._scrollOrder=1}autoscrollLeft(){this._scrollOrder=-1}autoscrollStop(){this._scrollOrder=0}getCorrection(){return this.isScrollable()?this._scrollView.getScrollState().position:0}isScrollable(){return!!this.$grid.$config.scrollable}}const _n="data-column-id";class va{constructor(e,n){this._targetMarker=null,this.calculateCurrentPosition=i=>{const a=this.$grid.$grid.getBoundingClientRect(),r=a.right,s=a.left;let o=i;return o>r&&(o=r),o{if(this._draggedCell=this.$gantt.utils.dom.closest(n.target,".gantt_grid_head_cell"),!this._draggedCell)return;const i=this.$grid.$getConfig().columns,a=this._draggedCell.getAttribute(_n);let r,s;return i.map(function(o,l){o.name===a&&(r=o,s=l)}),this.$grid.callEvent("onBeforeColumnDragStart",[{draggedColumn:r,draggedIndex:s}])!==!1&&!(!this._draggedCell||!r)&&(this._gridConfig=this.$grid.$getConfig(),this._originAutoscroll=this.$gantt.config.autoscroll,this.$gantt.config.autoscroll=!1,!0)}),this._dnd.attachEvent("onAfterDragStart",(e,n)=>{this._draggedCell&&(this._dnd.config.column=this._draggedCell.getAttribute(_n),this._dnd.config.marker.innerHTML=this._draggedCell.outerHTML,this._dnd.config.marker.classList.add("gantt_column_drag_marker"),this._dnd.config.marker.style.height=this._gridConfig.scale_height+"px",this._dnd.config.marker.style.lineHeight=this._gridConfig.scale_height+"px",this._draggedCell.classList.add("gantt_grid_head_cell_dragged"))}),this._dnd.attachEvent("onDragMove",(e,n)=>{if(!this._draggedCell)return;this._dragX=n.clientX;const i=this.calculateCurrentPosition(n.clientX),a=this.findColumnsIndexes(),r=a.targetIndex,s=a.draggedIndex,o=this.$grid.$getConfig().columns,l=o[s],d=o[r];return this.$grid.callEvent("onColumnDragMove",[{draggedColumn:l,targetColumn:d,draggedIndex:s,targetIndex:r}])===!1?(this.cleanTargetMarker(),!1):(this.setMarkerPosition(i),this.drawTargetMarker(a),!0)}),this._dnd.attachEvent("onDragEnd",()=>{this._draggedCell&&(this.$gantt.config.autoscroll=this._originAutoscroll,this._draggedCell.classList.remove("gantt_grid_head_cell_dragged"),this.cleanTargetMarker(),this.reorderColumns())})}reorderColumns(){const{targetIndex:e,draggedIndex:n}=this.findColumnsIndexes(),i=this.$grid.$getConfig().columns,a=i[n],r=i[e];this.$grid.callEvent("onBeforeColumnReorder",[{draggedColumn:a,targetColumn:r,draggedIndex:n,targetIndex:e}])!==!1&&e!==n&&(i.splice(n,1),i.splice(e,0,a),this.$gantt.render(),this.$grid.callEvent("onAfterColumnReorder",[{draggedColumn:a,targetColumn:r,draggedIndex:n,targetIndex:e}]))}findColumnsIndexes(){const e=this._dnd.config.column,n=this.$grid.$getConfig().columns;let i,a,r,s;const o={startX:0,endX:0};let l,d=0,c=n.length-1,u=(f,y)=>f<=y,h=f=>++f;this.$gantt.config.rtl&&(d=n.length-1,c=0,u=(f,y)=>f>=y,h=f=>--f);const g=this._dragX-this.$grid.$grid.getBoundingClientRect().left+this._scrollableGrid.getCorrection();for(let f=d;u(f,c)&&(i===void 0||a===void 0);f=h(f))n[f].hide||(o.startX=o.endX,o.endX+=n[f].width,g>=o.startX&&(g<=o.endX||!u(h(f),c))&&(i=f,r=o.startX,s=o.endX,l=(g-o.startX)/(o.endX-o.startX)),e===n[f].name&&(a=f));return{targetIndex:i,draggedIndex:a,xBefore:r,xAfter:s,columnRelativePos:l}}setMarkerPosition(e,n=10){const{marker:i}=this._dnd.config,a=this._dnd._obj.getBoundingClientRect();i.style.top=`${a.y+n}px`,i.style.left=`${e}px`}drawTargetMarker({targetIndex:e,draggedIndex:n,xBefore:i,xAfter:a,columnRelativePos:r}){let s;this._targetMarker||(this._targetMarker=document.createElement("div"),bt(this._targetMarker,"gantt_grid_target_marker"),this._targetMarker.style.display="none",this._targetMarker.style.height=`${this._gridConfig.scale_height}px`),this._targetMarker.parentNode||this.$grid.$grid_scale.appendChild(this._targetMarker),s=e>n?a:e.5?a:i,this._targetMarker.style.left=`${s}px`,this._targetMarker.style.display="block"}cleanTargetMarker(){this._targetMarker&&this._targetMarker.parentNode&&this.$grid.$grid_scale.removeChild(this._targetMarker),this._targetMarker=null}}function me(t){var e=[];return{delegate:function(n,i,a,r){e.push([n,i,a,r]),t.$services.getService("mouseEvents").delegate(n,i,a,r)},destructor:function(){for(var n=t.$services.getService("mouseEvents"),i=0;i",this.$grid=t.childNodes[0],this.$grid.innerHTML="
",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1];var s=a[this.$config.bind+"_attribute"];if(!s&&this.$config.bind&&(s="data-"+this.$config.bind+"-id"),this.$config.item_attribute=s||null,!this.$config.layers){var o=this._createLayerConfig();this.$config.layers=o}var l={init:function(){},doOnRender:function(){}};this._renderHeaderResizers=l.doOnRender,this._mouseDelegates=me(e);var d=function(c,u){var h={row_before_start:c.bind(function(g,f,y){var v=u.$getConfig(),b=u.$config.rowStore;if(!tt(y,v.task_grid_row_resizer_attribute))return!1;var _=this.locate(y,v.task_grid_row_resizer_attribute),m=b.getItem(_);return u.callEvent("onBeforeRowResize",[m])!==!1&&void 0},c),row_after_start:c.bind(function(g,f,y){var v=u.$getConfig(),b=this.locate(y,v.task_grid_row_resizer_attribute);g.config.marker.innerHTML="",g.config.marker.className+=" gantt_row_grid_resize_area",g.config.marker.style.width=u.$grid.offsetWidth+"px",g.config.drag_id=b},c),row_drag_move:c.bind(function(g,f,y){var v=u.$config.rowStore,b=u.$getConfig(),_=g.config,m=_.drag_id,p=u.getItemHeight(m),k=u.getItemTop(m)-f.scrollTop,$=z(u.$grid_data),w=parseInt(_.marker.style.top,10),x=k+$.y,S=0,T=b.min_task_grid_row_height;return(S=w-x)c.max_width&&(u=c.max_width-c.width),a-=c.width,c.width+=u,l-=u}for(var h=l>0?1:-1;l>0&&h===1||l<0&&h===-1;){var g=l;for(s=e+1;s-1&&(f=i[e].width+l)==this._getColumnWidth(i[e],n,f)&&(i[e].width=f),this._getColsTotalWidth()},_getColsTotalWidth:function(){for(var t=this.getGridColumns(),e=0,n=0;ns+h&&(u.width=h=g-s),s+=h;var f=t._sort&&u.name==t._sort.name?`
`:"",y=["gantt_grid_head_cell","gantt_grid_head_"+u.name,c?"gantt_last_cell":"",i.grid_header_class(u.name,u)].join(" "),v="width:"+(h-(c?1:0))+"px;",b=u.label||o["column_"+u.name]||o[u.name];b=b||"";var _="
"+b+f+"
";r.push(_)}this.$grid_scale.style.height=e.scale_height+"px",this.$grid_scale.style.lineHeight=l+"px",this.$grid_scale.innerHTML=r.join(""),this._renderHeaderResizers&&this._renderHeaderResizers()},_getGridWidth:function(){return this.$config.width},destructor:function(){this._clearLayers(this.$gantt),this._mouseDelegates&&(this._mouseDelegates.destructor(),this._mouseDelegates=null),this._unbindStore(),this.$grid=null,this.$grid_scale=null,this.$grid_data=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}};const ka={init:function(t,e){var n=e.$gantt;n.attachEvent("onTaskClick",function(i,a){if(n._is_icon_open_click(a))return!0;var r=t.getState(),s=t.locateCell(a.target);return!s||!t.getEditorConfig(s.columnName)||(t.isVisible()&&r.id==s.id&&r.columnName==s.columnName||t.startEdit(s.id,s.columnName),!1)}),n.attachEvent("onEmptyClick",function(){return t.isVisible()&&t.isChanged()?t.save():t.hide(),!0}),n.attachEvent("onTaskDblClick",function(i,a){var r=t.getState(),s=t.locateCell(a.target);return!s||!t.isVisible()||s.columnName!=r.columnName})},onShow:function(t,e,n){var i=n.$gantt;i.ext&&i.ext.keyboardNavigation&&i.ext.keyboardNavigation.attachEvent("onKeyDown",function(a,r){var s=i.constants.KEY_CODES,o=!1;return r.keyCode===s.SPACE&&t.isVisible()&&(o=!0),!o}),e.onkeydown=function(a){a=a||window.event;var r=i.constants.KEY_CODES;if(!(a.defaultPrevented||a.shiftKey&&a.keyCode!=r.TAB)){var s=!0;switch(a.keyCode){case i.keys.edit_save:t.save();break;case i.keys.edit_cancel:t.hide();break;case r.UP:case r.DOWN:t.isVisible()&&(t.hide(),s=!1);break;case r.TAB:a.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);break;default:s=!1}s&&a.preventDefault()}}},onHide:function(){},destroy:function(){}},ya={init:function(t,e){var n=t,i=e.$gantt,a=null,r=i.ext.keyboardNavigation;r.attachEvent("onBeforeFocus",function(s){var o=t.locateCell(s);if(clearTimeout(a),o){var l=o.columnName,d=o.id,c=n.getState();if(n.isVisible()&&c.id==d&&c.columnName===l)return!1}return!0}),r.attachEvent("onFocus",function(s){var o=t.locateCell(s),l=t.getState();return clearTimeout(a),!o||o.id==l.id&&o.columnName==l.columnName||n.isVisible()&&n.save(),!0}),t.attachEvent("onHide",function(){clearTimeout(a)}),r.attachEvent("onBlur",function(){return a=setTimeout(function(){n.save()}),!0}),i.attachEvent("onTaskDblClick",function(s,o){var l=t.getState(),d=t.locateCell(o.target);return!d||!t.isVisible()||d.columnName!=l.columnName}),i.attachEvent("onTaskClick",function(s,o){if(i._is_icon_open_click(o))return!0;var l=t.getState(),d=t.locateCell(o.target);return!d||!t.getEditorConfig(d.columnName)||(t.isVisible()&&l.id==d.id&&l.columnName==d.columnName||t.startEdit(d.id,d.columnName),!1)}),i.attachEvent("onEmptyClick",function(){return n.save(),!0}),r.attachEvent("onKeyDown",function(s,o){var l=t.locateCell(o.target),d=!!l&&t.getEditorConfig(l.columnName),c=t.getState(),u=i.constants.KEY_CODES,h=o.keyCode,g=!1;switch(h){case u.ENTER:t.isVisible()?(t.save(),o.preventDefault(),g=!0):d&&!(o.ctrlKey||o.metaKey||o.shiftKey)&&(n.startEdit(l.id,l.columnName),o.preventDefault(),g=!0);break;case u.ESC:t.isVisible()&&(t.hide(),o.preventDefault(),g=!0);break;case u.UP:case u.DOWN:break;case u.LEFT:case u.RIGHT:(d&&t.isVisible()||c.editorType==="date")&&(g=!0);break;case u.SPACE:t.isVisible()&&(g=!0),d&&!t.isVisible()&&(n.startEdit(l.id,l.columnName),o.preventDefault(),g=!0);break;case u.DELETE:d&&!t.isVisible()?(n.startEdit(l.id,l.columnName),g=!0):d&&t.isVisible()&&(g=!0);break;case u.TAB:if(t.isVisible()){o.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);var f=t.getState();f.id&&r.focus({type:"taskCell",id:f.id,column:f.columnName}),o.preventDefault(),g=!0}break;default:if(t.isVisible())g=!0;else if(h>=48&&h<=57||h>95&&h<112||h>=64&&h<=91||h>185&&h<193||h>218&&h<223){var y=s.modifiers,v=y.alt||y.ctrl||y.meta||y.shift;y.alt||v&&r.getCommandHandler(s,"taskCell")||d&&!t.isVisible()&&(n.startEdit(l.id,l.columnName),g=!0)}}return!g})},onShow:function(t,e,n){},onHide:function(t,e,n){const i=n.$gantt;i&&i.focus()},destroy:function(){}};function St(t){var e=function(){};return e.prototype={show:function(n,i,a,r){},hide:function(){},set_value:function(n,i,a,r){this.get_input(r).value=n},get_value:function(n,i,a){return this.get_input(a).value||""},is_changed:function(n,i,a,r){var s=this.get_value(i,a,r);return s&&n&&s.valueOf&&n.valueOf?s.valueOf()!=n.valueOf():s!=n},is_valid:function(n,i,a,r){return!0},save:function(n,i,a){},get_input:function(n){return n.querySelector("input")},focus:function(n){var i=this.get_input(n);i&&(i.focus&&i.focus(),i.select&&i.select())}},e}function ba(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){var o=`
`;s.innerHTML=o}},!0),n}function xa(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){var o=r.min||0,l=r.max||100,d=`
`;s.innerHTML=d,s.oninput=function(c){+c.target.valuel&&(c.target.value=l)}},get_value:function(i,a,r){return this.get_input(r).value||""},is_valid:function(i,a,r,s){return!isNaN(parseInt(i,10))}},!0),n}function $a(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){for(var o=`
",s.innerHTML=o},get_input:function(i){return i.querySelector("select")}},!0),n}function wa(t){var e=St(),n="%Y-%m-%d",i=null,a=null;function r(){return e.apply(this,arguments)||this}return B(r,e),N(r.prototype,{show:function(s,o,l,d){i||(i=t.date.date_to_str(n)),a||(a=t.date.str_to_date(n));var c=null,u=null;c=typeof l.min=="function"?l.min(s,o):l.min,u=typeof l.max=="function"?l.max(s,o):l.max;var h=`
`;d.innerHTML=h,d.oninput=function(g){+t.date.str_to_date("%Y-%m-%d")(g.target.value)<+c&&(g.target.value=t.date.date_to_str("%Y-%m-%d")(c)),+t.date.str_to_date("%Y-%m-%d")(g.target.value)>+u&&(g.target.value=t.date.date_to_str("%Y-%m-%d")(u))}},set_value:function(s,o,l,d){s&&s.getFullYear?this.get_input(d).value=i(s):this.get_input(d).value=s},is_valid:function(s,o,l,d){return!(!s||isNaN(s.getTime()))},get_value:function(s,o,l){var d;try{d=a(this.get_input(l).value||"")}catch{d=null}return d}},!0),r}function Sa(t){var e=St();function n(){return e.apply(this,arguments)||this}function i(l){return l.formatter||t.ext.formatters.linkFormatter()}function a(l,d){for(var c=(l||"").split(d.delimiter||","),u=0;u`;u.innerHTML=h},hide:function(){},set_value:function(l,d,c,u){this.get_input(u).value=r(l,c.editor,t)},get_value:function(l,d,c){return a(this.get_input(c).value||"",d.editor)},save:function(l,d,c){var u=o(t.getTask(l),this.get_value(l,d,c),d.editor);(u.add.length||u.remove.length)&&t.batchUpdate(function(){u.add.forEach(function(h){t.addLink(h)}),u.remove.forEach(function(h){t.deleteLink(h)}),t.autoSchedule&&t.autoSchedule()})},is_changed:function(l,d,c,u){var h=this.get_value(d,c,u),g=a(r(l,c.editor,t),c.editor);return h.join()!==g.join()}},!0),n}function Ta(t){var e=St();function n(){return e.apply(this,arguments)||this}function i(a){return a.formatter||t.ext.formatters.durationFormatter()}return B(n,e),N(n.prototype,{show:function(a,r,s,o){var l=`
`;o.innerHTML=l},set_value:function(a,r,s,o){this.get_input(o).value=i(s.editor).format(a)},get_value:function(a,r,s){return i(r.editor).parse(this.get_input(s).value||"")}},!0),n}function Ca(t){return function(n,i,a){a=="keepDates"?function(r,s){s=="duration"?r.end_date=t.calculateEndDate(r):s!="end_date"&&s!="start_date"||(r.duration=t.calculateDuration(r))}(n,i):a=="keepDuration"?function(r,s){s=="end_date"?r.start_date=e(r):s!="start_date"&&s!="duration"||(r.end_date=t.calculateEndDate(r))}(n,i):function(r,s){t.config.schedule_from_end?s=="end_date"||s=="duration"?r.start_date=e(r):s=="start_date"&&(r.duration=t.calculateDuration(r)):s=="start_date"||s=="duration"?r.end_date=t.calculateEndDate(r):s=="end_date"&&(r.duration=t.calculateDuration(r))}(n,i)};function e(n){return t.calculateEndDate({start_date:n.end_date,duration:-n.duration,task:n})}}function Ea(t){t.config.editor_types={text:new(ba()),number:new(xa()),select:new($a()),date:new(wa(t)),predecessor:new(Sa(t)),duration:new(Ta(t))}}function Da(t){var e=function(a){var r=null;return{setMapping:function(s){r=s},getMapping:function(){return r||(a.config.keyboard_navigation_cells&&a.ext.keyboardNavigation?ya:ka)}}}(t),n={};it(n);var i={init:Ea,createEditors:function(a){function r(u,h){var g=a.$getConfig(),f=function(b,_){for(var m=a.$getConfig(),p=a.getItemTop(b),k=a.getItemHeight(b),$=a.getGridColumns(),w=0,x=0,S=0,T=0;T<$.length;T++){if($[T].name==_){S=$[T].width;break}m.rtl?x+=$[T].width:w+=$[T].width}return m.rtl?{top:p,right:x,height:k,width:S}:{top:p,left:w,height:k,width:S}}(u,h),y=document.createElement("div");y.className="gantt_grid_editor_placeholder",y.setAttribute(a.$config.item_attribute,u),y.setAttribute(a.$config.bind+"_id",u),y.setAttribute("data-column-name",h);var v=function(b,_){for(var m=b.getGridColumns(),p=0;p0?t.getNext:t.getPrev,g=(h=t.bind(h,t))(this._itemId);t.isTaskExists(g)&&t.isReadonly(t.getTask(g));)g=h(g);return g},editNextRow:function(u){var h=this.getState().id;if(t.isTaskExists(h)){var g=null;g=u?this.moveRow(1):t.getNext(h),t.isTaskExists(g)&&this.startEdit(g,this._columnName)}},editPrevRow:function(u){var h=this.getState().id;if(t.isTaskExists(h)){var g=null;g=u?this.moveRow(-1):t.getPrev(h),t.isTaskExists(g)&&this.startEdit(g,this._columnName)}},destructor:function(){o.forEach(function(u){d.detachEvent(u)}),l.forEach(function(u){t.detachEvent(u)}),o=[],l=[],d=null,this.hide(),this.detachAllEvents()}};return N(c,e),N(c,n),c}};return N(i,e),N(i,n),i}function ke(t,e,n,i,a){if(!t.start_date||!t.end_date)return null;var r=n.getItemTop(t.id),s=n.getItemHeight(t.id);if(r>e.y_end||r+se.x_end||c +
End date: ${l.templates.tooltip_date_format(_)}
`},baseline_text:function(b,_,m){return""}})},initTemplate:c}}(e);e.$services.setService("templateLoader",function(){return r}),it(e);var s=new Jn;s.registerProvider("global",function(){var l={min_date:e._min_date,max_date:e._max_date,selected_task:null};return e.$data&&e.$data.tasksStore&&(l.selected_task=e.$data.tasksStore.getSelectedId()),l}),e.getState=s.getState,e.$services.setService("state",function(){return s}),N(e,Hn),e.Promise=Kn,e.env=_t,function(l){var d=Zn.create();N(l,d);var c,u=l.createDatastore({name:"task",type:"treeDatastore",rootId:function(){return l.config.root_id},initItem:R(function(_){this.defined(_.id)||(_.id=this.uid()),_.start_date&&(_.start_date=l.date.parseDate(_.start_date,"parse_date")),_.end_date&&(_.end_date=l.date.parseDate(_.end_date,"parse_date"));var m=null;(_.duration||_.duration===0)&&(_.duration=m=1*_.duration),m&&(_.start_date&&!_.end_date?_.end_date=this.calculateEndDate(_):!_.start_date&&_.end_date&&(_.start_date=this.calculateEndDate({start_date:_.end_date,duration:-_.duration,task:_}))),l.config.deadlines!==!1&&_.deadline&&(_.deadline=l.date.parseDate(_.deadline,"parse_date")),_.progress=Number(_.progress)||0,this._isAllowedUnscheduledTask(_)&&this._set_default_task_timing(_),this._init_task_timing(_),_.start_date&&_.end_date&&this.correctTaskWorkTime(_),_.$source=[],_.$target=[];var p=this.$data.tasksStore.getItem(_.id);return p&&!W(_.open)&&(_.$open=p.$open),_.parent===void 0&&(_.parent=this.config.root_id),_.open&&(_.$open=!0),_},l),getConfig:function(){return l.config}}),h=l.createDatastore({name:"link",initItem:R(function(_){return this.defined(_.id)||(_.id=this.uid()),_},l)});function g(_){var m=l.isTaskVisible(_);if(!m&&l.isTaskExists(_)){var p=l.getParent(_);l.isTaskExists(p)&&l.isTaskVisible(p)&&(p=l.getTask(p),l.isSplitTask(p)&&(m=!0))}return m}function f(_){if(l.isTaskExists(_.source)){var m=l.getTask(_.source);m.$source=m.$source||[],m.$source.push(_.id)}if(l.isTaskExists(_.target)){var p=l.getTask(_.target);p.$target=p.$target||[],p.$target.push(_.id)}}function y(_){if(l.isTaskExists(_.source)){for(var m=l.getTask(_.source),p=0;pk||+m.end_date<+p)return!1}return!0}),u.attachEvent("onIdChange",function(_,m){l._update_flags(_,m);var p=l.getTask(m);u.isSilent()||(p.$split_subtask||p.rollup)&&l.eachParent(function(k){l.refreshTask(k.id)},m)}),u.attachEvent("onAfterUpdate",function(_){if(l._update_parents(_),l.getState("batchUpdate").batch_update)return!0;var m=u.getItem(_);m.$source||(m.$source=[]);for(var p=0;p-1&&k.click?k.click():(i(n,!0),p=!0)}m==27&&(i(n,!1),p=!0)}return p?(_.preventDefault&&_.preventDefault(),!(_.cancelBubble=!0)):void 0}}var r=vt(t.$root)||document;function s(_){s.cover||(s.cover=document.createElement("div"),s.cover.onkeydown=a,s.cover.className="dhx_modal_cover",document.body.appendChild(s.cover)),s.cover.style.display=_?"inline-block":"none"}function o(_,m,p){return"
"+_+"
"}function l(){for(var _=[].slice.apply(arguments,[0]),m=0;m<_.length;m++)if(_[m])return _[m]}function d(_,m,p){var k=_.tagName?_:function(x,S,T){var C=document.createElement("div"),E=rt();t._waiAria.messageModalAttr(C,E),C.className=" gantt_modal_box gantt-"+x.type,C.setAttribute(e,1);var D="";if(x.width&&(C.style.width=x.width),x.height&&(C.style.height=x.height),x.title&&(D+='
'+x.title+"
"),D+='
'+(x.content?"":x.text)+'
',S&&(D+=o(l(x.ok,t.locale.labels.message_ok,"OK"),"ok",!0)),T&&(D+=o(l(x.cancel,t.locale.labels.message_cancel,"Cancel"),"cancel",!1)),x.buttons)for(var A=0;A",C.innerHTML=D,x.content){var M=x.content;typeof M=="string"&&(M=document.getElementById(M)),M.style.display=="none"&&(M.style.display=""),C.childNodes[x.title?1:0].appendChild(M)}return C.onclick=function(L){var P=L.target||L.srcElement;if(P.className||(P=P.parentNode),lt(P,".gantt_popup_button")){var H=P.getAttribute("data-result");i(x,H=H=="true"||H!="false"&&H)}},x.box=C,(S||T)&&(n=x),C}(_,m,p);_.hidden||s(!0),document.body.appendChild(k);var $=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-k.offsetWidth)/2)),w=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-k.offsetHeight)/2));return _.position=="top"?k.style.top="-3px":k.style.top=w+"px",k.style.left=$+"px",k.onkeydown=a,y.focus(k),_.hidden&&y.hide(k),t.callEvent("onMessagePopup",[k]),k}function c(_){return d(_,!0,!1)}function u(_){return d(_,!0,!0)}function h(_){return d(_)}function g(_,m,p){return typeof _!="object"&&(typeof m=="function"&&(p=m,m=""),_={text:_,type:m,callback:p}),_}function f(_,m,p,k){return typeof _!="object"&&(_={text:_,type:m,expire:p,id:k}),_.id=_.id||rt(),_.expire=_.expire||v.expire,_}t.event(r,"keydown",a,!0);var y=function(){var _=g.apply(this,arguments);return _.type=_.type||"alert",h(_)};y.hide=function(_){for(;_&&_.getAttribute&&!_.getAttribute(e);)_=_.parentNode;_&&(_.parentNode.removeChild(_),s(!1),t.callEvent("onAfterMessagePopup",[_]))},y.focus=function(_){setTimeout(function(){var m=Zt(_);m.length&&m[0].focus&&m[0].focus()},1)};var v=function(_,m,p,k){switch((_=f.apply(this,arguments)).type=_.type||"info",_.type.split("-")[0]){case"alert":return c(_);case"confirm":return u(_);case"modalbox":return h(_);default:return function($){v.area||(v.area=document.createElement("div"),v.area.className="gantt_message_area",v.area.style[v.position]="5px",document.body.appendChild(v.area)),v.hide($.id);var w=document.createElement("div");return w.innerHTML="
"+$.text+"
",w.className="gantt-info gantt-"+$.type,w.onclick=function(){v.hide($.id),$=null},t._waiAria.messageInfoAttr(w),v.position=="bottom"&&v.area.firstChild?v.area.insertBefore(w,v.area.firstChild):v.area.appendChild(w),$.expire>0&&(v.timers[$.id]=window.setTimeout(function(){v&&v.hide($.id)},$.expire)),v.pull[$.id]=w,w=null,$.id}(_)}};v.seed=new Date().valueOf(),v.uid=rt,v.expire=4e3,v.keyboard=!0,v.position="top",v.pull={},v.timers={},v.hideAll=function(){for(var _ in v.pull)v.hide(_)},v.hide=function(_){var m=v.pull[_];m&&m.parentNode&&(window.setTimeout(function(){m.parentNode.removeChild(m),m=null},2e3),m.className+=" hidden",v.timers[_]&&window.clearTimeout(v.timers[_]),delete v.pull[_])};var b=[];return t.attachEvent("onMessagePopup",function(_){b.push(_)}),t.attachEvent("onAfterMessagePopup",function(_){for(var m=0;mt.x_end||e.left+e.widtht.y_end||e.top+e.heightd.x&&g.topd.y&&c.push(h.id)}return{ids:c}}}function cn(t,e,n,i,a){var r=n.$gantt.getTask(t.source),s=n.$gantt.getTask(t.target),o=n.getItemTop(r.id),l=n.getItemHeight(r.id),d=n.getItemTop(s.id),c=n.getItemHeight(s.id);if(e.y>o+l&&e.y>d+c||e.y_endg){var v=g;g=h,h=v}return f>y&&(v=y,y=f,f=v),h+=-100,g+=u,f+=-100,y+=u,!(e.x>g&&e.x>y)&&!(e.x_endr.maxWidth&&(i=r.maxWidth),ar.maxHeight&&(a=r.maxHeight),this.setSize(i,a),this.$preResize,this.$preResize=!1},t.prototype.hide=function(){this._hide(!0),this.resize()},t.prototype.show=function(e){this._hide(!1),e&&this.$parent&&this.$parent.show(),this.resize()},t.prototype._hide=function(e){if(e===!0&&this.$view.parentNode)this.$view.parentNode.removeChild(this.$view);else if(e===!1&&!this.$view.parentNode){var n=this.$parent.cellIndex(this.$id);this.$parent.moveView(this,n)}this.$config.hidden=e},t.prototype.$toHTML=function(e,n){e===void 0&&(e=""),n=[n||"",this.$config.css||""].join(" ");var i=this.$config,a="";return i.raw?e=typeof i.raw=="string"?i.raw:"":(e||(e="
"+(i.html||"")+"
"),i.header&&(a="
"+(i.canCollapse?"
":"")+"
"+i.header+"
")),"
"+a+e+"
"},t.prototype.$fill=function(e,n){this.$view=e,this.$parent=n,this.init()},t.prototype.getNode=function(){return this.$view.querySelector("gantt_layout_cell")||this.$view},t.prototype.init=function(){var e=this;this._headerClickHandler=function(n){tt(n,"data-cell-id")==e.$id&&e.toggle()},this.$gantt.$services.getService("mouseEvents").delegate("click","gantt_header_arrow",this._headerClickHandler),this.callEvent("onReady",[])},t.prototype.toggle=function(){this.$config.collapsed=!this.$config.collapsed,this.resize()},t.prototype.getSize=function(){var e={height:this.$config.height||0,width:this.$config.width||0,gravity:this.$config.gravity||1,minHeight:this.$config.minHeight||0,minWidth:this.$config.minWidth||0,maxHeight:this.$config.maxHeight||1e11,maxWidth:this.$config.maxWidth||1e11};if(this.$config.collapsed){var n=this.$config.mode==="x";e[n?"width":"height"]=e[n?"maxWidth":"maxHeight"]=this.$config.headerHeight}return e},t.prototype.getContentSize=function(){var e=this.$lastSize.contentX;e!==1*e&&(e=this.$lastSize.width);var n=this.$lastSize.contentY;return n!==1*n&&(n=this.$lastSize.height),{width:e,height:n}},t.prototype._getBorderSizes=function(){var e={top:0,right:0,bottom:0,left:0,horizontal:0,vertical:0};return this._currentBorders&&(this._currentBorders[this._borders.left]&&(e.left=1,e.horizontal++),this._currentBorders[this._borders.right]&&(e.right=1,e.horizontal++),this._currentBorders[this._borders.top]&&(e.top=1,e.vertical++),this._currentBorders[this._borders.bottom]&&(e.bottom=1,e.vertical++)),e},t.prototype.setSize=function(e,n){this.$view.style.width=e+"px",this.$view.style.height=n+"px";var i=this._getBorderSizes(),a=n-i.vertical,r=e-i.horizontal;this.$lastSize={x:e,y:n,contentX:r,contentY:a},this.$config.header?this._sizeHeader():this._sizeContent()},t.prototype._borders={left:"gantt_layout_cell_border_left",right:"gantt_layout_cell_border_right",top:"gantt_layout_cell_border_top",bottom:"gantt_layout_cell_border_bottom"},t.prototype._setBorders=function(e,n){n||(n=this);var i=n.$view;for(var a in this._borders)Ht(i,this._borders[a]);typeof e=="string"&&(e=[e]);var r={};for(a=0;a0?n[l].$parent.getNextSibling(n[l].$id):n[l].$parent.getPrevSibling(n[l].$id);c.$name=="resizer"&&(c=r>0?c.$parent.getNextSibling(c.$id):c.$parent.getPrevSibling(c.$id));var u=c.getSize();if(o)n[l].$config.gravity=s;else if(c[a]){var h=d.gravity+u.gravity,g=d[a]+u[a],f=h/g;n[l].$config.gravity=f*s,c.$config[a]=g-s,c.$config.gravity=h-f*s}else n[l].$config[a]=s;var y=this.$gantt.$ui.getView("grid");!y||n[l].$content!==y||y.$config.scrollable||o||(this.$gantt.config.grid_width=s)}},e.prototype.resize=function(n){var i=!1;if(this.$root&&!this._resizeInProgress&&(this.callEvent("onBeforeResize",[]),i=!0,this._resizeInProgress=!0),t.prototype.resize.call(this,!0),t.prototype.resize.call(this,!1),i){var a=[];a=(a=(a=a.concat(this.getCellsByType("viewCell"))).concat(this.getCellsByType("viewLayout"))).concat(this.getCellsByType("hostCell"));for(var r=this.getCellsByType("scroller"),s=0;s=0&&this.$cells[i+1]?this.$cells[i+1]:null},e.prototype.getPrevSibling=function(n){var i=this.cellIndex(n);return i>=0&&this.$cells[i-1]?this.$cells[i-1]:null},e.prototype.cell=function(n){for(var i=0;i=a.childNodes.length?a.appendChild(n.$view):a.insertBefore(n.$view,a.childNodes[i])},e.prototype._parseConfig=function(n){this.$cells=[],this._xLayout=!n.rows;for(var i=n.rows||n.cols||n.views,a=0;a=0;r--){var s=this.$cells[r];s.$fill(a[r],this),s.$config.hidden&&s.$view.parentNode.removeChild(s.$view)}},e.prototype.$toHTML=function(){for(var n=this._xLayout?"x":"y",i=[],a=0;a=1e5&&(c.maxWidth=a),c.maxHeight>=1e5&&(c.maxHeight=s),c.minWidth=c.minWidth!=c.minWidth?0:c.minWidth,c.minHeight=c.minHeight!=c.minHeight?0:c.minHeight,this._xLayout?(c.minWidth+=this.$config.margin*this.$cells.length||0,c.minWidth+=2*this.$config.padding||0,c.minHeight+=2*this.$config.padding||0):(c.minHeight+=this.$config.margin*this.$cells.length||0,c.minHeight+=2*this.$config.padding||0),c},e.prototype._calcFreeSpace=function(n,i,a){var r=a?i.minWidth:i.minHeight,s=i.maxWidth,o=n;return o?(o>s&&(o=s),os&&(o=s,this._free-=o,this._gravity-=i.gravity),oo&&(r=o),r=0;r--)if(!i[r].$config.hidden){a=r;break}for(r=0;r=a,o="";!s&&i[r+1]&&i[r+1].$config.view=="scrollbar"&&(this._xLayout?s=!0:o="gantt_layout_cell_border_transparent"),this._setBorders(s?[]:[n,o],i[r])}},e.prototype._updateCellVisibility=function(){for(var n=this._visibleCells||{},i=!this._visibleCells,a={},r=null,s=[],o=0;o
"},n.prototype._getRootParent=function(){for(var a=this.$parent;a&&a.$parent;)a=a.$parent;if(a)return a},n.prototype._eachView=function(){var a=[];return i(this._getRootParent(),a),a},n.prototype._getLinkedViews=function(){for(var a=this._eachView(),r=[],s=0;sy[u]&&y[c]>r&&f>y[u]-h+2&&(r=f+(o?0:2),s=y[u]);else{var v=Math.max(y[c]-f,0);(f+=v)>Math.max(y[u]-v,0)&&f>r&&(r=f,s=y[u])}}return{outerScroll:s,innerScroll:r}},n.prototype.scroll=function(a){this._isHorizontal()?this.scrollHorizontally(a):this.scrollVertically(a)},n.prototype.getScrollState=function(){return{visible:this.isVisible(),direction:this.$config.scroll,size:this.$config.outerSize,scrollSize:this.$config.scrollSize||0,position:this.$config.scrollPosition||0}},n.prototype.setSize=function(a,r){t.prototype.setSize.apply(this,arguments);var s=this._getScrollSize(),o=(this._isVertical()?r:a)-this._getScrollOffset()+(this._isHorizontal()?1:0);s.innerScroll&&o>s.outerScroll&&(s.innerScroll+=o-s.outerScroll),this.$config.scrollSize=s.innerScroll,this.$config.width=a,this.$config.height=r,this._setScrollSize(s.innerScroll)},n.prototype.isVisible=function(){return!(!this.$parent||!this.$parent.$view.parentNode)},n.prototype.shouldShow=function(){var a=this._getScrollSize();return!(!a.innerScroll&&this.$parent&&this.$parent.$view.parentNode)&&!(!a.innerScroll||this.$parent&&this.$parent.$view.parentNode)},n.prototype.shouldHide=function(){return!(this._getScrollSize().innerScroll||!this.$parent||!this.$parent.$view.parentNode)},n.prototype.toggleVisibility=function(){this.shouldHide()?this.hide():this.shouldShow()&&this.show()},n.prototype._getScaleOffset=function(a){var r=0;return!a||a.$config.view!="timeline"&&a.$config.view!="grid"||(r=a.$content.$getConfig().scale_height),r},n.prototype._getScrollOffset=function(){var a=0;if(this._isVertical()){var r=this.$parent.$parent;a=Math.max(this._getScaleOffset(r.getPrevSibling(this.$parent.$id)),this._getScaleOffset(r.getNextSibling(this.$parent.$id)))}else for(var s=this._getLinkedViews(),o=0;o=0&&(!a[y]||a.deltaX||a.wheelDeltaX||(g=2*f,f=0)),g&&Math.abs(g)>Math.abs(f)){if(this._isVertical())return;if(s.x||!this.$scroll_hor||!this.$scroll_hor.offsetWidth)return!0;var v=g/-40,b=this._oldLeft,_=b+30*v;if(this.scrollHorizontally(_),this.$scroll_hor.scrollLeft=_,b==this.$scroll_hor.scrollLeft)return!0;this._oldLeft=this.$scroll_hor.scrollLeft}else{if(this._isHorizontal())return;if(s.y||!this.$scroll_ver||!this.$scroll_ver.offsetHeight)return!0;v=f/-40,f===void 0&&(v=a.detail);var m=this._oldTop,p=this.$scroll_ver.scrollTop+30*v;if(this.scrollVertically(p),this.$scroll_ver.scrollTop=p,m==this.$scroll_ver.scrollTop)return!0;this._oldTop=this.$scroll_ver.scrollTop}return a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,!1}},n}(It);function hn(t){var e={},n={},i=null,a=-1,r=null,s=function(o){var l=-1,d=-1;return{resetCache:function(){l=-1,d=-1},_getRowHeight:function(){return l===-1&&(l=o.$getConfig().row_height),l},_refreshState:function(){this.resetCache(),d=!0;var c=o.$config.rowStore;if(c)for(var u=this._getRowHeight(),h=0;h=c&&o",this.$task=t.childNodes[0],this.$task.innerHTML="
",this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_data.innerHTML="
",this.$task_bg=this.$task_data.childNodes[0],this.$task_baselines=this.$task_data.childNodes[1],this.$task_links=this.$task_data.childNodes[2],this.$task_bars=this.$task_data.childNodes[3],this.$task_constraints=this.$task_data.childNodes[4],this.$task_deadlines=this.$task_data.childNodes[5],this._tasks={col_width:0,width:[],full_width:0,trace_x:[],rendered:{}};var e=this.$getConfig(),n=e[this.$config.bind+"_attribute"],i=e[this.$config.bindLinks+"_attribute"];!n&&this.$config.bind&&(n="data-"+this.$config.bind+"-id"),!i&&this.$config.bindLinks&&(i="data-"+this.$config.bindLinks+"-id"),this.$config.item_attribute=n||null,this.$config.link_attribute=i||null;var a=this._createLayerConfig();this.$config.layers||(this.$config.layers=a.tasks),this.$config.linkLayers||(this.$config.linkLayers=a.links),this._attachLayers(this.$gantt),this.callEvent("onReady",[]),this.$gantt.ext.dragTimeline&&(this._timelineDragScroll=this.$gantt.ext.dragTimeline.create(),this._timelineDragScroll.attach(this))},setSize:function(t,e){var n=this.$getConfig();if(1*t===t&&(this.$config.width=t),1*e===e){this.$config.height=e;var i=Math.max(this.$config.height-n.scale_height);this.$task_data.style.height=i+"px"}this.refresh(),this.$task_bg.style.backgroundImage="",n.smart_rendering&&this.$config.rowStore?this.$task_bg.style.height=this.getTotalHeight()+"px":this.$task_bg.style.height="";for(var a=this._tasks,r=this.$task_data.childNodes,s=0,o=r.length;s'+this._prepareScaleHtml(t[r],e,n,r)+"")}return i.join("")},_prepareScaleHtml:function(t,e,n,i){var a=this.$getConfig(),r=this.$gantt.templates,s=[],o=null,l=null,d=t.format||t.template||t.date;typeof d=="string"&&(d=this.$gantt.date.date_to_str(d));var c=0,u=t.count;!a.smart_scales||isNaN(e)||isNaN(n)||(c=Tt(t.left,e),u=Tt(t.left,n)+1),l=t.css||function(){},!t.css&&a.inherit_scale_class&&(l=r.scale_cell_class);for(var h=c;hw||k===!0){if(yp.x_end&&f>w){let x=p.x_end-y-10,S="-100%";x${g}`;s.push(m)}}return s.join("")},dateFromPos:function(t){var e=this._tasks;if(t<0||t>e.full_width||!e.full_width)return null;var n=Tt(this._tasks.left,t),i=this._tasks.left[n],a=e.width[n]||e.col_width,r=0;a&&(r=(t-i)/a,e.rtl&&(r=1-r));var s=0;return r&&(s=this._getColumnDuration(e,e.trace_x[n])),new Date(e.trace_x[n].valueOf()+Math.round(r*s))},posFromDate:function(t){if(!this.isVisible()||!t)return 0;var e=String(t.valueOf());if(this._posFromDateCache[e]!==void 0)return this._posFromDateCache[e];var n=this.columnIndexByDate(t);this.$gantt.assert(n>=0,"Invalid day index");var i=Math.floor(n),a=n%1,r=this._tasks.left[Math.min(i,this._tasks.width.length-1)];i==this._tasks.width.length&&(r+=this._tasks.width[this._tasks.width.length-1]),a&&(i=a.max_date)return this._tasks.rtl?0:n.length;var r=Tt(n,e),s=this._getClosestVisibleColumn(r,n,i),o=n[s],l=this._tasks.trace_index_transition;if(!o)return l?l[0]:0;var d=(t-n[s])/this._getColumnDuration(this._tasks,n[s]);return l?l[s]+(1-d):s+d},getItemPosition:function(t,e,n){var i,a,r;let s=e||t.start_date||t.$auto_start_date,o=n||t.end_date||t.$auto_end_date;return this._tasks.rtl?(a=this.posFromDate(s),i=this.posFromDate(o)):(i=this.posFromDate(s),a=this.posFromDate(o)),r=Math.max(a-i,0),{left:i,top:this.getItemTop(t.id),height:this.getBarHeight(t.id),width:r,rowHeight:this.getItemHeight(t.id)}},getBarHeight:function(t,e){var n=this.$getConfig(),i=this.$config.rowStore.getItem(t),a=i.task_height||i.bar_height||n.bar_height||n.task_height,r=this.getItemHeight(t);return a=="full"&&(a=r-(n.bar_height_padding||3)),a=Math.min(a,r),e&&(a=Math.round(a/Math.sqrt(2))),Math.max(a,0)},getScale:function(){return this._tasks},_getScales:function(){var t=this.$getConfig(),e=this.$scaleHelper,n=[e.primaryScale(t)].concat(e.getSubScales(t));return e.sortScales(n),n},_getColumnDuration:function(t,e){return this.$gantt.date.add(e,t.step,t.unit)-e},_bindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);if(this.$config.rowStore=t,t&&!t._timelineCacheAttached){var e=this;t._timelineCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})}}},_unbindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);t&&t._timelineCacheAttached&&(t.detachEvent(t._timelineCacheAttached),t._timelineCacheAttached=!1)}},refresh:function(){this._bindStore(),this.$config.bindLinks&&(this.$config.linkStore=this.$gantt.getDatastore(this.$config.bindLinks)),this._resetTopPositionHeight(),this._resetHeight(),this._initStaticBackgroundRender(),this._render_tasks_scales()},destructor:function(){var t=this.$gantt;this._clearLayers(t),this._unbindStore(),this.$task=null,this.$task_scale=null,this.$task_data=null,this.$task_bg=null,this.$task_links=null,this.$task_bars=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.$config.linkStore&&(this.$config.linkStore=null),this._timelineDragScroll&&(this._timelineDragScroll.destructor(),this._timelineDragScroll=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}};class ma{constructor(e){this._scrollOrder=0;const{gantt:n,grid:i,dnd:a,getCurrentX:r}=e;this.$gantt=n,this.$grid=i,this._dnd=a,this.getCurrentX=r,this._scrollView=this.$gantt.$ui.getView(this.$grid.$config.scrollX),this.attachEvents()}attachEvents(){this.isScrollable()&&(this._dnd.attachEvent("onDragMove",(e,n)=>{const i=this.$grid.$grid.getBoundingClientRect(),a=i.right,r=i.left,s=this.getCurrentX(n.clientX);return s>=a-20&&(this.autoscrollRight(),this.autoscrollStart()),s<=r+20&&(this.autoscrollLeft(),this.autoscrollStart()),sr+20&&this.autoscrollStop(),!0}),this._dnd.attachEvent("onDragEnd",()=>{this.autoscrollStop()}))}autoscrollStart(){if(this._scrollOrder===0)return;const e=10*this._scrollOrder,n=this._scrollView.getScrollState();this._scrollView.scrollTo(n.position+e),setTimeout(()=>{this.autoscrollStart()},50)}autoscrollRight(){this._scrollOrder=1}autoscrollLeft(){this._scrollOrder=-1}autoscrollStop(){this._scrollOrder=0}getCorrection(){return this.isScrollable()?this._scrollView.getScrollState().position:0}isScrollable(){return!!this.$grid.$config.scrollable}}const _n="data-column-id";class va{constructor(e,n){this._targetMarker=null,this.calculateCurrentPosition=i=>{const a=this.$grid.$grid.getBoundingClientRect(),r=a.right,s=a.left;let o=i;return o>r&&(o=r),o{if(this._draggedCell=this.$gantt.utils.dom.closest(n.target,".gantt_grid_head_cell"),!this._draggedCell)return;const i=this.$grid.$getConfig().columns,a=this._draggedCell.getAttribute(_n);let r,s;return i.map(function(o,l){o.name===a&&(r=o,s=l)}),this.$grid.callEvent("onBeforeColumnDragStart",[{draggedColumn:r,draggedIndex:s}])!==!1&&!(!this._draggedCell||!r)&&(this._gridConfig=this.$grid.$getConfig(),this._originAutoscroll=this.$gantt.config.autoscroll,this.$gantt.config.autoscroll=!1,!0)}),this._dnd.attachEvent("onAfterDragStart",(e,n)=>{this._draggedCell&&(this._dnd.config.column=this._draggedCell.getAttribute(_n),this._dnd.config.marker.innerHTML=this._draggedCell.outerHTML,this._dnd.config.marker.classList.add("gantt_column_drag_marker"),this._dnd.config.marker.style.height=this._gridConfig.scale_height+"px",this._dnd.config.marker.style.lineHeight=this._gridConfig.scale_height+"px",this._draggedCell.classList.add("gantt_grid_head_cell_dragged"))}),this._dnd.attachEvent("onDragMove",(e,n)=>{if(!this._draggedCell)return;this._dragX=n.clientX;const i=this.calculateCurrentPosition(n.clientX),a=this.findColumnsIndexes(),r=a.targetIndex,s=a.draggedIndex,o=this.$grid.$getConfig().columns,l=o[s],d=o[r];return this.$grid.callEvent("onColumnDragMove",[{draggedColumn:l,targetColumn:d,draggedIndex:s,targetIndex:r}])===!1?(this.cleanTargetMarker(),!1):(this.setMarkerPosition(i),this.drawTargetMarker(a),!0)}),this._dnd.attachEvent("onDragEnd",()=>{this._draggedCell&&(this.$gantt.config.autoscroll=this._originAutoscroll,this._draggedCell.classList.remove("gantt_grid_head_cell_dragged"),this.cleanTargetMarker(),this.reorderColumns())})}reorderColumns(){const{targetIndex:e,draggedIndex:n}=this.findColumnsIndexes(),i=this.$grid.$getConfig().columns,a=i[n],r=i[e];this.$grid.callEvent("onBeforeColumnReorder",[{draggedColumn:a,targetColumn:r,draggedIndex:n,targetIndex:e}])!==!1&&e!==n&&(i.splice(n,1),i.splice(e,0,a),this.$gantt.render(),this.$grid.callEvent("onAfterColumnReorder",[{draggedColumn:a,targetColumn:r,draggedIndex:n,targetIndex:e}]))}findColumnsIndexes(){const e=this._dnd.config.column,n=this.$grid.$getConfig().columns;let i,a,r,s;const o={startX:0,endX:0};let l,d=0,c=n.length-1,u=(f,y)=>f<=y,h=f=>++f;this.$gantt.config.rtl&&(d=n.length-1,c=0,u=(f,y)=>f>=y,h=f=>--f);const g=this._dragX-this.$grid.$grid.getBoundingClientRect().left+this._scrollableGrid.getCorrection();for(let f=d;u(f,c)&&(i===void 0||a===void 0);f=h(f))n[f].hide||(o.startX=o.endX,o.endX+=n[f].width,g>=o.startX&&(g<=o.endX||!u(h(f),c))&&(i=f,r=o.startX,s=o.endX,l=(g-o.startX)/(o.endX-o.startX)),e===n[f].name&&(a=f));return{targetIndex:i,draggedIndex:a,xBefore:r,xAfter:s,columnRelativePos:l}}setMarkerPosition(e,n=10){const{marker:i}=this._dnd.config,a=this._dnd._obj.getBoundingClientRect();i.style.top=`${a.y+n}px`,i.style.left=`${e}px`}drawTargetMarker({targetIndex:e,draggedIndex:n,xBefore:i,xAfter:a,columnRelativePos:r}){let s;this._targetMarker||(this._targetMarker=document.createElement("div"),bt(this._targetMarker,"gantt_grid_target_marker"),this._targetMarker.style.display="none",this._targetMarker.style.height=`${this._gridConfig.scale_height}px`),this._targetMarker.parentNode||this.$grid.$grid_scale.appendChild(this._targetMarker),s=e>n?a:e.5?a:i,this._targetMarker.style.left=`${s}px`,this._targetMarker.style.display="block"}cleanTargetMarker(){this._targetMarker&&this._targetMarker.parentNode&&this.$grid.$grid_scale.removeChild(this._targetMarker),this._targetMarker=null}}function me(t){var e=[];return{delegate:function(n,i,a,r){e.push([n,i,a,r]),t.$services.getService("mouseEvents").delegate(n,i,a,r)},destructor:function(){for(var n=t.$services.getService("mouseEvents"),i=0;i",this.$grid=t.childNodes[0],this.$grid.innerHTML="
",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1];var s=a[this.$config.bind+"_attribute"];if(!s&&this.$config.bind&&(s="data-"+this.$config.bind+"-id"),this.$config.item_attribute=s||null,!this.$config.layers){var o=this._createLayerConfig();this.$config.layers=o}var l={init:function(){},doOnRender:function(){}};this._renderHeaderResizers=l.doOnRender,this._mouseDelegates=me(e);var d=function(c,u){var h={row_before_start:c.bind(function(g,f,y){var v=u.$getConfig(),b=u.$config.rowStore;if(!tt(y,v.task_grid_row_resizer_attribute))return!1;var _=this.locate(y,v.task_grid_row_resizer_attribute),m=b.getItem(_);return u.callEvent("onBeforeRowResize",[m])!==!1&&void 0},c),row_after_start:c.bind(function(g,f,y){var v=u.$getConfig(),b=this.locate(y,v.task_grid_row_resizer_attribute);g.config.marker.innerHTML="",g.config.marker.className+=" gantt_row_grid_resize_area",g.config.marker.style.width=u.$grid.offsetWidth+"px",g.config.drag_id=b},c),row_drag_move:c.bind(function(g,f,y){var v=u.$config.rowStore,b=u.$getConfig(),_=g.config,m=_.drag_id,p=u.getItemHeight(m),k=u.getItemTop(m)-f.scrollTop,$=z(u.$grid_data),w=parseInt(_.marker.style.top,10),x=k+$.y,S=0,T=b.min_task_grid_row_height;return(S=w-x)c.max_width&&(u=c.max_width-c.width),a-=c.width,c.width+=u,l-=u}for(var h=l>0?1:-1;l>0&&h===1||l<0&&h===-1;){var g=l;for(s=e+1;s-1&&(f=i[e].width+l)==this._getColumnWidth(i[e],n,f)&&(i[e].width=f),this._getColsTotalWidth()},_getColsTotalWidth:function(){for(var t=this.getGridColumns(),e=0,n=0;ns+h&&(u.width=h=g-s),s+=h;var f=t._sort&&u.name==t._sort.name?`
`:"",y=["gantt_grid_head_cell","gantt_grid_head_"+u.name,c?"gantt_last_cell":"",i.grid_header_class(u.name,u)].join(" "),v="width:"+(h-(c?1:0))+"px;",b=u.label||o["column_"+u.name]||o[u.name];b=b||"";var _="
"+b+f+"
";r.push(_)}this.$grid_scale.style.height=e.scale_height+"px",this.$grid_scale.style.lineHeight=l+"px",this.$grid_scale.innerHTML=r.join(""),this._renderHeaderResizers&&this._renderHeaderResizers()},_getGridWidth:function(){return this.$config.width},destructor:function(){this._clearLayers(this.$gantt),this._mouseDelegates&&(this._mouseDelegates.destructor(),this._mouseDelegates=null),this._unbindStore(),this.$grid=null,this.$grid_scale=null,this.$grid_data=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}};const ka={init:function(t,e){var n=e.$gantt;n.attachEvent("onTaskClick",function(i,a){if(n._is_icon_open_click(a))return!0;var r=t.getState(),s=t.locateCell(a.target);return!s||!t.getEditorConfig(s.columnName)||(t.isVisible()&&r.id==s.id&&r.columnName==s.columnName||t.startEdit(s.id,s.columnName),!1)}),n.attachEvent("onEmptyClick",function(){return t.isVisible()&&t.isChanged()?t.save():t.hide(),!0}),n.attachEvent("onTaskDblClick",function(i,a){var r=t.getState(),s=t.locateCell(a.target);return!s||!t.isVisible()||s.columnName!=r.columnName})},onShow:function(t,e,n){var i=n.$gantt;i.ext&&i.ext.keyboardNavigation&&i.ext.keyboardNavigation.attachEvent("onKeyDown",function(a,r){var s=i.constants.KEY_CODES,o=!1;return r.keyCode===s.SPACE&&t.isVisible()&&(o=!0),!o}),e.onkeydown=function(a){a=a||window.event;var r=i.constants.KEY_CODES;if(!(a.defaultPrevented||a.shiftKey&&a.keyCode!=r.TAB)){var s=!0;switch(a.keyCode){case i.keys.edit_save:t.save();break;case i.keys.edit_cancel:t.hide();break;case r.UP:case r.DOWN:t.isVisible()&&(t.hide(),s=!1);break;case r.TAB:a.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);break;default:s=!1}s&&a.preventDefault()}}},onHide:function(){},destroy:function(){}},ya={init:function(t,e){var n=t,i=e.$gantt,a=null,r=i.ext.keyboardNavigation;r.attachEvent("onBeforeFocus",function(s){var o=t.locateCell(s);if(clearTimeout(a),o){var l=o.columnName,d=o.id,c=n.getState();if(n.isVisible()&&c.id==d&&c.columnName===l)return!1}return!0}),r.attachEvent("onFocus",function(s){var o=t.locateCell(s),l=t.getState();return clearTimeout(a),!o||o.id==l.id&&o.columnName==l.columnName||n.isVisible()&&n.save(),!0}),t.attachEvent("onHide",function(){clearTimeout(a)}),r.attachEvent("onBlur",function(){return a=setTimeout(function(){n.save()}),!0}),i.attachEvent("onTaskDblClick",function(s,o){var l=t.getState(),d=t.locateCell(o.target);return!d||!t.isVisible()||d.columnName!=l.columnName}),i.attachEvent("onTaskClick",function(s,o){if(i._is_icon_open_click(o))return!0;var l=t.getState(),d=t.locateCell(o.target);return!d||!t.getEditorConfig(d.columnName)||(t.isVisible()&&l.id==d.id&&l.columnName==d.columnName||t.startEdit(d.id,d.columnName),!1)}),i.attachEvent("onEmptyClick",function(){return n.save(),!0}),r.attachEvent("onKeyDown",function(s,o){var l=t.locateCell(o.target),d=!!l&&t.getEditorConfig(l.columnName),c=t.getState(),u=i.constants.KEY_CODES,h=o.keyCode,g=!1;switch(h){case u.ENTER:t.isVisible()?(t.save(),o.preventDefault(),g=!0):d&&!(o.ctrlKey||o.metaKey||o.shiftKey)&&(n.startEdit(l.id,l.columnName),o.preventDefault(),g=!0);break;case u.ESC:t.isVisible()&&(t.hide(),o.preventDefault(),g=!0);break;case u.UP:case u.DOWN:break;case u.LEFT:case u.RIGHT:(d&&t.isVisible()||c.editorType==="date")&&(g=!0);break;case u.SPACE:t.isVisible()&&(g=!0),d&&!t.isVisible()&&(n.startEdit(l.id,l.columnName),o.preventDefault(),g=!0);break;case u.DELETE:d&&!t.isVisible()?(n.startEdit(l.id,l.columnName),g=!0):d&&t.isVisible()&&(g=!0);break;case u.TAB:if(t.isVisible()){o.shiftKey?t.editPrevCell(!0):t.editNextCell(!0);var f=t.getState();f.id&&r.focus({type:"taskCell",id:f.id,column:f.columnName}),o.preventDefault(),g=!0}break;default:if(t.isVisible())g=!0;else if(h>=48&&h<=57||h>95&&h<112||h>=64&&h<=91||h>185&&h<193||h>218&&h<223){var y=s.modifiers,v=y.alt||y.ctrl||y.meta||y.shift;y.alt||v&&r.getCommandHandler(s,"taskCell")||d&&!t.isVisible()&&(n.startEdit(l.id,l.columnName),g=!0)}}return!g})},onShow:function(t,e,n){},onHide:function(t,e,n){const i=n.$gantt;i&&i.focus()},destroy:function(){}};function St(t){var e=function(){};return e.prototype={show:function(n,i,a,r){},hide:function(){},set_value:function(n,i,a,r){this.get_input(r).value=n},get_value:function(n,i,a){return this.get_input(a).value||""},is_changed:function(n,i,a,r){var s=this.get_value(i,a,r);return s&&n&&s.valueOf&&n.valueOf?s.valueOf()!=n.valueOf():s!=n},is_valid:function(n,i,a,r){return!0},save:function(n,i,a){},get_input:function(n){return n.querySelector("input")},focus:function(n){var i=this.get_input(n);i&&(i.focus&&i.focus(),i.select&&i.select())}},e}function ba(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){var o=`
`;s.innerHTML=o}},!0),n}function xa(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){var o=r.min||0,l=r.max||100,d=`
`;s.innerHTML=d,s.oninput=function(c){+c.target.valuel&&(c.target.value=l)}},get_value:function(i,a,r){return this.get_input(r).value||""},is_valid:function(i,a,r,s){return!isNaN(parseInt(i,10))}},!0),n}function $a(t){var e=St();function n(){return e.apply(this,arguments)||this}return B(n,e),N(n.prototype,{show:function(i,a,r,s){for(var o=`
",s.innerHTML=o},get_input:function(i){return i.querySelector("select")}},!0),n}function wa(t){var e=St(),n="%Y-%m-%d",i=null,a=null;function r(){return e.apply(this,arguments)||this}return B(r,e),N(r.prototype,{show:function(s,o,l,d){i||(i=t.date.date_to_str(n)),a||(a=t.date.str_to_date(n));var c=null,u=null;c=typeof l.min=="function"?l.min(s,o):l.min,u=typeof l.max=="function"?l.max(s,o):l.max;var h=`
`;d.innerHTML=h,d.oninput=function(g){+t.date.str_to_date("%Y-%m-%d")(g.target.value)<+c&&(g.target.value=t.date.date_to_str("%Y-%m-%d")(c)),+t.date.str_to_date("%Y-%m-%d")(g.target.value)>+u&&(g.target.value=t.date.date_to_str("%Y-%m-%d")(u))}},set_value:function(s,o,l,d){s&&s.getFullYear?this.get_input(d).value=i(s):this.get_input(d).value=s},is_valid:function(s,o,l,d){return!(!s||isNaN(s.getTime()))},get_value:function(s,o,l){var d;try{d=a(this.get_input(l).value||"")}catch{d=null}return d}},!0),r}function Sa(t){var e=St();function n(){return e.apply(this,arguments)||this}function i(l){return l.formatter||t.ext.formatters.linkFormatter()}function a(l,d){for(var c=(l||"").split(d.delimiter||","),u=0;u`;u.innerHTML=h},hide:function(){},set_value:function(l,d,c,u){this.get_input(u).value=r(l,c.editor,t)},get_value:function(l,d,c){return a(this.get_input(c).value||"",d.editor)},save:function(l,d,c){var u=o(t.getTask(l),this.get_value(l,d,c),d.editor);(u.add.length||u.remove.length)&&t.batchUpdate(function(){u.add.forEach(function(h){t.addLink(h)}),u.remove.forEach(function(h){t.deleteLink(h)}),t.autoSchedule&&t.autoSchedule()})},is_changed:function(l,d,c,u){var h=this.get_value(d,c,u),g=a(r(l,c.editor,t),c.editor);return h.join()!==g.join()}},!0),n}function Ta(t){var e=St();function n(){return e.apply(this,arguments)||this}function i(a){return a.formatter||t.ext.formatters.durationFormatter()}return B(n,e),N(n.prototype,{show:function(a,r,s,o){var l=`
`;o.innerHTML=l},set_value:function(a,r,s,o){this.get_input(o).value=i(s.editor).format(a)},get_value:function(a,r,s){return i(r.editor).parse(this.get_input(s).value||"")}},!0),n}function Ca(t){return function(n,i,a){a=="keepDates"?function(r,s){s=="duration"?r.end_date=t.calculateEndDate(r):s!="end_date"&&s!="start_date"||(r.duration=t.calculateDuration(r))}(n,i):a=="keepDuration"?function(r,s){s=="end_date"?r.start_date=e(r):s!="start_date"&&s!="duration"||(r.end_date=t.calculateEndDate(r))}(n,i):function(r,s){t.config.schedule_from_end?s=="end_date"||s=="duration"?r.start_date=e(r):s=="start_date"&&(r.duration=t.calculateDuration(r)):s=="start_date"||s=="duration"?r.end_date=t.calculateEndDate(r):s=="end_date"&&(r.duration=t.calculateDuration(r))}(n,i)};function e(n){return t.calculateEndDate({start_date:n.end_date,duration:-n.duration,task:n})}}function Ea(t){t.config.editor_types={text:new(ba()),number:new(xa()),select:new($a()),date:new(wa(t)),predecessor:new(Sa(t)),duration:new(Ta(t))}}function Da(t){var e=function(a){var r=null;return{setMapping:function(s){r=s},getMapping:function(){return r||(a.config.keyboard_navigation_cells&&a.ext.keyboardNavigation?ya:ka)}}}(t),n={};it(n);var i={init:Ea,createEditors:function(a){function r(u,h){var g=a.$getConfig(),f=function(b,_){for(var m=a.$getConfig(),p=a.getItemTop(b),k=a.getItemHeight(b),$=a.getGridColumns(),w=0,x=0,S=0,T=0;T<$.length;T++){if($[T].name==_){S=$[T].width;break}m.rtl?x+=$[T].width:w+=$[T].width}return m.rtl?{top:p,right:x,height:k,width:S}:{top:p,left:w,height:k,width:S}}(u,h),y=document.createElement("div");y.className="gantt_grid_editor_placeholder",y.setAttribute(a.$config.item_attribute,u),y.setAttribute(a.$config.bind+"_id",u),y.setAttribute("data-column-name",h);var v=function(b,_){for(var m=b.getGridColumns(),p=0;p0?t.getNext:t.getPrev,g=(h=t.bind(h,t))(this._itemId);t.isTaskExists(g)&&t.isReadonly(t.getTask(g));)g=h(g);return g},editNextRow:function(u){var h=this.getState().id;if(t.isTaskExists(h)){var g=null;g=u?this.moveRow(1):t.getNext(h),t.isTaskExists(g)&&this.startEdit(g,this._columnName)}},editPrevRow:function(u){var h=this.getState().id;if(t.isTaskExists(h)){var g=null;g=u?this.moveRow(-1):t.getPrev(h),t.isTaskExists(g)&&this.startEdit(g,this._columnName)}},destructor:function(){o.forEach(function(u){d.detachEvent(u)}),l.forEach(function(u){t.detachEvent(u)}),o=[],l=[],d=null,this.hide(),this.detachAllEvents()}};return N(c,e),N(c,n),c}};return N(i,e),N(i,n),i}function ke(t,e,n,i,a){if(!t.start_date||!t.end_date)return null;var r=n.getItemTop(t.id),s=n.getItemHeight(t.id);if(r>e.y_end||r+se.x_end||c -`,A.appendChild(L),S.appendChild(L)}}(r,b,_,d,c);var m=function(x,S,T){var C=document.createElement("div");return t.getTaskType(x.type)!=t.config.types.milestone?C.innerHTML=T.task_text(x.start_date,x.end_date,x):t.getTaskType(x.type)==t.config.types.milestone&&S&&(C.style.height=C.style.width=S+"px"),C.className="gantt_task_content",C}(r,_,c);b.appendChild(m);var p=function(x,S,T,C){var E=C.$getConfig(),D=[x];S&&D.push(S);var A=t.getState(),I=t.getTask(T);if(t.getTaskType(I.type)==E.types.milestone?D.push("gantt_milestone"):t.getTaskType(I.type)==E.types.project&&D.push("gantt_project"),D.push("gantt_bar_"+t.getTaskType(I.type)),t.isSummaryTask(I)&&D.push("gantt_dependent_task"),t.isSplitTask(I)&&(E.open_split_tasks&&!I.$open||!E.open_split_tasks)&&D.push("gantt_split_parent"),E.select_task&&t.isSelectedTask(T)&&D.push("gantt_selected"),T==A.drag_id&&(D.push("gantt_drag_"+A.drag_mode),A.touch_drag&&D.push("gantt_touch_"+A.drag_mode)),A.link_source_id==T&&(D.push("gantt_link_source"),A.link_from_start?D.push("gantt_link_from_start"):D.push("gantt_link_from_end")),A.link_target_id==T&&D.push("gantt_link_target"),E.highlight_critical_path&&t.isCriticalTask&&t.isCriticalTask(I)&&D.push("gantt_critical_task"),A.link_landing_area&&A.link_target_id&&A.link_source_id&&A.link_target_id!=A.link_source_id&&(A.link_target_id==T||A.link_source_id==T)){var M=A.link_source_id,L=A.link_from_start,P=A.link_to_start,H="";H=t.isLinkAllowed(M,T,L,P)?P?"link_start_allow":"link_finish_allow":P?"link_start_deny":"link_finish_deny",D.push(H)}return D.join(" ")}("gantt_task_line",c.task_class(r.start_date,r.end_date,r),r.id,s);(r.color||r.progressColor||r.textColor)&&(p+=" gantt_task_inline_color"),l.width<20&&(p+=" gantt_thin_task"),b.className=p;var k=["left:"+l.left+"px","top:"+(f+l.top)+"px","height:"+h+"px","line-height:"+Math.max(h<30?h-2:h,0)+"px","width:"+_+"px"];b.style.cssText=k.join(";"),r.color&&b.style.setProperty("--dhx-gantt-task-background",r.color),r.textColor&&b.style.setProperty("--dhx-gantt-task-color",r.textColor),r.progressColor&&b.style.setProperty("--dhx-gantt-task-progress-color",r.progressColor);var $=function(x,S,T,C){var E="gantt_left "+i(!S.rtl,x),D=null;return C&&(D={type:"marginRight",value:C}),n(x,T.leftside_text,E,D)}(r,d,c,g);$&&b.appendChild($),$=function(x,S,T,C){var E="gantt_right "+i(!!S.rtl,x),D=null;return C&&(D={type:"marginLeft",value:C}),n(x,T.rightside_text,E,D)}(r,d,c,g),$&&b.appendChild($),t._waiAria.setTaskBarAttr(r,b);var w=t.getState();return t.isReadonly(r)||(d.drag_resize&&!t.isSummaryTask(r)&&u!=d.types.milestone&&a(b,"gantt_task_drag",r,function(x){var S=document.createElement("div");return S.className=x,S},d),d.drag_links&&d.show_links&&a(b,"gantt_link_control",r,function(x){var S=document.createElement("div");S.className=x,S.style.cssText=["height:"+h+"px","line-height:"+h+"px"].join(";");var T=document.createElement("div");T.className="gantt_link_point";var C=!1;return w.link_source_id&&d.touch&&(C=!0),T.style.display=C?"block":"",S.appendChild(T),S},d,g)),b}function n(r,s,o,l){if(!s)return null;var d=s(r.start_date,r.end_date,r);if(!d)return null;var c=document.createElement("div");return c.className="gantt_side_content "+o,c.innerHTML=d,l&&(c.style[l.type]=Math.abs(l.value)+"px"),c}function i(r,s){var o=r?{$source:[t.config.links.start_to_start],$target:[t.config.links.start_to_start,t.config.links.finish_to_start]}:{$source:[t.config.links.finish_to_start,t.config.links.finish_to_finish],$target:[t.config.links.finish_to_finish]};for(var l in o)for(var d=s[l],c=0;c=+h.min_date&&((u=l([s,d.rtl?"task_right":"task_left","task_start_date"].join(" "))).setAttribute("data-bind-property","start_date"),c&&(u.style.marginLeft=c+"px"),r.appendChild(u)),+o.end_date<=+h.max_date&&((u=l([s,d.rtl?"task_left":"task_right","task_end_date"].join(" "))).setAttribute("data-bind-property","end_date"),c&&(u.style.marginRight=c+"px"),r.appendChild(u))}return function(r,s,o){var l=(o=s.$getConfig()).type_renderers[t.getTaskType(r.type)],d=e;return l?l.call(t,r,function(c){return d.call(t,c,s,o)},s):d.call(t,r,s,o)}}function fn(t){return{render:gn(t),update:null,isInViewPort:ke,getVisibleRange:gt}}function Mt(){return console.error("You are trying to use a Pro feature that is not available in the GPL version."),{render:function(){},isInViewPort:function(){},getVisibleRange:function(){}}}function pn(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}function Ut(t,e){var n=0,i=t.left.length-1;if(e)for(var a=0;ae.x_end){i=a;break}}return{start:n,end:i}}function ye(t,e,n,i){var a=e.width[t];if(a<=0)return!1;if(!i.config.smart_rendering||At(i))return!0;var r=e.left[t]-a,s=e.left[t]+a;return r<=n.x_end&&s>=n.x}function Aa(t,e){var n=e.config.timeline_placeholder;if(t=t||[],n&&t.filter(l=>l.id==="timeline_placeholder_task").length===0){var i=e.getState(),a=null,r=i.min_date,s=i.max_date;t.length&&(a=t[t.length-1].id);var o={start_date:r,end_date:s,row_height:n.height||0,id:"timeline_placeholder_task",unscheduled:!0,lastTaskId:a,calendar_id:n.calendar||"global",$source:[],$target:[]};t.push(o)}}function Ia(t){var e={current_pos:null,dirs:{left:"left",right:"right",up:"up",down:"down"},path:[],clear:function(){this.current_pos=null,this.path=[]},point:function(a){this.current_pos=t.copy(a)},get_lines:function(a){this.clear(),this.point(a[0]);for(var r=1;ra.x?this.dirs.right:r.y>a.y?this.dirs.down:this.dirs.up}},n={path:[],clear:function(){this.path=[]},current:function(){return this.path[this.path.length-1]},point:function(a){return a?(this.path.push(t.copy(a)),a):this.current()},point_to:function(a,r,s){s=s?{x:s.x,y:s.y}:t.copy(this.point());var o=e.dirs;switch(a){case o.left:s.x-=r;break;case o.right:s.x+=r;break;case o.up:s.y-=r;break;case o.down:s.y+=r}return this.point(s)},get_points:function(a,r,s,o){var l=this.get_endpoint(a,r,s,o),d=t.config,c=l.e_y-l.y,u=l.e_x-l.x,h=e.dirs,g=r.getItemHeight(a.source);this.clear(),this.point({x:l.x,y:l.y});var f=2*d.link_arrow_size,y=this.get_line_type(a,r.$getConfig()),v=l.e_x>l.x;if(y.from_start&&y.to_start)this.point_to(h.left,f),v?(this.point_to(h.down,c),this.point_to(h.right,u)):(this.point_to(h.right,u),this.point_to(h.down,c)),this.point_to(h.right,f);else if(!y.from_start&&y.to_start)if(v=l.e_x>l.x+2*f,this.point_to(h.right,f),v)u-=f,this.point_to(h.down,c),this.point_to(h.right,u);else{u-=2*f;var b=c>0?1:-1;this.point_to(h.down,b*(g/2)),this.point_to(h.right,u),this.point_to(h.down,b*(Math.abs(c)-g/2)),this.point_to(h.right,f)}else y.from_start||y.to_start?y.from_start&&!y.to_start&&(v=l.e_x>l.x-2*f,this.point_to(h.left,f),v?(u+=2*f,b=c>0?1:-1,this.point_to(h.down,b*(g/2)),this.point_to(h.right,u),this.point_to(h.down,b*(Math.abs(c)-g/2)),this.point_to(h.left,f)):(u+=f,this.point_to(h.down,c),this.point_to(h.right,u))):(this.point_to(h.right,f),v?(this.point_to(h.right,u),this.point_to(h.down,c)):(this.point_to(h.down,c),this.point_to(h.right,u)),this.point_to(h.left,f));return this.path},get_line_type:function(a,r){var s=r.links,o=!1,l=!1;return a.type==s.start_to_start?o=l=!0:a.type==s.finish_to_finish?o=l=!1:a.type==s.finish_to_start?(o=!1,l=!0):a.type==s.start_to_finish?(o=!0,l=!1):t.assert(!1,"Invalid link type"),r.rtl&&(o=!o,l=!l),{from_start:o,to_start:l}},get_endpoint:function(a,r,s,o){var l=r.$getConfig(),d=this.get_line_type(a,l),c=d.from_start,u=d.to_start,h=i(s,r,l),g=i(o,r,l);return{x:c?h.left:h.left+h.width,e_x:u?g.left:g.left+g.width,y:h.top+h.rowHeight/2-1,e_y:g.top+g.rowHeight/2-1}}};function i(a,r,s){var o=r.getItemPosition(a);let l=_i(t,r,a),d=l.maxHeight,c=l.splitChild;const u=t.config.baselines!==!1&&(t.config.baselines.render_mode=="separateRow"||t.config.baselines.render_mode=="individualRow")&&a.baselines&&a.baselines.length;let h;l.shrinkHeight&&(o.rowHeight=d);let g=t.getTaskType(a.type)==s.types.milestone;if(g){let f=r.getBarHeight(a.id,!0);h=Math.sqrt(2*f*f),l.shrinkHeight&&d=o.height){const f=hi(t,a.parent);u||f?g?(o.rowHeight=o.height+4,o.left+=(o.width-o.rowHeight+4)/2,o.width=o.rowHeight-3):o.rowHeight=o.height+6:g&&(o.left+=(h-o.height)/2)}else o.rowHeight=d+2,g&&(o.left+=(o.width-o.rowHeight+4)/2,o.width=o.rowHeight-3);else u&&(o.rowHeight=o.height+4);return o}return{render:function(a,r,s){var o=t.getTask(a.source);if(o.hide_bar)return;var l=t.getTask(a.target);if(l.hide_bar)return;var d=n.get_endpoint(a,r,o,l),c=d.e_y-d.y;if(!(d.e_x-d.x)&&!c)return null;var u=n.get_points(a,r,o,l);const h=function(v,b){const _=b.link_radius||4,m=b.link_arrow_size||6,p=[];for(let $=0;$v.size>0),s),g=function(v,b,_,m){const p=document.createElement("div");return v.forEach(k=>{let $;k.type==="line"?$=e.render_line(k.data,null,b,_.source):k.type==="corner"?$=e.render_corner(k.data,b):k.type==="arrow"&&($=e.render_arrow(k.data,m)),p.appendChild($)}),p}(h,r,a,s);var f="gantt_task_link";a.color&&(f+=" gantt_link_inline_color");var y=t.templates.link_class?t.templates.link_class(a):"";return y&&(f+=" "+y),s.highlight_critical_path&&t.isCriticalLink&&t.isCriticalLink(a)&&(f+=" gantt_critical_link"),g.className=f,r.$config.link_attribute&&(g.setAttribute(r.$config.link_attribute,a.id),g.setAttribute("link_id",a.id)),a.color&&g.style.setProperty("--dhx-gantt-link-background",a.color),t._waiAria.linkAttr(a,g),g},update:null,isInViewPort:cn,getVisibleRange:dn()}}function Ma(t,e,n,i,a){if(a.$ui.getView("grid")&&(a.config.keyboard_navigation&&a.getSelectedId()||a.ext.inlineEditors&&a.ext.inlineEditors.getState().id))return!0;var r=n.getItemTop(t.id),s=n.getItemHeight(t.id);return!(r>e.y_end||r+sl.y+h-u&&(c=l.y+h-u);const g=l.y+l.height;return c>g-u&&(c=g-u),l.x=d,l.y=c,l},t),i._getTargetY=t.bind(function(o){var l=z(e.$grid_data),d=e.$state.scrollTop||0,c=t.$grid_data.getBoundingClientRect().height+d,u=o.pageY-l.y+d;return u>c?u=c:ud.countVisible()-1?null:d.getIdByIndex(c)},t),i.attachEvent("onDragMove",t.bind(function(o,l){var d=t.$grid_data.getBoundingClientRect(),c=d.height+d.y+(e.$state.scrollTop||0)+window.scrollY,u=i.config,h=i._getGridPos(l);t._waiAria.reorderMarkerAttr(u.marker);var g=e.$getConfig(),f=r();h.yy.width&&(u.marker.style.width=y.width-10-2+"px",u.marker.style.overflow="hidden");var v=f.getItem(i.config.id),b=i._getTargetY(l),_=i._getTaskByY(b,f.getIndexById(v.id));function m(D,A){return!f.isChildOf(p.id,A.id)&&(D.$level==A.$level||g.order_branch_free)}if(f.exists(_)||(_=i.lastTaskOfLevel(g.order_branch_free?v.$level:0))==i.config.id&&(_=null),f.exists(_)){var p=f.getItem(_),k=e.getItemTop(p.id),$=e.getItemHeight(p.id);if(k+$/2=0;)T=f.getIdByIndex(w-E),C=f.getItem(T),E++;if(v.id==p.id||s(p.id))return;m(p,v)&&v.id!=p.id?f.move(v.id,0,0,p.id):p.$level!=v.$level-1||f.getChildren(p.id).length?C&&m(C,v)&&v.id!=C.id&&f.move(v.id,-1,f.getParent(C.id)):f.move(v.id,0,p.id)}return!0},t)),i.attachEvent("onDragEnd",t.bind(function(){var o=r(),l=o.getItem(i.config.id);l.$transparent=!1,l.$open=i.config.initial_open_state,this.callEvent("onBeforeRowDragEnd",[i.config.id,i.config.parent,i.config.index])===!1?(o.move(i.config.id,i.config.index,i.config.parent),l.$drop_target=null):this.callEvent("onRowDragEnd",[i.config.id,l.$drop_target]),t.render(),this.refreshData()},t))}function a(o){return tt(o,e.$config.item_attribute)}function r(){return t.getDatastore(e.$config.bind)}function s(o){return Ct(o,t,r())}}},Z={createDropTargetObject:function(t){var e={targetParent:null,targetIndex:0,targetId:null,child:!1,nextSibling:!1,prevSibling:!1};return t&&N(e,t,!0),e},nextSiblingTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.nextSibling=!0,i.targetParent=n.getParent(i.targetId),i.targetIndex=n.getBranchIndex(i.targetId),(n.getParent(t)!=i.targetParent||i.targetIndexn.getBranchIndex(t)&&(i.targetIndex-=1),i},firstChildTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.targetParent=i.targetId,i.targetIndex=0,i.child=!0,i},lastChildTarget:function(t,e,n){var i=n.getChildren(e),a=this.createDropTargetObject();return a.targetId=i[i.length-1],a.targetParent=e,a.targetIndex=i.length,a.nextSibling=!0,a}};function mn(t,e,n,i,a){for(var r=e;i.exists(r);){var s=i.calculateItemLevel(i.getItem(r));if((s===n||s===n-1)&&i.getBranchIndex(r)>-1)break;r=a?i.getPrev(r):i.getNext(r)}return i.exists(r)?i.calculateItemLevel(i.getItem(r))===n?a?Z.nextSiblingTarget(t,r,i):Z.prevSiblingTarget(t,r,i):Z.firstChildTarget(t,r,i):null}function be(t,e,n,i){return mn(t,e,n,i,!0)}function vn(t,e,n,i){return mn(t,e,n,i,!1)}function kn(t,e,n,i,a,r){var s;if(e!==a.$getRootId()){var o=a.getItem(e),l=a.calculateItemLevel(o);if(l===r){var d=a.getPrevSibling(e);n<.5&&!d?s=Z.prevSiblingTarget(t,e,a):(n<.5&&(e=d),s=Z.nextSiblingTarget(t,e,a))}else if(l>r)a.eachParent(function(f){a.calculateItemLevel(f)===r&&(e=f.id)},o),s=be(t,e,r,a);else{var c=be(t,e,r,a),u=vn(t,e,r,a);s=n<.5?c:u}}else{var h=a.$getRootId(),g=a.getChildren(h);s=Z.createDropTargetObject(),s=g.length&&i>=0?be(t,function(f){for(var y=f.getNext();f.exists(y);){var v=f.getNext(y);if(!f.exists(v))return y;y=v}return null}(a),r,a):vn(t,h,r,a)}return s}function yn(t,e){var n=z(e.$grid_data);return t.x+=n.x+e.$grid.scrollLeft,t.y+=n.y-e.$grid_data.scrollTop,t}function xe(t,e,n=0){const i=z(t.$root);return e>i.width&&(e=i.width-n-2),e}const bn={removeLineHighlight:function(t){t.markerLine&&t.markerLine.parentNode&&t.markerLine.parentNode.removeChild(t.markerLine),t.markerLine=null},highlightPosition:function(t,e,n){var i=function(r,s){var o=z(s.$grid_data),l=nt(r,s.$grid_data),d=o.x+s.$grid.scrollLeft,c=l.y-10,u=s.getItemHeight(r.targetId);co.y+h-u&&(c=o.y+h-u),o.x=d,o.y=c,o.width=xe(s.$gantt,o.width,9),o}(t,n);e.marker.style.left=i.x+9+"px",e.marker.style.width=i.width+"px",e.marker.style.overflow="hidden";var a=e.markerLine;a||((a=document.createElement("div")).className="gantt_drag_marker gantt_grid_dnd_marker",a.innerHTML="
",a.style.pointerEvents="none"),t.child?function(r,s,o){var l=r.targetParent,d=yn({x:0,y:o.getItemTop(l)},o),c=o.$grid_data.getBoundingClientRect().bottom+window.scrollY;let u=xe(o.$gantt,o.$grid_data.offsetWidth);s.innerHTML="
",s.style.width=u+"px",s.style.top=d.y+"px",s.style.left=d.x+"px",s.style.height=o.getItemHeight(l)+"px",d.y>c&&(s.style.top=c+"px")}(t,a,n):function(r,s,o){var l=function(u,h){var g=h.$config.rowStore,f={x:0,y:0},y=h.$grid_data.querySelector(".gantt_tree_indent"),v=15,b=0;y&&(v=y.offsetWidth);var _=40;if(u.targetId!==g.$getRootId()){var m=h.getItemTop(u.targetId),p=h.getItemHeight(u.targetId);if(b=g.exists(u.targetId)?g.calculateItemLevel(g.getItem(u.targetId)):0,u.prevSibling)f.y=m;else if(u.nextSibling){var k=0;g.eachItem(function($){g.getIndexById($.id)!==-1&&k++},u.targetId),f.y=m+p+k*p}else f.y=m+p,b+=1}return f.x=_+b*v,f.width=xe(h.$gantt,Math.max(h.$grid_data.offsetWidth-f.x,0),f.x),yn(f,h)}(r,o),d=o.$grid_data.getBoundingClientRect().bottom+window.scrollY;s.innerHTML="
",s.style.left=l.x+"px",s.style.height="4px";var c=l.y-2;s.style.top=c+"px",s.style.width=l.width+"px",c>d&&(s.style.top=d+"px")}(t,a,n),e.markerLine||(document.body.appendChild(a),e.markerLine=a)}},Pa={init:function(t,e){var n=t.$services.getService("dnd");if(e.$config.bind&&t.getDatastore(e.$config.bind)){var i=new n(e.$grid_data,{updates_per_second:60});t.defined(e.$getConfig().dnd_sensitivity)&&(i.config.sensitivity=e.$getConfig().dnd_sensitivity),i.attachEvent("onBeforeDragStart",t.bind(function(o,l){var d=a(l);if(!d||(t.hideQuickInfo&&t.hideQuickInfo(),lt(l.target,".gantt_grid_editor_placeholder")))return!1;var c=d.getAttribute(e.$config.item_attribute),u=e.$config.rowStore.getItem(c);return!t.isReadonly(u)&&!r(c)&&(i.config.initial_open_state=u.$open,!!t.callEvent("onRowDragStart",[c,l.target||l.srcElement,l])&&void 0)},t)),i.attachEvent("onAfterDragStart",t.bind(function(o,l){var d=a(l);i.config.marker.innerHTML=d.outerHTML;var c=i.config.marker.firstChild;c&&(i.config.marker.style.opacity=.4,c.style.position="static",c.style.pointerEvents="none"),i.config.id=d.getAttribute(e.$config.item_attribute);var u=e.$config.rowStore,h=u.getItem(i.config.id);i.config.level=u.calculateItemLevel(h),i.config.drop_target=Z.createDropTargetObject({targetParent:u.getParent(h.id),targetIndex:u.getBranchIndex(h.id),targetId:h.id,nextSibling:!0}),h.$open=!1,h.$transparent=!0,this.refreshData()},t)),i.attachEvent("onDragMove",t.bind(function(o,l){var d=s(l);return d&&t.callEvent("onBeforeRowDragMove",[i.config.id,d.targetParent,d.targetIndex])!==!1||(d=Z.createDropTargetObject(i.config.drop_target)),bn.highlightPosition(d,i.config,e),i.config.drop_target=d,t._waiAria.reorderMarkerAttr(i.config.marker),this.callEvent("onRowDragMove",[i.config.id,d.targetParent,d.targetIndex]),!0},t)),i.attachEvent("onDragEnd",t.bind(function(){var o=e.$config.rowStore,l=o.getItem(i.config.id);bn.removeLineHighlight(i.config),l.$transparent=!1,l.$open=i.config.initial_open_state;var d=i.config.drop_target;this.callEvent("onBeforeRowDragEnd",[i.config.id,d.targetParent,d.targetIndex])===!1?l.$drop_target=null:(o.move(i.config.id,d.targetIndex,d.targetParent),t.render(),this.callEvent("onRowDragEnd",[i.config.id,d.targetParent,d.targetIndex])),o.refresh(l.id)},t))}function a(o){return tt(o,e.$config.item_attribute)}function r(o){return Ct(o,t,t.getDatastore(e.$config.bind))}function s(o){var l,d=function(f){var y=nt(f,e.$grid_data).y,v=e.$config.rowStore;document.doctype||(y+=window.scrollY),y=y||0;var b=e.$state.scrollTop||0,_=t.$grid_data.getBoundingClientRect().height+b+window.scrollY,m=b,p=e.getItemIndexByTopPosition(e.$state.scrollTop);if(v.exists(p)||(p=v.countVisible()-1),p<0)return v.$getRootId();var k=v.getIdByIndex(p),$=e.$state.scrollTop/e.getItemHeight(k),w=$-Math.floor($);w>.1&&w<.9&&(_-=e.getItemHeight(k)*w,m+=e.getItemHeight(k)*(1-w));const x=z(e.$grid_data),S=x.y+x.height,T=i.config.marker.offsetHeight;y+T+window.scrollY>=_&&(i.config.marker.style.top=S-T+"px"),y>=_?y=_:y<=m&&(y=m,i.config.marker.style.top=x.y+"px");var C=e.getItemIndexByTopPosition(y);if(C>v.countVisible()-1||C<0)return v.$getRootId();var E=v.getIdByIndex(C);return r(E)?v.getPrevSibling(E):v.getIdByIndex(C)}(o),c=null,u=e.$config.rowStore,h=!e.$getConfig().order_branch_free,g=nt(o,e.$grid_data).y;return document.doctype||(g+=window.scrollY),d!==u.$getRootId()&&(c=(g-e.getItemTop(d))/e.getItemHeight(d)),h?(l=kn(i.config.id,d,c,g,u,i.config.level))&&l.targetParent&&r(l.targetParent)&&(d=u.getPrevSibling(l.targetParent),l=kn(i.config.id,d,c,g,u,i.config.level)):l=function(f,y,v,b,_){var m;if(y!==_.$getRootId())m=v<.25?Z.prevSiblingTarget(f,y,_):!(v>.6)||_.hasChild(y)&&_.getItem(y).$open?Z.firstChildTarget(f,y,_):Z.nextSiblingTarget(f,y,_);else{var p=_.$getRootId();m=_.hasChild(p)&&b>=0?Z.lastChildTarget(f,p,_):Z.firstChildTarget(f,p,_)}return m}(i.config.id,d,c,g,u),l}}};var Ra=function(t){return{onCreated:function(e){e.$config=N(e.$config,{bind:"task"}),e.$config.id=="grid"&&(this.extendGantt(e),t.ext.inlineEditors=t.ext._inlineEditors.createEditors(e),t.ext.inlineEditors.init()),this._mouseDelegates=me(t)},onInitialized:function(e){var n=e.$getConfig();n.order_branch&&(n.order_branch=="marker"?Pa.init(e.$gantt,e):La.init(e.$gantt,e)),this.initEvents(e,t),e.$config.id=="grid"&&this.extendDom(e)},onDestroyed:function(e){e.$config.id=="grid"&&t.ext.inlineEditors.destructor(),this.clearEvents(e,t)},initEvents:function(e,n){this._mouseDelegates.delegate("click","gantt_row",n.bind(function(i,a,r){var s=e.$getConfig();if(a!==null){var o=this.getTask(a);s.scroll_on_click&&!n._is_icon_open_click(i)&&this.showDate(o.start_date),n.callEvent("onTaskRowClick",[a,r])}},n),e.$grid),this._mouseDelegates.delegate("click","gantt_grid_head_cell",n.bind(function(i,a,r){var s=r.getAttribute("data-column-id");if(n.callEvent("onGridHeaderClick",[s,i])){var o=e.$getConfig();if(s!="add"){if(o.sort&&s){for(var l,d=s,c=0;cf){var y=f-h.end;(yl||l===void 0)&&(l=v)}}return l},_move:function(s,o,l,d){var c=this._drag_task_coords(s,l),u=null,h=null;d?(u=new Date(+l.obj.start_date+d),h=new Date(+l.obj.end_date+d)):(u=a.dateFromPos(c.start+o),h=a.dateFromPos(c.end+o)),u?h?(s.start_date=u,s.end_date=h):(s.end_date=new Date(a.getState().max_date),s.start_date=a.dateFromPos(a.posFromDate(s.end_date)-(c.end-c.start))):(s.start_date=new Date(a.getState().min_date),s.end_date=a.dateFromPos(a.posFromDate(s.start_date)+(c.end-c.start)))},_drag_task_coords:function(s,o){return{start:o.obj_s_x=o.obj_s_x||a.posFromDate(s.start_date),end:o.obj_e_x=o.obj_e_x||a.posFromDate(s.end_date)}},_mouse_position_change:function(s,o){var l=s.x-o.x,d=s.y-o.y;return Math.sqrt(l*l+d*d)},_is_number:function(s){return!isNaN(parseFloat(s))&&isFinite(s)},on_mouse_move:function(s){if(this.drag.start_drag){var o=nt(s,a.$task_data),l=this.drag.start_drag.start_x,d=this.drag.start_drag.start_y;(Date.now()-this.drag.timestamp>50||this._is_number(l)&&this._is_number(d)&&this._mouse_position_change({x:l,y:d},o)>20)&&this._start_dnd(s)}if(this.drag.mode){if(!Ue(this,40))return;this._update_on_move(s)}},_update_item_on_move:function(s,o,l,d,c,u){var h=a.getTask(o),g=a.mixin({},h),f=a.mixin({},h);this._handlers[l].apply(this,[f,s,d,u]),a.mixin(h,f,!0),a.callEvent("onTaskDrag",[h.id,l,f,g,c]),a.mixin(h,f,!0),a.refreshTask(o)},_update_on_move:function(s){var o=this.drag,l=i.$getConfig();if(o.mode){var d=nt(s,i.$task_data);if(o.pos&&o.pos.x==d.x)return;o.pos=d;var c=a.dateFromPos(d.x);if(!c||isNaN(c.getTime()))return;var u=d.x-o.start_x,h=a.getTask(o.id);if(this._handlers[o.mode]){if(o.mode===l.drag_mode.move){var g={};this._isMultiselect()&&a.getSelectedTasks().indexOf(o.id)>=0&&(g=this.dragMultiple);var f=!1;if(a.isSummaryTask(h)&&a.config.drag_project){var y={};y[o.id]=V(o),f=!0,g=N(y,this.dragMultiple)}var v=this._find_max_shift(g,u);for(var b in v!==void 0&&(u=v),this._update_item_on_move(u,o.id,o.mode,o,s),g){var _=g[b];if(f&&_.id!=o.id&&(a._bulk_dnd=!0),v===void 0&&(f||Object.keys(g).length>1))var m=c-a.dateFromPos(o.start_x);this._update_item_on_move(u,_.id,_.mode,_,s,m)}a._bulk_dnd=!1}else this._update_item_on_move(u,o.id,o.mode,o,s);a._update_parents(o.id)}}},on_mouse_down:function(s,o){if(s.button!=2||s.button===void 0){var l=i.$getConfig(),d=a.locate(s),c=null;if(a.isTaskExists(d)&&(c=a.getTask(d)),!a.isReadonly(c)&&!this.drag.mode){this.clear_drag_state();var u=K(o=o||s.target||s.srcElement),h=this._get_drag_mode(u,o);if(!u||!h)return o.parentNode?this.on_mouse_down(s,o.parentNode):void 0;if(h)if(h.mode&&h.mode!=l.drag_mode.ignore&&l["drag_"+h.mode]){if(d=a.locate(o),c=a.copy(a.getTask(d)||{}),a.isReadonly(c))return this.clear_drag_state(),!1;if(a.isSummaryTask(c)&&c.auto_scheduling!==!1&&!l.drag_project&&h.mode!=l.drag_mode.progress)return void this.clear_drag_state();h.id=d;var g=nt(s,a.$task_data);h.start_x=g.x,h.start_y=g.y,h.obj=c,this.drag.start_drag=h,this.drag.timestamp=Date.now()}else this.clear_drag_state();else if(a.checkEvent("onMouseDown")&&a.callEvent("onMouseDown",[u.split(" ")[0]])&&o.parentNode)return this.on_mouse_down(s,o.parentNode)}}},_fix_dnd_scale_time:function(s,o){var l=i.$getConfig(),d=a.getScale().unit,c=a.getScale().step;function u(h){if(a.config.correct_work_time){var g=i.$getConfig();a.isWorkTime(h.start_date,void 0,h)||(h.start_date=a.calculateEndDate({start_date:h.start_date,duration:-1,unit:g.duration_unit,task:h}))}}l.round_dnd_dates||(d="minute",c=l.time_step),o.mode==l.drag_mode.resize?o.left?(s.start_date=a.roundDate({date:s.start_date,unit:d,step:c}),u(s)):(s.end_date=a.roundDate({date:s.end_date,unit:d,step:c}),function(h){if(a.config.correct_work_time){var g=i.$getConfig();a.isWorkTime(new Date(h.end_date-1),void 0,h)||(h.end_date=a.calculateEndDate({start_date:h.end_date,duration:1,unit:g.duration_unit,task:h}))}}(s)):o.mode==l.drag_mode.move&&(s.start_date=a.roundDate({date:s.start_date,unit:d,step:c}),u(s),s.end_date=a.calculateEndDate(s))},_fix_working_times:function(s,o){var l=i.$getConfig();(o=o||{mode:l.drag_mode.move}).mode==l.drag_mode.resize?o.left?s.start_date=a.getClosestWorkTime({date:s.start_date,dir:"future",task:s}):s.end_date=a.getClosestWorkTime({date:s.end_date,dir:"past",task:s}):o.mode==l.drag_mode.move&&a.correctTaskWorkTime(s)},_finalize_mouse_up:function(s,o,l,d){var c=a.getTask(s);if(o.work_time&&o.correct_work_time&&this._fix_working_times(c,l),this._fix_dnd_scale_time(c,l),this._fireEvent("before_finish",l.mode,[s,l.mode,a.copy(l.obj),d])){var u=s;a._init_task_timing(c),this.clear_drag_state(),a.updateTask(c.id),this._fireEvent("after_finish",l.mode,[u,l.mode,d])}else this.clear_drag_state(),s==l.id&&(l.obj._dhx_changed=!1,a.mixin(c,l.obj,!0)),a.refreshTask(c.id)},on_mouse_up:function(s){var o=this.drag;if(o.mode&&o.id){var l=i.$getConfig(),d=a.getTask(o.id),c=this.dragMultiple,u=!1,h=0;o.mode===l.drag_mode.move&&(a.isSummaryTask(d)&&l.drag_project||this._isMultiselect())&&(u=!0,h=Object.keys(c).length);var g=function(){if(u)for(var f in c)c[f].id!=o.id&&this._finalize_mouse_up(c[f].id,l,c[f],s);this._finalize_mouse_up(o.id,l,o,s)};u&&h>10?a.batchUpdate((function(){g.call(this)}).bind(this)):g.call(this)}this.clear_drag_state()},_get_drag_mode:function(s,o){var l=i.$getConfig().drag_mode,d={mode:null,left:null};switch((s||"").split(" ")[0]){case"gantt_task_line":case"gantt_task_content":d.mode=l.move;break;case"gantt_task_drag":d.mode=l.resize;var c=o.getAttribute("data-bind-property");d.left=c=="start_date";break;case"gantt_task_progress_drag":d.mode=l.progress;break;case"gantt_link_control":case"gantt_link_point":d.mode=l.ignore;break;default:d=null}return d},_start_dnd:function(s){var o=this.drag=this.drag.start_drag;delete o.start_drag;var l=i.$getConfig(),d=o.id;if(l["drag_"+o.mode]&&a.callEvent("onBeforeDrag",[d,o.mode,s])&&this._fireEvent("before_start",o.mode,[d,o.mode,s])){delete o.start_drag;var c=a.getTask(d);if(a.isReadonly(c))return void this.clear_drag_state();if(this._isMultiselect()){var u=a.getSelectedTasks();u.indexOf(o.id)>=0&&kt(u,a.bind(function(h){var g=a.getTask(h);a.isSummaryTask(g)&&a.config.drag_project&&o.mode==l.drag_mode.move&&this._addSubtasksToDragMultiple(g.id),this.dragMultiple[h]=a.mixin({id:g.id,obj:a.copy(g)},this.drag)},this))}a.isSummaryTask(c)&&a.config.drag_project&&o.mode==l.drag_mode.move&&this._addSubtasksToDragMultiple(c.id),a.callEvent("onTaskDragStart",[])}else this.clear_drag_state()},_fireEvent:function(s,o,l){a.assert(this._events[s],"Invalid stage:{"+s+"}");var d=this._events[s][o];return a.assert(d,"Unknown after drop mode:{"+o+"}"),a.assert(l,"Invalid event arguments"),!a.checkEvent(d)||a.callEvent(d,l)},round_task_dates:function(s){var o=this.drag,l=i.$getConfig();o||(o={mode:l.drag_mode.move}),this._fix_dnd_scale_time(s,o)},destructor:function(){this._domEvents.detachAll()},_isMultiselect:function(){return a.config.drag_multiple&&!!(a.getSelectedTasks&&a.getSelectedTasks().length>0)},_addSubtasksToDragMultiple:function(s){a.eachTask(function(o){this.dragMultiple[o.id]=a.mixin({id:o.id,obj:a.copy(o)},this.drag)},s,this)}}}(e,n),e._tasks_dnd=t,t.init(n)},destructor:function(){t&&(t.destructor(),t=null)}}}};var Oa=function(t,e){var n,i,a,r,s;function o(){return{link_source_id:r,link_target_id:i,link_from_start:s,link_to_start:a,link_landing_area:n}}var l=e.$services,d=l.getService("state"),c=l.getService("dnd");d.registerProvider("linksDnD",o);var u="gantt_link_point",h="gantt_link_control",g=new c(t.$task_bars,{sensitivity:0,updates_per_second:60,mousemoveContainer:e.$root,selector:"."+u,preventDefault:!0});function f(m,p){var k,$=g.getPosition(m),w=function(A){var I=0,M=0;return A&&(I=A.offsetWidth||0,M=A.offsetHeight||0),{width:I,height:M}}(p),x={right:(k=e.$root).offsetWidth,bottom:k.offsetHeight},S=e.config.tooltip_offset_x||10,T=e.config.tooltip_offset_y||10,C=e.config.scroll_size||18,E=e.$container.getBoundingClientRect().y+window.scrollY,D={y:$.y+T,x:$.x+S,bottom:$.y+w.height+T+C,right:$.x+w.width+S+C};return D.bottom>x.bottom+E&&(D.y=x.bottom+E-w.height-T),D.right>x.right&&(D.x=x.right-w.width-S),D}function y(m){var p=o();p.link_source_id&&p.link_target_id&&e.isLinkAllowed(p.link_source_id,p.link_target_id,p.link_from_start,p.link_to_start);var k="";m.innerHTML=k}function v(){r=s=i=null,a=!0}function b(m,p,k,$){var w=function(){return g._direction&&g._direction.parentNode||(g._direction=document.createElement("div"),t.$task_links.appendChild(g._direction)),g._direction}(),x=o(),S=["gantt_link_direction"];e.templates.link_direction_class&&S.push(e.templates.link_direction_class(x.link_source_id,x.link_from_start,x.link_target_id,x.link_to_start));var T=Math.sqrt(Math.pow(k-m,2)+Math.pow($-p,2));if(T=Math.max(0,T-3)){w.className=S.join(" ");var C=($-p)/(k-m),E=Math.atan(C);_(m,k,p,$)==2?E+=Math.PI:_(m,k,p,$)==3&&(E-=Math.PI);var D=Math.sin(E),A=Math.cos(E),I=Math.round(p),M=Math.round(m),L=["-webkit-transform: rotate("+E+"rad)","-moz-transform: rotate("+E+"rad)","-ms-transform: rotate("+E+"rad)","-o-transform: rotate("+E+"rad)","transform: rotate("+E+"rad)","width:"+Math.round(T)+"px"];if(window.navigator.userAgent.indexOf("MSIE 8.0")!=-1){L.push('-ms-filter: "'+function(U,ft){return"progid:DXImageTransform.Microsoft.Matrix(M11 = "+ft+",M12 = -"+U+",M21 = "+U+",M22 = "+ft+",SizingMethod = 'auto expand')"}(D,A)+'"');var P=Math.abs(Math.round(m-k)),H=Math.abs(Math.round($-p));switch(_(m,k,p,$)){case 1:I-=H;break;case 2:M-=P,I-=H;break;case 3:M-=P}}L.push("top:"+I+"px"),L.push("left:"+M+"px"),w.style.cssText=L.join(";")}}function _(m,p,k,$){return p>=m?$<=k?1:4:$<=k?2:3}g.attachEvent("onBeforeDragStart",e.bind(function(m,p){var k=p.target||p.srcElement;if(v(),e.getState("tasksDnd").drag_id)return!1;if(ht(k,u)){ht(k,"task_start_date")&&(s=!0);var $=e.locate(p);r=$;var w=e.getTask($);return e.isReadonly(w)?(v(),!1):(this._dir_start={x:g.config.original_element_sizes.x+g.config.original_element_sizes.width/2,y:g.config.original_element_sizes.y+g.config.original_element_sizes.height/2},!0)}return!1},this)),g.attachEvent("onAfterDragStart",e.bind(function(m,p){e.config.touch&&e.refreshData(),y(g.config.marker)},this)),g.attachEvent("onDragMove",e.bind(function(m,p){var k=g.config,$=f(p,k.marker);(function(A,I){A.style.left=I.x+"px",A.style.top=I.y+"px"})(k.marker,$);var w=!!ht(p,h),x=i,S=n,T=a,C=e.locate(p),E=!0;if(Y(mt(p),e.$root)||(w=!1,C=null),w&&(E=!ht(p,"task_end_date"),w=!!C),i=C,n=w,a=E,w){const A=ht(p,h).querySelector(`.${u}`);if(A){const I=Ae(A,t.$task_bg);this._dir_end={x:I.x+A.offsetWidth/2,y:I.y+A.offsetHeight/2}}}else this._dir_end=nt(p,t.$task_data),e.env.isEdge&&(this._dir_end.y+=window.scrollY);var D=!(S==w&&x==C&&T==E);return D&&(x&&e.refreshTask(x,!1),C&&e.refreshTask(C,!1)),D&&y(k.marker),b(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y),!0},this)),g.attachEvent("onDragEnd",e.bind(function(){var m=o();if(m.link_source_id&&m.link_target_id&&m.link_source_id!=m.link_target_id){var p=e._get_link_type(m.link_from_start,m.link_to_start),k={source:m.link_source_id,target:m.link_target_id,type:p};k.type&&e.isLinkAllowed(k)&&e.callEvent("onLinkCreated",[k])&&e.addLink(k)}v(),e.config.touch?e.refreshData():(m.link_source_id&&e.refreshTask(m.link_source_id,!1),m.link_target_id&&e.refreshTask(m.link_target_id,!1)),g._direction&&(g._direction.parentNode&&g._direction.parentNode.removeChild(g._direction),g._direction=null)},this)),e.attachEvent("onGanttRender",e.bind(function(){g._direction&&b(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y)},this))};const Ba=function(){return{init:Oa}};var za=function(t){var e=t.$services;return{onCreated:function(n){var i=n.$config;i.bind=W(i.bind)?i.bind:"task",i.bindLinks=W(i.bindLinks)?i.bindLinks:"link",n._linksDnD=Ba(),n._tasksDnD=Ha.createTaskDND(),n._tasksDnD.extend(n),this._mouseDelegates=me(t)},onInitialized:function(n){this._attachDomEvents(t),this._attachStateProvider(t,n),n._tasksDnD.init(n,t),n._linksDnD.init(n,t),n.$config.id=="timeline"&&this.extendDom(n)},onDestroyed:function(n){this._clearDomEvents(t),this._clearStateProvider(t),n._tasksDnD&&n._tasksDnD.destructor()},extendDom:function(n){t.$task=n.$task,t.$task_scale=n.$task_scale,t.$task_data=n.$task_data,t.$task_bg=n.$task_bg,t.$task_links=n.$task_links,t.$task_bars=n.$task_bars},_clearDomEvents:function(){this._mouseDelegates.destructor(),this._mouseDelegates=null},_attachDomEvents:function(n){function i(a,r){if(a&&this.callEvent("onLinkDblClick",[a,r])){var s=this.getLink(a);if(this.isReadonly(s))return;var o=this.locale.labels.link+" "+this.templates.link_description(this.getLink(a))+" "+this.locale.labels.confirm_link_deleting;window.setTimeout(function(){n._simple_confirm(o,"",function(){n.deleteLink(a)})},this.config.touch?300:1)}}this._mouseDelegates.delegate("click","gantt_task_link",n.bind(function(a,r){var s=this.locate(a,this.config.link_attribute);s&&this.callEvent("onLinkClick",[s,a])},n),this.$task),this._mouseDelegates.delegate("click","gantt_scale_cell",n.bind(function(a,r){var s=nt(a,n.$task_data),o=n.dateFromPos(s.x),l=Math.floor(n.columnIndexByDate(o)),d=n.getScale().trace_x[l];n.callEvent("onScaleClick",[a,d])},n),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_task_link",n.bind(function(a,r,s){r=this.locate(a,n.config.link_attribute),i.call(this,r,a)},n),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_link_point",n.bind(function(a,r,s){r=this.locate(a);var o=this.getTask(r),l=null;return s.parentNode&&K(s.parentNode)&&(l=K(s.parentNode).indexOf("_left")>-1?o.$target[0]:o.$source[0]),l&&i.call(this,l,a),!1},n),this.$task)},_attachStateProvider:function(n,i){var a=i;e.getService("state").registerProvider("tasksTimeline",function(){return{scale_unit:a._tasks?a._tasks.unit:void 0,scale_step:a._tasks?a._tasks.step:void 0}})},_clearStateProvider:function(){e.getService("state").unregisterProvider("tasksTimeline")}}},Wa=function(t){return{getVerticalScrollbar:function(){return t.$ui.getView("scrollVer")},getHorizontalScrollbar:function(){return t.$ui.getView("scrollHor")},_legacyGridResizerClass:function(e){for(var n=e.getCellsByType("resizer"),i=0;io[1]&&(t.config.grid_width=o[1]),i&&t.config.show_chart){if(a.$config.width=t.config.grid_width-1,!a.$config.scrollable&&a.$config.scrollY&&t.$root.offsetWidth){var l=a.$gantt.$layout.$container.offsetWidth,d=t.$ui.getView(a.$config.scrollY).$config.width,c=l-(a.$config.width+d)-4;c<0&&(a.$config.width+=c,t.config.grid_width+=c)}if(n)a.$parent.$config.width=t.config.grid_width,a.$parent.$config.group&&t.$layout._syncCellSizes(a.$parent.$config.group,{value:a.$parent.$config.width,isGravity:!1});else if(i&&!Y(i.$task,e.$view)){if(!a.$config.original_grid_width){var u=t.skins[t.skin];u&&u.config&&u.config.grid_width?a.$config.original_grid_width=u.config.grid_width:a.$config.original_grid_width=0}t.config.grid_width=a.$config.original_grid_width,a.$parent.$config.width=t.config.grid_width}else a.$parent._setContentSize(a.$config.width,null),t.$layout._syncCellSizes(a.$parent.$config.group,{value:t.config.grid_width,isGravity:!1})}else i&&Y(i.$task,e.$view)&&(a.$config.original_grid_width=t.config.grid_width),n||(a.$parent.$config.width=0)}n=!1}}),this._initScrollStateEvents(e)},_initScrollStateEvents:function(e){t._getVerticalScrollbar=this.getVerticalScrollbar,t._getHorizontalScrollbar=this.getHorizontalScrollbar;var n=this.getVerticalScrollbar(),i=this.getHorizontalScrollbar();n&&n.attachEvent("onScroll",function(a,r,s){var o=t.getScrollState();t.callEvent("onGanttScroll",[o.x,a,o.x,r])}),i&&i.attachEvent("onScroll",function(a,r,s){var o=t.getScrollState();t.callEvent("onGanttScroll",[a,o.y,r,o.y]);var l=t.$ui.getView("grid");l&&l.$grid_data&&!l.$config.scrollable&&(l.$grid_data.style.left=l.$grid.scrollLeft+"px",l.$grid_data.scrollLeft=l.$grid.scrollLeft)}),e.attachEvent("onResize",function(){n&&!t.$scroll_ver&&(t.$scroll_ver=n.$scroll_ver),i&&!t.$scroll_hor&&(t.$scroll_hor=i.$scroll_hor)})},_findGridResizer:function(e,n){for(var i,a=e.getCellsByType("resizer"),r=!0,s=0;s",b=""):(X(v=m.template?m.template(s):s[m.name])&&(v=u.date_grid(v,s,m.name)),v==null&&(v=""),b=v,v="
"+v+"
");var p="gantt_cell"+(_?" gantt_last_cell":""),k=[];if(m.tree){p+=" gantt_cell_tree";for(var $=0;$"+k.join("")+"",g.push(y)}switch(p="",h.$config.name){case"task":p=r.getGlobalTaskIndex(s.id)%2==0?"":" odd";break;case"resource":p=h.visibleOrder.indexOf(s.id)%2==0?"":" odd"}if(p+=s.$transparent?" gantt_transparent":"",p+=s.$dataprocessor_class?" "+s.$dataprocessor_class:"",u.grid_row_class){var T=u.grid_row_class.call(r,s.start_date,s.end_date,s);T&&(p+=" "+T)}h.isSelected(s.id)&&(p+=" gantt_selected");var C=document.createElement("div");C.className="gantt_row"+p+" gantt_row_"+r.getTaskType(s.type);var E=o.getItemHeight(s.id);return C.style.height=E+"px",C.style.lineHeight=E+"px",l.smart_rendering&&(C.style.position="absolute",C.style.left="0px",C.style.top=o.getItemTop(s.id)+"px"),o.$config.item_attribute&&(C.setAttribute(o.$config.item_attribute,s.id),C.setAttribute(o.$config.bind+"_id",s.id)),r._waiAria.taskRowAttr(s,C),C.innerHTML=g.join(""),C},update:null,getRectangle:Ft,isInViewPort:Ma,getVisibleRange:gt,onrender:function(s,o,l){for(var d=l.getGridColumns(),c=0;c$.end)&&d(g.id,x)}o[g.id]={};for(var S=$.start;S<=$.end;S++){var T=h(_,S,g,b,m,p,k,v);!T&&l(g,S)?d(g.id,S):T&&!T.parentNode&&f.appendChild(T)}}},getRectangle:pn,getVisibleRange:gt,prepareData:Aa}}(t)},taskBar:function(){return fn(t)},timedProjectBar:function(){return fn(t)},taskRollupBar:function(){return function(r){const s=gn(r),o={};function l(u,h,g,f,y){let v=!0;return f.smart_rendering&&(v=ke(u,h,g)),v}function d(u,h,g,f){const y=r.copy(r.getTask(h.id));if(y.$rendered_at=u.id,r.callEvent("onBeforeRollupTaskDisplay",[y.id,y,u.id])===!1)return;const v=s(y,g);if(!v)return;const b=g.getBarHeight(u.id,h.type==r.config.types.milestone),_=Math.floor((g.getItemHeight(u.id)-b)/2);return v.style.top=f.top+_+"px",v.classList.add("gantt_rollup_child"),v.setAttribute("data-rollup-parent-id",u.id),v}function c(u,h){return u+"_"+h}return{render:function(u,h,g,f){if(u.rollup!==!1&&u.$rollup&&u.$rollup.length){const y=document.createElement("div"),v=r.getTaskPosition(u);return f&&(f.y=0,f.y_end=r.$task_bg.scrollHeight),u.$rollup.forEach(function(b){if(!r.isTaskExists(b))return;const _=r.getTask(b);if(!l(_,f,h,g))return;const m=d(u,_,h,v);m?(o[c(_.id,u.id)]=m,y.appendChild(m)):o[c(_.id,u.id)]=!1}),y}return!1},update:function(u,h,g,f,y){const v=document.createElement("div"),b=r.getTaskPosition(u);y.y=0,y.y_end=r.$task_bg.scrollHeight,u.$rollup.forEach(function(_){const m=r.getTask(_),p=c(m.id,u.id);let k=l(m,y,g,f);if(k!==!!o[p])if(k){const $=d(u,m,g,b);o[p]=$||!1}else o[p]=!1;o[p]&&v.appendChild(o[p]),h.innerHTML="",h.appendChild(v)})},isInViewPort:ke,getVisibleRange:gt}}(t)},taskSplitBar:function(){return Mt()},taskConstraints:function(){return Mt()},taskDeadline:function(){return Mt()},taskBaselines:function(){return Mt()},link:function(){return Ia(t)},resourceRow:function(){return function(r){var s=Na(r),o={};function l(c,u,h,g,f){var y=h.resource_cell_class(u.start_date,u.end_date,c,u.tasks,u.assignments),v=h.resource_cell_value(u.start_date,u.end_date,c,u.tasks,u.assignments),b=f.getItemHeight(c.id)-1;if(y||v){var _=f.getItemPosition(c,u.start_date,u.end_date),m=document.createElement("div");return m.setAttribute(f.$config.item_attribute,c.id),m.className=["gantt_resource_marker",y].join(" "),m.style.cssText=["left:"+_.left+"px","width:"+_.width+"px","height:"+b+"px","line-height:"+b+"px","top:"+_.top+"px"].join(";"),v&&(m.innerHTML=v),m}return null}function d(c,u){o[c]&&o[c][u]&&o[c][u].parentNode&&o[c][u].parentNode.removeChild(o[c][u])}return{render:function(c,u,h,g){var f=u.$getTemplates(),y=u.getScale(),v=s(c,h.resource_property,u.getScale(),u),b=!!g,_=[];o[c.id]={};for(var m=Ut(y,g),p=m.start;p<=m.end;p++){var k=v[p];if(k&&(!b||ye(p,y,g,r))){var $=l(c,k,f,0,u);$&&(_.push($),o[c.id][p]=$)}}var w=null;if(_.length){w=document.createElement("div");for(var x=0;x<_.length;x++)w.appendChild(_[x])}return w},update:function(c,u,h,g,f){var y=h.$getTemplates(),v=h.getScale(),b=s(c,g.resource_property,h.getScale(),h),_=Ut(v,f),m={};if(o&&o[c.id])for(var p in o[c.id])m[p]=p;for(var k=_.start;k<=_.end;k++){var $=b[k];if(m[k]=!1,$)if(ye(k,v,f,r))if(o[c.id]&&o[c.id][k])o[c.id]&&o[c.id][k]&&!o[c.id][k].parentNode&&u.appendChild(o[c.id][k]);else{var w=l(c,$,y,0,h);w&&(u.appendChild(w),o[c.id][k]=w)}else d(c.id,k)}for(var p in m)m[p]!==!1&&d(c.id,p)},getRectangle:pn,getVisibleRange:gt}}(t)},resourceHistogram:function(){return Mt()},gridTaskRowResizer:function(){return function(r){return{render:function(s,o,l){var d=o.$getConfig(),c=document.createElement("div");return c.className="gantt_task_grid_row_resize_wrap",c.style.top=o.getItemTop(s.id)+o.getItemHeight(s.id)+"px",c.innerHTML="
",c.setAttribute(d.task_grid_row_resizer_attribute,s.id),r._waiAria.rowResizerAttr(c),c},update:null,getRectangle:Ft,getVisibleRange:gt}}(t)}},layersService:{getDataRender:function(r){return i.getDataRender(r,t)},createDataRender:function(r){return i.createDataRender(r,t)}}}}};function $e(t,e){const n=getComputedStyle(e.$root).getPropertyValue("--dhx-gantt-theme");let i,a=!!n;if(a)i=n;else{var r=e.skin;if(i=r,!r||t)for(var s=document.getElementsByTagName("link"),o=0;ou.width?u.min_width:u.width,u.width=u.max_width&&u.max_width0&&S+T>=C+2)&&(w=0),($&&!D||$<0&&!E||$>0&&E+D>=A)&&($=0);var I=t.config.autoscroll_step;I&&I<2&&(I=2),w*=I||n,(($*=I||n)||w)&&function(M,L){var P=t.getScrollState(),H=null,U=null;M&&(H=P.x+M,H=Math.min(P.width,H),H=Math.max(0,H)),L&&(U=P.y+L,U=Math.min(P.height,U),U=Math.max(0,U)),t.scrollTo(H,U)}($,w)}}function v(b,_,m){return b-e<0&&b_-e&&b>m?1:0}t.attachEvent("onGanttReady",function(){if(!F(t)){var b=vt(t.$root)||document.body;t.eventRemove(b,"mousemove",f),t.event(b,"mousemove",f),t.eventRemove(b,"touchmove",f),t.event(b,"touchmove",f),t.eventRemove(b,"pointermove",f),t.event(b,"pointermove",f)}}),t.attachEvent("onDestroy",function(){g(!1)})}var we,Se;window.jQuery&&(we=window.jQuery,Se=[],we.fn.dhx_gantt=function(t){if(typeof(t=t||{})!="string"){var e=[];return this.each(function(){if(this&&this.getAttribute)if(this.gantt||window.gantt.$root==this)e.push(typeof this.gantt=="object"?this.gantt:window.gantt);else{var n=window.gantt.$container&&window.Gantt?window.Gantt.getGanttInstance():window.gantt;for(var i in t)i!="data"&&(n.config[i]=t[i]);n.init(this),t.data&&n.parse(t.data),e.push(n)}}),e.length===1?e[0]:e}if(Se[t])return Se[t].apply(this,[]);we.error("Method "+t+" does not exist on jQuery.dhx_gantt")});const Va=null;window.dhtmlx&&(window.dhtmlx.attaches||(window.dhtmlx.attaches={}),window.dhtmlx.attaches.attachGantt=function(t,e,n){var i=document.createElement("DIV");n=n||window.gantt,i.id="gantt_"+n.uid(),i.style.width="100%",i.style.height="100%",i.cmp="grid",document.body.appendChild(i),this.attachObject(i.id),this.dataType="gantt",this.dataObj=n;var a=this.vs[this.av];return a.grid=n,n.init(i.id,t,e),i.firstChild.style.border="none",a.gridId=i.id,a.gridObj=i,this.vs[this._viewRestore()].grid}),window.dhtmlXCellObject!==void 0&&(window.dhtmlXCellObject.prototype.attachGantt=function(t,e,n){n=n||window.gantt;var i=document.createElement("DIV");return i.id="gantt_"+n.uid(),i.style.width="100%",i.style.height="100%",i.cmp="grid",document.body.appendChild(i),this.attachObject(i.id),this.dataType="gantt",this.dataObj=n,n.init(i.id,t,e),i.firstChild.style.border="none",i=null,this.callEvent("_onContentAttach",[]),this.dataObj});const Ua=null,qa=["ctrlKey","altKey","shiftKey","metaKey"],Ga=[[{unit:"month",date:"%M",step:1},{unit:"day",date:"%d",step:1}],[{unit:"day",date:"%d %M",step:1}],[{unit:"day",date:"%d %M",step:1},{unit:"hour",date:"%H:00",step:8}],[{unit:"day",date:"%d %M",step:1},{unit:"hour",date:"%H:00",step:1}]];class Ya{constructor(e){this.zoomIn=()=>{const n=this.getCurrentLevel()-1;n<0||this.setLevel(n)},this.zoomOut=()=>{const n=this.getCurrentLevel()+1;n>this._levels.length-1||this.setLevel(n)},this.getCurrentLevel=()=>this._activeLevelIndex,this.getLevels=()=>this._levels,this.setLevel=n=>{const i=this._getZoomIndexByName(n);i===-1&&this.$gantt.assert(i!==-1,"Invalid zoom level for gantt.ext.zoom.setLevel. "+n+" is not an expected value."),this._setLevel(i,0)},this._getZoomIndexByName=n=>{let i=-1;if(typeof n=="string"){if(!isNaN(Number(n))&&this._levels[Number(n)])i=Number(n);else for(let a=0;a{if(!this.$gantt.$task)return null;const n=this.$gantt.getScrollState().x,i=this.$gantt.$task.offsetWidth;this._visibleDate=this.$gantt.dateFromPos(n+i/2)},this._setLevel=(n,i)=>{this._activeLevelIndex=n;const a=this.$gantt,r=a.copy(this._levels[this._activeLevelIndex]),s=a.copy(r);if(delete s.name,a.mixin(a.config,s,!0),a.$root&&a.$task){if(i){const o=this.$gantt.dateFromPos(i+this.$gantt.getScrollState().x);this.$gantt.render();const l=this.$gantt.posFromDate(o);this.$gantt.scrollTo(l-i)}else{const o=this.$gantt.$task.offsetWidth;this._visibleDate||this._getVisibleDate();const l=this._visibleDate;this.$gantt.render();const d=this.$gantt.posFromDate(l);this.$gantt.scrollTo(d-o/2)}this.callEvent("onAfterZoom",[this._activeLevelIndex,r])}},this._attachWheelEvent=n=>{const i=_t.isFF?"wheel":"mousewheel";let a;a=typeof n.element=="function"?n.element():n.element,a&&this._domEvents.attach(a,i,this.$gantt.bind(function(r){if(this._useKey&&(qa.indexOf(this._useKey)<0||!r[this._useKey]))return!1;if(typeof this._handler=="function")return this._handler.apply(this,[r]),!0},this),{passive:!1})},this._defaultHandler=n=>{const i=this.$gantt.$task.getBoundingClientRect().x,a=n.clientX-i;let r=!1;(this.$gantt.env.isFF?-40*n.deltaY:n.wheelDelta)>0&&(r=!0),n.preventDefault(),n.stopPropagation(),this._setScaleSettings(r,a)},this._setScaleDates=()=>{this._initialStartDate&&this._initialEndDate&&(this.$gantt.config.start_date=this._initialStartDate,this.$gantt.config.end_date=this._initialEndDate)},this.$gantt=e,this._domEvents=this.$gantt._createDomEventScope()}init(e){this.$gantt.env.isNode||(this._initialStartDate=e.startDate,this._initialEndDate=e.endDate,this._activeLevelIndex=e.activeLevelIndex?e.activeLevelIndex:0,this._levels=this._mapScales(e.levels||Ga),this._handler=e.handler||this._defaultHandler,this._minColumnWidth=e.minColumnWidth||60,this._maxColumnWidth=e.maxColumnWidth||240,this._widthStep=e.widthStep||3/8*e.minColumnWidth,this._useKey=e.useKey,this._initialized||(it(this),this.$gantt.attachEvent("onGanttScroll",()=>{this._getVisibleDate()})),this._domEvents.detachAll(),e.trigger==="wheel"&&(this.$gantt.$root?this._attachWheelEvent(e):this.$gantt.attachEvent("onGanttReady",()=>{this._attachWheelEvent(e)})),this._initialized=!0,this.setLevel(this._activeLevelIndex))}_mapScales(e){return e.map(n=>Array.isArray(n)?{scales:n}:n)}_setScaleSettings(e,n){e?this._stepUp(n):this._stepDown(n)}_stepUp(e){if(this._activeLevelIndex>=this._levels.length-1)return;let n=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){let i=this.$gantt.config.min_column_width+this._widthStep;i>this._maxColumnWidth&&(i=this._minColumnWidth,n++),this.$gantt.config.min_column_width=i}else n++;this._setLevel(n,e)}_stepDown(e){if(this._activeLevelIndex<1)return;let n=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){let i=this.$gantt.config.min_column_width-this._widthStep;i1),t.config.touch){var r=!0;try{document.createEvent("TouchEvent")}catch{r=!1}r?t._touch_events(["touchmove","touchstart","touchend"],function(s){return s.touches&&s.touches.length>1?null:s.touches[0]?{target:s.target,pageX:s.touches[0].pageX,pageY:s.touches[0].pageY,clientX:s.touches[0].clientX,clientY:s.touches[0].clientY}:s},function(){return!1}):window.navigator.pointerEnabled?t._touch_events(["pointermove","pointerdown","pointerup"],function(s){return s.pointerType=="mouse"?null:s},function(s){return!s||s.pointerType=="mouse"}):window.navigator.msPointerEnabled&&t._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(s){return s.pointerType==s.MSPOINTER_TYPE_MOUSE?null:s},function(s){return!s||s.pointerType==s.MSPOINTER_TYPE_MOUSE})}}function n(r){var s=r.$config.scrollX?t.$ui.getView(r.$config.scrollX):null,o=r.$config.scrollY?t.$ui.getView(r.$config.scrollY):null,l={x:null,y:null};return s&&s.getScrollState().visible&&(l.x=s.$view.scrollLeft),o&&o.getScrollState().visible&&(l.y=o.$view.scrollTop),l}function i(){var r;return t.$ui.getView("timeline")&&(r=t.$ui.getView("timeline")._tasks_dnd),r}t.config.touch_drag=75,t.config.touch=!0,t.config.touch_feedback=!0,t.config.touch_feedback_duration=1,t._prevent_touch_scroll=!1,t._touch_feedback=function(){t.config.touch_feedback&&navigator.vibrate&&navigator.vibrate(t.config.touch_feedback_duration)},t.attachEvent("onGanttReady",function(){t.$container&&e()}),t.attachEvent("onGanttLayoutReady",function(){t.$container&&t.attachEvent("onGanttRender",e,{once:!0})});var a=[];t._touch_events=function(r,s,o){var l,d=0,c=!1,u=!1,h=null,g=null,f=null,y=[],v=null;let b={};for(var _=0;_5||Math.abs(x)>5)&&(u=!0,d=0,l=v?n(v):t.getScrollState()),u){var S,T=l.x+w,C=l.y+x;if(v?(function(E,D,A){var I=E.$config.scrollX?t.$ui.getView(E.$config.scrollX):null,M=E.$config.scrollY?t.$ui.getView(E.$config.scrollY):null;I&&I.scrollTo(D,null),M&&M.scrollTo(null,A)}(v,T,C),S=n(v)):(t.scrollTo(T,C),S=t.getScrollState()),l.x!=S.x&&x>2*w||l.y!=S.y&&w>2*x)return m(p)}}return m(p)}return!0}}]);try{document.addEventListener("touchmove",function(p){t._touch_drag&&m(p)},{passive:!1})}catch{console.warn("Cannot prevent touch event for the page drag")}for(a.push([this.$container,"contextmenu",function(p){if(c)return m(p)}]),a.push([this.$container,r[1],function(p){if(b=p.touches.length,document&&document.body&&document.body.classList.add("gantt_touch_active"),!o(p))if(p.touches&&p.touches.length>1)c=!1;else{h=s(p),v=function($){for(var w=t.$layout.getCellsByType("viewCell"),x=0;x=S.left&&$.clientX<=S.right&&$.clientY<=S.bottom&&$.clientY>=S.top)return w[x]}}(h),t._locate_css(h,"gantt_hor_scroll")||t._locate_css(h,"gantt_ver_scroll")||(c=!0);var k=i();g=setTimeout(function(){var $=t.locate(h);k&&$&&!t._locate_css(h,"gantt_link_control")&&!t._locate_css(h,"gantt_grid_data")&&(k.on_mouse_down(h),k.drag&&k.drag.start_drag&&(function(w){const x=t._getTaskLayers();let S=t.getTask(w);if(S){let T=t.isTaskVisible(w);if(T){f=w;for(let C=0;C"}};function Lt(t,e,n){return e=e||[],"<"+t+$n(n||[])+">"+(e.innerHTML||"")+""}function $n(t){var e="";return kt(t,function(n){e+=" "+n.key+"='"+n.value+"'"}),e}function Gt(t){const e=ct();function n(){return e.apply(this,arguments)||this}return B(n,e),n.prototype.render=function(i){const a=i.height?`height:${i.height}px;`:"";let r=`
`;return r+=xn.getHtmlSelect(i.options,[{key:"style",value:"width:100%;"},{key:"title",value:i.name}]),r+="
",r},n.prototype.set_value=function(i,a,r,s){var o=i.firstChild;!o._dhx_onchange&&s.onchange&&(o.onchange=s.onchange,o._dhx_onchange=!0),a===void 0&&(a=(o.options[0]||{}).value),o.value=a||""},n.prototype.get_value=function(i){return i.firstChild.value},n.prototype.focus=function(i){var a=i.firstChild;t._focus(a,!0)},n}function Ka(t){var e=Gt(t);function n(){return e.apply(this,arguments)||this}function i(a,r){var s=[],o=[];r&&(s=t.getTaskByTime(),a.allow_root&&s.unshift({id:t.config.root_id,text:a.root_label||""}),s=function(u,h,g){var f=h.filter||function(){return!0};u=u.slice(0);for(var y=0;y`},m.prototype.set_value=function(p,k){p.innerHTML=k||""},m.prototype.get_value=function(p){return p.innerHTML||""},m.prototype.focus=function(){},m}(),n=function(_){const m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){return`
`},p.prototype.set_value=function(k,$){_.form_blocks.textarea._get_input(k).value=$||""},p.prototype.get_value=function(k){return _.form_blocks.textarea._get_input(k).value},p.prototype.focus=function(k){var $=_.form_blocks.textarea._get_input(k);_._focus($,!0)},p.prototype._get_input=function(k){return k.querySelector("textarea")},p}(t),i=function(_){const m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){var $=_.form_blocks.getTimePicker.call(this,k);let w="gantt_section_time";k.name!=="time"&&(w+=" gantt_section_"+k.name);var x="
";return x+=$,k.single_date?($=_.form_blocks.getTimePicker.call(this,k,!0),x+=""):x+="  –  ",(x+=$)+"
"},p.prototype.set_value=function(k,$,w,x){var S=x,T=k.getElementsByTagName("select"),C=x._time_format_order;if(S.auto_end_date)for(var E=function(){I=new Date(T[C[2]].value,T[C[1]].value,T[C[0]].value,0,0),M=_.calculateEndDate({start_date:I,duration:1,task:w}),_.form_blocks._fill_lightbox_select(T,C.size,M,C,S)},D=0;D<4;D++)T[D].onchange=E;var A=_._resolve_default_mapping(x);typeof A=="string"&&(A={start_date:A});var I=w[A.start_date]||new Date,M=w[A.end_date]||_.calculateEndDate({start_date:I,duration:1,task:w});_.form_blocks._fill_lightbox_select(T,0,I,C,S),_.form_blocks._fill_lightbox_select(T,C.size,M,C,S)},p.prototype.get_value=function(k,$,w){var x,S=k.getElementsByTagName("select"),T=w._time_format_order;return x=_.form_blocks.getTimePickerValue(S,w),typeof _._resolve_default_mapping(w)=="string"?x:{start_date:x,end_date:function(C,E,D){var A=_.form_blocks.getTimePickerValue(C,w,E.size);return A<=D&&(w.autofix_end!==!1||w.single_date)?_.date.add(D,_._get_timepicker_step(),"minute"):A}(S,T,x)}},p.prototype.focus=function(k){_._focus(k.getElementsByTagName("select")[0])},p}(t),a=Gt(t),r=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){const $=k.height?`height:${k.height}px;`:"";let w=`
`;if(k.options&&k.options.length)for(var x=0;x"+k.options[x].label+"";else k.single_value=!0,w+="";return w+="
",w},p.prototype.set_value=function(k,$,w,x){var S=Array.prototype.slice.call(k.querySelectorAll("input[type=checkbox]"));!k._dhx_onchange&&x.onchange&&(k.onchange=x.onchange,k._dhx_onchange=!0),x.single_value?S[0].checked=!!$:kt(S,function(T){T.checked=!!$&&$.indexOf(T.value)>=0})},p.prototype.get_value=function(k,$,w){return w.single_value?k.querySelector("input[type=checkbox]").checked:function(x,S){if(x.map)return x.map(S);for(var T=x.slice(),C=[],E=0;E`;if(k.options&&k.options.length)for(var x=0;x"+k.options[x].label+"";return w+="",w},p.prototype.set_value=function(k,$,w,x){var S;x.options&&x.options.length&&(S=k.querySelector("input[type=radio][value='"+$+"']")||k.querySelector("input[type=radio][value='"+x.default_value+"']"))&&(!k._dhx_onchange&&x.onchange&&(k.onchange=x.onchange,k._dhx_onchange=!0),S.checked=!0)},p.prototype.get_value=function(k,$){var w=k.querySelector("input[type=radio]:checked");return w?w.value:""},p.prototype.focus=function(k){_._focus(k.querySelector("input[type=radio]"))},p}(t),o=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(x){return x.formatter||new Et}function $(x,S){var T=x.getElementsByTagName("select"),C=S._time_format_order,E=0,D=0;if(_.defined(C[3])){var A=T[C[3]],I=parseInt(A.value,10);isNaN(I)&&A.hasAttribute("data-value")&&(I=parseInt(A.getAttribute("data-value"),10)),E=Math.floor(I/60),D=I%60}return new Date(T[C[2]].value,T[C[1]].value,T[C[0]].value,E,D)}function w(x,S){var T=x.getElementsByTagName("input")[1];return(T=k(S).parse(T.value))&&!window.isNaN(T)||(T=1),T<0&&(T*=-1),T}return B(p,m),p.prototype.render=function(x){var S="
"+_.form_blocks.getTimePicker.call(this,x)+"
",T=" "+_.locale.labels[_.config.duration_unit+"s"]+" ",C=x.single_date?" style='display:none'":"",E=x.readonly?" disabled='disabled'":"",D=_._waiAria.lightboxDurationInputAttrString(x),A="gantt_duration_value";x.formatter&&(T="",A+=" gantt_duration_value_formatted");var I="
"+T+"
";let M="gantt_section_time gantt_section_duration";return x.name!=="time"&&(M+=" gantt_section_"+x.name),"
"+S+" "+I+"
"},p.prototype.set_value=function(x,S,T,C){var E,D,A,I,M=x.getElementsByTagName("select"),L=x.getElementsByTagName("input"),P=L[1],H=[L[0],L[2]],U=x.getElementsByTagName("span")[0],ft=C._time_format_order;function O(){var J=$.call(_,x,C),j=w.call(_,x,C),q=_.calculateEndDate({start_date:J,duration:j,task:T}),Pt=_.templates.task_end_date||_.templates.task_date;U.innerHTML=Pt(q)}function Q(J){var j=P.value;j=k(C).parse(j),window.isNaN(j)&&(j=0),(j+=J)<1&&(j=1),P.value=k(C).format(j),O()}H[0].onclick=_.bind(function(){Q(-1*_.config.duration_step)},this),H[1].onclick=_.bind(function(){Q(1*_.config.duration_step)},this),M[0].onchange=O,M[1].onchange=O,M[2].onchange=O,M[3]&&(M[3].onchange=O),P.onkeydown=_.bind(function(J){var j;return(j=(J=J||window.event).charCode||J.keyCode||J.which)==_.constants.KEY_CODES.DOWN?(Q(-1*_.config.duration_step),!1):j==_.constants.KEY_CODES.UP?(Q(1*_.config.duration_step),!1):void window.setTimeout(O,1)},this),P.onchange=_.bind(O,this),typeof(E=_._resolve_default_mapping(C))=="string"&&(E={start_date:E}),D=T[E.start_date]||new Date,A=T[E.end_date]||_.calculateEndDate({start_date:D,duration:1,task:T}),I=Math.round(T[E.duration])||_.calculateDuration({start_date:D,end_date:A,task:T}),I=k(C).format(I),_.form_blocks._fill_lightbox_select(M,0,D,ft,C),P.value=I,O()},p.prototype.get_value=function(x,S,T){var C=$(x,T),E=w(x,T),D=_.calculateEndDate({start_date:C,duration:E,task:S});return typeof _._resolve_default_mapping(T)=="string"?C:{start_date:C,end_date:D,duration:E}},p.prototype.focus=function(x){_._focus(x.getElementsByTagName("select")[0])},p}(t),l=Ka(t),d=Gt(t),c=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(w){return!w||w===_.config.constraint_types.ASAP||w===_.config.constraint_types.ALAP}function $(w,x){for(var S=k(x),T=0;T`;var T=[];for(var C in _.config.constraint_types)T.push({key:_.config.constraint_types[C],label:_.locale.labels[_.config.constraint_types[C]]});return w.options=w.options||T,S+=""+xn.getHtmlSelect(w.options,[{key:"data-type",value:"constraint-type"}])+"",S+="",S+="",S},p.prototype.set_value=function(w,x,S,T){var C=w.querySelector("[data-constraint-type-select] select"),E=w.querySelectorAll("[data-constraint-time-select] select"),D=T._time_format_order,A=_._resolve_default_mapping(T);C._eventsInitialized||(C.addEventListener("change",function(L){$(E,L.target.value)}),C._eventsInitialized=!0);var I=S[A.constraint_date]||new Date;_.form_blocks._fill_lightbox_select(E,0,I,D,T);var M=S[A.constraint_type]||_.getConstraintType(S);C.value=M,$(E,M)},p.prototype.get_value=function(w,x,S){var T=w.querySelector("[data-constraint-type-select] select"),C=w.querySelectorAll("[data-constraint-time-select] select"),E=T.value,D=null;return k(E)||(D=_.form_blocks.getTimePickerValue(C,S)),{constraint_type:E,constraint_date:D}},p.prototype.focus=function(w){_._focus(w.querySelector("select"))},p}(t),u=function(_){const m=Gt(_);function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){var $=_.config.types,w=_.locale.labels,x=[],S=k.filter||function(E,D){return!$.placeholder||D!==$.placeholder};for(var T in $)!S(T,$[T])==0&&x.push({key:$[T],label:w["type_"+T]});k.options=x;var C=k.onchange;return k.onchange=function(){_._lightbox_current_type=this.value,_.changeLightboxType(this.value),typeof C=="function"&&C.apply(this,arguments)},m.prototype.render.apply(this,arguments)},p}(t),h=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(S){return S.formatter||new Et}function $(S,T,C,E){const D="
"+_.form_blocks.getTimePicker.call(_,E)+"
";let A=" "+_.locale.labels[_.config.duration_unit+"s"]+" ";const I=E.single_date?" style='display:none'":"",M=E.readonly?" disabled='disabled'":"",L=_._waiAria.lightboxDurationInputAttrString(E),P=_.locale.labels.baselines_remove_button;let H="gantt_duration_value";E.formatter&&(A="",H+=" gantt_duration_value_formatted");const U="
"+A+"
",ft=`
${P}
`,O=document.createElement("div");O.className="gantt_section_time gantt_section_duration",O.setAttribute("data-baseline-id",T.id),O.innerHTML=D+U+ft+"
",S.appendChild(O);var Q,J,j,q=O.getElementsByTagName("select"),Pt=O.getElementsByTagName("input"),Rt=Pt[1],Sn=[Pt[0],Pt[2]],Qa=O.getElementsByTagName("span")[0],tr=E._time_format_order;function pt(){var ut=w.call(_,O,E),G=x.call(_,O,E),er=_.calculateEndDate({start_date:ut,duration:G,task:C}),nr=_.templates.task_end_date||_.templates.task_date;Qa.innerHTML=nr(er)}function Xt(ut){var G=Rt.value;G=k(E).parse(G),window.isNaN(G)&&(G=0),(G+=ut)<1&&(G=1),Rt.value=k(E).format(G),pt()}O.querySelector(".baseline_delete_button").onclick=function(ut){const G=O.parentNode;O.innerHTML="",O.remove(),G.innerHTML===""&&(G.innerHTML=_.locale.labels.baselines_section_placeholder)},Sn[0].onclick=_.bind(function(){Xt(-1*_.config.duration_step)},_),Sn[1].onclick=_.bind(function(){Xt(1*_.config.duration_step)},_),q[0].onchange=pt,q[1].onchange=pt,q[2].onchange=pt,q[3]&&(q[3].onchange=pt),Rt.onkeydown=_.bind(function(ut){var G;return(G=(ut=ut||window.event).charCode||ut.keyCode||ut.which)==_.constants.KEY_CODES.DOWN?(Xt(-1*_.config.duration_step),!1):G==_.constants.KEY_CODES.UP?(Xt(1*_.config.duration_step),!1):void window.setTimeout(pt,1)},_),Rt.onchange=_.bind(pt,_),_._resolve_default_mapping(E),Q=T.start_date||new Date,J=T.end_date||_.calculateEndDate({start_date:Q,duration:1,task:C}),j=_.calculateDuration({start_date:Q,end_date:J,task:C}),j=k(E).format(j),_.form_blocks._fill_lightbox_select(q,0,Q,tr,E),Rt.value=j,pt()}function w(S,T){var C=S.getElementsByTagName("select"),E=T._time_format_order,D=0,A=0;if(_.defined(E[3])){var I=C[E[3]],M=parseInt(I.value,10);isNaN(M)&&I.hasAttribute("data-value")&&(M=parseInt(I.getAttribute("data-value"),10)),D=Math.floor(M/60),A=M%60}return new Date(C[E[2]].value,C[E[1]].value,C[E[0]].value,D,A)}function x(S,T){var C=S.getElementsByTagName("input")[1];return(C=k(T).parse(C.value))&&!window.isNaN(C)||(C=1),C<0&&(C*=-1),C}return B(p,m),p.prototype.render=function(S){return`
`},p.prototype.set_value=function(S,T,C,E){C.baselines?(S.innerHTML="",C.baselines.forEach(D=>{$(S,D,C,E)})):S.innerHTML=_.locale.labels.baselines_section_placeholder},p.prototype.get_value=function(S,T,C){const E=[];return S.querySelectorAll("[data-baseline-id]").forEach(D=>{const A=D.dataset.baselineId;let I,M=_.getDatastore("baselines").getItem(A);I=M?_.copy(M):{id:_.uid(),task_id:T.id,text:"Baseline 1"},I.start_date=w(D,C),I.duration=x(D,C),I.end_date=_.calculateEndDate({start_date:I.start_date,duration:I.duration,task:T}),E.push(I)}),E},p.prototype.button_click=function(S,T,C,E){if(_.callEvent("onSectionButton",[_._lightbox_id,C])!==!1&&(T.closest(".gantt_custom_button.gantt_remove_baselines")&&(E.innerHTML=_.locale.labels.baselines_section_placeholder),T.closest(".gantt_custom_button.gantt_add_baselines"))){E.innerHTML==_.locale.labels.baselines_section_placeholder&&(E.innerHTML="");const D=_.getTask(_._lightbox_id);$(E,{id:_.uid(),task_id:D.id,text:"Baseline 1",start_date:D.start_date,end_date:D.end_date},D,_._get_typed_lightbox_config()[S])}},p.prototype.focus=function(S){_._focus(S.getElementsByTagName("select")[0])},p}(t);t._lightbox_methods={},t._lightbox_template="
 
",t._lightbox_template=`
  +`,A.appendChild(L),S.appendChild(L)}}(r,b,_,d,c);var m=function(x,S,T){var C=document.createElement("div");return t.getTaskType(x.type)!=t.config.types.milestone?C.innerHTML=T.task_text(x.start_date,x.end_date,x):t.getTaskType(x.type)==t.config.types.milestone&&S&&(C.style.height=C.style.width=S+"px"),C.className="gantt_task_content",C}(r,_,c);b.appendChild(m);var p=function(x,S,T,C){var E=C.$getConfig(),D=[x];S&&D.push(S);var A=t.getState(),I=t.getTask(T);if(t.getTaskType(I.type)==E.types.milestone?D.push("gantt_milestone"):t.getTaskType(I.type)==E.types.project&&D.push("gantt_project"),D.push("gantt_bar_"+t.getTaskType(I.type)),t.isSummaryTask(I)&&D.push("gantt_dependent_task"),t.isSplitTask(I)&&(E.open_split_tasks&&!I.$open||!E.open_split_tasks)&&D.push("gantt_split_parent"),E.select_task&&t.isSelectedTask(T)&&D.push("gantt_selected"),T==A.drag_id&&(D.push("gantt_drag_"+A.drag_mode),A.touch_drag&&D.push("gantt_touch_"+A.drag_mode)),A.link_source_id==T&&(D.push("gantt_link_source"),A.link_from_start?D.push("gantt_link_from_start"):D.push("gantt_link_from_end")),A.link_target_id==T&&D.push("gantt_link_target"),E.highlight_critical_path&&t.isCriticalTask&&t.isCriticalTask(I)&&D.push("gantt_critical_task"),A.link_landing_area&&A.link_target_id&&A.link_source_id&&A.link_target_id!=A.link_source_id&&(A.link_target_id==T||A.link_source_id==T)){var M=A.link_source_id,L=A.link_from_start,P=A.link_to_start,H="";H=t.isLinkAllowed(M,T,L,P)?P?"link_start_allow":"link_finish_allow":P?"link_start_deny":"link_finish_deny",D.push(H)}return D.join(" ")}("gantt_task_line",c.task_class(r.start_date,r.end_date,r),r.id,s);(r.color||r.progressColor||r.textColor)&&(p+=" gantt_task_inline_color"),l.width<20&&(p+=" gantt_thin_task"),b.className=p;var k=["left:"+l.left+"px","top:"+(f+l.top)+"px","height:"+h+"px","line-height:"+Math.max(h<30?h-2:h,0)+"px","width:"+_+"px"];b.style.cssText=k.join(";"),r.color&&b.style.setProperty("--dhx-gantt-task-background",r.color),r.textColor&&b.style.setProperty("--dhx-gantt-task-color",r.textColor),r.progressColor&&b.style.setProperty("--dhx-gantt-task-progress-color",r.progressColor);var $=function(x,S,T,C){var E="gantt_left "+i(!S.rtl,x),D=null;return C&&(D={type:"marginRight",value:C}),n(x,T.leftside_text,E,D)}(r,d,c,g);$&&b.appendChild($),$=function(x,S,T,C){var E="gantt_right "+i(!!S.rtl,x),D=null;return C&&(D={type:"marginLeft",value:C}),n(x,T.rightside_text,E,D)}(r,d,c,g),$&&b.appendChild($),t._waiAria.setTaskBarAttr(r,b);var w=t.getState();return t.isReadonly(r)||(d.drag_resize&&!t.isSummaryTask(r)&&u!=d.types.milestone&&a(b,"gantt_task_drag",r,function(x){var S=document.createElement("div");return S.className=x,S},d),d.drag_links&&d.show_links&&a(b,"gantt_link_control",r,function(x){var S=document.createElement("div");S.className=x,S.style.cssText=["height:"+h+"px","line-height:"+h+"px"].join(";");var T=document.createElement("div");T.className="gantt_link_point";var C=!1;return w.link_source_id&&d.touch&&(C=!0),T.style.display=C?"block":"",S.appendChild(T),S},d,g)),b}function n(r,s,o,l){if(!s)return null;var d=s(r.start_date,r.end_date,r);if(!d)return null;var c=document.createElement("div");return c.className="gantt_side_content "+o,c.innerHTML=d,l&&(c.style[l.type]=Math.abs(l.value)+"px"),c}function i(r,s){var o=r?{$source:[t.config.links.start_to_start],$target:[t.config.links.start_to_start,t.config.links.finish_to_start]}:{$source:[t.config.links.finish_to_start,t.config.links.finish_to_finish],$target:[t.config.links.finish_to_finish]};for(var l in o)for(var d=s[l],c=0;c=+h.min_date&&((u=l([s,d.rtl?"task_right":"task_left","task_start_date"].join(" "))).setAttribute("data-bind-property","start_date"),c&&(u.style.marginLeft=c+"px"),r.appendChild(u)),+o.end_date<=+h.max_date&&((u=l([s,d.rtl?"task_left":"task_right","task_end_date"].join(" "))).setAttribute("data-bind-property","end_date"),c&&(u.style.marginRight=c+"px"),r.appendChild(u))}return function(r,s,o){var l=(o=s.$getConfig()).type_renderers[t.getTaskType(r.type)],d=e;return l?l.call(t,r,function(c){return d.call(t,c,s,o)},s):d.call(t,r,s,o)}}function fn(t){return{render:gn(t),update:null,isInViewPort:ke,getVisibleRange:gt}}function Mt(){return console.error("You are trying to use a Pro feature that is not available in the GPL version."),{render:function(){},isInViewPort:function(){},getVisibleRange:function(){}}}function pn(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}function Ut(t,e){var n=0,i=t.left.length-1;if(e)for(var a=0;ae.x_end){i=a;break}}return{start:n,end:i}}function ye(t,e,n,i){var a=e.width[t];if(a<=0)return!1;if(!i.config.smart_rendering||At(i))return!0;var r=e.left[t]-a,s=e.left[t]+a;return r<=n.x_end&&s>=n.x}function Aa(t,e){var n=e.config.timeline_placeholder;if(t=t||[],n&&t.filter(l=>l.id==="timeline_placeholder_task").length===0){var i=e.getState(),a=null,r=i.min_date,s=i.max_date;t.length&&(a=t[t.length-1].id);var o={start_date:r,end_date:s,row_height:n.height||0,id:"timeline_placeholder_task",unscheduled:!0,lastTaskId:a,calendar_id:n.calendar||"global",$source:[],$target:[]};t.push(o)}}function Ia(t){var e={current_pos:null,dirs:{left:"left",right:"right",up:"up",down:"down"},path:[],clear:function(){this.current_pos=null,this.path=[]},point:function(a){this.current_pos=t.copy(a)},get_lines:function(a){this.clear(),this.point(a[0]);for(var r=1;ra.x?this.dirs.right:r.y>a.y?this.dirs.down:this.dirs.up}},n={path:[],clear:function(){this.path=[]},current:function(){return this.path[this.path.length-1]},point:function(a){return a?(this.path.push(t.copy(a)),a):this.current()},point_to:function(a,r,s){s=s?{x:s.x,y:s.y}:t.copy(this.point());var o=e.dirs;switch(a){case o.left:s.x-=r;break;case o.right:s.x+=r;break;case o.up:s.y-=r;break;case o.down:s.y+=r}return this.point(s)},get_points:function(a,r,s,o){var l=this.get_endpoint(a,r,s,o),d=t.config,c=l.e_y-l.y,u=l.e_x-l.x,h=e.dirs,g=r.getItemHeight(a.source);this.clear(),this.point({x:l.x,y:l.y});var f=2*d.link_arrow_size,y=this.get_line_type(a,r.$getConfig()),v=l.e_x>l.x;if(y.from_start&&y.to_start)this.point_to(h.left,f),v?(this.point_to(h.down,c),this.point_to(h.right,u)):(this.point_to(h.right,u),this.point_to(h.down,c)),this.point_to(h.right,f);else if(!y.from_start&&y.to_start)if(c!==0&&(v=l.e_x>l.x+2*f),this.point_to(h.right,f),v)u-=f,this.point_to(h.down,c),this.point_to(h.right,u);else{u-=2*f;var b=c>0?1:-1;this.point_to(h.down,b*(g/2)),this.point_to(h.right,u),this.point_to(h.down,b*(Math.abs(c)-g/2)),this.point_to(h.right,f)}else y.from_start||y.to_start?y.from_start&&!y.to_start&&(c!==0&&(v=l.e_x>l.x-2*f),this.point_to(h.left,f),v?(u+=2*f,b=c>0?1:-1,this.point_to(h.down,b*(g/2)),this.point_to(h.right,u),this.point_to(h.down,b*(Math.abs(c)-g/2)),this.point_to(h.left,f)):(u+=f,this.point_to(h.down,c),this.point_to(h.right,u))):(this.point_to(h.right,f),v?(this.point_to(h.right,u),this.point_to(h.down,c)):(this.point_to(h.down,c),this.point_to(h.right,u)),this.point_to(h.left,f));return this.path},get_line_type:function(a,r){var s=r.links,o=!1,l=!1;return a.type==s.start_to_start?o=l=!0:a.type==s.finish_to_finish?o=l=!1:a.type==s.finish_to_start?(o=!1,l=!0):a.type==s.start_to_finish?(o=!0,l=!1):t.assert(!1,"Invalid link type"),r.rtl&&(o=!o,l=!l),{from_start:o,to_start:l}},get_endpoint:function(a,r,s,o){var l=r.$getConfig(),d=this.get_line_type(a,l),c=d.from_start,u=d.to_start,h=i(s,r,l),g=i(o,r,l);return{x:c?h.left:h.left+h.width,e_x:u?g.left:g.left+g.width,y:h.top+h.rowHeight/2-1,e_y:g.top+g.rowHeight/2-1}}};function i(a,r,s){var o=r.getItemPosition(a);let l=_i(t,r,a),d=l.maxHeight,c=l.splitChild;const u=t.config.baselines!==!1&&(t.config.baselines.render_mode=="separateRow"||t.config.baselines.render_mode=="individualRow")&&a.baselines&&a.baselines.length;let h;l.shrinkHeight&&(o.rowHeight=d);let g=t.getTaskType(a.type)==s.types.milestone;if(g){let f=r.getBarHeight(a.id,!0);h=Math.sqrt(2*f*f),l.shrinkHeight&&d=o.height){const f=hi(t,a.parent);u||f?g?(o.rowHeight=o.height+4,o.left+=(o.width-o.rowHeight+4)/2,o.width=o.rowHeight-3):o.rowHeight=o.height+6:g&&(o.left+=(h-o.height)/2)}else o.rowHeight=d+2,g&&(o.left+=(o.width-o.rowHeight+4)/2,o.width=o.rowHeight-3);else u&&(o.rowHeight=o.height+4);return o}return{render:function(a,r,s){var o=t.getTask(a.source);if(o.hide_bar)return;var l=t.getTask(a.target);if(l.hide_bar)return;var d=n.get_endpoint(a,r,o,l),c=d.e_y-d.y;if(!(d.e_x-d.x)&&!c)return null;var u=n.get_points(a,r,o,l);const h=function(v,b){const _=b.link_radius||4,m=b.link_arrow_size||6,p=[];for(let $=0;$v.size>0),s),g=function(v,b,_,m){const p=document.createElement("div");return v.forEach(k=>{let $;k.type==="line"?$=e.render_line(k.data,null,b,_.source):k.type==="corner"?$=e.render_corner(k.data,b):k.type==="arrow"&&($=e.render_arrow(k.data,m)),p.appendChild($)}),p}(h,r,a,s);var f="gantt_task_link";a.color&&(f+=" gantt_link_inline_color");var y=t.templates.link_class?t.templates.link_class(a):"";return y&&(f+=" "+y),s.highlight_critical_path&&t.isCriticalLink&&t.isCriticalLink(a)&&(f+=" gantt_critical_link"),g.className=f,r.$config.link_attribute&&(g.setAttribute(r.$config.link_attribute,a.id),g.setAttribute("link_id",a.id)),a.color&&g.style.setProperty("--dhx-gantt-link-background",a.color),t._waiAria.linkAttr(a,g),g},update:null,isInViewPort:cn,getVisibleRange:dn()}}function Ma(t,e,n,i,a){if(a.$ui.getView("grid")&&(a.config.keyboard_navigation&&a.getSelectedId()||a.ext.inlineEditors&&a.ext.inlineEditors.getState().id))return!0;var r=n.getItemTop(t.id),s=n.getItemHeight(t.id);return!(r>e.y_end||r+sl.y+h-u&&(c=l.y+h-u);const g=l.y+l.height;return c>g-u&&(c=g-u),l.x=d,l.y=c,l},t),i._getTargetY=t.bind(function(o){var l=z(e.$grid_data),d=e.$state.scrollTop||0,c=t.$grid_data.getBoundingClientRect().height+d,u=o.pageY-l.y+d;return u>c?u=c:ud.countVisible()-1?null:d.getIdByIndex(c)},t),i.attachEvent("onDragMove",t.bind(function(o,l){var d=t.$grid_data.getBoundingClientRect(),c=d.height+d.y+(e.$state.scrollTop||0)+window.scrollY,u=i.config,h=i._getGridPos(l);t._waiAria.reorderMarkerAttr(u.marker);var g=e.$getConfig(),f=r();h.yy.width&&(u.marker.style.width=y.width-10-2+"px",u.marker.style.overflow="hidden");var v=f.getItem(i.config.id),b=i._getTargetY(l),_=i._getTaskByY(b,f.getIndexById(v.id));function m(D,A){return!f.isChildOf(p.id,A.id)&&(D.$level==A.$level||g.order_branch_free)}if(f.exists(_)||(_=i.lastTaskOfLevel(g.order_branch_free?v.$level:0))==i.config.id&&(_=null),f.exists(_)){var p=f.getItem(_),k=e.getItemTop(p.id),$=e.getItemHeight(p.id);if(k+$/2=0;)T=f.getIdByIndex(w-E),C=f.getItem(T),E++;if(v.id==p.id||s(p.id))return;m(p,v)&&v.id!=p.id?f.move(v.id,0,0,p.id):p.$level!=v.$level-1||f.getChildren(p.id).length?C&&m(C,v)&&v.id!=C.id&&f.move(v.id,-1,f.getParent(C.id)):f.move(v.id,0,p.id)}return!0},t)),i.attachEvent("onDragEnd",t.bind(function(){var o=r(),l=o.getItem(i.config.id);l.$transparent=!1,l.$open=i.config.initial_open_state,this.callEvent("onBeforeRowDragEnd",[i.config.id,i.config.parent,i.config.index])===!1?(o.move(i.config.id,i.config.index,i.config.parent),l.$drop_target=null):this.callEvent("onRowDragEnd",[i.config.id,l.$drop_target]),t.render(),this.refreshData()},t))}function a(o){return tt(o,e.$config.item_attribute)}function r(){return t.getDatastore(e.$config.bind)}function s(o){return Ct(o,t,r())}}},Z={createDropTargetObject:function(t){var e={targetParent:null,targetIndex:0,targetId:null,child:!1,nextSibling:!1,prevSibling:!1};return t&&N(e,t,!0),e},nextSiblingTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.nextSibling=!0,i.targetParent=n.getParent(i.targetId),i.targetIndex=n.getBranchIndex(i.targetId),(n.getParent(t)!=i.targetParent||i.targetIndexn.getBranchIndex(t)&&(i.targetIndex-=1),i},firstChildTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.targetParent=i.targetId,i.targetIndex=0,i.child=!0,i},lastChildTarget:function(t,e,n){var i=n.getChildren(e),a=this.createDropTargetObject();return a.targetId=i[i.length-1],a.targetParent=e,a.targetIndex=i.length,a.nextSibling=!0,a}};function mn(t,e,n,i,a){for(var r=e;i.exists(r);){var s=i.calculateItemLevel(i.getItem(r));if((s===n||s===n-1)&&i.getBranchIndex(r)>-1)break;r=a?i.getPrev(r):i.getNext(r)}return i.exists(r)?i.calculateItemLevel(i.getItem(r))===n?a?Z.nextSiblingTarget(t,r,i):Z.prevSiblingTarget(t,r,i):Z.firstChildTarget(t,r,i):null}function be(t,e,n,i){return mn(t,e,n,i,!0)}function vn(t,e,n,i){return mn(t,e,n,i,!1)}function kn(t,e,n,i,a,r){var s;if(e!==a.$getRootId()){var o=a.getItem(e),l=a.calculateItemLevel(o);if(l===r){var d=a.getPrevSibling(e);n<.5&&!d?s=Z.prevSiblingTarget(t,e,a):(n<.5&&(e=d),s=Z.nextSiblingTarget(t,e,a))}else if(l>r)a.eachParent(function(f){a.calculateItemLevel(f)===r&&(e=f.id)},o),s=be(t,e,r,a);else{var c=be(t,e,r,a),u=vn(t,e,r,a);s=n<.5?c:u}}else{var h=a.$getRootId(),g=a.getChildren(h);s=Z.createDropTargetObject(),s=g.length&&i>=0?be(t,function(f){for(var y=f.getNext();f.exists(y);){var v=f.getNext(y);if(!f.exists(v))return y;y=v}return null}(a),r,a):vn(t,h,r,a)}return s}function yn(t,e){var n=z(e.$grid_data);return t.x+=n.x+e.$grid.scrollLeft,t.y+=n.y-e.$grid_data.scrollTop,t}function xe(t,e,n=0){const i=z(t.$root);return e>i.width&&(e=i.width-n-2),e}const bn={removeLineHighlight:function(t){t.markerLine&&t.markerLine.parentNode&&t.markerLine.parentNode.removeChild(t.markerLine),t.markerLine=null},highlightPosition:function(t,e,n){var i=function(r,s){var o=z(s.$grid_data),l=nt(r,s.$grid_data),d=o.x+s.$grid.scrollLeft,c=l.y-10,u=s.getItemHeight(r.targetId);co.y+h-u&&(c=o.y+h-u),o.x=d,o.y=c,o.width=xe(s.$gantt,o.width,9),o}(t,n);e.marker.style.left=i.x+9+"px",e.marker.style.width=i.width+"px",e.marker.style.overflow="hidden";var a=e.markerLine;a||((a=document.createElement("div")).className="gantt_drag_marker gantt_grid_dnd_marker",a.innerHTML="
",a.style.pointerEvents="none"),t.child?function(r,s,o){var l=r.targetParent,d=yn({x:0,y:o.getItemTop(l)},o),c=o.$grid_data.getBoundingClientRect().bottom+window.scrollY;let u=xe(o.$gantt,o.$grid_data.offsetWidth);s.innerHTML="
",s.style.width=u+"px",s.style.top=d.y+"px",s.style.left=d.x+"px",s.style.height=o.getItemHeight(l)+"px",d.y>c&&(s.style.top=c+"px")}(t,a,n):function(r,s,o){var l=function(u,h){var g=h.$config.rowStore,f={x:0,y:0},y=h.$grid_data.querySelector(".gantt_tree_indent"),v=15,b=0;y&&(v=y.offsetWidth);var _=40;if(u.targetId!==g.$getRootId()){var m=h.getItemTop(u.targetId),p=h.getItemHeight(u.targetId);if(b=g.exists(u.targetId)?g.calculateItemLevel(g.getItem(u.targetId)):0,u.prevSibling)f.y=m;else if(u.nextSibling){var k=0;g.eachItem(function($){g.getIndexById($.id)!==-1&&k++},u.targetId),f.y=m+p+k*p}else f.y=m+p,b+=1}return f.x=_+b*v,f.width=xe(h.$gantt,Math.max(h.$grid_data.offsetWidth-f.x,0),f.x),yn(f,h)}(r,o),d=o.$grid_data.getBoundingClientRect().bottom+window.scrollY;s.innerHTML="
",s.style.left=l.x+"px",s.style.height="4px";var c=l.y-2;s.style.top=c+"px",s.style.width=l.width+"px",c>d&&(s.style.top=d+"px")}(t,a,n),e.markerLine||(document.body.appendChild(a),e.markerLine=a)}},Pa={init:function(t,e){var n=t.$services.getService("dnd");if(e.$config.bind&&t.getDatastore(e.$config.bind)){var i=new n(e.$grid_data,{updates_per_second:60});t.defined(e.$getConfig().dnd_sensitivity)&&(i.config.sensitivity=e.$getConfig().dnd_sensitivity),i.attachEvent("onBeforeDragStart",t.bind(function(o,l){var d=a(l);if(!d||(t.hideQuickInfo&&t.hideQuickInfo(),lt(l.target,".gantt_grid_editor_placeholder")))return!1;var c=d.getAttribute(e.$config.item_attribute),u=e.$config.rowStore.getItem(c);return!t.isReadonly(u)&&!r(c)&&(i.config.initial_open_state=u.$open,!!t.callEvent("onRowDragStart",[c,l.target||l.srcElement,l])&&void 0)},t)),i.attachEvent("onAfterDragStart",t.bind(function(o,l){var d=a(l);i.config.marker.innerHTML=d.outerHTML;var c=i.config.marker.firstChild;c&&(i.config.marker.style.opacity=.4,c.style.position="static",c.style.pointerEvents="none"),i.config.id=d.getAttribute(e.$config.item_attribute);var u=e.$config.rowStore,h=u.getItem(i.config.id);i.config.level=u.calculateItemLevel(h),i.config.drop_target=Z.createDropTargetObject({targetParent:u.getParent(h.id),targetIndex:u.getBranchIndex(h.id),targetId:h.id,nextSibling:!0}),h.$open=!1,h.$transparent=!0,this.refreshData()},t)),i.attachEvent("onDragMove",t.bind(function(o,l){var d=s(l);return d&&t.callEvent("onBeforeRowDragMove",[i.config.id,d.targetParent,d.targetIndex])!==!1||(d=Z.createDropTargetObject(i.config.drop_target)),bn.highlightPosition(d,i.config,e),i.config.drop_target=d,t._waiAria.reorderMarkerAttr(i.config.marker),this.callEvent("onRowDragMove",[i.config.id,d.targetParent,d.targetIndex]),!0},t)),i.attachEvent("onDragEnd",t.bind(function(){var o=e.$config.rowStore,l=o.getItem(i.config.id);bn.removeLineHighlight(i.config),l.$transparent=!1,l.$open=i.config.initial_open_state;var d=i.config.drop_target;this.callEvent("onBeforeRowDragEnd",[i.config.id,d.targetParent,d.targetIndex])===!1?l.$drop_target=null:(o.move(i.config.id,d.targetIndex,d.targetParent),t.render(),this.callEvent("onRowDragEnd",[i.config.id,d.targetParent,d.targetIndex])),o.refresh(l.id)},t))}function a(o){return tt(o,e.$config.item_attribute)}function r(o){return Ct(o,t,t.getDatastore(e.$config.bind))}function s(o){var l,d=function(f){var y=nt(f,e.$grid_data).y,v=e.$config.rowStore;document.doctype||(y+=window.scrollY),y=y||0;var b=e.$state.scrollTop||0,_=t.$grid_data.getBoundingClientRect().height+b+window.scrollY,m=b,p=e.getItemIndexByTopPosition(e.$state.scrollTop);if(v.exists(p)||(p=v.countVisible()-1),p<0)return v.$getRootId();var k=v.getIdByIndex(p),$=e.$state.scrollTop/e.getItemHeight(k),w=$-Math.floor($);w>.1&&w<.9&&(_-=e.getItemHeight(k)*w,m+=e.getItemHeight(k)*(1-w));const x=z(e.$grid_data),S=x.y+x.height,T=i.config.marker.offsetHeight;y+T+window.scrollY>=_&&(i.config.marker.style.top=S-T+"px"),y>=_?y=_:y<=m&&(y=m,i.config.marker.style.top=x.y+"px");var C=e.getItemIndexByTopPosition(y);if(C>v.countVisible()-1||C<0)return v.$getRootId();var E=v.getIdByIndex(C);return r(E)?v.getPrevSibling(E):v.getIdByIndex(C)}(o),c=null,u=e.$config.rowStore,h=!e.$getConfig().order_branch_free,g=nt(o,e.$grid_data).y;return document.doctype||(g+=window.scrollY),d!==u.$getRootId()&&(c=(g-e.getItemTop(d))/e.getItemHeight(d)),h?(l=kn(i.config.id,d,c,g,u,i.config.level))&&l.targetParent&&r(l.targetParent)&&(d=u.getPrevSibling(l.targetParent),l=kn(i.config.id,d,c,g,u,i.config.level)):l=function(f,y,v,b,_){var m;if(y!==_.$getRootId())m=v<.25?Z.prevSiblingTarget(f,y,_):!(v>.6)||_.hasChild(y)&&_.getItem(y).$open?Z.firstChildTarget(f,y,_):Z.nextSiblingTarget(f,y,_);else{var p=_.$getRootId();m=_.hasChild(p)&&b>=0?Z.lastChildTarget(f,p,_):Z.firstChildTarget(f,p,_)}return m}(i.config.id,d,c,g,u),l}}};var Ra=function(t){return{onCreated:function(e){e.$config=N(e.$config,{bind:"task"}),e.$config.id=="grid"&&(this.extendGantt(e),t.ext.inlineEditors=t.ext._inlineEditors.createEditors(e),t.ext.inlineEditors.init()),this._mouseDelegates=me(t)},onInitialized:function(e){var n=e.$getConfig();n.order_branch&&(n.order_branch=="marker"?Pa.init(e.$gantt,e):La.init(e.$gantt,e)),this.initEvents(e,t),e.$config.id=="grid"&&this.extendDom(e)},onDestroyed:function(e){e.$config.id=="grid"&&t.ext.inlineEditors.destructor(),this.clearEvents(e,t)},initEvents:function(e,n){this._mouseDelegates.delegate("click","gantt_row",n.bind(function(i,a,r){var s=e.$getConfig();if(a!==null){var o=this.getTask(a);s.scroll_on_click&&!n._is_icon_open_click(i)&&this.showDate(o.start_date),n.callEvent("onTaskRowClick",[a,r])}},n),e.$grid),this._mouseDelegates.delegate("click","gantt_grid_head_cell",n.bind(function(i,a,r){var s=r.getAttribute("data-column-id");if(n.callEvent("onGridHeaderClick",[s,i])){var o=e.$getConfig();if(s!="add"){if(o.sort&&s){for(var l,d=s,c=0;cf){var y=f-h.end;(yl||l===void 0)&&(l=v)}}return l},_move:function(s,o,l,d){var c=this._drag_task_coords(s,l),u=null,h=null;d?(u=new Date(+l.obj.start_date+d),h=new Date(+l.obj.end_date+d)):(u=a.dateFromPos(c.start+o),h=a.dateFromPos(c.end+o)),u?h?(s.start_date=u,s.end_date=h):(s.end_date=new Date(a.getState().max_date),s.start_date=a.dateFromPos(a.posFromDate(s.end_date)-(c.end-c.start))):(s.start_date=new Date(a.getState().min_date),s.end_date=a.dateFromPos(a.posFromDate(s.start_date)+(c.end-c.start)))},_drag_task_coords:function(s,o){return{start:o.obj_s_x=o.obj_s_x||a.posFromDate(s.start_date),end:o.obj_e_x=o.obj_e_x||a.posFromDate(s.end_date)}},_mouse_position_change:function(s,o){var l=s.x-o.x,d=s.y-o.y;return Math.sqrt(l*l+d*d)},_is_number:function(s){return!isNaN(parseFloat(s))&&isFinite(s)},on_mouse_move:function(s){if(this.drag.start_drag){var o=nt(s,a.$task_data),l=this.drag.start_drag.start_x,d=this.drag.start_drag.start_y;(Date.now()-this.drag.timestamp>50||this._is_number(l)&&this._is_number(d)&&this._mouse_position_change({x:l,y:d},o)>20)&&this._start_dnd(s)}if(this.drag.mode){if(!Ue(this,40))return;this._update_on_move(s)}},_update_item_on_move:function(s,o,l,d,c,u){var h=a.getTask(o),g=a.mixin({},h),f=a.mixin({},h);this._handlers[l].apply(this,[f,s,d,u]),a.mixin(h,f,!0),a.callEvent("onTaskDrag",[h.id,l,f,g,c]),a.mixin(h,f,!0),a.refreshTask(o)},_update_on_move:function(s){var o=this.drag,l=i.$getConfig();if(o.mode){var d=nt(s,i.$task_data);if(o.pos&&o.pos.x==d.x)return;o.pos=d;var c=a.dateFromPos(d.x);if(!c||isNaN(c.getTime()))return;var u=d.x-o.start_x,h=a.getTask(o.id);if(this._handlers[o.mode]){if(o.mode===l.drag_mode.move){var g={};this._isMultiselect()&&a.getSelectedTasks().indexOf(o.id)>=0&&(g=this.dragMultiple);var f=!1;if(a.isSummaryTask(h)&&a.config.drag_project){var y={};y[o.id]=V(o),f=!0,g=N(y,this.dragMultiple)}var v=this._find_max_shift(g,u);for(var b in v!==void 0&&(u=v),this._update_item_on_move(u,o.id,o.mode,o,s),g){var _=g[b];if(f&&_.id!=o.id&&(a._bulk_dnd=!0),v===void 0&&(f||Object.keys(g).length>1))var m=c-a.dateFromPos(o.start_x);this._update_item_on_move(u,_.id,_.mode,_,s,m)}a._bulk_dnd=!1}else this._update_item_on_move(u,o.id,o.mode,o,s);a._update_parents(o.id)}}},on_mouse_down:function(s,o){if(s.button!=2||s.button===void 0){var l=i.$getConfig(),d=a.locate(s),c=null;if(a.isTaskExists(d)&&(c=a.getTask(d)),!a.isReadonly(c)&&!this.drag.mode){this.clear_drag_state();var u=K(o=o||s.target||s.srcElement),h=this._get_drag_mode(u,o);if(!u||!h)return o.parentNode?this.on_mouse_down(s,o.parentNode):void 0;if(h)if(h.mode&&h.mode!=l.drag_mode.ignore&&l["drag_"+h.mode]){if(d=a.locate(o),c=a.copy(a.getTask(d)||{}),a.isReadonly(c))return this.clear_drag_state(),!1;if(a.isSummaryTask(c)&&c.auto_scheduling!==!1&&!l.drag_project&&h.mode!=l.drag_mode.progress)return void this.clear_drag_state();h.id=d;var g=nt(s,a.$task_data);h.start_x=g.x,h.start_y=g.y,h.obj=c,this.drag.start_drag=h,this.drag.timestamp=Date.now()}else this.clear_drag_state();else if(a.checkEvent("onMouseDown")&&a.callEvent("onMouseDown",[u.split(" ")[0]])&&o.parentNode)return this.on_mouse_down(s,o.parentNode)}}},_fix_dnd_scale_time:function(s,o){var l=i.$getConfig(),d=a.getScale().unit,c=a.getScale().step;function u(h){if(a.config.correct_work_time){var g=i.$getConfig();a.isWorkTime(h.start_date,void 0,h)||(h.start_date=a.calculateEndDate({start_date:h.start_date,duration:-1,unit:g.duration_unit,task:h}))}}l.round_dnd_dates||(d="minute",c=l.time_step),o.mode==l.drag_mode.resize?o.left?(s.start_date=a.roundDate({date:s.start_date,unit:d,step:c}),u(s)):(s.end_date=a.roundDate({date:s.end_date,unit:d,step:c}),function(h){if(a.config.correct_work_time){var g=i.$getConfig();a.isWorkTime(new Date(h.end_date-1),void 0,h)||(h.end_date=a.calculateEndDate({start_date:h.end_date,duration:1,unit:g.duration_unit,task:h}))}}(s)):o.mode==l.drag_mode.move&&(s.start_date=a.roundDate({date:s.start_date,unit:d,step:c}),u(s),s.end_date=a.calculateEndDate(s))},_fix_working_times:function(s,o){var l=i.$getConfig();(o=o||{mode:l.drag_mode.move}).mode==l.drag_mode.resize?o.left?s.start_date=a.getClosestWorkTime({date:s.start_date,dir:"future",task:s}):s.end_date=a.getClosestWorkTime({date:s.end_date,dir:"past",task:s}):o.mode==l.drag_mode.move&&a.correctTaskWorkTime(s)},_finalize_mouse_up:function(s,o,l,d){var c=a.getTask(s);if(o.work_time&&o.correct_work_time&&this._fix_working_times(c,l),this._fix_dnd_scale_time(c,l),this._fireEvent("before_finish",l.mode,[s,l.mode,a.copy(l.obj),d])){var u=s;a._init_task_timing(c),this.clear_drag_state(),a.updateTask(c.id),this._fireEvent("after_finish",l.mode,[u,l.mode,d])}else this.clear_drag_state(),s==l.id&&(l.obj._dhx_changed=!1,a.mixin(c,l.obj,!0)),a.refreshTask(c.id)},on_mouse_up:function(s){var o=this.drag;if(o.mode&&o.id){var l=i.$getConfig(),d=a.getTask(o.id),c=this.dragMultiple,u=!1,h=0;o.mode===l.drag_mode.move&&(a.isSummaryTask(d)&&l.drag_project||this._isMultiselect())&&(u=!0,h=Object.keys(c).length);var g=function(){if(u)for(var f in c)c[f].id!=o.id&&this._finalize_mouse_up(c[f].id,l,c[f],s);this._finalize_mouse_up(o.id,l,o,s)};u&&h>10?a.batchUpdate((function(){g.call(this)}).bind(this)):g.call(this)}this.clear_drag_state()},_get_drag_mode:function(s,o){var l=i.$getConfig().drag_mode,d={mode:null,left:null};switch((s||"").split(" ")[0]){case"gantt_task_line":case"gantt_task_content":d.mode=l.move;break;case"gantt_task_drag":d.mode=l.resize;var c=o.getAttribute("data-bind-property");d.left=c=="start_date";break;case"gantt_task_progress_drag":d.mode=l.progress;break;case"gantt_link_control":case"gantt_link_point":d.mode=l.ignore;break;default:d=null}return d},_start_dnd:function(s){var o=this.drag=this.drag.start_drag;delete o.start_drag;var l=i.$getConfig(),d=o.id;if(l["drag_"+o.mode]&&a.callEvent("onBeforeDrag",[d,o.mode,s])&&this._fireEvent("before_start",o.mode,[d,o.mode,s])){delete o.start_drag;var c=a.getTask(d);if(a.isReadonly(c))return void this.clear_drag_state();if(this._isMultiselect()){var u=a.getSelectedTasks();u.indexOf(o.id)>=0&&kt(u,a.bind(function(h){var g=a.getTask(h);a.isSummaryTask(g)&&a.config.drag_project&&o.mode==l.drag_mode.move&&this._addSubtasksToDragMultiple(g.id),this.dragMultiple[h]=a.mixin({id:g.id,obj:a.copy(g)},this.drag)},this))}a.isSummaryTask(c)&&a.config.drag_project&&o.mode==l.drag_mode.move&&this._addSubtasksToDragMultiple(c.id),a.callEvent("onTaskDragStart",[])}else this.clear_drag_state()},_fireEvent:function(s,o,l){a.assert(this._events[s],"Invalid stage:{"+s+"}");var d=this._events[s][o];return a.assert(d,"Unknown after drop mode:{"+o+"}"),a.assert(l,"Invalid event arguments"),!a.checkEvent(d)||a.callEvent(d,l)},round_task_dates:function(s){var o=this.drag,l=i.$getConfig();o||(o={mode:l.drag_mode.move}),this._fix_dnd_scale_time(s,o)},destructor:function(){this._domEvents.detachAll()},_isMultiselect:function(){return a.config.drag_multiple&&!!(a.getSelectedTasks&&a.getSelectedTasks().length>0)},_addSubtasksToDragMultiple:function(s){a.eachTask(function(o){this.dragMultiple[o.id]=a.mixin({id:o.id,obj:a.copy(o)},this.drag)},s,this)}}}(e,n),e._tasks_dnd=t,t.init(n)},destructor:function(){t&&(t.destructor(),t=null)}}}};var Oa=function(t,e){var n,i,a,r,s;function o(){return{link_source_id:r,link_target_id:i,link_from_start:s,link_to_start:a,link_landing_area:n}}var l=e.$services,d=l.getService("state"),c=l.getService("dnd");d.registerProvider("linksDnD",o);var u="gantt_link_point",h="gantt_link_control",g=new c(t.$task_bars,{sensitivity:0,updates_per_second:60,mousemoveContainer:e.$root,selector:"."+u,preventDefault:!0});function f(m,p){var k,$=g.getPosition(m),w=function(A){var I=0,M=0;return A&&(I=A.offsetWidth||0,M=A.offsetHeight||0),{width:I,height:M}}(p),x={right:(k=e.$root).offsetWidth,bottom:k.offsetHeight},S=e.config.tooltip_offset_x||10,T=e.config.tooltip_offset_y||10,C=e.config.scroll_size||18,E=e.$container.getBoundingClientRect().y+window.scrollY,D={y:$.y+T,x:$.x+S,bottom:$.y+w.height+T+C,right:$.x+w.width+S+C};return D.bottom>x.bottom+E&&(D.y=x.bottom+E-w.height-T),D.right>x.right&&(D.x=x.right-w.width-S),D}function y(m){var p=o();p.link_source_id&&p.link_target_id&&e.isLinkAllowed(p.link_source_id,p.link_target_id,p.link_from_start,p.link_to_start);var k="";m.innerHTML=k}function v(){r=s=i=null,a=!0}function b(m,p,k,$){var w=function(){return g._direction&&g._direction.parentNode||(g._direction=document.createElement("div"),t.$task_links.appendChild(g._direction)),g._direction}(),x=o(),S=["gantt_link_direction"];e.templates.link_direction_class&&S.push(e.templates.link_direction_class(x.link_source_id,x.link_from_start,x.link_target_id,x.link_to_start));var T=Math.sqrt(Math.pow(k-m,2)+Math.pow($-p,2));if(T=Math.max(0,T-3)){w.className=S.join(" ");var C=($-p)/(k-m),E=Math.atan(C);_(m,k,p,$)==2?E+=Math.PI:_(m,k,p,$)==3&&(E-=Math.PI);var D=Math.sin(E),A=Math.cos(E),I=Math.round(p),M=Math.round(m),L=["-webkit-transform: rotate("+E+"rad)","-moz-transform: rotate("+E+"rad)","-ms-transform: rotate("+E+"rad)","-o-transform: rotate("+E+"rad)","transform: rotate("+E+"rad)","width:"+Math.round(T)+"px"];if(window.navigator.userAgent.indexOf("MSIE 8.0")!=-1){L.push('-ms-filter: "'+function(U,ft){return"progid:DXImageTransform.Microsoft.Matrix(M11 = "+ft+",M12 = -"+U+",M21 = "+U+",M22 = "+ft+",SizingMethod = 'auto expand')"}(D,A)+'"');var P=Math.abs(Math.round(m-k)),H=Math.abs(Math.round($-p));switch(_(m,k,p,$)){case 1:I-=H;break;case 2:M-=P,I-=H;break;case 3:M-=P}}L.push("top:"+I+"px"),L.push("left:"+M+"px"),w.style.cssText=L.join(";")}}function _(m,p,k,$){return p>=m?$<=k?1:4:$<=k?2:3}g.attachEvent("onBeforeDragStart",e.bind(function(m,p){var k=p.target||p.srcElement;if(v(),e.getState("tasksDnd").drag_id)return!1;if(ht(k,u)){ht(k,"task_start_date")&&(s=!0);var $=e.locate(p);r=$;var w=e.getTask($);return e.isReadonly(w)?(v(),!1):(this._dir_start={x:g.config.original_element_sizes.x+g.config.original_element_sizes.width/2,y:g.config.original_element_sizes.y+g.config.original_element_sizes.height/2},!0)}return!1},this)),g.attachEvent("onAfterDragStart",e.bind(function(m,p){e.config.touch&&e.refreshData(),y(g.config.marker)},this)),g.attachEvent("onDragMove",e.bind(function(m,p){var k=g.config,$=f(p,k.marker);(function(A,I){A.style.left=I.x+"px",A.style.top=I.y+"px"})(k.marker,$);var w=!!ht(p,h),x=i,S=n,T=a,C=e.locate(p),E=!0;if(Y(mt(p),e.$root)||(w=!1,C=null),w&&(E=!ht(p,"task_end_date"),w=!!C),i=C,n=w,a=E,w){const A=ht(p,h).querySelector(`.${u}`);if(A){const I=Ae(A,t.$task_bg);this._dir_end={x:I.x+A.offsetWidth/2,y:I.y+A.offsetHeight/2}}}else this._dir_end=nt(p,t.$task_data),e.env.isEdge&&(this._dir_end.y+=window.scrollY);var D=!(S==w&&x==C&&T==E);return D&&(x&&e.refreshTask(x,!1),C&&e.refreshTask(C,!1)),D&&y(k.marker),b(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y),!0},this)),g.attachEvent("onDragEnd",e.bind(function(){var m=o();if(m.link_source_id&&m.link_target_id&&m.link_source_id!=m.link_target_id){var p=e._get_link_type(m.link_from_start,m.link_to_start),k={source:m.link_source_id,target:m.link_target_id,type:p};k.type&&e.isLinkAllowed(k)&&e.callEvent("onLinkCreated",[k])&&e.addLink(k)}v(),e.config.touch?e.refreshData():(m.link_source_id&&e.refreshTask(m.link_source_id,!1),m.link_target_id&&e.refreshTask(m.link_target_id,!1)),g._direction&&(g._direction.parentNode&&g._direction.parentNode.removeChild(g._direction),g._direction=null)},this)),e.attachEvent("onGanttRender",e.bind(function(){g._direction&&b(this._dir_start.x,this._dir_start.y,this._dir_end.x,this._dir_end.y)},this))};const Ba=function(){return{init:Oa}};var za=function(t){var e=t.$services;return{onCreated:function(n){var i=n.$config;i.bind=W(i.bind)?i.bind:"task",i.bindLinks=W(i.bindLinks)?i.bindLinks:"link",n._linksDnD=Ba(),n._tasksDnD=Ha.createTaskDND(),n._tasksDnD.extend(n),this._mouseDelegates=me(t)},onInitialized:function(n){this._attachDomEvents(t),this._attachStateProvider(t,n),n._tasksDnD.init(n,t),n._linksDnD.init(n,t),n.$config.id=="timeline"&&this.extendDom(n)},onDestroyed:function(n){this._clearDomEvents(t),this._clearStateProvider(t),n._tasksDnD&&n._tasksDnD.destructor()},extendDom:function(n){t.$task=n.$task,t.$task_scale=n.$task_scale,t.$task_data=n.$task_data,t.$task_bg=n.$task_bg,t.$task_links=n.$task_links,t.$task_bars=n.$task_bars},_clearDomEvents:function(){this._mouseDelegates.destructor(),this._mouseDelegates=null},_attachDomEvents:function(n){function i(a,r){if(a&&this.callEvent("onLinkDblClick",[a,r])){var s=this.getLink(a);if(this.isReadonly(s))return;var o=this.locale.labels.link+" "+this.templates.link_description(this.getLink(a))+" "+this.locale.labels.confirm_link_deleting;window.setTimeout(function(){n._simple_confirm(o,"",function(){n.deleteLink(a)})},this.config.touch?300:1)}}this._mouseDelegates.delegate("click","gantt_task_link",n.bind(function(a,r){var s=this.locate(a,this.config.link_attribute);s&&this.callEvent("onLinkClick",[s,a])},n),this.$task),this._mouseDelegates.delegate("click","gantt_scale_cell",n.bind(function(a,r){var s=nt(a,n.$task_data),o=n.dateFromPos(s.x),l=Math.floor(n.columnIndexByDate(o)),d=n.getScale().trace_x[l];n.callEvent("onScaleClick",[a,d])},n),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_task_link",n.bind(function(a,r,s){r=this.locate(a,n.config.link_attribute),i.call(this,r,a)},n),this.$task),this._mouseDelegates.delegate("doubleclick","gantt_link_point",n.bind(function(a,r,s){r=this.locate(a);var o=this.getTask(r),l=null;return s.parentNode&&K(s.parentNode)&&(l=K(s.parentNode).indexOf("_left")>-1?o.$target[0]:o.$source[0]),l&&i.call(this,l,a),!1},n),this.$task)},_attachStateProvider:function(n,i){var a=i;e.getService("state").registerProvider("tasksTimeline",function(){return{scale_unit:a._tasks?a._tasks.unit:void 0,scale_step:a._tasks?a._tasks.step:void 0}})},_clearStateProvider:function(){e.getService("state").unregisterProvider("tasksTimeline")}}},Wa=function(t){return{getVerticalScrollbar:function(){return t.$ui.getView("scrollVer")},getHorizontalScrollbar:function(){return t.$ui.getView("scrollHor")},_legacyGridResizerClass:function(e){for(var n=e.getCellsByType("resizer"),i=0;io[1]&&(t.config.grid_width=o[1]),i&&t.config.show_chart){if(a.$config.width=t.config.grid_width-1,!a.$config.scrollable&&a.$config.scrollY&&t.$root.offsetWidth){var l=a.$gantt.$layout.$container.offsetWidth,d=t.$ui.getView(a.$config.scrollY).$config.width,c=l-(a.$config.width+d)-4;c<0&&(a.$config.width+=c,t.config.grid_width+=c)}if(n)a.$parent.$config.width=t.config.grid_width,a.$parent.$config.group&&t.$layout._syncCellSizes(a.$parent.$config.group,{value:a.$parent.$config.width,isGravity:!1});else if(i&&!Y(i.$task,e.$view)){if(!a.$config.original_grid_width){var u=t.skins[t.skin];u&&u.config&&u.config.grid_width?a.$config.original_grid_width=u.config.grid_width:a.$config.original_grid_width=0}t.config.grid_width=a.$config.original_grid_width,a.$parent.$config.width=t.config.grid_width}else a.$parent._setContentSize(a.$config.width,null),t.$layout._syncCellSizes(a.$parent.$config.group,{value:t.config.grid_width,isGravity:!1})}else i&&Y(i.$task,e.$view)&&(a.$config.original_grid_width=t.config.grid_width),n||(a.$parent.$config.width=0)}n=!1}}),this._initScrollStateEvents(e)},_initScrollStateEvents:function(e){t._getVerticalScrollbar=this.getVerticalScrollbar,t._getHorizontalScrollbar=this.getHorizontalScrollbar;var n=this.getVerticalScrollbar(),i=this.getHorizontalScrollbar();n&&n.attachEvent("onScroll",function(a,r,s){var o=t.getScrollState();t.callEvent("onGanttScroll",[o.x,a,o.x,r])}),i&&i.attachEvent("onScroll",function(a,r,s){var o=t.getScrollState();t.callEvent("onGanttScroll",[a,o.y,r,o.y]);var l=t.$ui.getView("grid");l&&l.$grid_data&&!l.$config.scrollable&&(l.$grid_data.style.left=l.$grid.scrollLeft+"px",l.$grid_data.scrollLeft=l.$grid.scrollLeft)}),e.attachEvent("onResize",function(){n&&!t.$scroll_ver&&(t.$scroll_ver=n.$scroll_ver),i&&!t.$scroll_hor&&(t.$scroll_hor=i.$scroll_hor)})},_findGridResizer:function(e,n){for(var i,a=e.getCellsByType("resizer"),r=!0,s=0;s
",b=""):(X(v=m.template?m.template(s):s[m.name])&&(v=u.date_grid(v,s,m.name)),v==null&&(v=""),b=v,v="
"+v+"
");var p="gantt_cell"+(_?" gantt_last_cell":""),k=[];if(m.tree){p+=" gantt_cell_tree";for(var $=0;$"+k.join("")+"
",g.push(y)}switch(p="",h.$config.name){case"task":p=r.getGlobalTaskIndex(s.id)%2==0?"":" odd";break;case"resource":p=h.visibleOrder.indexOf(s.id)%2==0?"":" odd"}if(p+=s.$transparent?" gantt_transparent":"",p+=s.$dataprocessor_class?" "+s.$dataprocessor_class:"",u.grid_row_class){var T=u.grid_row_class.call(r,s.start_date,s.end_date,s);T&&(p+=" "+T)}h.isSelected(s.id)&&(p+=" gantt_selected");var C=document.createElement("div");C.className="gantt_row"+p+" gantt_row_"+r.getTaskType(s.type);var E=o.getItemHeight(s.id);return C.style.height=E+"px",C.style.lineHeight=E+"px",l.smart_rendering&&(C.style.position="absolute",C.style.left="0px",C.style.top=o.getItemTop(s.id)+"px"),o.$config.item_attribute&&(C.setAttribute(o.$config.item_attribute,s.id),C.setAttribute(o.$config.bind+"_id",s.id)),r._waiAria.taskRowAttr(s,C),C.innerHTML=g.join(""),C},update:null,getRectangle:Ft,isInViewPort:Ma,getVisibleRange:gt,onrender:function(s,o,l){for(var d=l.getGridColumns(),c=0;c$.end)&&d(g.id,x)}o[g.id]={};for(var S=$.start;S<=$.end;S++){var T=h(_,S,g,b,m,p,k,v);!T&&l(g,S)?d(g.id,S):T&&!T.parentNode&&f.appendChild(T)}}},getRectangle:pn,getVisibleRange:gt,prepareData:Aa}}(t)},taskBar:function(){return fn(t)},timedProjectBar:function(){return fn(t)},taskRollupBar:function(){return function(r){const s=gn(r),o={};function l(u,h,g,f,y){let v=!0;return f.smart_rendering&&(v=ke(u,h,g)),v}function d(u,h,g,f){const y=r.copy(r.getTask(h.id));if(y.$rendered_at=u.id,r.callEvent("onBeforeRollupTaskDisplay",[y.id,y,u.id])===!1)return;const v=s(y,g);if(!v)return;const b=g.getBarHeight(u.id,h.type==r.config.types.milestone),_=Math.floor((g.getItemHeight(u.id)-b)/2);return v.style.top=f.top+_+"px",v.classList.add("gantt_rollup_child"),v.setAttribute("data-rollup-parent-id",u.id),v}function c(u,h){return u+"_"+h}return{render:function(u,h,g,f){if(u.rollup!==!1&&u.$rollup&&u.$rollup.length){const y=document.createElement("div"),v=r.getTaskPosition(u);return f&&(f.y=0,f.y_end=r.$task_bg.scrollHeight),u.$rollup.forEach(function(b){if(!r.isTaskExists(b))return;const _=r.getTask(b);if(!l(_,f,h,g))return;const m=d(u,_,h,v);m?(o[c(_.id,u.id)]=m,y.appendChild(m)):o[c(_.id,u.id)]=!1}),y}return!1},update:function(u,h,g,f,y){const v=document.createElement("div"),b=r.getTaskPosition(u);y.y=0,y.y_end=r.$task_bg.scrollHeight,u.$rollup.forEach(function(_){const m=r.getTask(_),p=c(m.id,u.id);let k=l(m,y,g,f);if(k!==!!o[p])if(k){const $=d(u,m,g,b);o[p]=$||!1}else o[p]=!1;o[p]&&v.appendChild(o[p]),h.innerHTML="",h.appendChild(v)})},isInViewPort:ke,getVisibleRange:gt}}(t)},taskSplitBar:function(){return Mt()},taskConstraints:function(){return Mt()},taskDeadline:function(){return Mt()},taskBaselines:function(){return Mt()},link:function(){return Ia(t)},resourceRow:function(){return function(r){var s=Na(r),o={};function l(c,u,h,g,f){var y=h.resource_cell_class(u.start_date,u.end_date,c,u.tasks,u.assignments),v=h.resource_cell_value(u.start_date,u.end_date,c,u.tasks,u.assignments),b=f.getItemHeight(c.id)-1;if(y||v){var _=f.getItemPosition(c,u.start_date,u.end_date),m=document.createElement("div");return m.setAttribute(f.$config.item_attribute,c.id),m.className=["gantt_resource_marker",y].join(" "),m.style.cssText=["left:"+_.left+"px","width:"+_.width+"px","height:"+b+"px","line-height:"+b+"px","top:"+_.top+"px"].join(";"),v&&(m.innerHTML=v),m}return null}function d(c,u){o[c]&&o[c][u]&&o[c][u].parentNode&&o[c][u].parentNode.removeChild(o[c][u])}return{render:function(c,u,h,g){var f=u.$getTemplates(),y=u.getScale(),v=s(c,h.resource_property,u.getScale(),u),b=!!g,_=[];o[c.id]={};for(var m=Ut(y,g),p=m.start;p<=m.end;p++){var k=v[p];if(k&&(!b||ye(p,y,g,r))){var $=l(c,k,f,0,u);$&&(_.push($),o[c.id][p]=$)}}var w=null;if(_.length){w=document.createElement("div");for(var x=0;x<_.length;x++)w.appendChild(_[x])}return w},update:function(c,u,h,g,f){var y=h.$getTemplates(),v=h.getScale(),b=s(c,g.resource_property,h.getScale(),h),_=Ut(v,f),m={};if(o&&o[c.id])for(var p in o[c.id])m[p]=p;for(var k=_.start;k<=_.end;k++){var $=b[k];if(m[k]=!1,$)if(ye(k,v,f,r))if(o[c.id]&&o[c.id][k])o[c.id]&&o[c.id][k]&&!o[c.id][k].parentNode&&u.appendChild(o[c.id][k]);else{var w=l(c,$,y,0,h);w&&(u.appendChild(w),o[c.id][k]=w)}else d(c.id,k)}for(var p in m)m[p]!==!1&&d(c.id,p)},getRectangle:pn,getVisibleRange:gt}}(t)},resourceHistogram:function(){return Mt()},gridTaskRowResizer:function(){return function(r){return{render:function(s,o,l){var d=o.$getConfig(),c=document.createElement("div");return c.className="gantt_task_grid_row_resize_wrap",c.style.top=o.getItemTop(s.id)+o.getItemHeight(s.id)+"px",c.innerHTML="
",c.setAttribute(d.task_grid_row_resizer_attribute,s.id),r._waiAria.rowResizerAttr(c),c},update:null,getRectangle:Ft,getVisibleRange:gt}}(t)}},layersService:{getDataRender:function(r){return i.getDataRender(r,t)},createDataRender:function(r){return i.createDataRender(r,t)}}}}};function $e(t,e){const n=getComputedStyle(e.$root).getPropertyValue("--dhx-gantt-theme");let i,a=!!n;if(a)i=n;else{var r=e.skin;if(i=r,!r||t)for(var s=document.getElementsByTagName("link"),o=0;ou.width?u.min_width:u.width,u.width=u.max_width&&u.max_width0&&S+T>=C+2)&&(w=0),($&&!D||$<0&&!E||$>0&&E+D>=A)&&($=0);var I=t.config.autoscroll_step;I&&I<2&&(I=2),w*=I||n,(($*=I||n)||w)&&function(M,L){var P=t.getScrollState(),H=null,U=null;M&&(H=P.x+M,H=Math.min(P.width,H),H=Math.max(0,H)),L&&(U=P.y+L,U=Math.min(P.height,U),U=Math.max(0,U)),t.scrollTo(H,U)}($,w)}}function v(b,_,m){return b-e<0&&b_-e&&b>m?1:0}t.attachEvent("onGanttReady",function(){if(!F(t)){var b=vt(t.$root)||document.body;t.eventRemove(b,"mousemove",f),t.event(b,"mousemove",f),t.eventRemove(b,"touchmove",f),t.event(b,"touchmove",f),t.eventRemove(b,"pointermove",f),t.event(b,"pointermove",f)}}),t.attachEvent("onDestroy",function(){g(!1)})}var we,Se;window.jQuery&&(we=window.jQuery,Se=[],we.fn.dhx_gantt=function(t){if(typeof(t=t||{})!="string"){var e=[];return this.each(function(){if(this&&this.getAttribute)if(this.gantt||window.gantt.$root==this)e.push(typeof this.gantt=="object"?this.gantt:window.gantt);else{var n=window.gantt.$container&&window.Gantt?window.Gantt.getGanttInstance():window.gantt;for(var i in t)i!="data"&&(n.config[i]=t[i]);n.init(this),t.data&&n.parse(t.data),e.push(n)}}),e.length===1?e[0]:e}if(Se[t])return Se[t].apply(this,[]);we.error("Method "+t+" does not exist on jQuery.dhx_gantt")});const Va=null;window.dhtmlx&&(window.dhtmlx.attaches||(window.dhtmlx.attaches={}),window.dhtmlx.attaches.attachGantt=function(t,e,n){var i=document.createElement("DIV");n=n||window.gantt,i.id="gantt_"+n.uid(),i.style.width="100%",i.style.height="100%",i.cmp="grid",document.body.appendChild(i),this.attachObject(i.id),this.dataType="gantt",this.dataObj=n;var a=this.vs[this.av];return a.grid=n,n.init(i.id,t,e),i.firstChild.style.border="none",a.gridId=i.id,a.gridObj=i,this.vs[this._viewRestore()].grid}),window.dhtmlXCellObject!==void 0&&(window.dhtmlXCellObject.prototype.attachGantt=function(t,e,n){n=n||window.gantt;var i=document.createElement("DIV");return i.id="gantt_"+n.uid(),i.style.width="100%",i.style.height="100%",i.cmp="grid",document.body.appendChild(i),this.attachObject(i.id),this.dataType="gantt",this.dataObj=n,n.init(i.id,t,e),i.firstChild.style.border="none",i=null,this.callEvent("_onContentAttach",[]),this.dataObj});const Ua=null,qa=["ctrlKey","altKey","shiftKey","metaKey"],Ga=[[{unit:"month",date:"%M",step:1},{unit:"day",date:"%d",step:1}],[{unit:"day",date:"%d %M",step:1}],[{unit:"day",date:"%d %M",step:1},{unit:"hour",date:"%H:00",step:8}],[{unit:"day",date:"%d %M",step:1},{unit:"hour",date:"%H:00",step:1}]];class Ya{constructor(e){this.zoomIn=()=>{const n=this.getCurrentLevel()-1;n<0||this.setLevel(n)},this.zoomOut=()=>{const n=this.getCurrentLevel()+1;n>this._levels.length-1||this.setLevel(n)},this.getCurrentLevel=()=>this._activeLevelIndex,this.getLevels=()=>this._levels,this.setLevel=n=>{const i=this._getZoomIndexByName(n);i===-1&&this.$gantt.assert(i!==-1,"Invalid zoom level for gantt.ext.zoom.setLevel. "+n+" is not an expected value."),this._setLevel(i,0)},this._getZoomIndexByName=n=>{let i=-1;if(typeof n=="string"){if(!isNaN(Number(n))&&this._levels[Number(n)])i=Number(n);else for(let a=0;a{if(!this.$gantt.$task)return null;const n=this.$gantt.getScrollState().x,i=this.$gantt.$task.offsetWidth;this._visibleDate=this.$gantt.dateFromPos(n+i/2)},this._setLevel=(n,i)=>{this._activeLevelIndex=n;const a=this.$gantt,r=a.copy(this._levels[this._activeLevelIndex]),s=a.copy(r);if(delete s.name,a.mixin(a.config,s,!0),a.$root&&a.$task){if(i){const o=this.$gantt.dateFromPos(i+this.$gantt.getScrollState().x);this.$gantt.render();const l=this.$gantt.posFromDate(o);this.$gantt.scrollTo(l-i)}else{const o=this.$gantt.$task.offsetWidth;this._visibleDate||this._getVisibleDate();const l=this._visibleDate;this.$gantt.render();const d=this.$gantt.posFromDate(l);this.$gantt.scrollTo(d-o/2)}this.callEvent("onAfterZoom",[this._activeLevelIndex,r])}},this._attachWheelEvent=n=>{const i=_t.isFF?"wheel":"mousewheel";let a;a=typeof n.element=="function"?n.element():n.element,a&&this._domEvents.attach(a,i,this.$gantt.bind(function(r){if(this._useKey&&(qa.indexOf(this._useKey)<0||!r[this._useKey]))return!1;if(typeof this._handler=="function")return this._handler.apply(this,[r]),!0},this),{passive:!1})},this._defaultHandler=n=>{const i=this.$gantt.$task.getBoundingClientRect().x,a=n.clientX-i;let r=!1;(this.$gantt.env.isFF?-40*n.deltaY:n.wheelDelta)>0&&(r=!0),n.preventDefault(),n.stopPropagation(),this._setScaleSettings(r,a)},this._setScaleDates=()=>{this._initialStartDate&&this._initialEndDate&&(this.$gantt.config.start_date=this._initialStartDate,this.$gantt.config.end_date=this._initialEndDate)},this.$gantt=e,this._domEvents=this.$gantt._createDomEventScope()}init(e){this.$gantt.env.isNode||(this._initialStartDate=e.startDate,this._initialEndDate=e.endDate,this._activeLevelIndex=e.activeLevelIndex?e.activeLevelIndex:0,this._levels=this._mapScales(e.levels||Ga),this._handler=e.handler||this._defaultHandler,this._minColumnWidth=e.minColumnWidth||60,this._maxColumnWidth=e.maxColumnWidth||240,this._widthStep=e.widthStep||3/8*e.minColumnWidth,this._useKey=e.useKey,this._initialized||(it(this),this.$gantt.attachEvent("onGanttScroll",()=>{this._getVisibleDate()})),this._domEvents.detachAll(),e.trigger==="wheel"&&(this.$gantt.$root?this._attachWheelEvent(e):this.$gantt.attachEvent("onGanttReady",()=>{this._attachWheelEvent(e)})),this._initialized=!0,this.setLevel(this._activeLevelIndex))}_mapScales(e){return e.map(n=>Array.isArray(n)?{scales:n}:n)}_setScaleSettings(e,n){e?this._stepUp(n):this._stepDown(n)}_stepUp(e){if(this._activeLevelIndex>=this._levels.length-1)return;let n=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){let i=this.$gantt.config.min_column_width+this._widthStep;i>this._maxColumnWidth&&(i=this._minColumnWidth,n++),this.$gantt.config.min_column_width=i}else n++;this._setLevel(n,e)}_stepDown(e){if(this._activeLevelIndex<1)return;let n=this._activeLevelIndex;if(this._setScaleDates(),this._widthStep){let i=this.$gantt.config.min_column_width-this._widthStep;i1),t.config.touch){var r=!0;try{document.createEvent("TouchEvent")}catch{r=!1}r?t._touch_events(["touchmove","touchstart","touchend"],function(s){return s.touches&&s.touches.length>1?null:s.touches[0]?{target:s.target,pageX:s.touches[0].pageX,pageY:s.touches[0].pageY,clientX:s.touches[0].clientX,clientY:s.touches[0].clientY}:s},function(){return!1}):window.navigator.pointerEnabled?t._touch_events(["pointermove","pointerdown","pointerup"],function(s){return s.pointerType=="mouse"?null:s},function(s){return!s||s.pointerType=="mouse"}):window.navigator.msPointerEnabled&&t._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(s){return s.pointerType==s.MSPOINTER_TYPE_MOUSE?null:s},function(s){return!s||s.pointerType==s.MSPOINTER_TYPE_MOUSE})}}function n(r){var s=r.$config.scrollX?t.$ui.getView(r.$config.scrollX):null,o=r.$config.scrollY?t.$ui.getView(r.$config.scrollY):null,l={x:null,y:null};return s&&s.getScrollState().visible&&(l.x=s.$view.scrollLeft),o&&o.getScrollState().visible&&(l.y=o.$view.scrollTop),l}function i(){var r;return t.$ui.getView("timeline")&&(r=t.$ui.getView("timeline")._tasks_dnd),r}t.config.touch_drag=75,t.config.touch=!0,t.config.touch_feedback=!0,t.config.touch_feedback_duration=1,t._prevent_touch_scroll=!1,t._touch_feedback=function(){t.config.touch_feedback&&navigator.vibrate&&navigator.vibrate(t.config.touch_feedback_duration)},t.attachEvent("onGanttReady",function(){t.$container&&e()}),t.attachEvent("onGanttLayoutReady",function(){t.$container&&t.attachEvent("onGanttRender",e,{once:!0})});var a=[];t._touch_events=function(r,s,o){var l,d=0,c=!1,u=!1,h=null,g=null,f=null,y=[],v=null;let b={};for(var _=0;_5||Math.abs(x)>5)&&(u=!0,d=0,l=v?n(v):t.getScrollState()),u){var S,T=l.x+w,C=l.y+x;if(v?(function(E,D,A){var I=E.$config.scrollX?t.$ui.getView(E.$config.scrollX):null,M=E.$config.scrollY?t.$ui.getView(E.$config.scrollY):null;I&&I.scrollTo(D,null),M&&M.scrollTo(null,A)}(v,T,C),S=n(v)):(t.scrollTo(T,C),S=t.getScrollState()),l.x!=S.x&&x>2*w||l.y!=S.y&&w>2*x)return m(p)}}return m(p)}return!0}}]);try{document.addEventListener("touchmove",function(p){t._touch_drag&&m(p)},{passive:!1})}catch{console.warn("Cannot prevent touch event for the page drag")}for(a.push([this.$container,"contextmenu",function(p){if(c)return m(p)}]),a.push([this.$container,r[1],function(p){if(b=p.touches.length,document&&document.body&&document.body.classList.add("gantt_touch_active"),!o(p))if(p.touches&&p.touches.length>1)c=!1;else{h=s(p),v=function($){for(var w=t.$layout.getCellsByType("viewCell"),x=0;x=S.left&&$.clientX<=S.right&&$.clientY<=S.bottom&&$.clientY>=S.top)return w[x]}}(h),t._locate_css(h,"gantt_hor_scroll")||t._locate_css(h,"gantt_ver_scroll")||(c=!0);var k=i();g=setTimeout(function(){var $=t.locate(h);k&&$&&!t._locate_css(h,"gantt_link_control")&&!t._locate_css(h,"gantt_grid_data")&&(k.on_mouse_down(h),k.drag&&k.drag.start_drag&&(function(w){const x=t._getTaskLayers();let S=t.getTask(w);if(S){let T=t.isTaskVisible(w);if(T){f=w;for(let C=0;C"}};function Lt(t,e,n){return e=e||[],"<"+t+$n(n||[])+">"+(e.innerHTML||"")+""}function $n(t){var e="";return kt(t,function(n){e+=" "+n.key+"='"+n.value+"'"}),e}function Gt(t){const e=ct();function n(){return e.apply(this,arguments)||this}return B(n,e),n.prototype.render=function(i){const a=i.height?`height:${i.height}px;`:"";let r=`
`;return r+=xn.getHtmlSelect(i.options,[{key:"style",value:"width:100%;"},{key:"title",value:i.name}]),r+="
",r},n.prototype.set_value=function(i,a,r,s){var o=i.firstChild;!o._dhx_onchange&&s.onchange&&(o.onchange=s.onchange,o._dhx_onchange=!0),a===void 0&&(a=(o.options[0]||{}).value),o.value=a||""},n.prototype.get_value=function(i){return i.firstChild.value},n.prototype.focus=function(i){var a=i.firstChild;t._focus(a,!0)},n}function Ka(t){var e=Gt(t);function n(){return e.apply(this,arguments)||this}function i(a,r){var s=[],o=[];r&&(s=t.getTaskByTime(),a.allow_root&&s.unshift({id:t.config.root_id,text:a.root_label||""}),s=function(u,h,g){var f=h.filter||function(){return!0};u=u.slice(0);for(var y=0;y`},m.prototype.set_value=function(p,k){p.innerHTML=k||""},m.prototype.get_value=function(p){return p.innerHTML||""},m.prototype.focus=function(){},m}(),n=function(_){const m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){const $=(k.height||"130")+"px",w=k.placeholder?`placeholder='${k.placeholder}'`:"";return`
`},p.prototype.set_value=function(k,$){_.form_blocks.textarea._get_input(k).value=$||""},p.prototype.get_value=function(k){return _.form_blocks.textarea._get_input(k).value},p.prototype.focus=function(k){var $=_.form_blocks.textarea._get_input(k);_._focus($,!0)},p.prototype._get_input=function(k){return k.querySelector("textarea")},p}(t),i=function(_){const m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){var $=_.form_blocks.getTimePicker.call(this,k);let w="gantt_section_time";k.name!=="time"&&(w+=" gantt_section_"+k.name);var x="
";return x+=$,k.single_date?($=_.form_blocks.getTimePicker.call(this,k,!0),x+=""):x+="  –  ",(x+=$)+"
"},p.prototype.set_value=function(k,$,w,x){var S=x,T=k.getElementsByTagName("select"),C=x._time_format_order;if(S.auto_end_date)for(var E=function(){I=new Date(T[C[2]].value,T[C[1]].value,T[C[0]].value,0,0),M=_.calculateEndDate({start_date:I,duration:1,task:w}),_.form_blocks._fill_lightbox_select(T,C.size,M,C,S)},D=0;D<4;D++)T[D].onchange=E;var A=_._resolve_default_mapping(x);typeof A=="string"&&(A={start_date:A});var I=w[A.start_date]||new Date,M=w[A.end_date]||_.calculateEndDate({start_date:I,duration:1,task:w});_.form_blocks._fill_lightbox_select(T,0,I,C,S),_.form_blocks._fill_lightbox_select(T,C.size,M,C,S)},p.prototype.get_value=function(k,$,w){var x,S=k.getElementsByTagName("select"),T=w._time_format_order;return x=_.form_blocks.getTimePickerValue(S,w),typeof _._resolve_default_mapping(w)=="string"?x:{start_date:x,end_date:function(C,E,D){var A=_.form_blocks.getTimePickerValue(C,w,E.size);return A<=D&&(w.autofix_end!==!1||w.single_date)?_.date.add(D,_._get_timepicker_step(),"minute"):A}(S,T,x)}},p.prototype.focus=function(k){_._focus(k.getElementsByTagName("select")[0])},p}(t),a=Gt(t),r=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){const $=k.height?`height:${k.height}px;`:"";let w=`
`;if(k.options&&k.options.length)for(var x=0;x"+k.options[x].label+"";else k.single_value=!0,w+="";return w+="
",w},p.prototype.set_value=function(k,$,w,x){var S=Array.prototype.slice.call(k.querySelectorAll("input[type=checkbox]"));!k._dhx_onchange&&x.onchange&&(k.onchange=x.onchange,k._dhx_onchange=!0),x.single_value?S[0].checked=!!$:kt(S,function(T){T.checked=!!$&&$.indexOf(T.value)>=0})},p.prototype.get_value=function(k,$,w){return w.single_value?k.querySelector("input[type=checkbox]").checked:function(x,S){if(x.map)return x.map(S);for(var T=x.slice(),C=[],E=0;E`;if(k.options&&k.options.length)for(var x=0;x"+k.options[x].label+"";return w+="",w},p.prototype.set_value=function(k,$,w,x){var S;x.options&&x.options.length&&(S=k.querySelector("input[type=radio][value='"+$+"']")||k.querySelector("input[type=radio][value='"+x.default_value+"']"))&&(!k._dhx_onchange&&x.onchange&&(k.onchange=x.onchange,k._dhx_onchange=!0),S.checked=!0)},p.prototype.get_value=function(k,$){var w=k.querySelector("input[type=radio]:checked");return w?w.value:""},p.prototype.focus=function(k){_._focus(k.querySelector("input[type=radio]"))},p}(t),o=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(x){return x.formatter||new Et}function $(x,S){var T=x.getElementsByTagName("select"),C=S._time_format_order,E=0,D=0;if(_.defined(C[3])){var A=T[C[3]],I=parseInt(A.value,10);isNaN(I)&&A.hasAttribute("data-value")&&(I=parseInt(A.getAttribute("data-value"),10)),E=Math.floor(I/60),D=I%60}return new Date(T[C[2]].value,T[C[1]].value,T[C[0]].value,E,D)}function w(x,S){var T=x.getElementsByTagName("input")[1];return(T=k(S).parse(T.value))&&!window.isNaN(T)||(T=1),T<0&&(T*=-1),T}return B(p,m),p.prototype.render=function(x){var S="
"+_.form_blocks.getTimePicker.call(this,x)+"
",T=" "+_.locale.labels[_.config.duration_unit+"s"]+" ",C=x.single_date?" style='display:none'":"",E=x.readonly?" disabled='disabled'":"",D=_._waiAria.lightboxDurationInputAttrString(x),A="gantt_duration_value";x.formatter&&(T="",A+=" gantt_duration_value_formatted");var I="
"+T+"
";let M="gantt_section_time gantt_section_duration";return x.name!=="time"&&(M+=" gantt_section_"+x.name),"
"+S+" "+I+"
"},p.prototype.set_value=function(x,S,T,C){var E,D,A,I,M=x.getElementsByTagName("select"),L=x.getElementsByTagName("input"),P=L[1],H=[L[0],L[2]],U=x.getElementsByTagName("span")[0],ft=C._time_format_order;function O(){var J=$.call(_,x,C),j=w.call(_,x,C),q=_.calculateEndDate({start_date:J,duration:j,task:T}),Pt=_.templates.task_end_date||_.templates.task_date;U.innerHTML=Pt(q)}function Q(J){var j=P.value;j=k(C).parse(j),window.isNaN(j)&&(j=0),(j+=J)<1&&(j=1),P.value=k(C).format(j),O()}H[0].onclick=_.bind(function(){Q(-1*_.config.duration_step)},this),H[1].onclick=_.bind(function(){Q(1*_.config.duration_step)},this),M[0].onchange=O,M[1].onchange=O,M[2].onchange=O,M[3]&&(M[3].onchange=O),P.onkeydown=_.bind(function(J){var j;return(j=(J=J||window.event).charCode||J.keyCode||J.which)==_.constants.KEY_CODES.DOWN?(Q(-1*_.config.duration_step),!1):j==_.constants.KEY_CODES.UP?(Q(1*_.config.duration_step),!1):void window.setTimeout(O,1)},this),P.onchange=_.bind(O,this),typeof(E=_._resolve_default_mapping(C))=="string"&&(E={start_date:E}),D=T[E.start_date]||new Date,A=T[E.end_date]||_.calculateEndDate({start_date:D,duration:1,task:T}),I=Math.round(T[E.duration])||_.calculateDuration({start_date:D,end_date:A,task:T}),I=k(C).format(I),_.form_blocks._fill_lightbox_select(M,0,D,ft,C),P.value=I,O()},p.prototype.get_value=function(x,S,T){var C=$(x,T),E=w(x,T),D=_.calculateEndDate({start_date:C,duration:E,task:S});return typeof _._resolve_default_mapping(T)=="string"?C:{start_date:C,end_date:D,duration:E}},p.prototype.focus=function(x){_._focus(x.getElementsByTagName("select")[0])},p}(t),l=Ka(t),d=Gt(t),c=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(w){return!w||w===_.config.constraint_types.ASAP||w===_.config.constraint_types.ALAP}function $(w,x){for(var S=k(x),T=0;T`;var T=[];for(var C in _.config.constraint_types)T.push({key:_.config.constraint_types[C],label:_.locale.labels[_.config.constraint_types[C]]});return w.options=w.options||T,S+=""+xn.getHtmlSelect(w.options,[{key:"data-type",value:"constraint-type"}])+"",S+="",S+="",S},p.prototype.set_value=function(w,x,S,T){var C=w.querySelector("[data-constraint-type-select] select"),E=w.querySelectorAll("[data-constraint-time-select] select"),D=T._time_format_order,A=_._resolve_default_mapping(T);C._eventsInitialized||(C.addEventListener("change",function(L){$(E,L.target.value)}),C._eventsInitialized=!0);var I=S[A.constraint_date]||new Date;_.form_blocks._fill_lightbox_select(E,0,I,D,T);var M=S[A.constraint_type]||_.getConstraintType(S);C.value=M,$(E,M)},p.prototype.get_value=function(w,x,S){var T=w.querySelector("[data-constraint-type-select] select"),C=w.querySelectorAll("[data-constraint-time-select] select"),E=T.value,D=null;return k(E)||(D=_.form_blocks.getTimePickerValue(C,S)),{constraint_type:E,constraint_date:D}},p.prototype.focus=function(w){_._focus(w.querySelector("select"))},p}(t),u=function(_){const m=Gt(_);function p(){return m.apply(this,arguments)||this}return B(p,m),p.prototype.render=function(k){var $=_.config.types,w=_.locale.labels,x=[],S=k.filter||function(E,D){return!$.placeholder||D!==$.placeholder};for(var T in $)!S(T,$[T])==0&&x.push({key:$[T],label:w["type_"+T]});k.options=x;var C=k.onchange;return k.onchange=function(){_._lightbox_current_type=this.value,_.changeLightboxType(this.value),typeof C=="function"&&C.apply(this,arguments)},m.prototype.render.apply(this,arguments)},p}(t),h=function(_){var m=ct();function p(){return m.apply(this,arguments)||this}function k(S){return S.formatter||new Et}function $(S,T,C,E){const D="
"+_.form_blocks.getTimePicker.call(_,E)+"
";let A=" "+_.locale.labels[_.config.duration_unit+"s"]+" ";const I=E.single_date?" style='display:none'":"",M=E.readonly?" disabled='disabled'":"",L=_._waiAria.lightboxDurationInputAttrString(E),P=_.locale.labels.baselines_remove_button;let H="gantt_duration_value";E.formatter&&(A="",H+=" gantt_duration_value_formatted");const U="
"+A+"
",ft=`
${P}
`,O=document.createElement("div");O.className="gantt_section_time gantt_section_duration",O.setAttribute("data-baseline-id",T.id),O.innerHTML=D+U+ft+"
",S.appendChild(O);var Q,J,j,q=O.getElementsByTagName("select"),Pt=O.getElementsByTagName("input"),Rt=Pt[1],Sn=[Pt[0],Pt[2]],Qa=O.getElementsByTagName("span")[0],tr=E._time_format_order;function pt(){var ut=w.call(_,O,E),G=x.call(_,O,E),er=_.calculateEndDate({start_date:ut,duration:G,task:C}),nr=_.templates.task_end_date||_.templates.task_date;Qa.innerHTML=nr(er)}function Xt(ut){var G=Rt.value;G=k(E).parse(G),window.isNaN(G)&&(G=0),(G+=ut)<1&&(G=1),Rt.value=k(E).format(G),pt()}O.querySelector(".baseline_delete_button").onclick=function(ut){const G=O.parentNode;O.innerHTML="",O.remove(),G.innerHTML===""&&(G.innerHTML=_.locale.labels.baselines_section_placeholder)},Sn[0].onclick=_.bind(function(){Xt(-1*_.config.duration_step)},_),Sn[1].onclick=_.bind(function(){Xt(1*_.config.duration_step)},_),q[0].onchange=pt,q[1].onchange=pt,q[2].onchange=pt,q[3]&&(q[3].onchange=pt),Rt.onkeydown=_.bind(function(ut){var G;return(G=(ut=ut||window.event).charCode||ut.keyCode||ut.which)==_.constants.KEY_CODES.DOWN?(Xt(-1*_.config.duration_step),!1):G==_.constants.KEY_CODES.UP?(Xt(1*_.config.duration_step),!1):void window.setTimeout(pt,1)},_),Rt.onchange=_.bind(pt,_),_._resolve_default_mapping(E),Q=T.start_date||new Date,J=T.end_date||_.calculateEndDate({start_date:Q,duration:1,task:C}),j=_.calculateDuration({start_date:Q,end_date:J,task:C}),j=k(E).format(j),_.form_blocks._fill_lightbox_select(q,0,Q,tr,E),Rt.value=j,pt()}function w(S,T){var C=S.getElementsByTagName("select"),E=T._time_format_order,D=0,A=0;if(_.defined(E[3])){var I=C[E[3]],M=parseInt(I.value,10);isNaN(M)&&I.hasAttribute("data-value")&&(M=parseInt(I.getAttribute("data-value"),10)),D=Math.floor(M/60),A=M%60}return new Date(C[E[2]].value,C[E[1]].value,C[E[0]].value,D,A)}function x(S,T){var C=S.getElementsByTagName("input")[1];return(C=k(T).parse(C.value))&&!window.isNaN(C)||(C=1),C<0&&(C*=-1),C}return B(p,m),p.prototype.render=function(S){return`
`},p.prototype.set_value=function(S,T,C,E){C.baselines?(S.innerHTML="",C.baselines.forEach(D=>{$(S,D,C,E)})):S.innerHTML=_.locale.labels.baselines_section_placeholder},p.prototype.get_value=function(S,T,C){const E=[];return S.querySelectorAll("[data-baseline-id]").forEach(D=>{const A=D.dataset.baselineId;let I,M=_.getDatastore("baselines").getItem(A);I=M?_.copy(M):{id:_.uid(),task_id:T.id,text:"Baseline 1"},I.start_date=w(D,C),I.duration=x(D,C),I.end_date=_.calculateEndDate({start_date:I.start_date,duration:I.duration,task:T}),E.push(I)}),E},p.prototype.button_click=function(S,T,C,E){if(_.callEvent("onSectionButton",[_._lightbox_id,C])!==!1&&(T.closest(".gantt_custom_button.gantt_remove_baselines")&&(E.innerHTML=_.locale.labels.baselines_section_placeholder),T.closest(".gantt_custom_button.gantt_add_baselines"))){E.innerHTML==_.locale.labels.baselines_section_placeholder&&(E.innerHTML="");const D=_.getTask(_._lightbox_id);$(E,{id:_.uid(),task_id:D.id,text:"Baseline 1",start_date:D.start_date,end_date:D.end_date},D,_._get_typed_lightbox_config()[S])}},p.prototype.focus=function(S){_._focus(S.getElementsByTagName("select")[0])},p}(t);t._lightbox_methods={},t._lightbox_template="
 
",t._lightbox_template=`
 
diff --git a/codebase/dhtmlxgantt.js.map b/codebase/dhtmlxgantt.js.map index 0f67a54..d18a1d1 100644 --- a/codebase/dhtmlxgantt.js.map +++ b/codebase/dhtmlxgantt.js.map @@ -1 +1 @@ -{"version":3,"file":"dhtmlxgantt.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\t\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\r\n\tif(marker.css){\r\n\t\tcss += \" \" + marker.css;\r\n\t}\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\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\tvar multiselect = gantt._multiselect;\r\n\tif (state && multiselect.isActive()) {\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 = 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 = [];\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 = [];\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 = [];\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 = [];\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};\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 \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 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 if (!item.task_id) {\r\n return false;\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\t
Start date: ${gantt.templates.tooltip_date_format(start)}
\r\n\t\t\t\t
End 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\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 \"
\" + text + \"
\";\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 += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, gantt.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, gantt.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"gantt_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\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 = \"
\" + collapseIcon + \"
\" + obj.header + \"
\";\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\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\tforward = (pt.e_x > (pt.x + 2 * shiftX));\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\r\n\t\t\tforward = (pt.e_x > (pt.x - 2 * shiftX));\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 || \"\") + \"\";\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
\r\n\t\r\n\r\n
`;\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 = \"
\" + this.locale.labels[\"button_\" + sns[i].button] + \"
\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"
\" + this.locale.labels.baselines_remove_all_button + \"
\" +\r\n\t\t\t\t\"
\" + this.locale.labels.baselines_add_button + \"
\";\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 += \"
\" + 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 += \"\";\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 += \"
\" + gantt.locale.labels[button] + \"
\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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\"
\" +\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\"
\"+label+\"
\" +\r\n\t\t\t\"
\" +\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 += \"\";\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\"
\" +\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\"
\"+durationLabel+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = `
${deleteLabel}
`;\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","detach","detachAll","unregisterProvider","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","undefined","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","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","destructor","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","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","clearInitialTasks","getLink","deleteCacheCooldown","saveInitialAll","eachTask","clearInitialLinks","getLinks","getMoveObjectByTaskId","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","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","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","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","getUndoStack","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","_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","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","_Ut","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","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","_ne","LinkFormatterSimple","_linkReg","linkPart","exec","_findSource","lag","pred","reqTemplate","_ae","formatters","durationFormatter","DurationFormatter","linkFormatter","LinkFormatter","empty_state_screen","show_empty_state","emptyStateElement","isGanttEmpty","placeholderContainer","empty_state_text_link","empty_state_text_description","clickEvents","detachAddTaskEvents","domHelpers","getContainer","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","getDirectionLine","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","TemplateControlConstructor","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":";;;;;;;;;;uOACA,SAASA,EAAgBC,EAAAA,CACxB,IAAIC,EAAI,EAAGC,EAAK,EAAGC,EAAM,EAAGC,EAAO,EACnC,GAAIJ,EAAKK,sBAAuB,CAC/B,IAAIC,EAAMN,EAAKK,sBAAAA,EACXE,EAAOC,SAASD,KAChBE,EAAWD,SAASE,iBACvBF,SAASD,KAAKI,YACdH,SAASD,KAENK,EAAYC,OAAOC,aAAeL,EAAQG,WAAaL,EAAKK,UAC5DG,EAAaF,OAAOG,aAAeP,EAAQM,YAAcR,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AM4E,KAAK,SAAUiuF,EAC9C31F,CAAAA,KAAKksE,QAAQypB,EAAGuyB,CAAAA,EAChBloH,KAAK6H,UAAU,YAAa,CAAC25B,EAAK0mF,CAAAA,CAAAA,SACvBozB,GAAM,YAChBA,EAAGl/I,KAAK4D,IACZ,CAAA,EAAKA,MACL,CACA,EDfc8C,CAINA,GAAAA,CACR,EDd0C2hB,EAAAA","x_google_ignoreList":[44]} \ No newline at end of file +{"version":3,"file":"dhtmlxgantt.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\t\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 \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\t
Start date: ${gantt.templates.tooltip_date_format(start)}
\r\n\t\t\t\t
End 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 \"
\" + text + \"
\";\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 += '
' + config.title + '
';\r\n\t\tinner += '
' + (config.content ? '' : config.text) + '
';\r\n\t\tif (ok)\r\n\t\t\tinner += button(getFirstDefined(config.ok, gantt.locale.labels.message_ok, \"OK\"), \"ok\", true);\r\n\t\tif (cancel)\r\n\t\t\tinner += button(getFirstDefined(config.cancel, gantt.locale.labels.message_cancel, \"Cancel\"), \"cancel\", false);\r\n\r\n\t\tif (config.buttons) {\r\n\t\t\tfor (var i = 0; i < config.buttons.length; i++) {\r\n\t\t\t\tvar btn = config.buttons[i];\r\n\t\t\t\tif (typeof btn == \"object\") {\r\n\t\t\t\t\t// Support { label:\"Save\", css:\"main_button\", value:\"save\" }\r\n\t\t\t\t\tvar label = btn.label;\r\n\t\t\t\t\tvar css = btn.css || (\"gantt_\" + btn.label.toLowerCase() + \"_button\");\r\n\t\t\t\t\tvar value = btn.value || i;\r\n\t\t\t\t\tinner += button(label, css, value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinner += button(btn, btn, i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\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 = \"
\" + collapseIcon + \"
\" + obj.header + \"
\";\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\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 || \"\") + \"\";\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
\r\n\t\r\n\r\n
`;\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 = \"
\" + this.locale.labels[\"button_\" + sns[i].button] + \"
\";\r\n\t\t\t}\r\n\t\t\tif (sns[i].type == \"baselines\") {\r\n\t\t\t\tbutton = \"
\" + this.locale.labels.baselines_remove_all_button + \"
\" +\r\n\t\t\t\t\"
\" + this.locale.labels.baselines_add_button + \"
\";\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 += \"
\" + 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 += \"\";\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 += \"
\" + gantt.locale.labels[button] + \"
\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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 += \"\";\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\"
\" +\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\"
\"+label+\"
\" +\r\n\t\t\t\"
\" +\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 += \"\";\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\"
\" +\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\"
\"+durationLabel+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"\";\r\n\r\n\t\tconst deleteButton = `
${deleteLabel}
`;\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","detach","detachAll","unregisterProvider","destructor","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","defined","uid","functor","capture","addEventListener","removeEventListener","createScope","utils.event","utils.eventRemove","eventScope","staticArray","extend","Tooltip","_tooltipNode","tooltipAttr","_root","domHelpers.isChildOf","_isLikeMouseEvent","_calculateTooltipPosition","tooltipVisibleAttr","tooltipHiddenAttr","_getViewPort","viewport","_getViewPortSize","tooltipNode","tooltip","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","domHelpers.getRelativeEventPosition","containerPos","domHelpers.getNodePosition","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","_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","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","cantFullscreen","warning","log","expand","requestArguments","webkitRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","collapse","requestExitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","exitFullscreen","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","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","_Ut","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","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","_ne","LinkFormatterSimple","_linkReg","linkPart","exec","_findSource","lag","pred","reqTemplate","_ae","formatters","durationFormatter","DurationFormatter","linkFormatter","LinkFormatter","empty_state_screen","show_empty_state","emptyStateElement","isGanttEmpty","placeholderContainer","empty_state_text_link","empty_state_text_description","clickEvents","detachAddTaskEvents","domHelpers","getContainer","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","getCorrection","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","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","getDirectionLine","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","TemplateControlConstructor","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":";;;;;;;;;;uOACA,SAASA,EAAgBC,EAAAA,CACxB,IAAIC,EAAI,EAAGC,EAAK,EAAGC,EAAM,EAAGC,EAAO,EACnC,GAAIJ,EAAKK,sBAAuB,CAC/B,IAAIC,EAAMN,EAAKK,sBAAAA,EACXE,EAAOC,SAASD,KAChBE,EAAWD,SAASE,iBACvBF,SAASD,KAAKI,YACdH,SAASD,KAENK,EAAYC,OAAOC,aAAeL,EAAQG,WAAaL,EAAKK,UAC5DG,EAAaF,OAAOG,aAAeP,EAAQM,YAAcR,EAAKQ,WAC9DE,EAAYR,EAAQQ,WAAaV,EAAKU,WAAa,EACnDC,EAAaT,EAAQS,YAAcX,EAAKW,YAAc,EAC1DjB,EAAOK,EAAIL,IAAOW,EAAYK,EAC9Bf,EAAOI,EAAIJ,KAAOa,EAAaG,EAE/Bf,EAAQK,SAASD,KAAKY,YAAcb,EAAIH,MACxCC,EAASI,SAASD,KAAKa,aAAed,EAAIF,MAC5C,KAAQ,CACN,KAAMJ,GACLC,GAAYoB,SAASrB,EAAKsB,UAAU,IACpCpB,GAAcmB,SAASrB,EAAKuB,WAAW,EAAA,EACvCvB,EAAOA,EAAKwB,aAGbrB,EAAQK,SAASD,KAAKY,YAAcnB,EAAKmB,YAAcjB,EACvDE,EAASI,SAASD,KAAKa,aAAepB,EAAKoB,aAAenB,CAC1D,CACD,MAAO,CAAEw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AIrC,CACH,CAAA,CACA,Cc9KM,MAAA3oF,GAASH,GAAcG,MCId,SAASuoF,GACvB,IAAIvoF,EAAQsoF,GAAQC,CAQpB,EAAA,OANIvoF,EAAM0wC,IAAIc,SACbyhG,GAAGjzI,CCXU,EAAA,SAASA,GACvBA,EAAMq5C,KAAO,SAAUva,EAAK9kB,EAAMjV,GACjC9H,KAAKw7I,UAAY35G,EACjB7hC,KAAK+iB,OAAOnc,UAAUtK,OAAQ,0BAE9B,IAAI+rH,EAAK,OAAQozB,EAAK,KAetB,OAdI70I,UAAUtK,QAAU,GACvB+rH,EAAKtrG,EACL0+H,EAAK3zI,GAEsB,OAAhBlB,UAAU,CACpByhH,GAD0B,SAC1BA,EAAKzhH,UAAU,CACgB,EAAA,OAAhBA,UAAU,CACzB60I,GAD+B,aAC/BA,EAAK70I,UAAU,CAGjB5G,GAAAA,KAAK07I,WAAarzB,EAElBroH,KAAK+H,UAAU,cAAe,CAAC85B,EAAKwmF,CAE7BroH,CAAAA,EAAAA,KAAKgiC,KAAK7d,IAAI0d,EAAK9+B,EAAM6E,KAAK,SAAUkuF,EAC9C91F,CAAAA,KAAKqsE,QAAQypB,EAAGuyB,CAAAA,EAChBroH,KAAK+H,UAAU,YAAa,CAAC85B,EAAKwmF,CAAAA,CAAAA,SACvBozB,GAAM,YAChBA,EAAGr/I,KAAK4D,IACZ,CAAA,EAAKA,MACL,CACA,EDfc+C,CAINA,GAAAA,CACR,EDd0C4hB,EAAAA","x_google_ignoreList":[44]} \ No newline at end of file diff --git a/codebase/sources/dhtmlxgantt.css b/codebase/sources/dhtmlxgantt.css index 3f9e2b1..d243ac7 100644 --- a/codebase/sources/dhtmlxgantt.css +++ b/codebase/sources/dhtmlxgantt.css @@ -879,8 +879,7 @@ url("src/dhx-gantt-icons.woff2?d2ea3e087edb3b9fad35a6580bd8acd3") format("woff2"); */ src: url("data:font/woff;base64,d09GRgABAAAAAAc4AAsAAAAADHgAAQAAAAAAAAAAAAAAAAAAAAAAA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+8oLd+9pasviO537M6Cr35dHGmRzwyRhSLxOPcc+miPk5ZNfnn+0giEU9ECmpAQ0//coJFsevWlK+5rlfv4MabQzczNdF1Z9XOroMHqXQ2mj0c/S/Ky9dcuaB0wZXdu/mXbDq5KZ3ouqtqV9dBlefsG9MHdo1T/+tMZtO45eOGv/hx7OPW4seKSY9VBwrkIL6+5s555u0D27cFg2//646/fPNH8UD88vjP+/dff32xKqlHD/zAstSB//l/82PFjw0T+/Urzl8H32THjRw57pYJ8yKfqE/VJ5F5LKvNj2V/bfylI9YQ6/il8ddsbOCjtbdsuvzccrv4y5rOl0Vrvyyu2e2tsb9b1q8sWXb1qCR5rMitEvIZyY21p2b7D5pDkDvBOQkZpuNiSDThpNhVcQfEAz7eJVhqJUvcNzxmyS9PKwIc4F4oygL8KkUknJXoW/t9+GqsER4ZuuG4V0sUYFn946ugd6upTcOL4cYLNGGGU+VyUvtO5p8mpqJl0ZuM2wN7KgxEtCiXfHGWNACFAnKIhDDv7jZBCDWuCAYeQnPZnCo2aktfb3WhucLqJkQXq6KVgZtr8lmMiVg+hAq2GVaDIFmrSQXPqy39t1YXNsesbipEWRUpafpImgu/ZIV2W257FMn9SJi+wc6hZ0Vrma/+gZMnVHVRKZ/iBAjcC2g17CotthExyjBFdSQUCIHUxHSGUQonMh3K0ri3VIwUM+22HNujSI4fCdM34J059NysAxV1/4GTT7yjqCmomqtPBLs49wI6ZtiHMWkxSePGGFXUZYqKYzemoRykTDGZ1POdYZQC1yFnOlBavZmmpNixEh/5ocCfyj6IiCGmWOISt3jEK77P6Gp+CUhQQhKWiORxd520raat1vbMtLa6GBxvlBPN06Xr4hgowac/M2ES7j1KG8AY3tEkAvqjgQcTBa+/7Ez21ukZ0GfCRv5duaohgMCjwnckqV2AxY99uCiZzhDH2zgtAs5nqM+7jeyue72MVL7XpDegKczprSLTjBr0pW5bT2nxETjLAAA=") format("woff2"); } -.dhx_gantt_icon:before, -.dhx_menu_icon:before { +.dhx_gantt_icon:before { font-family: dhx-gantt-icons !important; font-style: normal; font-weight: normal !important; @@ -894,69 +893,56 @@ url("src/dhx-gantt-icons.woff2?d2ea3e087edb3b9fad35a6580bd8acd3") format("woff2" color: var(--dhx-gantt-base-colors-icons); font-size: var(--dhx-gantt-icon-size, 1.5em); } -.dhx_gantt_icon.dhx_gantt_icon_arrow_down:before, -.dhx_menu_icon.dhx_gantt_icon_arrow_down:before { +.dhx_gantt_icon.dhx_gantt_icon_arrow_down:before { content: "\f101"; } -.dhx_gantt_icon.dhx_gantt_icon_arrow_up:before, -.dhx_menu_icon.dhx_gantt_icon_arrow_up:before { +.dhx_gantt_icon.dhx_gantt_icon_arrow_up:before { content: "\f102"; } -.dhx_gantt_icon.dhx_gantt_icon_close:before, -.dhx_menu_icon.dhx_gantt_icon_close:before { +.dhx_gantt_icon.dhx_gantt_icon_close:before { content: "\f103"; } -.dhx_gantt_icon.dhx_gantt_icon_constraint_left_dotted:before, -.dhx_menu_icon.dhx_gantt_icon_constraint_left_dotted:before { +.dhx_gantt_icon.dhx_gantt_icon_constraint_left_dotted:before { content: "\f104"; } -.dhx_gantt_icon.dhx_gantt_icon_constraint_left_solid:before, -.dhx_menu_icon.dhx_gantt_icon_constraint_left_solid:before { +.dhx_gantt_icon.dhx_gantt_icon_constraint_left_solid:before { content: "\f105"; } -.dhx_gantt_icon.dhx_gantt_icon_constraint_right_dotted:before, -.dhx_menu_icon.dhx_gantt_icon_constraint_right_dotted:before { +.dhx_gantt_icon.dhx_gantt_icon_constraint_right_dotted:before { content: "\f106"; } -.dhx_gantt_icon.dhx_gantt_icon_constraint_right_solid:before, -.dhx_menu_icon.dhx_gantt_icon_constraint_right_solid:before { +.dhx_gantt_icon.dhx_gantt_icon_constraint_right_solid:before { content: "\f107"; } -.dhx_gantt_icon.dhx_gantt_icon_delete:before, -.dhx_menu_icon.dhx_gantt_icon_delete:before { +.dhx_gantt_icon.dhx_gantt_icon_delete:before { content: "\f108"; } -.dhx_gantt_icon.dhx_gantt_icon_dots_vertical:before, -.dhx_menu_icon.dhx_gantt_icon_dots_vertical:before { +.dhx_gantt_icon.dhx_gantt_icon_dots_vertical:before { content: "\f109"; } -.dhx_gantt_icon.dhx_gantt_icon_edit:before, -.dhx_menu_icon.dhx_gantt_icon_edit:before { +.dhx_gantt_icon.dhx_gantt_icon_edit:before { content: "\f10a"; } -.dhx_gantt_icon.dhx_gantt_icon_menu_down:before, -.dhx_menu_icon.dhx_gantt_icon_menu_down:before { +.dhx_gantt_icon.dhx_gantt_icon_menu_down:before { content: "\f10b"; } -.dhx_gantt_icon.dhx_gantt_icon_menu_right:before, -.dhx_menu_icon.dhx_gantt_icon_menu_right:before { +.dhx_gantt_icon.dhx_gantt_icon_menu_right:before { content: "\f10c"; } -.dhx_gantt_icon.dhx_gantt_icon_minus:before, -.dhx_menu_icon.dhx_gantt_icon_minus:before { +.dhx_gantt_icon.dhx_gantt_icon_minus:before { content: "\f10d"; } -.dhx_gantt_icon.dhx_gantt_icon_plus:before, -.dhx_menu_icon.dhx_gantt_icon_plus:before { +.dhx_gantt_icon.dhx_gantt_icon_plus:before { content: "\f10e"; } -.dhx_gantt_icon.dhx_gantt_icon_rounded_arrow_right:before, -.dhx_menu_icon.dhx_gantt_icon_rounded_arrow_right:before { +.dhx_gantt_icon.dhx_gantt_icon_rounded_arrow_right:before { content: "\f10f"; } -.dhx_gantt_icon.dhx_gantt_icon_timer:before, -.dhx_menu_icon.dhx_gantt_icon_timer:before { +.dhx_gantt_icon.dhx_gantt_icon_timer:before { content: "\f110"; + max-width: 100%; + max-height: 100%; + font-size: 1em; } .gantt_container { background: var(--dhx-gantt-container-background); @@ -1591,6 +1577,9 @@ div.dhx_modal_cover { .gantt_task_link:hover { --dhx-gantt-link-background: var(--dhx-gantt-link-background-hover); } +.gantt_task_link:hover > div { + z-index: 1; +} /* Link arrow */ .gantt_task_link div.gantt_link_arrow { color: var(--dhx-gantt-link-background); @@ -1821,22 +1810,6 @@ div.dhx_modal_cover { box-sizing: border-box; transform: rotate(45deg); } -.gantt_task_line.gantt_task_inline_color { - border-color: var(--dhx-gantt-task-background); -} -.gantt_task_line.gantt_task_inline_color .gantt_task_progress { - background-color: var(--dhx-gantt-task-background); - opacity: 0.2; -} -.gantt_task_line.gantt_task_inline_color.gantt_selected { - box-shadow: 0 0 5px var(--dhx-gantt-task-background); -} -.gantt_task_line.gantt_task_inline_color.gantt_project.gantt_selected { - box-shadow: 0 0 5px var(--dhx-gantt-task-background); -} -.gantt_task_link.gantt_link_inline_color:hover .gantt_line_wrapper div { - box-shadow: 0 0 5px 0px var(--dhx-gantt-task-background); -} .gantt_critical_task { --dhx-gantt-task-background: var(--dhx-gantt-link-critical-background); } @@ -2571,14 +2544,9 @@ div.dhx_modal_cover { .dhx_menu_icon.dhx_gantt_icon_edit { --dhx-gantt-icon-size: var(--dhx-gantt-font-size); } -/* -.gantt_menu_icon.icon_details { - background: url("imgs/icon-edit.svg") center no-repeat; +.gantt_cal_quick_info.gantt_qi_hidden { + display: none; } - -.gantt_menu_icon.icon_delete { - background: url("imgs/icon-delete.svg") center no-repeat; -}*/ .gantt_tooltip { padding: 8px 30px 8px 8px; position: absolute; @@ -2751,6 +2719,11 @@ div.dhx_modal_cover { .gantt_constraint_marker.gantt_constraint_marker_mfo { transform: rotate(180deg); } +.gantt_constraint_marker svg { + display: block; + max-height: 100%; + max-width: 100%; +} .gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_snlt, .gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_fnlt, .gantt_rtl .gantt_constraint_marker.gantt_constraint_marker_mfo { @@ -3068,6 +3041,7 @@ div.dhx_modal_cover { position: absolute; z-index: 5; --dhx-gantt-base-colors-icons: var(--dhx-gantt-base-colors-error); + pointer-events: none; } .gantt_task_deadline:before { font-family: dhx-gantt-icons !important; @@ -3085,6 +3059,9 @@ div.dhx_modal_cover { } .gantt_task_deadline:before { content: "\f110"; + max-width: 100%; + max-height: 100%; + font-size: 1em; } .gantt_task_baseline { position: absolute; diff --git a/codebase/sources/dhtmlxgantt.es.js b/codebase/sources/dhtmlxgantt.es.js index a25a86e..7bd2fc6 100644 --- a/codebase/sources/dhtmlxgantt.es.js +++ b/codebase/sources/dhtmlxgantt.es.js @@ -1,6 +1,6 @@ /** @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. @@ -1568,7 +1568,7 @@ function export_api(gantt2) { if (cols[i].name === "add" || cols[i].name === "buttons") { continue; } - columns[ccount] = { id: cols[i].template ? "_" + i : cols[i].name, header: cols[i].label || gantt2.locale.labels["column_" + cols[i].name], width: cols[i].width ? Math.floor(cols[i].width / 4) : "" }; + columns[ccount] = { id: cols[i].template ? "_" + i : cols[i].name, header: cols[i].label || gantt2.locale.labels["column_" + cols[i].name], width: cols[i].width ? Math.floor(cols[i].width / 4) : "", tree: cols[i].tree || false }; if (cols[i].name === "duration") { columns[ccount].type = "number"; } @@ -3101,9 +3101,11 @@ function marker(gantt2) { var div = document.createElement("div"); div.setAttribute("data-marker-id", marker2.id); var css = "gantt_marker"; + if (gantt2.templates.marker_class) css += " " + gantt2.templates.marker_class(marker2); if (marker2.css) { css += " " + marker2.css; } + if (gantt2.templates.marker_class) css += " " + gantt2.templates.marker_class(marker2); if (marker2.title) { div.title = marker2.title; } @@ -3298,6 +3300,10 @@ function multiselect(gantt2) { var first_indx = gantt2.getGlobalTaskIndex(this.getFirstSelected()); var target_indx = gantt2.getGlobalTaskIndex(target_ev); var last_indx = gantt2.getGlobalTaskIndex(last); + if (first_indx == -1 || last_indx == -1) { + first_indx = target_indx; + this.reset(); + } var tmp = last; while (gantt2.getGlobalTaskIndex(tmp) !== first_indx) { this.unselect(tmp, e); @@ -3424,8 +3430,21 @@ function multiselect(gantt2) { }); }); gantt2.attachEvent("onBeforeTaskMultiSelect", function(id, state, e) { - var multiselect2 = gantt2._multiselect; + const multiselect2 = gantt2._multiselect; if (state && multiselect2.isActive()) { + let oldSelectedId = gantt2.getSelectedId(); + let oldSelectedTask = null; + if (oldSelectedId) { + oldSelectedTask = gantt2.getTask(oldSelectedId); + } + let newSelectedTask = gantt2.getTask(id); + let differentTreeLevel = false; + if (oldSelectedTask && oldSelectedTask.$level != newSelectedTask.$level) { + differentTreeLevel = true; + } + if (gantt2.config.multiselect_one_level && differentTreeLevel && !e.ctrlKey && !e.shiftKey) { + return true; + } if (multiselect2._one_level) { return multiselect2.isSameLevel(id); } @@ -8032,6 +8051,9 @@ function initDataStores(gantt2) { if (task.parent === void 0) { task.parent = this.config.root_id; } + if (task.open) { + task.$open = true; + } return task; } function _init_link(link) { @@ -10865,6 +10887,9 @@ const getMaxParentHeight = function(gantt2, view, task, heightLimit) { function baselines(gantt2) { gantt2.config.baselines = { datastore: "baselines", render_mode: false, dataprocessor_baselines: false, row_height: 16, bar_height: 8 }; function initBaselineFields(item, task) { + if (!item.task_id || !item.start_date && !item.end_date) { + return false; + } if (item.start_date) { item.start_date = gantt2.date.parseDate(item.start_date, "parse_date"); } else { @@ -10875,8 +10900,11 @@ function baselines(gantt2) { } else { item.end_date = null; } - if (!item.task_id) { - return false; + item.duration = item.duration || 1; + if (item.start_date && !item.end_date) { + item.end_date = gantt2.calculateEndDate(item.start_date, item.duration); + } else if (item.end_date && !item.start_date) { + item.start_date = gantt2.calculateEndDate(item.end_date, -item.duration); } } const baselineStore = gantt2.createDatastore({ name: gantt2.config.baselines.datastore, initItem: function(item) { @@ -14267,7 +14295,7 @@ function i18nFactory() { } function DHXGantt() { this.constants = constants; - this.version = "9.0.1"; + this.version = "9.0.2"; this.license = "gpl"; this.templates = {}; this.ext = {}; @@ -20363,7 +20391,9 @@ function createLinkRender(gantt2) { } this.point_to(dir.right, shiftX); } else if (!lineType.from_start && lineType.to_start) { - forward = pt.e_x > pt.x + 2 * shiftX; + if (dy !== 0) { + forward = pt.e_x > pt.x + 2 * shiftX; + } this.point_to(dir.right, shiftX); if (forward) { dx -= shiftX; @@ -20388,7 +20418,9 @@ function createLinkRender(gantt2) { } this.point_to(dir.left, shiftX); } else if (lineType.from_start && !lineType.to_start) { - forward = pt.e_x > pt.x - 2 * shiftX; + if (dy !== 0) { + forward = pt.e_x > pt.x - 2 * shiftX; + } this.point_to(dir.left, shiftX); if (!forward) { dx += shiftX; @@ -23771,7 +23803,7 @@ function TextareaControlConstructor(gantt2) { TextareaControl.prototype.render = function(sns) { const height = (sns.height || "130") + "px"; const placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : ""; - return `
`; + return `
`; }; TextareaControl.prototype.set_value = function(node, value) { gantt2.form_blocks.textarea._get_input(node).value = value || ""; diff --git a/codebase/sources/dhtmlxgantt.es.js.map b/codebase/sources/dhtmlxgantt.es.js.map index 16675d5..8007e4a 100644 --- a/codebase/sources/dhtmlxgantt.es.js.map +++ b/codebase/sources/dhtmlxgantt.es.js.map @@ -1 +1 @@ -{"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/click_drag/index.ts","../../sources/ext/drag_timeline/eventsManager.ts","../../sources/ext/drag_timeline/index.ts","../../sources/ext/export_api/index.ts","../../sources/ext/fullscreen/index.ts","../../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/modals.js","../../sources/ext/keyboard_navigation/core.js","../../sources/ext/keyboard_navigation.js","../../sources/ext/marker.js","../../sources/ext/multiselect.js","../../sources/ext/quick_info/quickInfo.ts","../../sources/ext/quick_info/index.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/tooltip/index.ts","../../sources/ext/undo/monitor.ts","../../sources/ext/undo/undo.ts","../../sources/ext/undo/index.ts","../../sources/ext/extensions_gpl.ts","../../sources/constants/index.js","../../sources/ext/extension_manager.ts","../../sources/core/common/services.js","../../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/dnd.js","../../sources/core/common/templates.js","../../sources/core/common/state.js","../../sources/utils/promise.js","../../sources/core/facades/datastore_tasks.js","../../sources/core/facades/datastore_links.js","../../sources/core/datastore/power_array.js","../../sources/utils/placeholder_task.js","../../sources/core/datastore/datastore.js","../../sources/core/datastore/treedatastore.js","../../sources/core/datastore/select.js","../../sources/utils/is_headless.js","../../sources/core/datastore/datastore_render.js","../../sources/core/facades/datastore.js","../../sources/core/ui/timeline/scales.js","../../sources/core/gantt_data_range.js","../../sources/utils/task_tree_helpers.js","../../sources/core/datastore/datastore_hooks.js","../../sources/core/dataprocessor/data_processor_events.ts","../../sources/core/dataprocessor/extend_gantt.ts","../../sources/core/dataprocessor/simple_storage.ts","../../sources/core/dataprocessor/data_processor.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/plugins/index.js","../../sources/core/grid_column_api.gpl.js","../../sources/core/tasks.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/index.ts","../../sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts","../../sources/core/worktime/strategy/calendar_strategy.js","../../sources/core/worktime/legacy_resource_config.js","../../sources/core/worktime/dynamic_resource_calendars.js","../../sources/core/worktime/calendar_manager.js","../../sources/core/worktime/strategy/no_work_time.js","../../sources/core/worktime/time_calculator.js","../../sources/core/facades/worktime_calendars.js","../../sources/core/worktime/work_time.js","../../sources/core/data.js","../../sources/core/data_task_types.gpl.js","../../sources/core/cached_functions.js","../../sources/core/ui/resize_listener.js","../../sources/core/common/assert.js","../../sources/core/gantt_core.js","../../sources/core/destructor.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/locale/index.ts","../../sources/factory/make_instance_common.js","../../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/get_link_rectangle.js","../../sources/core/ui/render/viewport/factory/get_visible_link_range.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/resizer_cell.gpl.js","../../sources/core/ui/layout/scrollbar_cell.js","../../sources/core/ui/row_position_fixed_height.js","../../sources/core/ui/row_position_mixin.js","../../sources/core/ui/timeline/tasks_canvas_render.gpl.js","../../sources/core/ui/timeline/timeline_layers_gpl.js","../../sources/core/ui/timeline/timeline.js","../../sources/core/ui/grid/grid_resize.gpl.js","../../sources/core/ui/grid/task_grid_row_resize.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/editors/keyboard_mappings/default.js","../../sources/core/ui/grid/editors/keyboard_mappings/keyboard_navigation.js","../../sources/core/ui/grid/editors/keyboard_mappings.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/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/task_rollup_render.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/task_bg_render.js","../../sources/core/ui/render/link_render.js","../../sources/core/ui/render/viewport/is_grid_row_in_viewport.js","../../sources/core/ui/render/task_grid_line_render.js","../../sources/core/resource_timetable_builder.js","../../sources/core/ui/render/resource_matrix_render.js","../../sources/core/ui/render/task_grid_row_resize_render.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/multi_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/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/facades/layout.js","../../sources/core/data_task_layers.gpl.js","../../sources/core/ui/skin.js","../../sources/css/skins/skyblue.js","../../sources/css/skins/meadow.js","../../sources/css/skins/terrace.js","../../sources/css/skins/broadway.js","../../sources/css/skins/material.js","../../sources/css/skins/dark.js","../../sources/css/skins/contrast_black.js","../../sources/css/skins/contrast_white.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/plugins/index.js","../../sources/core/ui/touch.js","../../sources/core/ui/lightbox/controls/base_control.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/utils/html_helpers.js","../../sources/core/ui/lightbox/controls/select_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/parent_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/lightbox/index.js","../../sources/core/ui/lightbox/lightbox_optional_time.js","../../sources/core/ui/wai_aria.js","../../sources/core/ui_core.js","../../sources/core/loading/ajax_loading.js","../../sources/factory/make_instance_web.js","../../sources/dhtmlxgantt.gpl.ts"],"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}","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}","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}","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}","/* 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 = 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 = [];\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 = [];\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 = [];\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 = [];\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};\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 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}","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\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};","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 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};","\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\r\n\tif(marker.css){\r\n\t\tcss += \" \" + marker.css;\r\n\t}\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\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\tvar multiselect = gantt._multiselect;\r\n\tif (state && multiselect.isActive()) {\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};","\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\t\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 { 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