UNPKG

jordium-gantt-vue3

Version:

A Vue 3 Gantt chart component for project management, task scheduling, resource planning, calendar, resource usage and timeline visualization.

125 lines (124 loc) 4.63 kB
import { WorkingHoursConfig, CalendarScale, CalendarSelectionDraft, CalendarSelectionRange, CalendarTaskMovePayload } from '../../models/types/CalendarTypes'; import { Task } from '../../models/classes/Task'; import { Resource } from '../../models/classes/Resource'; interface Props { tasks: Task[]; resources?: Resource[]; scale?: CalendarScale; defaultScale?: CalendarScale; currentDate?: Date | string; selectedResourceId?: string | number | null; workingHours?: WorkingHoursConfig; selectionMinuteStep?: number; disabled?: boolean; locale?: 'zh-CN' | 'en-US'; onBeforeSelect?: (range: CalendarSelectionDraft) => boolean | Promise<boolean>; onBeforeResourceChange?: (nextId: string | number | null, prevId: string | number | null) => boolean | Promise<boolean>; onBeforeViewChange?: (next: CalendarScale, prev: CalendarScale) => boolean | Promise<boolean>; onSelectionComplete?: (range: CalendarSelectionRange) => void; onResourceChange?: (nextId: string | number | null, prevId: string | number | null) => void; /** v1.13.0 点击已创建任务卡片时触发 */ onTaskClick?: (task: Task, event: MouseEvent) => void; /** v1.13.0 拖拽任务卡片松开后触发 */ onTaskMove?: (payload: CalendarTaskMovePayload) => void; /** v1.13.0 日/周视图全天任务行的标签文字 */ allDayLabel?: string; /** v1.13.0 日/周视图任务卡片底色透明度(0-1) */ taskCardOpacity?: number; /** v1.13.0 日/周视图任务卡片左侧强调条宽度(px) */ taskAccentWidth?: number; } declare var __VLS_1: { date: Date; onChange: (value: string | [string, string]) => void; }, __VLS_29: { style: { top: string; height: string; left: string; width: string; borderLeftWidth: string; borderLeftColor: string; backgroundColor: string; }; task: Task; }, __VLS_43: { style: { top: string; height: string; left: string; width: string; borderLeftWidth: string; borderLeftColor: string; backgroundColor: string; }; task: Task; }; type __VLS_Slots = {} & { 'date-picker'?: (props: typeof __VLS_1) => any; } & { 'task-card'?: (props: typeof __VLS_29) => any; } & { 'task-card'?: (props: typeof __VLS_43) => any; }; declare const __VLS_component: import('vue').DefineComponent<Props, { goToToday: () => void; goToDate: (date: Date | string) => void; clearSelection: () => void; setScale: (scale: CalendarScale) => void; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, { "selection-complete": (range: CalendarSelectionDraft) => any; "selection-cancel": (payload: { reason: "before-hook-rejected" | "user-cancelled"; }) => any; "task-click": (task: Task, event: MouseEvent) => any; "task-move": (payload: CalendarTaskMovePayload) => any; "resource-change": (payload: { next: string | number | null; prev: string | number | null; }) => any; "view-change": (payload: { next: CalendarScale; prev: CalendarScale; }) => any; "date-change": (payload: { next: Date; prev: Date; }) => any; }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{ "onSelection-complete"?: ((range: CalendarSelectionDraft) => any) | undefined; "onSelection-cancel"?: ((payload: { reason: "before-hook-rejected" | "user-cancelled"; }) => any) | undefined; "onTask-click"?: ((task: Task, event: MouseEvent) => any) | undefined; "onTask-move"?: ((payload: CalendarTaskMovePayload) => any) | undefined; "onResource-change"?: ((payload: { next: string | number | null; prev: string | number | null; }) => any) | undefined; "onView-change"?: ((payload: { next: CalendarScale; prev: CalendarScale; }) => any) | undefined; "onDate-change"?: ((payload: { next: Date; prev: Date; }) => any) | undefined; }>, { locale: "zh-CN" | "en-US"; resources: Resource[]; disabled: boolean; workingHours: WorkingHoursConfig; selectionMinuteStep: number; allDayLabel: string; taskCardOpacity: number; taskAccentWidth: number; defaultScale: CalendarScale; }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>; declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>; export default _default; type __VLS_WithSlots<T, S> = T & { new (): { $slots: S; }; };