@thepocman/gantt-task-react 1.0.28 → 1.0.30

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.
@@ -3504,17 +3504,20 @@ const TaskListInner = ({
3504
3504
  className: styles$d.taskListContent,
3505
3505
  ref: taskListContentRef,
3506
3506
  onScroll: onScrollTableListContentVertically,
3507
+ style: {
3508
+ height: Math.min(
3509
+ ganttFullHeight,
3510
+ distances.minimumRowDisplayed * distances.rowHeight
3511
+ ),
3512
+ overflowY: "auto"
3513
+ },
3507
3514
  children: /* @__PURE__ */ jsx(
3508
3515
  "div",
3509
3516
  {
3510
3517
  style: {
3511
- height: Math.max(
3512
- ganttFullHeight,
3513
- distances.minimumRowDisplayed * distances.rowHeight
3514
- ),
3518
+ height: ganttFullHeight,
3515
3519
  backgroundSize: `100% ${fullRowHeight * 2}px`,
3516
- backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`,
3517
- overflow: "hidden"
3520
+ backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
3518
3521
  },
3519
3522
  children: /* @__PURE__ */ jsx(
3520
3523
  TaskListTable,
@@ -4604,7 +4607,6 @@ const Calendar = ({
4604
4607
  for (let i2 = startColumnIndex; i2 <= endColumnIndex; i2++) {
4605
4608
  const date = getDate(i2);
4606
4609
  const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
4607
- console.log("quarter :>> ", quarter);
4608
4610
  bottomValues2.push(
4609
4611
  /* @__PURE__ */ jsx(
4610
4612
  "text",
@@ -5006,8 +5008,6 @@ const GridBodyInner = ({
5006
5008
  startColumnIndex
5007
5009
  )) {
5008
5010
  const x3 = additionalLeftSpace + columnWidth * i2;
5009
- console.log("debugging x:", x3);
5010
- console.log("divider color", dividerColor);
5011
5011
  dividers.push(
5012
5012
  /* @__PURE__ */ jsx(
5013
5013
  "line",
@@ -5037,7 +5037,6 @@ const GridBodyInner = ({
5037
5037
  getDate,
5038
5038
  dividerColor
5039
5039
  ]);
5040
- console.log("verticalDividers :>> ", verticalDividers);
5041
5040
  return /* @__PURE__ */ jsxs("g", { className: "gridBody", children: [
5042
5041
  /* @__PURE__ */ jsx("g", { className: "today", children: today }),
5043
5042
  /* @__PURE__ */ jsx("g", { className: "verticalDividers", children: verticalDividers })
@@ -5242,9 +5241,9 @@ const Grid = (props) => {
5242
5241
  /* @__PURE__ */ jsx(GridBody, { ...props })
5243
5242
  ] });
5244
5243
  };
5245
- const ganttTaskRoot = "_ganttTaskRoot_1mu5y_1";
5246
- const ganttTaskContent = "_ganttTaskContent_1mu5y_83";
5247
- const wrapper$2 = "_wrapper_1mu5y_111";
5244
+ const ganttTaskRoot = "_ganttTaskRoot_1lwsd_1";
5245
+ const ganttTaskContent = "_ganttTaskContent_1lwsd_83";
5246
+ const wrapper$2 = "_wrapper_1lwsd_111";
5248
5247
  const styles$8 = {
5249
5248
  ganttTaskRoot,
5250
5249
  ganttTaskContent,
@@ -6871,7 +6870,6 @@ const TaskGanttContent = ({
6871
6870
  const dependentsByTask = dependentsAtLevel == null ? void 0 : dependentsAtLevel.get(taskId);
6872
6871
  dependentsByTask == null ? void 0 : dependentsByTask.filter(({ dependent }) => visibleTasksMirror[dependent.id]).forEach((dep) => {
6873
6872
  var _a2, _b;
6874
- console.log("dependent", dep);
6875
6873
  const addedDepsForDep = addedDependenciesAtLevel[_a2 = dep.dependent.id] ?? (addedDependenciesAtLevel[_a2] = {});
6876
6874
  if (addedDepsForDep[taskId])
6877
6875
  return;
@@ -6983,12 +6981,12 @@ const TaskGanttInner = (props) => {
6983
6981
  const containerStyle = {
6984
6982
  // In order to see the vertical scrollbar of the gantt content,
6985
6983
  // we resize dynamically the width of the gantt content
6986
- height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
6984
+ height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
6987
6985
  width: (ganttTaskRootRef == null ? void 0 : ganttTaskRootRef.current) ? ganttTaskRootRef.current.clientWidth + ganttTaskRootRef.current.scrollLeft : fullSvgWidth
6988
6986
  };
6989
6987
  const gridStyle = useMemo(
6990
6988
  () => ({
6991
- height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
6989
+ height: ganttFullHeight,
6992
6990
  width: fullSvgWidth,
6993
6991
  backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
6994
6992
  backgroundPositionX: additionalLeftSpace || void 0,
@@ -10553,6 +10551,28 @@ const defaultRoundStartDate = (date, viewMode) => {
10553
10551
  }
10554
10552
  return addMonths(start, 1);
10555
10553
  }
10554
+ case ViewMode.QuarterYear: {
10555
+ const start = startOfYear(date);
10556
+ const diff = differenceInMonths(date, start);
10557
+ if (diff < 3)
10558
+ return start;
10559
+ if (diff < 6)
10560
+ return addMonths(start, 3);
10561
+ if (diff < 9)
10562
+ return addMonths(start, 6);
10563
+ if (diff < 12)
10564
+ return addMonths(start, 9);
10565
+ return addYears(start, 1);
10566
+ }
10567
+ case ViewMode.HalfYear: {
10568
+ const start = startOfYear(date);
10569
+ const diff = differenceInMonths(date, start);
10570
+ if (diff < 6)
10571
+ return start;
10572
+ if (diff < 12)
10573
+ return addMonths(start, 6);
10574
+ return addYears(start, 1);
10575
+ }
10556
10576
  case ViewMode.Year: {
10557
10577
  const start = startOfYear(date);
10558
10578
  const diff = differenceInMonths(date, start);
@@ -11720,6 +11740,7 @@ const defaultDateFormats = {
11720
11740
  };
11721
11741
  const defaultDistances = {
11722
11742
  actionColumnWidth: 40,
11743
+ ganttHeight: 0,
11723
11744
  arrowIndent: 20,
11724
11745
  taskHeight: 24,
11725
11746
  barCornerRadius: 3,
@@ -3517,17 +3517,20 @@
3517
3517
  className: styles$d.taskListContent,
3518
3518
  ref: taskListContentRef,
3519
3519
  onScroll: onScrollTableListContentVertically,
3520
+ style: {
3521
+ height: Math.min(
3522
+ ganttFullHeight,
3523
+ distances.minimumRowDisplayed * distances.rowHeight
3524
+ ),
3525
+ overflowY: "auto"
3526
+ },
3520
3527
  children: /* @__PURE__ */ jsxRuntime.jsx(
3521
3528
  "div",
3522
3529
  {
3523
3530
  style: {
3524
- height: Math.max(
3525
- ganttFullHeight,
3526
- distances.minimumRowDisplayed * distances.rowHeight
3527
- ),
3531
+ height: ganttFullHeight,
3528
3532
  backgroundSize: `100% ${fullRowHeight * 2}px`,
3529
- backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`,
3530
- overflow: "hidden"
3533
+ backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
3531
3534
  },
3532
3535
  children: /* @__PURE__ */ jsxRuntime.jsx(
3533
3536
  TaskListTable,
@@ -4617,7 +4620,6 @@
4617
4620
  for (let i = startColumnIndex; i <= endColumnIndex; i++) {
4618
4621
  const date = getDate(i);
4619
4622
  const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
4620
- console.log("quarter :>> ", quarter);
4621
4623
  bottomValues2.push(
4622
4624
  /* @__PURE__ */ jsxRuntime.jsx(
4623
4625
  "text",
@@ -5019,8 +5021,6 @@
5019
5021
  startColumnIndex
5020
5022
  )) {
5021
5023
  const x2 = additionalLeftSpace + columnWidth * i;
5022
- console.log("debugging x:", x2);
5023
- console.log("divider color", dividerColor);
5024
5024
  dividers.push(
5025
5025
  /* @__PURE__ */ jsxRuntime.jsx(
5026
5026
  "line",
@@ -5050,7 +5050,6 @@
5050
5050
  getDate,
5051
5051
  dividerColor
5052
5052
  ]);
5053
- console.log("verticalDividers :>> ", verticalDividers);
5054
5053
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "gridBody", children: [
5055
5054
  /* @__PURE__ */ jsxRuntime.jsx("g", { className: "today", children: today }),
5056
5055
  /* @__PURE__ */ jsxRuntime.jsx("g", { className: "verticalDividers", children: verticalDividers })
@@ -5255,9 +5254,9 @@
5255
5254
  /* @__PURE__ */ jsxRuntime.jsx(GridBody, { ...props })
5256
5255
  ] });
5257
5256
  };
5258
- const ganttTaskRoot = "_ganttTaskRoot_1mu5y_1";
5259
- const ganttTaskContent = "_ganttTaskContent_1mu5y_83";
5260
- const wrapper$2 = "_wrapper_1mu5y_111";
5257
+ const ganttTaskRoot = "_ganttTaskRoot_1lwsd_1";
5258
+ const ganttTaskContent = "_ganttTaskContent_1lwsd_83";
5259
+ const wrapper$2 = "_wrapper_1lwsd_111";
5261
5260
  const styles$8 = {
5262
5261
  ganttTaskRoot,
5263
5262
  ganttTaskContent,
@@ -6884,7 +6883,6 @@
6884
6883
  const dependentsByTask = dependentsAtLevel == null ? void 0 : dependentsAtLevel.get(taskId);
6885
6884
  dependentsByTask == null ? void 0 : dependentsByTask.filter(({ dependent }) => visibleTasksMirror[dependent.id]).forEach((dep) => {
6886
6885
  var _a2, _b;
6887
- console.log("dependent", dep);
6888
6886
  const addedDepsForDep = addedDependenciesAtLevel[_a2 = dep.dependent.id] ?? (addedDependenciesAtLevel[_a2] = {});
6889
6887
  if (addedDepsForDep[taskId])
6890
6888
  return;
@@ -6996,12 +6994,12 @@
6996
6994
  const containerStyle = {
6997
6995
  // In order to see the vertical scrollbar of the gantt content,
6998
6996
  // we resize dynamically the width of the gantt content
6999
- height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
6997
+ height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
7000
6998
  width: (ganttTaskRootRef == null ? void 0 : ganttTaskRootRef.current) ? ganttTaskRootRef.current.clientWidth + ganttTaskRootRef.current.scrollLeft : fullSvgWidth
7001
6999
  };
7002
7000
  const gridStyle = React.useMemo(
7003
7001
  () => ({
7004
- height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
7002
+ height: ganttFullHeight,
7005
7003
  width: fullSvgWidth,
7006
7004
  backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
7007
7005
  backgroundPositionX: additionalLeftSpace || void 0,
@@ -10566,6 +10564,28 @@
10566
10564
  }
10567
10565
  return addMonths(start, 1);
10568
10566
  }
10567
+ case ViewMode.QuarterYear: {
10568
+ const start = startOfYear(date);
10569
+ const diff = differenceInMonths(date, start);
10570
+ if (diff < 3)
10571
+ return start;
10572
+ if (diff < 6)
10573
+ return addMonths(start, 3);
10574
+ if (diff < 9)
10575
+ return addMonths(start, 6);
10576
+ if (diff < 12)
10577
+ return addMonths(start, 9);
10578
+ return addYears(start, 1);
10579
+ }
10580
+ case ViewMode.HalfYear: {
10581
+ const start = startOfYear(date);
10582
+ const diff = differenceInMonths(date, start);
10583
+ if (diff < 6)
10584
+ return start;
10585
+ if (diff < 12)
10586
+ return addMonths(start, 6);
10587
+ return addYears(start, 1);
10588
+ }
10569
10589
  case ViewMode.Year: {
10570
10590
  const start = startOfYear(date);
10571
10591
  const diff = differenceInMonths(date, start);
@@ -11733,6 +11753,7 @@
11733
11753
  };
11734
11754
  const defaultDistances = {
11735
11755
  actionColumnWidth: 40,
11756
+ ganttHeight: 0,
11736
11757
  arrowIndent: 20,
11737
11758
  taskHeight: 24,
11738
11759
  barCornerRadius: 3,
package/dist/style.css CHANGED
@@ -332,7 +332,7 @@
332
332
  stroke: #e0e0e0;
333
333
  stroke-width: 1.4;
334
334
  }
335
- ._ganttTaskRoot_1mu5y_1 {
335
+ ._ganttTaskRoot_1lwsd_1 {
336
336
  display: flex;
337
337
  flex-direction: column;
338
338
  overflow-x: scroll;
@@ -344,7 +344,7 @@
344
344
 
345
345
  /* Only chrome otherwise the firefox scrollbar has no edge*/
346
346
  @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
347
- ._ganttTaskRoot_1mu5y_1 {
347
+ ._ganttTaskRoot_1lwsd_1 {
348
348
  scrollbar-width: thin;
349
349
  }
350
350
  }
@@ -373,7 +373,7 @@
373
373
  background-clip: padding-box;
374
374
  } */
375
375
 
376
- ._ganttTaskContent_1mu5y_83 {
376
+ ._ganttTaskContent_1lwsd_83 {
377
377
  margin: 0;
378
378
  padding: 0;
379
379
  overflow-x: hidden;
@@ -382,12 +382,12 @@
382
382
 
383
383
  /* Only chrome otherwise the firefox scrollbar has no edges*/
384
384
  @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
385
- ._ganttTaskContent_1mu5y_83 {
385
+ ._ganttTaskContent_1lwsd_83 {
386
386
  scrollbar-width: thin;
387
387
  }
388
388
  }
389
389
 
390
- ._wrapper_1mu5y_111 {
390
+ ._wrapper_1lwsd_111 {
391
391
  display: grid;
392
392
  overflow-x: hidden;
393
393
  overflow-y: auto;
@@ -396,7 +396,6 @@
396
396
  list-style: none;
397
397
  outline: none;
398
398
  position: relative;
399
- height: 600px;
400
399
  }._hoverVisibleWrapper_11ld1_1:hover ._wrapper_11ld1_1 {
401
400
  display: initial;
402
401
  }
@@ -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.28",
3
+ "version": "1.0.30",
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",