gantt-task-react-v 1.4.4 → 1.4.5

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.
@@ -11727,9 +11727,9 @@ const generateTrianglePoints = (x, y, width, isLeftDirected) => {
11727
11727
  ${x - width},${y - width}
11728
11728
  ${x - width},${y + width}`;
11729
11729
  };
11730
- const arrow_clickable = "_arrow_clickable_w0fo0_1";
11731
- const mainPath = "_mainPath_w0fo0_11";
11732
- const clickZone = "_clickZone_w0fo0_57";
11730
+ const arrow_clickable = "_arrow_clickable_1xrbf_1";
11731
+ const mainPath = "_mainPath_1xrbf_11";
11732
+ const clickZone = "_clickZone_1xrbf_57";
11733
11733
  const styles$a = {
11734
11734
  arrow_clickable,
11735
11735
  mainPath,
@@ -11826,8 +11826,8 @@ const ArrowInner = (props) => {
11826
11826
  onDoubleClick,
11827
11827
  children: [
11828
11828
  onArrowDoubleClick && /* @__PURE__ */ jsx("path", { d: path, className: styles$a.clickZone }),
11829
- /* @__PURE__ */ jsx("path", { className: styles$a.mainPath, d: path }),
11830
- /* @__PURE__ */ jsx("polygon", { className: "polygon", points: trianglePoints })
11829
+ /* @__PURE__ */ jsx("path", { className: `${styles$a.mainPath} arrowMainPath`, d: path }),
11830
+ /* @__PURE__ */ jsx("polygon", { className: "polygon arrowPolygon", points: trianglePoints })
11831
11831
  ]
11832
11832
  }
11833
11833
  ) });
@@ -13203,6 +13203,13 @@ const TaskGanttContentInner = (props) => {
13203
13203
  getDate,
13204
13204
  startColumnIndex
13205
13205
  ]);
13206
+ const [hoveredTaskId, setHoveredTaskId] = useState(null);
13207
+ const handleTaskHover = useCallback((taskId) => {
13208
+ setHoveredTaskId(taskId);
13209
+ }, []);
13210
+ const handleTaskLeave = useCallback(() => {
13211
+ setHoveredTaskId(null);
13212
+ }, []);
13206
13213
  const [renderedTasks, renderedArrows, renderedSelectedTasks] = useMemo(() => {
13207
13214
  if (!renderedRowIndexes) {
13208
13215
  return [null, null, null];
@@ -13305,6 +13312,8 @@ const TaskGanttContentInner = (props) => {
13305
13312
  y: safeLevelY,
13306
13313
  width: Math.max(safeContainerWidth, 0),
13307
13314
  height: fullRowHeight,
13315
+ onMouseEnter: () => handleTaskHover(task.id),
13316
+ onMouseLeave: handleTaskLeave,
13308
13317
  children: /* @__PURE__ */ jsx(
13309
13318
  TaskItem,
13310
13319
  {
@@ -13433,6 +13442,8 @@ const TaskGanttContentInner = (props) => {
13433
13442
  y: containerY,
13434
13443
  width: safeArrowContainerWidth,
13435
13444
  height: containerHeight,
13445
+ "data-from-id": source.id,
13446
+ "data-to-id": taskId,
13436
13447
  children: /* @__PURE__ */ jsx(
13437
13448
  Arrow,
13438
13449
  {
@@ -13517,6 +13528,8 @@ const TaskGanttContentInner = (props) => {
13517
13528
  y: containerY,
13518
13529
  width: safeArrowContainerWidth,
13519
13530
  height: containerHeight,
13531
+ "data-from-id": taskId,
13532
+ "data-to-id": dependent.id,
13520
13533
  children: /* @__PURE__ */ jsx(
13521
13534
  Arrow,
13522
13535
  {
@@ -13614,6 +13627,8 @@ const TaskGanttContentInner = (props) => {
13614
13627
  y: containerY,
13615
13628
  width: safeCW,
13616
13629
  height: containerHeight,
13630
+ "data-from-id": source.id,
13631
+ "data-to-id": taskId,
13617
13632
  children: /* @__PURE__ */ jsx(
13618
13633
  Arrow,
13619
13634
  {
@@ -13691,9 +13706,35 @@ const TaskGanttContentInner = (props) => {
13691
13706
  visibleTasksMirror,
13692
13707
  onArrowDoubleClick,
13693
13708
  showProgress,
13694
- progressColor
13709
+ progressColor,
13710
+ handleTaskHover,
13711
+ handleTaskLeave
13695
13712
  ]);
13713
+ const arrowHighlightStyle = useMemo(() => {
13714
+ if (!hoveredTaskId)
13715
+ return null;
13716
+ const safeId = CSS.escape(hoveredTaskId);
13717
+ return /* @__PURE__ */ jsx("style", { children: `
13718
+ g.arrows svg { opacity: 0.08 !important; transition: opacity 0.15s; }
13719
+ g.arrows svg[data-from-id="${safeId}"],
13720
+ g.arrows svg[data-to-id="${safeId}"] {
13721
+ opacity: 1 !important;
13722
+ }
13723
+ g.arrows svg[data-from-id="${safeId}"] .arrowMainPath,
13724
+ g.arrows svg[data-to-id="${safeId}"] .arrowMainPath {
13725
+ opacity: 1 !important;
13726
+ stroke-width: 2px !important;
13727
+ stroke: var(--gantt-arrow-hover-color, #1976D2) !important;
13728
+ }
13729
+ g.arrows svg[data-from-id="${safeId}"] .arrowPolygon,
13730
+ g.arrows svg[data-to-id="${safeId}"] .arrowPolygon {
13731
+ fill: var(--gantt-arrow-hover-color, #1976D2) !important;
13732
+ opacity: 1 !important;
13733
+ }
13734
+ ` });
13735
+ }, [hoveredTaskId]);
13696
13736
  return /* @__PURE__ */ jsxs("g", { className: "content", children: [
13737
+ arrowHighlightStyle,
13697
13738
  renderedSelectedTasks,
13698
13739
  /* @__PURE__ */ jsx("g", { children: renderedHolidays }),
13699
13740
  /* @__PURE__ */ jsx(
@@ -11744,9 +11744,9 @@
11744
11744
  ${x - width},${y - width}
11745
11745
  ${x - width},${y + width}`;
11746
11746
  };
11747
- const arrow_clickable = "_arrow_clickable_w0fo0_1";
11748
- const mainPath = "_mainPath_w0fo0_11";
11749
- const clickZone = "_clickZone_w0fo0_57";
11747
+ const arrow_clickable = "_arrow_clickable_1xrbf_1";
11748
+ const mainPath = "_mainPath_1xrbf_11";
11749
+ const clickZone = "_clickZone_1xrbf_57";
11750
11750
  const styles$a = {
11751
11751
  arrow_clickable,
11752
11752
  mainPath,
@@ -11843,8 +11843,8 @@
11843
11843
  onDoubleClick,
11844
11844
  children: [
11845
11845
  onArrowDoubleClick && /* @__PURE__ */ jsxRuntime.jsx("path", { d: path, className: styles$a.clickZone }),
11846
- /* @__PURE__ */ jsxRuntime.jsx("path", { className: styles$a.mainPath, d: path }),
11847
- /* @__PURE__ */ jsxRuntime.jsx("polygon", { className: "polygon", points: trianglePoints })
11846
+ /* @__PURE__ */ jsxRuntime.jsx("path", { className: `${styles$a.mainPath} arrowMainPath`, d: path }),
11847
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { className: "polygon arrowPolygon", points: trianglePoints })
11848
11848
  ]
11849
11849
  }
11850
11850
  ) });
