gantt-task-react-powern 0.4.34 → 0.4.36

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.
@@ -743,7 +743,7 @@ var Grid = function Grid(props) {
743
743
  }, React.createElement(GridBody, Object.assign({}, props)));
744
744
  };
745
745
 
746
- var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX"};
746
+ var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
747
747
 
748
748
  var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
749
749
  var value = _ref.value,
@@ -751,7 +751,10 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
751
751
  y1Line = _ref.y1Line,
752
752
  y2Line = _ref.y2Line,
753
753
  xText = _ref.xText,
754
- yText = _ref.yText;
754
+ yText = _ref.yText,
755
+ _ref$textAnchor = _ref.textAnchor,
756
+ textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
757
+ var textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
755
758
  return React.createElement("g", {
756
759
  className: "calendarTop"
757
760
  }, React.createElement("line", {
@@ -765,7 +768,7 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
765
768
  key: value + "text",
766
769
  y: yText,
767
770
  x: xText,
768
- className: styles$5.calendarTopText
771
+ className: styles$5.calendarTopText + " " + textAnchorClass
769
772
  }, value));
770
773
  };
771
774
 
@@ -826,12 +829,14 @@ var Calendar = function Calendar(_ref) {
826
829
 
827
830
  for (var i = 0; i < dateSetup.dates.length; i++) {
828
831
  var date = dateSetup.dates[i];
829
- var bottomValue = getLocaleMonth(date, locale);
832
+ var bottomValue = date.toLocaleString(locale, {
833
+ month: "short"
834
+ });
830
835
  bottomValues.push(React.createElement("text", {
831
836
  key: bottomValue + date.getFullYear(),
832
837
  y: headerHeight * 0.8,
833
838
  x: columnWidth * i + columnWidth * 0.5,
834
- className: styles$5.calendarBottomText
839
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
835
840
  }, bottomValue));
836
841
 
837
842
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
@@ -844,6 +849,7 @@ var Calendar = function Calendar(_ref) {
844
849
  xText = (6 + i - date.getMonth()) * columnWidth;
845
850
  }
846
851
 
852
+ console.log(xText);
847
853
  topValues.push(React.createElement(TopPartOfCalendar, {
848
854
  key: topValue,
849
855
  value: topValue,
@@ -851,7 +857,8 @@ var Calendar = function Calendar(_ref) {
851
857
  y1Line: 0,
852
858
  y2Line: topDefaultHeight,
853
859
  xText: xText,
854
- yText: topDefaultHeight * 0.9
860
+ yText: topDefaultHeight * 0.9,
861
+ textAnchor: "end"
855
862
  }));
856
863
  }
857
864
  }
@@ -879,7 +886,7 @@ var Calendar = function Calendar(_ref) {
879
886
  key: date.getTime(),
880
887
  y: headerHeight * 0.8,
881
888
  x: columnWidth * (i + +rtl),
882
- className: styles$5.calendarBottomText
889
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
883
890
  }, bottomValue));
884
891
 
885
892
  if (topValue) {
@@ -891,7 +898,8 @@ var Calendar = function Calendar(_ref) {
891
898
  y1Line: 0,
892
899
  y2Line: topDefaultHeight,
893
900
  xText: columnWidth * i + columnWidth * weeksCount * 0.5,
894
- yText: topDefaultHeight * 0.9
901
+ yText: topDefaultHeight * 0.9,
902
+ textAnchor: "start"
895
903
  }));
896
904
  }
897
905
 
@@ -1062,7 +1070,8 @@ var Calendar = function Calendar(_ref) {
1062
1070
  return React.createElement("g", {
1063
1071
  className: "calendar",
1064
1072
  fontSize: fontSize,
1065
- fontFamily: fontFamily
1073
+ fontFamily: fontFamily,
1074
+ width: columnWidth * dateSetup.dates.length
1066
1075
  }, React.createElement("rect", {
1067
1076
  x: 0,
1068
1077
  y: 0,
@@ -2654,7 +2663,7 @@ var Gantt = function Gantt(_ref) {
2654
2663
  };
2655
2664
 
2656
2665
  var handleScrollX = function handleScrollX(event) {
2657
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
2666
+ if (scrollX !== event.currentTarget.scrollLeft) {
2658
2667
  setScrollX(event.currentTarget.scrollLeft);
2659
2668
  setIgnoreScrollEvent(true);
2660
2669
  } else {