@syncfusion/ej2-gantt 19.4.56 → 20.1.47-1460716

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/CHANGELOG.md +1072 -1060
  2. package/README.md +75 -75
  3. package/dist/ej2-gantt.umd.min.js +1 -10
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +274 -176
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +642 -534
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +1 -10
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +0 -9
  12. package/dist/ts/components.ts +4 -0
  13. package/dist/ts/gantt/actions/actions.ts +18 -0
  14. package/dist/ts/gantt/actions/cell-edit.ts +606 -0
  15. package/dist/ts/gantt/actions/chart-scroll.ts +167 -0
  16. package/dist/ts/gantt/actions/column-menu.ts +35 -0
  17. package/dist/ts/gantt/actions/column-reorder.ts +52 -0
  18. package/dist/ts/gantt/actions/column-resize.ts +52 -0
  19. package/dist/ts/gantt/actions/connector-line-edit.ts +829 -0
  20. package/dist/ts/gantt/actions/context-menu.ts +754 -0
  21. package/dist/ts/gantt/actions/day-markers.ts +80 -0
  22. package/dist/ts/gantt/actions/dependency.ts +692 -0
  23. package/dist/ts/gantt/actions/dialog-edit.ts +2208 -0
  24. package/dist/ts/gantt/actions/edit.ts +3499 -0
  25. package/dist/ts/gantt/actions/excel-export.ts +61 -0
  26. package/dist/ts/gantt/actions/filter.ts +302 -0
  27. package/dist/ts/gantt/actions/keyboard.ts +306 -0
  28. package/dist/ts/gantt/actions/pdf-export.ts +214 -0
  29. package/dist/ts/gantt/actions/rowdragdrop.ts +839 -0
  30. package/dist/ts/gantt/actions/selection.ts +536 -0
  31. package/dist/ts/gantt/actions/sort.ts +98 -0
  32. package/dist/ts/gantt/actions/taskbar-edit.ts +1940 -0
  33. package/dist/ts/gantt/actions/toolbar.ts +489 -0
  34. package/dist/ts/gantt/actions/virtual-scroll.ts +60 -0
  35. package/dist/ts/gantt/base/common.ts +9 -0
  36. package/dist/ts/gantt/base/constant.ts +13 -0
  37. package/dist/ts/gantt/base/css-constants.ts +148 -0
  38. package/dist/ts/gantt/base/date-processor.ts +1257 -0
  39. package/dist/ts/gantt/base/enum.ts +372 -0
  40. package/dist/ts/gantt/base/gantt-chart.ts +1248 -0
  41. package/dist/ts/gantt/base/gantt.ts +4069 -0
  42. package/dist/ts/gantt/base/interface.ts +955 -0
  43. package/dist/ts/gantt/base/splitter.ts +174 -0
  44. package/dist/ts/gantt/base/task-processor.ts +2217 -0
  45. package/dist/ts/gantt/base/tree-grid.ts +694 -0
  46. package/dist/ts/gantt/base/utils.ts +208 -0
  47. package/dist/ts/gantt/export/export-helper.ts +552 -0
  48. package/dist/ts/gantt/export/pdf-base/dictionary.ts +152 -0
  49. package/dist/ts/gantt/export/pdf-base/pdf-borders.ts +277 -0
  50. package/dist/ts/gantt/export/pdf-base/pdf-grid-table.ts +901 -0
  51. package/dist/ts/gantt/export/pdf-base/pdf-style/gantt-theme.ts +131 -0
  52. package/dist/ts/gantt/export/pdf-base/pdf-style/style.ts +91 -0
  53. package/dist/ts/gantt/export/pdf-base/treegrid-layouter.ts +414 -0
  54. package/dist/ts/gantt/export/pdf-connector-line.ts +422 -0
  55. package/dist/ts/gantt/export/pdf-gantt.ts +282 -0
  56. package/dist/ts/gantt/export/pdf-taskbar.ts +395 -0
  57. package/dist/ts/gantt/export/pdf-timeline.ts +202 -0
  58. package/dist/ts/gantt/export/pdf-treegrid.ts +406 -0
  59. package/dist/ts/gantt/models/add-dialog-field-settings.ts +33 -0
  60. package/dist/ts/gantt/models/column.ts +464 -0
  61. package/dist/ts/gantt/models/day-working-time.ts +22 -0
  62. package/dist/ts/gantt/models/edit-dialog-field-settings.ts +33 -0
  63. package/dist/ts/gantt/models/edit-settings.ts +79 -0
  64. package/dist/ts/gantt/models/event-marker.ts +27 -0
  65. package/dist/ts/gantt/models/filter-settings.ts +53 -0
  66. package/dist/ts/gantt/models/holiday.ts +34 -0
  67. package/dist/ts/gantt/models/label-settings.ts +30 -0
  68. package/dist/ts/gantt/models/models.ts +36 -0
  69. package/dist/ts/gantt/models/resource-fields.ts +38 -0
  70. package/dist/ts/gantt/models/search-settings.ts +77 -0
  71. package/dist/ts/gantt/models/selection-settings.ts +56 -0
  72. package/dist/ts/gantt/models/sort-settings.ts +50 -0
  73. package/dist/ts/gantt/models/splitter-settings.ts +47 -0
  74. package/dist/ts/gantt/models/task-fields.ts +171 -0
  75. package/dist/ts/gantt/models/timeline-settings.ts +112 -0
  76. package/dist/ts/gantt/models/tooltip-settings.ts +46 -0
  77. package/dist/ts/gantt/renderer/chart-rows.ts +1838 -0
  78. package/dist/ts/gantt/renderer/connector-line.ts +1025 -0
  79. package/dist/ts/gantt/renderer/edit-tooltip.ts +228 -0
  80. package/dist/ts/gantt/renderer/event-marker.ts +96 -0
  81. package/dist/ts/gantt/renderer/nonworking-day.ts +205 -0
  82. package/dist/ts/gantt/renderer/render.ts +5 -0
  83. package/dist/ts/gantt/renderer/timeline.ts +1397 -0
  84. package/dist/ts/gantt/renderer/tooltip.ts +450 -0
  85. package/dist/ts/gantt/renderer/virtual-content-render.ts +50 -0
  86. package/license +9 -9
  87. package/package.json +80 -80
  88. package/src/gantt/actions/cell-edit.js +2 -1
  89. package/src/gantt/actions/dialog-edit.js +2 -1
  90. package/src/gantt/actions/edit.js +11 -2
  91. package/src/gantt/actions/rowdragdrop.js +37 -15
  92. package/src/gantt/actions/taskbar-edit.js +24 -24
  93. package/src/gantt/base/date-processor.js +0 -1
  94. package/src/gantt/base/gantt-chart.js +9 -4
  95. package/src/gantt/base/gantt-model.d.ts +779 -779
  96. package/src/gantt/base/gantt.d.ts +27 -27
  97. package/src/gantt/base/gantt.js +22 -22
  98. package/src/gantt/base/splitter.js +1 -0
  99. package/src/gantt/base/task-processor.js +13 -13
  100. package/src/gantt/base/tree-grid.js +3 -1
  101. package/src/gantt/export/pdf-base/treegrid-layouter.js +13 -13
  102. package/src/gantt/export/pdf-connector-line.js +11 -11
  103. package/src/gantt/export/pdf-gantt.js +24 -24
  104. package/src/gantt/export/pdf-taskbar.js +11 -11
  105. package/src/gantt/export/pdf-treegrid.js +13 -13
  106. package/src/gantt/models/add-dialog-field-settings-model.d.ts +21 -21
  107. package/src/gantt/models/add-dialog-field-settings.js +19 -19
  108. package/src/gantt/models/day-working-time-model.d.ts +11 -11
  109. package/src/gantt/models/day-working-time.js +19 -19
  110. package/src/gantt/models/edit-dialog-field-settings-model.d.ts +21 -21
  111. package/src/gantt/models/edit-dialog-field-settings.js +19 -19
  112. package/src/gantt/models/edit-settings-model.d.ts +50 -50
  113. package/src/gantt/models/edit-settings.js +19 -19
  114. package/src/gantt/models/event-marker-model.d.ts +16 -16
  115. package/src/gantt/models/event-marker.js +19 -19
  116. package/src/gantt/models/filter-settings-model.d.ts +34 -34
  117. package/src/gantt/models/filter-settings.js +19 -19
  118. package/src/gantt/models/holiday-model.d.ts +21 -21
  119. package/src/gantt/models/holiday.js +19 -19
  120. package/src/gantt/models/label-settings-model.d.ts +16 -16
  121. package/src/gantt/models/label-settings.js +19 -19
  122. package/src/gantt/models/resource-fields-model.d.ts +21 -21
  123. package/src/gantt/models/resource-fields.js +19 -19
  124. package/src/gantt/models/search-settings-model.d.ts +56 -56
  125. package/src/gantt/models/search-settings.js +19 -19
  126. package/src/gantt/models/selection-settings-model.d.ts +35 -35
  127. package/src/gantt/models/selection-settings.js +19 -19
  128. package/src/gantt/models/sort-settings-model.d.ts +24 -24
  129. package/src/gantt/models/sort-settings.js +19 -19
  130. package/src/gantt/models/splitter-settings-model.d.ts +30 -30
  131. package/src/gantt/models/splitter-settings.js +19 -19
  132. package/src/gantt/models/task-fields-model.d.ts +110 -110
  133. package/src/gantt/models/task-fields.js +19 -19
  134. package/src/gantt/models/timeline-settings-model.d.ts +71 -71
  135. package/src/gantt/models/timeline-settings.js +19 -19
  136. package/src/gantt/models/tooltip-settings-model.d.ts +26 -26
  137. package/src/gantt/models/tooltip-settings.js +19 -19
  138. package/src/gantt/renderer/chart-rows.js +49 -37
  139. package/src/gantt/renderer/connector-line.js +22 -18
  140. package/src/gantt/renderer/event-marker.js +1 -0
  141. package/src/gantt/renderer/nonworking-day.js +13 -6
  142. package/src/gantt/renderer/timeline.d.ts +1 -0
  143. package/src/gantt/renderer/timeline.js +48 -12
  144. package/src/gantt/renderer/tooltip.js +11 -3
  145. package/styles/bootstrap-dark.css +442 -427
  146. package/styles/bootstrap.css +442 -433
  147. package/styles/bootstrap4.css +454 -479
  148. package/styles/bootstrap5-dark.css +457 -433
  149. package/styles/bootstrap5.css +457 -433
  150. package/styles/fabric-dark.css +438 -421
  151. package/styles/fabric.css +445 -428
  152. package/styles/fluent-dark.css +1938 -0
  153. package/styles/fluent-dark.scss +1 -0
  154. package/styles/fluent.css +1938 -0
  155. package/styles/fluent.scss +1 -0
  156. package/styles/gantt/_all.scss +2 -2
  157. package/styles/gantt/_bootstrap-dark-definition.scss +210 -156
  158. package/styles/gantt/_bootstrap-definition.scss +211 -157
  159. package/styles/gantt/_bootstrap4-definition.scss +213 -158
  160. package/styles/gantt/_bootstrap5-definition.scss +215 -162
  161. package/styles/gantt/_fabric-dark-definition.scss +211 -157
  162. package/styles/gantt/_fabric-definition.scss +211 -157
  163. package/styles/gantt/_fluent-dark-definition.scss +1 -0
  164. package/styles/gantt/_fluent-definition.scss +215 -162
  165. package/styles/gantt/_fusionnew-definition.scss +214 -0
  166. package/styles/gantt/_highcontrast-definition.scss +211 -157
  167. package/styles/gantt/_highcontrast-light-definition.scss +211 -157
  168. package/styles/gantt/_layout.scss +1446 -1027
  169. package/styles/gantt/_material-dark-definition.scss +212 -157
  170. package/styles/gantt/_material-definition.scss +212 -157
  171. package/styles/gantt/_material3-definition.scss +215 -0
  172. package/styles/gantt/_tailwind-definition.scss +215 -161
  173. package/styles/gantt/_theme.scss +702 -668
  174. package/styles/gantt/bootstrap-dark.css +442 -427
  175. package/styles/gantt/bootstrap.css +442 -433
  176. package/styles/gantt/bootstrap4.css +454 -479
  177. package/styles/gantt/bootstrap5-dark.css +457 -433
  178. package/styles/gantt/bootstrap5.css +457 -433
  179. package/styles/gantt/fabric-dark.css +438 -421
  180. package/styles/gantt/fabric.css +445 -428
  181. package/styles/gantt/fluent-dark.css +1938 -0
  182. package/styles/gantt/fluent-dark.scss +22 -0
  183. package/styles/gantt/fluent.css +1938 -0
  184. package/styles/gantt/fluent.scss +22 -0
  185. package/styles/gantt/highcontrast-light.css +405 -405
  186. package/styles/gantt/highcontrast.css +444 -456
  187. package/styles/gantt/icons/_bootstrap-dark.scss +124 -113
  188. package/styles/gantt/icons/_bootstrap.scss +124 -113
  189. package/styles/gantt/icons/_bootstrap4.scss +124 -113
  190. package/styles/gantt/icons/_bootstrap5.scss +124 -112
  191. package/styles/gantt/icons/_fabric-dark.scss +124 -112
  192. package/styles/gantt/icons/_fabric.scss +124 -112
  193. package/styles/gantt/icons/_fluent-dark.scss +1 -0
  194. package/styles/gantt/icons/_fluent.scss +124 -112
  195. package/styles/gantt/icons/_fusionnew.scss +120 -0
  196. package/styles/gantt/icons/_highcontrast.scss +124 -112
  197. package/styles/gantt/icons/_material-dark.scss +124 -112
  198. package/styles/gantt/icons/_material.scss +124 -112
  199. package/styles/gantt/icons/_material3.scss +124 -0
  200. package/styles/gantt/icons/_tailwind-dark.scss +124 -113
  201. package/styles/gantt/icons/_tailwind.scss +124 -113
  202. package/styles/gantt/material-dark.css +446 -417
  203. package/styles/gantt/material.css +445 -419
  204. package/styles/gantt/tailwind-dark.css +452 -482
  205. package/styles/gantt/tailwind.css +449 -479
  206. package/styles/highcontrast-light.css +405 -405
  207. package/styles/highcontrast.css +444 -456
  208. package/styles/material-dark.css +446 -417
  209. package/styles/material.css +445 -419
  210. package/styles/tailwind-dark.css +452 -482
  211. package/styles/tailwind.css +449 -479