@@ -13220,6 +13220,13 @@
13220
13220
  getDate,
13221
13221
  startColumnIndex
13222
13222
  ]);
13223
+ const [hoveredTaskId, setHoveredTaskId] = React.useState(null);
13224
+ const handleTaskHover = React.useCallback((taskId) => {
13225
+ setHoveredTaskId(taskId);
13226
+ }, []);
13227
+ const handleTaskLeave = React.useCallback(() => {
13228
+ setHoveredTaskId(null);
13229
+ }, []);
13223
13230
  const [renderedTasks, renderedArrows, renderedSelectedTasks] = React.useMemo(() => {
13224
13231
  if (!renderedRowIndexes) {
13225
13232
  return [null, null, null];
@@ -13322,6 +13329,8 @@
13322
13329
  y: safeLevelY,
13323
13330
  width: Math.max(safeContainerWidth, 0),
13324
13331
  height: fullRowHeight,
13332
+ onMouseEnter: () => handleTaskHover(task.id),
13333
+ onMouseLeave: handleTaskLeave,
13325
13334
  children: /* @__PURE__ */ jsxRuntime.jsx(
13326
13335
  TaskItem,
13327
13336
  {
@@ -13450,6 +13459,8 @@
13450
13459
  y: containerY,
13451
13460
  width: safeArrowContainerWidth,
13452
13461
  height: containerHeight,
13462
+ "data-from-id": source.id,
13463
+ "data-to-id": taskId,
13453
13464
  children: /* @__PURE__ */ jsxRuntime.jsx(
13454
13465
  Arrow,
13455
13466
  {
@@ -13534,6 +13545,8 @@
13534
13545
  y: containerY,
13535
13546
  width: safeArrowContainerWidth,
13536
13547
  height: containerHeight,
13548
+ "data-from-id": taskId,
13549
+ "data-to-id": dependent.id,
13537
13550
  children: /* @__PURE__ */ jsxRuntime.jsx(
13538
13551
  Arrow,
13539
13552
  {
@@ -13631,6 +13644,8 @@
13631
13644
  y: containerY,
13632
13645
  width: safeCW,
13633
13646
  height: containerHeight,
13647
+ "data-from-id": source.id,
13648
+ "data-to-id": taskId,
13634
13649
  children: /* @__PURE__ */ jsxRuntime.jsx(
13635
13650
  Arrow,
13636
13651
  {
@@ -13708,9 +13723,35 @@
13708
13723
  visibleTasksMirror,
13709
13724
  onArrowDoubleClick,
13710
13725
  showProgress,
13711
- progressColor
13726
+ progressColor,
13727
+ handleTaskHover,
13728
+ handleTaskLeave
13712
13729
  ]);
13730
+ const arrowHighlightStyle = React.useMemo(() => {
13731
+ if (!hoveredTaskId)
13732
+ return null;
13733
+ const safeId = CSS.escape(hoveredTaskId);
13734
+ return /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
13735
+ g.arrows svg { opacity: 0.08 !important; transition: opacity 0.15s; }
13736
+ g.arrows svg[data-from-id="${safeId}"],
13737
+ g.arrows svg[data-to-id="${safeId}"] {
13738
+ opacity: 1 !important;
13739
+ }
13740
+ g.arrows svg[data-from-id="${safeId}"] .arrowMainPath,
13741
+ g.arrows svg[data-to-id="${safeId}"] .arrowMainPath {
13742
+ opacity: 1 !important;
13743
+ stroke-width: 2px !important;
13744
+ stroke: var(--gantt-arrow-hover-color, #1976D2) !important;
13745
+ }
13746
+ g.arrows svg[data-from-id="${safeId}"] .arrowPolygon,
13747
+ g.arrows svg[data-to-id="${safeId}"] .arrowPolygon {
13748
+ fill: var(--gantt-arrow-hover-color, #1976D2) !important;
13749
+ opacity: 1 !important;
13750
+ }
13751
+ ` });
13752
+ }, [hoveredTaskId]);
13713
13753
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "content", children: [
13754
+ arrowHighlightStyle,
13714
13755
  renderedSelectedTasks,
13715
13756
  /* @__PURE__ */ jsxRuntime.jsx("g", { children: renderedHolidays }),
13716
13757
  /* @__PURE__ */ jsxRuntime.jsx(
package/dist/style.css CHANGED
@@ -439,12 +439,12 @@
439
439
  ._calendarDragging_15t8b_85 {
440
440
  cursor: ew-resize;
441
441
  }
442
- ._arrow_clickable_w0fo0_1 {
442
+ ._arrow_clickable_1xrbf_1 {
443
443
  cursor: pointer;
444
444
  }
445
445
 
446
446
  /*noinspection CssUnresolvedCustomProperty*/
447
- ._arrow_clickable_w0fo0_1:hover ._mainPath_w0fo0_11 {
447
+ ._arrow_clickable_1xrbf_1:hover ._mainPath_1xrbf_11 {
448
448
  filter: var(--gantt-hover-filter);
449
449
  stroke: var(--gantt-arrow-hover-color, red);
450
450
  stroke-width: 2px;
@@ -452,22 +452,22 @@
452
452
  }
453
453
 
454
454
  /*noinspection CssUnresolvedCustomProperty*/
455
- ._arrow_clickable_w0fo0_1:hover polygon {
455
+ ._arrow_clickable_1xrbf_1:hover polygon {
456
456
  fill: var(--gantt-arrow-hover-color, red);
457
457
  }
458
458
 
459
- ._mainPath_w0fo0_11 {
459
+ ._mainPath_1xrbf_11 {
460
460
  fill: none;
461
461
  stroke-width: 1.2px;
462
462
  stroke-linecap: round;
463
463
  stroke-linejoin: round;
464
- opacity: 0.55;
464
+ opacity: 0.35;
465
465
  transition:
466
466
  stroke-width 0.15s ease,
467
467
  opacity 0.15s ease;
468
468
  }
469
469
 
470
- ._clickZone_w0fo0_57 {
470
+ ._clickZone_1xrbf_57 {
471
471
  fill: none;
472
472
  stroke: transparent;
473
473
  stroke-width: 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript.",
5
5
  "author": "aguilanbon",
6
6
  "homepage": "https://github.com/aguilanbon/gantt-task-react-v",