gantt-lib 0.146.2 → 0.146.3
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/README.md +2 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +41 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -307,6 +307,8 @@ Tasks accept ISO strings or `Date` objects, but internal calculations are UTC-sa
|
|
|
307
307
|
|
|
308
308
|
Fixed dates independently anchor each boundary during scheduling. Parent boundaries without an anchor follow their children and applicable incoming constraints; children may extend outside fixed boundaries. A milestone has one date. Inverted fixed dates are rejected, as are subtree scaling results that would move an anchor (`FIXED_DATE_CONFLICT`). Existing tasks without fixed dates retain their existing behavior.
|
|
309
309
|
|
|
310
|
+
Use `renderTaskDateAction(task, boundary)` to render a consumer-owned control next to the start or end date in the task list. The `boundary` is `'start'` or `'end'`.
|
|
311
|
+
|
|
310
312
|
### Dependencies
|
|
311
313
|
|
|
312
314
|
Tasks can have dependencies on predecessor tasks using 4 link types following PM standards:
|
package/dist/index.d.mts
CHANGED
|
@@ -742,6 +742,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
742
742
|
renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
|
|
743
743
|
/** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
|
|
744
744
|
renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
|
|
745
|
+
/** Optional consumer-owned action beside each task date. */
|
|
746
|
+
renderTaskDateAction?: (task: TTask, boundary: 'start' | 'end') => React$1.ReactNode;
|
|
745
747
|
/** Hide row action controls in the TaskList for table-like read/edit presentations. */
|
|
746
748
|
hideTaskListRowActions?: boolean;
|
|
747
749
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
@@ -1265,6 +1267,7 @@ interface TaskListProps {
|
|
|
1265
1267
|
taskListMenuCommands?: TaskListMenuCommand<Task>[];
|
|
1266
1268
|
renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
|
|
1267
1269
|
renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
|
|
1270
|
+
renderTaskDateAction?: (task: Task, boundary: 'start' | 'end') => React$1.ReactNode;
|
|
1268
1271
|
/** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
|
|
1269
1272
|
hideTaskListRowActions?: boolean;
|
|
1270
1273
|
/** Returns an extra CSS class name for a TaskList row. */
|
package/dist/index.d.ts
CHANGED
|
@@ -742,6 +742,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
742
742
|
renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
|
|
743
743
|
/** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
|
|
744
744
|
renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
|
|
745
|
+
/** Optional consumer-owned action beside each task date. */
|
|
746
|
+
renderTaskDateAction?: (task: TTask, boundary: 'start' | 'end') => React$1.ReactNode;
|
|
745
747
|
/** Hide row action controls in the TaskList for table-like read/edit presentations. */
|
|
746
748
|
hideTaskListRowActions?: boolean;
|
|
747
749
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
@@ -1265,6 +1267,7 @@ interface TaskListProps {
|
|
|
1265
1267
|
taskListMenuCommands?: TaskListMenuCommand<Task>[];
|
|
1266
1268
|
renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
|
|
1267
1269
|
renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
|
|
1270
|
+
renderTaskDateAction?: (task: Task, boundary: 'start' | 'end') => React$1.ReactNode;
|
|
1268
1271
|
/** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
|
|
1269
1272
|
hideTaskListRowActions?: boolean;
|
|
1270
1273
|
/** Returns an extra CSS class name for a TaskList row. */
|
package/dist/index.js
CHANGED
|
@@ -8328,7 +8328,7 @@ var resolveActiveCustomCellForRow = (props) => {
|
|
|
8328
8328
|
var areTaskListRowPropsEqual = (prevProps, nextProps) => {
|
|
8329
8329
|
const prevTask = prevProps.task;
|
|
8330
8330
|
const nextTask = nextProps.task;
|
|
8331
|
-
const prevTaskUnchanged = prevTask === nextTask || prevTask.id === nextTask.id && prevTask.name === nextTask.name && prevTask.startDate === nextTask.startDate && prevTask.endDate === nextTask.endDate && prevTask.type === nextTask.type && prevTask.parentId === nextTask.parentId && prevTask.progress === nextTask.progress && prevTask.color === nextTask.color && prevTask.accepted === nextTask.accepted && prevTask.dependencies === nextTask.dependencies;
|
|
8331
|
+
const prevTaskUnchanged = prevTask === nextTask || prevTask.id === nextTask.id && prevTask.name === nextTask.name && prevTask.startDate === nextTask.startDate && prevTask.endDate === nextTask.endDate && prevTask.fixedStartDate === nextTask.fixedStartDate && prevTask.fixedEndDate === nextTask.fixedEndDate && prevTask.type === nextTask.type && prevTask.parentId === nextTask.parentId && prevTask.progress === nextTask.progress && prevTask.color === nextTask.color && prevTask.accepted === nextTask.accepted && prevTask.dependencies === nextTask.dependencies;
|
|
8332
8332
|
const prevIsSelected = prevProps.selectedTaskId === prevTask.id;
|
|
8333
8333
|
const nextIsSelected = nextProps.selectedTaskId === nextTask.id;
|
|
8334
8334
|
const prevIsEditingTask = prevProps.editingTaskId === prevTask.id;
|
|
@@ -8339,7 +8339,7 @@ var areTaskListRowPropsEqual = (prevProps, nextProps) => {
|
|
|
8339
8339
|
const nextPickingTask = nextProps.selectingPredecessorFor === nextTask.id;
|
|
8340
8340
|
const prevAnyPicking = prevProps.selectingPredecessorFor != null;
|
|
8341
8341
|
const nextAnyPicking = nextProps.selectingPredecessorFor != null;
|
|
8342
|
-
return prevTaskUnchanged && prevProps.rowIndex === nextProps.rowIndex && prevProps.taskNumber === nextProps.taskNumber && prevProps.taskNumberMap === nextProps.taskNumberMap && prevProps.rowHeight === nextProps.rowHeight && prevIsSelected === nextIsSelected && prevProps.disableTaskNameEditing === nextProps.disableTaskNameEditing && prevProps.disableDependencyEditing === nextProps.disableDependencyEditing && prevProps.allTasks === nextProps.allTasks && prevProps.activeLinkType === nextProps.activeLinkType && prevProps.dependencyPickMode === nextProps.dependencyPickMode && prevPickingTask === nextPickingTask && prevAnyPicking === nextAnyPicking && resolveSelectedChipRole(prevProps) === resolveSelectedChipRole(nextProps) && prevIsEditingTask === nextIsEditingTask && prevProps.isDragging === nextProps.isDragging && prevProps.isDragOver === nextProps.isDragOver && prevProps.dragOverPlacement === nextProps.dragOverPlacement && prevProps.isNestedDropTarget === nextProps.isNestedDropTarget && prevProps.isDirectChildDropTarget === nextProps.isDirectChildDropTarget && prevCollapsed === nextCollapsed && prevProps.canDemoteTask === nextProps.canDemoteTask && prevProps.isLastChild === nextProps.isLastChild && prevProps.nestingDepth === nextProps.nestingDepth && prevProps.hasVisibleChildren === nextProps.hasVisibleChildren && prevProps.ancestorLineModes === nextProps.ancestorLineModes && prevProps.customDays === nextProps.customDays && prevProps.isWeekend === nextProps.isWeekend && prevProps.fillParentRow === nextProps.fillParentRow && prevProps.businessDays === nextProps.businessDays && prevProps.defaultTaskDurationDays === nextProps.defaultTaskDurationDays && prevProps.isFilterMatch === nextProps.isFilterMatch && prevProps.isFilterHideMode === nextProps.isFilterHideMode && prevProps.resolvedColumns === nextProps.resolvedColumns && prevProps.isTaskSelected === nextProps.isTaskSelected && resolveActiveCustomCellForRow(prevProps) === resolveActiveCustomCellForRow(nextProps) && prevProps.taskListMenuCommands === nextProps.taskListMenuCommands && prevProps.onInsertAfter === nextProps.onInsertAfter && prevProps.onPromoteTask === nextProps.onPromoteTask && prevProps.onDemoteTask === nextProps.onDemoteTask && prevProps.onDuplicateTask === nextProps.onDuplicateTask && prevProps.onDelete === nextProps.onDelete && prevProps.onUngroupTask === nextProps.onUngroupTask && prevProps.renderTaskListActions === nextProps.renderTaskListActions && prevProps.renderTaskListMenu === nextProps.renderTaskListMenu && prevProps.hideTaskListRowActions === nextProps.hideTaskListRowActions && prevProps.rowClassName === nextProps.rowClassName && prevProps.getTaskListNamePrefixIcon === nextProps.getTaskListNamePrefixIcon && prevProps.taskDateChangeMode === nextProps.taskDateChangeMode && prevProps.printDependencyLabels === nextProps.printDependencyLabels;
|
|
8342
|
+
return prevTaskUnchanged && prevProps.rowIndex === nextProps.rowIndex && prevProps.taskNumber === nextProps.taskNumber && prevProps.taskNumberMap === nextProps.taskNumberMap && prevProps.rowHeight === nextProps.rowHeight && prevIsSelected === nextIsSelected && prevProps.disableTaskNameEditing === nextProps.disableTaskNameEditing && prevProps.disableDependencyEditing === nextProps.disableDependencyEditing && prevProps.allTasks === nextProps.allTasks && prevProps.activeLinkType === nextProps.activeLinkType && prevProps.dependencyPickMode === nextProps.dependencyPickMode && prevPickingTask === nextPickingTask && prevAnyPicking === nextAnyPicking && resolveSelectedChipRole(prevProps) === resolveSelectedChipRole(nextProps) && prevIsEditingTask === nextIsEditingTask && prevProps.isDragging === nextProps.isDragging && prevProps.isDragOver === nextProps.isDragOver && prevProps.dragOverPlacement === nextProps.dragOverPlacement && prevProps.isNestedDropTarget === nextProps.isNestedDropTarget && prevProps.isDirectChildDropTarget === nextProps.isDirectChildDropTarget && prevCollapsed === nextCollapsed && prevProps.canDemoteTask === nextProps.canDemoteTask && prevProps.isLastChild === nextProps.isLastChild && prevProps.nestingDepth === nextProps.nestingDepth && prevProps.hasVisibleChildren === nextProps.hasVisibleChildren && prevProps.ancestorLineModes === nextProps.ancestorLineModes && prevProps.customDays === nextProps.customDays && prevProps.isWeekend === nextProps.isWeekend && prevProps.fillParentRow === nextProps.fillParentRow && prevProps.businessDays === nextProps.businessDays && prevProps.defaultTaskDurationDays === nextProps.defaultTaskDurationDays && prevProps.isFilterMatch === nextProps.isFilterMatch && prevProps.isFilterHideMode === nextProps.isFilterHideMode && prevProps.resolvedColumns === nextProps.resolvedColumns && prevProps.isTaskSelected === nextProps.isTaskSelected && resolveActiveCustomCellForRow(prevProps) === resolveActiveCustomCellForRow(nextProps) && prevProps.taskListMenuCommands === nextProps.taskListMenuCommands && prevProps.onInsertAfter === nextProps.onInsertAfter && prevProps.onPromoteTask === nextProps.onPromoteTask && prevProps.onDemoteTask === nextProps.onDemoteTask && prevProps.onDuplicateTask === nextProps.onDuplicateTask && prevProps.onDelete === nextProps.onDelete && prevProps.onUngroupTask === nextProps.onUngroupTask && prevProps.renderTaskListActions === nextProps.renderTaskListActions && prevProps.renderTaskListMenu === nextProps.renderTaskListMenu && prevProps.renderTaskDateAction === nextProps.renderTaskDateAction && prevProps.hideTaskListRowActions === nextProps.hideTaskListRowActions && prevProps.rowClassName === nextProps.rowClassName && prevProps.getTaskListNamePrefixIcon === nextProps.getTaskListNamePrefixIcon && prevProps.taskDateChangeMode === nextProps.taskDateChangeMode && prevProps.printDependencyLabels === nextProps.printDependencyLabels;
|
|
8343
8343
|
};
|
|
8344
8344
|
var TaskListRow = import_react12.default.memo(
|
|
8345
8345
|
({
|
|
@@ -8405,6 +8405,7 @@ var TaskListRow = import_react12.default.memo(
|
|
|
8405
8405
|
taskListMenuCommands = [],
|
|
8406
8406
|
renderTaskListActions,
|
|
8407
8407
|
renderTaskListMenu,
|
|
8408
|
+
renderTaskDateAction,
|
|
8408
8409
|
hideTaskListRowActions = false,
|
|
8409
8410
|
rowClassName,
|
|
8410
8411
|
compositeParentColor,
|
|
@@ -9523,46 +9524,52 @@ var TaskListRow = import_react12.default.memo(
|
|
|
9523
9524
|
] }) : null
|
|
9524
9525
|
] }) : null
|
|
9525
9526
|
] });
|
|
9526
|
-
const startDateCell = /* @__PURE__ */ (0, import_jsx_runtime15.
|
|
9527
|
+
const startDateCell = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9527
9528
|
"div",
|
|
9528
9529
|
{
|
|
9529
9530
|
className: "gantt-tl-cell gantt-tl-cell-date",
|
|
9530
9531
|
style: getColumnStyle("startDate", 90),
|
|
9531
9532
|
onClick: (e) => e.stopPropagation(),
|
|
9532
|
-
children:
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9533
|
+
children: [
|
|
9534
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
9535
|
+
DatePicker,
|
|
9536
|
+
{
|
|
9537
|
+
value: startDateISO,
|
|
9538
|
+
onChange: handleStartDateChange,
|
|
9539
|
+
format: "dd.MM.yy",
|
|
9540
|
+
portal: true,
|
|
9541
|
+
disabled: task.locked,
|
|
9542
|
+
isWeekend: weekendPredicate,
|
|
9543
|
+
businessDays,
|
|
9544
|
+
footer: datePickerFooter
|
|
9545
|
+
}
|
|
9546
|
+
),
|
|
9547
|
+
renderTaskDateAction?.(task, "start")
|
|
9548
|
+
]
|
|
9545
9549
|
}
|
|
9546
9550
|
);
|
|
9547
|
-
const endDateCell = /* @__PURE__ */ (0, import_jsx_runtime15.
|
|
9551
|
+
const endDateCell = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9548
9552
|
"div",
|
|
9549
9553
|
{
|
|
9550
9554
|
className: "gantt-tl-cell gantt-tl-cell-date",
|
|
9551
9555
|
style: getColumnStyle("endDate", 90),
|
|
9552
9556
|
onClick: (e) => e.stopPropagation(),
|
|
9553
|
-
children:
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9557
|
+
children: [
|
|
9558
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
9559
|
+
DatePicker,
|
|
9560
|
+
{
|
|
9561
|
+
value: endDateISO,
|
|
9562
|
+
onChange: handleEndDateChange,
|
|
9563
|
+
format: "dd.MM.yy",
|
|
9564
|
+
portal: true,
|
|
9565
|
+
disabled: task.locked,
|
|
9566
|
+
isWeekend: weekendPredicate,
|
|
9567
|
+
businessDays,
|
|
9568
|
+
footer: datePickerFooter
|
|
9569
|
+
}
|
|
9570
|
+
),
|
|
9571
|
+
renderTaskDateAction?.(task, "end")
|
|
9572
|
+
]
|
|
9566
9573
|
}
|
|
9567
9574
|
);
|
|
9568
9575
|
const durationCell = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
@@ -10527,6 +10534,7 @@ var TaskList = ({
|
|
|
10527
10534
|
taskListMenuCommands,
|
|
10528
10535
|
renderTaskListActions,
|
|
10529
10536
|
renderTaskListMenu,
|
|
10537
|
+
renderTaskDateAction,
|
|
10530
10538
|
hideTaskListRowActions = false,
|
|
10531
10539
|
getTaskListRowClassName,
|
|
10532
10540
|
getTaskListNamePrefixIcon,
|
|
@@ -11690,6 +11698,7 @@ var TaskList = ({
|
|
|
11690
11698
|
taskListMenuCommands,
|
|
11691
11699
|
renderTaskListActions,
|
|
11692
11700
|
renderTaskListMenu,
|
|
11701
|
+
renderTaskDateAction,
|
|
11693
11702
|
hideTaskListRowActions,
|
|
11694
11703
|
rowClassName: [
|
|
11695
11704
|
task.parentId && compositeParentIds.has(task.parentId) ? "gantt-tl-row-composite-detail" : "",
|
|
@@ -15654,6 +15663,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
15654
15663
|
taskListMenuCommands,
|
|
15655
15664
|
renderTaskListActions,
|
|
15656
15665
|
renderTaskListMenu,
|
|
15666
|
+
renderTaskDateAction,
|
|
15657
15667
|
hideTaskListRowActions = false,
|
|
15658
15668
|
getTaskListRowClassName,
|
|
15659
15669
|
getTaskListNamePrefixIcon,
|
|
@@ -17013,6 +17023,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
17013
17023
|
taskListMenuCommands,
|
|
17014
17024
|
renderTaskListActions,
|
|
17015
17025
|
renderTaskListMenu,
|
|
17026
|
+
renderTaskDateAction,
|
|
17016
17027
|
hideTaskListRowActions,
|
|
17017
17028
|
getTaskListRowClassName,
|
|
17018
17029
|
getTaskListNamePrefixIcon,
|