Skip to content

Gantt Task Editor Dialog

HTMLRevoGridElement (Extended from global)

Section titled “HTMLRevoGridElement (Extended from global)”
interface HTMLRevoGridElement {
ganttTaskEditorDialog?: GanttTaskEditorDialogOptions;
'gantt-task-editor-dialog'?: GanttTaskEditorDialogOptions
}
export function DependencyEditor(;

interface DependencyEditorProps {
readonly direction: 'predecessors' | 'successors';
readonly task: TaskEntity | null;
readonly tasks: readonly TaskEntity[];
readonly drafts: readonly GanttTaskEditorDialogDependencyDraft[];
readonly localeText: GanttTaskEditorDialogLocaleText;
readonly onChange: (drafts: readonly GanttTaskEditorDialogDependencyDraft[]) => void
}

export function FieldControl(;

interface ResourceSelection {
readonly resources: readonly ResourceEntity[];
readonly selectedResourceIds: readonly ResourceId[];
readonly onChange: (resourceIds: readonly ResourceId[]) => void
}

interface FieldControlProps {
readonly field: TaskEditorFieldSchema;
readonly values: TaskEditorFormValues;
readonly localeText: GanttTaskEditorDialogLocaleText;
readonly dateFormatProject?: GanttPluginConfig | null;
readonly dateTimeEnabled?: boolean;
readonly resourceSelection?: ResourceSelection;
readonly onChange: (values: TaskEditorFormValues) => void;
readonly onDateTimeToggle?: (enabled: boolean) => void
}

export type TaskEditorTabId = 'details' | 'advanced' | 'predecessors' | 'successors' | 'assignments';

DETAIL_FIELDS: readonly TaskEditorFieldId[];

ADVANCED_FIELDS: readonly TaskEditorFieldId[];

ASSIGNMENT_FIELDS: readonly TaskEditorFieldId[];

DEFAULT_FIELDS: readonly TaskEditorFieldId[];

TAB_LABELS: {
details: string;
advanced: string;
predecessors: string;
successors: string;
assignments: string;
};

DEPENDENCY_TYPE_OPTIONS: readonly { readonly label: string; readonly value: DependencyType; }[];

export function createTaskEditorDialogLocaleText(
localeText: GanttTaskEditorDialogLocaleTextOptions | undefined,
): GanttTaskEditorDialogLocaleText;

DEFAULT_TASK_EDITOR_DIALOG_LOCALE_TEXT: {
title: string;
description: string;
fallbackTaskTitle: string;
closeLabel: string;
closeButtonText: string;
applyLabel: string;
resetLabel: string;
menuItemName: string;
tabListAriaLabel: string;
readOnlyLabel: string;
noResourcesAvailable: string;
noAssignedResources: string;
assignedResourcesAriaLabel: string;
projectDefaultOption: string;
noConstraintOption: string;
timeToggleLabel: string;
switchOnLabel: string;
switchOffLabel: string;
manualSchedulingOnLabel: string;
manualSchedulingOffLabel: string;
dependencyTargetLabel: { predecessors: string; successors: string; };
dependencyEmptyLabel: { predecessors: string; successors: string; };
dependencySearch: { predecessors: { placeholder: string; ariaLabel: string; empty: string; }; successors: { placeholder: string; ariaLabel: string; empty: string; }; };
resourcesSearch: { placeholder: string; ariaLabel: string; empty: string; };
dependencyTypeLabel: string;
dependencyLagDaysLabel: string;
removeDependencyLabel: (targetLabel: string) => string;
removeDependencyButton: string;
addDependencyButton: { predecessors: string; successors: string; };
tabs: { details: string; advanced: string; predecessors: string; successors: string; assignments: string; };
dependencyTypes: { 'finish-to-start': string; 'start-to-start': string; 'finish-to-finish': string; 'start-to-finish': string; };
fields: Partial<Record<TaskEditorFieldId, string>>;
fieldOptions: Partial<Record<TaskEditorFieldId, readonly TaskEditorFieldOption<string>[]>>;
status: { ready: string; closed: string; changesSaved: string; noChangesToSave: string; readOnlyProject: string; fixValidationErrors: string; saveFailed: string; };
validation: { checkRequiredFields: string; couldNotSave: string; fieldError: (error: TaskEditorSubmitError) => string; resourceNotFound: (resourceId: string) => string; taskCannotDependOnItself: string; predecessorTaskNotFound: (taskId: string) => string; successorTaskNotFound: (taskId: string) => string; dependencyMustIncludeCurrentTask: string; duplicateDependencyLinks: string; };
};

export function GanttTaskEditorDialog(;

interface GanttTaskEditorDialogSubmitContext {
readonly grid: HTMLRevoGridElement;
readonly task: TaskEntity;
readonly values: TaskEditorFormValues;
readonly result: TaskEditorSubmitSuccess;
readonly assignmentResourceIds: readonly ResourceId[];
readonly assignments: readonly AssignmentEntity[];
readonly assignmentsChanged: boolean;
readonly dependencyDrafts: readonly GanttTaskEditorDialogDependencyDraft[];
readonly dependencies: readonly DependencyEntity[];
readonly dependenciesChanged: boolean
}

interface GanttTaskEditorDialogResourcesOptions {
readonly editable?: boolean;
readonly defaultAllocationUnits?: number;
readonly defaultResponsibility?: string
}

interface GanttTaskEditorDialogDependencyDraft {
readonly id?: DependencyId;
readonly predecessorTaskId: TaskId | '';
readonly successorTaskId: TaskId | '';
readonly type: DependencyType;
readonly lagDays: number
}

interface GanttTaskEditorDialogSearchText {
readonly placeholder: string;
readonly ariaLabel: string;
readonly empty: string
}

interface GanttTaskEditorDialogStatusText {
readonly ready: string;
readonly closed: string;
readonly changesSaved: string;
readonly noChangesToSave: string;
readonly readOnlyProject: string;
readonly fixValidationErrors: string;
readonly saveFailed: string
}

interface GanttTaskEditorDialogValidationText {
readonly checkRequiredFields: string;
readonly couldNotSave: string;
readonly fieldError: (error: TaskEditorSubmitError, fieldLabel: string) => string;
readonly resourceNotFound: (resourceId: ResourceId) => string;
readonly taskCannotDependOnItself: string;
readonly predecessorTaskNotFound: (taskId: TaskId) => string;
readonly successorTaskNotFound: (taskId: TaskId) => string;
readonly dependencyMustIncludeCurrentTask: string;
readonly duplicateDependencyLinks: string
}

interface GanttTaskEditorDialogLocaleText {
readonly title: string;
readonly description: string;
readonly fallbackTaskTitle: string;
readonly closeLabel: string;
readonly closeButtonText: string;
readonly applyLabel: string;
readonly resetLabel: string;
readonly menuItemName: string;
readonly tabListAriaLabel: string;
readonly readOnlyLabel: string;
readonly noResourcesAvailable: string;
readonly noAssignedResources: string;
readonly assignedResourcesAriaLabel: string;
readonly projectDefaultOption: string;
readonly noConstraintOption: string;
readonly timeToggleLabel: string;
readonly switchOnLabel: string;
readonly switchOffLabel: string;
readonly manualSchedulingOnLabel: string;
readonly manualSchedulingOffLabel: string;
readonly dependencyTargetLabel: {
readonly predecessors: string;
readonly successors: string;
};
readonly dependencyEmptyLabel: {
readonly predecessors: string;
readonly successors: string;
};
readonly dependencySearch: {
readonly predecessors: GanttTaskEditorDialogSearchText;
readonly successors: GanttTaskEditorDialogSearchText;
};
readonly resourcesSearch: GanttTaskEditorDialogSearchText;
readonly dependencyTypeLabel: string;
readonly dependencyLagDaysLabel: string;
readonly removeDependencyLabel: (targetLabel: string) => string;
readonly removeDependencyButton: string;
readonly addDependencyButton: {
readonly predecessors: string;
readonly successors: string;
};
readonly tabs: Record<TaskEditorTabId, string>;
readonly dependencyTypes: Record<DependencyType, string>;
readonly fields: Partial<Record<TaskEditorFieldId, string>>;
readonly fieldOptions: Partial<Record<TaskEditorFieldId, readonly TaskEditorFieldOption[]>>;
readonly status: GanttTaskEditorDialogStatusText;
readonly validation: GanttTaskEditorDialogValidationText
}

GanttTaskEditorDialogLocaleTextOptions (Extended from gantt-task-editor-dialog.types.ts)

Section titled “GanttTaskEditorDialogLocaleTextOptions (Extended from gantt-task-editor-dialog.types.ts)”
export type GanttTaskEditorDialogLocaleTextOptions = Partial<Omit<
GanttTaskEditorDialogLocaleText,
| 'dependencyTargetLabel'
| 'dependencyEmptyLabel'
| 'dependencySearch'
| 'resourcesSearch'
| 'addDependencyButton'
| 'tabs'
| 'dependencyTypes'
| 'fields'
| 'fieldOptions'
| 'status'
| 'validation'
>> & {
readonly dependencyTargetLabel?: Partial<GanttTaskEditorDialogLocaleText['dependencyTargetLabel']>;
readonly dependencyEmptyLabel?: Partial<GanttTaskEditorDialogLocaleText['dependencyEmptyLabel']>;
readonly dependencySearch?: {
readonly predecessors?: Partial<GanttTaskEditorDialogSearchText>;
readonly successors?: Partial<GanttTaskEditorDialogSearchText>;
};
readonly resourcesSearch?: Partial<GanttTaskEditorDialogSearchText>;
readonly addDependencyButton?: Partial<GanttTaskEditorDialogLocaleText['addDependencyButton']>;
readonly tabs?: Partial<Record<TaskEditorTabId, string>>;
readonly dependencyTypes?: Partial<Record<DependencyType, string>>;
readonly fields?: Partial<Record<TaskEditorFieldId, string>>;
readonly fieldOptions?: Partial<Record<TaskEditorFieldId, readonly TaskEditorFieldOption[]>>;
readonly status?: Partial<GanttTaskEditorDialogStatusText>;
readonly validation?: Partial<GanttTaskEditorDialogValidationText>;
};

interface GanttTaskEditorDialogOptions {
readonly fields?: readonly TaskEditorFieldId[];
readonly localeText?: GanttTaskEditorDialogLocaleTextOptions;
readonly menuItemName?: string;
readonly title?: string;
readonly description?: string;
readonly applyLabel?: string;
readonly resetLabel?: string;
readonly closeLabel?: string;
/**
* Controls the packaged row context-menu entry for opening the task editor.
* Defaults to the Gantt context-menu setting. Set to `false` to remove only
* the editor menu item, or `true` to keep it when `gantt.contextMenu` is
* disabled.
*/
readonly contextMenu?: boolean;
/**
* Opens the dialog immediately after the Gantt plugin creates a task. Defaults
* to `true`. Set to `false` to keep task creation silent. This
* covers task creation from the toolbar, row context menu, and custom
* dispatches of the task-create event.
*/
readonly openOnCreate?: boolean;
/**
* Controls the built-in resource assignment picker. Set to `false` to keep
* the resources field read-only.
*/
readonly resources?: false | GanttTaskEditorDialogResourcesOptions;
/**
* Shows the normalized TaskUpdate JSON preview. Intended for documentation,
* diagnostics, and custom developer tooling; hidden by default for end-user UI.
*/
readonly preview?: boolean;
readonly readOnly?: boolean;
readonly onSubmit?: (context: GanttTaskEditorDialogSubmitContext) => boolean | void | Promise<boolean | void>;
readonly getTask?: (taskId: TaskId, grid: HTMLRevoGridElement) => TaskEntity | null | undefined
}

interface GanttTaskEditorDialogState {
readonly taskId: TaskId | null;
readonly task: TaskEntity | null;
readonly values: TaskEditorFormValues;
readonly status: string
}

export function formatValue(value: unknown): string;

export function formatDateInputValue(value: unknown): string;

export function formatDateTimeInputValue(value: unknown): string;

export function isEditableInputField(field: TaskEditorFieldSchema): boolean;

export function cloneValues(values: TaskEditorFormValues): TaskEditorFormValues;

export function hasActiveConstraint(values: TaskEditorFormValues): boolean;

export function createNormalizedDialogValues(values: TaskEditorFormValues): TaskEditorFormValues;

export function hasTimeGranularity(value: unknown): boolean;

export function createUtcDateTimeValue(value: string): string;

export function createInitialDateTimeFieldIds(
values: TaskEditorFormValues,
fields: readonly TaskEditorFieldSchema[],
): readonly TaskEditorFieldId[];

export function isTaskEntity(model: unknown): model is TaskEntity;

export function getGridTasks(grid: HTMLRevoGridElement): readonly TaskEntity[];

export function createDependencyDrafts(
task: TaskEntity | null,
dependencies: readonly DependencyEntity[],
): readonly GanttTaskEditorDialogDependencyDraft[];

export function areDependencyDraftsEqual(
left: readonly GanttTaskEditorDialogDependencyDraft[],
right: readonly GanttTaskEditorDialogDependencyDraft[],
): boolean;

export function normalizeDependencyLagDaysInput(value: unknown): number;

export function getFieldsForTab(
tab: TaskEditorTabId,
fields: readonly TaskEditorFieldSchema[],
): readonly TaskEditorFieldSchema[];

export function areResourceIdsEqual(left: readonly ResourceId[], right: readonly ResourceId[]): boolean;

export function createSelectedResourceIds(
task: TaskEntity | null,
assignments: readonly AssignmentEntity[],
): readonly ResourceId[];

export function createErrors(
errors: readonly TaskEditorSubmitError[],
fields: readonly TaskEditorFieldSchema[],
localeText: GanttTaskEditorDialogLocaleText,
): Map<string, string>;

export function shouldShowStatusMessage(status: string, statusText: GanttTaskEditorDialogStatusText): boolean;

export function compareTextAscending(left: string, right: string): number;

export function includesSearchText(value: string, searchText: string): boolean;

export function getFieldLabel(
field: TaskEditorFieldSchema,
localeText: GanttTaskEditorDialogLocaleText,
): string;

export function getSortedFieldOptions(
field: TaskEditorFieldSchema,
localeText: GanttTaskEditorDialogLocaleText,
): readonly;

EMPTY_RESOURCES: readonly ResourceEntity[];

EMPTY_ASSIGNMENTS: readonly AssignmentEntity[];

EMPTY_DEPENDENCIES: readonly DependencyEntity[];

  • Optional GanttPlugin: Uses Gantt task metadata, resource assignments, and read-only state when present.
  • Auto-installed ContextMenuPlugin: Adds the Edit task action to the row context menu.
ganttTaskEditorDialogDependencies: PluginDependency[];

class GanttTaskEditorDialogPlugin {
openTask(taskId: TaskId | null): void;
closeTaskEditor(): void;
destroy(): void;
}

export function ResourcePicker(;

interface ResourcePickerProps {
readonly resources: readonly ResourceEntity[];
readonly selectedResourceIds: readonly ResourceId[];
readonly localeText: GanttTaskEditorDialogLocaleText;
readonly onChange: (resourceIds: readonly ResourceId[]) => void
}

export function TaskEditorField(;

interface TaskEditorFieldProps {
readonly field: TaskEditorFieldSchema;
readonly values: TaskEditorFormValues;
readonly errors: ReadonlyMap<string, string>;
readonly localeText: GanttTaskEditorDialogLocaleText;
readonly dateFormatProject?: GanttPluginConfig | null;
readonly dateTimeEnabled?: boolean;
readonly resourceSelection?: ResourceSelection;
readonly onChange: (values: TaskEditorFormValues) => void;
readonly onDateTimeToggle?: (fieldId: TaskEditorFieldId, enabled: boolean) => void
}

export function TaskEditorTabs(;

interface TaskEditorTabsProps {
readonly activeTab: TaskEditorTabId;
readonly tabs: readonly TaskEditorTabId[];
readonly localeText: GanttTaskEditorDialogLocaleText;
readonly onChange: (tab: TaskEditorTabId) => void
}