gantt-task-react-v 1.7.9 → 1.8.1
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.
|
@@ -5,6 +5,5 @@ export declare const useTableListResize: (clientColumns: readonly Column[] | und
|
|
|
5
5
|
taskListWidth: number,
|
|
6
6
|
tableWidth: number,
|
|
7
7
|
onTableResizeStart: (clientX: number) => void,
|
|
8
|
-
onColumnResizeStart: (columnIndex: number, clientX: number) => void
|
|
9
|
-
handleColumnVisibilityChange: (columnId: string, hidden: boolean) => void
|
|
8
|
+
onColumnResizeStart: (columnIndex: number, clientX: number) => void
|
|
10
9
|
];
|
|
@@ -5378,16 +5378,22 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5378
5378
|
useEffect(() => {
|
|
5379
5379
|
if (clientColumns) {
|
|
5380
5380
|
setColumns([...clientColumns]);
|
|
5381
|
-
const
|
|
5381
|
+
const currentColumnIds = clientColumns.map((col) => col.id);
|
|
5382
|
+
const newColumnIds = clientColumns.map((col) => col.id);
|
|
5383
|
+
const widthOfAddedColumns = clientColumns.filter((col) => !currentColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5384
|
+
const widthOfRemovedColumns = clientColumns.filter((col) => !newColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5382
5385
|
setTableWidth(
|
|
5383
|
-
|
|
5386
|
+
(prev) => Math.min(
|
|
5387
|
+
prev + widthOfAddedColumns - widthOfRemovedColumns,
|
|
5388
|
+
clientColumns.reduce((res, { width }) => res + width, 0) + extraWidth
|
|
5389
|
+
)
|
|
5384
5390
|
);
|
|
5385
5391
|
}
|
|
5386
5392
|
}, [clientColumns, extraWidth]);
|
|
5387
5393
|
const [tableResizeEvent, setTableResizeEvent] = useState(null);
|
|
5388
5394
|
const [columnResizeEvent, setColumnResizeEvent] = useState(null);
|
|
5389
5395
|
const [tableWidthState, setTableWidth] = useState(
|
|
5390
|
-
() => columnsState.
|
|
5396
|
+
() => columnsState.reduce((res, { width }) => res + width, 0) + extraWidth
|
|
5391
5397
|
);
|
|
5392
5398
|
const onTableResizeStart = (clientX) => {
|
|
5393
5399
|
const newTableResizeEvent = {
|
|
@@ -5405,19 +5411,9 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5405
5411
|
initialTableWidth: tableWidthState
|
|
5406
5412
|
});
|
|
5407
5413
|
};
|
|
5408
|
-
const handleColumnVisibilityChange = (columnId, hidden2) => {
|
|
5409
|
-
setColumns((prev) => {
|
|
5410
|
-
const next = prev.map(
|
|
5411
|
-
(col) => col.id === columnId ? { ...col, hidden: hidden2 } : col
|
|
5412
|
-
);
|
|
5413
|
-
const visibleWidth = next.filter((c) => !c.hidden).reduce((s, { width }) => s + width, 0) + extraWidth;
|
|
5414
|
-
setTableWidth(visibleWidth);
|
|
5415
|
-
return next;
|
|
5416
|
-
});
|
|
5417
|
-
};
|
|
5418
5414
|
const isResizeTableInProgress = Boolean(tableResizeEvent);
|
|
5419
5415
|
const isResizeColumnInProgress = Boolean(columnResizeEvent);
|
|
5420
|
-
const taskListWidth = columnsState.
|
|
5416
|
+
const taskListWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5421
5417
|
useEffect(() => {
|
|
5422
5418
|
if (!isResizeTableInProgress) {
|
|
5423
5419
|
return void 0;
|
|
@@ -5538,8 +5534,7 @@ const useTableListResize = (clientColumns, canMoveTasks, onResizeColumn, ganttRe
|
|
|
5538
5534
|
taskListWidth,
|
|
5539
5535
|
tableWidthState,
|
|
5540
5536
|
onTableResizeStart,
|
|
5541
|
-
onColumnResizeStart
|
|
5542
|
-
handleColumnVisibilityChange
|
|
5537
|
+
onColumnResizeStart
|
|
5543
5538
|
];
|
|
5544
5539
|
};
|
|
5545
5540
|
const toggleWrapper = "_toggleWrapper_rjfhl_1";
|
|
@@ -5693,26 +5688,35 @@ const TaskListTableHeadersDefaultInner = ({
|
|
|
5693
5688
|
}) => {
|
|
5694
5689
|
const pinnedStyles = useMemo(() => {
|
|
5695
5690
|
const result = {};
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
};
|
|
5691
|
+
let leftOffset = 0;
|
|
5692
|
+
if (canMoveTasks) {
|
|
5693
|
+
leftOffset = 24;
|
|
5694
|
+
}
|
|
5701
5695
|
for (let i = 0; i < columns.length; i++) {
|
|
5702
5696
|
if (columns[i].pinned === "left") {
|
|
5703
5697
|
result[i] = {
|
|
5704
|
-
|
|
5705
|
-
|
|
5698
|
+
position: "sticky",
|
|
5699
|
+
left: leftOffset,
|
|
5700
|
+
zIndex: 2,
|
|
5701
|
+
backgroundColor: "var(--gantt-table-header-background-color, #fff)"
|
|
5706
5702
|
};
|
|
5707
|
-
|
|
5703
|
+
leftOffset += columns[i].width;
|
|
5704
|
+
}
|
|
5705
|
+
}
|
|
5706
|
+
let rightOffset = 0;
|
|
5707
|
+
for (let i = columns.length - 1; i >= 0; i--) {
|
|
5708
|
+
if (columns[i].pinned === "right") {
|
|
5708
5709
|
result[i] = {
|
|
5709
|
-
|
|
5710
|
-
|
|
5710
|
+
position: "sticky",
|
|
5711
|
+
right: rightOffset,
|
|
5712
|
+
zIndex: 2,
|
|
5713
|
+
backgroundColor: "var(--gantt-table-header-background-color, #fff)"
|
|
5711
5714
|
};
|
|
5715
|
+
rightOffset += columns[i].width;
|
|
5712
5716
|
}
|
|
5713
5717
|
}
|
|
5714
5718
|
return result;
|
|
5715
|
-
}, [columns]);
|
|
5719
|
+
}, [columns, canMoveTasks]);
|
|
5716
5720
|
return /* @__PURE__ */ jsx(
|
|
5717
5721
|
"div",
|
|
5718
5722
|
{
|
|
@@ -10446,17 +10450,7 @@ const TaskListTableRowInner = forwardRef(
|
|
|
10446
10450
|
if (isOverlay2) {
|
|
10447
10451
|
return "var(--gantt-table-drag-task-background-color)";
|
|
10448
10452
|
}
|
|
10449
|
-
return isSelected ? "var(--gantt-table-selected-task-background-color)" : isEven ? "var(--gantt-table-even-background-color)" :
|
|
10450
|
-
}, [isEven, isOverlay2, isSelected]);
|
|
10451
|
-
const pinnedBgColor = useMemo(() => {
|
|
10452
|
-
if (isOverlay2) {
|
|
10453
|
-
return "var(--gantt-table-drag-task-background-color)";
|
|
10454
|
-
}
|
|
10455
|
-
if (isSelected) {
|
|
10456
|
-
const base = isEven ? "var(--gantt-table-even-background-color, #f5f5f5)" : "var(--gantt-background-color, #fff)";
|
|
10457
|
-
return `linear-gradient(var(--gantt-table-selected-task-background-color), var(--gantt-table-selected-task-background-color)), linear-gradient(${base}, ${base})`;
|
|
10458
|
-
}
|
|
10459
|
-
return isEven ? "var(--gantt-table-even-background-color)" : "var(--gantt-background-color, #fff)";
|
|
10453
|
+
return isSelected ? "var(--gantt-table-selected-task-background-color)" : isEven ? "var(--gantt-table-even-background-color)" : void 0;
|
|
10460
10454
|
}, [isEven, isOverlay2, isSelected]);
|
|
10461
10455
|
const rowClassName = useMemo(() => {
|
|
10462
10456
|
const classNames = [styles$h.taskListTableRow];
|
|
@@ -10476,26 +10470,35 @@ const TaskListTableRowInner = forwardRef(
|
|
|
10476
10470
|
}, [isCut2, moveOverPosition, isOverlay2, isDragging]);
|
|
10477
10471
|
const pinnedStyles = useMemo(() => {
|
|
10478
10472
|
const result = {};
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
};
|
|
10473
|
+
let leftOffset = 0;
|
|
10474
|
+
if (moveHandleProps || !isOverlay2 && task.type !== "project" && task.id !== "no-project-asigned") {
|
|
10475
|
+
leftOffset = 24;
|
|
10476
|
+
}
|
|
10484
10477
|
for (let i = 0; i < columns.length; i++) {
|
|
10485
10478
|
if (columns[i].pinned === "left") {
|
|
10486
10479
|
result[i] = {
|
|
10487
|
-
|
|
10488
|
-
|
|
10480
|
+
position: "sticky",
|
|
10481
|
+
left: leftOffset,
|
|
10482
|
+
zIndex: 1,
|
|
10483
|
+
backgroundColor: "inherit"
|
|
10489
10484
|
};
|
|
10490
|
-
|
|
10485
|
+
leftOffset += columns[i].width;
|
|
10486
|
+
}
|
|
10487
|
+
}
|
|
10488
|
+
let rightOffset = 0;
|
|
10489
|
+
for (let i = columns.length - 1; i >= 0; i--) {
|
|
10490
|
+
if (columns[i].pinned === "right") {
|
|
10491
10491
|
result[i] = {
|
|
10492
|
-
|
|
10493
|
-
|
|
10492
|
+
position: "sticky",
|
|
10493
|
+
right: rightOffset,
|
|
10494
|
+
zIndex: 1,
|
|
10495
|
+
backgroundColor: "inherit"
|
|
10494
10496
|
};
|
|
10497
|
+
rightOffset += columns[i].width;
|
|
10495
10498
|
}
|
|
10496
10499
|
}
|
|
10497
10500
|
return result;
|
|
10498
|
-
}, [columns,
|
|
10501
|
+
}, [columns, moveHandleProps, isOverlay2, task.type, task.id]);
|
|
10499
10502
|
return /* @__PURE__ */ jsxs(
|
|
10500
10503
|
"div",
|
|
10501
10504
|
{
|
|
@@ -11166,59 +11169,17 @@ const TaskListInner = ({
|
|
|
11166
11169
|
taskListWidth,
|
|
11167
11170
|
tableWidth,
|
|
11168
11171
|
onTableResizeStart,
|
|
11169
|
-
onColumnResizeStart
|
|
11170
|
-
internalColumnVisibilityChange
|
|
11172
|
+
onColumnResizeStart
|
|
11171
11173
|
] = useTableListResize(
|
|
11172
11174
|
columnsProp,
|
|
11173
11175
|
canReorderTasks,
|
|
11174
11176
|
onResizeColumn,
|
|
11175
11177
|
ganttRef
|
|
11176
11178
|
);
|
|
11177
|
-
const
|
|
11178
|
-
(
|
|
11179
|
-
|
|
11180
|
-
if (onColumnVisibilityChange) {
|
|
11181
|
-
onColumnVisibilityChange(columnId, hidden2);
|
|
11182
|
-
}
|
|
11183
|
-
},
|
|
11184
|
-
[internalColumnVisibilityChange, onColumnVisibilityChange]
|
|
11185
|
-
);
|
|
11186
|
-
const columns = useMemo(() => {
|
|
11187
|
-
const visible = allColumns.filter((col) => !col.hidden);
|
|
11188
|
-
const left = visible.filter((col) => col.pinned === "left");
|
|
11189
|
-
const middle = visible.filter((col) => !col.pinned);
|
|
11190
|
-
const right = visible.filter((col) => col.pinned === "right");
|
|
11191
|
-
return [...left, ...middle, ...right];
|
|
11192
|
-
}, [allColumns]);
|
|
11193
|
-
const horizontalScrollRef = useRef(null);
|
|
11194
|
-
const setHorizontalScrollRef = useCallback(
|
|
11195
|
-
(el) => {
|
|
11196
|
-
horizontalScrollRef.current = el;
|
|
11197
|
-
if (taskListHorizontalScrollRef) {
|
|
11198
|
-
taskListHorizontalScrollRef.current = el;
|
|
11199
|
-
}
|
|
11200
|
-
},
|
|
11201
|
-
[taskListHorizontalScrollRef]
|
|
11179
|
+
const columns = useMemo(
|
|
11180
|
+
() => allColumns.filter((col) => !col.hidden),
|
|
11181
|
+
[allColumns]
|
|
11202
11182
|
);
|
|
11203
|
-
useEffect(() => {
|
|
11204
|
-
const scrollEl = horizontalScrollRef.current;
|
|
11205
|
-
const containerEl = taskListContainerRef.current;
|
|
11206
|
-
if (!scrollEl || !containerEl)
|
|
11207
|
-
return void 0;
|
|
11208
|
-
const update = () => {
|
|
11209
|
-
const sl = scrollEl.scrollLeft;
|
|
11210
|
-
const maxSl = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
11211
|
-
const leftVal = `${sl}px`;
|
|
11212
|
-
const rightVal = `${sl - maxSl}px`;
|
|
11213
|
-
scrollEl.style.setProperty("--pinned-translate-left", leftVal);
|
|
11214
|
-
scrollEl.style.setProperty("--pinned-translate-right", rightVal);
|
|
11215
|
-
containerEl.style.setProperty("--pinned-translate-left", leftVal);
|
|
11216
|
-
containerEl.style.setProperty("--pinned-translate-right", rightVal);
|
|
11217
|
-
};
|
|
11218
|
-
update();
|
|
11219
|
-
scrollEl.addEventListener("scroll", update, { passive: true });
|
|
11220
|
-
return () => scrollEl.removeEventListener("scroll", update);
|
|
11221
|
-
}, [taskListContainerRef, taskListWidth, tableWidth]);
|
|
11222
11183
|
const renderedIndexes = useOptimizedList(
|
|
11223
11184
|
taskListContainerRef,
|
|
11224
11185
|
"scrollTop",
|
|
@@ -11295,7 +11256,7 @@ const TaskListInner = ({
|
|
|
11295
11256
|
/* @__PURE__ */ jsxs(
|
|
11296
11257
|
"div",
|
|
11297
11258
|
{
|
|
11298
|
-
ref:
|
|
11259
|
+
ref: taskListHorizontalScrollRef,
|
|
11299
11260
|
className: styles$e.taskListHorizontalScroll,
|
|
11300
11261
|
style: {
|
|
11301
11262
|
width: tableWidth
|
|
@@ -11310,7 +11271,7 @@ const TaskListInner = ({
|
|
|
11310
11271
|
allColumns,
|
|
11311
11272
|
canToggleColumns: !!canToggleColumns,
|
|
11312
11273
|
onColumnResizeStart,
|
|
11313
|
-
onColumnVisibilityChange
|
|
11274
|
+
onColumnVisibilityChange,
|
|
11314
11275
|
canResizeColumns
|
|
11315
11276
|
}
|
|
11316
11277
|
),
|
|
@@ -11336,7 +11297,7 @@ const TaskListInner = ({
|
|
|
11336
11297
|
distances.minimumRowDisplayed * distances.rowHeight
|
|
11337
11298
|
),
|
|
11338
11299
|
backgroundSize: `100% ${fullRowHeight * 2}px`,
|
|
11339
|
-
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px,
|
|
11300
|
+
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
11340
11301
|
},
|
|
11341
11302
|
children: /* @__PURE__ */ jsx(
|
|
11342
11303
|
RenderTaskListTable,
|
|
@@ -14451,7 +14412,7 @@ const TaskGanttInner = (props) => {
|
|
|
14451
14412
|
backgroundPositionX: additionalLeftSpace || void 0,
|
|
14452
14413
|
backgroundImage: [
|
|
14453
14414
|
`linear-gradient(to right, #ebeff2 1px, transparent 2px)`,
|
|
14454
|
-
`linear-gradient(to bottom, transparent ${fullRowHeight}px,
|
|
14415
|
+
`linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
14455
14416
|
].join(", ")
|
|
14456
14417
|
}),
|
|
14457
14418
|
[
|
|
@@ -5395,16 +5395,22 @@
|
|
|
5395
5395
|
React.useEffect(() => {
|
|
5396
5396
|
if (clientColumns) {
|
|
5397
5397
|
setColumns([...clientColumns]);
|
|
5398
|
-
const
|
|
5398
|
+
const currentColumnIds = clientColumns.map((col) => col.id);
|
|
5399
|
+
const newColumnIds = clientColumns.map((col) => col.id);
|
|
5400
|
+
const widthOfAddedColumns = clientColumns.filter((col) => !currentColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5401
|
+
const widthOfRemovedColumns = clientColumns.filter((col) => !newColumnIds.includes(col.id)).reduce((res, { width }) => res + width, 0);
|
|
5399
5402
|
setTableWidth(
|
|
5400
|
-
|
|
5403
|
+
(prev) => Math.min(
|
|
5404
|
+
prev + widthOfAddedColumns - widthOfRemovedColumns,
|
|
5405
|
+
clientColumns.reduce((res, { width }) => res + width, 0) + extraWidth
|
|
5406
|
+
)
|
|
5401
5407
|
);
|
|
5402
5408
|
}
|
|
5403
5409
|
}, [clientColumns, extraWidth]);
|
|
5404
5410
|
const [tableResizeEvent, setTableResizeEvent] = React.useState(null);
|
|
5405
5411
|
const [columnResizeEvent, setColumnResizeEvent] = React.useState(null);
|
|
5406
5412
|
const [tableWidthState, setTableWidth] = React.useState(
|
|
5407
|
-
() => columnsState.
|
|
5413
|
+
() => columnsState.reduce((res, { width }) => res + width, 0) + extraWidth
|
|
5408
5414
|
);
|
|
5409
5415
|
const onTableResizeStart = (clientX) => {
|
|
5410
5416
|
const newTableResizeEvent = {
|
|
@@ -5422,19 +5428,9 @@
|
|
|
5422
5428
|
initialTableWidth: tableWidthState
|
|
5423
5429
|
});
|
|
5424
5430
|
};
|
|
5425
|
-
const handleColumnVisibilityChange = (columnId, hidden2) => {
|
|
5426
|
-
setColumns((prev) => {
|
|
5427
|
-
const next = prev.map(
|
|
5428
|
-
(col) => col.id === columnId ? { ...col, hidden: hidden2 } : col
|
|
5429
|
-
);
|
|
5430
|
-
const visibleWidth = next.filter((c) => !c.hidden).reduce((s, { width }) => s + width, 0) + extraWidth;
|
|
5431
|
-
setTableWidth(visibleWidth);
|
|
5432
|
-
return next;
|
|
5433
|
-
});
|
|
5434
|
-
};
|
|
5435
5431
|
const isResizeTableInProgress = Boolean(tableResizeEvent);
|
|
5436
5432
|
const isResizeColumnInProgress = Boolean(columnResizeEvent);
|
|
5437
|
-
const taskListWidth = columnsState.
|
|
5433
|
+
const taskListWidth = columnsState.reduce((res, { width }) => res + width, 0) + extraWidth;
|
|
5438
5434
|
React.useEffect(() => {
|
|
5439
5435
|
if (!isResizeTableInProgress) {
|
|
5440
5436
|
return void 0;
|
|
@@ -5555,8 +5551,7 @@
|
|
|
5555
5551
|
taskListWidth,
|
|
5556
5552
|
tableWidthState,
|
|
5557
5553
|
onTableResizeStart,
|
|
5558
|
-
onColumnResizeStart
|
|
5559
|
-
handleColumnVisibilityChange
|
|
5554
|
+
onColumnResizeStart
|
|
5560
5555
|
];
|
|
5561
5556
|
};
|
|
5562
5557
|
const toggleWrapper = "_toggleWrapper_rjfhl_1";
|
|
@@ -5710,26 +5705,35 @@
|
|
|
5710
5705
|
}) => {
|
|
5711
5706
|
const pinnedStyles = React.useMemo(() => {
|
|
5712
5707
|
const result = {};
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
};
|
|
5708
|
+
let leftOffset = 0;
|
|
5709
|
+
if (canMoveTasks) {
|
|
5710
|
+
leftOffset = 24;
|
|
5711
|
+
}
|
|
5718
5712
|
for (let i = 0; i < columns.length; i++) {
|
|
5719
5713
|
if (columns[i].pinned === "left") {
|
|
5720
5714
|
result[i] = {
|
|
5721
|
-
|
|
5722
|
-
|
|
5715
|
+
position: "sticky",
|
|
5716
|
+
left: leftOffset,
|
|
5717
|
+
zIndex: 2,
|
|
5718
|
+
backgroundColor: "var(--gantt-table-header-background-color, #fff)"
|
|
5723
5719
|
};
|
|
5724
|
-
|
|
5720
|
+
leftOffset += columns[i].width;
|
|
5721
|
+
}
|
|
5722
|
+
}
|
|
5723
|
+
let rightOffset = 0;
|
|
5724
|
+
for (let i = columns.length - 1; i >= 0; i--) {
|
|
5725
|
+
if (columns[i].pinned === "right") {
|
|
5725
5726
|
result[i] = {
|
|
5726
|
-
|
|
5727
|
-
|
|
5727
|
+
position: "sticky",
|
|
5728
|
+
right: rightOffset,
|
|
5729
|
+
zIndex: 2,
|
|
5730
|
+
backgroundColor: "var(--gantt-table-header-background-color, #fff)"
|
|
5728
5731
|
};
|
|
5732
|
+
rightOffset += columns[i].width;
|
|
5729
5733
|
}
|
|
5730
5734
|
}
|
|
5731
5735
|
return result;
|
|
5732
|
-
}, [columns]);
|
|
5736
|
+
}, [columns, canMoveTasks]);
|
|
5733
5737
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5734
5738
|
"div",
|
|
5735
5739
|
{
|
|
@@ -10463,17 +10467,7 @@
|
|
|
10463
10467
|
if (isOverlay2) {
|
|
10464
10468
|
return "var(--gantt-table-drag-task-background-color)";
|
|
10465
10469
|
}
|
|
10466
|
-
return isSelected ? "var(--gantt-table-selected-task-background-color)" : isEven ? "var(--gantt-table-even-background-color)" :
|
|
10467
|
-
}, [isEven, isOverlay2, isSelected]);
|
|
10468
|
-
const pinnedBgColor = React.useMemo(() => {
|
|
10469
|
-
if (isOverlay2) {
|
|
10470
|
-
return "var(--gantt-table-drag-task-background-color)";
|
|
10471
|
-
}
|
|
10472
|
-
if (isSelected) {
|
|
10473
|
-
const base = isEven ? "var(--gantt-table-even-background-color, #f5f5f5)" : "var(--gantt-background-color, #fff)";
|
|
10474
|
-
return `linear-gradient(var(--gantt-table-selected-task-background-color), var(--gantt-table-selected-task-background-color)), linear-gradient(${base}, ${base})`;
|
|
10475
|
-
}
|
|
10476
|
-
return isEven ? "var(--gantt-table-even-background-color)" : "var(--gantt-background-color, #fff)";
|
|
10470
|
+
return isSelected ? "var(--gantt-table-selected-task-background-color)" : isEven ? "var(--gantt-table-even-background-color)" : void 0;
|
|
10477
10471
|
}, [isEven, isOverlay2, isSelected]);
|
|
10478
10472
|
const rowClassName = React.useMemo(() => {
|
|
10479
10473
|
const classNames = [styles$h.taskListTableRow];
|
|
@@ -10493,26 +10487,35 @@
|
|
|
10493
10487
|
}, [isCut2, moveOverPosition, isOverlay2, isDragging]);
|
|
10494
10488
|
const pinnedStyles = React.useMemo(() => {
|
|
10495
10489
|
const result = {};
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
};
|
|
10490
|
+
let leftOffset = 0;
|
|
10491
|
+
if (moveHandleProps || !isOverlay2 && task.type !== "project" && task.id !== "no-project-asigned") {
|
|
10492
|
+
leftOffset = 24;
|
|
10493
|
+
}
|
|
10501
10494
|
for (let i = 0; i < columns.length; i++) {
|
|
10502
10495
|
if (columns[i].pinned === "left") {
|
|
10503
10496
|
result[i] = {
|
|
10504
|
-
|
|
10505
|
-
|
|
10497
|
+
position: "sticky",
|
|
10498
|
+
left: leftOffset,
|
|
10499
|
+
zIndex: 1,
|
|
10500
|
+
backgroundColor: "inherit"
|
|
10506
10501
|
};
|
|
10507
|
-
|
|
10502
|
+
leftOffset += columns[i].width;
|
|
10503
|
+
}
|
|
10504
|
+
}
|
|
10505
|
+
let rightOffset = 0;
|
|
10506
|
+
for (let i = columns.length - 1; i >= 0; i--) {
|
|
10507
|
+
if (columns[i].pinned === "right") {
|
|
10508
10508
|
result[i] = {
|
|
10509
|
-
|
|
10510
|
-
|
|
10509
|
+
position: "sticky",
|
|
10510
|
+
right: rightOffset,
|
|
10511
|
+
zIndex: 1,
|
|
10512
|
+
backgroundColor: "inherit"
|
|
10511
10513
|
};
|
|
10514
|
+
rightOffset += columns[i].width;
|
|
10512
10515
|
}
|
|
10513
10516
|
}
|
|
10514
10517
|
return result;
|
|
10515
|
-
}, [columns,
|
|
10518
|
+
}, [columns, moveHandleProps, isOverlay2, task.type, task.id]);
|
|
10516
10519
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10517
10520
|
"div",
|
|
10518
10521
|
{
|
|
@@ -11183,59 +11186,17 @@
|
|
|
11183
11186
|
taskListWidth,
|
|
11184
11187
|
tableWidth,
|
|
11185
11188
|
onTableResizeStart,
|
|
11186
|
-
onColumnResizeStart
|
|
11187
|
-
internalColumnVisibilityChange
|
|
11189
|
+
onColumnResizeStart
|
|
11188
11190
|
] = useTableListResize(
|
|
11189
11191
|
columnsProp,
|
|
11190
11192
|
canReorderTasks,
|
|
11191
11193
|
onResizeColumn,
|
|
11192
11194
|
ganttRef
|
|
11193
11195
|
);
|
|
11194
|
-
const
|
|
11195
|
-
(
|
|
11196
|
-
|
|
11197
|
-
if (onColumnVisibilityChange) {
|
|
11198
|
-
onColumnVisibilityChange(columnId, hidden2);
|
|
11199
|
-
}
|
|
11200
|
-
},
|
|
11201
|
-
[internalColumnVisibilityChange, onColumnVisibilityChange]
|
|
11202
|
-
);
|
|
11203
|
-
const columns = React.useMemo(() => {
|
|
11204
|
-
const visible = allColumns.filter((col) => !col.hidden);
|
|
11205
|
-
const left = visible.filter((col) => col.pinned === "left");
|
|
11206
|
-
const middle = visible.filter((col) => !col.pinned);
|
|
11207
|
-
const right = visible.filter((col) => col.pinned === "right");
|
|
11208
|
-
return [...left, ...middle, ...right];
|
|
11209
|
-
}, [allColumns]);
|
|
11210
|
-
const horizontalScrollRef = React.useRef(null);
|
|
11211
|
-
const setHorizontalScrollRef = React.useCallback(
|
|
11212
|
-
(el) => {
|
|
11213
|
-
horizontalScrollRef.current = el;
|
|
11214
|
-
if (taskListHorizontalScrollRef) {
|
|
11215
|
-
taskListHorizontalScrollRef.current = el;
|
|
11216
|
-
}
|
|
11217
|
-
},
|
|
11218
|
-
[taskListHorizontalScrollRef]
|
|
11196
|
+
const columns = React.useMemo(
|
|
11197
|
+
() => allColumns.filter((col) => !col.hidden),
|
|
11198
|
+
[allColumns]
|
|
11219
11199
|
);
|
|
11220
|
-
React.useEffect(() => {
|
|
11221
|
-
const scrollEl = horizontalScrollRef.current;
|
|
11222
|
-
const containerEl = taskListContainerRef.current;
|
|
11223
|
-
if (!scrollEl || !containerEl)
|
|
11224
|
-
return void 0;
|
|
11225
|
-
const update = () => {
|
|
11226
|
-
const sl = scrollEl.scrollLeft;
|
|
11227
|
-
const maxSl = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
11228
|
-
const leftVal = `${sl}px`;
|
|
11229
|
-
const rightVal = `${sl - maxSl}px`;
|
|
11230
|
-
scrollEl.style.setProperty("--pinned-translate-left", leftVal);
|
|
11231
|
-
scrollEl.style.setProperty("--pinned-translate-right", rightVal);
|
|
11232
|
-
containerEl.style.setProperty("--pinned-translate-left", leftVal);
|
|
11233
|
-
containerEl.style.setProperty("--pinned-translate-right", rightVal);
|
|
11234
|
-
};
|
|
11235
|
-
update();
|
|
11236
|
-
scrollEl.addEventListener("scroll", update, { passive: true });
|
|
11237
|
-
return () => scrollEl.removeEventListener("scroll", update);
|
|
11238
|
-
}, [taskListContainerRef, taskListWidth, tableWidth]);
|
|
11239
11200
|
const renderedIndexes = useOptimizedList(
|
|
11240
11201
|
taskListContainerRef,
|
|
11241
11202
|
"scrollTop",
|
|
@@ -11312,7 +11273,7 @@
|
|
|
11312
11273
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11313
11274
|
"div",
|
|
11314
11275
|
{
|
|
11315
|
-
ref:
|
|
11276
|
+
ref: taskListHorizontalScrollRef,
|
|
11316
11277
|
className: styles$e.taskListHorizontalScroll,
|
|
11317
11278
|
style: {
|
|
11318
11279
|
width: tableWidth
|
|
@@ -11327,7 +11288,7 @@
|
|
|
11327
11288
|
allColumns,
|
|
11328
11289
|
canToggleColumns: !!canToggleColumns,
|
|
11329
11290
|
onColumnResizeStart,
|
|
11330
|
-
onColumnVisibilityChange
|
|
11291
|
+
onColumnVisibilityChange,
|
|
11331
11292
|
canResizeColumns
|
|
11332
11293
|
}
|
|
11333
11294
|
),
|
|
@@ -11353,7 +11314,7 @@
|
|
|
11353
11314
|
distances.minimumRowDisplayed * distances.rowHeight
|
|
11354
11315
|
),
|
|
11355
11316
|
backgroundSize: `100% ${fullRowHeight * 2}px`,
|
|
11356
|
-
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px,
|
|
11317
|
+
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
11357
11318
|
},
|
|
11358
11319
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11359
11320
|
RenderTaskListTable,
|
|
@@ -14468,7 +14429,7 @@
|
|
|
14468
14429
|
backgroundPositionX: additionalLeftSpace || void 0,
|
|
14469
14430
|
backgroundImage: [
|
|
14470
14431
|
`linear-gradient(to right, #ebeff2 1px, transparent 2px)`,
|
|
14471
|
-
`linear-gradient(to bottom, transparent ${fullRowHeight}px,
|
|
14432
|
+
`linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
14472
14433
|
].join(", ")
|
|
14473
14434
|
}),
|
|
14474
14435
|
[
|
package/package.json
CHANGED