gantt-task-react-v 1.0.20 → 1.0.22

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.
@@ -13147,12 +13147,12 @@ const TaskGanttContentInner = (props) => {
13147
13147
  ] });
13148
13148
  };
13149
13149
  const TaskGanttContent = memo(TaskGanttContentInner);
13150
- const ganttVerticalContainer = "_ganttVerticalContainer_fjhll_1";
13151
- const horizontalContainer = "_horizontalContainer_fjhll_81";
13152
- const ganttHeader = "_ganttHeader_fjhll_99";
13153
- const ganttBodyScroll = "_ganttBodyScroll_fjhll_109";
13154
- const wrapper = "_wrapper_fjhll_127";
13155
- const calendarDragging = "_calendarDragging_fjhll_153";
13150
+ const ganttVerticalContainer = "_ganttVerticalContainer_z1ydk_1";
13151
+ const horizontalContainer = "_horizontalContainer_z1ydk_81";
13152
+ const ganttHeader = "_ganttHeader_z1ydk_99";
13153
+ const ganttBodyScroll = "_ganttBodyScroll_z1ydk_109";
13154
+ const wrapper = "_wrapper_z1ydk_125";
13155
+ const calendarDragging = "_calendarDragging_z1ydk_155";
13156
13156
  const styles$2 = {
13157
13157
  ganttVerticalContainer,
13158
13158
  horizontalContainer,
@@ -13186,39 +13186,16 @@ const TaskGanttInner = (props) => {
13186
13186
  const containerStyle = useMemo(
13187
13187
  () => ({
13188
13188
  height: "100%",
13189
- // width will be set dynamically below based on measured container width
13190
- width: fullSvgWidth
13189
+ minWidth: fullSvgWidth,
13190
+ width: "max-content"
13191
13191
  }),
13192
13192
  [fullSvgWidth]
13193
13193
  );
13194
- const [parentClientWidth, setParentClientWidth] = useState(
13195
- null
13196
- );
13197
- useEffect(() => {
13198
- const el = verticalGanttContainerRef.current;
13199
- if (!el) {
13200
- return () => {
13201
- };
13202
- }
13203
- const update = () => setParentClientWidth(el.clientWidth);
13204
- update();
13205
- let ro = null;
13206
- if (typeof ResizeObserver !== "undefined") {
13207
- ro = new ResizeObserver(() => update());
13208
- ro.observe(el);
13209
- }
13210
- window.addEventListener("resize", update);
13211
- return () => {
13212
- if (ro) {
13213
- ro.disconnect();
13214
- }
13215
- window.removeEventListener("resize", update);
13216
- };
13217
- }, [verticalGanttContainerRef]);
13218
13194
  const gridStyle = useMemo(
13219
13195
  () => ({
13220
13196
  height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
13221
- width: fullSvgWidth,
13197
+ minWidth: fullSvgWidth,
13198
+ width: "max-content",
13222
13199
  backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
13223
13200
  backgroundPositionX: additionalLeftSpace || void 0,
13224
13201
  backgroundImage: [
@@ -13298,33 +13275,15 @@ const TaskGanttInner = (props) => {
13298
13275
  moveStateHorRef.current = null;
13299
13276
  contentContainer.classList.remove(styles$2.calendarDragging);
13300
13277
  };
13301
- contentContainer.addEventListener(
13302
- "mousemove",
13303
- onScrollMove
13304
- );
13305
- contentContainer.addEventListener(
13306
- "mousedown",
13307
- onScrollStart
13308
- );
13278
+ contentContainer.addEventListener("mousemove", onScrollMove);
13279
+ contentContainer.addEventListener("mousedown", onScrollStart);
13309
13280
  contentContainer.addEventListener("mouseup", onScrollEnd);
13310
13281
  contentContainer.addEventListener("mouseout", onScrollEnd);
13311
13282
  return () => {
13312
- contentContainer.removeEventListener(
13313
- "mousemove",
13314
- onScrollMove
13315
- );
13316
- contentContainer.removeEventListener(
13317
- "mousedown",
13318
- onScrollStart
13319
- );
13320
- contentContainer.removeEventListener(
13321
- "mouseup",
13322
- onScrollEnd
13323
- );
13324
- contentContainer.removeEventListener(
13325
- "mouseout",
13326
- onScrollEnd
13327
- );
13283
+ contentContainer.removeEventListener("mousemove", onScrollMove);
13284
+ contentContainer.removeEventListener("mousedown", onScrollStart);
13285
+ contentContainer.removeEventListener("mouseup", onScrollEnd);
13286
+ contentContainer.removeEventListener("mouseout", onScrollEnd);
13328
13287
  };
13329
13288
  }, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
13330
13289
  return /* @__PURE__ */ jsxs(
@@ -13350,13 +13309,7 @@ const TaskGanttInner = (props) => {
13350
13309
  {
13351
13310
  ref: horizontalContainerRef,
13352
13311
  className: styles$2.horizontalContainer,
13353
- style: {
13354
- ...containerStyle,
13355
- // ensure the horizontal container occupies at least the parent view width
13356
- // so it's flexible when fullSvgWidth is smaller than the current viewport,
13357
- // and it overflows when fullSvgWidth is larger.
13358
- width: parentClientWidth && parentClientWidth > fullSvgWidth ? parentClientWidth : fullSvgWidth
13359
- },
13312
+ style: containerStyle,
13360
13313
  children: /* @__PURE__ */ jsx("div", { style: gridStyle, children: /* @__PURE__ */ jsxs(
13361
13314
  "svg",
13362
13315
  {
@@ -13164,12 +13164,12 @@
13164
13164
  ] });
13165
13165
  };
13166
13166
  const TaskGanttContent = React.memo(TaskGanttContentInner);
13167
- const ganttVerticalContainer = "_ganttVerticalContainer_fjhll_1";
13168
- const horizontalContainer = "_horizontalContainer_fjhll_81";
13169
- const ganttHeader = "_ganttHeader_fjhll_99";
13170
- const ganttBodyScroll = "_ganttBodyScroll_fjhll_109";
13171
- const wrapper = "_wrapper_fjhll_127";
13172
- const calendarDragging = "_calendarDragging_fjhll_153";
13167
+ const ganttVerticalContainer = "_ganttVerticalContainer_z1ydk_1";
13168
+ const horizontalContainer = "_horizontalContainer_z1ydk_81";
13169
+ const ganttHeader = "_ganttHeader_z1ydk_99";
13170
+ const ganttBodyScroll = "_ganttBodyScroll_z1ydk_109";
13171
+ const wrapper = "_wrapper_z1ydk_125";
13172
+ const calendarDragging = "_calendarDragging_z1ydk_155";
13173
13173
  const styles$2 = {
13174
13174
  ganttVerticalContainer,
13175
13175
  horizontalContainer,
@@ -13203,39 +13203,16 @@
13203
13203
  const containerStyle = React.useMemo(
13204
13204
  () => ({
13205
13205
  height: "100%",
13206
- // width will be set dynamically below based on measured container width
13207
- width: fullSvgWidth
13206
+ minWidth: fullSvgWidth,
13207
+ width: "max-content"
13208
13208
  }),
13209
13209
  [fullSvgWidth]
13210
13210
  );
13211
- const [parentClientWidth, setParentClientWidth] = React.useState(
13212
- null
13213
- );
13214
- React.useEffect(() => {
13215
- const el = verticalGanttContainerRef.current;
13216
- if (!el) {
13217
- return () => {
13218
- };
13219
- }
13220
- const update = () => setParentClientWidth(el.clientWidth);
13221
- update();
13222
- let ro = null;
13223
- if (typeof ResizeObserver !== "undefined") {
13224
- ro = new ResizeObserver(() => update());
13225
- ro.observe(el);
13226
- }
13227
- window.addEventListener("resize", update);
13228
- return () => {
13229
- if (ro) {
13230
- ro.disconnect();
13231
- }
13232
- window.removeEventListener("resize", update);
13233
- };
13234
- }, [verticalGanttContainerRef]);
13235
13211
  const gridStyle = React.useMemo(
13236
13212
  () => ({
13237
13213
  height: Math.max(ganttFullHeight, minimumRowDisplayed * rowHeight),
13238
- width: fullSvgWidth,
13214
+ minWidth: fullSvgWidth,
13215
+ width: "max-content",
13239
13216
  backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
13240
13217
  backgroundPositionX: additionalLeftSpace || void 0,
13241
13218
  backgroundImage: [
@@ -13315,33 +13292,15 @@
13315
13292
  moveStateHorRef.current = null;
13316
13293
  contentContainer.classList.remove(styles$2.calendarDragging);
13317
13294
  };
13318
- contentContainer.addEventListener(
13319
- "mousemove",
13320
- onScrollMove
13321
- );
13322
- contentContainer.addEventListener(
13323
- "mousedown",
13324
- onScrollStart
13325
- );
13295
+ contentContainer.addEventListener("mousemove", onScrollMove);
13296
+ contentContainer.addEventListener("mousedown", onScrollStart);
13326
13297
  contentContainer.addEventListener("mouseup", onScrollEnd);
13327
13298
  contentContainer.addEventListener("mouseout", onScrollEnd);
13328
13299
  return () => {
13329
- contentContainer.removeEventListener(
13330
- "mousemove",
13331
- onScrollMove
13332
- );
13333
- contentContainer.removeEventListener(
13334
- "mousedown",
13335
- onScrollStart
13336
- );
13337
- contentContainer.removeEventListener(
13338
- "mouseup",
13339
- onScrollEnd
13340
- );
13341
- contentContainer.removeEventListener(
13342
- "mouseout",
13343
- onScrollEnd
13344
- );
13300
+ contentContainer.removeEventListener("mousemove", onScrollMove);
13301
+ contentContainer.removeEventListener("mousedown", onScrollStart);
13302
+ contentContainer.removeEventListener("mouseup", onScrollEnd);
13303
+ contentContainer.removeEventListener("mouseout", onScrollEnd);
13345
13304
  };
13346
13305
  }, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
13347
13306
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -13367,13 +13326,7 @@
13367
13326
  {
13368
13327
  ref: horizontalContainerRef,
13369
13328
  className: styles$2.horizontalContainer,
13370
- style: {
13371
- ...containerStyle,
13372
- // ensure the horizontal container occupies at least the parent view width
13373
- // so it's flexible when fullSvgWidth is smaller than the current viewport,
13374
- // and it overflows when fullSvgWidth is larger.
13375
- width: parentClientWidth && parentClientWidth > fullSvgWidth ? parentClientWidth : fullSvgWidth
13376
- },
13329
+ style: containerStyle,
13377
13330
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(
13378
13331
  "svg",
13379
13332
  {
package/dist/style.css CHANGED
@@ -581,10 +581,9 @@
581
581
  user-select: none;
582
582
  stroke-width: 0;
583
583
  }
584
- ._ganttVerticalContainer_fjhll_1 {
584
+ ._ganttVerticalContainer_z1ydk_1 {
585
585
  display: flex;
586
586
  flex-direction: column;
587
- /* allow horizontal scrolling so the gantt SVG can overflow and be scrolled */
588
587
  overflow-x: auto;
589
588
  overflow-y: hidden;
590
589
  font-size: 0;
@@ -595,18 +594,19 @@
595
594
  flex-grow: 1;
596
595
  height: 100%;
597
596
  min-height: 0;
597
+ max-width: 100%;
598
598
  }
599
599
 
600
- ._ganttVerticalContainer_fjhll_1::-webkit-scrollbar {
600
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar {
601
601
  width: 1rem;
602
602
  height: 1rem;
603
603
  }
604
604
 
605
- ._ganttVerticalContainer_fjhll_1::-webkit-scrollbar-corner {
605
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-corner {
606
606
  background: transparent;
607
607
  }
608
608
 
609
- ._ganttVerticalContainer_fjhll_1::-webkit-scrollbar-thumb {
609
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-thumb {
610
610
  border: 4px solid transparent;
611
611
  /*noinspection CssUnresolvedCustomProperty*/
612
612
  background: var(--gantt-scrollbar-thumb-color);
@@ -614,37 +614,36 @@
614
614
  background-clip: padding-box;
615
615
  }
616
616
 
617
- ._ganttVerticalContainer_fjhll_1::-webkit-scrollbar-thumb:hover {
617
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-thumb:hover {
618
618
  border: 2px solid transparent;
619
619
  /*noinspection CssUnresolvedCustomProperty*/
620
620
  background: var(--gantt-scrollbar-thumb-color);
621
621
  background-clip: padding-box;
622
622
  }
623
623
 
624
- ._horizontalContainer_fjhll_81 {
624
+ ._horizontalContainer_z1ydk_81 {
625
625
  margin: 0;
626
626
  padding: 0;
627
- /* keep inner container hidden overflow so content width is controlled by outer container */
628
627
  overflow: hidden;
629
628
  height: 100%;
630
629
  min-height: 0;
630
+ min-width: 0;
631
631
  }
632
632
 
633
- ._ganttHeader_fjhll_99 {
633
+ ._ganttHeader_z1ydk_99 {
634
634
  flex: 0 0 auto;
635
635
  z-index: 3;
636
636
  }
637
637
 
638
- ._ganttBodyScroll_fjhll_109 {
638
+ ._ganttBodyScroll_z1ydk_109 {
639
639
  flex: 1 1 auto;
640
- /* vertical scrolling only here; horizontal controlled by the parent container */
641
640
  overflow-y: auto;
642
641
  overflow-x: hidden;
643
642
  min-height: 0;
644
643
  height: 100%;
645
644
  }
646
645
 
647
- ._wrapper_fjhll_127 {
646
+ ._wrapper_z1ydk_125 {
648
647
  display: flex;
649
648
  padding: 0;
650
649
  margin: 0;
@@ -655,9 +654,11 @@
655
654
  border-bottom: 1px solid var(--gantt-divider-color);
656
655
  height: 100%;
657
656
  min-height: 0;
657
+ max-width: 100%;
658
+ overflow: hidden;
658
659
  }
659
660
 
660
- ._calendarDragging_fjhll_153 {
661
+ ._calendarDragging_z1ydk_155 {
661
662
  cursor: grabbing;
662
663
  }
663
664
  /*noinspection CssUnresolvedCustomProperty*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
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",