Skip to content

Events And Lifecycle

This page documents 36 public symbols exported by @revolist/gantt.

constant

EventManager tag for committed assignment mutations.

export const GANTT_ASSIGNMENT_CHANGE_EVENT: "gantt-assignment-change";

constant

Cancelable event fired before task assignments are modified.

export const GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT: "gantt-before-assignment-change";

constant

Cancelable event fired before a dependency is created, deleted, or edited.

export const GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT: "gantt-before-dependency-change";

constant

Cancelable event fired before a task is created, moved, resized, or edited.

export const GANTT_BEFORE_TASK_CHANGE_EVENT: "gantt-before-task-change";

constant

EventManager tag for committed dependency mutations.

export const GANTT_DEPENDENCY_CHANGE_EVENT: "gantt-dependency-change";

constant

Fired when the user hovers over a dependency arrow.

export const GANTT_DEPENDENCY_HOVER_EVENT: "gantt-dependency-hover";

constant

Fired when the user clicks a dependency arrow.

export const GANTT_DEPENDENCY_SELECT_EVENT: "gantt-dependency-select";

constant

Internal history marker used to record Gantt timeline mutations without replaying them immediately.

export const GANTT_HISTORY_RECORD_EVENT: "gantt-history-record";

constant

Fired when the user resizes the table/timeline panel divider.

export const GANTT_PANEL_RESIZE_EVENT: "gantt-panel-resize";

constant

Dispatched to filter visible Gantt rows by a free-text query.

export const GANTT_SEARCH_EVENT: "gantt-search";

constant

EventManager tag for committed task mutations.

export const GANTT_TASK_CHANGE_EVENT: "gantt-task-change";

constant

Dispatched to convert the selected task into a milestone.

export const GANTT_TASK_CONVERT_TO_MILESTONE_EVENT: "gantt-task-convert-to-milestone";

constant

Dispatched to create a new task. Provide {@link GanttCreateTaskOptions} as the detail.

export const GANTT_TASK_CREATE_EVENT: "gantt-task-create";

constant

Fired after a task is created and selected.

export const GANTT_TASK_CREATED_EVENT: "gantt-task-created";

constant

Dispatched to delete the selected task and its descendants.

export const GANTT_TASK_DELETE_EVENT: "gantt-task-delete";

constant

Dispatched to open editing UI for a task.

export const GANTT_TASK_EDIT_EVENT: "gantt-task-edit";

constant

Dispatched to indent (demote) the selected task one level deeper.

export const GANTT_TASK_INDENT_EVENT: "gantt-task-indent";

constant

Dispatched to outdent (promote) the selected task one level up.

export const GANTT_TASK_OUTDENT_EVENT: "gantt-task-outdent";

constant

Dispatched to zoom in by one level.

export const GANTT_ZOOM_IN_EVENT: "gantt-zoom-in";

constant

Dispatched to zoom out by one level.

export const GANTT_ZOOM_OUT_EVENT: "gantt-zoom-out";

constant

Dispatched to jump directly to a specific zoom level by id.

export const GANTT_ZOOM_SET_LEVEL_EVENT: "gantt-zoom-set-level";

type

Kind of assignment mutation that triggered the before-change event.

export type GanttBeforeAssignmentChangeAction = 'edit';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeAssignmentChangeDetail {
readonly action: GanttBeforeAssignmentChangeAction;
readonly taskId: TaskId;
readonly assignments: readonly AssignmentEntity[];
readonly previousAssignments: readonly AssignmentEntity[];
}
MemberType / returnRequiredDefaultDescription
action"edit"Yes—
taskIdstringYes—
assignmentsreadonly AssignmentEntity[]Yes—
previousAssignmentsreadonly AssignmentEntity[]Yes—

Related types: AssignmentEntity, GanttBeforeAssignmentChangeAction, TaskId

type

export type GanttBeforeChangeDetailByEventName = {
readonly [GANTT_BEFORE_TASK_CHANGE_EVENT]: GanttBeforeTaskChangeDetail;
readonly [GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT]: GanttBeforeDependencyChangeDetail;
readonly [GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT]: GanttBeforeAssignmentChangeDetail;
};

Related types: GanttBeforeAssignmentChangeDetail, GanttBeforeDependencyChangeDetail, GanttBeforeTaskChangeDetail

type

export type GanttBeforeChangeEventName =
| typeof GANTT_BEFORE_TASK_CHANGE_EVENT
| typeof GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT
| typeof GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT;

type

Kind of dependency mutation that triggered the before-change event.

export type GanttBeforeDependencyChangeAction = 'create' | 'delete' | 'edit' | 'replace';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeDependencyChangeDetail {
readonly action: GanttBeforeDependencyChangeAction;
readonly dependencyId: DependencyId | null;
readonly dependency: DependencyEntity | null;
readonly previousDependency?: DependencyEntity | null;
/** Full proposed dependency set for batch replacements. */
readonly dependencies?: readonly DependencyEntity[];
/** Full previous dependency set for batch replacements. */
readonly previousDependencies?: readonly DependencyEntity[];
}
MemberType / returnRequiredDefaultDescription
actionGanttBeforeDependencyChangeActionYes—
dependencyIdstring | nullYes—
dependencyDependencyEntity | nullYes—
previousDependencyDependencyEntity | null | undefinedNo—
dependenciesreadonly DependencyEntity[] | undefinedNo—Full proposed dependency set for batch replacements.
previousDependenciesreadonly DependencyEntity[] | undefinedNo—Full previous dependency set for batch replacements.

Related types: DependencyEntity, DependencyId, GanttBeforeDependencyChangeAction

type

Kind of task mutation that triggered the before-change event.

export type GanttBeforeTaskChangeAction = 'move' | 'resize' | 'create' | 'edit' | 'progress' | 'split' | 'indent' | 'outdent' | 'delete' | 'convert-to-milestone';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_TASK_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeTaskChangeDetail {
readonly action: GanttBeforeTaskChangeAction;
readonly taskId: TaskId | null;
/** Partial task with proposed values */
readonly changes: Partial<TaskEntity>;
/** Previous values of fields being changed */
readonly previousValues: Partial<TaskEntity>;
/** Source row that will receive the task-row write, when available. */
readonly sourceRow?: DataType;
/** Physical source row index that will receive the mapped write, when available. */
readonly sourceIndex?: number;
/** Proposed flat source-row patch for this task row. */
readonly sourcePatch?: Record<string, unknown>;
/** Previous source values for the keys in `sourcePatch`. */
readonly previousSourceValues?: Record<string, unknown>;
}
MemberType / returnRequiredDefaultDescription
actionGanttBeforeTaskChangeActionYes—
taskIdstring | nullYes—
changesPartial<TaskEntity>Yes—Partial task with proposed values
previousValuesPartial<TaskEntity>Yes—Previous values of fields being changed
sourceRowDataType | undefinedNo—Source row that will receive the task-row write, when available.
sourceIndexnumber | undefinedNo—Physical source row index that will receive the mapped write, when available.
sourcePatchRecord<string, unknown> | undefinedNo—Proposed flat source-row patch for this task row.
previousSourceValuesRecord<string, unknown> | undefinedNo—Previous source values for the keys in sourcePatch.

Related types: GanttBeforeTaskChangeAction, TaskEntity, TaskId

interface

Detail payload for dependency hover/select events.

export interface GanttDependencyInteractionDetail {
/** Dependency id, or `null` when the interaction is cleared. */
readonly dependencyId: DependencyId | null;
/** Full dependency entity, or `null` when cleared. */
readonly dependency: DependencyEntity | null;
}
MemberType / returnRequiredDefaultDescription
dependencyIdstring | nullYes—Dependency id, or null when the interaction is cleared.
dependencyDependencyEntity | nullYes—Full dependency entity, or null when cleared.

Related types: DependencyEntity, DependencyId

type

Typed semantic Gantt entries carried in EventManagerEvent.domainChanges.

export type GanttEventManagerDomainChange =
| EventManagerDomainChange<'gantt-task', GanttTaskDomainChangeDetail>
| EventManagerDomainChange<'gantt-dependency', GanttDependencyDomainChangeDetail>
| EventManagerDomainChange<'gantt-assignment', GanttAssignmentDomainChangeDetail>;

Related types: GanttAssignmentDomainChangeDetail, GanttDependencyDomainChangeDetail, GanttTaskDomainChangeDetail

type

Typed gridedit detail for consumers collecting committed Gantt changes.

export type GanttEventManagerEvent = Omit<EventManagerEvent, 'domainChanges'> & {
readonly domainChanges?: readonly GanttEventManagerDomainChange[];
};

Related types: GanttEventManagerDomainChange

interface

Detail payload for panel resize events.

export interface GanttPanelResizeEventDetail {
/** New panel width in pixels. */
readonly width: number;
}
MemberType / returnRequiredDefaultDescription
widthnumberYes—New panel width in pixels.

interface

Detail payload for Gantt search events.

export interface GanttSearchEventDetail {
/** Free-text query matched against task rows, assignees, dates, status, tags, and costs. */
readonly query: string;
}
MemberType / returnRequiredDefaultDescription
querystringYes—Free-text query matched against task rows, assignees, dates, status, tags, and costs.

interface

Detail payload for the post-create task event.

export interface GanttTaskCreatedEventDetail {
/** Created task id. */
readonly taskId: TaskId;
/** Created task entity. */
readonly task: TaskEntity;
/**
* Whether task-created listeners such as the packaged editor should open a
* follow-up UI for the new task.
*/
readonly openEditor?: boolean;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYes—Created task id.
taskTaskEntityYes—Created task entity.
openEditorboolean | undefinedNo—Whether task-created listeners such as the packaged editor should open a follow-up UI for the new task.

Related types: TaskEntity, TaskId

interface

Detail payload for task edit requests.

export interface GanttTaskEditEventDetail {
/** Task id to edit. */
readonly taskId: TaskId;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYes—Task id to edit.

Related types: TaskId