vue-gantt-3
Version:
A gantt component for Vue 3
360 lines (359 loc) • 18.4 kB
TypeScript
import { RowData, ColDef, DefaultColDef, GanttRowNode, GanttStyleOption, TimeScale, GanttHeaderUnit } from '../../types';
import { default as dayjs } from 'dayjs';
export interface Props {
getRowId: (rowData: RowData) => string;
columns: ColDef[];
rows: RowData[];
defaultCol?: DefaultColDef;
rowHeight: number;
headerHeight: number;
rowBuffer: number;
rowNodeMap: Map<string, GanttRowNode>;
firstLevelRowNode: GanttRowNode[];
visibleRowIds: string[];
defaultPerHourSpacing?: number;
defaultTimeScale?: TimeScale;
styleOption?: GanttStyleOption;
timePointComp?: any;
locale?: string;
timeLineRender?: any;
timeLineRenderParams?: Record<string, any>;
headerTextRender?: (date: dayjs.Dayjs, unit: GanttHeaderUnit) => string | number;
headerTipRender?: (date: dayjs.Dayjs, unit: GanttHeaderUnit) => string;
}
declare const _default: import('vue').DefineComponent<Props, {
scrollTo: (options: ScrollToOptions) => void;
updateMinAndMaxDateByChangeRowNode: ({ addedRowNodes, deletedRowNodes, updatedRowNodes }: {
addedRowNodes?: GanttRowNode[];
deletedRowNodes?: GanttRowNode[];
updatedRowNodes?: GanttRowNode[];
}, freshRowNodes: GanttRowNode[]) => void;
freshTimeLines: (rowNodes: GanttRowNode[]) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
perHourSpacingChange: (perHourSpacing: number) => any;
ganttBodyResize: (target: HTMLDivElement) => any;
triggerTableViewScroll: (options: ScrollToOptions, onWheel?: boolean | undefined) => any;
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
onPerHourSpacingChange?: ((perHourSpacing: number) => any) | undefined;
onGanttBodyResize?: ((target: HTMLDivElement) => any) | undefined;
onTriggerTableViewScroll?: ((options: ScrollToOptions, onWheel?: boolean | undefined) => any) | undefined;
}>, {
defaultPerHourSpacing: number;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
ganttGanttView: HTMLDivElement;
ganttHeaderRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./ganttHeader/GanttHeader.vue').Props> & Readonly<{}>, {
onScroll: ({ scrollLeft }: {
scrollLeft: number;
}) => void;
updateGanttHeaderWidth: (show: boolean, scrollbarWidth: number) => void;
onResize: () => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
ganttHeaderRef: HTMLDivElement;
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('./ganttHeader/GanttHeader.vue').Props> & Readonly<{}>, {
onScroll: ({ scrollLeft }: {
scrollLeft: number;
}) => void;
updateGanttHeaderWidth: (show: boolean, scrollbarWidth: number) => void;
onResize: () => void;
}, {}, {}, {}, {}> | null;
scrollBarRef: ({
$: import('vue').ComponentInternalInstance;
$data: {};
$props: {
readonly tag?: string | undefined;
readonly viewClass?: string | undefined;
readonly wrapClass?: string | undefined;
readonly viewStyle?: import('vue').StyleValue;
readonly wrapStyle?: import('vue').StyleValue;
readonly interceptShiftScroll?: boolean | undefined;
readonly alwayHorizontal?: boolean | undefined;
readonly alwayVertical?: boolean | undefined;
readonly onResize?: ((target: HTMLDivElement) => any) | undefined;
readonly onScroll?: ((args_0: {
scrollTop: number;
scrollLeft: number;
}) => any) | undefined;
readonly onWheel?: ((e: WheelEvent) => any) | undefined;
readonly onWrapResize?: ((target: HTMLDivElement) => any) | undefined;
readonly onShiftScroll?: ((e: WheelEvent) => any) | undefined;
readonly onVerticalScrollBarShow?: ((args_0: {
show: boolean;
scrollbarWidth: number;
}) => any) | undefined;
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
$attrs: {
[x: string]: unknown;
};
$refs: {
[x: string]: unknown;
} & {
wrapRef: HTMLDivElement;
resizeRef: unknown;
barRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../scrollbar/Bar.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (wrap: HTMLDivElement) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
triggerScrollFromThumb: (options: ScrollToOptions) => any;
}, import('vue').PublicProps, {
scrollbarHeight: number;
scrollbarWidth: number;
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
horizontalThumbRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../scrollbar/Thumb.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (option: {
left: number;
top: number;
}) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
triggerScrollFromThumb: (options: ScrollToOptions) => any;
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
thumbRef: HTMLDivElement;
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('../scrollbar/Thumb.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (option: {
left: number;
top: number;
}) => void;
}, {}, {}, {}, {}> | null;
verticalThumbRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../scrollbar/Thumb.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (option: {
left: number;
top: number;
}) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
triggerScrollFromThumb: (options: ScrollToOptions) => any;
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
thumbRef: HTMLDivElement;
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('../scrollbar/Thumb.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (option: {
left: number;
top: number;
}) => void;
}, {}, {}, {}, {}> | null;
}, any, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('../scrollbar/Bar.vue').Props> & Readonly<{
onTriggerScrollFromThumb?: ((options: ScrollToOptions) => any) | undefined;
}>, {
handleScroll: (wrap: HTMLDivElement) => void;
}, {}, {}, {}, {
scrollbarHeight: number;
scrollbarWidth: number;
}> | null;
};
$slots: Readonly<{
[name: string]: import('vue').Slot<any> | undefined;
}>;
$root: import('vue').ComponentPublicInstance | null;
$parent: import('vue').ComponentPublicInstance | null;
$host: Element | null;
$emit: ((event: "resize", target: HTMLDivElement) => void) & ((event: "scroll", args_0: {
scrollTop: number;
scrollLeft: number;
}) => void) & ((event: "wheel", e: WheelEvent) => void) & ((event: "wrapResize", target: HTMLDivElement) => void) & ((event: "shiftScroll", e: WheelEvent) => void) & ((event: "verticalScrollBarShow", args_0: {
show: boolean;
scrollbarWidth: number;
}) => void);
$el: HTMLDivElement;
$options: import('vue').ComponentOptionsBase<Readonly<import('../scrollbar/ScrollBar.vue').Props> & Readonly<{
onResize?: ((target: HTMLDivElement) => any) | undefined;
onScroll?: ((args_0: {
scrollTop: number;
scrollLeft: number;
}) => any) | undefined;
onWheel?: ((e: WheelEvent) => any) | undefined;
onWrapResize?: ((target: HTMLDivElement) => any) | undefined;
onShiftScroll?: ((e: WheelEvent) => any) | undefined;
onVerticalScrollBarShow?: ((args_0: {
show: boolean;
scrollbarWidth: number;
}) => any) | undefined;
}>, {
onResize: () => void;
scrollTo: (options: ScrollToOptions) => void;
handleScroll: () => void;
triggerScrollFromOutSide: (options: ScrollToOptions) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
resize: (target: HTMLDivElement) => any;
scroll: (args_0: {
scrollTop: number;
scrollLeft: number;
}) => any;
wheel: (e: WheelEvent) => any;
wrapResize: (target: HTMLDivElement) => any;
shiftScroll: (e: WheelEvent) => any;
verticalScrollBarShow: (args_0: {
show: boolean;
scrollbarWidth: number;
}) => any;
}, string, {
tag: string;
interceptShiftScroll: boolean;
alwayHorizontal: boolean;
alwayVertical: boolean;
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
beforeCreate?: (() => void) | (() => void)[];
created?: (() => void) | (() => void)[];
beforeMount?: (() => void) | (() => void)[];
mounted?: (() => void) | (() => void)[];
beforeUpdate?: (() => void) | (() => void)[];
updated?: (() => void) | (() => void)[];
activated?: (() => void) | (() => void)[];
deactivated?: (() => void) | (() => void)[];
beforeDestroy?: (() => void) | (() => void)[];
beforeUnmount?: (() => void) | (() => void)[];
destroyed?: (() => void) | (() => void)[];
unmounted?: (() => void) | (() => void)[];
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
};
$forceUpdate: () => void;
$nextTick: typeof import('vue').nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
} & Readonly<{
tag: string;
interceptShiftScroll: boolean;
alwayHorizontal: boolean;
alwayVertical: boolean;
}> & Omit<Readonly<import('../scrollbar/ScrollBar.vue').Props> & Readonly<{
onResize?: ((target: HTMLDivElement) => any) | undefined;
onScroll?: ((args_0: {
scrollTop: number;
scrollLeft: number;
}) => any) | undefined;
onWheel?: ((e: WheelEvent) => any) | undefined;
onWrapResize?: ((target: HTMLDivElement) => any) | undefined;
onShiftScroll?: ((e: WheelEvent) => any) | undefined;
onVerticalScrollBarShow?: ((args_0: {
show: boolean;
scrollbarWidth: number;
}) => any) | undefined;
}>, "scrollTo" | "onResize" | "handleScroll" | ("tag" | "interceptShiftScroll" | "alwayHorizontal" | "alwayVertical") | "triggerScrollFromOutSide"> & import('vue').ShallowUnwrapRef<{
onResize: () => void;
scrollTo: (options: ScrollToOptions) => void;
handleScroll: () => void;
triggerScrollFromOutSide: (options: ScrollToOptions) => void;
}> & {} & import('vue').ComponentCustomProperties & {} & {
$slots: {
default?(_: {}): any;
};
}) | null;
ganttBodyRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./ganttBody/GanttBody.vue').Props> & Readonly<{
onUpdateMinDate?: ((date: dayjs.Dayjs) => any) | undefined;
onUpdateMaxDate?: ((date: dayjs.Dayjs) => any) | undefined;
}>, {
onResize: () => void;
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
freshTimeLines: (rowNodes: GanttRowNode[]) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
updateMinDate: (date: dayjs.Dayjs) => any;
updateMaxDate: (date: dayjs.Dayjs) => any;
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
ganttGridRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./ganttBody/ganttGrid/GanttGrid.vue').Props> & Readonly<{}>, {
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
onResize: () => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, SVGSVGElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('./ganttBody/ganttGrid/GanttGrid.vue').Props> & Readonly<{}>, {
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
onResize: () => void;
}, {}, {}, {}, {}> | null;
ganttTimeLineViewRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./ganttBody/ganttTimeLineView/GanttTimeLineView.vue').Props> & Readonly<{
onUpdateMinDate?: ((date: dayjs.Dayjs) => any) | undefined;
onUpdateMaxDate?: ((date: dayjs.Dayjs) => any) | undefined;
}>, {
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
onResize: () => void;
freshTimeLines: (rowNodes: GanttRowNode[]) => void;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
updateMinDate: (date: dayjs.Dayjs) => any;
updateMaxDate: (date: dayjs.Dayjs) => any;
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('./ganttBody/ganttTimeLineView/GanttTimeLineView.vue').Props> & Readonly<{
onUpdateMinDate?: ((date: dayjs.Dayjs) => any) | undefined;
onUpdateMaxDate?: ((date: dayjs.Dayjs) => any) | undefined;
}>, {
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
onResize: () => void;
freshTimeLines: (rowNodes: GanttRowNode[]) => void;
}, {}, {}, {}, {}> | null;
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
P: {};
B: {};
D: {};
C: {};
M: {};
Defaults: {};
}, Readonly<import('./ganttBody/GanttBody.vue').Props> & Readonly<{
onUpdateMinDate?: ((date: dayjs.Dayjs) => any) | undefined;
onUpdateMaxDate?: ((date: dayjs.Dayjs) => any) | undefined;
}>, {
onResize: () => void;
onScroll: ({ scrollTop, scrollLeft }: {
scrollTop: number;
scrollLeft: number;
}) => void;
freshTimeLines: (rowNodes: GanttRowNode[]) => void;
}, {}, {}, {}, {}> | null;
}, HTMLDivElement>;
export default _default;