@visactor/vtable-plugins 1.18.4-alpha.0 → 1.18.4

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.
@@ -17507,8 +17507,12 @@
17507
17507
  }(DependencyType || (DependencyType = {}));
17508
17508
  var TasksShowMode;
17509
17509
  !function (TasksShowMode) {
17510
- TasksShowMode.Tasks_Separate = "tasks_separate", TasksShowMode.Sub_Tasks_Inline = "sub_tasks_inline", TasksShowMode.Sub_Tasks_Separate = "sub_tasks_separate", TasksShowMode.Sub_Tasks_Arrange = "sub_tasks_arrange", TasksShowMode.Sub_Tasks_Compact = "sub_tasks_compact";
17510
+ TasksShowMode.Tasks_Separate = "tasks_separate", TasksShowMode.Sub_Tasks_Inline = "sub_tasks_inline", TasksShowMode.Sub_Tasks_Separate = "sub_tasks_separate", TasksShowMode.Sub_Tasks_Arrange = "sub_tasks_arrange", TasksShowMode.Sub_Tasks_Compact = "sub_tasks_compact", TasksShowMode.Project_Sub_Tasks_Inline = "project_sub_tasks_inline";
17511
17511
  }(TasksShowMode || (TasksShowMode = {}));
17512
+ var TaskType;
17513
+ !function (TaskType) {
17514
+ TaskType.TASK = "task", TaskType.PROJECT = "project", TaskType.MILESTONE = "milestone";
17515
+ }(TaskType || (TaskType = {}));
17512
17516
 
