gantt-task-react-powern 0.5.3 → 0.5.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 +68 -30
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +68 -30
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3012,9 +3012,17 @@ var Gantt = function Gantt(_ref) {
|
|
|
3012
3012
|
ignoreScrollEvent = _useState12[0],
|
|
3013
3013
|
setIgnoreScrollEvent = _useState12[1];
|
|
3014
3014
|
|
|
3015
|
-
var _useState13 = React.useState(
|
|
3016
|
-
|
|
3017
|
-
|
|
3015
|
+
var _useState13 = React.useState(0),
|
|
3016
|
+
lastTouchX = _useState13[0],
|
|
3017
|
+
setLastTouchX = _useState13[1];
|
|
3018
|
+
|
|
3019
|
+
var _useState14 = React.useState(0),
|
|
3020
|
+
lastTouchY = _useState14[0],
|
|
3021
|
+
setLastTouchY = _useState14[1];
|
|
3022
|
+
|
|
3023
|
+
var _useState15 = React.useState(false),
|
|
3024
|
+
hasCircularDeps = _useState15[0],
|
|
3025
|
+
setHasCircularDeps = _useState15[1];
|
|
3018
3026
|
|
|
3019
3027
|
React.useEffect(function () {
|
|
3020
3028
|
if (scheduleType === "lookAhead" && startDate && endDate) {
|
|
@@ -3154,7 +3162,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
3154
3162
|
}
|
|
3155
3163
|
}, [ganttHeight, tasks, headerHeight, rowHeight]);
|
|
3156
3164
|
React.useEffect(function () {
|
|
3157
|
-
var _wrapperRef$current;
|
|
3165
|
+
var _wrapperRef$current, _wrapperRef$current2, _wrapperRef$current3, _wrapperRef$current4;
|
|
3158
3166
|
|
|
3159
3167
|
var handleWheel = function handleWheel(event) {
|
|
3160
3168
|
if (event.shiftKey || event.deltaX) {
|
|
@@ -3187,13 +3195,66 @@ var Gantt = function Gantt(_ref) {
|
|
|
3187
3195
|
setIgnoreScrollEvent(true);
|
|
3188
3196
|
};
|
|
3189
3197
|
|
|
3198
|
+
var handleLogTouch = function handleLogTouch(event) {
|
|
3199
|
+
if (event) {
|
|
3200
|
+
setLastTouchX(event.changedTouches[0].pageX);
|
|
3201
|
+
setLastTouchY(event.changedTouches[0].pageY);
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
var handleTouch = function handleTouch(event) {
|
|
3206
|
+
if (event.changedTouches[0].pageX || event.changedTouches[0].pageY) {
|
|
3207
|
+
var deltaX = event.changedTouches[0].pageX - lastTouchX;
|
|
3208
|
+
var deltaY = event.changedTouches[0].pageY - lastTouchY;
|
|
3209
|
+
|
|
3210
|
+
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
|
3211
|
+
var newScrollX = scrollX - deltaX / 3;
|
|
3212
|
+
|
|
3213
|
+
if (newScrollX > 0 && newScrollX < 1600) {
|
|
3214
|
+
setScrollX(newScrollX);
|
|
3215
|
+
} else if (newScrollX < 0) {
|
|
3216
|
+
setScrollX(0);
|
|
3217
|
+
} else {
|
|
3218
|
+
setScrollX(1600);
|
|
3219
|
+
}
|
|
3220
|
+
} else {
|
|
3221
|
+
var newScrollY = scrollY - deltaY;
|
|
3222
|
+
|
|
3223
|
+
if (newScrollY > 0 && newScrollY < 1600) {
|
|
3224
|
+
setScrollY(newScrollY);
|
|
3225
|
+
} else if (newScrollY < 0) {
|
|
3226
|
+
setScrollY(0);
|
|
3227
|
+
} else {
|
|
3228
|
+
setScrollY(1600);
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
setLastTouchX(event.changedTouches[0].pageX);
|
|
3233
|
+
setLastTouchY(event.changedTouches[0].pageY);
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
setIgnoreScrollEvent(true);
|
|
3237
|
+
};
|
|
3238
|
+
|
|
3190
3239
|
(_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.addEventListener("wheel", handleWheel, {
|
|
3191
3240
|
passive: false
|
|
3192
3241
|
});
|
|
3242
|
+
(_wrapperRef$current2 = wrapperRef.current) === null || _wrapperRef$current2 === void 0 ? void 0 : _wrapperRef$current2.addEventListener("touchmove", handleTouch, {
|
|
3243
|
+
passive: false
|
|
3244
|
+
});
|
|
3245
|
+
(_wrapperRef$current3 = wrapperRef.current) === null || _wrapperRef$current3 === void 0 ? void 0 : _wrapperRef$current3.addEventListener("touchstart", handleLogTouch, {
|
|
3246
|
+
passive: false
|
|
3247
|
+
});
|
|
3248
|
+
(_wrapperRef$current4 = wrapperRef.current) === null || _wrapperRef$current4 === void 0 ? void 0 : _wrapperRef$current4.addEventListener("touchend", handleLogTouch, {
|
|
3249
|
+
passive: false
|
|
3250
|
+
});
|
|
3193
3251
|
return function () {
|
|
3194
|
-
var _wrapperRef$
|
|
3252
|
+
var _wrapperRef$current5, _wrapperRef$current6, _wrapperRef$current7, _wrapperRef$current8;
|
|
3195
3253
|
|
|
3196
|
-
(_wrapperRef$
|
|
3254
|
+
(_wrapperRef$current5 = wrapperRef.current) === null || _wrapperRef$current5 === void 0 ? void 0 : _wrapperRef$current5.removeEventListener("wheel", handleWheel);
|
|
3255
|
+
(_wrapperRef$current6 = wrapperRef.current) === null || _wrapperRef$current6 === void 0 ? void 0 : _wrapperRef$current6.removeEventListener("touchmove", handleTouch);
|
|
3256
|
+
(_wrapperRef$current7 = wrapperRef.current) === null || _wrapperRef$current7 === void 0 ? void 0 : _wrapperRef$current7.removeEventListener("touchend", handleLogTouch);
|
|
3257
|
+
(_wrapperRef$current8 = wrapperRef.current) === null || _wrapperRef$current8 === void 0 ? void 0 : _wrapperRef$current8.removeEventListener("touchend", handleLogTouch);
|
|
3197
3258
|
};
|
|
3198
3259
|
}, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
|
|
3199
3260
|
|
|
@@ -3215,16 +3276,6 @@ var Gantt = function Gantt(_ref) {
|
|
|
3215
3276
|
}
|
|
3216
3277
|
};
|
|
3217
3278
|
|
|
3218
|
-
var hideAlert = function hideAlert() {
|
|
3219
|
-
var checkbox = document.getElementById("alert-dismiss");
|
|
3220
|
-
var alert = document.getElementById("alert-container");
|
|
3221
|
-
|
|
3222
|
-
if (checkbox.checked) {
|
|
3223
|
-
localStorage.setItem('hideCircularDepsAlert', 'true');
|
|
3224
|
-
alert.style.display = "None";
|
|
3225
|
-
}
|
|
3226
|
-
};
|
|
3227
|
-
|
|
3228
3279
|
var handleKeyDown = function handleKeyDown(event) {
|
|
3229
3280
|
event.preventDefault();
|
|
3230
3281
|
var newScrollY = scrollY;
|
|
@@ -3373,20 +3424,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
3373
3424
|
taskLabelRenderer: taskLabelRenderer,
|
|
3374
3425
|
onMultiSelect: onMultiSelect
|
|
3375
3426
|
};
|
|
3376
|
-
return React__default.createElement("div", null,
|
|
3377
|
-
id: "alert-container",
|
|
3378
|
-
className: styles$9.alertContainer + " " + styles$9.warning
|
|
3379
|
-
}, React__default.createElement("input", {
|
|
3380
|
-
type: "checkbox",
|
|
3381
|
-
id: "alert-dismiss",
|
|
3382
|
-
className: styles$9.alertDismissCheckbox,
|
|
3383
|
-
onChange: hideAlert
|
|
3384
|
-
}), React__default.createElement("label", {
|
|
3385
|
-
htmlFor: "alert-dismiss",
|
|
3386
|
-
className: styles$9.alertCloseButton
|
|
3387
|
-
}, "\xD7"), React__default.createElement("div", {
|
|
3388
|
-
className: styles$9.alertContent
|
|
3389
|
-
}, React__default.createElement("p", null, "Critical path could not be displayed due to circular dependencies"))), React__default.createElement("div", {
|
|
3427
|
+
return React__default.createElement("div", null, React__default.createElement("div", {
|
|
3390
3428
|
className: styles$9.wrapper,
|
|
3391
3429
|
onKeyDown: handleKeyDown,
|
|
3392
3430
|
tabIndex: 0,
|