gantt-task-react-v 1.0.38 → 1.0.40
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/gantt-task-react.es.js +94 -75
- package/dist/gantt-task-react.umd.js +94 -75
- package/dist/style.css +30 -23
- package/package.json +1 -1
|
@@ -5296,7 +5296,8 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5296
5296
|
titleCellWidth,
|
|
5297
5297
|
dateCellWidth,
|
|
5298
5298
|
dependenciesCellWidth,
|
|
5299
|
-
actionColumnWidth
|
|
5299
|
+
actionColumnWidth,
|
|
5300
|
+
tableWidth: defaultTableWidth = 400
|
|
5300
5301
|
} = theme.distances;
|
|
5301
5302
|
const defaultColumns = useMemo(() => {
|
|
5302
5303
|
return [
|
|
@@ -5332,6 +5333,10 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5332
5333
|
const [columnsState, setColumns] = useState(
|
|
5333
5334
|
clientColumns || defaultColumns
|
|
5334
5335
|
);
|
|
5336
|
+
const taskListWidth = useMemo(
|
|
5337
|
+
() => columnsState.reduce((res, { width }) => res + width, 0) + extraWidth,
|
|
5338
|
+
[columnsState, extraWidth]
|
|
5339
|
+
);
|
|
5335
5340
|
useEffect(() => {
|
|
5336
5341
|
if (clientColumns) {
|
|
5337
5342
|
setColumns([...clientColumns]);
|
|
@@ -5339,19 +5344,23 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5339
5344
|
const newColumnIds = clientColumns.map((col) => col.id);
|
|
5340
5345
|
const widthOfAddedColumns = clientColumns.filter((col) => !currentColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5341
5346
|
const widthOfRemovedColumns = clientColumns.filter((col) => !newColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5342
|
-
setTableWidth(
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
)
|
|
5347
|
-
);
|
|
5347
|
+
setTableWidth((prev) => {
|
|
5348
|
+
const newWidth = prev + widthOfAddedColumns - widthOfRemovedColumns;
|
|
5349
|
+
return Math.max(newWidth, 100);
|
|
5350
|
+
});
|
|
5348
5351
|
}
|
|
5349
|
-
}, [clientColumns, extraWidth]);
|
|
5352
|
+
}, [clientColumns, extraWidth, taskListWidth]);
|
|
5350
5353
|
const [tableResizeEvent, setTableResizeEvent] = useState(null);
|
|
5351
5354
|
const [columnResizeEvent, setColumnResizeEvent] = useState(null);
|
|
5352
|
-
const [tableWidthState, setTableWidth] = useState(
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
+
const [tableWidthState, setTableWidth] = useState(() => {
|
|
5356
|
+
const calculatedWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5357
|
+
const MAX_INITIAL_WIDTH = 600;
|
|
5358
|
+
if (calculatedWidth <= MAX_INITIAL_WIDTH) {
|
|
5359
|
+
return calculatedWidth;
|
|
5360
|
+
} else {
|
|
5361
|
+
return defaultTableWidth;
|
|
5362
|
+
}
|
|
5363
|
+
});
|
|
5355
5364
|
const onTableResizeStart = (clientX) => {
|
|
5356
5365
|
const newTableResizeEvent = {
|
|
5357
5366
|
initialClientX: clientX,
|
|
@@ -5370,7 +5379,6 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5370
5379
|
};
|
|
5371
5380
|
const isResizeTableInProgress = Boolean(tableResizeEvent);
|
|
5372
5381
|
const isResizeColumnInProgress = Boolean(columnResizeEvent);
|
|
5373
|
-
const taskListWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5374
5382
|
useEffect(() => {
|
|
5375
5383
|
if (!isResizeTableInProgress) {
|
|
5376
5384
|
return void 0;
|
|
@@ -5378,9 +5386,15 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5378
5386
|
const handleMove = (clientX) => {
|
|
5379
5387
|
const moveDelta = clientX - tableResizeEvent.initialClientX;
|
|
5380
5388
|
setTableWidth(() => {
|
|
5389
|
+
const newWidth = tableResizeEvent.initialTableWidth + moveDelta;
|
|
5390
|
+
const ganttContainer = ganttRef.current;
|
|
5391
|
+
const containerWidth = ganttContainer ? ganttContainer.offsetWidth : 1e3;
|
|
5392
|
+
const maxTableWidth = Math.max(containerWidth - 100, taskListWidth);
|
|
5381
5393
|
return Math.min(
|
|
5382
|
-
Math.max(
|
|
5383
|
-
|
|
5394
|
+
Math.max(newWidth, 50),
|
|
5395
|
+
// Minimum width of 50px
|
|
5396
|
+
maxTableWidth
|
|
5397
|
+
// Allow table to expand much more
|
|
5384
5398
|
);
|
|
5385
5399
|
});
|
|
5386
5400
|
};
|
|
@@ -5440,12 +5454,18 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5440
5454
|
return newColumns;
|
|
5441
5455
|
});
|
|
5442
5456
|
if (previousColumnWidth !== newColumnWidth) {
|
|
5443
|
-
setTableWidth(
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
)
|
|
5448
|
-
|
|
5457
|
+
setTableWidth(() => {
|
|
5458
|
+
const newTableWidth = columnResizeEvent.initialTableWidth + moveDelta;
|
|
5459
|
+
const ganttContainer = ganttRef.current;
|
|
5460
|
+
const containerWidth = ganttContainer ? ganttContainer.offsetWidth : 1e3;
|
|
5461
|
+
const maxTableWidth = Math.max(containerWidth - 100, taskListWidth);
|
|
5462
|
+
return Math.min(
|
|
5463
|
+
Math.max(newTableWidth, 50),
|
|
5464
|
+
// Minimum width
|
|
5465
|
+
maxTableWidth
|
|
5466
|
+
// Allow expansion beyond column width
|
|
5467
|
+
);
|
|
5468
|
+
});
|
|
5449
5469
|
}
|
|
5450
5470
|
};
|
|
5451
5471
|
const handleMouseMove = (event) => {
|
|
@@ -10637,14 +10657,14 @@ const TaskListTableDefaultInner = ({
|
|
|
10637
10657
|
);
|
|
10638
10658
|
};
|
|
10639
10659
|
const TaskListTable = memo(TaskListTableDefaultInner);
|
|
10640
|
-
const taskListRoot = "
|
|
10641
|
-
const taskListHorizontalScroll = "
|
|
10642
|
-
const taskListResizer = "
|
|
10643
|
-
const horizontalContainer$1 = "
|
|
10644
|
-
const tableWrapper = "
|
|
10645
|
-
const scrollToTop = "
|
|
10646
|
-
const scrollToBottom = "
|
|
10647
|
-
const hidden = "
|
|
10660
|
+
const taskListRoot = "_taskListRoot_13wkq_1";
|
|
10661
|
+
const taskListHorizontalScroll = "_taskListHorizontalScroll_13wkq_23";
|
|
10662
|
+
const taskListResizer = "_taskListResizer_13wkq_87";
|
|
10663
|
+
const horizontalContainer$1 = "_horizontalContainer_13wkq_151";
|
|
10664
|
+
const tableWrapper = "_tableWrapper_13wkq_165";
|
|
10665
|
+
const scrollToTop = "_scrollToTop_13wkq_179";
|
|
10666
|
+
const scrollToBottom = "_scrollToBottom_13wkq_195";
|
|
10667
|
+
const hidden = "_hidden_13wkq_211";
|
|
10648
10668
|
const styles$d = {
|
|
10649
10669
|
taskListRoot,
|
|
10650
10670
|
taskListHorizontalScroll,
|
|
@@ -13135,10 +13155,10 @@ const TaskGanttContentInner = (props) => {
|
|
|
13135
13155
|
] });
|
|
13136
13156
|
};
|
|
13137
13157
|
const TaskGanttContent = memo(TaskGanttContentInner);
|
|
13138
|
-
const ganttVerticalContainer = "
|
|
13139
|
-
const horizontalContainer = "
|
|
13140
|
-
const wrapper = "
|
|
13141
|
-
const calendarDragging = "
|
|
13158
|
+
const ganttVerticalContainer = "_ganttVerticalContainer_5z1c2_1";
|
|
13159
|
+
const horizontalContainer = "_horizontalContainer_5z1c2_75";
|
|
13160
|
+
const wrapper = "_wrapper_5z1c2_87";
|
|
13161
|
+
const calendarDragging = "_calendarDragging_5z1c2_117";
|
|
13142
13162
|
const styles$2 = {
|
|
13143
13163
|
ganttVerticalContainer,
|
|
13144
13164
|
horizontalContainer,
|
|
@@ -13164,8 +13184,7 @@ const TaskGanttInner = (props) => {
|
|
|
13164
13184
|
verticalGanttContainerRef,
|
|
13165
13185
|
verticalScrollbarRef
|
|
13166
13186
|
} = props;
|
|
13167
|
-
const
|
|
13168
|
-
const moveStateVertRef = useRef(null);
|
|
13187
|
+
const ganttBodyRef = React__default.useRef(null);
|
|
13169
13188
|
const moveStateHorRef = useRef(null);
|
|
13170
13189
|
const moveStateScrollRef = useRef(null);
|
|
13171
13190
|
const containerStyle = useMemo(
|
|
@@ -13197,51 +13216,49 @@ const TaskGanttInner = (props) => {
|
|
|
13197
13216
|
]
|
|
13198
13217
|
);
|
|
13199
13218
|
useEffect(() => {
|
|
13200
|
-
if (!
|
|
13219
|
+
if (!ganttBodyRef.current) {
|
|
13201
13220
|
return () => {
|
|
13202
13221
|
};
|
|
13203
13222
|
}
|
|
13204
|
-
const
|
|
13223
|
+
const ganttBodyContainer = ganttBodyRef.current;
|
|
13205
13224
|
const onScrollStart = (event) => {
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
clientY: event.clientY,
|
|
13210
|
-
scrollLeft: verticalGanttContainerRef.current.scrollLeft,
|
|
13211
|
-
scrollTop: verticalGanttContainerRef.current.scrollTop
|
|
13212
|
-
};
|
|
13225
|
+
var _a, _b, _c, _d;
|
|
13226
|
+
const mouseEvent = event;
|
|
13227
|
+
mouseEvent.preventDefault();
|
|
13213
13228
|
moveStateHorRef.current = {
|
|
13214
|
-
clientX:
|
|
13215
|
-
clientY:
|
|
13216
|
-
scrollLeft:
|
|
13217
|
-
scrollTop: horizontalContainerRef.current.scrollTop
|
|
13229
|
+
clientX: mouseEvent.clientX,
|
|
13230
|
+
clientY: mouseEvent.clientY,
|
|
13231
|
+
scrollLeft: ((_a = verticalGanttContainerRef.current) == null ? void 0 : _a.scrollLeft) || 0,
|
|
13232
|
+
scrollTop: ((_b = horizontalContainerRef.current) == null ? void 0 : _b.scrollTop) || 0
|
|
13218
13233
|
};
|
|
13219
13234
|
moveStateScrollRef.current = {
|
|
13220
|
-
clientX:
|
|
13221
|
-
clientY:
|
|
13222
|
-
scrollLeft: verticalScrollbarRef.current.scrollLeft,
|
|
13223
|
-
scrollTop: verticalScrollbarRef.current.scrollTop
|
|
13235
|
+
clientX: mouseEvent.clientX,
|
|
13236
|
+
clientY: mouseEvent.clientY,
|
|
13237
|
+
scrollLeft: ((_c = verticalScrollbarRef.current) == null ? void 0 : _c.scrollLeft) || 0,
|
|
13238
|
+
scrollTop: ((_d = verticalScrollbarRef.current) == null ? void 0 : _d.scrollTop) || 0
|
|
13224
13239
|
};
|
|
13225
|
-
|
|
13240
|
+
ganttBodyContainer.classList.add(styles$2.calendarDragging);
|
|
13226
13241
|
};
|
|
13227
13242
|
const onScrollMove = (event) => {
|
|
13228
|
-
if (!
|
|
13243
|
+
if (!moveStateHorRef.current) {
|
|
13229
13244
|
return;
|
|
13230
13245
|
}
|
|
13231
|
-
event
|
|
13232
|
-
|
|
13233
|
-
const scrollVertContainer = verticalGanttContainerRef.current;
|
|
13234
|
-
scrollVertContainer.scrollLeft = scrollLeft + clientX - event.clientX;
|
|
13235
|
-
scrollVertContainer.scrollTop = scrollTop + clientY - event.clientY;
|
|
13246
|
+
const mouseEvent = event;
|
|
13247
|
+
mouseEvent.preventDefault();
|
|
13236
13248
|
const {
|
|
13237
13249
|
clientX: clientXH,
|
|
13238
13250
|
scrollLeft: scrollLeftH,
|
|
13239
13251
|
scrollTop: scrollTopH,
|
|
13240
13252
|
clientY: clientYH
|
|
13241
13253
|
} = moveStateHorRef.current;
|
|
13254
|
+
const vertContainer = verticalGanttContainerRef.current;
|
|
13255
|
+
if (vertContainer) {
|
|
13256
|
+
vertContainer.scrollLeft = scrollLeftH + clientXH - mouseEvent.clientX;
|
|
13257
|
+
}
|
|
13242
13258
|
const horContainer = horizontalContainerRef.current;
|
|
13243
|
-
horContainer
|
|
13244
|
-
|
|
13259
|
+
if (horContainer) {
|
|
13260
|
+
horContainer.scrollTop = scrollTopH + clientYH - mouseEvent.clientY;
|
|
13261
|
+
}
|
|
13245
13262
|
const {
|
|
13246
13263
|
clientX: clientXS,
|
|
13247
13264
|
scrollLeft: scrollLeftS,
|
|
@@ -13249,24 +13266,27 @@ const TaskGanttInner = (props) => {
|
|
|
13249
13266
|
clientY: clientYS
|
|
13250
13267
|
} = moveStateScrollRef.current;
|
|
13251
13268
|
const scrollContainer = verticalScrollbarRef.current;
|
|
13252
|
-
scrollContainer
|
|
13253
|
-
|
|
13269
|
+
if (scrollContainer) {
|
|
13270
|
+
scrollContainer.scrollLeft = scrollLeftS + clientXS - mouseEvent.clientX;
|
|
13271
|
+
scrollContainer.scrollTop = scrollTopS + clientYS - mouseEvent.clientY;
|
|
13272
|
+
}
|
|
13254
13273
|
};
|
|
13255
13274
|
const onScrollEnd = (event) => {
|
|
13256
|
-
event
|
|
13257
|
-
|
|
13275
|
+
const mouseEvent = event;
|
|
13276
|
+
mouseEvent.preventDefault();
|
|
13258
13277
|
moveStateHorRef.current = null;
|
|
13259
|
-
|
|
13278
|
+
moveStateScrollRef.current = null;
|
|
13279
|
+
ganttBodyContainer.classList.remove(styles$2.calendarDragging);
|
|
13260
13280
|
};
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13281
|
+
ganttBodyContainer.addEventListener("mousemove", onScrollMove);
|
|
13282
|
+
ganttBodyContainer.addEventListener("mousedown", onScrollStart);
|
|
13283
|
+
ganttBodyContainer.addEventListener("mouseup", onScrollEnd);
|
|
13284
|
+
ganttBodyContainer.addEventListener("mouseout", onScrollEnd);
|
|
13265
13285
|
return () => {
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13286
|
+
ganttBodyContainer.removeEventListener("mousemove", onScrollMove);
|
|
13287
|
+
ganttBodyContainer.removeEventListener("mousedown", onScrollStart);
|
|
13288
|
+
ganttBodyContainer.removeEventListener("mouseup", onScrollEnd);
|
|
13289
|
+
ganttBodyContainer.removeEventListener("mouseout", onScrollEnd);
|
|
13270
13290
|
};
|
|
13271
13291
|
}, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
|
|
13272
13292
|
return /* @__PURE__ */ jsxs(
|
|
@@ -13293,7 +13313,7 @@ const TaskGanttInner = (props) => {
|
|
|
13293
13313
|
ref: horizontalContainerRef,
|
|
13294
13314
|
className: styles$2.horizontalContainer,
|
|
13295
13315
|
style: containerStyle,
|
|
13296
|
-
children: /* @__PURE__ */ jsx("div", { style: gridStyle, children: /* @__PURE__ */ jsxs(
|
|
13316
|
+
children: /* @__PURE__ */ jsx("div", { style: gridStyle, ref: ganttBodyRef, children: /* @__PURE__ */ jsxs(
|
|
13297
13317
|
"svg",
|
|
13298
13318
|
{
|
|
13299
13319
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13303,7 +13323,6 @@ const TaskGanttInner = (props) => {
|
|
|
13303
13323
|
ref: ganttSVGRef,
|
|
13304
13324
|
children: [
|
|
13305
13325
|
/* @__PURE__ */ jsx(GanttToday, { ...ganttTodayProps }),
|
|
13306
|
-
/* @__PURE__ */ jsx("rect", { ref: contentRef, width: "100%", height: "100%", fill: "transparent" }),
|
|
13307
13326
|
/* @__PURE__ */ jsx(TaskGanttContent, { ...barProps })
|
|
13308
13327
|
]
|
|
13309
13328
|
}
|
|
@@ -5313,7 +5313,8 @@
|
|
|
5313
5313
|
titleCellWidth,
|
|
5314
5314
|
dateCellWidth,
|
|
5315
5315
|
dependenciesCellWidth,
|
|
5316
|
-
actionColumnWidth
|
|
5316
|
+
actionColumnWidth,
|
|
5317
|
+
tableWidth: defaultTableWidth = 400
|
|
5317
5318
|
} = theme.distances;
|
|
5318
5319
|
const defaultColumns = React.useMemo(() => {
|
|
5319
5320
|
return [
|
|
@@ -5349,6 +5350,10 @@
|
|
|
5349
5350
|
const [columnsState, setColumns] = React.useState(
|
|
5350
5351
|
clientColumns || defaultColumns
|
|
5351
5352
|
);
|
|
5353
|
+
const taskListWidth = React.useMemo(
|
|
5354
|
+
() => columnsState.reduce((res, { width }) => res + width, 0) + extraWidth,
|
|
5355
|
+
[columnsState, extraWidth]
|
|
5356
|
+
);
|
|
5352
5357
|
React.useEffect(() => {
|
|
5353
5358
|
if (clientColumns) {
|
|
5354
5359
|
setColumns([...clientColumns]);
|
|
@@ -5356,19 +5361,23 @@
|
|
|
5356
5361
|
const newColumnIds = clientColumns.map((col) => col.id);
|
|
5357
5362
|
const widthOfAddedColumns = clientColumns.filter((col) => !currentColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5358
5363
|
const widthOfRemovedColumns = clientColumns.filter((col) => !newColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5359
|
-
setTableWidth(
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
)
|
|
5364
|
-
);
|
|
5364
|
+
setTableWidth((prev) => {
|
|
5365
|
+
const newWidth = prev + widthOfAddedColumns - widthOfRemovedColumns;
|
|
5366
|
+
return Math.max(newWidth, 100);
|
|
5367
|
+
});
|
|
5365
5368
|
}
|
|
5366
|
-
}, [clientColumns, extraWidth]);
|
|
5369
|
+
}, [clientColumns, extraWidth, taskListWidth]);
|
|
5367
5370
|
const [tableResizeEvent, setTableResizeEvent] = React.useState(null);
|
|
5368
5371
|
const [columnResizeEvent, setColumnResizeEvent] = React.useState(null);
|
|
5369
|
-
const [tableWidthState, setTableWidth] = React.useState(
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
+
const [tableWidthState, setTableWidth] = React.useState(() => {
|
|
5373
|
+
const calculatedWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5374
|
+
const MAX_INITIAL_WIDTH = 600;
|
|
5375
|
+
if (calculatedWidth <= MAX_INITIAL_WIDTH) {
|
|
5376
|
+
return calculatedWidth;
|
|
5377
|
+
} else {
|
|
5378
|
+
return defaultTableWidth;
|
|
5379
|
+
}
|
|
5380
|
+
});
|
|
5372
5381
|
const onTableResizeStart = (clientX) => {
|
|
5373
5382
|
const newTableResizeEvent = {
|
|
5374
5383
|
initialClientX: clientX,
|
|
@@ -5387,7 +5396,6 @@
|
|
|
5387
5396
|
};
|
|
5388
5397
|
const isResizeTableInProgress = Boolean(tableResizeEvent);
|
|
5389
5398
|
const isResizeColumnInProgress = Boolean(columnResizeEvent);
|
|
5390
|
-
const taskListWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5391
5399
|
React.useEffect(() => {
|
|
5392
5400
|
if (!isResizeTableInProgress) {
|
|
5393
5401
|
return void 0;
|
|
@@ -5395,9 +5403,15 @@
|
|
|
5395
5403
|
const handleMove = (clientX) => {
|
|
5396
5404
|
const moveDelta = clientX - tableResizeEvent.initialClientX;
|
|
5397
5405
|
setTableWidth(() => {
|
|
5406
|
+
const newWidth = tableResizeEvent.initialTableWidth + moveDelta;
|
|
5407
|
+
const ganttContainer = ganttRef.current;
|
|
5408
|
+
const containerWidth = ganttContainer ? ganttContainer.offsetWidth : 1e3;
|
|
5409
|
+
const maxTableWidth = Math.max(containerWidth - 100, taskListWidth);
|
|
5398
5410
|
return Math.min(
|
|
5399
|
-
Math.max(
|
|
5400
|
-
|
|
5411
|
+
Math.max(newWidth, 50),
|
|
5412
|
+
// Minimum width of 50px
|
|
5413
|
+
maxTableWidth
|
|
5414
|
+
// Allow table to expand much more
|
|
5401
5415
|
);
|
|
5402
5416
|
});
|
|
5403
5417
|
};
|
|
@@ -5457,12 +5471,18 @@
|
|
|
5457
5471
|
return newColumns;
|
|
5458
5472
|
});
|
|
5459
5473
|
if (previousColumnWidth !== newColumnWidth) {
|
|
5460
|
-
setTableWidth(
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
)
|
|
5465
|
-
|
|
5474
|
+
setTableWidth(() => {
|
|
5475
|
+
const newTableWidth = columnResizeEvent.initialTableWidth + moveDelta;
|
|
5476
|
+
const ganttContainer = ganttRef.current;
|
|
5477
|
+
const containerWidth = ganttContainer ? ganttContainer.offsetWidth : 1e3;
|
|
5478
|
+
const maxTableWidth = Math.max(containerWidth - 100, taskListWidth);
|
|
5479
|
+
return Math.min(
|
|
5480
|
+
Math.max(newTableWidth, 50),
|
|
5481
|
+
// Minimum width
|
|
5482
|
+
maxTableWidth
|
|
5483
|
+
// Allow expansion beyond column width
|
|
5484
|
+
);
|
|
5485
|
+
});
|
|
5466
5486
|
}
|
|
5467
5487
|
};
|
|
5468
5488
|
const handleMouseMove = (event) => {
|
|
@@ -10654,14 +10674,14 @@
|
|
|
10654
10674
|
);
|
|
10655
10675
|
};
|
|
10656
10676
|
const TaskListTable = React.memo(TaskListTableDefaultInner);
|
|
10657
|
-
const taskListRoot = "
|
|
10658
|
-
const taskListHorizontalScroll = "
|
|
10659
|
-
const taskListResizer = "
|
|
10660
|
-
const horizontalContainer$1 = "
|
|
10661
|
-
const tableWrapper = "
|
|
10662
|
-
const scrollToTop = "
|
|
10663
|
-
const scrollToBottom = "
|
|
10664
|
-
const hidden = "
|
|
10677
|
+
const taskListRoot = "_taskListRoot_13wkq_1";
|
|
10678
|
+
const taskListHorizontalScroll = "_taskListHorizontalScroll_13wkq_23";
|
|
10679
|
+
const taskListResizer = "_taskListResizer_13wkq_87";
|
|
10680
|
+
const horizontalContainer$1 = "_horizontalContainer_13wkq_151";
|
|
10681
|
+
const tableWrapper = "_tableWrapper_13wkq_165";
|
|
10682
|
+
const scrollToTop = "_scrollToTop_13wkq_179";
|
|
10683
|
+
const scrollToBottom = "_scrollToBottom_13wkq_195";
|
|
10684
|
+
const hidden = "_hidden_13wkq_211";
|
|
10665
10685
|
const styles$d = {
|
|
10666
10686
|
taskListRoot,
|
|
10667
10687
|
taskListHorizontalScroll,
|
|
@@ -13152,10 +13172,10 @@
|
|
|
13152
13172
|
] });
|
|
13153
13173
|
};
|
|
13154
13174
|
const TaskGanttContent = React.memo(TaskGanttContentInner);
|
|
13155
|
-
const ganttVerticalContainer = "
|
|
13156
|
-
const horizontalContainer = "
|
|
13157
|
-
const wrapper = "
|
|
13158
|
-
const calendarDragging = "
|
|
13175
|
+
const ganttVerticalContainer = "_ganttVerticalContainer_5z1c2_1";
|
|
13176
|
+
const horizontalContainer = "_horizontalContainer_5z1c2_75";
|
|
13177
|
+
const wrapper = "_wrapper_5z1c2_87";
|
|
13178
|
+
const calendarDragging = "_calendarDragging_5z1c2_117";
|
|
13159
13179
|
const styles$2 = {
|
|
13160
13180
|
ganttVerticalContainer,
|
|
13161
13181
|
horizontalContainer,
|
|
@@ -13181,8 +13201,7 @@
|
|
|
13181
13201
|
verticalGanttContainerRef,
|
|
13182
13202
|
verticalScrollbarRef
|
|
13183
13203
|
} = props;
|
|
13184
|
-
const
|
|
13185
|
-
const moveStateVertRef = React.useRef(null);
|
|
13204
|
+
const ganttBodyRef = React.useRef(null);
|
|
13186
13205
|
const moveStateHorRef = React.useRef(null);
|
|
13187
13206
|
const moveStateScrollRef = React.useRef(null);
|
|
13188
13207
|
const containerStyle = React.useMemo(
|
|
@@ -13214,51 +13233,49 @@
|
|
|
13214
13233
|
]
|
|
13215
13234
|
);
|
|
13216
13235
|
React.useEffect(() => {
|
|
13217
|
-
if (!
|
|
13236
|
+
if (!ganttBodyRef.current) {
|
|
13218
13237
|
return () => {
|
|
13219
13238
|
};
|
|
13220
13239
|
}
|
|
13221
|
-
const
|
|
13240
|
+
const ganttBodyContainer = ganttBodyRef.current;
|
|
13222
13241
|
const onScrollStart = (event) => {
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
clientY: event.clientY,
|
|
13227
|
-
scrollLeft: verticalGanttContainerRef.current.scrollLeft,
|
|
13228
|
-
scrollTop: verticalGanttContainerRef.current.scrollTop
|
|
13229
|
-
};
|
|
13242
|
+
var _a, _b, _c, _d;
|
|
13243
|
+
const mouseEvent = event;
|
|
13244
|
+
mouseEvent.preventDefault();
|
|
13230
13245
|
moveStateHorRef.current = {
|
|
13231
|
-
clientX:
|
|
13232
|
-
clientY:
|
|
13233
|
-
scrollLeft:
|
|
13234
|
-
scrollTop: horizontalContainerRef.current.scrollTop
|
|
13246
|
+
clientX: mouseEvent.clientX,
|
|
13247
|
+
clientY: mouseEvent.clientY,
|
|
13248
|
+
scrollLeft: ((_a = verticalGanttContainerRef.current) == null ? void 0 : _a.scrollLeft) || 0,
|
|
13249
|
+
scrollTop: ((_b = horizontalContainerRef.current) == null ? void 0 : _b.scrollTop) || 0
|
|
13235
13250
|
};
|
|
13236
13251
|
moveStateScrollRef.current = {
|
|
13237
|
-
clientX:
|
|
13238
|
-
clientY:
|
|
13239
|
-
scrollLeft: verticalScrollbarRef.current.scrollLeft,
|
|
13240
|
-
scrollTop: verticalScrollbarRef.current.scrollTop
|
|
13252
|
+
clientX: mouseEvent.clientX,
|
|
13253
|
+
clientY: mouseEvent.clientY,
|
|
13254
|
+
scrollLeft: ((_c = verticalScrollbarRef.current) == null ? void 0 : _c.scrollLeft) || 0,
|
|
13255
|
+
scrollTop: ((_d = verticalScrollbarRef.current) == null ? void 0 : _d.scrollTop) || 0
|
|
13241
13256
|
};
|
|
13242
|
-
|
|
13257
|
+
ganttBodyContainer.classList.add(styles$2.calendarDragging);
|
|
13243
13258
|
};
|
|
13244
13259
|
const onScrollMove = (event) => {
|
|
13245
|
-
if (!
|
|
13260
|
+
if (!moveStateHorRef.current) {
|
|
13246
13261
|
return;
|
|
13247
13262
|
}
|
|
13248
|
-
event
|
|
13249
|
-
|
|
13250
|
-
const scrollVertContainer = verticalGanttContainerRef.current;
|
|
13251
|
-
scrollVertContainer.scrollLeft = scrollLeft + clientX - event.clientX;
|
|
13252
|
-
scrollVertContainer.scrollTop = scrollTop + clientY - event.clientY;
|
|
13263
|
+
const mouseEvent = event;
|
|
13264
|
+
mouseEvent.preventDefault();
|
|
13253
13265
|
const {
|
|
13254
13266
|
clientX: clientXH,
|
|
13255
13267
|
scrollLeft: scrollLeftH,
|
|
13256
13268
|
scrollTop: scrollTopH,
|
|
13257
13269
|
clientY: clientYH
|
|
13258
13270
|
} = moveStateHorRef.current;
|
|
13271
|
+
const vertContainer = verticalGanttContainerRef.current;
|
|
13272
|
+
if (vertContainer) {
|
|
13273
|
+
vertContainer.scrollLeft = scrollLeftH + clientXH - mouseEvent.clientX;
|
|
13274
|
+
}
|
|
13259
13275
|
const horContainer = horizontalContainerRef.current;
|
|
13260
|
-
horContainer
|
|
13261
|
-
|
|
13276
|
+
if (horContainer) {
|
|
13277
|
+
horContainer.scrollTop = scrollTopH + clientYH - mouseEvent.clientY;
|
|
13278
|
+
}
|
|
13262
13279
|
const {
|
|
13263
13280
|
clientX: clientXS,
|
|
13264
13281
|
scrollLeft: scrollLeftS,
|
|
@@ -13266,24 +13283,27 @@
|
|
|
13266
13283
|
clientY: clientYS
|
|
13267
13284
|
} = moveStateScrollRef.current;
|
|
13268
13285
|
const scrollContainer = verticalScrollbarRef.current;
|
|
13269
|
-
scrollContainer
|
|
13270
|
-
|
|
13286
|
+
if (scrollContainer) {
|
|
13287
|
+
scrollContainer.scrollLeft = scrollLeftS + clientXS - mouseEvent.clientX;
|
|
13288
|
+
scrollContainer.scrollTop = scrollTopS + clientYS - mouseEvent.clientY;
|
|
13289
|
+
}
|
|
13271
13290
|
};
|
|
13272
13291
|
const onScrollEnd = (event) => {
|
|
13273
|
-
event
|
|
13274
|
-
|
|
13292
|
+
const mouseEvent = event;
|
|
13293
|
+
mouseEvent.preventDefault();
|
|
13275
13294
|
moveStateHorRef.current = null;
|
|
13276
|
-
|
|
13295
|
+
moveStateScrollRef.current = null;
|
|
13296
|
+
ganttBodyContainer.classList.remove(styles$2.calendarDragging);
|
|
13277
13297
|
};
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13298
|
+
ganttBodyContainer.addEventListener("mousemove", onScrollMove);
|
|
13299
|
+
ganttBodyContainer.addEventListener("mousedown", onScrollStart);
|
|
13300
|
+
ganttBodyContainer.addEventListener("mouseup", onScrollEnd);
|
|
13301
|
+
ganttBodyContainer.addEventListener("mouseout", onScrollEnd);
|
|
13282
13302
|
return () => {
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13303
|
+
ganttBodyContainer.removeEventListener("mousemove", onScrollMove);
|
|
13304
|
+
ganttBodyContainer.removeEventListener("mousedown", onScrollStart);
|
|
13305
|
+
ganttBodyContainer.removeEventListener("mouseup", onScrollEnd);
|
|
13306
|
+
ganttBodyContainer.removeEventListener("mouseout", onScrollEnd);
|
|
13287
13307
|
};
|
|
13288
13308
|
}, [verticalScrollbarRef, horizontalContainerRef, verticalGanttContainerRef]);
|
|
13289
13309
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -13310,7 +13330,7 @@
|
|
|
13310
13330
|
ref: horizontalContainerRef,
|
|
13311
13331
|
className: styles$2.horizontalContainer,
|
|
13312
13332
|
style: containerStyle,
|
|
13313
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13333
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, ref: ganttBodyRef, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13314
13334
|
"svg",
|
|
13315
13335
|
{
|
|
13316
13336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13320,7 +13340,6 @@
|
|
|
13320
13340
|
ref: ganttSVGRef,
|
|
13321
13341
|
children: [
|
|
13322
13342
|
/* @__PURE__ */ jsxRuntime.jsx(GanttToday, { ...ganttTodayProps }),
|
|
13323
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { ref: contentRef, width: "100%", height: "100%", fill: "transparent" }),
|
|
13324
13343
|
/* @__PURE__ */ jsxRuntime.jsx(TaskGanttContent, { ...barProps })
|
|
13325
13344
|
]
|
|
13326
13345
|
}
|
package/dist/style.css
CHANGED
|
@@ -282,32 +282,35 @@
|
|
|
282
282
|
border-bottom: 1px solid var(--gantt-divider-color);
|
|
283
283
|
table-layout: fixed;
|
|
284
284
|
}
|
|
285
|
-
.
|
|
285
|
+
._taskListRoot_13wkq_1 {
|
|
286
286
|
position: relative;
|
|
287
287
|
height: 100%;
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
|
+
min-width: 0;
|
|
291
|
+
flex-shrink: 0;
|
|
290
292
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
291
293
|
border-left: 1px solid var(--gantt-table-divider-color, var(--gantt-divider-color));
|
|
292
294
|
}
|
|
293
295
|
|
|
294
|
-
.
|
|
296
|
+
._taskListHorizontalScroll_13wkq_23 {
|
|
295
297
|
overflow-x: scroll;
|
|
296
298
|
height: 100%;
|
|
297
299
|
display: flex;
|
|
298
300
|
flex-direction: column;
|
|
301
|
+
min-width: 0;
|
|
299
302
|
}
|
|
300
303
|
|
|
301
|
-
.
|
|
304
|
+
._taskListHorizontalScroll_13wkq_23::-webkit-scrollbar {
|
|
302
305
|
width: 1rem;
|
|
303
306
|
height: 1rem;
|
|
304
307
|
}
|
|
305
308
|
|
|
306
|
-
.
|
|
309
|
+
._taskListHorizontalScroll_13wkq_23::-webkit-scrollbar-corner {
|
|
307
310
|
background: transparent;
|
|
308
311
|
}
|
|
309
312
|
|
|
310
|
-
.
|
|
313
|
+
._taskListHorizontalScroll_13wkq_23::-webkit-scrollbar-thumb {
|
|
311
314
|
border: 4px solid transparent;
|
|
312
315
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
313
316
|
background: var(--gantt-scrollbar-thumb-color);
|
|
@@ -315,14 +318,14 @@
|
|
|
315
318
|
background-clip: padding-box;
|
|
316
319
|
}
|
|
317
320
|
|
|
318
|
-
.
|
|
321
|
+
._taskListHorizontalScroll_13wkq_23::-webkit-scrollbar-thumb:hover {
|
|
319
322
|
border: 2px solid transparent;
|
|
320
323
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
321
324
|
background: var(--gantt-scrollbar-thumb-color);
|
|
322
325
|
background-clip: padding-box;
|
|
323
326
|
}
|
|
324
327
|
|
|
325
|
-
.
|
|
328
|
+
._taskListResizer_13wkq_87 {
|
|
326
329
|
position: absolute;
|
|
327
330
|
top: 0;
|
|
328
331
|
right: -3px;
|
|
@@ -334,16 +337,16 @@
|
|
|
334
337
|
}
|
|
335
338
|
|
|
336
339
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
337
|
-
.
|
|
340
|
+
._taskListResizer_13wkq_87:hover {
|
|
338
341
|
background-color: var(--gantt-table-hover-action-color);
|
|
339
342
|
filter: var(--gantt-hover-filter);
|
|
340
343
|
}
|
|
341
344
|
|
|
342
|
-
.
|
|
345
|
+
._taskListResizer_13wkq_87:hover::before {
|
|
343
346
|
display: none;
|
|
344
347
|
}
|
|
345
348
|
|
|
346
|
-
.
|
|
349
|
+
._taskListResizer_13wkq_87::before {
|
|
347
350
|
content: "";
|
|
348
351
|
position: absolute;
|
|
349
352
|
top: 0;
|
|
@@ -354,21 +357,21 @@
|
|
|
354
357
|
background-color: var(--gantt-table-resize-color, var(--gantt-divider-color));
|
|
355
358
|
}
|
|
356
359
|
|
|
357
|
-
.
|
|
360
|
+
._horizontalContainer_13wkq_151 {
|
|
358
361
|
margin: 0;
|
|
359
362
|
padding: 0;
|
|
360
363
|
overflow: hidden;
|
|
361
364
|
flex-grow: 1;
|
|
362
365
|
}
|
|
363
366
|
|
|
364
|
-
.
|
|
367
|
+
._tableWrapper_13wkq_165 {
|
|
365
368
|
position: relative;
|
|
366
369
|
flex-grow: 1;
|
|
367
370
|
display: flex;
|
|
368
371
|
flex-direction: column;
|
|
369
372
|
}
|
|
370
373
|
|
|
371
|
-
.
|
|
374
|
+
._scrollToTop_13wkq_179 {
|
|
372
375
|
position: absolute;
|
|
373
376
|
top: 0;
|
|
374
377
|
left: 0;
|
|
@@ -376,7 +379,7 @@
|
|
|
376
379
|
height: 20px;
|
|
377
380
|
}
|
|
378
381
|
|
|
379
|
-
.
|
|
382
|
+
._scrollToBottom_13wkq_195 {
|
|
380
383
|
position: absolute;
|
|
381
384
|
bottom: 0;
|
|
382
385
|
left: 0;
|
|
@@ -384,7 +387,7 @@
|
|
|
384
387
|
height: 20px;
|
|
385
388
|
}
|
|
386
389
|
|
|
387
|
-
.
|
|
390
|
+
._hidden_13wkq_211 {
|
|
388
391
|
display: none;
|
|
389
392
|
}
|
|
390
393
|
._ganttToday_1oyhk_1 {
|
|
@@ -578,7 +581,7 @@
|
|
|
578
581
|
user-select: none;
|
|
579
582
|
stroke-width: 0;
|
|
580
583
|
}
|
|
581
|
-
.
|
|
584
|
+
._ganttVerticalContainer_5z1c2_1 {
|
|
582
585
|
overflow-x: scroll;
|
|
583
586
|
overflow-y: hidden;
|
|
584
587
|
font-size: 0;
|
|
@@ -588,18 +591,19 @@
|
|
|
588
591
|
border-right: 1px solid var(--gantt-calendar-divider-color, var(--gantt-divider-color));
|
|
589
592
|
flex-grow: 1;
|
|
590
593
|
height: 100%;
|
|
594
|
+
min-width: 0;
|
|
591
595
|
}
|
|
592
596
|
|
|
593
|
-
.
|
|
597
|
+
._ganttVerticalContainer_5z1c2_1::-webkit-scrollbar {
|
|
594
598
|
width: 1rem;
|
|
595
599
|
height: 1rem;
|
|
596
600
|
}
|
|
597
601
|
|
|
598
|
-
.
|
|
602
|
+
._ganttVerticalContainer_5z1c2_1::-webkit-scrollbar-corner {
|
|
599
603
|
background: transparent;
|
|
600
604
|
}
|
|
601
605
|
|
|
602
|
-
.
|
|
606
|
+
._ganttVerticalContainer_5z1c2_1::-webkit-scrollbar-thumb {
|
|
603
607
|
border: 4px solid transparent;
|
|
604
608
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
605
609
|
background: var(--gantt-scrollbar-thumb-color);
|
|
@@ -607,20 +611,20 @@
|
|
|
607
611
|
background-clip: padding-box;
|
|
608
612
|
}
|
|
609
613
|
|
|
610
|
-
.
|
|
614
|
+
._ganttVerticalContainer_5z1c2_1::-webkit-scrollbar-thumb:hover {
|
|
611
615
|
border: 2px solid transparent;
|
|
612
616
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
613
617
|
background: var(--gantt-scrollbar-thumb-color);
|
|
614
618
|
background-clip: padding-box;
|
|
615
619
|
}
|
|
616
620
|
|
|
617
|
-
.
|
|
621
|
+
._horizontalContainer_5z1c2_75 {
|
|
618
622
|
margin: 0;
|
|
619
623
|
padding: 0;
|
|
620
624
|
overflow: hidden;
|
|
621
625
|
}
|
|
622
626
|
|
|
623
|
-
.
|
|
627
|
+
._wrapper_5z1c2_87 {
|
|
624
628
|
display: flex;
|
|
625
629
|
padding: 0;
|
|
626
630
|
margin: 0;
|
|
@@ -628,11 +632,14 @@
|
|
|
628
632
|
outline: none;
|
|
629
633
|
position: relative;
|
|
630
634
|
height: 100%;
|
|
635
|
+
width: 100%;
|
|
636
|
+
max-width: 100%;
|
|
637
|
+
overflow: hidden;
|
|
631
638
|
/*noinspection CssUnresolvedCustomProperty*/
|
|
632
639
|
border-bottom: 1px solid var(--gantt-divider-color);
|
|
633
640
|
}
|
|
634
641
|
|
|
635
|
-
.
|
|
642
|
+
._calendarDragging_5z1c2_117 {
|
|
636
643
|
cursor: grabbing;
|
|
637
644
|
}
|
|
638
645
|
/*noinspection CssUnresolvedCustomProperty*/
|
package/package.json
CHANGED