@@ -0,0 +1,1025 @@
1
+ import { createElement, isNullOrUndefined, isObject, remove } from '@syncfusion/ej2-base';
2
+ import { Gantt } from '../base/gantt';
3
+ import * as cls from '../base/css-constants';
4
+ import { IGanttData, ITaskData, IConnectorLineObject, IPredecessor } from '../base/interface';
5
+ import { isScheduledTask } from '../base/utils';
6
+
7
+ /**
8
+ * To render the connector line in Gantt
9
+ */
10
+ export class ConnectorLine {
11
+ private parent: Gantt;
12
+ public dependencyViewContainer: HTMLElement;
13
+ private lineColor: string;
14
+ private lineStroke: number;
15
+ public tooltipTable: HTMLElement;
16
+ /**
17
+ * @hidden
18
+ */
19
+ public expandedRecords: IGanttData[];
20
+ constructor(ganttObj?: Gantt) {
21
+ this.expandedRecords = [];
22
+ this.parent = ganttObj;
23
+ this.dependencyViewContainer =
24
+ createElement('div', { className: cls.dependencyViewContainer });
25
+ this.initPublicProp();
26
+ }
27
+
28
+ /**
29
+ * To get connector line gap.
30
+ *
31
+ * @param {IConnectorLineObject} data .
32
+ * @returns {number} .
33
+ * @private
34
+ */
35
+ private getconnectorLineGap(data: IConnectorLineObject): number {
36
+ let width: number = 0;
37
+ width = (data.milestoneChild ?
38
+ ((this.parent.chartRowsModule.milestoneMarginTop / 2) + (this.parent.chartRowsModule.milestoneHeight / 2)) :
39
+ ((this.parent.chartRowsModule.taskBarMarginTop / 2) + (this.parent.chartRowsModule.taskBarHeight / 2)));
40
+ return width;
41
+ }
42
+
43
+ /**
44
+ * To initialize the public property.
45
+ *
46
+ * @returns {void}
47
+ * @private
48
+ */
49
+ public initPublicProp(): void {
50
+ this.lineColor = this.parent.connectorLineBackground;
51
+ this.lineStroke = (this.parent.connectorLineWidth) > 4 ? 4 : this.parent.connectorLineWidth;
52
+ this.createConnectorLineTooltipTable();
53
+ }
54
+
55
+ private getTaskbarMidpoint(isMilestone: boolean): number {
56
+ return Math.floor(isMilestone ?
57
+ (this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2)) :
58
+ (this.parent.chartRowsModule.taskBarMarginTop + (this.parent.chartRowsModule.taskBarHeight / 2))) + 1;
59
+ }
60
+
61
+ /**
62
+ * To connector line object collection.
63
+ *
64
+ * @param {IGanttData} parentGanttData .
65
+ * @param {IGanttData} childGanttData .
66
+ * @param {IPredecessor} predecessor .
67
+ * @returns {void}
68
+ * @private
69
+ */
70
+ public createConnectorLineObject(parentGanttData: IGanttData, childGanttData: IGanttData, predecessor: IPredecessor):
71
+ IConnectorLineObject {
72
+ const connectorObj: IConnectorLineObject = {} as IConnectorLineObject;
73
+ const updatedRecords: IGanttData[] = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
74
+ this.parent.flatData : this.expandedRecords;
75
+ const parentIndex: number = updatedRecords.indexOf(parentGanttData);
76
+ const childIndex: number = updatedRecords.indexOf(childGanttData);
77
+ const parentGanttRecord: ITaskData = parentGanttData.ganttProperties;
78
+ const childGanttRecord: ITaskData = childGanttData.ganttProperties;
79
+ const currentData: IGanttData[] = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
80
+ this.parent.currentViewData : this.parent.getExpandedRecords(this.parent.currentViewData);
81
+ connectorObj.parentIndexInCurrentView = currentData.indexOf(parentGanttData);
82
+ connectorObj.childIndexInCurrentView = currentData.indexOf(childGanttData);
83
+ const isVirtualScroll: boolean = this.parent.virtualScrollModule && this.parent.enableVirtualization;
84
+ if ((!isVirtualScroll && (connectorObj.parentIndexInCurrentView === -1 || connectorObj.childIndexInCurrentView === -1)) ||
85
+ connectorObj.parentIndexInCurrentView === -1 && connectorObj.childIndexInCurrentView === -1) {
86
+ return null;
87
+ } else {
88
+ connectorObj.parentLeft = parentGanttRecord.isMilestone ?
89
+ parentGanttRecord.left - (this.parent.chartRowsModule.milestoneHeight / 2) : parentGanttRecord.left;
90
+ connectorObj.childLeft = childGanttRecord.isMilestone ?
91
+ childGanttRecord.left - (this.parent.chartRowsModule.milestoneHeight / 2) : childGanttRecord.left;
92
+ connectorObj.parentWidth = parentGanttRecord.width === 0 || parentGanttRecord.isMilestone ?
93
+ (Math.floor(this.parent.chartRowsModule.milestoneHeight)) : parentGanttRecord.width;
94
+ connectorObj.childWidth = childGanttRecord.width === 0 || childGanttRecord.isMilestone ?
95
+ (Math.floor(this.parent.chartRowsModule.milestoneHeight)) : childGanttRecord.width;
96
+ connectorObj.parentIndex = parentIndex;
97
+ connectorObj.childIndex = childIndex;
98
+ const rowHeight: number = this.parent.ganttChartModule.getChartRows()[0] &&
99
+ this.parent.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;
100
+ connectorObj.rowHeight = rowHeight && !isNaN(rowHeight) ? rowHeight : this.parent.rowHeight;
101
+ connectorObj.type = predecessor.type;
102
+ const parentId: string = this.parent.viewType === 'ResourceView' ? parentGanttRecord.taskId : parentGanttRecord.rowUniqueID;
103
+ const childId: string = this.parent.viewType === 'ResourceView' ? childGanttRecord.taskId : childGanttRecord.rowUniqueID;
104
+ connectorObj.connectorLineId = 'parent' + parentId + 'child' + childId;
105
+ connectorObj.milestoneParent = parentGanttRecord.isMilestone ? true : false;
106
+ connectorObj.milestoneChild = childGanttRecord.isMilestone ? true : false;
107
+ if (isNullOrUndefined(isScheduledTask(parentGanttRecord)) || isNullOrUndefined(isScheduledTask(childGanttRecord))) {
108
+ return null;
109
+ } else {
110
+ return connectorObj;
111
+ }
112
+ }
113
+ }
114
+
115
+ /**
116
+ * To render connector line.
117
+ *
118
+ * @param {IConnectorLineObject} connectorLinesCollection .
119
+ * @returns {void}
120
+ * @private
121
+ */
122
+ public renderConnectorLines(connectorLinesCollection: IConnectorLineObject[]): void {
123
+ let connectorLine: string = '';
124
+ const ariaConnector : IConnectorLineObject[] = [];
125
+ for (let index: number = 0; index < connectorLinesCollection.length; index++) {
126
+ connectorLine = connectorLine + this.getConnectorLineTemplate(connectorLinesCollection[index]);
127
+ ariaConnector.push(connectorLinesCollection[index]);
128
+ }
129
+ this.dependencyViewContainer.innerHTML = connectorLine;
130
+ const childNodes: NodeList = this.parent.connectorLineModule.dependencyViewContainer.childNodes;
131
+ for (let i: number = 0; i < childNodes.length; i++) {
132
+ const innerChild: NodeList = childNodes[i].childNodes;
133
+ for (let j: number = 0; j < innerChild.length; j++) {
134
+ const ariaString: string = 'Connector Line ' + this.parent.connectorLineModule.generateAriaLabel(ariaConnector[i]);
135
+ (<HTMLElement>innerChild[j]).setAttribute('aria-label', ariaString);
136
+ }
137
+ }
138
+ this.parent.ganttChartModule.chartBodyContent.appendChild(this.dependencyViewContainer);
139
+ }
140
+
141
+ /**
142
+ * To get parent position.
143
+ *
144
+ * @param {IConnectorLineObject} data .
145
+ * @returns {void}
146
+ * @private
147
+ */
148
+ private getParentPosition(data: IConnectorLineObject): string {
149
+ if (data.parentIndex < data.childIndex) {
150
+ if (data.type === 'FF') {
151
+ if ((data.childLeft + data.childWidth) >= (data.parentLeft + data.parentWidth)) {
152
+ return 'FFType2';
153
+ } else {
154
+ return 'FFType1';
155
+ }
156
+ } else if ((data.parentLeft < data.childLeft) && (data.childLeft > (data.parentLeft + data.parentWidth + 25))) {
157
+ if (data.type === 'FS') {
158
+ return 'FSType1';
159
+ }
160
+ if (data.type === 'SF') {
161
+ return 'SFType1';
162
+ } else if (data.type === 'SS') {
163
+ return 'SSType2';
164
+ } else if (data.type === 'FF') {
165
+ return 'FFType2';
166
+ }
167
+ } else if ((data.parentLeft < data.childLeft && (data.childLeft < (data.parentLeft + data.parentWidth)))
168
+ || (data.parentLeft === data.childLeft || data.parentLeft > data.childLeft)) {
169
+ if (data.parentLeft > (data.childLeft + data.childWidth + 25)) {
170
+ if (data.type === 'SF') {
171
+ return 'SFType2';
172
+ }
173
+ }
174
+ if (data.parentLeft > data.childLeft) {
175
+ if (data.type === 'SS') {
176
+ return 'SSType1';
177
+ }
178
+ if (data.type === 'SF') {
179
+ return 'SFType1';
180
+ }
181
+ if (data.type === 'FF') {
182
+ return 'FFType1';
183
+ }
184
+ } else if ((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth)) {
185
+ if (data.type === 'FF') {
186
+ return 'FFType2';
187
+ }
188
+ }
189
+ if (data.type === 'FS') {
190
+ return 'FSType2';
191
+ } else if (data.type === 'SS') {
192
+ return 'SSType2';
193
+ } else if (data.type === 'FF') {
194
+ return 'FFType1';
195
+ } else if (data.type === 'SF') {
196
+ return 'SFType1';
197
+ }
198
+ } else if ((data.parentLeft) < data.childLeft) {
199
+
200
+ if (data.type === 'FS') {
201
+ return 'FSType2';
202
+ } else if (data.type === 'FF') {
203
+ return 'FFType2';
204
+ } else if (data.type === 'SS') {
205
+ return 'SSType2';
206
+ } else if (data.type === 'SF') {
207
+ return 'SFType1';
208
+ }
209
+ }
210
+ } else if (data.parentIndex > data.childIndex) {
211
+ if ((data.parentLeft < data.childLeft) && (data.childLeft > (data.parentLeft + data.parentWidth))) {
212
+ if (data.type === 'FS') {
213
+ if (30 >= (data.childLeft - (data.milestoneParent ?
214
+ (data.parentLeft + data.parentWidth + 4) : (data.parentLeft + data.parentWidth)))) {
215
+ return 'FSType3';
216
+ } else {
217
+ return 'FSType4';
218
+ }
219
+ }
220
+ if (data.parentLeft < data.childLeft || ((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth))) {
221
+ if (data.type === 'SS') {
222
+ return 'SSType4';
223
+ }
224
+ if (data.type === 'FF') {
225
+ return 'FFType4';
226
+ }
227
+ if (data.type === 'SF') {
228
+ return 'SFType4';
229
+ }
230
+ // eslint-disable-next-line
231
+ } else if ((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth)) {
232
+ if (data.type === 'FF') {
233
+ return 'FFType4';
234
+ }
235
+ }
236
+ } else if ((data.parentLeft < data.childLeft && (data.childLeft < (data.parentLeft + data.parentWidth)))
237
+ || (data.parentLeft === data.childLeft || data.parentLeft > data.childLeft)) {
238
+ if ((data.childLeft + data.childWidth) <= (data.parentLeft + data.parentWidth)) {
239
+ if (data.type === 'FF') {
240
+ return 'FFType3';
241
+ }
242
+ if (data.type === 'SF') {
243
+ if ((data.childLeft + data.childWidth + 25) < (data.parentLeft)) {
244
+ return 'SFType3';
245
+ } else {
246
+ return 'SFType4';
247
+ }
248
+ }
249
+ if (data.type === 'SS') {
250
+ if (data.childLeft <= data.parentLeft) {
251
+ return 'SSType3';
252
+ } else {
253
+ return 'SSType4';
254
+ }
255
+ }
256
+ } else if ((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth)) {
257
+ if (data.type === 'FF') {
258
+ return 'FFType4';
259
+ }
260
+ if (data.type === 'SF') {
261
+ return 'SFType4';
262
+ }
263
+ if (data.type === 'SS') {
264
+ if (data.childLeft <= data.parentLeft) {
265
+ return 'SSType3';
266
+ } else {
267
+ return 'SSType4';
268
+ }
269
+ }
270
+ }
271
+ if (data.type === 'FS') {
272
+ return 'FSType3';
273
+ }
274
+ } else if (data.parentLeft < data.childLeft) {
275
+ if (data.type === 'FS') {
276
+ return 'FSType3';
277
+ }
278
+ if (data.type === 'SS') {
279
+ return 'SSType4';
280
+ }
281
+ if (data.type === 'FF') {
282
+ return 'FFType4';
283
+ }
284
+ if (data.type === 'SF') {
285
+ return 'SFType4';
286
+ }
287
+ }
288
+ }
289
+ return null;
290
+ }
291
+
292
+ /**
293
+ * To get line height.
294
+ *
295
+ * @param {IConnectorLineObject} data .
296
+ * @returns {void}
297
+ * @private
298
+ */
299
+ private getHeightValue(data: IConnectorLineObject): number {
300
+ return (data.parentIndex * data.rowHeight) > (data.childIndex * data.rowHeight) ?
301
+ ((data.parentIndex * data.rowHeight) - (data.childIndex * data.rowHeight)) :
302
+ ((data.childIndex * data.rowHeight) - (data.parentIndex * data.rowHeight));
303
+ }
304
+
305
+ /**
306
+ * To get sstype2 inner element width.
307
+ *
308
+ * @param {IConnectorLineObject} data .
309
+ * @returns {void}
310
+ * @private
311
+ */
312
+ private getInnerElementWidthSSType2(data: IConnectorLineObject): number {
313
+ if (data.parentLeft === data.childLeft) {
314
+ return 10;
315
+ }
316
+ return (data.childLeft - data.parentLeft);
317
+ }
318
+
319
+ /**
320
+ * To get sstype2 inner element left.
321
+ *
322
+ * @param {IConnectorLineObject} data .
323
+ * @returns {void}
324
+ * @private
325
+ */
326
+ private getInnerElementLeftSSType2(data: IConnectorLineObject): number {
327
+ if (data.parentLeft === data.childLeft) {
328
+ return (data.parentLeft - 20);
329
+ }
330
+ return (data.parentLeft - 10);
331
+ }
332
+
333
+ /**
334
+ * To get sstype2 inner child element width.
335
+ *
336
+ * @param {IConnectorLineObject} data .
337
+ * @returns {void}
338
+ * @private
339
+ */
340
+ private getInnerChildWidthSSType2(data: IConnectorLineObject): number {
341
+ if ((data.parentLeft + data.parentWidth) < data.childLeft) {
342
+ return 10;
343
+ }
344
+ if (data.parentLeft === data.childLeft) {
345
+ return 20;
346
+ }
347
+ if ((data.parentLeft + data.parentWidth) >= data.childLeft) {
348
+ return 10;
349
+ }
350
+ return (data.childLeft - data.parentLeft);
351
+ }
352
+
353
+ private getBorderStyles(cssType: string, unit: number): string {
354
+ const borderWidth: string = 'border-' + cssType + '-width:' + unit + 'px;';
355
+ const borderStyle: string = 'border-' + cssType + '-style:solid;';
356
+ const borderColor: string = !isNullOrUndefined(this.lineColor) ? 'border-' + cssType + '-color:' + this.lineColor + ';' : '';
357
+ return (borderWidth + borderStyle + borderColor);
358
+ }
359
+
360
+ /**
361
+ * To get connector line template.
362
+ *
363
+ * @param {IConnectorLineObject} data .
364
+ * @returns {void}
365
+ * @private
366
+ */
367
+ public getConnectorLineTemplate(data: IConnectorLineObject): string {
368
+
369
+ const setInnerChildWidthSSType2: number = this.getInnerChildWidthSSType2(data);
370
+ const setInnerElementWidthSSType2: number = this.getInnerElementWidthSSType2(data);
371
+ const setInnerElementLeftSSType2: number = this.getInnerElementLeftSSType2(data);
372
+ const height: number = this.getHeightValue(data);
373
+ const isMilestoneParent: boolean = data.milestoneParent ? true : false;
374
+ const isMilestone: boolean = data.milestoneChild ? true : false;
375
+ let connectorContainer: string = '';
376
+ const isVirtual: boolean = this.parent.virtualScrollModule && this.parent.enableVirtualization;
377
+ const connectorLine: { top: number, height: number } = this.getPosition(data, this.getParentPosition(data), height);
378
+ let isMilestoneValue = 0;
379
+ if(this.parent.renderBaseline){
380
+ isMilestoneValue = (data.milestoneParent && data.milestoneChild) ? 0 : data.milestoneParent ? -5: data.milestoneChild ? 5 : 0;
381
+ }
382
+ const heightValue: number = isVirtual ? connectorLine.height : (height + isMilestoneValue);
383
+ if (this.getParentPosition(data)) {
384
+ connectorContainer = '<div id="ConnectorLine' + data.connectorLineId + '" style="background-color:black">';
385
+ let div: string = '<div class="' + cls.connectorLineContainer +
386
+ '" tabindex="-1" style="';
387
+ const eLine: string = '<div class="' + cls.connectorLine + '" style="' +
388
+ (!isNullOrUndefined(this.lineColor) ? 'outline-color:' + this.lineColor + ';' : '');
389
+ const rightArrow: string = '<div class="' + cls.connectorLineRightArrow + '" style="' +
390
+ (!isNullOrUndefined(this.lineColor) ? 'outline-color:' + this.lineColor + ';' : '');
391
+ const leftArrow: string = '<div class="' + cls.connectorLineLeftArrow + '" style="' +
392
+ (!isNullOrUndefined(this.lineColor) ? 'outline-color:' + this.lineColor + ';' : '');
393
+ const duplicateStingOne: string = leftArrow + (isMilestone ? 'left:0px;' : '') +
394
+ this.getBorderStyles('right', 10) +
395
+ 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;border-bottom-width:' + (5 + this.lineStroke) + 'px;' +
396
+ 'border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div>';
397
+ const duplicateStingTwo: string = this.getBorderStyles('left', 10) +
398
+ 'top:' + (-6) + 'px;border-bottom-width:' + (5 + this.lineStroke) + 'px;' +
399
+ 'border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div>';
400
+ const duplicateStingThree: string = this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>' + eLine +
401
+ 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
402
+ this.getBorderStyles('top', (heightValue - (this.lineStroke - 1))) + 'position:relative;"></div>';
403
+ const duplicateStingFour: string = leftArrow + 'left:' +
404
+ (((data.childLeft + data.childWidth) - (data.parentLeft)) + 10) + 'px;' +
405
+ this.getBorderStyles('right', 10);
406
+ const duplicateStingFive: string = 'top:' + (-(6 + (5 + this.lineStroke) + (this.lineStroke / 2))) + 'px;' +
407
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
408
+
409
+ if (this.getParentPosition(data) === 'FSType1') {
410
+ div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
411
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
412
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType1">';
413
+
414
+ div = div + eLine;
415
+ div = div + 'left:' + (isMilestoneParent ? -1 : 0) + 'px;width:' + (isMilestoneParent ?
416
+ ((((data.childLeft - (data.parentLeft + data.parentWidth + 10)) + this.lineStroke) - 10) + 1) :
417
+ (((data.childLeft - (data.parentLeft + data.parentWidth + 10)) + this.lineStroke) - 10)) + 'px;' +
418
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
419
+
420
+ div = div + eLine;
421
+ div = div + 'left:' + ((data.childLeft - (data.parentLeft + data.parentWidth + 10)) - 10) + 'px;' +
422
+ 'width:0px;' + this.getBorderStyles('right', this.lineStroke) +
423
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) + 'position:relative;"></div>';
424
+
425
+ div = div + eLine;
426
+ div = div + 'left:' + ((data.childLeft - (data.parentLeft + data.parentWidth + 10)) - 10) + 'px;width:10px;' +
427
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
428
+
429
+ div = div + rightArrow;
430
+ div = div + 'left:' + (data.childLeft - (data.parentLeft + data.parentWidth + 10)) + 'px;' +
431
+ this.getBorderStyles('left', 10) + 'top:' + (-6 - this.lineStroke) + 'px;border-bottom-width:' + (5 + this.lineStroke) +
432
+ 'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
433
+ }
434
+
435
+
436
+ if (this.getParentPosition(data) === 'FSType2') {
437
+ div = div + 'left:' + data.parentLeft + 'px;top:' + (isVirtual ? connectorLine.top : ((data.parentIndex * data.rowHeight) +
438
+ this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
439
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType2">';
440
+
441
+ div = div + eLine;
442
+ div = div + 'left:' + (isMilestoneParent ? data.parentWidth - 1 : data.parentWidth) + 'px;width:' +
443
+ (isMilestoneParent ? 11 : 10) + 'px;' +
444
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
445
+
446
+ div = div + eLine;
447
+ div = div + 'left:' + (data.parentWidth + 10 - this.lineStroke) + 'px;' +
448
+ this.getBorderStyles('left', this.lineStroke) + 'width:0px;' +
449
+ this.getBorderStyles(
450
+ 'top', (heightValue - this.getconnectorLineGap(data) - this.lineStroke)) + 'position:relative;"></div>';
451
+
452
+ div = div + eLine;
453
+ div = div + 'left:' + (data.parentWidth - (((data.parentLeft + data.parentWidth) - data.childLeft) + 20)) + 'px;' +
454
+ 'width:' + (((data.parentLeft + data.parentWidth) - data.childLeft) + 30) + 'px;' +
455
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
456
+
457
+ div = div + eLine;
458
+ div = div + 'left:' + (data.parentWidth - (((data.parentLeft +
459
+ data.parentWidth) - data.childLeft) + 20)) + 'px;width:0px;' +
460
+ this.getBorderStyles('top', (this.getconnectorLineGap(data) - this.lineStroke)) +
461
+ this.getBorderStyles('left', this.lineStroke) + 'position:relative;"></div>';
462
+
463
+ div = div + eLine;
464
+ div = div + 'left:' + (data.parentWidth - (((data.parentLeft +
465
+ data.parentWidth) - data.childLeft) + 20)) + 'px;width:10px;' +
466
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
467
+
468
+ div = div + rightArrow;
469
+ div = div + 'left:' + (data.parentWidth - (((data.parentLeft + data.parentWidth) - data.childLeft) + 10)) + 'px;' +
470
+ this.getBorderStyles('left', 10) + 'border-bottom-width:' + (5 + this.lineStroke) + 'px;' +
471
+ 'border-top-width:' + (5 + this.lineStroke) + 'px;top:' + (-6 - this.lineStroke) +
472
+ 'px;width:0;height:0;position:relative;"></div></div>';
473
+ }
474
+
475
+ if (this.getParentPosition(data) === 'FSType3') {
476
+ div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine.top :
477
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
478
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType3">';
479
+
480
+ div = div + rightArrow;
481
+ div = div + 'left:10px;' + this.getBorderStyles('left', 10) +
482
+ 'border-bottom-width:' + (5 + this.lineStroke) + 'px;border-top-width:' + (5 + this.lineStroke) + 'px;' +
483
+ 'top:' + (-6) + 'px;width:0;height:0;position:relative;"></div>';
484
+
485
+ div = div + eLine;
486
+ div = div + 'width:10px;' + this.getBorderStyles('top', this.lineStroke) +
487
+ 'position:relative;top:' + (-(6 + (5 + this.lineStroke) + Math.round(this.lineStroke / 2))) + 'px;"></div>';
488
+
489
+ div = div + eLine;
490
+ div = div + 'width:' + this.lineStroke + 'px;' + this.getBorderStyles(
491
+ 'top', (heightValue - this.getconnectorLineGap(data) - this.lineStroke + 1)) +
492
+ 'position:relative;top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;"></div>';
493
+
494
+ div = div + eLine;
495
+ div = div + 'width:' + (((data.parentLeft + data.parentWidth) - data.childLeft) + 30) + 'px;' +
496
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;top:' +
497
+ (- (13 + ((this.lineStroke - 1) * 2))) + 'px;"></div>';
498
+
499
+ div = div + eLine;
500
+ div = div + 'left:' + (((data.parentLeft + data.parentWidth) - data.childLeft) + (30 - this.lineStroke)) +
501
+ 'px;width:0px;' + 'height:' + (this.getconnectorLineGap(data) - this.lineStroke) + 'px;' +
502
+ this.getBorderStyles('left', this.lineStroke) + 'position:relative;' +
503
+ 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;"></div>';
504
+
505
+ div = div + eLine;
506
+ div = div + (isMilestoneParent ? 'left:' + (((data.parentLeft +
507
+ data.parentWidth) - data.childLeft) + (18 - this.lineStroke)) + 'px;width:' + (12 + this.lineStroke) + 'px;' : 'left:' +
508
+ (((data.parentLeft + data.parentWidth) - data.childLeft) + 20) + 'px;width:10px;') +
509
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;top:' +
510
+ (- (13 + ((this.lineStroke - 1) * 2))) + 'px;"></div></div>';
511
+ }
512
+
513
+ if (this.getParentPosition(data) === 'FSType4') {
514
+ div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
515
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
516
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType4">';
517
+
518
+ div = div + rightArrow;
519
+ div = div + 'left:' + (data.childLeft - (data.parentLeft + data.parentWidth + 10)) + 'px;' +
520
+ this.getBorderStyles('left', 10) + 'top:' + (-6) + 'px;' +
521
+ 'border-bottom-width:' + (5 + this.lineStroke) + 'px;border-top-width:' +
522
+ (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div>';
523
+
524
+ div = div + eLine;
525
+ div = div + 'left:' + (data.childLeft - (data.parentLeft + data.parentWidth) - 20) +
526
+ 'px;top:' + (-(6 + (5 + this.lineStroke) + Math.round(this.lineStroke / 2))) + 'px;width:10px;' +
527
+ this.getBorderStyles('top', this.lineStroke) +
528
+ 'position:relative;"></div>';
529
+
530
+ div = div + eLine;
531
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;left:' +
532
+ (data.childLeft - (data.parentLeft + data.parentWidth) - 20) + 'px;width:0px;' +
533
+ this.getBorderStyles('left', this.lineStroke) +
534
+ this.getBorderStyles('top', (heightValue - this.lineStroke + 1)) + 'position:relative;"></div>';
535
+
536
+ div = div + eLine;
537
+ div = div + (isMilestoneParent ? 'left:-1px;' : '') + 'top:' +
538
+ (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:' +
539
+ (isMilestoneParent ? ((data.childLeft - (data.parentLeft + data.parentWidth + 20) + 1) + this.lineStroke) :
540
+ ((data.childLeft - (data.parentLeft + data.parentWidth + 20)) + this.lineStroke)) + 'px;' +
541
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
542
+ }
543
+
544
+ if (this.getParentPosition(data) === 'SSType4') {
545
+ div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine.top :
546
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
547
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType4">';
548
+
549
+ div = div + rightArrow;
550
+ div = div + 'left:' + (data.childLeft - data.parentLeft) + 'px;' + duplicateStingTwo;
551
+
552
+ div = div + eLine;
553
+ div = div + 'top:' + (-(6 + (5 + this.lineStroke) + (this.lineStroke / 2))) + 'px;width:' +
554
+ (data.childLeft - data.parentLeft) + 'px;' + duplicateStingThree;
555
+
556
+ div = div + eLine;
557
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:10px;' +
558
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
559
+ }
560
+
561
+ if (this.getParentPosition(data) === 'SSType3') {
562
+ div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine.top :
563
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
564
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType3">';
565
+
566
+ div = div + rightArrow;
567
+ div = div + 'left:10px;' + duplicateStingTwo;
568
+
569
+ div = div + eLine;
570
+ div = div + 'top:' + (-(6 + (5 + this.lineStroke) + (this.lineStroke / 2))) + 'px;width:10px;' + duplicateStingThree;
571
+
572
+ div = div + eLine;
573
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:' +
574
+ (data.parentLeft - data.childLeft + 21) + 'px;' +
575
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
576
+ }
577
+
578
+ if (this.getParentPosition(data) === 'SSType2') {
579
+ div = div + 'left:' + setInnerElementLeftSSType2 + 'px;top:' + (isVirtual ? connectorLine.top :
580
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
581
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType2">';
582
+
583
+ div = div + eLine;
584
+ div = div + 'width:' + (setInnerChildWidthSSType2 + 1) + 'px;' +
585
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
586
+
587
+ div = div + eLine;
588
+ div = div + 'width:0px;' + this.getBorderStyles('left', this.lineStroke) +
589
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) + 'position:relative;"></div>';
590
+
591
+ div = div + eLine;
592
+ div = div + 'width:' + setInnerElementWidthSSType2 + 'px;' +
593
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
594
+
595
+ div = div + rightArrow;
596
+ div = div + 'left:' + setInnerElementWidthSSType2 + 'px;' +
597
+ this.getBorderStyles('left', 10) + 'top:' + (-6 - this.lineStroke) + 'px;' +
598
+ 'border-bottom-width:' + (5 + this.lineStroke) + 'px;border-top-width:' +
599
+ (5 + this.lineStroke) + 'px;width:0;' +
600
+ 'height:0;position:relative;"></div></div>';
601
+ }
602
+
603
+ if (this.getParentPosition(data) === 'SSType1') {
604
+ div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine.top :
605
+ ((data.parentIndex * data.rowHeight) +
606
+ this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
607
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType1">';
608
+
609
+ div = div + eLine;
610
+ div = div + 'width:' + (data.parentLeft - data.childLeft + 21) + 'px;' +
611
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
612
+
613
+ div = div + eLine;
614
+ div = div + 'width:0px;' + this.getBorderStyles('left', this.lineStroke) +
615
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) + 'position:relative;"></div>';
616
+
617
+ div = div + eLine;
618
+ div = div + 'width:10px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
619
+
620
+ div = div + rightArrow;
621
+ div = div + 'left:10px;' + this.getBorderStyles('left', 10) +
622
+ 'top:' + (-6 - this.lineStroke) + 'px;border-bottom-width:' + (5 + this.lineStroke) + 'px;' +
623
+ 'border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
624
+ }
625
+
626
+ if (this.getParentPosition(data) === 'FFType1') {
627
+ div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
628
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
629
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType1">';
630
+
631
+ div = div + eLine;
632
+ div = div + 'left:' + (isMilestoneParent ? (((data.parentLeft + data.parentWidth) -
633
+ (data.childLeft + data.childWidth)) - 1) : ((data.parentLeft + data.parentWidth) -
634
+ (data.childLeft + data.childWidth))) + 'px;' +
635
+ 'width:' + (isMilestoneParent ? (21 + this.lineStroke) : (20 + this.lineStroke)) + 'px;' +
636
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
637
+
638
+ div = div + eLine;
639
+ div = div + 'left:' + (((data.parentLeft + data.parentWidth) -
640
+ (data.childLeft + data.childWidth)) + 20) + 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
641
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) + 'position:relative;"></div>';
642
+
643
+ div = div + eLine;
644
+ div = div + 'left:' + (isMilestone ? 4 : 10) + 'px;width:' + (isMilestone ?
645
+ (((data.parentLeft + data.parentWidth) - (data.childLeft + data.childWidth)) + (16 + this.lineStroke)) :
646
+ (((data.parentLeft + data.parentWidth) - (data.childLeft + data.childWidth)) + (10 + this.lineStroke))) + 'px;' +
647
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
648
+
649
+ div = div + leftArrow;
650
+ div = div + (isMilestone ? 'left:0px;' : '') + this.getBorderStyles('right', 10) +
651
+ 'top:' + (-6 - this.lineStroke) + 'px;border-bottom-width:' + (5 + this.lineStroke) + 'px;' +
652
+ 'border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
653
+ }
654
+
655
+ if (this.getParentPosition(data) === 'FFType2') {
656
+ div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
657
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
658
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType2">';
659
+
660
+ div = div + eLine;
661
+ div = div + (isMilestoneParent ? 'left:-1px;' : '') + 'width:' +
662
+ (isMilestoneParent ? (((data.childLeft + data.childWidth) - (data.parentLeft + data.parentWidth)) +
663
+ (21 + this.lineStroke)) : (((data.childLeft + data.childWidth) -
664
+ (data.parentLeft + data.parentWidth)) + (20 + this.lineStroke))) + 'px;' +
665
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
666
+
667
+ div = div + eLine;
668
+ div = div + 'left:' + (((data.childLeft + data.childWidth) - (data.parentLeft + data.parentWidth)) + 20) +
669
+ 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
670
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) +
671
+ 'position:relative;"></div>';
672
+
673
+ div = div + eLine;
674
+ div = div + 'left:' + (isMilestone ? (((data.childLeft + data.childWidth) - (data.parentLeft + data.parentWidth)) + 4) :
675
+ (((data.childLeft + data.childWidth) - (data.parentLeft + data.parentWidth)) + 10)) + 'px;' +
676
+ 'width:' + (isMilestone ? (16 + this.lineStroke) : (10 + this.lineStroke)) + 'px;' +
677
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
678
+
679
+ div = div + leftArrow;
680
+ div = div + 'left:' + ((data.childLeft + data.childWidth) - (data.parentLeft + data.parentWidth)) + 'px;' +
681
+ this.getBorderStyles('right', 10) + 'top:' + (-6 - this.lineStroke) + 'px;' +
682
+ 'border-bottom-width:' + (5 + this.lineStroke) + 'px;border-top-width:' + (5 + this.lineStroke) +
683
+ 'px;width:0;height:0;position:relative;"></div></div>';
684
+ }
685
+
686
+ if (this.getParentPosition(data) === 'FFType3') {
687
+ div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
688
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
689
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType3">';
690
+
691
+ div = div + duplicateStingOne;
692
+
693
+ div = div + eLine;
694
+ div = div + (isMilestone ? ('left:4px;width:' +
695
+ (((data.parentLeft + data.parentWidth) - (data.childLeft + data.childWidth)) + 16)) :
696
+ ('left:10px;width:' + (((data.parentLeft + data.parentWidth) -
697
+ (data.childLeft + data.childWidth)) + 10))) + 'px;top:' + (-(6 + (5 + this.lineStroke) +
698
+ (this.lineStroke / 2))) + 'px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
699
+
700
+ div = div + eLine;
701
+ div = div + 'left:' + (((data.parentLeft + data.parentWidth) - (data.childLeft + data.childWidth)) + 20) +
702
+ 'px;top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;' +
703
+ 'width:0px;' + this.getBorderStyles('left', this.lineStroke) +
704
+ this.getBorderStyles('top', (heightValue - this.lineStroke + 1)) + 'position:relative;"></div>';
705
+
706
+ div = div + eLine;
707
+ div = div + (isMilestoneParent ? ('left:' + (((data.parentLeft + data.parentWidth) -
708
+ (data.childLeft + data.childWidth)) - 1) + 'px;width:21') : ('left:' + ((data.parentLeft + data.parentWidth) -
709
+ (data.childLeft + data.childWidth)) + 'px;width:20')) +
710
+ 'px;top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;' +
711
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
712
+ }
713
+
714
+ if (this.getParentPosition(data) === 'FFType4') {
715
+ div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
716
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
717
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType4">';
718
+
719
+ div = div + leftArrow;
720
+ div = div + ('left:' + ((data.childLeft + data.childWidth) -
721
+ (data.parentLeft + data.parentWidth))) + 'px;' +
722
+ this.getBorderStyles('right', 10) + 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;' +
723
+ 'border-bottom-width:' + (5 + this.lineStroke) +
724
+ 'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;' +
725
+ 'position:relative;"></div>';
726
+
727
+ div = div + eLine;
728
+ div = div + (isMilestone ? ('left:' + (((data.childLeft + data.childWidth) -
729
+ (data.parentLeft + data.parentWidth)) + 4) +
730
+ 'px;width:' + (16 + this.lineStroke)) : ('left:' + (((data.childLeft + data.childWidth) -
731
+ (data.parentLeft + data.parentWidth)) + 10) + 'px;width:' + (10 + this.lineStroke))) +
732
+ 'px;' + duplicateStingFive;
733
+
734
+ div = div + eLine;
735
+ div = div + 'left:' + (((data.childLeft + data.childWidth) -
736
+ (data.parentLeft + data.parentWidth)) + 20) + 'px;top:' + (- (13 + ((this.lineStroke - 1) * 2))) +
737
+ 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
738
+ this.getBorderStyles('top', (heightValue - this.lineStroke + 1)) + 'position:relative;"></div>';
739
+
740
+ div = div + eLine;
741
+ div = div + (isMilestoneParent ? ('left:-1px;width:' + (((data.childLeft + data.childWidth) -
742
+ (data.parentLeft + data.parentWidth)) + (21 + this.lineStroke))) : ('width:' + (((data.childLeft + data.childWidth) -
743
+ (data.parentLeft + data.parentWidth)) + (20 + this.lineStroke)))) + 'px;top:' +
744
+ (- (13 + ((this.lineStroke - 1) * 2))) + 'px;' +
745
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
746
+ }
747
+
748
+ if (this.getParentPosition(data) === 'SFType4') {
749
+ div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine.top :
750
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;width:1px;' +
751
+ 'height:' + heightValue + 'px;position:absolute" data-connectortype="SFType4">';
752
+
753
+ div = div + duplicateStingFour + 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;' +
754
+ 'border-bottom-width:' + (5 + this.lineStroke) +
755
+ 'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;' +
756
+ 'position:relative;"></div>';
757
+
758
+ div = div + eLine;
759
+ div = div + 'left:' + (isMilestone ? ((((data.childLeft + data.childWidth) - (data.parentLeft)) + (14 + this.lineStroke)) +
760
+ 'px;width:16') : ((((data.childLeft + data.childWidth) - (data.parentLeft)) + 20) + 'px;width:' +
761
+ (10 + this.lineStroke))) + 'px;' + duplicateStingFive;
762
+
763
+ div = div + eLine;
764
+ div = div + 'left:' + (((data.childLeft + data.childWidth) - (data.parentLeft)) + 30) + 'px;top:' +
765
+ (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
766
+ this.getBorderStyles(
767
+ 'top', (heightValue - this.getconnectorLineGap(data) - (this.lineStroke - 1))) + 'position:relative;"></div>';
768
+
769
+ div = div + eLine;
770
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:' +
771
+ (((data.childLeft + data.childWidth) - (data.parentLeft)) + (30 + this.lineStroke)) + 'px;' +
772
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
773
+
774
+ div = div + eLine;
775
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:0px;' +
776
+ this.getBorderStyles('left', this.lineStroke) +
777
+ this.getBorderStyles('top', (this.getconnectorLineGap(data) - this.lineStroke)) + 'position:relative;"></div>';
778
+
779
+ div = div + eLine;
780
+ div = div + 'top:' + (- (13 + ((this.lineStroke - 1) * 2))) + 'px;width:11px;' +
781
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
782
+ }
783
+
784
+ if (this.getParentPosition(data) === 'SFType3') {
785
+ div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
786
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
787
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType3">';
788
+
789
+ div = div + duplicateStingOne;
790
+
791
+ div = div + eLine;
792
+ div = div + (isMilestone ? 'left:4px;width:' + (16 + this.lineStroke) : 'left:10px;width:' +
793
+ (10 + this.lineStroke)) + 'px;top:' + (-(13 + ((this.lineStroke - 1) * 2) - 1)) + 'px;' +
794
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
795
+
796
+ div = div + eLine;
797
+ div = div + 'left:20px;top:' + (-(13 + ((this.lineStroke - 1) * 2))) + 'px;width:0px;' +
798
+ this.getBorderStyles('left', this.lineStroke) +
799
+ this.getBorderStyles('top', (heightValue - (this.lineStroke - 1))) + 'position:relative;"></div>';
800
+
801
+ div = div + eLine;
802
+ div = div + 'left:20px;top:' + (-(13 + ((this.lineStroke - 1) * 2))) + 'px;width:' +
803
+ ((data.parentLeft - (data.childLeft + data.childWidth + 20)) + this.lineStroke) + 'px;' +
804
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div></div>';
805
+ }
806
+
807
+ if (this.getParentPosition(data) === 'SFType1') {
808
+ div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine.top :
809
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
810
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType1">';
811
+
812
+ div = div + eLine;
813
+ div = div + 'width:11px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
814
+
815
+ div = div + eLine;
816
+ div = div + 'width:0px;' + this.getBorderStyles('left', this.lineStroke) +
817
+ this.getBorderStyles(
818
+ 'top', (heightValue - this.getconnectorLineGap(data) - this.lineStroke)) + 'position:relative;"></div>';
819
+
820
+ div = div + eLine;
821
+ div = div + 'width:' + (((data.childLeft + data.childWidth) - (data.parentLeft)) + (30 + this.lineStroke)) + 'px;' +
822
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
823
+
824
+ div = div + eLine;
825
+ div = div + 'left:' + (((data.childLeft + data.childWidth) - (data.parentLeft)) + 30) +
826
+ 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
827
+ this.getBorderStyles('top', (this.getconnectorLineGap(data) - this.lineStroke)) + 'position:relative;"></div>';
828
+
829
+ div = div + eLine;
830
+ div = div + (isMilestone ? ('left:' + (((data.childLeft + data.childWidth) -
831
+ (data.parentLeft)) + 15) + 'px;width:' + (15 + this.lineStroke)) : ('left:' +
832
+ (((data.childLeft + data.childWidth) - (data.parentLeft)) + 20) + 'px;width:' + (10 + this.lineStroke))) + 'px;' +
833
+ this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
834
+
835
+ div = div + duplicateStingFour + 'top:' + (-6 - this.lineStroke) + 'px;' +
836
+ 'border-bottom-width:' + (5 + this.lineStroke) + 'px;border-top-width:' +
837
+ (5 + this.lineStroke) + 'px;position:relative;"></div></div>';
838
+ }
839
+
840
+ if (this.getParentPosition(data) === 'SFType2') {
841
+ div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine.top :
842
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
843
+ 'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType2">';
844
+
845
+ div = div + eLine;
846
+ div = div + 'left:' + (((data.parentLeft) - (data.childLeft + data.childWidth)) - 10) +
847
+ 'px;width:11px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
848
+
849
+ div = div + eLine;
850
+ div = div + 'left:' + (((data.parentLeft) - (data.childLeft + data.childWidth)) - 10) +
851
+ 'px;width:0px;' + this.getBorderStyles('left', this.lineStroke) +
852
+ this.getBorderStyles('top', (heightValue - this.lineStroke)) + 'position:relative;"></div>';
853
+
854
+ div = div + eLine;
855
+ div = div + (isMilestone ? ('left:4px;width:' + (((data.parentLeft) - (data.childLeft + data.childWidth))
856
+ - (14 - this.lineStroke))) : ('left:10px;width:' + (((data.parentLeft) -
857
+ (data.childLeft + data.childWidth)) - (20 - this.lineStroke)))) +
858
+ 'px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
859
+
860
+ div = div + leftArrow;
861
+ div = div + 'left:0px;' + this.getBorderStyles('right', 10) +
862
+ 'top:' + (-6 - this.lineStroke) + 'px;border-bottom-width:' + (5 + this.lineStroke) +
863
+ 'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
864
+ }
865
+
866
+ connectorContainer += div;
867
+ connectorContainer += '</div>';
868
+ }
869
+ return connectorContainer;
870
+ }
871
+ /**
872
+ * @param {IConnectorLineObject} data .
873
+ * @param {string} type .
874
+ * @param {number} heightValue .
875
+ * @returns {number} .
876
+ * @private
877
+ */
878
+ private getPosition(data: IConnectorLineObject, type: string, heightValue: number): { top: number, height: number } {
879
+ let topPosition: number = 0; let lineHeight: number = 0;
880
+ if (this.parent.virtualScrollModule && this.parent.enableVirtualization) {
881
+ const isMilestoneParent: boolean = data.milestoneParent ? true : false;
882
+ const isMilestone: boolean = data.milestoneChild ? true : false;
883
+ const midPointParent: number = this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1);
884
+ const midPoint: number = this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1);
885
+ const isParentIndex: boolean = data.parentIndexInCurrentView !== -1;
886
+ const isChildIndex: boolean = data.childIndexInCurrentView !== -1;
887
+ const lastRowIndex: number = this.parent.currentViewData.length - 1;
888
+ if (type === 'SSType1' || type === 'SSType2' || type === 'FFType1' || type === 'FFType2' || type === 'SFType2') {
889
+ topPosition = isParentIndex ? (data.parentIndexInCurrentView * data.rowHeight) + midPointParent : 0;
890
+ lineHeight = (isParentIndex && isChildIndex) ? heightValue : isChildIndex ?
891
+ (data.childIndexInCurrentView * data.rowHeight) + midPointParent : (lastRowIndex * data.rowHeight) + midPointParent;
892
+ } else if (type === 'SSType3' || type === 'SSType4' || type === 'FSType4' || type === 'FFType3' ||
893
+ type === 'FFType4' || type === 'SFType4' || type === 'SFType3') {
894
+ topPosition = isChildIndex ? (data.childIndexInCurrentView * data.rowHeight) + midPoint : 0;
895
+ lineHeight = (isParentIndex && isChildIndex) ? heightValue : isParentIndex ?
896
+ (data.parentIndexInCurrentView * data.rowHeight) + midPoint :
897
+ (lastRowIndex * data.rowHeight) + midPoint;
898
+ } else if (type === 'FSType3') {
899
+ topPosition = isChildIndex ? (data.childIndexInCurrentView * data.rowHeight) + midPointParent : 0;
900
+ lineHeight = (isParentIndex && isChildIndex) ? heightValue : isParentIndex ?
901
+ (data.parentIndexInCurrentView * data.rowHeight) + midPoint :
902
+ (lastRowIndex * data.rowHeight) + midPointParent;
903
+ } else if (type === 'SFType1' || type === 'FSType1' || type === 'FSType2') {
904
+ topPosition = isParentIndex ? (data.parentIndexInCurrentView * data.rowHeight) + midPoint : 0;
905
+ lineHeight = (isParentIndex && isChildIndex) ? heightValue : isChildIndex ?
906
+ (data.childIndexInCurrentView * data.rowHeight) + midPoint :
907
+ (lastRowIndex * data.rowHeight) + midPoint;
908
+ }
909
+ }
910
+ return { top: topPosition, height: lineHeight };
911
+ }
912
+ /**
913
+ * @returns {void} .
914
+ * @private
915
+ */
916
+ public createConnectorLineTooltipTable(): void {
917
+ this.tooltipTable = createElement(
918
+ 'table', { className: '.e-tooltiptable', styles: 'margin-top:0px', attrs: { 'cellspacing': '2px', 'cellpadding': '2px' } });
919
+ const tooltipBody: HTMLElement = createElement('tbody');
920
+ tooltipBody.innerHTML = '';
921
+ this.tooltipTable.appendChild(tooltipBody);
922
+ }
923
+ /**
924
+ * @param {string} fromTaskName .
925
+ * @param {string} fromPredecessorText .
926
+ * @param {string} toTaskName .
927
+ * @param {string} toPredecessorText .
928
+ * @returns {string} .
929
+ * @private
930
+ */
931
+ public getConnectorLineTooltipInnerTd(
932
+ fromTaskName: string, fromPredecessorText: string, toTaskName?: string, toPredecessorText?: string): string {
933
+ let innerTd: string = '<tr id="fromPredecessor"><td >' + this.parent.localeObj.getConstant('from') + '</td><td> ';
934
+ innerTd = innerTd + fromTaskName + ' </td><td> ' + this.parent.localeObj.getConstant(fromPredecessorText) + ' </td> </tr>';
935
+ innerTd = innerTd + '<tr id="toPredecessor"><td>' + this.parent.localeObj.getConstant('to') + '</td><td> ' + toTaskName;
936
+ innerTd = innerTd + ' </td><td> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
937
+ return innerTd;
938
+ }
939
+ /**
940
+ * Generate aria-label for connectorline
941
+ *
942
+ * @param {IConnectorLineObject} data .
943
+ * @returns {string} .
944
+ * @private
945
+ */
946
+ public generateAriaLabel(data: IConnectorLineObject): string {
947
+ const type: string = data.type;
948
+ const updatedRecords: IGanttData[] = this.expandedRecords;
949
+ const fromName: string = updatedRecords[data.parentIndex].ganttProperties.taskName;
950
+ const toName: string = updatedRecords[data.childIndex].ganttProperties.taskName;
951
+ const start: string = this.parent.localeObj.getConstant('start');
952
+ const finish: string = this.parent.localeObj.getConstant('finish');
953
+ let value: string = '';
954
+ if (type === 'FS') {
955
+ value = fromName + ' ' + finish + ' to ' + toName + ' ' + start;
956
+ } else if (type === 'FF') {
957
+ value = fromName + ' ' + finish + ' to ' + toName + ' ' + finish;
958
+ } else if (type === 'SS') {
959
+ value = fromName + ' ' + start + ' to ' + toName + ' ' + start;
960
+ } else {
961
+ value = fromName + ' ' + start + ' to ' + toName + ' ' + finish;
962
+ }
963
+ return value;
964
+ }
965
+ /**
966
+ * To get the record based on the predecessor value
967
+ *
968
+ * @param {string} id .
969
+ * @returns {IGanttData} .
970
+ * @private
971
+ */
972
+ public getRecordByID(id: string): IGanttData {
973
+ if (isNullOrUndefined(id)) {
974
+ return null;
975
+ }
976
+ return this.parent.viewType === 'ResourceView' ? this.parent.flatData[this.parent.getTaskIds().indexOf('T' + id.toString())] :
977
+ this.parent.flatData[this.parent.ids.indexOf(id.toString())];
978
+ }
979
+ /**
980
+ * Method to remove connector line from DOM
981
+ *
982
+ * @param {IGanttData[] | object} records .
983
+ * @returns {void} .
984
+ * @private
985
+ */
986
+ public removePreviousConnectorLines(records: IGanttData[] | object): void {
987
+ let isObjectType: boolean;
988
+ if (isObject(records) === true) {
989
+ isObjectType = true;
990
+ } else {
991
+ isObjectType = false;
992
+ }
993
+ const length: number = isObjectType ? Object.keys(records).length : (records as IGanttData[]).length;
994
+ const keys: string[] = Object.keys(records);
995
+ for (let i: number = 0; i < length; i++) {
996
+ let data: IGanttData;
997
+ if (isObjectType) {
998
+ const uniqueId: string = keys[i];
999
+ data = records[uniqueId] as IGanttData;
1000
+ } else {
1001
+ data = records[i];
1002
+ }
1003
+
1004
+ const predecessors: IPredecessor[] = data.ganttProperties && data.ganttProperties.predecessor;
1005
+ if (predecessors && predecessors.length > 0) {
1006
+ for (let pre: number = 0; pre < predecessors.length; pre++) {
1007
+ const lineId: string = 'parent' + predecessors[pre].from + 'child' + predecessors[pre].to;
1008
+ this.removeConnectorLineById(lineId);
1009
+ }
1010
+ }
1011
+ }
1012
+ }
1013
+ /**
1014
+ * @param {string} id .
1015
+ * @returns {void} .
1016
+ * @private
1017
+ */
1018
+ public removeConnectorLineById(id: string): void {
1019
+ const element: Element = this.parent.connectorLineModule.dependencyViewContainer.querySelector('#ConnectorLine' + id);
1020
+ if (!isNullOrUndefined(element)) {
1021
+ remove(element);
1022
+ }
1023
+ }
1024
+
1025
+ }