gantt-task-react-v 1.0.21 → 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_1nwo1_1";
13151
- const horizontalContainer = "_horizontalContainer_1nwo1_85";
13152
- const ganttHeader = "_ganttHeader_1nwo1_107";
13153
- const ganttBodyScroll = "_ganttBodyScroll_1nwo1_117";
13154
- const wrapper = "_wrapper_1nwo1_139";
13155
- const calendarDragging = "_calendarDragging_1nwo1_173";
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_1nwo1_1";
13168
- const horizontalContainer = "_horizontalContainer_1nwo1_85";
13169
- const ganttHeader = "_ganttHeader_1nwo1_107";
13170
- const ganttBodyScroll = "_ganttBodyScroll_1nwo1_117";
13171
- const wrapper = "_wrapper_1nwo1_139";
13172
- const calendarDragging = "_calendarDragging_1nwo1_173";
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,14 +581,11 @@
581
581
  user-select: none;
582
582
  stroke-width: 0;
583
583
  }
584
- ._ganttVerticalContainer_1nwo1_1 {
584
+ ._ganttVerticalContainer_z1ydk_1 {
585
585
  display: flex;
586
586
  flex-direction: column;
587
- /* inner container should not create a page-wide scroll; let wrapper handle horizontal overflow */
588
- overflow-x: visible;
587
+ overflow-x: auto;
589
588
  overflow-y: hidden;
590
- /* allow this flex child to shrink when its child is wider than available space */
591
- min-width: 0;
592
589
  font-size: 0;
593
590
  margin: 0;
594
591
  padding: 0;
@@ -597,18 +594,19 @@
597
594
  flex-grow: 1;
598
595
  height: 100%;
599
596
  min-height: 0;
597
+ max-width: 100%;
600
598
  }
601
599
 
602
- ._ganttVerticalContainer_1nwo1_1::-webkit-scrollbar {
600
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar {
603
601
  width: 1rem;
604
602
  height: 1rem;
605
603
  }
606
604
 
607
- ._ganttVerticalContainer_1nwo1_1::-webkit-scrollbar-corner {
605
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-corner {
608
606
  background: transparent;
609
607
  }
610
608
 
611
- ._ganttVerticalContainer_1nwo1_1::-webkit-scrollbar-thumb {
609
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-thumb {
612
610
  border: 4px solid transparent;
613
611
  /*noinspection CssUnresolvedCustomProperty*/
614
612
  background: var(--gantt-scrollbar-thumb-color);
@@ -616,58 +614,51 @@
616
614
  background-clip: padding-box;
617
615
  }
618
616
 
619
- ._ganttVerticalContainer_1nwo1_1::-webkit-scrollbar-thumb:hover {
617
+ ._ganttVerticalContainer_z1ydk_1::-webkit-scrollbar-thumb:hover {
620
618
  border: 2px solid transparent;
621
619
  /*noinspection CssUnresolvedCustomProperty*/
622
620
  background: var(--gantt-scrollbar-thumb-color);
623
621
  background-clip: padding-box;
624
622
  }
625
623
 
626
- ._horizontalContainer_1nwo1_85 {
624
+ ._horizontalContainer_z1ydk_81 {
627
625
  margin: 0;
628
626
  padding: 0;
629
- /* keep inner container hidden overflow so content width is controlled by outer container */
630
627
  overflow: hidden;
631
- /* allow inner container to be clipped instead of forcing parent width */
632
- min-width: 0;
633
628
  height: 100%;
634
629
  min-height: 0;
630
+ min-width: 0;
635
631
  }
636
632
 
637
- ._ganttHeader_1nwo1_107 {
633
+ ._ganttHeader_z1ydk_99 {
638
634
  flex: 0 0 auto;
639
635
  z-index: 3;
640
636
  }
641
637
 
642
- ._ganttBodyScroll_1nwo1_117 {
638
+ ._ganttBodyScroll_z1ydk_109 {
643
639
  flex: 1 1 auto;
644
- /* vertical scrolling only here; horizontal controlled by the parent container */
645
640
  overflow-y: auto;
646
- /* allow horizontal overflow to be visible so the outer container's horizontal
647
- scrollbar can control the full width of the gantt */
648
- overflow-x: visible;
641
+ overflow-x: hidden;
649
642
  min-height: 0;
650
643
  height: 100%;
651
644
  }
652
645
 
653
- ._wrapper_1nwo1_139 {
646
+ ._wrapper_z1ydk_125 {
654
647
  display: flex;
655
648
  padding: 0;
656
649
  margin: 0;
657
650
  list-style: none;
658
651
  outline: none;
659
652
  position: relative;
660
- /* allow children to shrink; prevents child content from expanding the wrapper width */
661
- min-width: 0;
662
- /* let wrapper provide horizontal scrolling when children are wider than the view */
663
- overflow-x: auto;
664
653
  /*noinspection CssUnresolvedCustomProperty*/
665
654
  border-bottom: 1px solid var(--gantt-divider-color);
666
655
  height: 100%;
667
656
  min-height: 0;
657
+ max-width: 100%;
658
+ overflow: hidden;
668
659
  }
669
660
 
670
- ._calendarDragging_1nwo1_173 {
661
+ ._calendarDragging_z1ydk_155 {
671
662
  cursor: grabbing;
672
663
  }
673
664
  /*noinspection CssUnresolvedCustomProperty*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.0.21",
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",