gantt-task-react-v 1.2.12 → 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.
@@ -15,7 +15,5 @@ export type GanttTodayProps = {
15
15
  dataDateColor?: string | null;
16
16
  todayLabel?: string;
17
17
  dataDateLabel?: string;
18
- taskHeight?: number;
19
- taskYOffset?: number;
20
18
  };
21
19
  export declare const GanttToday: React.NamedExoticComponent<GanttTodayProps>;
@@ -10911,7 +10911,7 @@ const styles$c = {
10911
10911
  };
10912
10912
  const GanttTodayInner = ({
10913
10913
  additionalLeftSpace,
10914
- distances: { columnWidth, barCornerRadius },
10914
+ distances,
10915
10915
  ganttFullHeight,
10916
10916
  isUnknownDates,
10917
10917
  rtl,
@@ -10923,10 +10923,9 @@ const GanttTodayInner = ({
10923
10923
  todayColor = null,
10924
10924
  dataDateColor = null,
10925
10925
  todayLabel = "Today",
10926
- dataDateLabel = "Data Date",
10927
- taskHeight = 20,
10928
- taskYOffset = 5
10926
+ dataDateLabel = "Data Date"
10929
10927
  }) => {
10928
+ const { columnWidth, rowHeight, barFill } = distances;
10930
10929
  const todayElement = useMemo(() => {
10931
10930
  if (isUnknownDates || !showTodayLine) {
10932
10931
  return null;
@@ -11033,47 +11032,54 @@ const GanttTodayInner = ({
11033
11032
  }
11034
11033
  };
11035
11034
  const tickX = dataIndex * columnWidth * extraMultiplier();
11036
- const x = rtl ? tickX + columnWidth : tickX;
11035
+ const dateBaseX = rtl ? tickX + columnWidth : tickX;
11037
11036
  const color = dataDateColor || "var(--gantt-calendar-today-color)";
11038
- const rotatedHeight = taskHeight / 1.414;
11039
- const milestoneX = x + additionalLeftSpace - rotatedHeight * 0.5;
11040
- const milestoneY = taskYOffset;
11041
- const transform = `rotate(45 ${milestoneX + rotatedHeight * 0.356} ${milestoneY + rotatedHeight * 0.85})`;
11042
- const milestoneCenterX = milestoneX + rotatedHeight * 0.5;
11043
- const lineX = milestoneCenterX + rotatedHeight / Math.sqrt(2) * 0.5;
11037
+ const taskHeight = rowHeight * barFill / 100;
11038
+ const rotatedHeight = taskHeight / Math.SQRT2;
11039
+ const centerX = dateBaseX;
11040
+ const centerY = 6;
11041
+ const rectX = centerX - rotatedHeight / 2;
11042
+ const rectY = centerY - rotatedHeight / 2;
11043
+ const rightEdgeX = centerX + taskHeight / 2;
11044
11044
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11045
11045
  /* @__PURE__ */ jsx(
11046
11046
  "rect",
11047
11047
  {
11048
- x: milestoneX,
11049
- y: milestoneY,
11050
- width: rotatedHeight,
11051
- height: rotatedHeight,
11052
- rx: barCornerRadius,
11053
- ry: barCornerRadius,
11054
- transform,
11048
+ x: additionalLeftSpace + rightEdgeX,
11049
+ y: 0,
11050
+ width: 2,
11051
+ height: ganttFullHeight,
11055
11052
  fill: color,
11056
- opacity: 0.9,
11057
- stroke: color,
11058
- strokeWidth: 1
11053
+ opacity: 0.9
11059
11054
  }
11060
11055
  ),
11061
11056
  /* @__PURE__ */ jsx(
11062
11057
  "rect",
11063
11058
  {
11064
- x: lineX,
11065
- y: 0,
11066
- width: 2,
11067
- height: ganttFullHeight,
11059
+ x: additionalLeftSpace + rectX,
11060
+ y: rectY,
11061
+ width: rotatedHeight,
11062
+ height: rotatedHeight,
11068
11063
  fill: color,
11069
- opacity: 0.7
11064
+ transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11065
+ rx: 2,
11066
+ ry: 2
11070
11067
  }
11071
11068
  ),
11072
- /* @__PURE__ */ jsx("text", { x: lineX + 8, y: 10, fill: color, fontSize: 12, fontWeight: 600, children: dataDateLabel || "Data Date" })
11069
+ /* @__PURE__ */ jsx(
11070
+ "text",
11071
+ {
11072
+ x: additionalLeftSpace + rightEdgeX + 8,
11073
+ y: 10,
11074
+ fill: color,
11075
+ fontSize: 12,
11076
+ fontWeight: 600,
11077
+ children: dataDateLabel || "Data Date"
11078
+ }
11079
+ )
11073
11080
  ] });
11074
11081
  }, [
11075
11082
  additionalLeftSpace,
11076
- barCornerRadius,
11077
11083
  columnWidth,
11078
11084
  ganttFullHeight,
11079
11085
  rtl,
@@ -11083,8 +11089,8 @@ const GanttTodayInner = ({
11083
11089
  dataDate,
11084
11090
  dataDateColor,
11085
11091
  dataDateLabel,
11086
- taskHeight,
11087
- taskYOffset
11092
+ rowHeight,
11093
+ barFill
11088
11094
  ]);
11089
11095
  return /* @__PURE__ */ jsxs("g", { className: "today", children: [
11090
11096
  dataDateElement,
@@ -20193,9 +20199,7 @@ const Gantt = (props) => {
20193
20199
  todayColor,
20194
20200
  dataDateColor,
20195
20201
  todayLabel,
20196
- dataDateLabel,
20197
- taskHeight,
20198
- taskYOffset
20202
+ dataDateLabel
20199
20203
  }),
20200
20204
  [
20201
20205
  additionalLeftSpace,
@@ -20211,9 +20215,7 @@ const Gantt = (props) => {
20211
20215
  todayColor,
20212
20216
  dataDateColor,
20213
20217
  todayLabel,
20214
- dataDateLabel,
20215
- taskHeight,
20216
- taskYOffset
20218
+ dataDateLabel
20217
20219
  ]
20218
20220
  );
20219
20221
  const calendarProps = useMemo(
@@ -10928,7 +10928,7 @@
10928
10928
  };
10929
10929
  const GanttTodayInner = ({
10930
10930
  additionalLeftSpace,
10931
- distances: { columnWidth, barCornerRadius },
10931
+ distances,
10932
10932
  ganttFullHeight,
10933
10933
  isUnknownDates,
10934
10934
  rtl,
@@ -10940,10 +10940,9 @@
10940
10940
  todayColor = null,
10941
10941
  dataDateColor = null,
10942
10942
  todayLabel = "Today",
10943
- dataDateLabel = "Data Date",
10944
- taskHeight = 20,
10945
- taskYOffset = 5
10943
+ dataDateLabel = "Data Date"
10946
10944
  }) => {
10945
+ const { columnWidth, rowHeight, barFill } = distances;
10947
10946
  const todayElement = React.useMemo(() => {
10948
10947
  if (isUnknownDates || !showTodayLine) {
10949
10948
  return null;
@@ -11050,47 +11049,54 @@
11050
11049
  }
11051
11050
  };
11052
11051
  const tickX = dataIndex * columnWidth * extraMultiplier();
11053
- const x = rtl ? tickX + columnWidth : tickX;
11052
+ const dateBaseX = rtl ? tickX + columnWidth : tickX;
11054
11053
  const color = dataDateColor || "var(--gantt-calendar-today-color)";
11055
- const rotatedHeight = taskHeight / 1.414;
11056
- const milestoneX = x + additionalLeftSpace - rotatedHeight * 0.5;
11057
- const milestoneY = taskYOffset;
11058
- const transform = `rotate(45 ${milestoneX + rotatedHeight * 0.356} ${milestoneY + rotatedHeight * 0.85})`;
11059
- const milestoneCenterX = milestoneX + rotatedHeight * 0.5;
11060
- const lineX = milestoneCenterX + rotatedHeight / Math.sqrt(2) * 0.5;
11054
+ const taskHeight = rowHeight * barFill / 100;
11055
+ const rotatedHeight = taskHeight / Math.SQRT2;
11056
+ const centerX = dateBaseX;
11057
+ const centerY = 6;
11058
+ const rectX = centerX - rotatedHeight / 2;
11059
+ const rectY = centerY - rotatedHeight / 2;
11060
+ const rightEdgeX = centerX + taskHeight / 2;
11061
11061
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11062
11062
  /* @__PURE__ */ jsxRuntime.jsx(
11063
11063
  "rect",
11064
11064
  {
11065
- x: milestoneX,
11066
- y: milestoneY,
11067
- width: rotatedHeight,
11068
- height: rotatedHeight,
11069
- rx: barCornerRadius,
11070
- ry: barCornerRadius,
11071
- transform,
11065
+ x: additionalLeftSpace + rightEdgeX,
11066
+ y: 0,
11067
+ width: 2,
11068
+ height: ganttFullHeight,
11072
11069
  fill: color,
11073
- opacity: 0.9,
11074
- stroke: color,
11075
- strokeWidth: 1
11070
+ opacity: 0.9
11076
11071
  }
11077
11072
  ),
11078
11073
  /* @__PURE__ */ jsxRuntime.jsx(
11079
11074
  "rect",
11080
11075
  {
11081
- x: lineX,
11082
- y: 0,
11083
- width: 2,
11084
- height: ganttFullHeight,
11076
+ x: additionalLeftSpace + rectX,
11077
+ y: rectY,
11078
+ width: rotatedHeight,
11079
+ height: rotatedHeight,
11085
11080
  fill: color,
11086
- opacity: 0.7
11081
+ transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11082
+ rx: 2,
11083
+ ry: 2
11087
11084
  }
11088
11085
  ),
11089
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: lineX + 8, y: 10, fill: color, fontSize: 12, fontWeight: 600, children: dataDateLabel || "Data Date" })
11086
+ /* @__PURE__ */ jsxRuntime.jsx(
11087
+ "text",
11088
+ {
11089
+ x: additionalLeftSpace + rightEdgeX + 8,
11090
+ y: 10,
11091
+ fill: color,
11092
+ fontSize: 12,
11093
+ fontWeight: 600,
11094
+ children: dataDateLabel || "Data Date"
11095
+ }
11096
+ )
11090
11097
  ] });
11091
11098
  }, [
11092
11099
  additionalLeftSpace,
11093
- barCornerRadius,
11094
11100
  columnWidth,
11095
11101
  ganttFullHeight,
11096
11102
  rtl,
@@ -11100,8 +11106,8 @@
11100
11106
  dataDate,
11101
11107
  dataDateColor,
11102
11108
  dataDateLabel,
11103
- taskHeight,
11104
- taskYOffset
11109
+ rowHeight,
11110
+ barFill
11105
11111
  ]);
11106
11112
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "today", children: [
11107
11113
  dataDateElement,
@@ -20210,9 +20216,7 @@
20210
20216
  todayColor,
20211
20217
  dataDateColor,
20212
20218
  todayLabel,
20213
- dataDateLabel,
20214
- taskHeight,
20215
- taskYOffset
20219
+ dataDateLabel
20216
20220
  }),
20217
20221
  [
20218
20222
  additionalLeftSpace,
@@ -20228,9 +20232,7 @@
20228
20232
  todayColor,
20229
20233
  dataDateColor,
20230
20234
  todayLabel,
20231
- dataDateLabel,
20232
- taskHeight,
20233
- taskYOffset
20235
+ dataDateLabel
20234
20236
  ]
20235
20237
  );
20236
20238
  const calendarProps = React.useMemo(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.2.12",
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",