17513
17517
  const GANTT_EVENT_TYPE = {
17514
17518
  SCROLL: "scroll",
@@ -18384,6 +18388,7 @@
18384
18388
  var _a, _b, _c, _d, _e;
18385
18389
  return markLine ? !0 === markLine ? [{
18386
18390
  date: createDateAtMidnight().toLocaleDateString(),
18391
+ content: "",
18387
18392
  scrollToMarkLine: !0,
18388
18393
  position: "left",
18389
18394
  style: {
@@ -18422,15 +18427,15 @@
18422
18427
  return (null == scrollStyle ? void 0 : scrollStyle.hoverOn) || (null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && "none" === (null == scrollStyle ? void 0 : scrollStyle.verticalVisible) || !(null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && "none" === (null == scrollStyle ? void 0 : scrollStyle.visible) ? 0 : null !== (_a = null == scrollStyle ? void 0 : scrollStyle.width) && void 0 !== _a ? _a : 7;
18423
18428
  }
18424
18429
  function initOptions(gantt) {
18425
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81;
18430
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85;
18426
18431
  const options = gantt.options;
18427
- gantt.parsedOptions.tasksShowMode = null !== (_a = null == options ? void 0 : options.tasksShowMode) && void 0 !== _a ? _a : TasksShowMode.Tasks_Separate, gantt.parsedOptions.pixelRatio = null !== (_b = null == options ? void 0 : options.pixelRatio) && void 0 !== _b ? _b : 1, gantt.parsedOptions.rowHeight = null !== (_c = null == options ? void 0 : options.rowHeight) && void 0 !== _c ? _c : 40, gantt.parsedOptions.timelineColWidth = null !== (_e = null === (_d = null == options ? void 0 : options.timelineHeader) || void 0 === _d ? void 0 : _d.colWidth) && void 0 !== _e ? _e : 60, gantt.parsedOptions.startDateField = null !== (_g = null === (_f = options.taskBar) || void 0 === _f ? void 0 : _f.startDateField) && void 0 !== _g ? _g : "startDate", gantt.parsedOptions.endDateField = null !== (_j = null === (_h = options.taskBar) || void 0 === _h ? void 0 : _h.endDateField) && void 0 !== _j ? _j : "endDate", gantt.parsedOptions.progressField = null !== (_l = null === (_k = options.taskBar) || void 0 === _k ? void 0 : _k.progressField) && void 0 !== _l ? _l : "progress";
18432
+ gantt.parsedOptions.tasksShowMode = null !== (_a = null == options ? void 0 : options.tasksShowMode) && void 0 !== _a ? _a : TasksShowMode.Tasks_Separate, gantt.parsedOptions.pixelRatio = null !== (_b = null == options ? void 0 : options.pixelRatio) && void 0 !== _b ? _b : 1, gantt.parsedOptions.rowHeight = null !== (_c = null == options ? void 0 : options.rowHeight) && void 0 !== _c ? _c : 40, gantt.parsedOptions.timelineColWidth = null !== (_e = null === (_d = null == options ? void 0 : options.timelineHeader) || void 0 === _d ? void 0 : _d.colWidth) && void 0 !== _e ? _e : 60, gantt.parsedOptions.startDateField = null !== (_g = null === (_f = options.taskBar) || void 0 === _f ? void 0 : _f.startDateField) && void 0 !== _g ? _g : "startDate", gantt.parsedOptions.endDateField = null !== (_j = null === (_h = options.taskBar) || void 0 === _h ? void 0 : _h.endDateField) && void 0 !== _j ? _j : "endDate", gantt.parsedOptions.progressField = null !== (_l = null === (_k = options.taskBar) || void 0 === _k ? void 0 : _k.progressField) && void 0 !== _l ? _l : "progress", gantt.parsedOptions.projectSubTasksExpandable = null === (_m = null == options ? void 0 : options.projectSubTasksExpandable) || void 0 === _m || _m;
18428
18433
  const {
18429
18434
  unit: minTimeUnit,
18430
18435
  startOfWeek: startOfWeek,
18431
18436
  step: step
18432
18437
  } = gantt.parsedOptions.reverseSortedTimelineScales[0];
18433
- gantt.parsedOptions.minDate = (null == options ? void 0 : options.minDate) ? getStartDateByTimeUnit(new Date(options.minDate), minTimeUnit, startOfWeek) : void 0, gantt.parsedOptions.maxDate = (null == options ? void 0 : options.maxDate) && (null === (_m = gantt.parsedOptions) || void 0 === _m ? void 0 : _m.minDate) ? getEndDateByTimeUnit(null === (_o = gantt.parsedOptions) || void 0 === _o ? void 0 : _o.minDate, new Date(options.maxDate), minTimeUnit, step) : void 0, gantt.parsedOptions._minDateTime = null === (_p = gantt.parsedOptions.minDate) || void 0 === _p ? void 0 : _p.getTime(), gantt.parsedOptions._maxDateTime = null === (_q = gantt.parsedOptions.maxDate) || void 0 === _q ? void 0 : _q.getTime(), gantt.parsedOptions.overscrollBehavior = null !== (_r = null == options ? void 0 : options.overscrollBehavior) && void 0 !== _r ? _r : "auto", gantt.parsedOptions.underlayBackgroundColor = null !== (_s = null == options ? void 0 : options.underlayBackgroundColor) && void 0 !== _s ? _s : "#FFF", gantt.parsedOptions.scrollStyle = Object.assign({}, {
18438
+ gantt.parsedOptions.minDate = (null == options ? void 0 : options.minDate) ? getStartDateByTimeUnit(new Date(options.minDate), minTimeUnit, startOfWeek) : void 0, gantt.parsedOptions.maxDate = (null == options ? void 0 : options.maxDate) && (null === (_o = gantt.parsedOptions) || void 0 === _o ? void 0 : _o.minDate) ? getEndDateByTimeUnit(null === (_p = gantt.parsedOptions) || void 0 === _p ? void 0 : _p.minDate, new Date(options.maxDate), minTimeUnit, step) : void 0, gantt.parsedOptions._minDateTime = null === (_q = gantt.parsedOptions.minDate) || void 0 === _q ? void 0 : _q.getTime(), gantt.parsedOptions._maxDateTime = null === (_r = gantt.parsedOptions.maxDate) || void 0 === _r ? void 0 : _r.getTime(), gantt.parsedOptions.overscrollBehavior = null !== (_s = null == options ? void 0 : options.overscrollBehavior) && void 0 !== _s ? _s : "auto", gantt.parsedOptions.underlayBackgroundColor = null !== (_t = null == options ? void 0 : options.underlayBackgroundColor) && void 0 !== _t ? _t : "#FFF", gantt.parsedOptions.scrollStyle = Object.assign({}, {
18434
18439
  scrollRailColor: "rgba(100, 100, 100, 0.2)",
18435
18440
  scrollSliderColor: "rgba(100, 100, 100, 0.5)",
18436
18441
  scrollSliderCornerRadius: 4,
@@ -18438,8 +18443,8 @@
18438
18443
  visible: "always",
18439
18444
  hoverOn: !0,
18440
18445
  barToSide: !1
18441
- }, null == options ? void 0 : options.scrollStyle), gantt.parsedOptions.timelineHeaderHorizontalLineStyle = null === (_t = null == options ? void 0 : options.timelineHeader) || void 0 === _t ? void 0 : _t.horizontalLine, gantt.parsedOptions.timelineHeaderVerticalLineStyle = null === (_u = null == options ? void 0 : options.timelineHeader) || void 0 === _u ? void 0 : _u.verticalLine, gantt.parsedOptions.timelineHeaderBackgroundColor = null === (_v = null == options ? void 0 : options.timelineHeader) || void 0 === _v ? void 0 : _v.backgroundColor, gantt.parsedOptions.timeLineHeaderRowHeights = [], gantt.parsedOptions.timelineHeaderStyles = [];
18442
- for (let i = 0; null !== (_w = i < gantt.parsedOptions.sortedTimelineScales.length) && void 0 !== _w && _w; i++) {
18446
+ }, null == options ? void 0 : options.scrollStyle), gantt.parsedOptions.timelineHeaderHorizontalLineStyle = null === (_u = null == options ? void 0 : options.timelineHeader) || void 0 === _u ? void 0 : _u.horizontalLine, gantt.parsedOptions.timelineHeaderVerticalLineStyle = null === (_v = null == options ? void 0 : options.timelineHeader) || void 0 === _v ? void 0 : _v.verticalLine, gantt.parsedOptions.timelineHeaderBackgroundColor = null === (_w = null == options ? void 0 : options.timelineHeader) || void 0 === _w ? void 0 : _w.backgroundColor, gantt.parsedOptions.timeLineHeaderRowHeights = [], gantt.parsedOptions.timelineHeaderStyles = [];
18447
+ for (let i = 0; i < gantt.parsedOptions.sortedTimelineScales.length; i++) {
18443
18448
  const style = gantt.parsedOptions.sortedTimelineScales[i].style;
18444
18449
  gantt.parsedOptions.timelineHeaderStyles.push(Object.assign({
18445
18450
  fontSize: 20,
@@ -18450,15 +18455,23 @@
18450
18455
  backgroundColor: "#fff"
18451
18456
  }, style)), gantt.parsedOptions.timeLineHeaderRowHeights.push(null !== (_y = null !== (_x = gantt.parsedOptions.sortedTimelineScales[i].rowHeight) && void 0 !== _x ? _x : null == options ? void 0 : options.headerRowHeight) && void 0 !== _y ? _y : 40);
18452
18457
  }
18453
- gantt.parsedOptions.grid = Object.assign({}, null == options ? void 0 : options.grid), setWidthToDefaultTaskBarStyle(3 * gantt.parsedOptions.rowHeight / 4), gantt.parsedOptions.taskBarStyle = (null === (_z = null == options ? void 0 : options.taskBar) || void 0 === _z ? void 0 : _z.barStyle) && "function" == typeof (null === (_0 = null == options ? void 0 : options.taskBar) || void 0 === _0 ? void 0 : _0.barStyle) ? options.taskBar.barStyle : Object.assign({}, defaultTaskBarStyle, null === (_1 = null == options ? void 0 : options.taskBar) || void 0 === _1 ? void 0 : _1.barStyle), gantt.parsedOptions.taskBarMilestoneStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {} : {
18458
+ gantt.parsedOptions.grid = Object.assign({}, null == options ? void 0 : options.grid), setWidthToDefaultTaskBarStyle(3 * gantt.parsedOptions.rowHeight / 4), gantt.parsedOptions.taskBarStyle = (null === (_z = null == options ? void 0 : options.taskBar) || void 0 === _z ? void 0 : _z.barStyle) && "function" == typeof (null === (_0 = null == options ? void 0 : options.taskBar) || void 0 === _0 ? void 0 : _0.barStyle) ? options.taskBar.barStyle : Object.assign({}, defaultTaskBarStyle, null === (_1 = null == options ? void 0 : options.taskBar) || void 0 === _1 ? void 0 : _1.barStyle), gantt.parsedOptions.projectBarStyle = (null === (_2 = null == options ? void 0 : options.taskBar) || void 0 === _2 ? void 0 : _2.projectStyle) && "function" == typeof (null === (_3 = null == options ? void 0 : options.taskBar) || void 0 === _3 ? void 0 : _3.projectStyle) ? options.taskBar.projectStyle : (null === (_4 = null == options ? void 0 : options.taskBar) || void 0 === _4 ? void 0 : _4.projectStyle) ? Object.assign({}, defaultTaskBarStyle, null === (_5 = null == options ? void 0 : options.taskBar) || void 0 === _5 ? void 0 : _5.projectStyle) : gantt.parsedOptions.taskBarStyle;
18459
+ gantt.parsedOptions.taskBarMilestoneStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {} : {
18454
18460
  width: gantt.parsedOptions.taskBarStyle.width,
18455
18461
  borderColor: gantt.parsedOptions.taskBarStyle.borderColor,
18456
- borderLineWidth: null !== (_2 = gantt.parsedOptions.taskBarStyle.borderLineWidth) && void 0 !== _2 ? _2 : 1,
18462
+ borderLineWidth: null !== (_6 = gantt.parsedOptions.taskBarStyle.borderLineWidth) && void 0 !== _6 ? _6 : 1,
18457
18463
  fillColor: gantt.parsedOptions.taskBarStyle.barColor,
18458
18464
  cornerRadius: 0
18459
- }, null === (_3 = null == options ? void 0 : options.taskBar) || void 0 === _3 ? void 0 : _3.milestoneStyle), gantt.parsedOptions.taskBarMilestoneHypotenuse = gantt.parsedOptions.taskBarMilestoneStyle.width * Math.sqrt(2), gantt.parsedOptions.dateFormat = null == options ? void 0 : options.dateFormat, gantt.parsedOptions.taskBarHoverStyle = Object.assign({
18465
+ }, {
18466
+ labelTextStyle: {
18467
+ fontSize: 16,
18468
+ color: "red",
18469
+ fontFamily: "Arial",
18470
+ padding: 4
18471
+ }
18472
+ }, null === (_7 = null == options ? void 0 : options.taskBar) || void 0 === _7 ? void 0 : _7.milestoneStyle), gantt.parsedOptions.taskBarMilestoneHypotenuse = gantt.parsedOptions.taskBarMilestoneStyle.width * Math.sqrt(2), gantt.parsedOptions.dateFormat = null == options ? void 0 : options.dateFormat, gantt.parsedOptions.taskBarHoverStyle = Object.assign({
18460
18473
  barOverlayColor: "rgba(99, 144, 0, 0.4)"
18461
- }, null === (_4 = null == options ? void 0 : options.taskBar) || void 0 === _4 ? void 0 : _4.hoverBarStyle), gantt.parsedOptions.taskBarSelectable = null === (_6 = null === (_5 = null == options ? void 0 : options.taskBar) || void 0 === _5 ? void 0 : _5.selectable) || void 0 === _6 || _6, gantt.parsedOptions.taskBarSelectedStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {
18474
+ }, null === (_8 = null == options ? void 0 : options.taskBar) || void 0 === _8 ? void 0 : _8.hoverBarStyle), gantt.parsedOptions.taskBarSelectable = null === (_10 = null === (_9 = null == options ? void 0 : options.taskBar) || void 0 === _9 ? void 0 : _9.selectable) || void 0 === _10 || _10, gantt.parsedOptions.taskBarSelectedStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {
18462
18475
  shadowBlur: 6,
18463
18476
  shadowOffsetX: 0,
18464
18477
  shadowOffsetY: 0,
@@ -18470,57 +18483,57 @@
18470
18483
  shadowColor: gantt.parsedOptions.taskBarStyle.barColor,
18471
18484
  borderColor: gantt.parsedOptions.taskBarStyle.barColor,
18472
18485
  borderLineWidth: 1
18473
- }, null === (_7 = null == options ? void 0 : options.taskBar) || void 0 === _7 ? void 0 : _7.selectedBarStyle), gantt.parsedOptions.taskBarLabelText = null !== (_9 = null === (_8 = null == options ? void 0 : options.taskBar) || void 0 === _8 ? void 0 : _8.labelText) && void 0 !== _9 ? _9 : "", gantt.parsedOptions.taskBarMoveable = null === (_11 = null === (_10 = null == options ? void 0 : options.taskBar) || void 0 === _10 ? void 0 : _10.moveable) || void 0 === _11 || _11, gantt.parsedOptions.moveTaskBarToExtendDateRange = null === (_13 = null === (_12 = null == options ? void 0 : options.taskBar) || void 0 === _12 ? void 0 : _12.moveToExtendDateRange) || void 0 === _13 || _13, gantt.parsedOptions.taskBarResizable = null === (_15 = null === (_14 = null == options ? void 0 : options.taskBar) || void 0 === _14 ? void 0 : _14.resizable) || void 0 === _15 || _15, gantt.parsedOptions.taskBarDragOrder = null === (_17 = null === (_16 = null == options ? void 0 : options.taskBar) || void 0 === _16 ? void 0 : _16.dragOrder) || void 0 === _17 || _17, gantt.parsedOptions.taskBarLabelStyle = {
18474
- fontFamily: null !== (_20 = null === (_19 = null === (_18 = null == options ? void 0 : options.taskBar) || void 0 === _18 ? void 0 : _18.labelTextStyle) || void 0 === _19 ? void 0 : _19.fontFamily) && void 0 !== _20 ? _20 : "Arial",
18475
- fontSize: null !== (_23 = null === (_22 = null === (_21 = null == options ? void 0 : options.taskBar) || void 0 === _21 ? void 0 : _21.labelTextStyle) || void 0 === _22 ? void 0 : _22.fontSize) && void 0 !== _23 ? _23 : 20,
18476
- color: null !== (_26 = null === (_25 = null === (_24 = null == options ? void 0 : options.taskBar) || void 0 === _24 ? void 0 : _24.labelTextStyle) || void 0 === _25 ? void 0 : _25.color) && void 0 !== _26 ? _26 : "#F01",
18477
- outsideColor: null !== (_29 = null === (_28 = null === (_27 = null == options ? void 0 : options.taskBar) || void 0 === _27 ? void 0 : _27.labelTextStyle) || void 0 === _28 ? void 0 : _28.outsideColor) && void 0 !== _29 ? _29 : "#333333",
18478
- textAlign: null !== (_32 = null === (_31 = null === (_30 = null == options ? void 0 : options.taskBar) || void 0 === _30 ? void 0 : _30.labelTextStyle) || void 0 === _31 ? void 0 : _31.textAlign) && void 0 !== _32 ? _32 : "left",
18479
- textBaseline: null !== (_35 = null === (_34 = null === (_33 = null == options ? void 0 : options.taskBar) || void 0 === _33 ? void 0 : _33.labelTextStyle) || void 0 === _34 ? void 0 : _34.textBaseline) && void 0 !== _35 ? _35 : "middle",
18480
- padding: null !== (_38 = null === (_37 = null === (_36 = null == options ? void 0 : options.taskBar) || void 0 === _36 ? void 0 : _36.labelTextStyle) || void 0 === _37 ? void 0 : _37.padding) && void 0 !== _38 ? _38 : [0, 0, 0, 10],
18481
- textOverflow: null === (_40 = null === (_39 = null == options ? void 0 : options.taskBar) || void 0 === _39 ? void 0 : _39.labelTextStyle) || void 0 === _40 ? void 0 : _40.textOverflow,
18482
- orient: null === (_42 = null === (_41 = null == options ? void 0 : options.taskBar) || void 0 === _41 ? void 0 : _41.labelTextStyle) || void 0 === _42 ? void 0 : _42.orient,
18483
- orientHandleWithOverflow: null === (_44 = null === (_43 = null == options ? void 0 : options.taskBar) || void 0 === _43 ? void 0 : _43.labelTextStyle) || void 0 === _44 ? void 0 : _44.orientHandleWithOverflow
18484
- }, gantt.parsedOptions.taskBarCustomLayout = null === (_45 = null == options ? void 0 : options.taskBar) || void 0 === _45 ? void 0 : _45.customLayout, gantt.parsedOptions.taskBarCreatable = null !== (_47 = null === (_46 = null == options ? void 0 : options.taskBar) || void 0 === _46 ? void 0 : _46.scheduleCreatable) && void 0 !== _47 ? _47 : !(gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Separate && gantt.parsedOptions.tasksShowMode !== TasksShowMode.Tasks_Separate), gantt.parsedOptions.taskBarCreationButtonStyle = Object.assign({
18486
+ }, null === (_11 = null == options ? void 0 : options.taskBar) || void 0 === _11 ? void 0 : _11.selectedBarStyle), gantt.parsedOptions.taskBarLabelText = null !== (_13 = null === (_12 = null == options ? void 0 : options.taskBar) || void 0 === _12 ? void 0 : _12.labelText) && void 0 !== _13 ? _13 : "", gantt.parsedOptions.taskBarMoveable = null === (_15 = null === (_14 = null == options ? void 0 : options.taskBar) || void 0 === _14 ? void 0 : _14.moveable) || void 0 === _15 || _15, gantt.parsedOptions.moveTaskBarToExtendDateRange = null === (_17 = null === (_16 = null == options ? void 0 : options.taskBar) || void 0 === _16 ? void 0 : _16.moveToExtendDateRange) || void 0 === _17 || _17, gantt.parsedOptions.taskBarResizable = null === (_19 = null === (_18 = null == options ? void 0 : options.taskBar) || void 0 === _18 ? void 0 : _18.resizable) || void 0 === _19 || _19, gantt.parsedOptions.taskBarDragOrder = null === (_21 = null === (_20 = null == options ? void 0 : options.taskBar) || void 0 === _20 ? void 0 : _20.dragOrder) || void 0 === _21 || _21, gantt.parsedOptions.taskBarLabelStyle = {
18487
+ fontFamily: null !== (_24 = null === (_23 = null === (_22 = null == options ? void 0 : options.taskBar) || void 0 === _22 ? void 0 : _22.labelTextStyle) || void 0 === _23 ? void 0 : _23.fontFamily) && void 0 !== _24 ? _24 : "Arial",
18488
+ fontSize: null !== (_27 = null === (_26 = null === (_25 = null == options ? void 0 : options.taskBar) || void 0 === _25 ? void 0 : _25.labelTextStyle) || void 0 === _26 ? void 0 : _26.fontSize) && void 0 !== _27 ? _27 : 20,
18489
+ color: null !== (_30 = null === (_29 = null === (_28 = null == options ? void 0 : options.taskBar) || void 0 === _28 ? void 0 : _28.labelTextStyle) || void 0 === _29 ? void 0 : _29.color) && void 0 !== _30 ? _30 : "#F01",
18490
+ outsideColor: null !== (_33 = null === (_32 = null === (_31 = null == options ? void 0 : options.taskBar) || void 0 === _31 ? void 0 : _31.labelTextStyle) || void 0 === _32 ? void 0 : _32.outsideColor) && void 0 !== _33 ? _33 : "#333333",
18491
+ textAlign: null !== (_36 = null === (_35 = null === (_34 = null == options ? void 0 : options.taskBar) || void 0 === _34 ? void 0 : _34.labelTextStyle) || void 0 === _35 ? void 0 : _35.textAlign) && void 0 !== _36 ? _36 : "left",
18492
+ textBaseline: null !== (_39 = null === (_38 = null === (_37 = null == options ? void 0 : options.taskBar) || void 0 === _37 ? void 0 : _37.labelTextStyle) || void 0 === _38 ? void 0 : _38.textBaseline) && void 0 !== _39 ? _39 : "middle",
18493
+ padding: null !== (_42 = null === (_41 = null === (_40 = null == options ? void 0 : options.taskBar) || void 0 === _40 ? void 0 : _40.labelTextStyle) || void 0 === _41 ? void 0 : _41.padding) && void 0 !== _42 ? _42 : [0, 0, 0, 10],
18494
+ textOverflow: null === (_44 = null === (_43 = null == options ? void 0 : options.taskBar) || void 0 === _43 ? void 0 : _43.labelTextStyle) || void 0 === _44 ? void 0 : _44.textOverflow,
18495
+ orient: null === (_46 = null === (_45 = null == options ? void 0 : options.taskBar) || void 0 === _45 ? void 0 : _45.labelTextStyle) || void 0 === _46 ? void 0 : _46.orient,
18496
+ orientHandleWithOverflow: null === (_48 = null === (_47 = null == options ? void 0 : options.taskBar) || void 0 === _47 ? void 0 : _47.labelTextStyle) || void 0 === _48 ? void 0 : _48.orientHandleWithOverflow
18497
+ }, gantt.parsedOptions.taskBarCustomLayout = null === (_49 = null == options ? void 0 : options.taskBar) || void 0 === _49 ? void 0 : _49.customLayout, gantt.parsedOptions.taskBarCreatable = null !== (_51 = null === (_50 = null == options ? void 0 : options.taskBar) || void 0 === _50 ? void 0 : _50.scheduleCreatable) && void 0 !== _51 ? _51 : !(gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Separate && gantt.parsedOptions.tasksShowMode !== TasksShowMode.Tasks_Separate), gantt.parsedOptions.taskBarCreationButtonStyle = Object.assign({
18485
18498
  lineColor: "rgb(99, 144, 0)",
18486
18499
  lineWidth: 1,
18487
18500
  lineDash: [5, 5],
18488
18501
  cornerRadius: 4,
18489
18502
  backgroundColor: "#FFF"
18490
- }, null === (_49 = null === (_48 = null == options ? void 0 : options.taskBar) || void 0 === _48 ? void 0 : _48.scheduleCreation) || void 0 === _49 ? void 0 : _49.buttonStyle), gantt.parsedOptions.taskBarCreationCustomLayout = null === (_51 = null === (_50 = null == options ? void 0 : options.taskBar) || void 0 === _50 ? void 0 : _50.scheduleCreation) || void 0 === _51 ? void 0 : _51.customLayout, gantt.parsedOptions.taskBarCreationMaxWidth = null === (_53 = null === (_52 = null == options ? void 0 : options.taskBar) || void 0 === _52 ? void 0 : _52.scheduleCreation) || void 0 === _53 ? void 0 : _53.maxWidth, gantt.parsedOptions.taskBarCreationMinWidth = null === (_55 = null === (_54 = null == options ? void 0 : options.taskBar) || void 0 === _54 ? void 0 : _54.scheduleCreation) || void 0 === _55 ? void 0 : _55.minWidth, gantt.parsedOptions.outerFrameStyle = Object.assign({
18503
+ }, null === (_53 = null === (_52 = null == options ? void 0 : options.taskBar) || void 0 === _52 ? void 0 : _52.scheduleCreation) || void 0 === _53 ? void 0 : _53.buttonStyle), gantt.parsedOptions.taskBarCreationCustomLayout = null === (_55 = null === (_54 = null == options ? void 0 : options.taskBar) || void 0 === _54 ? void 0 : _54.scheduleCreation) || void 0 === _55 ? void 0 : _55.customLayout, gantt.parsedOptions.taskBarCreationMaxWidth = null === (_57 = null === (_56 = null == options ? void 0 : options.taskBar) || void 0 === _56 ? void 0 : _56.scheduleCreation) || void 0 === _57 ? void 0 : _57.maxWidth, gantt.parsedOptions.taskBarCreationMinWidth = null === (_59 = null === (_58 = null == options ? void 0 : options.taskBar) || void 0 === _58 ? void 0 : _58.scheduleCreation) || void 0 === _59 ? void 0 : _59.minWidth, gantt.parsedOptions.outerFrameStyle = Object.assign({
18491
18504
  borderColor: "#e1e4e8",
18492
18505
  borderLineWidth: 1,
18493
18506
  cornerRadius: 4
18494
- }, null === (_56 = options.frame) || void 0 === _56 ? void 0 : _56.outerFrameStyle), gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine), null !== (_58 = null === (_57 = gantt.parsedOptions.markLine) || void 0 === _57 ? void 0 : _57.length) && void 0 !== _58 && _58 && ((null === (_59 = gantt.parsedOptions.markLine) || void 0 === _59 ? void 0 : _59.every(item => void 0 === item.scrollToMarkLine)) && (gantt.parsedOptions.markLine[0].scrollToMarkLine = !0), (null === (_60 = gantt.parsedOptions.markLine) || void 0 === _60 ? void 0 : _60.find(item => item.scrollToMarkLine)) && (gantt.parsedOptions.scrollToMarkLineDate = getStartDateByTimeUnit(new Date(null === (_61 = gantt.parsedOptions.markLine) || void 0 === _61 ? void 0 : _61.find(item => item.scrollToMarkLine).date), minTimeUnit, startOfWeek))), gantt.parsedOptions.verticalSplitLineHighlight = null === (_62 = options.frame) || void 0 === _62 ? void 0 : _62.verticalSplitLineHighlight, gantt.parsedOptions.verticalSplitLine = Object.assign({
18495
- lineColor: null === (_63 = gantt.parsedOptions.outerFrameStyle) || void 0 === _63 ? void 0 : _63.borderColor,
18496
- lineWidth: null === (_64 = gantt.parsedOptions.outerFrameStyle) || void 0 === _64 ? void 0 : _64.borderLineWidth
18497
- }, null === (_65 = options.frame) || void 0 === _65 ? void 0 : _65.verticalSplitLine), gantt.parsedOptions.horizontalSplitLine = null === (_66 = options.frame) || void 0 === _66 ? void 0 : _66.horizontalSplitLine, gantt.parsedOptions.verticalSplitLineMoveable = null === (_67 = options.frame) || void 0 === _67 ? void 0 : _67.verticalSplitLineMoveable, gantt.parsedOptions.taskKeyField = null !== (_68 = options.taskKeyField) && void 0 !== _68 ? _68 : "id", gantt.parsedOptions.dependencyLinks = null !== (_70 = null === (_69 = options.dependency) || void 0 === _69 ? void 0 : _69.links) && void 0 !== _70 ? _70 : [], gantt.parsedOptions.dependencyLinkCreatable = null !== (_72 = null === (_71 = options.dependency) || void 0 === _71 ? void 0 : _71.linkCreatable) && void 0 !== _72 && _72, gantt.parsedOptions.dependencyLinkSelectable = null === (_74 = null === (_73 = options.dependency) || void 0 === _73 ? void 0 : _73.linkSelectable) || void 0 === _74 || _74, gantt.parsedOptions.dependencyLinkDeletable = null !== (_76 = null === (_75 = options.dependency) || void 0 === _75 ? void 0 : _75.linkDeletable) && void 0 !== _76 && _76, gantt.parsedOptions.dependencyLinkLineStyle = Object.assign({
18507
+ }, null === (_60 = options.frame) || void 0 === _60 ? void 0 : _60.outerFrameStyle), gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine), null !== (_62 = null === (_61 = gantt.parsedOptions.markLine) || void 0 === _61 ? void 0 : _61.length) && void 0 !== _62 && _62 && ((null === (_63 = gantt.parsedOptions.markLine) || void 0 === _63 ? void 0 : _63.every(item => void 0 === item.scrollToMarkLine)) && (gantt.parsedOptions.markLine[0].scrollToMarkLine = !0), (null === (_64 = gantt.parsedOptions.markLine) || void 0 === _64 ? void 0 : _64.find(item => item.scrollToMarkLine)) && (gantt.parsedOptions.scrollToMarkLineDate = getStartDateByTimeUnit(new Date(null === (_65 = gantt.parsedOptions.markLine) || void 0 === _65 ? void 0 : _65.find(item => item.scrollToMarkLine).date), minTimeUnit, startOfWeek))), gantt.parsedOptions.verticalSplitLineHighlight = null === (_66 = options.frame) || void 0 === _66 ? void 0 : _66.verticalSplitLineHighlight, gantt.parsedOptions.verticalSplitLine = Object.assign({
18508
+ lineColor: null === (_67 = gantt.parsedOptions.outerFrameStyle) || void 0 === _67 ? void 0 : _67.borderColor,
18509
+ lineWidth: null === (_68 = gantt.parsedOptions.outerFrameStyle) || void 0 === _68 ? void 0 : _68.borderLineWidth
18510
+ }, null === (_69 = options.frame) || void 0 === _69 ? void 0 : _69.verticalSplitLine), gantt.parsedOptions.horizontalSplitLine = null === (_70 = options.frame) || void 0 === _70 ? void 0 : _70.horizontalSplitLine, gantt.parsedOptions.verticalSplitLineMoveable = null === (_71 = options.frame) || void 0 === _71 ? void 0 : _71.verticalSplitLineMoveable, gantt.parsedOptions.taskKeyField = null !== (_72 = options.taskKeyField) && void 0 !== _72 ? _72 : "id", gantt.parsedOptions.dependencyLinks = null !== (_74 = null === (_73 = options.dependency) || void 0 === _73 ? void 0 : _73.links) && void 0 !== _74 ? _74 : [], gantt.parsedOptions.dependencyLinkCreatable = null !== (_76 = null === (_75 = options.dependency) || void 0 === _75 ? void 0 : _75.linkCreatable) && void 0 !== _76 && _76, gantt.parsedOptions.dependencyLinkSelectable = null === (_78 = null === (_77 = options.dependency) || void 0 === _77 ? void 0 : _77.linkSelectable) || void 0 === _78 || _78, gantt.parsedOptions.dependencyLinkDeletable = null !== (_80 = null === (_79 = options.dependency) || void 0 === _79 ? void 0 : _79.linkDeletable) && void 0 !== _80 && _80, gantt.parsedOptions.dependencyLinkLineStyle = Object.assign({
18498
18511
  lineColor: "red",
18499
18512
  lineWidth: 1
18500
- }, null === (_77 = options.dependency) || void 0 === _77 ? void 0 : _77.linkLineStyle), gantt.parsedOptions.dependencyLinkSelectedLineStyle = Object.assign({
18513
+ }, null === (_81 = options.dependency) || void 0 === _81 ? void 0 : _81.linkLineStyle), gantt.parsedOptions.dependencyLinkSelectedLineStyle = Object.assign({
18501
18514
  shadowBlur: 4,
18502
18515
  shadowOffset: 0,
18503
18516
  shadowColor: gantt.parsedOptions.dependencyLinkLineStyle.lineColor,
18504
18517
  lineColor: gantt.parsedOptions.dependencyLinkLineStyle.lineColor,
18505
18518
  lineWidth: gantt.parsedOptions.dependencyLinkLineStyle.lineWidth
18506
- }, null === (_78 = null == options ? void 0 : options.dependency) || void 0 === _78 ? void 0 : _78.linkSelectedLineStyle), gantt.parsedOptions.dependencyLinkLineCreatePointStyle = Object.assign({
18519
+ }, null === (_82 = null == options ? void 0 : options.dependency) || void 0 === _82 ? void 0 : _82.linkSelectedLineStyle), gantt.parsedOptions.dependencyLinkLineCreatePointStyle = Object.assign({
18507
18520
  strokeColor: "red",
18508
18521
  fillColor: "white",
18509
18522
  radius: 5,
18510
18523
  strokeWidth: 1
18511
- }, null === (_79 = null == options ? void 0 : options.dependency) || void 0 === _79 ? void 0 : _79.linkCreatePointStyle), gantt.parsedOptions.dependencyLinkLineCreatingPointStyle = Object.assign({
18524
+ }, null === (_83 = null == options ? void 0 : options.dependency) || void 0 === _83 ? void 0 : _83.linkCreatePointStyle), gantt.parsedOptions.dependencyLinkLineCreatingPointStyle = Object.assign({
18512
18525
  strokeColor: "red",
18513
18526
  fillColor: "red",
18514
18527
  radius: 5,
18515
18528
  strokeWidth: 1
18516
- }, null === (_80 = null == options ? void 0 : options.dependency) || void 0 === _80 ? void 0 : _80.linkCreatingPointStyle), gantt.parsedOptions.dependencyLinkLineCreatingStyle = Object.assign({
18529
+ }, null === (_84 = null == options ? void 0 : options.dependency) || void 0 === _84 ? void 0 : _84.linkCreatingPointStyle), gantt.parsedOptions.dependencyLinkLineCreatingStyle = Object.assign({
18517
18530
  lineColor: "red",
18518
18531
  lineWidth: 1,
18519
18532
  lineDash: [5, 5]
18520
- }, null === (_81 = null == options ? void 0 : options.dependency) || void 0 === _81 ? void 0 : _81.linkCreatingLineStyle), gantt.parsedOptions.eventOptions = null == options ? void 0 : options.eventOptions, gantt.parsedOptions.keyboardOptions = null == options ? void 0 : options.keyboardOptions, gantt.parsedOptions.markLineCreateOptions = null == options ? void 0 : options.markLineCreateOptions;
18533
+ }, null === (_85 = null == options ? void 0 : options.dependency) || void 0 === _85 ? void 0 : _85.linkCreatingLineStyle), gantt.parsedOptions.eventOptions = null == options ? void 0 : options.eventOptions, gantt.parsedOptions.keyboardOptions = null == options ? void 0 : options.keyboardOptions, gantt.parsedOptions.markLineCreateOptions = null == options ? void 0 : options.markLineCreateOptions;
18521
18534
  }
