API reference: @salmonui/gantt
GanttPropsinterface
import type { GanttProps } from '@salmonui/gantt';interface GanttProps<Row = Record<string, unknown>> extends Partial<GanttGridProps<Row>> {
readonly data: readonly Row[] | DataSource<Row>;
readonly taskFields?: GanttTaskFields;
readonly columns?: readonly (GanttColumnPreset | DataGridColumn<Row>)[];
readonly treeColumn?: string;
readonly treeFilterMode?: 'ancestors' | 'descendants' | 'both' | 'none';
readonly defaultExpanded?: 'all' | 'none' | boolean;
readonly hasChildrenField?: string;
readonly loadChildren?: (ctx: {
readonly rowId: RowId;
readonly row: Row;
readonly signal: AbortSignal;
}) => readonly Row[] | Promise<readonly Row[]>;
readonly taskMode?: TaskMode;
readonly autoSchedule?: boolean;
readonly projectStart?: GanttDateInput | null;
readonly projectEnd?: GanttDateInput | null;
readonly workingTime?: GanttWorkingTime;
readonly holidays?: readonly GanttHoliday[];
readonly calendars?: readonly GanttCalendar[];
readonly projectCalendar?: string;
readonly durationUnit?: DurationUnit;
readonly workUnit?: WorkUnit;
readonly taskType?: TaskType;
readonly dependencyTypes?: readonly DependencyType[];
readonly validateDependencies?: boolean;
readonly validateManualTasks?: boolean;
readonly parentDependencies?: boolean;
readonly dependencyLag?: {
readonly normalizeOnLoad?: boolean;
readonly updateOnTaskbarEdit?: boolean;
};
readonly unscheduledTasks?: boolean;
readonly criticalPath?: boolean;
readonly timeZone?: string;
readonly locale?: string;
readonly localeText?: GanttLocaleText;
readonly dateFormat?: Intl.DateTimeFormatOptions | string;
readonly wbs?: boolean | {
readonly autoUpdate?: boolean;
};
readonly resources?: readonly GanttResource[];
readonly resourceFields?: GanttResourceFields;
readonly resourceView?: boolean;
readonly overAllocation?: boolean;
readonly multiTaskbar?: boolean;
readonly taskbarOverlap?: boolean;
readonly timeline?: GanttTimeline;
readonly zoom?: number;
readonly defaultZoom?: number;
readonly zoomLevels?: readonly GanttZoomLevel[];
readonly onZoomChange?: (event: GanttZoomChangeEvent) => void;
readonly highlightWeekends?: boolean;
readonly markers?: readonly GanttMarker[];
readonly rowHeight?: number;
readonly getRowHeight?: (row: Row) => number;
readonly taskbarHeight?: number;
readonly baselines?: boolean;
readonly labels?: {
readonly start?: GanttLabel<Row>;
readonly end?: GanttLabel<Row>;
readonly inside?: GanttLabel<Row>;
};
readonly tooltip?: boolean | GanttTooltipOptions<Row>;
readonly onBeforeTooltipOpen?: (event: GanttTooltipOpenEvent<Row>) => void;
readonly renderTaskbar?: (ctx: GanttTaskbarContext<Row>) => ReactNode;
readonly renderParentTaskbar?: (ctx: GanttTaskbarContext<Row>) => ReactNode;
readonly renderMilestone?: (ctx: GanttTaskbarContext<Row>) => ReactNode;
readonly renderBaseline?: (ctx: GanttTaskbarContext<Row>) => ReactNode;
readonly getTaskbarProps?: (ctx: GanttTaskbarContext<Row>) => GanttTaskbarProps | undefined;
readonly connectorWidth?: number;
readonly inlineNotes?: boolean;
readonly focusTaskOnSelect?: boolean;
readonly splitter?: GanttSplitter;
readonly panes?: 'both' | 'grid' | 'chart';
readonly adaptive?: boolean | GanttAdaptive;
readonly readOnly?: boolean;
readonly editing?: boolean | GanttEditing<Row>;
readonly undo?: boolean | GanttUndo;
readonly toolbar?: readonly GanttToolbarItem[];
readonly onToolbarItemClick?: (event: GanttToolbarItemClickEvent) => void;
readonly contextMenu?: boolean | readonly GanttContextMenuItem[];
readonly onBeforeContextMenuOpen?: (event: GanttContextMenuOpenEvent<Row>) => void;
readonly onContextMenuItemClick?: (event: GanttContextMenuItemClickEvent<Row>) => void;
readonly onTaskbarEditStart?: (event: GanttTaskbarEditEvent<Row>) => void;
readonly onTaskbarEdit?: (event: GanttTaskbarEditEvent<Row>) => void;
readonly onBeforeTaskbarEditEnd?: (event: GanttTaskbarEditEvent<Row>) => void;
readonly onTaskbarEditEnd?: (event: GanttTaskbarEditEvent<Row>) => void;
readonly onBeforeDependencyChange?: (event: GanttDependencyChangeEvent<Row>) => void;
readonly onDependencyChange?: (event: GanttDependencyChangeEvent<Row>) => void;
readonly onScheduleConflict?: (event: GanttScheduleConflictEvent<Row>) => void;
readonly onBeforeTaskChange?: (event: GanttTaskChangeEvent<Row>) => void;
readonly onTaskChange?: (event: GanttTaskChangeEvent<Row>) => void;
readonly onTaskbarClick?: (event: GanttTaskbarClickEvent<Row>) => void;
readonly onChartPointerMove?: (event: GanttChartPointerEvent<Row>) => void;
readonly onSplitterResizeStart?: (event: GanttSplitterEvent) => void;
readonly onSplitterResize?: (event: GanttSplitterEvent) => void;
readonly onSplitterResizeEnd?: (event: GanttSplitterEvent) => void;
readonly onBeforeDialogOpen?: (event: GanttDialogOpenEvent<Row>) => void;
readonly onBeforeExport?: (event: GanttExportEvent) => void;
readonly onExport?: (event: GanttExportEvent) => void;
readonly onError?: (event: GanttErrorEvent) => void;
readonly onReady?: (api: GanttApi<Row>) => void;
readonly onDataChange?: (rows: readonly Row[], event: GanttTaskChangeEvent<Row>) => void;
readonly exportWriters?: GanttExportWriters;
readonly height?: number | string;
readonly width?: number | string;
readonly dir?: 'ltr' | 'rtl' | 'auto';
readonly className?: string;
readonly style?: CSSProperties;
readonly id?: string;
readonly 'aria-label'?: string;
readonly ref?: Ref<GanttApi<Row>>;
}
| Name | Signature | Description |
|---|---|---|
data | readonly data: readonly Row[] | DataSource<Row>; | Tasks (nested |
taskFieldsoptional | readonly taskFields?: GanttTaskFields; | |
columnsoptional | readonly columns?: readonly (GanttColumnPreset | DataGridColumn<Row>)[]; | Grid pane columns: Data Grid columns or task column presets. Default title, start, end, duration, progress. |
treeColumnoptional | readonly treeColumn?: string; | Field of the tree column. Default the title column. |
treeFilterModeoptional | readonly treeFilterMode?: 'ancestors' | 'descendants' | 'both' | 'none'; | Rows a filter or search keeps around the matches (Data Grid |
defaultExpandedoptional | readonly defaultExpanded?: 'all' | 'none' | boolean; |
|
hasChildrenFieldoptional | readonly hasChildrenField?: string; | Load children on demand: rows with this field true have children loaded on expand. |
loadChildrenoptional | readonly loadChildren?: (ctx: {
readonly rowId: RowId;
readonly row: Row;
readonly signal: AbortSignal;
}) => readonly Row[] | Promise<readonly Row[]>; | |
taskModeoptional | readonly taskMode?: TaskMode; | |
autoScheduleoptional | readonly autoSchedule?: boolean; | |
projectStartoptional | readonly projectStart?: GanttDateInput | null; | |
projectEndoptional | readonly projectEnd?: GanttDateInput | null; | |
workingTimeoptional | readonly workingTime?: GanttWorkingTime; | |
holidaysoptional | readonly holidays?: readonly GanttHoliday[]; | |
calendarsoptional | readonly calendars?: readonly GanttCalendar[]; | |
projectCalendaroptional | readonly projectCalendar?: string; | |
durationUnitoptional | readonly durationUnit?: DurationUnit; | |
workUnitoptional | readonly workUnit?: WorkUnit; | |
taskTypeoptional | readonly taskType?: TaskType; | |
dependencyTypesoptional | readonly dependencyTypes?: readonly DependencyType[]; | |
validateDependenciesoptional | readonly validateDependencies?: boolean; | |
validateManualTasksoptional | readonly validateManualTasks?: boolean; | |
parentDependenciesoptional | readonly parentDependencies?: boolean; | |
dependencyLagoptional | readonly dependencyLag?: {
readonly normalizeOnLoad?: boolean;
readonly updateOnTaskbarEdit?: boolean;
}; | |
unscheduledTasksoptional | readonly unscheduledTasks?: boolean; | |
criticalPathoptional | readonly criticalPath?: boolean; | |
timeZoneoptional | readonly timeZone?: string; | IANA zone the task dates are wall times in. Set it for SSR. |
localeoptional | readonly locale?: string; | |
localeTextoptional | readonly localeText?: GanttLocaleText; | |
dateFormatoptional | readonly dateFormat?: Intl.DateTimeFormatOptions | string; | Column, label and tooltip date format: |
wbsoptional | readonly wbs?: boolean | {
readonly autoUpdate?: boolean;
}; | |
resourcesoptional | readonly resources?: readonly GanttResource[]; | |
resourceFieldsoptional | readonly resourceFields?: GanttResourceFields; | |
resourceViewoptional | readonly resourceView?: boolean; | |
overAllocationoptional | readonly overAllocation?: boolean; | |
multiTaskbaroptional | readonly multiTaskbar?: boolean; | |
taskbarOverlapoptional | readonly taskbarOverlap?: boolean; | |
timelineoptional | readonly timeline?: GanttTimeline; | |
zoomoptional | readonly zoom?: number; | Zoom level index into |
defaultZoomoptional | readonly defaultZoom?: number; | |
zoomLevelsoptional | readonly zoomLevels?: readonly GanttZoomLevel[]; | |
onZoomChangeoptional | readonly onZoomChange?: (event: GanttZoomChangeEvent) => void; | |
highlightWeekendsoptional | readonly highlightWeekends?: boolean; | |
markersoptional | readonly markers?: readonly GanttMarker[]; | |
rowHeightoptional | readonly rowHeight?: number; | |
getRowHeightoptional | readonly getRowHeight?: (row: Row) => number; | Per-row height (taller rows for baselines or lanes), shared with the grid through the row-height extension point. |
taskbarHeightoptional | readonly taskbarHeight?: number; | |
baselinesoptional | readonly baselines?: boolean; | |
labelsoptional | readonly labels?: {
readonly start?: GanttLabel<Row>;
readonly end?: GanttLabel<Row>;
readonly inside?: GanttLabel<Row>;
}; | |
tooltipoptional | readonly tooltip?: boolean | GanttTooltipOptions<Row>; | |
onBeforeTooltipOpenoptional | readonly onBeforeTooltipOpen?: (event: GanttTooltipOpenEvent<Row>) => void; | |
renderTaskbaroptional | readonly renderTaskbar?: (ctx: GanttTaskbarContext<Row>) => ReactNode; | |
renderParentTaskbaroptional | readonly renderParentTaskbar?: (ctx: GanttTaskbarContext<Row>) => ReactNode; | |
renderMilestoneoptional | readonly renderMilestone?: (ctx: GanttTaskbarContext<Row>) => ReactNode; | |
renderBaselineoptional | readonly renderBaseline?: (ctx: GanttTaskbarContext<Row>) => ReactNode; | |
getTaskbarPropsoptional | readonly getTaskbarProps?: (ctx: GanttTaskbarContext<Row>) => GanttTaskbarProps | undefined; | |
connectorWidthoptional | readonly connectorWidth?: number; | |
inlineNotesoptional | readonly inlineNotes?: boolean; | |
focusTaskOnSelectoptional | readonly focusTaskOnSelect?: boolean; | |
splitteroptional | readonly splitter?: GanttSplitter; | |
panesoptional | readonly panes?: 'both' | 'grid' | 'chart'; | |
adaptiveoptional | readonly adaptive?: boolean | GanttAdaptive; | Adaptive UI: one pane at a time with a pane switch and full-screen dialogs; |
readOnlyoptional | readonly readOnly?: boolean; | |
editingoptional | readonly editing?: boolean | GanttEditing<Row>; | |
undooptional | readonly undo?: boolean | GanttUndo; | |
toolbaroptional | readonly toolbar?: readonly GanttToolbarItem[]; | |
onToolbarItemClickoptional | readonly onToolbarItemClick?: (event: GanttToolbarItemClickEvent) => void; | |
contextMenuoptional | readonly contextMenu?: boolean | readonly GanttContextMenuItem[]; | Context menu of both panes: Gantt items, Data Grid items and custom items; |
onBeforeContextMenuOpenoptional | readonly onBeforeContextMenuOpen?: (event: GanttContextMenuOpenEvent<Row>) => void; | |
onContextMenuItemClickoptional | readonly onContextMenuItemClick?: (event: GanttContextMenuItemClickEvent<Row>) => void; | |
onTaskbarEditStartoptional | readonly onTaskbarEditStart?: (event: GanttTaskbarEditEvent<Row>) => void; | |
onTaskbarEditoptional | readonly onTaskbarEdit?: (event: GanttTaskbarEditEvent<Row>) => void; | At most once per animation frame. |
onBeforeTaskbarEditEndoptional | readonly onBeforeTaskbarEditEnd?: (event: GanttTaskbarEditEvent<Row>) => void; | |
onTaskbarEditEndoptional | readonly onTaskbarEditEnd?: (event: GanttTaskbarEditEvent<Row>) => void; | |
onBeforeDependencyChangeoptional | readonly onBeforeDependencyChange?: (event: GanttDependencyChangeEvent<Row>) => void; | |
onDependencyChangeoptional | readonly onDependencyChange?: (event: GanttDependencyChangeEvent<Row>) => void; | |
onScheduleConflictoptional | readonly onScheduleConflict?: (event: GanttScheduleConflictEvent<Row>) => void; | |
onBeforeTaskChangeoptional | readonly onBeforeTaskChange?: (event: GanttTaskChangeEvent<Row>) => void; | |
onTaskChangeoptional | readonly onTaskChange?: (event: GanttTaskChangeEvent<Row>) => void; | |
onTaskbarClickoptional | readonly onTaskbarClick?: (event: GanttTaskbarClickEvent<Row>) => void; | |
onChartPointerMoveoptional | readonly onChartPointerMove?: (event: GanttChartPointerEvent<Row>) => void; | At most once per animation frame. |
onSplitterResizeStartoptional | readonly onSplitterResizeStart?: (event: GanttSplitterEvent) => void; | |
onSplitterResizeoptional | readonly onSplitterResize?: (event: GanttSplitterEvent) => void; | |
onSplitterResizeEndoptional | readonly onSplitterResizeEnd?: (event: GanttSplitterEvent) => void; | |
onBeforeDialogOpenoptional | readonly onBeforeDialogOpen?: (event: GanttDialogOpenEvent<Row>) => void; | |
onBeforeExportoptional | readonly onBeforeExport?: (event: GanttExportEvent) => void; | |
onExportoptional | readonly onExport?: (event: GanttExportEvent) => void; | |
onErroroptional | readonly onError?: (event: GanttErrorEvent) => void; | |
onReadyoptional | readonly onReady?: (api: GanttApi<Row>) => void; | |
onDataChangeoptional | readonly onDataChange?: (rows: readonly Row[], event: GanttTaskChangeEvent<Row>) => void; | Writes the changed rows back (local |
exportWritersoptional | readonly exportWriters?: GanttExportWriters; | |
heightoptional | readonly height?: number | string; | |
widthoptional | readonly width?: number | string; | |
diroptional | readonly dir?: 'ltr' | 'rtl' | 'auto'; | |
classNameoptional | readonly className?: string; | |
styleoptional | readonly style?: CSSProperties; | |
idoptional | readonly id?: string; | |
aria-labeloptional | readonly 'aria-label'?: string; | |
refoptional | readonly ref?: Ref<GanttApi<Row>>; | |
columnMenuoptionalinherited | columnMenu?: boolean | readonly (DataGridMenuItem | DataGridColumnMenuItemId)[]; | Column menu; an array lists the items in order (built-in ids or custom items). |
columnChooseroptionalinherited | columnChooser?: boolean | DataGridColumnChooser<Row>; | |
renderContextMenuoptionalinherited | renderContextMenu?: ((ctx: DataGridContextMenuContext) => ReactNode); | |
onColumnResizeStartoptionalinherited | onColumnResizeStart?: ((event: DataGridColumnResizeEvent) => void); | |
onColumnResizeoptionalinherited | onColumnResize?: ((event: DataGridColumnResizeEvent) => void); | |
onColumnResizeEndoptionalinherited | onColumnResizeEnd?: ((event: DataGridColumnResizeEvent) => void); | |
onBeforeEditStartoptionalinherited | onBeforeEditStart?: ((event: DataGridEditStartEvent<Row>) => void); | |
onBeforeCellValueChangeoptionalinherited | onBeforeCellValueChange?: ((event: DataGridCellValueChangeEvent) => void); | |
onBeforeSaveoptionalinherited | onBeforeSave?: ((event: DataGridSaveEvent<Row>) => void); | |
onSaveoptionalinherited | onSave?: ((event: DataGridSaveEvent<Row>) => void); | |
sortingoptionalinherited | sorting?: boolean | DataGridSorting; |
|
filteringoptionalinherited | filtering?: boolean | DataGridFiltering; |
|
searchoptionalinherited | search?: boolean | DataGridSearch; |
|
onBeforeSortChangeoptionalinherited | onBeforeSortChange?: ((event: DataGridSortChangeEvent) => void); | |
onSortChangeoptionalinherited | onSortChange?: ((event: DataGridSortChangeEvent) => void); | |
onBeforeFilterChangeoptionalinherited | onBeforeFilterChange?: ((event: DataGridFilterChangeEvent) => void); | |
onFilterChangeoptionalinherited | onFilterChange?: ((event: DataGridFilterChangeEvent) => void); | |
onBeforeSearchChangeoptionalinherited | onBeforeSearchChange?: ((event: DataGridSearchChangeEvent) => void); | |
onSearchChangeoptionalinherited | onSearchChange?: ((event: DataGridSearchChangeEvent) => void); | |
rowDragoptionalinherited | rowDrag?: boolean | DataGridRowDrag; | Row drag and drop with a drag handle column; |
onRowDragStartoptionalinherited | onRowDragStart?: ((event: DataGridRowDragEvent<Row>) => void); | Cancel with |
onRowDragoptionalinherited | onRowDrag?: ((event: DataGridRowDragEvent<Row>) => void); | Once per animation frame while dragging. |
onBeforeRowDropoptionalinherited | onBeforeRowDrop?: ((event: DataGridRowDragEvent<Row>) => void); | Cancel with |
onRowDropoptionalinherited | onRowDrop?: ((event: DataGridRowDragEvent<Row>) => void); | |
loadingIndicatoroptionalinherited | loadingIndicator?: "skeleton" | "spinner"; | Built-in loading indicator. Default |
onRowClickoptionalinherited | onRowClick?: ((event: DataGridRowClickEvent<Row>) => void); | A data row was clicked. |
onRowDoubleClickoptionalinherited | onRowDoubleClick?: ((event: DataGridRowClickEvent<Row>) => void); | A data row was double-clicked. |
onCellClickoptionalinherited | onCellClick?: ((event: DataGridCellClickEvent<Row>) => void); | A cell of a data row was clicked; fires before |
onBeforeTreeToggleoptionalinherited | onBeforeTreeToggle?: ((event: DataGridTreeToggleEvent<Row>) => void); | |
onTreeToggleoptionalinherited | onTreeToggle?: ((event: DataGridTreeToggleEvent<Row>) => void); | |
featuresoptionalinherited | features?: readonly DataGridFeature[]; | Salmon. Render features to use
synchronously, from |
currencyoptionalinherited | currency?: string; | |
virtualizationoptionalinherited | virtualization?: boolean | DataGridVirtualization; | Row and column virtualization; |
initialRowsoptionalinherited | initialRows?: number; | Rows in the deterministic server/initial range. Default 20. |
textWrapoptionalinherited | textWrap?: DataGridTextWrap; | |
gridLinesoptionalinherited | gridLines?: DataGridLines; | |
overflowoptionalinherited | overflow?: DataGridOverflow; | Default text overflow of every column. Default |
highlightOnHoveroptionalinherited | highlightOnHover?: boolean; | Row hover highlight. Default true. |
stripedoptionalinherited | striped?: boolean; | Alternate row shading. Default true. |
resizableoptionalinherited | resizable?: boolean; | Pointer and keyboard column resize. Default false; column |
resizeModeoptionalinherited | resizeMode?: "auto" | "normal"; | Column fit. |
reorderableoptionalinherited | reorderable?: boolean; | Pointer and keyboard column reorder. Default false; column |
onBeforeColumnVisibilityChangeoptionalinherited | onBeforeColumnVisibilityChange?: ((event: DataGridColumnVisibilityChangeEvent) => void); | |
onColumnVisibilityChangeoptionalinherited | onColumnVisibilityChange?: ((event: DataGridColumnVisibilityChangeEvent) => void); | |
onBeforeColumnReorderoptionalinherited | onBeforeColumnReorder?: ((event: DataGridColumnReorderEvent) => void); | |
onColumnReorderoptionalinherited | onColumnReorder?: ((event: DataGridColumnReorderEvent) => void); | |
renderEmptyoptionalinherited | renderEmpty?: ((ctx: DataGridEmptyContext) => ReactNode); | |
onViewChangeoptionalinherited | onViewChange?: ((event: DataGridViewChangeEvent) => void); | Once per committed change of the displayed rows; never on scroll, focus, selection, or expansion. |
getRowPropsoptionalinherited | getRowProps?: ((row: Row, rowIndex: number, ctx: { readonly tree?: DataGridTreeContext; }) => DataGridElementProps | undefined); | Called for rendered rows only; |
rowClassNameoptionalinherited | rowClassName?: ((row: Row, rowIndex: number) => string | undefined); | |
getCellPropsoptionalinherited | getCellProps?: ((ctx: DataGridCellContext<Row>) => DataGridElementProps | undefined); | Called for rendered cells only. |
iconsoptionalinherited | icons?: Partial<Record<DataGridIconName, ReactNode>>; | Icon overrides by name:
a node replaces the built-in SVG icon, |
selectionoptionalinherited | selection?: boolean | DataGridSelection; | Selection. On by default: single row selection. |
onBeforeSelectionChangeoptionalinherited | onBeforeSelectionChange?: ((event: DataGridSelectionChangeEvent<Row>) => void); | Cancel with |
onSelectionChangeoptionalinherited | onSelectionChange?: ((event: DataGridSelectionChangeEvent<Row>) => void); | |
keyBindingsoptionalinherited | keyBindings?: Readonly<Record<string, readonly string[]>>; | Replaces the combos of keyboard commands ( |
onKeyDownoptionalinherited | onKeyDown?: ((ctx: DataGridKeyDownContext) => void); | Called for every key pressed in the grid before the built-in binding runs. |