gantt-task-react-v 1.2.12 → 1.2.13

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: { columnWidth },
10915
10915
  ganttFullHeight,
10916
10916
  isUnknownDates,
10917
10917
  rtl,
@@ -10923,9 +10923,7 @@ 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
  }) => {
10930
10928
  const todayElement = useMemo(() => {
10931
10929
  if (isUnknownDates || !showTodayLine) {
@@ -11033,47 +11031,54 @@ const GanttTodayInner = ({
11033
11031
  }
11034
11032
  };
11035
11033
  const tickX = dataIndex * columnWidth * extraMultiplier();
11036
- const x = rtl ? tickX + columnWidth : tickX;
11034
+ const baseX = rtl ? tickX + columnWidth : tickX;
11037
11035
  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;
11036
+ const size = 12;
11037
+ const half = size / 2;
11038
+ const centerX = baseX + 1;
11039
+ const centerY = 6;
11040
+ const rectX = centerX - half;
11041
+ const rectY = centerY - half;
11042
+ const rightEdgeX = centerX + half * Math.SQRT2;
11044
11043
  return /* @__PURE__ */ jsxs(Fragment, { children: [
11045
11044
  /* @__PURE__ */ jsx(
11046
11045
  "rect",
11047
11046
  {
11048
- x: milestoneX,
11049
- y: milestoneY,
11050
- width: rotatedHeight,
11051
- height: rotatedHeight,
11052
- rx: barCornerRadius,
11053
- ry: barCornerRadius,
11054
- transform,
11047
+ x: additionalLeftSpace + rightEdgeX,
11048
+ y: 0,
11049
+ width: 2,
11050
+ height: ganttFullHeight,
11055
11051
  fill: color,
11056
- opacity: 0.9,
11057
- stroke: color,
11058
- strokeWidth: 1
11052
+ opacity: 0.9
11059
11053
  }
11060
11054
  ),
11061
11055
  /* @__PURE__ */ jsx(
11062
11056
  "rect",
11063
11057
  {
11064
- x: lineX,
11065
- y: 0,
11066
- width: 2,
11067
- height: ganttFullHeight,
11058
+ x: additionalLeftSpace + rectX,
11059
+ y: rectY,
11060
+ width: size,
11061
+ height: size,
11068
11062
  fill: color,
11069
- opacity: 0.7
11063
+ transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11064
+ rx: 2,
11065
+ ry: 2
11070
11066
  }
11071
11067
  ),
11072
- /* @__PURE__ */ jsx("text", { x: lineX + 8, y: 10, fill: color, fontSize: 12, fontWeight: 600, children: dataDateLabel || "Data Date" })
11068
+ /* @__PURE__ */ jsx(
11069
+ "text",
11070
+ {
11071
+ x: additionalLeftSpace + rightEdgeX + 8,
11072
+ y: 10,
11073
+ fill: color,
11074
+ fontSize: 12,
11075
+ fontWeight: 600,
11076
+ children: dataDateLabel || "Data Date"
11077
+ }
11078
+ )
11073
11079
  ] });
11074
11080
  }, [
11075
11081
  additionalLeftSpace,
11076
- barCornerRadius,
11077
11082
  columnWidth,
11078
11083
  ganttFullHeight,
11079
11084
  rtl,
@@ -11082,9 +11087,7 @@ const GanttTodayInner = ({
11082
11087
  showDataDateLine,
11083
11088
  dataDate,
11084
11089
  dataDateColor,
11085
- dataDateLabel,
11086
- taskHeight,
11087
- taskYOffset
11090
+ dataDateLabel
11088
11091
  ]);
11089
11092
  return /* @__PURE__ */ jsxs("g", { className: "today", children: [
11090
11093
  dataDateElement,
@@ -20193,9 +20196,7 @@ const Gantt = (props) => {
20193
20196
  todayColor,
20194
20197
  dataDateColor,
20195
20198
  todayLabel,
20196
- dataDateLabel,
20197
- taskHeight,
20198
- taskYOffset
20199
+ dataDateLabel
20199
20200
  }),
20200
20201
  [
20201
20202
  additionalLeftSpace,
@@ -20211,9 +20212,7 @@ const Gantt = (props) => {
20211
20212
  todayColor,
20212
20213
  dataDateColor,
20213
20214
  todayLabel,
20214
- dataDateLabel,
20215
- taskHeight,
20216
- taskYOffset
20215
+ dataDateLabel
20217
20216
  ]
20218
20217
  );
20219
20218
  const calendarProps = useMemo(
@@ -10928,7 +10928,7 @@
10928
10928
  };
10929
10929
  const GanttTodayInner = ({
10930
10930
  additionalLeftSpace,
10931
- distances: { columnWidth, barCornerRadius },
10931
+ distances: { columnWidth },
10932
10932
  ganttFullHeight,
10933
10933
  isUnknownDates,
10934
10934
  rtl,
@@ -10940,9 +10940,7 @@
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
  }) => {
10947
10945
  const todayElement = React.useMemo(() => {
10948
10946
  if (isUnknownDates || !showTodayLine) {
@@ -11050,47 +11048,54 @@
11050
11048
  }
11051
11049
  };
11052
11050
  const tickX = dataIndex * columnWidth * extraMultiplier();
11053
- const x = rtl ? tickX + columnWidth : tickX;
11051
+ const baseX = rtl ? tickX + columnWidth : tickX;
11054
11052
  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;
11053
+ const size = 12;
11054
+ const half = size / 2;
11055
+ const centerX = baseX + 1;
11056
+ const centerY = 6;
11057
+ const rectX = centerX - half;
11058
+ const rectY = centerY - half;
11059
+ const rightEdgeX = centerX + half * Math.SQRT2;
11061
11060
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11062
11061
  /* @__PURE__ */ jsxRuntime.jsx(
11063
11062
  "rect",
11064
11063
  {
11065
- x: milestoneX,
11066
- y: milestoneY,
11067
- width: rotatedHeight,
11068
- height: rotatedHeight,
11069
- rx: barCornerRadius,
11070
- ry: barCornerRadius,
11071
- transform,
11064
+ x: additionalLeftSpace + rightEdgeX,
11065
+ y: 0,
11066
+ width: 2,
11067
+ height: ganttFullHeight,
11072
11068
  fill: color,
11073
- opacity: 0.9,
11074
- stroke: color,
11075
- strokeWidth: 1
11069
+ opacity: 0.9
11076
11070
  }
11077
11071
  ),
11078
11072
  /* @__PURE__ */ jsxRuntime.jsx(
11079
11073
  "rect",
11080
11074
  {
11081
- x: lineX,
11082
- y: 0,
11083
- width: 2,
11084
- height: ganttFullHeight,
11075
+ x: additionalLeftSpace + rectX,
11076
+ y: rectY,
11077
+ width: size,
11078
+ height: size,
11085
11079
  fill: color,
11086
- opacity: 0.7
11080
+ transform: `rotate(45 ${additionalLeftSpace + centerX} ${centerY})`,
11081
+ rx: 2,
11082
+ ry: 2
11087
11083
  }
11088
11084
  ),
11089
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: lineX + 8, y: 10, fill: color, fontSize: 12, fontWeight: 600, children: dataDateLabel || "Data Date" })
11085
+ /* @__PURE__ */ jsxRuntime.jsx(
11086
+ "text",
11087
+ {
11088
+ x: additionalLeftSpace + rightEdgeX + 8,
11089
+ y: 10,
11090
+ fill: color,
11091
+ fontSize: 12,
11092
+ fontWeight: 600,
11093
+ children: dataDateLabel || "Data Date"
11094
+ }
11095
+ )
11090
11096
  ] });
11091
11097
  }, [
11092
11098
  additionalLeftSpace,
11093
- barCornerRadius,
11094
11099
  columnWidth,
11095
11100
  ganttFullHeight,
11096
11101
  rtl,
@@ -11099,9 +11104,7 @@
11099
11104
  showDataDateLine,
11100
11105
  dataDate,
11101
11106
  dataDateColor,
11102
- dataDateLabel,
11103
- taskHeight,
11104
- taskYOffset
11107
+ dataDateLabel
11105
11108
  ]);
11106
11109
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "today", children: [
11107
11110
  dataDateElement,
@@ -20210,9 +20213,7 @@
20210
20213
  todayColor,
20211
20214
  dataDateColor,
20212
20215
  todayLabel,
20213
- dataDateLabel,
20214
- taskHeight,
20215
- taskYOffset
20216
+ dataDateLabel
20216
20217
  }),
20217
20218
  [
20218
20219
  additionalLeftSpace,
@@ -20228,9 +20229,7 @@
20228
20229
  todayColor,
20229
20230
  dataDateColor,
20230
20231
  todayLabel,
20231
- dataDateLabel,
20232
- taskHeight,
20233
- taskYOffset
20232
+ dataDateLabel
20234
20233
  ]
20235
20234
  );
20236
20235
  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.13",
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",