Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/assets/option/en/common/gantt/task-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,9 @@ ${prefix} minWidth(number)
The minimum width of the task bar creation button.

Optional

${prefix} clip(boolean)

Whether to crop out the part that overflows the taskBar, the default is true

Optional
6 changes: 6 additions & 0 deletions docs/assets/option/zh/common/gantt/task-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,9 @@ ${prefix} minWidth(number)
任务条创建按钮的最小宽度

非必填

${prefix} clip(boolean)

是否裁剪掉溢出 taskBar 的部分,默认为 true

非必填
1 change: 1 addition & 0 deletions packages/vtable-gantt/src/Gantt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class Gantt extends EventTarget {
pixelRatio: number;
tasksShowMode: TasksShowMode;
projectSubTasksExpandable: boolean;
taskBarClip: boolean;

startDateField: string;
endDateField: string;
Expand Down
1 change: 1 addition & 0 deletions packages/vtable-gantt/src/gantt-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export function initOptions(gantt: Gantt) {
gantt.parsedOptions.startDateField = options.taskBar?.startDateField ?? 'startDate';
gantt.parsedOptions.endDateField = options.taskBar?.endDateField ?? 'endDate';
gantt.parsedOptions.progressField = options.taskBar?.progressField ?? 'progress';
gantt.parsedOptions.taskBarClip = options?.taskBar?.clip ?? true;
gantt.parsedOptions.projectSubTasksExpandable = options?.projectSubTasksExpandable ?? true;
// gantt.parsedOptions.minDate = options?.minDate
// ? gantt.parsedOptions.timeScaleIncludeHour
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-gantt/src/scenegraph/task-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export class TaskBar {
cornerRadius: isMilestone
? this._scene._gantt.parsedOptions.taskBarMilestoneStyle.cornerRadius
: taskBarStyle.cornerRadius,
clip: true
clip: this._scene._gantt.parsedOptions.taskBarClip
});
barGroup.name = 'task-bar-group';
barGroupBox.appendChild(barGroup);
Expand Down
2 changes: 2 additions & 0 deletions packages/vtable-gantt/src/ts-types/gantt-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ export interface GanttConstructorOptions {
selectedBarStyle?: ITaskBarSelectedStyle;
/** 任务条是否可选择,默认为true */
selectable?: boolean;
/** 任务条是否裁剪溢出部分 */
clip?: boolean;
/** 任务条右键菜单 */
menu?: {
/** 右键菜单。代替原来的option.contextmenu */
Expand Down