gantt-task-react-v 1.2.13 → 1.2.14

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.
@@ -10911,7 +10911,7 @@ const styles$c = {
10911
10911
  };
10912
10912
  const GanttTodayInner = ({
10913
10913
  additionalLeftSpace,
10914
- distances: { columnWidth },
10914
+ distances,
10915
10915
  ganttFullHeight,
10916
10916
  isUnknownDates,
10917
10917
  rtl,
@@ -10925,6 +10925,7 @@ const GanttTodayInner = ({
10925
10925
  todayLabel = "Today",
10926
10926
  dataDateLabel = "Data Date"
10927
10927
  }) => {
10928
+ const { columnWidth, rowHeight, barFill } = distances;
10928
10929
  const todayElement = useMemo(() => {
10929
10930
  if (isUnknownDates || !showTodayLine) {
10930
10931
  return null;
@@ -11031,15 +11032,15 @@ const GanttTodayInner = ({
11031
11032
  }
11032
11033
  };
11033
11034
  const tickX = dataIndex * columnWidth * extraMultiplier();
11034
- const baseX = rtl ? tickX + columnWidth : tickX;
11035
+ const dateBaseX = rtl ? tickX + columnWidth : tickX;
11035
11036
  const color = dataDateColor || "var(--gantt-calendar-today-color)";
11036
- const size = 12;
11037
- const half = size / 2;
11038
- const centerX = baseX + 1;
11037
+ const taskHeight = rowHeight * barFill / 100;
11038
+ const rotatedHeight = taskHeight / Math.SQRT2;
11039
+ const centerX = dateBaseX;
11039
11040
  const centerY = 6;
11040
- const rectX = centerX - half;
11041
- const rectY = centerY - half;
11042
- const rightEdgeX = centerX + half * Math.SQRT2;
11041
+ const rectX = centerX - rotatedHeight / 2;
11042
+ const rectY = centerY - rotatedHeight / 2;
11043
+ const rightEdgeX = centerX + taskHeight / 2;
11043
11044
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11044
11045
  /* @__PURE__ */ jsx(
11045
11046
  "rect",
@@ -11057,8 +11058,8 @@ const GanttTodayInner = ({
11057
11058
  {
11058
11059
  x: additionalLeftSpace + rectX,
11059
11060
  y: rectY,
11060
- width: size,
11061
- height: size,
11061
+ width: rotatedHeight,
11062
+ height: rotatedHeight,
11062
11063
  fill: color,
11063
11064
  transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11064
11065
  rx: 2,
@@ -11087,7 +11088,9 @@ const GanttTodayInner = ({
11087
11088
  showDataDateLine,
11088
11089
  dataDate,
11089
11090
  dataDateColor,
11090
- dataDateLabel
11091
+ dataDateLabel,
11092
+ rowHeight,
11093
+ barFill
11091
11094
  ]);
11092
11095
  return /* @__PURE__ */ jsxs("g", { className: "today", children: [
11093
11096
  dataDateElement,
@@ -10928,7 +10928,7 @@
10928
10928
  };
10929
10929
  const GanttTodayInner = ({
10930
10930
  additionalLeftSpace,
10931
- distances: { columnWidth },
10931
+ distances,
10932
10932
  ganttFullHeight,
10933
10933
  isUnknownDates,
10934
10934
  rtl,
@@ -10942,6 +10942,7 @@
10942
10942
  todayLabel = "Today",
10943
10943
  dataDateLabel = "Data Date"
10944
10944
  }) => {
10945
+ const { columnWidth, rowHeight, barFill } = distances;
10945
10946
  const todayElement = React.useMemo(() => {
10946
10947
  if (isUnknownDates || !showTodayLine) {
10947
10948
  return null;
@@ -11048,15 +11049,15 @@
11048
11049
  }
11049
11050
  };
11050
11051
  const tickX = dataIndex * columnWidth * extraMultiplier();
11051
- const baseX = rtl ? tickX + columnWidth : tickX;
11052
+ const dateBaseX = rtl ? tickX + columnWidth : tickX;
11052
11053
  const color = dataDateColor || "var(--gantt-calendar-today-color)";
11053
- const size = 12;
11054
- const half = size / 2;
11055
- const centerX = baseX + 1;
11054
+ const taskHeight = rowHeight * barFill / 100;
11055
+ const rotatedHeight = taskHeight / Math.SQRT2;
11056
+ const centerX = dateBaseX;
11056
11057
  const centerY = 6;
11057
- const rectX = centerX - half;
11058
- const rectY = centerY - half;
11059
- const rightEdgeX = centerX + half * Math.SQRT2;
11058
+ const rectX = centerX - rotatedHeight / 2;
11059
+ const rectY = centerY - rotatedHeight / 2;
11060
+ const rightEdgeX = centerX + taskHeight / 2;
11060
11061
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11061
11062
  /* @__PURE__ */ jsxRuntime.jsx(
11062
11063
  "rect",
@@ -11074,8 +11075,8 @@
11074
11075
  {
11075
11076
  x: additionalLeftSpace + rectX,
11076
11077
  y: rectY,
11077
- width: size,
11078
- height: size,
11078
+ width: rotatedHeight,
11079
+ height: rotatedHeight,
11079
11080
  fill: color,
11080
11081
  transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11081
11082
  rx: 2,
@@ -11104,7 +11105,9 @@
11104
11105
  showDataDateLine,
11105
11106
  dataDate,
11106
11107
  dataDateColor,
11107
- dataDateLabel
11108
+ dataDateLabel,
11109
+ rowHeight,
11110
+ barFill
11108
11111
  ]);
11109
11112
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "today", children: [
11110
11113
  dataDateElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
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",