gantt-task-react-powern 0.6.8 → 0.6.10

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.
@@ -2851,7 +2851,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2851
2851
  })));
2852
2852
  };
2853
2853
 
2854
- var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf","alertContainer":"_2AxB2","success":"_1a-EU","warning":"_1TP0x","error":"_2TeAI","alertDismissCheckbox":"_3cBUj","alertCloseButton":"_5jQM6"};
2854
+ var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf","alertContainer":"_2AxB2","success":"_1a-EU","warning":"_1TP0x","error":"_2TeAI","alertDismissCheckbox":"_3cBUj","alertCloseButton":"_5jQM6","spinner":"_3HJjy","spin":"_1W2rn"};
2855
2855
 
2856
2856
  var TaskGantt = function TaskGantt(_ref) {
2857
2857
  var gridProps = _ref.gridProps,
@@ -3130,6 +3130,10 @@ var Gantt = function Gantt(_ref) {
3130
3130
  lastTouchY = _useState14[0],
3131
3131
  setLastTouchY = _useState14[1];
3132
3132
 
3133
+ var _useState15 = useState(false),
3134
+ isProcessing = _useState15[0],
3135
+ setIsProcessing = _useState15[1];
3136
+
3133
3137
  var buffer = rowHeight * 10;
3134
3138
  var visibleStartY = scrollY - buffer;
3135
3139
  var visibleEndY = scrollY + ganttHeight + buffer;
@@ -3146,6 +3150,7 @@ var Gantt = function Gantt(_ref) {
3146
3150
  clearTimeout(debounceRef.current);
3147
3151
  }
3148
3152
 
3153
+ setIsProcessing(true);
3149
3154
  debounceRef.current = setTimeout(function () {
3150
3155
  var filteredTasks;
3151
3156
 
@@ -3194,8 +3199,9 @@ var Gantt = function Gantt(_ref) {
3194
3199
  }
3195
3200
 
3196
3201
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
3202
+ setIsProcessing(false);
3197
3203
  }, delayToRender);
3198
- }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor, rtl, scrollX, onExpanderClick]);
3204
+ }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor, rtl, onExpanderClick]);
3199
3205
  useEffect(function () {
3200
3206
  return function () {
3201
3207
  clearTimeout(debounceRef.current);
@@ -3274,6 +3280,8 @@ var Gantt = function Gantt(_ref) {
3274
3280
  useEffect(function () {
3275
3281
  var _wrapperRef$current, _wrapperRef$current2, _wrapperRef$current3, _wrapperRef$current4;
3276
3282
 
3283
+ if (isProcessing) return;
3284
+
3277
3285
  var handleWheel = function handleWheel(event) {
3278
3286
  if (event.shiftKey || event.deltaX) {
3279
3287
  var scrollMove = event.deltaX ? event.deltaX : event.deltaY;
@@ -3366,7 +3374,7 @@ var Gantt = function Gantt(_ref) {
3366
3374
  (_wrapperRef$current7 = wrapperRef.current) === null || _wrapperRef$current7 === void 0 ? void 0 : _wrapperRef$current7.removeEventListener("touchend", handleLogTouch);
3367
3375
  (_wrapperRef$current8 = wrapperRef.current) === null || _wrapperRef$current8 === void 0 ? void 0 : _wrapperRef$current8.removeEventListener("touchend", handleLogTouch);
3368
3376
  };
3369
- }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
3377
+ }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight, isProcessing]);
3370
3378
 
3371
3379
  var handleScrollY = function handleScrollY(event) {
3372
3380
  if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
@@ -3538,6 +3546,36 @@ var Gantt = function Gantt(_ref) {
3538
3546
  taskLabelRenderer: taskLabelRenderer,
3539
3547
  onMultiSelect: onMultiSelect
3540
3548
  };
3549
+
3550
+ if (isProcessing) {
3551
+ return React.createElement("div", {
3552
+ className: styles$9.wrapper,
3553
+ style: {
3554
+ position: "relative",
3555
+ minHeight: ganttHeight || 200
3556
+ }
3557
+ }, React.createElement("div", {
3558
+ style: {
3559
+ position: "absolute",
3560
+ inset: 0,
3561
+ height: "100%",
3562
+ width: "100%",
3563
+ display: "flex",
3564
+ justifyContent: "center",
3565
+ alignItems: "center",
3566
+ gap: "16px"
3567
+ }
3568
+ }, React.createElement("span", {
3569
+ style: {
3570
+ fontSize: "24px",
3571
+ color: "#cc0404",
3572
+ fontFamily: "Arial, sans-serif"
3573
+ }
3574
+ }, "Loading..."), React.createElement("div", {
3575
+ className: styles$9.spinner
3576
+ })));
3577
+ }
3578
+
3541
3579
  return React.createElement("div", null, React.createElement("div", {
3542
3580
  className: styles$9.wrapper,
3543
3581
  onKeyDown: handleKeyDown,