18522
18535
  function updateOptionsWhenScaleChanged(gantt) {
18523
- var _a, _b, _c, _d, _e;
18536
+ var _a, _b, _c, _d;
18524
18537
  const options = gantt.options,
18525
18538
  {
18526
18539
  unit: minTimeUnit,
@@ -18528,7 +18541,7 @@
18528
18541
  step: step
18529
18542
  } = gantt.parsedOptions.reverseSortedTimelineScales[0];
18530
18543
  gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(gantt.parsedOptions.minDate), minTimeUnit, startOfWeek), gantt.parsedOptions.maxDate = getEndDateByTimeUnit(gantt.parsedOptions.minDate, new Date(gantt.parsedOptions.maxDate), minTimeUnit, step), gantt.parsedOptions._minDateTime = null === (_a = gantt.parsedOptions.minDate) || void 0 === _a ? void 0 : _a.getTime(), gantt.parsedOptions._maxDateTime = null === (_b = gantt.parsedOptions.maxDate) || void 0 === _b ? void 0 : _b.getTime(), gantt.parsedOptions.timeLineHeaderRowHeights = [], gantt.parsedOptions.timelineHeaderStyles = [];
18531
- for (let i = 0; null !== (_c = i < gantt.parsedOptions.sortedTimelineScales.length) && void 0 !== _c && _c; i++) {
18544
+ for (let i = 0; i < gantt.parsedOptions.sortedTimelineScales.length; i++) {
18532
18545
  const style = gantt.parsedOptions.sortedTimelineScales[i].style;
18533
18546
  gantt.parsedOptions.timelineHeaderStyles.push(Object.assign({
18534
18547
  fontSize: 20,
@@ -18537,7 +18550,7 @@
18537
18550
  textBaseline: "middle",
18538
18551
  color: "#000",
18539
18552
  backgroundColor: "#fff"
18540
- }, style)), gantt.parsedOptions.timeLineHeaderRowHeights.push(null !== (_e = null !== (_d = gantt.parsedOptions.sortedTimelineScales[i].rowHeight) && void 0 !== _d ? _d : null == options ? void 0 : options.headerRowHeight) && void 0 !== _e ? _e : 40);
18553
+ }, style)), gantt.parsedOptions.timeLineHeaderRowHeights.push(null !== (_d = null !== (_c = gantt.parsedOptions.sortedTimelineScales[i].rowHeight) && void 0 !== _c ? _c : null == options ? void 0 : options.headerRowHeight) && void 0 !== _d ? _d : 40);
18541
18554
  }
18542
18555
  }
18543
18556
  function generateTimeLineDate(currentDate, endDate, scale) {
@@ -18744,25 +18757,23 @@
18744
18757
  return "string" == typeof progress && (progress = progress.replace("%", ""), progress = parseFloat(progress)), Math.round(progress);
18745
18758
  }
