gantt-task-react-powern 0.6.4 → 0.6.5

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.
package/dist/index.js CHANGED
@@ -3139,53 +3139,58 @@ var Gantt = function Gantt(_ref) {
3139
3139
  }
3140
3140
  }, [startDate, endDate]);
3141
3141
  React.useEffect(function () {
3142
- var filteredTasks;
3142
+ var timer = setTimeout(function () {
3143
+ var filteredTasks;
3143
3144
 
3144
- if (onExpanderClick) {
3145
- filteredTasks = removeHiddenTasks(tasks);
3146
- } else {
3147
- filteredTasks = tasks;
3148
- }
3145
+ if (onExpanderClick) {
3146
+ filteredTasks = removeHiddenTasks(tasks);
3147
+ } else {
3148
+ filteredTasks = tasks;
3149
+ }
3149
3150
 
3150
- filteredTasks = filteredTasks.sort(sortTasks);
3151
+ filteredTasks = filteredTasks.sort(sortTasks);
3151
3152
 
3152
- var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
3153
- startDateRange = _ganttDateRange2[0],
3154
- endDateRange = _ganttDateRange2[1];
3153
+ var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
3154
+ startDateRange = _ganttDateRange2[0],
3155
+ endDateRange = _ganttDateRange2[1];
3155
3156
 
3156
- var newDates = seedDates(startDateRange, endDateRange, viewMode);
3157
+ var newDates = seedDates(startDateRange, endDateRange, viewMode);
3157
3158
 
3158
- if (scheduleType === "lookAhead") {
3159
- newDates = seedDates(startDate, endDate, viewMode);
3160
- }
3159
+ if (scheduleType === "lookAhead") {
3160
+ newDates = seedDates(startDate, endDate, viewMode);
3161
+ }
3161
3162
 
3162
- if (rtl) {
3163
- newDates = newDates.reverse();
3163
+ if (rtl) {
3164
+ newDates = newDates.reverse();
3164
3165
 
3165
- if (scrollX === -1) {
3166
- setScrollX(newDates.length * columnWidth);
3166
+ if (scrollX === -1) {
3167
+ setScrollX(newDates.length * columnWidth);
3168
+ }
3167
3169
  }
3168
- }
3169
3170
 
3170
- if (scheduleType !== "lookAhead") {
3171
- setDateSetup({
3172
- dates: seedDates(startDateRange, endDateRange, viewMode),
3173
- viewMode: viewMode
3174
- });
3175
- }
3171
+ if (scheduleType !== "lookAhead") {
3172
+ setDateSetup({
3173
+ dates: seedDates(startDateRange, endDateRange, viewMode),
3174
+ viewMode: viewMode
3175
+ });
3176
+ }
3176
3177
 
3177
- var _getCriticalPaths = getCriticalPaths(leafTasks),
3178
- primaryPath = _getCriticalPaths[0],
3179
- secondaryPath = _getCriticalPaths[1];
3178
+ var _getCriticalPaths = getCriticalPaths(leafTasks),
3179
+ primaryPath = _getCriticalPaths[0],
3180
+ secondaryPath = _getCriticalPaths[1];
3180
3181
 
3181
- uncolorAll(tasks);
3182
+ uncolorAll(tasks);
3182
3183
 
3183
- if (scheduleType !== "lookAhead") {
3184
- colorPath(secondaryPath, "#00ff00", tasks, "secondary");
3185
- colorPath(primaryPath, "#ff0000", tasks, "primary");
3186
- }
3184
+ if (scheduleType !== "lookAhead") {
3185
+ colorPath(secondaryPath, "#00ff00", tasks, "secondary");
3186
+ colorPath(primaryPath, "#ff0000", tasks, "primary");
3187
+ }
3187
3188
 
3188
- setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
3189
+ setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
3190
+ }, 500);
3191
+ return function () {
3192
+ return clearTimeout(timer);
3193
+ };
3189
3194
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor, rtl, onExpanderClick]);
3190
3195
  React.useEffect(function () {
3191
3196
  if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {