@thepocman/gantt-task-react 1.0.27 → 1.0.29

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.
@@ -5005,10 +5005,7 @@ const GridBodyInner = ({
5005
5005
  i2,
5006
5006
  startColumnIndex
5007
5007
  )) {
5008
- console.log("Drawing divider at column", i2, "date", currentDate);
5009
5008
  const x3 = additionalLeftSpace + columnWidth * i2;
5010
- console.log("debugging x:", x3);
5011
- console.log("divider color", dividerColor);
5012
5009
  dividers.push(
5013
5010
  /* @__PURE__ */ jsx(
5014
5011
  "line",
@@ -5019,7 +5016,7 @@ const GridBodyInner = ({
5019
5016
  y2: ganttFullHeight,
5020
5017
  stroke: dividerColor,
5021
5018
  opacity: 0.15,
5022
- strokeWidth: 5
5019
+ strokeWidth: 2
5023
5020
  },
5024
5021
  `divider-${i2}`
5025
5022
  )
@@ -5038,7 +5035,6 @@ const GridBodyInner = ({
5038
5035
  getDate,
5039
5036
  dividerColor
5040
5037
  ]);
5041
- console.log("verticalDividers :>> ", verticalDividers);
5042
5038
  return /* @__PURE__ */ jsxs("g", { className: "gridBody", children: [
5043
5039
  /* @__PURE__ */ jsx("g", { className: "today", children: today }),
5044
5040
  /* @__PURE__ */ jsx("g", { className: "verticalDividers", children: verticalDividers })
@@ -10554,6 +10550,28 @@ const defaultRoundStartDate = (date, viewMode) => {
10554
10550
  }
10555
10551
  return addMonths(start, 1);
10556
10552
  }
10553
+ case ViewMode.QuarterYear: {
10554
+ const start = startOfYear(date);
10555
+ const diff = differenceInMonths(date, start);
10556
+ if (diff < 3)
10557
+ return start;
10558
+ if (diff < 6)
10559
+ return addMonths(start, 3);
10560
+ if (diff < 9)
10561
+ return addMonths(start, 6);
10562
+ if (diff < 12)
10563
+ return addMonths(start, 9);
10564
+ return addYears(start, 1);
10565
+ }
10566
+ case ViewMode.HalfYear: {
10567
+ const start = startOfYear(date);
10568
+ const diff = differenceInMonths(date, start);
10569
+ if (diff < 6)
10570
+ return start;
10571
+ if (diff < 12)
10572
+ return addMonths(start, 6);
10573
+ return addYears(start, 1);
10574
+ }
10557
10575
  case ViewMode.Year: {
10558
10576
  const start = startOfYear(date);
10559
10577
  const diff = differenceInMonths(date, start);
@@ -11721,6 +11739,7 @@ const defaultDateFormats = {
11721
11739
  };
11722
11740
  const defaultDistances = {
11723
11741
  actionColumnWidth: 40,
11742
+ ganttHeight: 0,
11724
11743
  arrowIndent: 20,
11725
11744
  taskHeight: 24,
11726
11745
  barCornerRadius: 3,
@@ -5018,10 +5018,7 @@
5018
5018
  i,
5019
5019
  startColumnIndex
5020
5020
  )) {
5021
- console.log("Drawing divider at column", i, "date", currentDate);
5022
5021
  const x2 = additionalLeftSpace + columnWidth * i;
5023
- console.log("debugging x:", x2);
5024
- console.log("divider color", dividerColor);
5025
5022
  dividers.push(
5026
5023
  /* @__PURE__ */ jsxRuntime.jsx(
5027
5024
  "line",
@@ -5032,7 +5029,7 @@
5032
5029
  y2: ganttFullHeight,
5033
5030
  stroke: dividerColor,
5034
5031
  opacity: 0.15,
5035
- strokeWidth: 5
5032
+ strokeWidth: 2
5036
5033
  },
5037
5034
  `divider-${i}`
5038
5035
  )
@@ -5051,7 +5048,6 @@
5051
5048
  getDate,
5052
5049
  dividerColor
5053
5050
  ]);
5054
- console.log("verticalDividers :>> ", verticalDividers);
5055
5051
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "gridBody", children: [
5056
5052
  /* @__PURE__ */ jsxRuntime.jsx("g", { className: "today", children: today }),
5057
5053
  /* @__PURE__ */ jsxRuntime.jsx("g", { className: "verticalDividers", children: verticalDividers })
@@ -10567,6 +10563,28 @@
10567
10563
  }
10568
10564
  return addMonths(start, 1);
10569
10565
  }
10566
+ case ViewMode.QuarterYear: {
10567
+ const start = startOfYear(date);
10568
+ const diff = differenceInMonths(date, start);
10569
+ if (diff < 3)
10570
+ return start;
10571
+ if (diff < 6)
10572
+ return addMonths(start, 3);
10573
+ if (diff < 9)
10574
+ return addMonths(start, 6);
10575
+ if (diff < 12)
10576
+ return addMonths(start, 9);
10577
+ return addYears(start, 1);
10578
+ }
10579
+ case ViewMode.HalfYear: {
10580
+ const start = startOfYear(date);
10581
+ const diff = differenceInMonths(date, start);
10582
+ if (diff < 6)
10583
+ return start;
10584
+ if (diff < 12)
10585
+ return addMonths(start, 6);
10586
+ return addYears(start, 1);
10587
+ }
10570
10588
  case ViewMode.Year: {
10571
10589
  const start = startOfYear(date);
10572
10590
  const diff = differenceInMonths(date, start);
@@ -11734,6 +11752,7 @@
11734
11752
  };
11735
11753
  const defaultDistances = {
11736
11754
  actionColumnWidth: 40,
11755
+ ganttHeight: 0,
11737
11756
  arrowIndent: 20,
11738
11757
  taskHeight: 24,
11739
11758
  barCornerRadius: 3,
@@ -114,6 +114,7 @@ export interface Distances {
114
114
  * From 0 to 100
115
115
  */
116
116
  barFill: number;
117
+ ganttHeight: number;
117
118
  columnWidth: number;
118
119
  contextMenuIconWidth: number;
119
120
  contextMenuOptionHeight: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thepocman/gantt-task-react",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "Fork of gantt-task-react with support for grouped tasks on a single row when collapsed",
5
5
  "author": "Adrian Bueno <adrianlbueno@users.noreply.github.com>",
6
6
  "homepage": "https://github.com/adrianlbueno/gantt-task-react#readme",