18746
18759
  function createSplitLineAndResizeLine(gantt) {
18747
- var _a, _b;
18748
18760
  if (gantt.taskListTableInstance) {
18749
18761
  gantt.verticalSplitResizeLine = document.createElement("div"), gantt.verticalSplitResizeLine.style.position = "absolute", gantt.verticalSplitResizeLine.style.top = gantt.tableY + "px", gantt.verticalSplitResizeLine.style.left = (gantt.taskTableWidth ? gantt.taskTableWidth - 7 + gantt.parsedOptions.verticalSplitLine.lineWidth / 2 : 0) + "px", gantt.verticalSplitResizeLine.style.width = "14px", gantt.verticalSplitResizeLine.style.height = gantt.drawHeight + "px", gantt.verticalSplitResizeLine.style.backgroundColor = "rgba(0,0,0,0)", gantt.verticalSplitResizeLine.style.zIndex = "100", gantt.parsedOptions.verticalSplitLineMoveable && (gantt.verticalSplitResizeLine.style.cursor = "col-resize"), gantt.verticalSplitResizeLine.style.userSelect = "none", gantt.verticalSplitResizeLine.style.opacity = "1";
18750
18762
  const verticalSplitLine = document.createElement("div");
18751
18763
  if (verticalSplitLine.style.position = "absolute", verticalSplitLine.style.top = "0px", verticalSplitLine.style.left = (14 - gantt.parsedOptions.verticalSplitLine.lineWidth) / 2 + "px", verticalSplitLine.style.width = gantt.parsedOptions.verticalSplitLine.lineWidth + "px", verticalSplitLine.style.height = "100%", verticalSplitLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLine.lineColor, verticalSplitLine.style.zIndex = "100", verticalSplitLine.style.userSelect = "none", verticalSplitLine.style.pointerEvents = "none", verticalSplitLine.style.transition = "background-color 0.3s", gantt.verticalSplitResizeLine.appendChild(verticalSplitLine), gantt.parsedOptions.verticalSplitLineHighlight) {
18752
18764
  const highlightLine = document.createElement("div");
18753
- highlightLine.style.position = "absolute", highlightLine.style.top = "0px", highlightLine.style.left = (null !== (_a = 14 - gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _a ? _a : 2) / 2 + "px", highlightLine.style.width = (null !== (_b = gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _b ? _b : 2) + "px", highlightLine.style.height = "100%", highlightLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLineHighlight.lineColor, highlightLine.style.zIndex = "100", highlightLine.style.cursor = "col-resize", highlightLine.style.userSelect = "none", highlightLine.style.pointerEvents = "none", highlightLine.style.opacity = "0", highlightLine.style.transition = "background-color 0.3s", gantt.verticalSplitResizeLine.appendChild(highlightLine);
18765
+ highlightLine.style.position = "absolute", highlightLine.style.top = "0px", highlightLine.style.left = (14 - gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) / 2 + "px", highlightLine.style.width = gantt.parsedOptions.verticalSplitLineHighlight.lineWidth + "px", highlightLine.style.height = "100%", highlightLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLineHighlight.lineColor, highlightLine.style.zIndex = "100", highlightLine.style.cursor = "col-resize", highlightLine.style.userSelect = "none", highlightLine.style.pointerEvents = "none", highlightLine.style.opacity = "0", highlightLine.style.transition = "background-color 0.3s", gantt.verticalSplitResizeLine.appendChild(highlightLine);
18754
18766
  }
18755
18767
  gantt.container.appendChild(gantt.verticalSplitResizeLine);
18756
18768
  }
18757
18769
  }
18758
18770
  function updateSplitLineAndResizeLine(gantt) {
18759
- var _a, _b;
18760
18771
  if (gantt.verticalSplitResizeLine) {
18761
18772
  gantt.verticalSplitResizeLine.style.position = "absolute", gantt.verticalSplitResizeLine.style.top = gantt.tableY + "px", gantt.verticalSplitResizeLine.style.left = gantt.taskTableWidth ? gantt.taskTableWidth - 7 + gantt.parsedOptions.verticalSplitLine.lineWidth / 2 + "px" : "0px", gantt.verticalSplitResizeLine.style.width = "14px", gantt.verticalSplitResizeLine.style.height = gantt.drawHeight + "px", gantt.verticalSplitResizeLine.style.backgroundColor = "rgba(0,0,0,0)", gantt.verticalSplitResizeLine.style.zIndex = "100", gantt.parsedOptions.verticalSplitLineMoveable && (gantt.verticalSplitResizeLine.style.cursor = "col-resize"), gantt.verticalSplitResizeLine.style.userSelect = "none", gantt.verticalSplitResizeLine.style.opacity = "1";
18762
18773
  const verticalSplitLine = gantt.verticalSplitResizeLine.childNodes[0];
18763
18774
  if (verticalSplitLine.style.position = "absolute", verticalSplitLine.style.top = "0px", verticalSplitLine.style.left = (14 - gantt.parsedOptions.verticalSplitLine.lineWidth) / 2 + "px", verticalSplitLine.style.width = gantt.parsedOptions.verticalSplitLine.lineWidth + "px", verticalSplitLine.style.height = "100%", verticalSplitLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLine.lineColor, verticalSplitLine.style.zIndex = "100", verticalSplitLine.style.userSelect = "none", verticalSplitLine.style.pointerEvents = "none", verticalSplitLine.style.transition = "background-color 0.3s", gantt.verticalSplitResizeLine.childNodes[1]) {
18764
18775
  const highlightLine = gantt.verticalSplitResizeLine.childNodes[1];
18765
- highlightLine.style.position = "absolute", highlightLine.style.top = "0px", highlightLine.style.left = (null !== (_a = 14 - gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _a ? _a : 2) / 2 + "px", highlightLine.style.width = (null !== (_b = gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) && void 0 !== _b ? _b : 2) + "px", highlightLine.style.height = "100%", highlightLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLineHighlight.lineColor, highlightLine.style.zIndex = "100", highlightLine.style.cursor = "col-resize", highlightLine.style.userSelect = "none", highlightLine.style.pointerEvents = "none", highlightLine.style.opacity = "0", highlightLine.style.transition = "background-color 0.3s";
18776
+ highlightLine.style.position = "absolute", highlightLine.style.top = "0px", highlightLine.style.left = (14 - gantt.parsedOptions.verticalSplitLineHighlight.lineWidth) / 2 + "px", highlightLine.style.width = gantt.parsedOptions.verticalSplitLineHighlight.lineWidth + "px", highlightLine.style.height = "100%", highlightLine.style.backgroundColor = gantt.parsedOptions.verticalSplitLineHighlight.lineColor, highlightLine.style.zIndex = "100", highlightLine.style.cursor = "col-resize", highlightLine.style.userSelect = "none", highlightLine.style.pointerEvents = "none", highlightLine.style.opacity = "0", highlightLine.style.transition = "background-color 0.3s";
18766
18777
  }
18767
18778
  }
18768
18779
  }
@@ -18794,6 +18805,7 @@
18794
18805
  for (let i = 0; i < records.length; i++) (null === (_a = records[i][childrenField]) || void 0 === _a ? void 0 : _a.length) ? clearRecordShowIndex(records[i][childrenField], childrenField) : delete records[i].vtable_gantt_showIndex;
18795
18806
  }
18796
18807
  function getTaskIndexsByTaskY(y, gantt) {
18808
+ var _a;
18797
18809
  let task_index, sub_task_index;
18798
18810
  if (gantt.taskListTableInstance) {
18799
18811
  const rowInfo = gantt.taskListTableInstance.getTargetRowAt(y + gantt.headerHeight);
@@ -18803,7 +18815,12 @@
18803
18815
  } = rowInfo;
18804
18816
  task_index = row - gantt.taskListTableInstance.columnHeaderLevelCount;
18805
18817
  const beforeRowsHeight = gantt.getRowsHeightByIndex(0, task_index - 1);
18806
- gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Inline && gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Arrange && gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Compact && gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Separate || (sub_task_index = Math.floor((y - beforeRowsHeight) / gantt.parsedOptions.rowHeight));
18818
+ if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate) sub_task_index = Math.floor((y - beforeRowsHeight) / gantt.parsedOptions.rowHeight);else if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
18819
+ const record = gantt.getRecordByIndex(task_index);
18820
+ if (record && record.type === TaskType.PROJECT && (null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0) {
18821
+ "expand" === record.hierarchyState || !1 === gantt.parsedOptions.projectSubTasksExpandable || (sub_task_index = Math.floor((y - beforeRowsHeight) / gantt.parsedOptions.rowHeight));
18822
+ }
18823
+ }
18807
18824
  }
18808
18825
  } else task_index = Math.floor(y / gantt.parsedOptions.rowHeight);
18809
18826
  return {
@@ -18886,13 +18903,13 @@
18886
18903
  };
18887
18904
  }
18888
18905
  function updateOptionsWhenRecordChanged(gantt) {
18889
- var _a, _b, _c, _d, _e, _f;
18906
+ var _a, _b, _c, _d, _e, _f, _g;
18890
18907
  const options = gantt.options,
18891
18908
  {
18892
18909
  unit: minTimeUnit,
18893
18910
  startOfWeek: startOfWeek
18894
18911
  } = gantt.parsedOptions.reverseSortedTimelineScales[0];
18895
- gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine), null !== (_b = null === (_a = gantt.parsedOptions.markLine) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b && _b && ((null === (_c = gantt.parsedOptions.markLine) || void 0 === _c ? void 0 : _c.every(item => void 0 === item.scrollToMarkLine)) && (gantt.parsedOptions.markLine[0].scrollToMarkLine = !0), (null === (_d = gantt.parsedOptions.markLine) || void 0 === _d ? void 0 : _d.find(item => item.scrollToMarkLine)) && (gantt.parsedOptions.scrollToMarkLineDate = getStartDateByTimeUnit(new Date(null === (_e = gantt.parsedOptions.markLine) || void 0 === _e ? void 0 : _e.find(item => item.scrollToMarkLine).date), minTimeUnit, startOfWeek))), gantt.parsedOptions.dependencyLinks = null === (_f = options.dependency) || void 0 === _f ? void 0 : _f.links;
18912
+ gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine), null !== (_b = null === (_a = gantt.parsedOptions.markLine) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b && _b && ((null === (_c = gantt.parsedOptions.markLine) || void 0 === _c ? void 0 : _c.every(item => void 0 === item.scrollToMarkLine)) && (gantt.parsedOptions.markLine[0].scrollToMarkLine = !0), (null === (_d = gantt.parsedOptions.markLine) || void 0 === _d ? void 0 : _d.find(item => item.scrollToMarkLine)) && (gantt.parsedOptions.scrollToMarkLineDate = getStartDateByTimeUnit(new Date(null === (_e = gantt.parsedOptions.markLine) || void 0 === _e ? void 0 : _e.find(item => item.scrollToMarkLine).date), minTimeUnit, startOfWeek))), gantt.parsedOptions.dependencyLinks = null !== (_g = null === (_f = options.dependency) || void 0 === _f ? void 0 : _f.links) && void 0 !== _g ? _g : [];
18896
18913
  }
18897
18914
  function updateOptionsWhenDateRangeChanged(gantt) {
18898
18915
  var _a, _b;
@@ -18923,7 +18940,7 @@
18923
18940
  progress: progress,
18924
18941
  taskRecord: taskRecord
18925
18942
  } = gantt.getTaskInfoByTaskListIndex(taskIndex.task_index, i);
18926
- if (((gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange) && taskRecord.vtable_gantt_showIndex === taskIndex.sub_task_index || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) && dateRange.startDate.getTime() >= startDate.getTime() && dateRange.endDate.getTime() <= endDate.getTime()) return {
18943
+ if (((gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange) && taskRecord.vtable_gantt_showIndex === taskIndex.sub_task_index || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline || gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline && recordParent.type === TaskType.PROJECT && "expand" !== recordParent.hierarchyState && !1 !== gantt.parsedOptions.projectSubTasksExpandable) && dateRange.startDate.getTime() >= startDate.getTime() && dateRange.endDate.getTime() <= endDate.getTime()) return {
18927
18944
  startDate: startDate,
18928
18945
  endDate: endDate,
18929
18946
  taskDays: taskDays,
@@ -18949,6 +18966,32 @@
18949
18966
  return marklineTime >= beginTime && marklineTime <= endTime;
18950
18967
  });
18951
18968
  }
18969
+ function initProjectTaskTimes(gantt) {
18970
+ if (!gantt.records || 0 === gantt.records.length) return;
18971
+ const startDateField = gantt.parsedOptions.startDateField,
18972
+ endDateField = gantt.parsedOptions.endDateField,
18973
+ processTasksRecursively = (records, parentIndex, parentArray) => {
18974
+ let earliestStartAll = null,
18975
+ latestEndAll = null;
18976
+ return records.forEach((record, index) => {
18977
+ var _a;
18978
+ if (!record) return;
18979
+ let earliestStart = null,
18980
+ latestEnd = null;
18981
+ if (record.children && record.children.length > 0 && record.type === TaskType.PROJECT) {
18982
+ const [childrenEarliestStart, childrenLatestEnd] = processTasksRecursively(record.children);
18983
+ if (childrenEarliestStart && childrenLatestEnd && (earliestStart = childrenEarliestStart, latestEnd = childrenLatestEnd, record.type === TaskType.PROJECT)) {
18984
+ const dateFormat = null !== (_a = gantt.parsedOptions.dateFormat) && void 0 !== _a ? _a : gantt.parseTimeFormat(record[startDateField] || record.children[0][startDateField] || ""),
18985
+ formatDateValue = date => gantt.formatDate ? gantt.formatDate(date, dateFormat) : date.toISOString().split("T")[0],
18986
+ updatedRecord = Object.assign({}, record);
18987
+ updatedRecord[startDateField] = formatDateValue(earliestStart), updatedRecord[endDateField] = formatDateValue(latestEnd), records[index] = updatedRecord;
18988
+ }
18989
+ } else record[startDateField] && record[endDateField] && (earliestStart = new Date(record[startDateField]), latestEnd = new Date(record[endDateField]));
18990
+ earliestStart && (!earliestStartAll || earliestStart < earliestStartAll) && (earliestStartAll = earliestStart), latestEnd && (!latestEndAll || latestEnd > latestEndAll) && (latestEndAll = latestEnd);
18991
+ }), [earliestStartAll, latestEndAll];
18992
+ };
18993
+ processTasksRecursively(gantt.records);
18994
+ }
18952
18995
 
18953
18996
  const DEFAULT_MARKLINE_CREATION_ICON = '<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1471" width="24" height="24"> <path d="M840.05 153.35a27.61875 27.61875 0 0 0-22.95-4.95c-56.25 13.05-218.25 39.6-289.8 2.25-115.65-60.75-241.65-31.95-299.7-13.05V95.75a27.05625 27.05625 0 0 0-27-27 27.05625 27.05625 0 0 0-27 27v834.75c0 14.85 12.15 27 27 27s27-12.15 27-27V611.9c44.1-13.95 199.35-56.25 293.85 1.8 45.9 28.35 96.75 37.8 143.55 37.8 89.1 0 164.7-34.2 169.65-36.45a27.9 27.9 0 0 0 15.75-24.75V174.5a27.5625 27.5625 0 0 0-10.35-21.15z" fill="#f54319" p-id="1472"></path></svg>';
