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.
@@ -6,6 +6,7 @@ declare type TopPartOfCalendarProps = {
6
6
  y2Line: number;
7
7
  xText: number;
8
8
  yText: number;
9
+ textAnchor?: "start" | "middle" | "end";
9
10
  };
10
11
  export declare const TopPartOfCalendar: React.FC<TopPartOfCalendarProps>;
11
12
  export {};
package/dist/index.css CHANGED
@@ -156,7 +156,7 @@
156
156
  }
157
157
 
158
158
  ._9w8d5 {
159
- text-anchor: middle;
159
+ /* text-anchor: middle; */
160
160
  fill: #333;
161
161
  -webkit-touch-callout: none;
162
162
  -webkit-user-select: none;
@@ -171,7 +171,6 @@
171
171
  }
172
172
 
173
173
  ._2q1Kt {
174
- text-anchor: middle;
175
174
  fill: #555;
176
175
  -webkit-touch-callout: none;
177
176
  -webkit-user-select: none;
@@ -187,6 +186,17 @@
187
186
  stroke-width: 1.4;
188
187
  }
189
188
 
189
+ ._2Shd- {
190
+ text-anchor: start;
191
+ }
192
+
193
+ ._2XXW4 {
194
+ text-anchor: middle;
195
+ }
196
+
197
+ ._3GdnC {
198
+ text-anchor: end;
199
+ }
190
200
  ._KxSXS {
191
201
  cursor: pointer;
192
202
  outline: none;
package/dist/index.js CHANGED
@@ -744,7 +744,7 @@ var Grid = function Grid(props) {
744
744
  }, React__default.createElement(GridBody, Object.assign({}, props)));
745
745
  };
746
746
 
747
- var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX"};
747
+ var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
748
748
 
749
749
  var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
750
750
  var value = _ref.value,
@@ -752,7 +752,10 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
752
752
  y1Line = _ref.y1Line,
753
753
  y2Line = _ref.y2Line,
754
754
  xText = _ref.xText,
755
- yText = _ref.yText;
755
+ yText = _ref.yText,
756
+ _ref$textAnchor = _ref.textAnchor,
757
+ textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
758
+ var textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
756
759
  return React__default.createElement("g", {
757
760
  className: "calendarTop"
758
761
  }, React__default.createElement("line", {
@@ -766,7 +769,7 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
766
769
  key: value + "text",
767
770
  y: yText,
768
771
  x: xText,
769
- className: styles$5.calendarTopText
772
+ className: styles$5.calendarTopText + " " + textAnchorClass
770
773
  }, value));
771
774
  };
772
775
 
@@ -827,12 +830,14 @@ var Calendar = function Calendar(_ref) {
827
830
 
828
831
  for (var i = 0; i < dateSetup.dates.length; i++) {
829
832
  var date = dateSetup.dates[i];
830
- var bottomValue = getLocaleMonth(date, locale);
833
+ var bottomValue = date.toLocaleString(locale, {
834
+ month: "short"
835
+ });
831
836
  bottomValues.push(React__default.createElement("text", {
832
837
  key: bottomValue + date.getFullYear(),
833
838
  y: headerHeight * 0.8,
834
839
  x: columnWidth * i + columnWidth * 0.5,
835
- className: styles$5.calendarBottomText
840
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
836
841
  }, bottomValue));
837
842
 
838
843
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
@@ -845,6 +850,7 @@ var Calendar = function Calendar(_ref) {
845
850
  xText = (6 + i - date.getMonth()) * columnWidth;
846
851
  }
847
852
 
853
+ console.log(xText);
848
854
  topValues.push(React__default.createElement(TopPartOfCalendar, {
849
855
  key: topValue,
850
856
  value: topValue,
@@ -852,7 +858,8 @@ var Calendar = function Calendar(_ref) {
852
858
  y1Line: 0,
853
859
  y2Line: topDefaultHeight,
854
860
  xText: xText,
855
- yText: topDefaultHeight * 0.9
861
+ yText: topDefaultHeight * 0.9,
862
+ textAnchor: "end"
856
863
  }));
857
864
  }
858
865
  }
@@ -880,7 +887,7 @@ var Calendar = function Calendar(_ref) {
880
887
  key: date.getTime(),
881
888
  y: headerHeight * 0.8,
882
889
  x: columnWidth * (i + +rtl),
883
- className: styles$5.calendarBottomText
890
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
884
891
  }, bottomValue));
885
892
 
886
893
  if (topValue) {
@@ -892,7 +899,8 @@ var Calendar = function Calendar(_ref) {
892
899
  y1Line: 0,
893
900
  y2Line: topDefaultHeight,
894
901
  xText: columnWidth * i + columnWidth * weeksCount * 0.5,
895
- yText: topDefaultHeight * 0.9
902
+ yText: topDefaultHeight * 0.9,
903
+ textAnchor: "start"
896
904
  }));
897
905
  }
898
906
 
@@ -1063,7 +1071,8 @@ var Calendar = function Calendar(_ref) {
1063
1071
  return React__default.createElement("g", {
1064
1072
  className: "calendar",
1065
1073
  fontSize: fontSize,
1066
- fontFamily: fontFamily
1074
+ fontFamily: fontFamily,
1075
+ width: columnWidth * dateSetup.dates.length
1067
1076
  }, React__default.createElement("rect", {
1068
1077
  x: 0,
1069
1078
  y: 0,
@@ -2655,7 +2664,7 @@ var Gantt = function Gantt(_ref) {
2655
2664
  };
2656
2665
 
2657
2666
  var handleScrollX = function handleScrollX(event) {
2658
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
2667
+ if (scrollX !== event.currentTarget.scrollLeft) {
2659
2668
  setScrollX(event.currentTarget.scrollLeft);
2660
2669
  setIgnoreScrollEvent(true);
2661
2670
  } else {