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({
direction,
task,
tasks,
drafts,
localeText,
onChange,
}: DependencyEditorProps);

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
}

Selects a focused dialog adapter from the shared task-field editor kind.

export function FieldControl(props: FieldControlProps);

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

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

export function resolveTaskEditorTabs(
options: GanttTaskEditorTabsOptions | undefined,
localeText: GanttTaskEditorDialogLocaleText,
legacyFields: readonly TaskEditorFieldId[],
): readonly ResolvedTaskEditorTab[];

export function TaskEditorDomRendererHost({
renderer,
context,
className,
}: {
readonly renderer: GanttTaskEditorDomRenderer;
readonly context: GanttTaskEditorRendererContext;
readonly className?: string;
});

interface ResolvedTaskEditorTab {
readonly id: string;
readonly title: string;
readonly builtin: TaskEditorTabId | null;
readonly fields: readonly TaskEditorFieldId[];
readonly renderer?: GanttTaskEditorDomRenderer
}

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

DETAIL_FIELDS: readonly TaskEditorFieldId[];

ADVANCED_FIELDS: readonly TaskEditorFieldId[];

ASSIGNMENT_FIELDS: readonly TaskEditorFieldId[];

NOTES_FIELDS: readonly TaskEditorFieldId[];

DEFAULT_FIELDS: readonly TaskEditorFieldId[];

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

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

export function createTaskEditorDialogLocaleText(
localeText: GanttTaskEditorDialogLocaleTextOptions | undefined,
inheritedLocaleText?: GanttTaskEditorDialogLocaleTextOptions,
): 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;
colorPaletteAriaLabel: string;
defaultColorOption: 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; notes: 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({
grid,
task,
tasks,
resources,
assignments,
dependencies,
project,
allowedTaskTypes,
calendars,
options,
open,
status,
onClose,
onReset,
onSubmit,
}: GanttTaskEditorDialogProps);

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;
readonly customValues: Readonly<Record<string, unknown>>
}

interface GanttTaskEditorDraftState {
readonly values: TaskEditorFormValues;
readonly resourceIds: readonly ResourceId[];
readonly dependencyDrafts: readonly GanttTaskEditorDialogDependencyDraft[];
readonly customValues: Readonly<Record<string, unknown>>;
readonly validationErrors: readonly string[];
readonly dirty: boolean
}

interface GanttTaskEditorDraftController {
getState(): GanttTaskEditorDraftState;
setValues(values: Partial<TaskEditorFormValues>): void;
setResourceIds(resourceIds: readonly ResourceId[]): void;
setDependencyDrafts(drafts: readonly GanttTaskEditorDialogDependencyDraft[]): void;
setCustomValue(key: string, value: unknown): void;
setValidationErrors(errors: readonly string[]): void;
reset(): void;
close(): void;
submit(): void
}

interface GanttTaskEditorRendererContext {
readonly grid: HTMLRevoGridElement;
readonly task: TaskEntity | null;
readonly project: ProjectSnapshot | null;
readonly open: boolean;
readonly status: string;
readonly state: GanttTaskEditorDraftState;
readonly controller: GanttTaskEditorDraftController
}

interface GanttTaskEditorRendererLifecycle {
update?(context: GanttTaskEditorRendererContext): void;
destroy?(): void
}

interface GanttTaskEditorDomRenderer {
mount(container: HTMLElement, context: GanttTaskEditorRendererContext): void | GanttTaskEditorRendererLifecycle
}

interface GanttTaskEditorTabOptions {
readonly title?: string;
readonly hidden?: boolean;
readonly fields?: readonly TaskEditorFieldId[];
readonly renderer?: GanttTaskEditorDomRenderer
}

interface GanttTaskEditorTabsOptions {
readonly items?: Readonly<Record<string, false | GanttTaskEditorTabOptions>>;
readonly order?: readonly string[]
}

export type GanttTaskEditorControlId =
| 'header'
| 'title'
| 'description'
| 'close'
| 'tabs'
| 'validation'
| 'preview'
| 'reset'
| 'apply'
| 'footer';

interface GanttTaskEditorDialogCustomization {
readonly tabs?: GanttTaskEditorTabsOptions;
readonly controls?: Partial<Record<GanttTaskEditorControlId, boolean>>;
readonly editor?: GanttTaskEditorDomRenderer
}

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 colorPaletteAriaLabel: string;
readonly defaultColorOption: 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;
/**
* Configures task colors in the packaged editor. Omit to inherit the Gantt
* context-menu palette; set to `false` to remove the editor field.
*/
readonly colorPalette?: GanttColorPaletteConfig | false;
/**
* 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;
readonly customization?: GanttTaskEditorDialogCustomization
}

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 { readonly label: string; readonly value: string }[];

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 action to the row context menu.
ganttTaskEditorDialogDependencies: PluginDependency[];

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

export function getResourceInitials(name: string): string;

export function ResourcePicker({
resources,
selectedResourceIds,
localeText,
onChange,
}: ResourcePickerProps);

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

export function TaskEditorField({
field,
values,
errors,
localeText,
dateFormatProject,
dateTimeEnabled,
resourceSelection,
colorPalette,
onChange,
onDateTimeToggle,
}: TaskEditorFieldProps);

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 colorPalette?: ResolvedGanttColorPalette | null;
readonly onChange: (values: TaskEditorFormValues) => void;
readonly onDateTimeToggle?: (fieldId: TaskEditorFieldId, enabled: boolean) => void
}

export function TaskEditorTabs({
activeTab,
tabs,
ariaLabel,
onChange,
}: TaskEditorTabsProps);

interface TaskEditorTabsProps {
readonly activeTab: string;
readonly tabs: readonly { readonly id: string; readonly title: string }[];
readonly ariaLabel: string;
readonly onChange: (tab: string) => void
}

export function ColorFieldControl({
field,
values,
localeText,
colorPalette,
onChange,
}: FieldControlProps);

export function DateFieldControl({
field,
values,
localeText,
dateFormatProject,
dateTimeEnabled,
onChange,
onDateTimeToggle,
}: FieldControlProps);

export function InputFieldControl({ field, values, onChange }: FieldControlProps);

export function LabelsFieldControl({ field, values, localeText, resourceSelection }: FieldControlProps);

export function SelectFieldControl({ field, values, localeText, onChange }: FieldControlProps);

export function SwitchFieldControl({ field, values, localeText, onChange }: FieldControlProps);

export function TagsFieldControl({ field, values, onChange }: FieldControlProps);

export function TextareaFieldControl({ field, values, onChange }: FieldControlProps);