18954
18997
  class TimelineHeader {
@@ -19221,6 +19264,44 @@
19221
19264
  const TASKBAR_HOVER_ICON = '<svg width="100" height="200" xmlns="http://www.w3.org/2000/svg">\n <line x1="30" y1="10" x2="30" y2="190" stroke="black" stroke-width="4"/>\n <line x1="70" y1="10" x2="70" y2="190" stroke="black" stroke-width="4"/>\n</svg>';
19222
19265
  const TASKBAR_HOVER_ICON_WIDTH = 10;
19223
19266
  class TaskBar {
19267
+ formatMilestoneText(text, record) {
19268
+ if (!text) return "";
19269
+ const matches = text.match(/{([^}]+)}/g);
19270
+ return matches && matches.forEach(match => {
19271
+ const fieldName = match.substring(1, match.length - 1),
19272
+ fieldValue = record[fieldName];
19273
+ void 0 !== fieldValue && (text = text.replace(match, String(fieldValue)));
19274
+ }), text;
19275
+ }
19276
+ calculateMilestoneTextPosition(position, milestoneWidth) {
19277
+ let padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 4;
19278
+ const paddingVal = "number" == typeof padding ? padding : 4;
19279
+ let textX = 0,
19280
+ textY = 0,
19281
+ textAlignValue = "left",
19282
+ textBaselineValue = "middle";
19283
+ const center = milestoneWidth / 2;
19284
+ switch (position) {
19285
+ case "left":
19286
+ textX = -paddingVal, textY = center, textAlignValue = "end", textBaselineValue = "middle";
19287
+ break;
19288
+ case "right":
19289
+ default:
19290
+ textX = milestoneWidth + paddingVal, textY = center, textAlignValue = "start", textBaselineValue = "middle";
19291
+ break;
19292
+ case "top":
19293
+ textX = center, textY = -paddingVal, textAlignValue = "center", textBaselineValue = "bottom";
19294
+ break;
19295
+ case "bottom":
19296
+ textX = center, textY = milestoneWidth + paddingVal, textAlignValue = "center", textBaselineValue = "top";
19297
+ }
19298
+ return {
19299
+ textX: textX,
19300
+ textY: textY,
19301
+ textAlignValue: textAlignValue,
19302
+ textBaselineValue: textBaselineValue
19303
+ };
19304
+ }
19224
19305
  constructor(scene) {
19225
19306
  this.selectedBorders = [], this._scene = scene, this.width = scene._gantt.tableNoFrameWidth, this.height = scene._gantt.gridHeight, this.group = new Group({
19226
19307
  x: 0,
@@ -19232,7 +19313,7 @@
19232
19313
  }), this.group.name = "task-bar-container", scene.ganttGroup.addChild(this.group), this.initBars(), this.initHoverBarIcons();
19233
19314
  }
19234
19315
  initBars() {
19235
- var _a, _b;
19316
+ var _a, _b, _c;
19236
19317
  this.barContainer = new Group({
19237
19318
  x: 0,
19238
19319
  y: 0,
@@ -19242,8 +19323,31 @@
19242
19323
  clip: !0
19243
19324
  }), this.group.appendChild(this.barContainer);
19244
19325
  for (let i = 0; i < this._scene._gantt.itemCount; i++) if (this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Inline && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Separate && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Arrange && this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Compact) {
19245
- const barGroup = this.initBar(i);
19246
- barGroup && this.barContainer.appendChild(barGroup);
19326
+ if (this._scene._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Project_Sub_Tasks_Inline) {
19327
+ const barGroup = this.initBar(i);
19328
+ barGroup && this.barContainer.appendChild(barGroup);
19329
+ } else {
19330
+ const record = this._scene._gantt.getRecordByIndex(i),
19331
+ isExpanded = "expand" === record.hierarchyState;
19332
+ if (record.type === TaskType.PROJECT && (null === (_c = record.children) || void 0 === _c ? void 0 : _c.length) > 0 && !isExpanded) {
19333
+ const recordIndex = this._scene._gantt.getRecordIndexByTaskShowIndex(i),
19334
+ sub_task_indexs = Array.isArray(recordIndex) ? [...recordIndex] : [recordIndex],
19335
+ callInitBar = (record, sub_task_indexs) => {
19336
+ var _a, _b;
19337
+ if ((null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0) for (let j = 0; j < (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length); j++) {
19338
+ const child_record = record.children[j];
19339
+ if (child_record.type !== TaskType.PROJECT) {
19340
+ const barGroup = this.initBar(i, [...sub_task_indexs, j], record.children.length);
19341
+ barGroup && this.barContainer.appendChild(barGroup);
19342
+ } else callInitBar(child_record, [...sub_task_indexs, j]);
19343
+ }
19344
+ };
19345
+ callInitBar(record, sub_task_indexs);
19346
+ } else {
19347
+ const barGroup = this.initBar(i);
19348
+ barGroup && this.barContainer.appendChild(barGroup);
19349
+ }
19350
+ }
19247
19351
  } else {
19248
19352
  const record = this._scene._gantt.getRecordByIndex(i);
19249
19353
  if ((null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0) for (let j = 0; j < (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length); j++) {
@@ -19256,7 +19360,7 @@
19256
19360
  }
19257
19361
  }
19258
19362
  initBar(index, childIndex, childrenLength) {
19259
- var _a, _b, _c;
19363
+ var _a, _b, _c, _d, _e;
19260
19364
  const taskBarCustomLayout = this._scene._gantt.parsedOptions.taskBarCustomLayout,
19261
19365
  {
19262
19366
  startDate: startDate,
@@ -19265,7 +19369,7 @@
19265
19369
  progress: progress,
19266
19370
  taskRecord: taskRecord
19267
19371
  } = this._scene._gantt.getTaskInfoByTaskListIndex(index, childIndex),
19268
- isMilestone = "milestone" === taskRecord.type;
19372
+ isMilestone = taskRecord.type === TaskType.MILESTONE;
19269
19373
  if (isMilestone && !startDate || !isMilestone && (taskDays <= 0 || !startDate || !endDate || startDate.getTime() > endDate.getTime())) return null;
19270
19374
  const {
19271
19375
  unit: unit,
@@ -19274,17 +19378,17 @@
19274
19378
  taskBarSize = computeCountToTimeScale(endDate, startDate, unit, step, 1) * this._scene._gantt.parsedOptions.timelineColWidth,
19275
19379
  taskBarStyle = this._scene._gantt.getTaskBarStyle(index, childIndex),
19276
19380
  taskbarHeight = taskBarStyle.width,
19277
- oneTaskHeigth = (createDateAtMidnight(this._scene._gantt.parsedOptions.minDate), this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ? computeRowsCountByRecordDate(this._scene._gantt, this._scene._gantt.records[index]) : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact && computeRowsCountByRecordDateForCompact(this._scene._gantt, this._scene._gantt.records[index])), this._scene._gantt.parsedOptions.rowHeight),
19381
+ oneTaskHeigth = this._scene._gantt.parsedOptions.rowHeight,
19278
19382
  milestoneTaskBarHeight = this._scene._gantt.parsedOptions.taskBarMilestoneStyle.width,
19279
19383
  x = computeCountToTimeScale(startDate, this._scene._gantt.parsedOptions.minDate, unit, step) * this._scene._gantt.parsedOptions.timelineColWidth - (isMilestone ? milestoneTaskBarHeight / 2 : 0),
19280
- y = this._scene._gantt.getRowsHeightByIndex(0, index - 1) + (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ? (null != childIndex ? childIndex : 0) * oneTaskHeigth : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? taskRecord.vtable_gantt_showIndex * oneTaskHeigth : 0) + (oneTaskHeigth - (isMilestone ? milestoneTaskBarHeight : taskbarHeight)) / 2,
19384
+ y = this._scene._gantt.getRowsHeightByIndex(0, index - 1) + (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ? (null !== (_a = childIndex) && void 0 !== _a ? _a : 0) * oneTaskHeigth : this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? taskRecord.vtable_gantt_showIndex * oneTaskHeigth : 0) + (oneTaskHeigth - (isMilestone ? milestoneTaskBarHeight : taskbarHeight)) / 2,
19281
19385
  barGroupBox = new GanttTaskBarNode({
19282
19386
  x: x,
19283
19387
  y: y,
19284
19388
  width: isMilestone ? milestoneTaskBarHeight : taskBarSize,
19285
19389
  height: isMilestone ? milestoneTaskBarHeight : taskbarHeight,
19286
19390
  cornerRadius: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius : taskBarStyle.cornerRadius,
19287
- lineWidth: isMilestone ? 2 * this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderLineWidth : 2 * (null !== (_a = taskBarStyle.borderLineWidth) && void 0 !== _a ? _a : taskBarStyle.borderWidth),
19391
+ lineWidth: isMilestone ? 2 * this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderLineWidth : 2 * (null !== (_b = taskBarStyle.borderLineWidth) && void 0 !== _b ? _b : taskBarStyle.borderWidth),
19288
19392
  stroke: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.borderColor : taskBarStyle.borderColor,
19289
19393
  angle: isMilestone ? .25 * Math.PI : 0,
19290
19394
  anchor: isMilestone ? [x + milestoneTaskBarHeight / 2, y + milestoneTaskBarHeight / 2] : void 0
@@ -19317,7 +19421,7 @@
19317
19421
  ganttInstance: this._scene._gantt
19318
19422
  });
19319
19423
  } else customLayoutObj = taskBarCustomLayout;
19320
- customLayoutObj && (rootContainer = customLayoutObj.rootContainer, renderDefaultBar = null !== (_b = customLayoutObj.renderDefaultBar) && void 0 !== _b && _b, renderDefaultText = null !== (_c = customLayoutObj.renderDefaultText) && void 0 !== _c && _c, rootContainer && (rootContainer.name = "task-bar-custom-render"));
19424
+ customLayoutObj && (rootContainer = customLayoutObj.rootContainer, renderDefaultBar = null !== (_c = customLayoutObj.renderDefaultBar) && void 0 !== _c && _c, renderDefaultText = null !== (_d = customLayoutObj.renderDefaultText) && void 0 !== _d && _d, rootContainer && (rootContainer.name = "task-bar-custom-render"));
19321
19425
  }
19322
19426
  if (renderDefaultBar) {
19323
19427
  const rect = createRect({
@@ -19328,7 +19432,7 @@
19328
19432
  fill: isMilestone ? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.fillColor : taskBarStyle.barColor,
19329
19433
  pickable: !1
19330
19434
  });
19331
- if (rect.name = "task-bar-rect", barGroup.appendChild(rect), barGroupBox.barRect = rect, "milestone" !== taskRecord.type) {
19435
+ if (rect.name = "task-bar-rect", barGroup.appendChild(rect), barGroupBox.barRect = rect, taskRecord.type !== TaskType.MILESTONE) {
19332
19436
  const progress_rect = createRect({
19333
19437
  x: 0,
19334
19438
  y: 0,
@@ -19340,7 +19444,7 @@
19340
19444
  progress_rect.name = "task-bar-progress-rect", barGroup.appendChild(progress_rect), barGroupBox.progressRect = progress_rect;
19341
19445
  }
19342
19446
  }
19343
- if (rootContainer && barGroup.appendChild(rootContainer), renderDefaultText && "milestone" !== taskRecord.type) {
19447
+ if (rootContainer && barGroup.appendChild(rootContainer), renderDefaultText && taskRecord.type !== TaskType.MILESTONE) {
19344
19448
  const {
19345
19449
  textAlign: textAlign,
19346
19450
  textBaseline: textBaseline,
@@ -19368,6 +19472,31 @@
19368
19472
  });
19369
19473
  barGroup.appendChild(label), barGroupBox.textLabel = label, barGroupBox.labelStyle = this._scene._gantt.parsedOptions.taskBarLabelStyle, barGroupBox.updateTextPosition();
19370
19474
  }
19475
+ if (renderDefaultText && "milestone" === taskRecord.type && this._scene._gantt.parsedOptions.taskBarMilestoneStyle.labelText) {
19476
+ const milestoneStyle = this._scene._gantt.parsedOptions.taskBarMilestoneStyle,
19477
+ textStyle = milestoneStyle.labelTextStyle || {},
19478
+ pos = this.calculateMilestoneTextPosition(milestoneStyle.textOrient || "right", milestoneStyle.width, null !== (_e = textStyle.padding) && void 0 !== _e ? _e : 4),
19479
+ textContainer = new Group({
19480
+ x: x,
19481
+ y: y,
19482
+ width: milestoneStyle.width,
19483
+ height: milestoneStyle.width,
19484
+ angle: 0,
19485
+ pickable: !1
19486
+ }),
19487
+ milestoneLabel = createText({
19488
+ x: pos.textX,
19489
+ y: pos.textY,
19490
+ fontSize: textStyle.fontSize || 16,
19491
+ fontFamily: textStyle.fontFamily || "Arial",
19492
+ fill: textStyle.color || "#ff0000",
19493
+ textBaseline: textStyle.textBaseline || pos.textBaselineValue,
19494
+ textAlign: textStyle.textAlign || pos.textAlignValue,
19495
+ text: this.formatMilestoneText(milestoneStyle.labelText, taskRecord),
19496
+ pickable: !1
19497
+ });
19498
+ textContainer.appendChild(milestoneLabel), this.barContainer.appendChild(textContainer), barGroupBox.milestoneTextLabel = milestoneLabel, barGroupBox.milestoneTextContainer = textContainer;
19499
+ }
19371
19500
  return barGroupBox;
19372
19501
  }
19373
19502
  updateTaskBarNode(index, sub_task_index) {
@@ -19440,14 +19569,14 @@
19440
19569
  } = this._scene._gantt.getTaskInfoByTaskListIndex(target.task_index, target.sub_task_index);
19441
19570
  target && "task-bar" === target.name && target.appendChild(this.hoverBarGroup), this.hoverBarGroup.setAttribute("x", 0), this.hoverBarGroup.setAttribute("y", 0), this.hoverBarGroup.setAttribute("width", width), this.hoverBarGroup.setAttribute("height", height), this.hoverBarGroup.setAttribute("visibleAll", !0);
19442
19571
  const taskBarStyle = this._scene._gantt.getTaskBarStyle(target.task_index, target.sub_task_index);
19443
- if ("milestone" === taskRecord.type) this.hoverBarGroup.setAttribute("cornerRadius", target.attribute.cornerRadius);else {
19572
+ if (taskRecord.type === TaskType.MILESTONE) this.hoverBarGroup.setAttribute("cornerRadius", target.attribute.cornerRadius);else {
19444
19573
  const cornerRadius = null !== (_b = null !== (_a = this._scene._gantt.parsedOptions.taskBarHoverStyle.cornerRadius) && void 0 !== _a ? _a : taskBarStyle.cornerRadius) && void 0 !== _b ? _b : 0;
19445
19574
  this.hoverBarGroup.setAttribute("cornerRadius", cornerRadius);
19446
19575
  }
19447
19576
  null === (_c = this.hoverBarLeftIcon) || void 0 === _c || _c.setAttribute("visible", !1), null === (_d = this.hoverBarRightIcon) || void 0 === _d || _d.setAttribute("visible", !1);
19448
19577
  let leftResizable = !0,
19449
19578
  rightResizable = !0;
19450
- if ("milestone" === taskRecord.type) leftResizable = !1, rightResizable = !1;else if ("function" == typeof this._scene._gantt.parsedOptions.taskBarResizable) {
19579
+ if (taskRecord.type === TaskType.MILESTONE) leftResizable = !1, rightResizable = !1;else if ("function" == typeof this._scene._gantt.parsedOptions.taskBarResizable) {
19451
19580
  const arg = {
19452
19581
  index: target.task_index,
19453
19582
  startDate: startDate,
@@ -19494,7 +19623,7 @@
19494
19623
  anchor: [width / 2, height / 2]
19495
19624
  });
19496
19625
  if (selectedBorder.appendChild(selectRectBorder), showLinkPoint) {
19497
- const linePointPadding = "milestone" === record.type ? 15 : 10,
19626
+ const linePointPadding = record.type === TaskType.MILESTONE ? 15 : 10,
19498
19627
  linkPointContainer = new Group({
19499
19628
  x: -linePointPadding,
19500
19629
  y: 0,
@@ -19598,8 +19727,14 @@
19598
19727
  unit: unit,
19599
19728
  step: step
19600
19729
  } = this._scene._gantt.parsedOptions.reverseSortedTimelineScales[0],
19601
- unitCount = computeCountToTimeScale(date, minDate, unit, step),
19602
- dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + ("right" === line.position ? 1 : "middle" === line.position ? .5 : 0)),
19730
+ unitCount = computeCountToTimeScale(date, minDate, unit, step);
19731
+ let positionOffset = 0;
19732
+ if ("right" === line.position) positionOffset = 1;else if ("middle" === line.position) positionOffset = .5;else if ("date" === line.position) {
19733
+ const date = createDateAtMidnight(line.date),
19734
+ unitCount = computeCountToTimeScale(date, minDate, unit, step);
19735
+ positionOffset = unitCount - Math.floor(unitCount);
19736
+ }
19737
+ const dateX = this._scene._gantt.parsedOptions.timelineColWidth * (Math.floor(unitCount) + positionOffset),
19603
19738
  markLineGroup = new Group({
19604
19739
  pickable: !1,
19605
19740
  x: dateX - this.markLineContainerWidth / 2,
@@ -19874,7 +20009,7 @@
19874
20009
  }), this.group.name = "dependency-link-container", scene.ganttGroup.addChild(this.group), this.initLinkLines();
19875
20010
  }
19876
20011
  initLinkLines() {
19877
- var _a, _b, _c;
20012
+ var _a;
19878
20013
  if (clearRecordLinkInfos(this._scene._gantt.records), this.linkLinesContainer = new Group({
19879
20014
  x: 0,
19880
20015
  y: 0,
@@ -19882,7 +20017,7 @@
19882
20017
  height: this._scene._gantt.getAllTaskBarsHeight(),
19883
20018
  pickable: !1,
19884
20019
  clip: !0
19885
- }), this.group.appendChild(this.linkLinesContainer), null === (_a = this._scene._gantt.records) || void 0 === _a ? void 0 : _a.length) for (let i = 0; null !== (_c = i < (null === (_b = this._scene._gantt.parsedOptions.dependencyLinks) || void 0 === _b ? void 0 : _b.length)) && void 0 !== _c && _c; i++) this.initLinkLine(i);
20020
+ }), this.group.appendChild(this.linkLinesContainer), null === (_a = this._scene._gantt.records) || void 0 === _a ? void 0 : _a.length) for (let i = 0; i < this._scene._gantt.parsedOptions.dependencyLinks.length; i++) this.initLinkLine(i);
19886
20021
  }
19887
20022
  initLinkLine(index) {
19888
20023
  var _a, _b;
@@ -19908,7 +20043,21 @@
19908
20043
  startDate: linkedFromTaskStartDate,
19909
20044
  endDate: linkedFromTaskEndDate,
19910
20045
  taskDays: linkedFromTaskTaskDays
19911
- } = this._scene._gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));else if (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) {
20046
+ } = this._scene._gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));else if (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
20047
+ const fromParentRecordShowIndex = this._scene._gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index.slice(0, -1)),
20048
+ toParentRecordShowIndex = this._scene._gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index.slice(0, -1)),
20049
+ fromParentRecord = this._scene._gantt.getRecordByIndex(fromParentRecordShowIndex),
20050
+ toParentRecord = this._scene._gantt.getRecordByIndex(toParentRecordShowIndex);
20051
+ linkedFromTaskShowIndex = fromParentRecord.type === TaskType.PROJECT && "expand" !== fromParentRecord.hierarchyState && !1 !== this._scene._gantt.parsedOptions.projectSubTasksExpandable ? fromParentRecordShowIndex : this._scene._gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index), linkedToTaskShowIndex = toParentRecord.type === TaskType.PROJECT && "expand" !== toParentRecord.hierarchyState && !1 !== this._scene._gantt.parsedOptions.projectSubTasksExpandable ? toParentRecordShowIndex : this._scene._gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index), ({
20052
+ startDate: linkedToTaskStartDate,
20053
+ endDate: linkedToTaskEndDate,
20054
+ taskDays: linkedToTaskTaskDays
20055
+ } = this._scene._gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex, linkedToTaskRecord.index)), ({
20056
+ startDate: linkedFromTaskStartDate,
20057
+ endDate: linkedFromTaskEndDate,
20058
+ taskDays: linkedFromTaskTaskDays
20059
+ } = this._scene._gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex, linkedFromTaskRecord.index));
20060
+ } else if (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) {
19912
20061
  linkedFromTaskShowIndex = this._scene._gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / this._scene._gantt.parsedOptions.rowHeight + (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? linkedFromTaskRecord.record.vtable_gantt_showIndex : null !== (_a = linkedFromTaskRecord.index[1]) && void 0 !== _a ? _a : 0);
19913
20062
  linkedToTaskShowIndex = this._scene._gantt.getRowsHeightByIndex(0, linkedToTaskRecord.index[0] - 1) / this._scene._gantt.parsedOptions.rowHeight + (this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || this._scene._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? linkedToTaskRecord.record.vtable_gantt_showIndex : null !== (_b = linkedToTaskRecord.index[1]) && void 0 !== _b ? _b : 0), ({
19914
20063
  startDate: linkedToTaskStartDate,
@@ -19933,7 +20082,7 @@
19933
20082
  const {
19934
20083
  arrowPoints: arrowPoints,
19935
20084
  linePoints: linePoints
19936
- } = generateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, "milestone" === linkedFromTaskRecord.record.type, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, "milestone" === linkedToTaskRecord.record.type, this._scene._gantt),
20085
+ } = generateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, linkedFromTaskRecord.record.type === TaskType.MILESTONE, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, linkedToTaskRecord.record.type === TaskType.MILESTONE, this._scene._gantt),
19937
20086
  lineStyle = this._scene._gantt.parsedOptions.dependencyLinkLineStyle,
