gantt-lib 0.117.2 → 0.118.0
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.css.map +1 -1
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -4
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +15 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -593,8 +593,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
593
593
|
onToggleCollapse?: (parentId: string) => void;
|
|
594
594
|
/** Task IDs to highlight in the task list (for search results) */
|
|
595
595
|
highlightedTaskIds?: Set<string>;
|
|
596
|
-
/** Fill parent rows with background in the task list. Defaults to enabled in plan-fact mode only. */
|
|
597
|
-
fillParentRowsInTaskList?: boolean;
|
|
596
|
+
/** Fill parent rows with background in the task list. Accepts a boolean for all parent rows or a predicate for selective fill. Defaults to enabled in plan-fact mode only. */
|
|
597
|
+
fillParentRowsInTaskList?: boolean | ((task: TTask) => boolean);
|
|
598
598
|
/** Enable a leading checkbox column for multi-selecting task rows (default: false) */
|
|
599
599
|
enableTaskMultiSelect?: boolean;
|
|
600
600
|
/** Controlled selected task IDs for multi-select mode */
|
|
@@ -621,6 +621,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
621
621
|
hideTaskListRowActions?: boolean;
|
|
622
622
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
623
623
|
getTaskListRowClassName?: (task: TTask) => string | undefined;
|
|
624
|
+
/** Optional icon rendered before the task name inside TaskList rows. */
|
|
625
|
+
getTaskListNamePrefixIcon?: (task: TTask) => React$1.ReactNode;
|
|
624
626
|
/** Global number of text lines the row height should accommodate in table-like presentations. */
|
|
625
627
|
rowContentLines?: number;
|
|
626
628
|
/** How task-list date pickers apply start/end edits (default: preserve-duration) */
|
|
@@ -966,7 +968,7 @@ interface TaskListProps {
|
|
|
966
968
|
/** Task IDs highlighted by the active filter */
|
|
967
969
|
highlightedTaskIds?: Set<string>;
|
|
968
970
|
/** Fill parent rows with background in task list */
|
|
969
|
-
fillParentRows?: boolean;
|
|
971
|
+
fillParentRows?: boolean | ((task: Task) => boolean);
|
|
970
972
|
/** Enable a leading checkbox column for multi-selecting task rows (default: false) */
|
|
971
973
|
enableTaskMultiSelect?: boolean;
|
|
972
974
|
/** Controlled selected task IDs for multi-select mode */
|
|
@@ -993,6 +995,8 @@ interface TaskListProps {
|
|
|
993
995
|
hideTaskListRowActions?: boolean;
|
|
994
996
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
995
997
|
getTaskListRowClassName?: (task: Task) => string | undefined;
|
|
998
|
+
/** Optional icon rendered before the task name inside TaskList rows. */
|
|
999
|
+
getTaskListNamePrefixIcon?: (task: Task) => React$1.ReactNode;
|
|
996
1000
|
/** Global number of visible content lines used to size every row consistently. */
|
|
997
1001
|
rowContentLines?: number;
|
|
998
1002
|
/** Optional minimum height for the data body area below the sticky header. */
|
package/dist/index.d.ts
CHANGED
|
@@ -593,8 +593,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
593
593
|
onToggleCollapse?: (parentId: string) => void;
|
|
594
594
|
/** Task IDs to highlight in the task list (for search results) */
|
|
595
595
|
highlightedTaskIds?: Set<string>;
|
|
596
|
-
/** Fill parent rows with background in the task list. Defaults to enabled in plan-fact mode only. */
|
|
597
|
-
fillParentRowsInTaskList?: boolean;
|
|
596
|
+
/** Fill parent rows with background in the task list. Accepts a boolean for all parent rows or a predicate for selective fill. Defaults to enabled in plan-fact mode only. */
|
|
597
|
+
fillParentRowsInTaskList?: boolean | ((task: TTask) => boolean);
|
|
598
598
|
/** Enable a leading checkbox column for multi-selecting task rows (default: false) */
|
|
599
599
|
enableTaskMultiSelect?: boolean;
|
|
600
600
|
/** Controlled selected task IDs for multi-select mode */
|
|
@@ -621,6 +621,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
621
621
|
hideTaskListRowActions?: boolean;
|
|
622
622
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
623
623
|
getTaskListRowClassName?: (task: TTask) => string | undefined;
|
|
624
|
+
/** Optional icon rendered before the task name inside TaskList rows. */
|
|
625
|
+
getTaskListNamePrefixIcon?: (task: TTask) => React$1.ReactNode;
|
|
624
626
|
/** Global number of text lines the row height should accommodate in table-like presentations. */
|
|
625
627
|
rowContentLines?: number;
|
|
626
628
|
/** How task-list date pickers apply start/end edits (default: preserve-duration) */
|
|
@@ -966,7 +968,7 @@ interface TaskListProps {
|
|
|
966
968
|
/** Task IDs highlighted by the active filter */
|
|
967
969
|
highlightedTaskIds?: Set<string>;
|
|
968
970
|
/** Fill parent rows with background in task list */
|
|
969
|
-
fillParentRows?: boolean;
|
|
971
|
+
fillParentRows?: boolean | ((task: Task) => boolean);
|
|
970
972
|
/** Enable a leading checkbox column for multi-selecting task rows (default: false) */
|
|
971
973
|
enableTaskMultiSelect?: boolean;
|
|
972
974
|
/** Controlled selected task IDs for multi-select mode */
|
|
@@ -993,6 +995,8 @@ interface TaskListProps {
|
|
|
993
995
|
hideTaskListRowActions?: boolean;
|
|
994
996
|
/** Returns an extra CSS class name for a TaskList row. */
|
|
995
997
|
getTaskListRowClassName?: (task: Task) => string | undefined;
|
|
998
|
+
/** Optional icon rendered before the task name inside TaskList rows. */
|
|
999
|
+
getTaskListNamePrefixIcon?: (task: Task) => React$1.ReactNode;
|
|
996
1000
|
/** Global number of visible content lines used to size every row consistently. */
|
|
997
1001
|
rowContentLines?: number;
|
|
998
1002
|
/** Optional minimum height for the data body area below the sticky header. */
|
package/dist/index.js
CHANGED
|
@@ -5111,7 +5111,7 @@ var areTaskListRowPropsEqual = (prevProps, nextProps) => {
|
|
|
5111
5111
|
const nextPickingTask = nextProps.selectingPredecessorFor === nextTask.id;
|
|
5112
5112
|
const prevAnyPicking = prevProps.selectingPredecessorFor != null;
|
|
5113
5113
|
const nextAnyPicking = nextProps.selectingPredecessorFor != null;
|
|
5114
|
-
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.hideTaskListRowActions === nextProps.hideTaskListRowActions && prevProps.rowClassName === nextProps.rowClassName && prevProps.taskDateChangeMode === nextProps.taskDateChangeMode;
|
|
5114
|
+
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.hideTaskListRowActions === nextProps.hideTaskListRowActions && prevProps.rowClassName === nextProps.rowClassName && prevProps.getTaskListNamePrefixIcon === nextProps.getTaskListNamePrefixIcon && prevProps.taskDateChangeMode === nextProps.taskDateChangeMode;
|
|
5115
5115
|
};
|
|
5116
5116
|
var TaskListRow = import_react11.default.memo(
|
|
5117
5117
|
({
|
|
@@ -5176,6 +5176,7 @@ var TaskListRow = import_react11.default.memo(
|
|
|
5176
5176
|
taskListMenuCommands = [],
|
|
5177
5177
|
hideTaskListRowActions = false,
|
|
5178
5178
|
rowClassName,
|
|
5179
|
+
getTaskListNamePrefixIcon,
|
|
5179
5180
|
taskDateChangeMode = "preserve-duration",
|
|
5180
5181
|
onTaskDateChangeModeChange
|
|
5181
5182
|
}) => {
|
|
@@ -5184,6 +5185,7 @@ var TaskListRow = import_react11.default.memo(
|
|
|
5184
5185
|
const editingName = editingColumnId === "name";
|
|
5185
5186
|
const editingDuration = editingColumnId === "duration";
|
|
5186
5187
|
const editingProgress = editingColumnId === "progress";
|
|
5188
|
+
const taskListNamePrefixIcon = getTaskListNamePrefixIcon?.(task) ?? null;
|
|
5187
5189
|
const columnWidthStyleMap = (0, import_react11.useMemo)(() => {
|
|
5188
5190
|
return new Map(
|
|
5189
5191
|
(resolvedColumns ?? []).map((column) => {
|
|
@@ -6216,7 +6218,7 @@ var TaskListRow = import_react11.default.memo(
|
|
|
6216
6218
|
style: { paddingLeft: nameInputPaddingLeft },
|
|
6217
6219
|
onClick: (e) => e.stopPropagation()
|
|
6218
6220
|
}
|
|
6219
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime13.
|
|
6221
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
6220
6222
|
"button",
|
|
6221
6223
|
{
|
|
6222
6224
|
type: "button",
|
|
@@ -6231,7 +6233,10 @@ var TaskListRow = import_react11.default.memo(
|
|
|
6231
6233
|
paddingLeft: nameTriggerPaddingLeft,
|
|
6232
6234
|
paddingRight: task.color ? "20px" : void 0
|
|
6233
6235
|
},
|
|
6234
|
-
children:
|
|
6236
|
+
children: [
|
|
6237
|
+
taskListNamePrefixIcon ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "gantt-tl-name-trigger-icon", "aria-hidden": "true", children: taskListNamePrefixIcon }) : null,
|
|
6238
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "gantt-tl-name-trigger-text", children: task.name })
|
|
6239
|
+
]
|
|
6235
6240
|
}
|
|
6236
6241
|
),
|
|
6237
6242
|
!editingName && task.color && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -7345,6 +7350,7 @@ var TaskList = ({
|
|
|
7345
7350
|
taskListMenuCommands,
|
|
7346
7351
|
hideTaskListRowActions = false,
|
|
7347
7352
|
getTaskListRowClassName,
|
|
7353
|
+
getTaskListNamePrefixIcon,
|
|
7348
7354
|
rowContentLines = 1,
|
|
7349
7355
|
bodyMinHeight,
|
|
7350
7356
|
taskDateChangeMode = "preserve-duration",
|
|
@@ -8268,7 +8274,7 @@ var TaskList = ({
|
|
|
8268
8274
|
ancestorLineModes: ancestorLineModesMap.get(task.id) ?? [],
|
|
8269
8275
|
customDays,
|
|
8270
8276
|
isWeekend: isWeekend3,
|
|
8271
|
-
fillParentRow: fillParentRows,
|
|
8277
|
+
fillParentRow: typeof fillParentRows === "function" ? fillParentRows(task) : fillParentRows,
|
|
8272
8278
|
businessDays,
|
|
8273
8279
|
defaultTaskDurationDays,
|
|
8274
8280
|
isFilterMatch: filterMode === "highlight" ? highlightedTaskIds.has(task.id) : false,
|
|
@@ -8281,6 +8287,7 @@ var TaskList = ({
|
|
|
8281
8287
|
taskListMenuCommands,
|
|
8282
8288
|
hideTaskListRowActions,
|
|
8283
8289
|
rowClassName: getTaskListRowClassName?.(task),
|
|
8290
|
+
getTaskListNamePrefixIcon,
|
|
8284
8291
|
taskDateChangeMode,
|
|
8285
8292
|
onTaskDateChangeModeChange
|
|
8286
8293
|
}
|
|
@@ -12174,6 +12181,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
12174
12181
|
taskListMenuCommands,
|
|
12175
12182
|
hideTaskListRowActions = false,
|
|
12176
12183
|
getTaskListRowClassName,
|
|
12184
|
+
getTaskListNamePrefixIcon,
|
|
12177
12185
|
rowContentLines = 1,
|
|
12178
12186
|
taskDateChangeMode: externalTaskDateChangeMode,
|
|
12179
12187
|
onTaskDateChangeModeChange: externalOnTaskDateChangeModeChange
|
|
@@ -13040,6 +13048,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
13040
13048
|
taskListMenuCommands,
|
|
13041
13049
|
hideTaskListRowActions,
|
|
13042
13050
|
getTaskListRowClassName,
|
|
13051
|
+
getTaskListNamePrefixIcon,
|
|
13043
13052
|
rowContentLines: resolvedRowContentLines,
|
|
13044
13053
|
bodyMinHeight: tableBodyMinHeight,
|
|
13045
13054
|
taskDateChangeMode,
|