19938
20087
  lineObj = createLine({
19939
20088
  pickable: !0,
@@ -20532,6 +20681,20 @@
20532
20681
  } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));
20533
20682
  const taskbarHeight = taskBarStyle.width;
20534
20683
  diffY = target.attribute.y + taskbarHeight / 2 - (linkedToTaskShowIndex + .5) * gantt.parsedOptions.rowHeight;
20684
+ } else if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
20685
+ const fromParentRecordShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index.slice(0, -1)),
20686
+ toParentRecordShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index.slice(0, -1)),
20687
+ fromParentRecord = gantt.getRecordByIndex(fromParentRecordShowIndex),
20688
+ toParentRecord = gantt.getRecordByIndex(toParentRecordShowIndex);
20689
+ linkedFromTaskShowIndex = fromParentRecord.type === TaskType.PROJECT && "expand" !== fromParentRecord.hierarchyState && !1 !== gantt.parsedOptions.projectSubTasksExpandable ? fromParentRecordShowIndex : gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index), linkedToTaskShowIndex = toParentRecord.type === TaskType.PROJECT && "expand" !== toParentRecord.hierarchyState && !1 !== gantt.parsedOptions.projectSubTasksExpandable ? toParentRecordShowIndex : gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index), ({
20690
+ startDate: linkedToTaskStartDate,
20691
+ endDate: linkedToTaskEndDate,
20692
+ taskDays: linkedToTaskTaskDays
20693
+ } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex, linkedToTaskRecord.index)), ({
20694
+ startDate: linkedFromTaskStartDate,
20695
+ endDate: linkedFromTaskEndDate,
20696
+ taskDays: linkedFromTaskTaskDays
20697
+ } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex, linkedFromTaskRecord.index));
20535
20698
  } else if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) {
20536
20699
  const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);
20537
20700
  linkedFromTaskShowIndex = gantt.getRowsHeightByIndex(0, linkedFromTaskRecord.index[0] - 1) / gantt.parsedOptions.rowHeight + (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? linkedFromTaskRecord.record.vtable_gantt_showIndex : linkedFromTaskRecord.index[1]);
@@ -20562,7 +20725,7 @@
20562
20725
  const {
20563
20726
  linePoints: linePoints,
20564
20727
  arrowPoints: arrowPoints
20565
- } = updateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, "milestone" === linkedFromTaskRecord.record.type, null, 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, "milestone" === linkedToTaskRecord.record.type, target, null != diffY ? diffY : 0, this._gantt);
20728
+ } = updateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, linkedFromTaskRecord.record.type === TaskType.MILESTONE, null, 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, linkedToTaskRecord.record.type === TaskType.MILESTONE, target, null != diffY ? diffY : 0, this._gantt);
20566
20729
  linkLineNode.setAttribute("points", linePoints), lineArrowNode.setAttribute("points", arrowPoints);
20567
20730
  }
20568
20731
  for (let i = 0; i < (null == vtable_gantt_linkedFrom ? void 0 : vtable_gantt_linkedFrom.length); i++) {
@@ -20595,6 +20758,20 @@
20595
20758
  } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskRecord.index[0], linkedFromTaskRecord.index[1]));
20596
20759
  const taskbarHeight = taskBarStyle.width;
20597
20760
  diffY = target.attribute.y + taskbarHeight / 2 - (linkedFromTaskShowIndex + .5) * gantt.parsedOptions.rowHeight;
20761
+ } else if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
20762
+ const fromParentRecordShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index.slice(0, -1)),
20763
+ toParentRecordShowIndex = gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index.slice(0, -1)),
20764
+ fromParentRecord = gantt.getRecordByIndex(fromParentRecordShowIndex),
20765
+ toParentRecord = gantt.getRecordByIndex(toParentRecordShowIndex);
20766
+ linkedFromTaskShowIndex = fromParentRecord.type === TaskType.PROJECT && "expand" !== fromParentRecord.hierarchyState && !1 !== gantt.parsedOptions.projectSubTasksExpandable ? fromParentRecordShowIndex : gantt.getTaskShowIndexByRecordIndex(linkedFromTaskRecord.index), linkedToTaskShowIndex = toParentRecord.type === TaskType.PROJECT && "expand" !== toParentRecord.hierarchyState && !1 !== gantt.parsedOptions.projectSubTasksExpandable ? toParentRecordShowIndex : gantt.getTaskShowIndexByRecordIndex(linkedToTaskRecord.index), ({
20767
+ startDate: linkedToTaskStartDate,
20768
+ endDate: linkedToTaskEndDate,
20769
+ taskDays: linkedToTaskTaskDays
20770
+ } = gantt.getTaskInfoByTaskListIndex(linkedToTaskShowIndex, linkedToTaskRecord.index)), ({
20771
+ startDate: linkedFromTaskStartDate,
20772
+ endDate: linkedFromTaskEndDate,
20773
+ taskDays: linkedFromTaskTaskDays
20774
+ } = gantt.getTaskInfoByTaskListIndex(linkedFromTaskShowIndex, linkedFromTaskRecord.index));
20598
20775
  } else if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) {
20599
20776
  const new_indexs = getTaskIndexsByTaskY(target.attribute.y + dy, gantt);
20600
20777
  linkedFromTaskShowIndex = gantt.getRowsHeightByIndex(0, new_indexs.task_index - 1) / gantt.parsedOptions.rowHeight + (gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact ? linkedFromTaskRecord.record.vtable_gantt_showIndex : new_indexs.sub_task_index);
@@ -20625,7 +20802,7 @@
20625
20802
  const {
20626
20803
  linePoints: linePoints,
20627
20804
  arrowPoints: arrowPoints
20628
- } = updateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, "milestone" === linkedFromTaskRecord.record.type, target, null != diffY ? diffY : 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, "milestone" === linkedToTaskRecord.record.type, null, 0, this._gantt);
20805
+ } = updateLinkLinePoints(type, linkedFromTaskStartDate, linkedFromTaskEndDate, linkedFromTaskShowIndex, linkedFromTaskTaskDays, linkedFromTaskRecord.record.type === TaskType.MILESTONE, target, null != diffY ? diffY : 0, linkedToTaskStartDate, linkedToTaskEndDate, linkedToTaskShowIndex, linkedToTaskTaskDays, linkedToTaskRecord.record.type === TaskType.MILESTONE, null, 0, this._gantt);
20629
20806
  linkLineNode.setAttribute("points", linePoints), lineArrowNode.setAttribute("points", arrowPoints);
20630
20807
  }
20631
20808
  }
@@ -20970,7 +21147,8 @@
20970
21147
  if (0 !== e.button) return;
20971
21148
  let downBarNode, downLeftLinkPointNode, downRightLinkPointNode;
20972
21149
  if (e.detailPath.find(pathNode => "task-bar" === pathNode.name ? (downBarNode = pathNode, !0) : "task-creation-button" === pathNode.name ? (!0) : "task-bar-link-point-left" === pathNode.name ? (downLeftLinkPointNode = pathNode, !0) : "task-bar-link-point-right" === pathNode.name ? (downRightLinkPointNode = pathNode, !0) : !!pathNode.attribute.vtable_link && (pathNode.attribute.vtable_link, !0)), downBarNode) {
20973
- if ("task-bar-hover-shadow-left-icon" === e.target.name) stateManager.startResizeTaskBar(downBarNode, e.nativeEvent.x, e.nativeEvent.y, e.offset.y, "left"), stateManager.updateInteractionState(InteractionState.grabing);else if ("task-bar-hover-shadow-right-icon" === e.target.name) stateManager.startResizeTaskBar(downBarNode, e.nativeEvent.x, e.nativeEvent.y, e.offset.y, "right"), stateManager.updateInteractionState(InteractionState.grabing);else if (gantt.parsedOptions.taskBarMoveable) {
21150
+ const taskRecord = downBarNode.record;
21151
+ if (!((null == taskRecord ? void 0 : taskRecord.type) === TaskType.PROJECT)) if ("task-bar-hover-shadow-left-icon" === e.target.name) stateManager.startResizeTaskBar(downBarNode, e.nativeEvent.x, e.nativeEvent.y, e.offset.y, "left"), stateManager.updateInteractionState(InteractionState.grabing);else if ("task-bar-hover-shadow-right-icon" === e.target.name) stateManager.startResizeTaskBar(downBarNode, e.nativeEvent.x, e.nativeEvent.y, e.offset.y, "right"), stateManager.updateInteractionState(InteractionState.grabing);else if (gantt.parsedOptions.taskBarMoveable) {
20974
21152
  const moveTaskBar = () => {
20975
21153
  let moveable = !0;
20976
21154
  if ("function" == typeof gantt.parsedOptions.taskBarMoveable) {
@@ -21002,11 +21180,12 @@
21002
21180
  marklineCreateGroupTarget = e.detailPath.find(pathNode => "markline-hover-group" === pathNode.name),
21003
21181
  marklineContentGroupTarget = e.detailPath.find(pathNode => "mark-line-content" === pathNode.name);
21004
21182
  if ((null === (_a = gantt.parsedOptions.markLineCreateOptions) || void 0 === _a ? void 0 : _a.markLineCreatable) && (marklineCreateGroupTarget && !judgeIfHasMarkLine(marklineCreateGroupTarget.data, gantt.parsedOptions.markLine) ? scene._gantt.stateManager.marklineIcon.target !== marklineCreateGroupTarget && (scene._gantt.stateManager.marklineIcon.target = marklineCreateGroupTarget, stateManager.showMarklineIconHover()) : scene._gantt.stateManager.marklineIcon.target && stateManager.hideMarklineIconHover()), taskBarTarget) {
21005
- if (scene._gantt.stateManager.hoverTaskBar.target !== taskBarTarget && (scene._gantt.stateManager.hoverTaskBar.target = taskBarTarget, stateManager.showTaskBarHover(), scene._gantt.hasListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR))) {
21183
+ if (scene._gantt.stateManager.hoverTaskBar.target !== taskBarTarget) {
21184
+ scene._gantt.stateManager.hoverTaskBar.target = taskBarTarget;
21006
21185
  const taskIndex = taskBarTarget.task_index,
21007
21186
  sub_task_index = taskBarTarget.sub_task_index,
21008
- record = scene._gantt.getRecordByIndex(taskIndex, sub_task_index);
21009
- scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR, {
21187
+ record = taskBarTarget.record;
21188
+ record.type !== TaskType.PROJECT && stateManager.showTaskBarHover(), scene._gantt.hasListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR) && scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR, {
21010
21189
  federatedEvent: e,
21011
21190
  event: e.nativeEvent,
21012
21191
  index: taskIndex,
@@ -21328,8 +21507,17 @@
21328
21507
  function syncTreeChangeFromTable(gantt) {
21329
21508
  var _a;
21330
21509
  null === (_a = gantt.taskListTableInstance) || void 0 === _a || _a.on("tree_hierarchy_state_change", args => {
21331
- var _a;
21332
- gantt._syncPropsFromTable(), gantt.scenegraph.refreshTaskBarsAndGrid(), !gantt.taskListTableInstance.checkHasColumnAutoWidth() || "auto" !== (null === (_a = gantt.options.taskListTable) || void 0 === _a ? void 0 : _a.tableWidth) && -1 !== gantt.taskTableWidth || _syncTableSize(gantt);
21510
+ var _a, _b;
21511
+ const {
21512
+ row: row,
21513
+ hierarchyState: hierarchyState
21514
+ } = args;
21515
+ if (gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
21516
+ const recordIndex = row - gantt.taskListTableInstance.columnHeaderLevelCount,
21517
+ record = gantt.getRecordByIndex(recordIndex);
21518
+ record && record.type === TaskType.PROJECT && (null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) > 0 && (record.hierarchyState = hierarchyState);
21519
+ }
21520
+ gantt._syncPropsFromTable(), gantt.scenegraph.refreshTaskBarsAndGrid(), !gantt.taskListTableInstance.checkHasColumnAutoWidth() || "auto" !== (null === (_b = gantt.options.taskListTable) || void 0 === _b ? void 0 : _b.tableWidth) && -1 !== gantt.taskTableWidth || _syncTableSize(gantt);
21333
21521
  const left = gantt.stateManager.scroll.horizontalBarPos,
21334
21522
  top = gantt.stateManager.scroll.verticalBarPos;
21335
21523
  gantt.scenegraph.setX(-left), gantt.scenegraph.setY(-top);
@@ -21347,7 +21535,7 @@
21347
21535
  function syncDragOrderFromTable(gantt) {
21348
21536
  var _a, _b, _c, _d;
21349
21537
  null === (_a = gantt.taskListTableInstance) || void 0 === _a || _a.on("change_header_position", args => {
21350
- gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ? gantt.scenegraph.refreshTaskBarsAndGrid() : gantt.scenegraph.refreshTaskBars(), gantt.scenegraph.dragOrderLine.hideDragLine();
21538
+ gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact || gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate || gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline ? gantt.scenegraph.refreshTaskBarsAndGrid() : gantt.scenegraph.refreshTaskBars(), gantt.scenegraph.dragOrderLine.hideDragLine();
21351
21539
  const left = gantt.stateManager.scroll.horizontalBarPos,
21352
21540
  top = gantt.stateManager.scroll.verticalBarPos;
21353
21541
  gantt.scenegraph.setX(-left), gantt.scenegraph.setY(-top);
@@ -21524,7 +21712,7 @@
21524
21712
  } = this._gantt.getTaskInfoByTaskListIndex(taskIndex, sub_task_index),
21525
21713
  targetEndY = this.moveTaskBar.targetStartY + this._gantt.parsedOptions.rowHeight * Math.round(deltaY / this._gantt.parsedOptions.rowHeight),
21526
21714
  milestoneTaskbarHeight = this._gantt.parsedOptions.taskBarMilestoneStyle.width,
21527
- testDateX = this.moveTaskBar.target.attribute.x + ("milestone" === target.record.type ? milestoneTaskbarHeight / 2 : 0),
21715
+ testDateX = this.moveTaskBar.target.attribute.x + (target.record.type === TaskType.MILESTONE ? milestoneTaskbarHeight / 2 : 0),
21528
21716
  startDateColIndex = getDateIndexByX(testDateX - this._gantt.stateManager.scroll.horizontalBarPos, this._gantt),
21529
21717
  timelineStartDate = this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[startDateColIndex];
21530
21718
  if (!timelineStartDate) return;
@@ -21551,7 +21739,7 @@
21551
21739
  this._gantt._dragOrderTaskRecord(target.task_index, target.sub_task_index, indexs.task_index, indexs.sub_task_index), this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Separate ? (this._gantt.taskListTableInstance.renderWithRecreateCells(), this._gantt.scenegraph.refreshTaskBarsAndGrid()) : (this._gantt.scenegraph.taskBar.refresh(), this._gantt.scenegraph.dependencyLink.refresh());
21552
21740
  } else {
21553
21741
  let newX = startDateColIndex >= 1 ? this._gantt.getDateColsWidth(0, startDateColIndex - 1) : 0;
21554
- if ("milestone" === target.record.type) {
21742
+ if (target.record.type === TaskType.MILESTONE) {
21555
21743
  newX -= this._gantt.parsedOptions.taskBarMilestoneStyle.width / 2;
21556
21744
  }
21557
21745
  if (moveTaskBar(target, newX - target.attribute.x, targetEndY - target.attribute.y, this), "right" === dateChanged) {
@@ -21569,7 +21757,7 @@
21569
21757
  this.moveTaskBar.moving = !1, this.selectedTaskBar.target !== target && target.setAttribute("zIndex", 0), target.updateTextPosition(), this.moveTaskBar.target = null, this.moveTaskBar.deltaX = 0, this.moveTaskBar.deltaY = 0, this.moveTaskBar.moveTaskBarXSpeed = 0;
21570
21758
  }
21571
21759
  dealTaskBarMove(e) {
21572
- var _a, _b, _c, _d;
21760
+ var _a, _b, _c, _d, _e, _f;
21573
21761
  const gantt = this._gantt;
21574
21762
  let target = this.moveTaskBar.target;
21575
21763
  target.setAttribute("zIndex", 1e4);
@@ -21585,13 +21773,13 @@
21585
21773
  unit: minTimeUnit,
21586
21774
  startOfWeek: startOfWeek
21587
21775
  } = gantt.parsedOptions.reverseSortedTimelineScales[0];
21588
- gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime() - timeDiff / 2), minTimeUnit, startOfWeek), gantt.parsedOptions._minDateTime = null === (_b = gantt.parsedOptions.minDate) || void 0 === _b ? void 0 : _b.getTime(), gantt._generateTimeLineDateMap(), gantt._updateSize(), gantt.scenegraph.refreshAll(), target = this.moveTaskBar.target = gantt.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index, this.moveTaskBar.target.sub_task_index), gantt.scrollLeft = gantt.parsedOptions.timelineColWidth - 1, gantt.eventManager.lastDragPointerXYOnWindow.x = e.x, target.setAttribute("x", gantt.scrollLeft);
21776
+ gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime() - timeDiff / 2), minTimeUnit, startOfWeek), gantt.parsedOptions._minDateTime = null === (_b = gantt.parsedOptions.minDate) || void 0 === _b ? void 0 : _b.getTime(), gantt._generateTimeLineDateMap(), gantt._updateSize(), gantt.scenegraph.refreshAll(), target = this.moveTaskBar.target = gantt.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index, this.moveTaskBar.target.sub_task_index), gantt.scrollLeft = gantt.parsedOptions.timelineColWidth - 1, gantt.eventManager.lastDragPointerXYOnWindow.x = e.x, "milestone" === (null === (_c = target.record) || void 0 === _c ? void 0 : _c.type) ? moveTaskBar(target, gantt.scrollLeft - target.attribute.x, 0, this) : target.setAttribute("x", gantt.scrollLeft);
21589
21777
  } else this.moveTaskBar.moveTaskBarXSpeed = -gantt.parsedOptions.timelineColWidth / 100, this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed, 0, 1), this.moveTaskBar.moveTaskBarXInertia.setScrollHandle((dx, dy) => {
21590
21778
  this.moveTaskBar.deltaX += dx, this.moveTaskBar.deltaY += dy, moveTaskBar(target, dx, dy, this), gantt.stateManager.setScrollLeft(target.attribute.x), 0 === gantt.stateManager.scrollLeft && this.moveTaskBar.moveTaskBarXInertia.endInertia();
21591
21779
  });
21592
21780
  } else if (target.attribute.x + target.attribute.width >= gantt.stateManager.scrollLeft + gantt.tableNoFrameWidth && dx > 0) {
21593
21781
  if (gantt.parsedOptions.moveTaskBarToExtendDateRange && gantt.stateManager.scrollLeft + gantt.tableNoFrameWidth === gantt.getAllDateColsWidth()) {
21594
- null === (_c = this.moveTaskBar.moveTaskBarXInertia) || void 0 === _c || _c.endInertia();
21782
+ null === (_d = this.moveTaskBar.moveTaskBarXInertia) || void 0 === _d || _d.endInertia();
21595
21783
  const timelineDates = gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates,
21596
21784
  timeDiff = timelineDates[1].startDate.getTime() - timelineDates[0].startDate.getTime(),
21597
21785
  {
@@ -21599,7 +21787,10 @@
21599
21787
  startOfWeek: startOfWeek,
21600
21788
  step: step
21601
21789
  } = gantt.parsedOptions.reverseSortedTimelineScales[0];
21602
- gantt.parsedOptions.maxDate = getEndDateByTimeUnit(gantt.parsedOptions.minDate, new Date(timelineDates[timelineDates.length - 1].endDate.getTime() + timeDiff / 2), minTimeUnit, step), gantt.parsedOptions._maxDateTime = null === (_d = gantt.parsedOptions.maxDate) || void 0 === _d ? void 0 : _d.getTime(), gantt._generateTimeLineDateMap(), gantt._updateSize(), gantt.scenegraph.refreshAll(), target = this.moveTaskBar.target = gantt.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index, this.moveTaskBar.target.sub_task_index), gantt.scrollLeft += 1, gantt.eventManager.lastDragPointerXYOnWindow.x = e.x, target.setAttribute("x", gantt.scrollLeft + gantt.tableNoFrameWidth - target.attribute.width);
21790
+ if (gantt.parsedOptions.maxDate = getEndDateByTimeUnit(gantt.parsedOptions.minDate, new Date(timelineDates[timelineDates.length - 1].endDate.getTime() + timeDiff / 2), minTimeUnit, step), gantt.parsedOptions._maxDateTime = null === (_e = gantt.parsedOptions.maxDate) || void 0 === _e ? void 0 : _e.getTime(), gantt._generateTimeLineDateMap(), gantt._updateSize(), gantt.scenegraph.refreshAll(), target = this.moveTaskBar.target = gantt.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index, this.moveTaskBar.target.sub_task_index), gantt.scrollLeft += 1, gantt.eventManager.lastDragPointerXYOnWindow.x = e.x, "milestone" === (null === (_f = target.record) || void 0 === _f ? void 0 : _f.type)) {
21791
+ const newX = gantt.scrollLeft + gantt.tableNoFrameWidth - target.attribute.width;
21792
+ moveTaskBar(target, newX - target.attribute.x, 0, this);
21793
+ } else target.setAttribute("x", gantt.scrollLeft + gantt.tableNoFrameWidth - target.attribute.width);
21603
21794
  } else this.moveTaskBar.moveTaskBarXSpeed = gantt.parsedOptions.timelineColWidth / 100, this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed, 0, 1), this.moveTaskBar.moveTaskBarXInertia.setScrollHandle((dx, dy) => {
21604
21795
  this.moveTaskBar.deltaX += dx, this.moveTaskBar.deltaY += dy, moveTaskBar(target, dx, dy, this), gantt.stateManager.setScrollLeft(target.attribute.x + target.attribute.width - gantt.tableNoFrameWidth), gantt.stateManager.scrollLeft === gantt.getAllDateColsWidth() - gantt.tableNoFrameWidth && this.moveTaskBar.moveTaskBarXInertia.endInertia();
21605
21796
  });
@@ -21810,6 +22001,43 @@
21810
22001
  hideMarklineIconHover() {
21811
22002
  this._gantt.scenegraph.timelineHeader.hideMarklineIconHover(this._gantt.stateManager.marklineIcon.target.parent), this._gantt.scenegraph.hideToolTip(), this._gantt.stateManager.marklineIcon.target = null, this._gantt.scenegraph.updateNextFrame();
21812
22003
  }
22004
+ updateProjectTaskTimes(taskPath) {
22005
+ var _a, _b;
22006
+ if (!taskPath || 0 === taskPath.length || !this._gantt || !this._gantt.records) return;
22007
+ const startDateField = this._gantt.parsedOptions.startDateField,
22008
+ endDateField = this._gantt.parsedOptions.endDateField,
22009
+ pathCopy = [...taskPath];
22010
+ for (; pathCopy.length > 0;) {
22011
+ const parentPath = [...pathCopy],
22012
+ childIndex = parentPath.pop();
22013
+ let parentRecord = this._gantt.records;
22014
+ for (const index of parentPath) {
22015
+ if (!parentRecord[index] || !parentRecord[index].children) return;
22016
+ parentRecord = parentRecord[index].children;
22017
+ }
22018
+ const parent = 0 === parentPath.length ? this._gantt.records[childIndex] : parentRecord[childIndex];
22019
+ if (parent && parent.type === TaskType.PROJECT && parent.children && parent.children.length > 0) {
22020
+ let earliestStart = null,
22021
+ latestEnd = null;
22022
+ for (const child of parent.children) if (child[startDateField] && child[endDateField]) {
22023
+ const childStartDate = new Date(child[startDateField]),
22024
+ childEndDate = new Date(child[endDateField]);
22025
+ (!earliestStart || childStartDate < earliestStart) && (earliestStart = childStartDate), (!latestEnd || childEndDate > latestEnd) && (latestEnd = childEndDate);
22026
+ }
22027
+ if (earliestStart && latestEnd) {
22028
+ const currentStartDate = parent[startDateField] ? new Date(parent[startDateField]) : null,
22029
+ currentEndDate = parent[endDateField] ? new Date(parent[endDateField]) : null;
22030
+ if (!currentStartDate || !currentEndDate || earliestStart.getTime() !== currentStartDate.getTime() || latestEnd.getTime() !== currentEndDate.getTime()) {
22031
+ const dateFormat = null !== (_a = this._gantt.parsedOptions.dateFormat) && void 0 !== _a ? _a : this._gantt.parseTimeFormat(parent[startDateField] || parent.children[0][startDateField]),
22032
+ formatDateValue = date => this._gantt.formatDate ? this._gantt.formatDate(date, dateFormat) : date.toISOString().split("T")[0];
22033
+ parent[startDateField] = formatDateValue(earliestStart), parent[endDateField] = formatDateValue(latestEnd);
22034
+ }
22035
+ }
22036
+ }
22037
+ pathCopy.pop();
22038
+ }
22039
+ null === (_b = this._gantt.scenegraph) || void 0 === _b || _b.refreshAll();
22040
+ }
21813
22041
  }
21814
22042
  function reCreateCustomNode(gantt, taskBarGroup, taskIndex, sub_task_index) {
21815
22043
  const taskBarCustomLayout = gantt.parsedOptions.taskBarCustomLayout;
@@ -21850,8 +22078,17 @@
21850
22078
  function moveTaskBar(target, dx, dy, state) {
21851
22079
  const taskIndex = target.task_index,
21852
22080
  sub_task_index = target.sub_task_index,
21853
- isMilestone = "milestone" === target.record.type;
21854
- dx && target.setAttribute("x", Math.max(0, target.attribute.x + dx)), state._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Tasks_Separate ? dy && target.setAttribute("y", target.attribute.y + dy) : dy = 0, isMilestone && target.setAttribute("anchor", [target.attribute.x + target.attribute.width / 2, target.attribute.y + target.attribute.height / 2]), target.updateTextPosition(), state._gantt.scenegraph.refreshRecordLinkNodes(taskIndex, sub_task_index, target, dy);
22081
+ isMilestone = target.record.type === TaskType.MILESTONE,
22082
+ oldX = target.attribute.x,
22083
+ oldY = target.attribute.y;
22084
+ if (dx && target.setAttribute("x", Math.max(0, target.attribute.x + dx)), state._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Tasks_Separate && state._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Project_Sub_Tasks_Inline ? dy && target.setAttribute("y", target.attribute.y + dy) : dy = 0, isMilestone && (target.setAttribute("anchor", [target.attribute.x + target.attribute.width / 2, target.attribute.y + target.attribute.height / 2]), target.milestoneTextContainer)) {
22085
+ const deltaX = target.attribute.x - oldX,
22086
+ deltaY = target.attribute.y - oldY,
22087
+ currentX = target.milestoneTextContainer.attribute.x,
22088
+ currentY = target.milestoneTextContainer.attribute.y;
22089
+ target.milestoneTextContainer.setAttribute("x", currentX + deltaX), target.milestoneTextContainer.setAttribute("y", currentY + deltaY);
22090
+ }
22091
+ target.updateTextPosition(), state._gantt.scenegraph.refreshRecordLinkNodes(taskIndex, sub_task_index, target, dy);
21855
22092
  }
21856
22093
  function resizeTaskBar(target, dx, newWidth, state) {
21857
22094
  const progressField = state._gantt.parsedOptions.progressField,
@@ -21863,7 +22100,7 @@
21863
22100
  sub_task_index = target.sub_task_index,
21864
22101
  record = target.record,
21865
22102
  progress = record[progressField],
21866
- isMilestone = "milestone" === record.type;
22103
+ isMilestone = record.type === TaskType.MILESTONE;
21867
22104
  if (target.setAttribute("zIndex", 1e4), dx && target.setAttribute("x", target.attribute.x + dx), isMilestone && target.setAttribute("anchor", [target.attribute.x + target.attribute.width / 2, target.attribute.y + target.attribute.height / 2]), newWidth && target.setAttribute("width", newWidth), clipGroupBox.setAttribute("width", target.attribute.width), null == rect || rect.setAttribute("width", target.attribute.width), null == progressRect || progressRect.setAttribute("width", progress / 100 * target.attribute.width), textLabel) {
21868
22105
  const {
21869
22106
  textAlign: textAlign,
@@ -21962,13 +22199,20 @@
21962
22199
  }
21963
22200
  }
21964
22201
  adjustOrder(source_index, source_sub_task_index, target_index, target_sub_task_index) {
21965
- var _a, _b;
22202
+ var _a, _b, _c, _d;
21966
22203
  if (this._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Arrange && this._gantt.parsedOptions.tasksShowMode !== TasksShowMode.Sub_Tasks_Compact || source_index !== target_index) if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {
21967
22204
  if (isValid$1(source_sub_task_index) && isValid$1(target_sub_task_index) && isValid$1(source_index) && isValid$1(target_index)) {
21968
22205
  const sub_task_record = this.records[source_index].children[source_sub_task_index];
21969
22206
  this.records[source_index].children.splice(source_sub_task_index, 1), this.records[target_index].children || (this.records[target_index].children = []), this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);
21970
22207
  }
21971
22208
  null === (_b = null === (_a = this.records[target_index]) || void 0 === _a ? void 0 : _a.children) || void 0 === _b || _b.sort((a, b) => createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() - createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime());
22209
+ } else if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Project_Sub_Tasks_Inline) {
22210
+ if (isValid$1(source_sub_task_index) && isValid$1(target_sub_task_index) && isValid$1(source_index) && isValid$1(target_index)) {
22211
+ this.records[source_index].type, TaskType.PROJECT;
22212
+ const targetIsProject = this.records[target_index].type === TaskType.PROJECT,
22213
+ sub_task_record = this.records[source_index].children[source_sub_task_index];
22214
+ this.records[source_index].children.splice(source_sub_task_index, 1), this.records[target_index].children || (this.records[target_index].children = []), this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record), targetIsProject && (null === (_d = null === (_c = this.records[target_index]) || void 0 === _c ? void 0 : _c.children) || void 0 === _d || _d.sort((a, b) => createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() - createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime()));
22215
+ }
21972
22216
  } else if (isValid$1(source_sub_task_index) && isValid$1(target_sub_task_index) && isValid$1(source_index) && isValid$1(target_index)) {
21973
22217
  const sub_task_record = this.records[source_index].children[source_sub_task_index];
21974
22218
  this.records[source_index].children.splice(source_sub_task_index, 1), this.records[target_index].children || (this.records[target_index].children = []), this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);
@@ -22050,7 +22294,7 @@
22050
22294
  class Gantt extends EventTarget {
22051
22295
  constructor(container, options) {
22052
22296
  var _a, _b, _c, _d, _e;
22053
- super(), this.parsedOptions = {}, this.container = container, this.options = options, this.taskTableWidth = "number" == typeof (null === (_a = null == options ? void 0 : options.taskListTable) || void 0 === _a ? void 0 : _a.tableWidth) ? null === (_b = null == options ? void 0 : options.taskListTable) || void 0 === _b ? void 0 : _b.tableWidth : -1, this.taskTableColumns = null !== (_d = null === (_c = null == options ? void 0 : options.taskListTable) || void 0 === _c ? void 0 : _c.columns) && void 0 !== _d ? _d : [], this.records = null !== (_e = null == options ? void 0 : options.records) && void 0 !== _e ? _e : [], this._sortScales(), initOptions(this), this.data = new DataSource(this), this._generateTimeLineDateMap(), this.timeLineHeaderLevel = this.parsedOptions.sortedTimelineScales.length, this.element = createRootElement({
22297
+ super(), this.parsedOptions = {}, this.container = container, this.options = options, this.taskTableWidth = "number" == typeof (null === (_a = null == options ? void 0 : options.taskListTable) || void 0 === _a ? void 0 : _a.tableWidth) ? null === (_b = null == options ? void 0 : options.taskListTable) || void 0 === _b ? void 0 : _b.tableWidth : -1, this.taskTableColumns = null !== (_d = null === (_c = null == options ? void 0 : options.taskListTable) || void 0 === _c ? void 0 : _c.columns) && void 0 !== _d ? _d : [], this.records = null !== (_e = null == options ? void 0 : options.records) && void 0 !== _e ? _e : [], this._sortScales(), initOptions(this), initProjectTaskTimes(this), this.data = new DataSource(this), this._generateTimeLineDateMap(), this.timeLineHeaderLevel = this.parsedOptions.sortedTimelineScales.length, this.element = createRootElement({
22054
22298
  top: 0,
22055
22299
  right: 0,
22056
22300
  left: 0,
@@ -22258,7 +22502,26 @@
22258
22502
  }
22259
22503
  getRecordByIndex(taskShowIndex, sub_task_index) {
22260
22504
  var _a, _b;
22261
- return isValid$1(sub_task_index) ? null === (_b = null === (_a = this.records[taskShowIndex]) || void 0 === _a ? void 0 : _a.children) || void 0 === _b ? void 0 : _b[sub_task_index] : this.taskListTableInstance ? this.taskListTableInstance.getRecordByCell(0, taskShowIndex + this.taskListTableInstance.columnHeaderLevelCount) : this.records[taskShowIndex];
22505
+ if (this.taskListTableInstance) {
22506
+ if (isValid$1(sub_task_index)) {
22507
+ const record = this.taskListTableInstance.getRecordByCell(0, taskShowIndex + this.taskListTableInstance.columnHeaderLevelCount);
22508
+ if (Array.isArray(sub_task_index)) {
22509
+ const recordIndex = this.getRecordIndexByTaskShowIndex(taskShowIndex),
22510
+ parentIndexLength = Array.isArray(recordIndex) ? recordIndex.length : 1,
22511
+ new_sub_task_index = [...sub_task_index];
22512
+ new_sub_task_index.splice(0, parentIndexLength);
22513
+ let currentRecord = record;
22514
+ for (; new_sub_task_index.length > 0;) {
22515
+ const index = new_sub_task_index.shift();
22516
+ currentRecord = null === (_a = null == currentRecord ? void 0 : currentRecord.children) || void 0 === _a ? void 0 : _a[index];
22517
+ }
22518
+ return currentRecord;
22519
+ }
22520
+ return null === (_b = null == record ? void 0 : record.children) || void 0 === _b ? void 0 : _b[sub_task_index];
22521
+ }
22522
+ return this.taskListTableInstance.getRecordByCell(0, taskShowIndex + this.taskListTableInstance.columnHeaderLevelCount);
22523
+ }
22524
+ return this.records[taskShowIndex];
22262
22525
  }
22263
22526
  _refreshTaskBar(taskShowIndex, sub_task_index) {
22264
22527
  this.scenegraph.taskBar.updateTaskBarNode(taskShowIndex, sub_task_index), this.scenegraph.refreshRecordLinkNodes(taskShowIndex, void 0, this.scenegraph.taskBar.getTaskBarNodeByIndex(taskShowIndex, sub_task_index)), this.scenegraph.updateNextFrame();
@@ -22298,9 +22561,9 @@
22298
22561
  startDateField = this.parsedOptions.startDateField,
22299
22562
  dateFormat = null !== (_a = this.parsedOptions.dateFormat) && void 0 !== _a ? _a : parseDateFormat(taskRecord[startDateField]),
22300
22563
  newStartDate = formatDate(startDate, dateFormat);
22301
- if (taskRecord[startDateField] = newStartDate, !isValid$1(sub_task_index)) {
22564
+ if (taskRecord[startDateField] = newStartDate, isValid$1(sub_task_index)) Array.isArray(sub_task_index) && this.stateManager.updateProjectTaskTimes(sub_task_index);else {
22302
22565
  const indexs = this.getRecordIndexByTaskShowIndex(index);
22303
- this._updateRecordToListTable(taskRecord, indexs);
22566
+ this._updateRecordToListTable(taskRecord, indexs), Array.isArray(indexs) && this.stateManager.updateProjectTaskTimes(indexs);
22304
22567
  }
22305
22568
  }
22306
22569
  _updateEndDateToTaskRecord(endDate, index, sub_task_index) {
@@ -22309,9 +22572,9 @@
22309
22572
  endDateField = this.parsedOptions.endDateField,
22310
22573
  dateFormat = null !== (_a = this.parsedOptions.dateFormat) && void 0 !== _a ? _a : parseDateFormat(taskRecord[endDateField]),
22311
22574
  newEndDate = formatDate(endDate, dateFormat);
22312
- if (taskRecord[endDateField] = newEndDate, !isValid$1(sub_task_index)) {
22575
+ if (taskRecord[endDateField] = newEndDate, isValid$1(sub_task_index)) Array.isArray(sub_task_index) && this.stateManager.updateProjectTaskTimes(sub_task_index);else {
22313
22576
  const indexs = this.getRecordIndexByTaskShowIndex(index);
22314
- this._updateRecordToListTable(taskRecord, indexs);
22577
+ this._updateRecordToListTable(taskRecord, indexs), Array.isArray(indexs) && this.stateManager.updateProjectTaskTimes(indexs);
22315
22578
  }
22316
22579
  }
22317
22580
  _updateStartEndDateToTaskRecord(startDate, endDate, index, sub_task_index) {
@@ -22323,9 +22586,9 @@
22323
22586
  newStartDate = formatDate(startDate, dateFormat);
22324
22587
  taskRecord[startDateField] = newStartDate;
22325
22588
  const newEndDate = formatDate(endDate, dateFormat);
22326
- if (taskRecord[endDateField] = newEndDate, !isValid$1(sub_task_index)) {
22589
+ if (taskRecord[endDateField] = newEndDate, isValid$1(sub_task_index)) Array.isArray(sub_task_index) && this.stateManager.updateProjectTaskTimes(sub_task_index);else {
22327
22590
  const indexs = this.getRecordIndexByTaskShowIndex(index);
22328
- this._updateRecordToListTable(taskRecord, indexs);
22591
+ this._updateRecordToListTable(taskRecord, indexs), Array.isArray(indexs) && this.stateManager.updateProjectTaskTimes(indexs);
22329
22592
  }
22330
22593
  }
22331
22594
  _dragOrderTaskRecord(source_index, source_sub_task_index, target_index, target_sub_task_index) {
@@ -22348,6 +22611,9 @@
22348
22611
  var _a;
22349
22612
  null === (_a = this.taskListTableInstance) || void 0 === _a || _a.setPixelRatio(pixelRatio), this.parsedOptions.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
22350
22613
  }
22614
+ updateTasksShowMode(tasksShowMode) {
22615
+ this.options.tasksShowMode = tasksShowMode, this.updateOption(this.options);
22616
+ }
22351
22617
  _resize() {
22352
22618
  var _a;
22353
22619
  this._updateSize(), null === (_a = this.taskListTableInstance) || void 0 === _a || _a.setCanvasSize(this.taskTableWidth, this.tableNoFrameHeight + 2 * this.parsedOptions.outerFrameStyle.borderLineWidth), this._syncPropsFromTable(), this.scenegraph.resize(), updateSplitLineAndResizeLine(this);
@@ -22475,22 +22741,25 @@
22475
22741
  return parseDateFormat(date);
22476
22742
  }
22477
22743
  getTaskBarStyle(task_index, sub_task_index) {
22478
- if ("function" == typeof this.parsedOptions.taskBarStyle) {
22479
- const {
22480
- startDate: startDate,
22481
- endDate: endDate,
22482
- taskRecord: taskRecord
22483
- } = this.getTaskInfoByTaskListIndex(task_index, sub_task_index),
22484
- args = {
22485
- index: task_index,
22486
- startDate: startDate,
22487
- endDate: endDate,
22488
- taskRecord: taskRecord,
22489
- ganttInstance: this
22490
- };
22491
- return this.parsedOptions.taskBarStyle(args);
22744
+ const {
22745
+ startDate: startDate,
22746
+ endDate: endDate,
22747
+ taskRecord: taskRecord
22748
+ } = this.getTaskInfoByTaskListIndex(task_index, sub_task_index);
22749
+ let style;
22750
+ if (style = taskRecord.type === TaskType.PROJECT ? this.parsedOptions.projectBarStyle : this.parsedOptions.taskBarStyle, "function" == typeof style) {
22751
+ return style({
22752
+ index: task_index,
22753
+ startDate: startDate,
22754
+ endDate: endDate,
22755
+ taskRecord: taskRecord,
22756
+ ganttInstance: this
22757
+ });
22492
22758
  }
22493
- return this.parsedOptions.taskBarStyle;
22759
+ return style;
22760
+ }
22761
+ formatDate(date, format) {
22762
+ return formatDate(date, format);
22494
22763
  }
22495
22764
  }
22496
22765