@dou-ui/gantt 0.0.0-stage → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/collaboration/index.js +323 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/peers.js +78 -0
- package/dist/collaboration/peers.js.map +1 -0
- package/dist/components/cell-editor.js +6 -0
- package/dist/components/cell-editor.js.map +1 -0
- package/dist/components/cell-editor.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/cell-editor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/gantt-menu.js +6 -0
- package/dist/components/gantt-menu.js.map +1 -0
- package/dist/components/gantt-menu.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/gantt-menu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/time-grid.js +6 -0
- package/dist/components/time-grid.js.map +1 -0
- package/dist/components/time-grid.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/time-grid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/time-header.js +6 -0
- package/dist/components/time-header.js.map +1 -0
- package/dist/components/time-header.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/time-header.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/context.js +12 -0
- package/dist/context.js.map +1 -0
- package/dist/core/baseline.js +48 -0
- package/dist/core/baseline.js.map +1 -0
- package/dist/core/calendar.js +191 -0
- package/dist/core/calendar.js.map +1 -0
- package/dist/core/csv.js +424 -0
- package/dist/core/csv.js.map +1 -0
- package/dist/core/document.js +231 -0
- package/dist/core/document.js.map +1 -0
- package/dist/core/extension.js +42 -0
- package/dist/core/extension.js.map +1 -0
- package/dist/core/geometry.js +112 -0
- package/dist/core/geometry.js.map +1 -0
- package/dist/core/history.js +70 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/links.js +72 -0
- package/dist/core/links.js.map +1 -0
- package/dist/core/model.js +52 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/order.js +34 -0
- package/dist/core/order.js.map +1 -0
- package/dist/core/scale.js +118 -0
- package/dist/core/scale.js.map +1 -0
- package/dist/core/schedule.js +235 -0
- package/dist/core/schedule.js.map +1 -0
- package/dist/core/time.js +81 -0
- package/dist/core/time.js.map +1 -0
- package/dist/core/transaction.js +371 -0
- package/dist/core/transaction.js.map +1 -0
- package/dist/core/tree.js +114 -0
- package/dist/core/tree.js.map +1 -0
- package/dist/export/draw.js +214 -0
- package/dist/export/draw.js.map +1 -0
- package/dist/export/theme.js +131 -0
- package/dist/export/theme.js.map +1 -0
- package/dist/gantt.js +6 -0
- package/dist/gantt.js.map +1 -0
- package/dist/gantt.vue_vue_type_script_setup_true_lang.js +2774 -0
- package/dist/gantt.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.js +87 -0
- package/dist/labels.js.map +1 -0
- package/dist/locale.js +355 -0
- package/dist/locale.js.map +1 -0
- package/dist/scheduler/index.js +8 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/layout.js +97 -0
- package/dist/scheduler/layout.js.map +1 -0
- package/dist/scheduler/scheduler.js +6 -0
- package/dist/scheduler/scheduler.js.map +1 -0
- package/dist/scheduler/scheduler.vue_vue_type_script_setup_true_lang.js +1359 -0
- package/dist/scheduler/scheduler.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/scheduler/style.d.ts +1 -0
- package/dist/scheduler/style.js +2 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +4 -0
- package/dist/time-axis.js +337 -0
- package/dist/time-axis.js.map +1 -0
- package/dist/types/collaboration/index.d.ts +39 -0
- package/dist/types/collaboration/peers.d.ts +22 -0
- package/dist/types/components/cell-editor.vue.d.ts +21 -0
- package/dist/types/components/gantt-menu.vue.d.ts +18 -0
- package/dist/types/components/time-grid.vue.d.ts +12 -0
- package/dist/types/components/time-header.vue.d.ts +23 -0
- package/dist/types/context.d.ts +64 -0
- package/dist/types/core/baseline.d.ts +14 -0
- package/dist/types/core/calendar.d.ts +75 -0
- package/dist/types/core/csv.d.ts +77 -0
- package/dist/types/core/document.d.ts +51 -0
- package/dist/types/core/extension.d.ts +88 -0
- package/dist/types/core/geometry.d.ts +33 -0
- package/dist/types/core/history.d.ts +19 -0
- package/dist/types/core/links.d.ts +20 -0
- package/dist/types/core/menu.d.ts +27 -0
- package/dist/types/core/model.d.ts +72 -0
- package/dist/types/core/order.d.ts +9 -0
- package/dist/types/core/scale.d.ts +33 -0
- package/dist/types/core/schedule.d.ts +44 -0
- package/dist/types/core/time.d.ts +39 -0
- package/dist/types/core/transaction.d.ts +134 -0
- package/dist/types/core/tree.d.ts +30 -0
- package/dist/types/export/draw.d.ts +76 -0
- package/dist/types/export/theme.d.ts +49 -0
- package/dist/types/gantt.vue.d.ts +54 -0
- package/dist/types/index.d.ts +148 -0
- package/dist/types/labels.d.ts +24 -0
- package/dist/types/locale.d.ts +161 -0
- package/dist/types/scheduler/index.d.ts +102 -0
- package/dist/types/scheduler/layout.d.ts +58 -0
- package/dist/types/scheduler/scheduler.vue.d.ts +46 -0
- package/dist/types/scheduler/types.d.ts +109 -0
- package/dist/types/time-axis.d.ts +80 -0
- package/dist/types/types.d.ts +305 -0
- package/package.json +79 -4
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export declare const DouGantt: import("dou-ui").WithInstall<{
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types").GanttProps & {
|
|
3
|
+
modelValue?: import("./index.js").GanttDocument;
|
|
4
|
+
selection?: string[];
|
|
5
|
+
scale?: import("./types").GanttScale;
|
|
6
|
+
}> & Readonly<{
|
|
7
|
+
onLink?: ((link: import("./index.js").GanttLink) => any) | undefined;
|
|
8
|
+
onTransaction?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
9
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").GanttDocument) => any) | undefined;
|
|
10
|
+
onTransactionCancel?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
11
|
+
onTaskClick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
12
|
+
onTaskDblclick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
13
|
+
onTaskContextmenu?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
14
|
+
onLinkClick?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
15
|
+
onLinkContextmenu?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
16
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
17
|
+
"onUpdate:scale"?: ((value: import("./types").GanttScale | undefined) => any) | undefined;
|
|
18
|
+
}>, import("./types").GanttExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
link: (link: import("./index.js").GanttLink) => any;
|
|
20
|
+
transaction: (tr: import("./index.js").GanttTransaction) => any;
|
|
21
|
+
"update:modelValue": (value: import("./index.js").GanttDocument) => any;
|
|
22
|
+
transactionCancel: (tr: import("./index.js").GanttTransaction) => any;
|
|
23
|
+
taskClick: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
24
|
+
taskDblclick: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
25
|
+
taskContextmenu: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
26
|
+
linkClick: (link: import("./index.js").GanttLink, event: MouseEvent) => any;
|
|
27
|
+
linkContextmenu: (link: import("./index.js").GanttLink, event: MouseEvent) => any;
|
|
28
|
+
"update:selection": (value: string[]) => any;
|
|
29
|
+
"update:scale": (value: import("./types").GanttScale | undefined) => any;
|
|
30
|
+
}, import("vue").PublicProps, {
|
|
31
|
+
today: boolean;
|
|
32
|
+
addRow: boolean;
|
|
33
|
+
menu: boolean;
|
|
34
|
+
table: boolean;
|
|
35
|
+
rowHeight: number;
|
|
36
|
+
tableWidth: number;
|
|
37
|
+
barLabel: import("./types").GanttBarLabel;
|
|
38
|
+
scheduling: "auto" | "manual";
|
|
39
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
40
|
+
P: {};
|
|
41
|
+
B: {};
|
|
42
|
+
D: {};
|
|
43
|
+
C: {};
|
|
44
|
+
M: {};
|
|
45
|
+
Defaults: {};
|
|
46
|
+
}, Readonly<import("./types").GanttProps & {
|
|
47
|
+
modelValue?: import("./index.js").GanttDocument;
|
|
48
|
+
selection?: string[];
|
|
49
|
+
scale?: import("./types").GanttScale;
|
|
50
|
+
}> & Readonly<{
|
|
51
|
+
onLink?: ((link: import("./index.js").GanttLink) => any) | undefined;
|
|
52
|
+
onTransaction?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
53
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").GanttDocument) => any) | undefined;
|
|
54
|
+
onTransactionCancel?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
55
|
+
onTaskClick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
56
|
+
onTaskDblclick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
57
|
+
onTaskContextmenu?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
58
|
+
onLinkClick?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
59
|
+
onLinkContextmenu?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
60
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
61
|
+
"onUpdate:scale"?: ((value: import("./types").GanttScale | undefined) => any) | undefined;
|
|
62
|
+
}>, import("./types").GanttExpose, {}, {}, {}, {
|
|
63
|
+
today: boolean;
|
|
64
|
+
addRow: boolean;
|
|
65
|
+
menu: boolean;
|
|
66
|
+
table: boolean;
|
|
67
|
+
rowHeight: number;
|
|
68
|
+
tableWidth: number;
|
|
69
|
+
barLabel: import("./types").GanttBarLabel;
|
|
70
|
+
scheduling: "auto" | "manual";
|
|
71
|
+
}>;
|
|
72
|
+
__isFragment?: never;
|
|
73
|
+
__isTeleport?: never;
|
|
74
|
+
__isSuspense?: never;
|
|
75
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types").GanttProps & {
|
|
76
|
+
modelValue?: import("./index.js").GanttDocument;
|
|
77
|
+
selection?: string[];
|
|
78
|
+
scale?: import("./types").GanttScale;
|
|
79
|
+
}> & Readonly<{
|
|
80
|
+
onLink?: ((link: import("./index.js").GanttLink) => any) | undefined;
|
|
81
|
+
onTransaction?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
82
|
+
"onUpdate:modelValue"?: ((value: import("./index.js").GanttDocument) => any) | undefined;
|
|
83
|
+
onTransactionCancel?: ((tr: import("./index.js").GanttTransaction) => any) | undefined;
|
|
84
|
+
onTaskClick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
85
|
+
onTaskDblclick?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
86
|
+
onTaskContextmenu?: ((task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
87
|
+
onLinkClick?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
88
|
+
onLinkContextmenu?: ((link: import("./index.js").GanttLink, event: MouseEvent) => any) | undefined;
|
|
89
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
90
|
+
"onUpdate:scale"?: ((value: import("./types").GanttScale | undefined) => any) | undefined;
|
|
91
|
+
}>, import("./types").GanttExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
92
|
+
link: (link: import("./index.js").GanttLink) => any;
|
|
93
|
+
transaction: (tr: import("./index.js").GanttTransaction) => any;
|
|
94
|
+
"update:modelValue": (value: import("./index.js").GanttDocument) => any;
|
|
95
|
+
transactionCancel: (tr: import("./index.js").GanttTransaction) => any;
|
|
96
|
+
taskClick: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
97
|
+
taskDblclick: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
98
|
+
taskContextmenu: (task: import("./index.js").GanttTask<import("./index.js").GanttData>, event: MouseEvent) => any;
|
|
99
|
+
linkClick: (link: import("./index.js").GanttLink, event: MouseEvent) => any;
|
|
100
|
+
linkContextmenu: (link: import("./index.js").GanttLink, event: MouseEvent) => any;
|
|
101
|
+
"update:selection": (value: string[]) => any;
|
|
102
|
+
"update:scale": (value: import("./types").GanttScale | undefined) => any;
|
|
103
|
+
}, string, {
|
|
104
|
+
today: boolean;
|
|
105
|
+
addRow: boolean;
|
|
106
|
+
menu: boolean;
|
|
107
|
+
table: boolean;
|
|
108
|
+
rowHeight: number;
|
|
109
|
+
tableWidth: number;
|
|
110
|
+
barLabel: import("./types").GanttBarLabel;
|
|
111
|
+
scheduling: "auto" | "manual";
|
|
112
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
113
|
+
$slots: import("./types").GanttSlots;
|
|
114
|
+
}), import("vue").HTMLAttributes>;
|
|
115
|
+
export default DouGantt;
|
|
116
|
+
export type { GanttBarLabel, GanttCSVErrorCode, GanttCSVExportOptions, GanttCSVImportOptions, GanttCSVResult, GanttCSVWarning, GanttColumn, GanttEmits, GanttExportOptions, GanttExpose, GanttImageOptions, GanttInsertOptions, GanttMarker, GanttMove, GanttPrintOptions, GanttProps, GanttSlots, } from './types';
|
|
117
|
+
export { GanttCSVError } from './core/csv';
|
|
118
|
+
export { useGantt } from './context';
|
|
119
|
+
export type { GanttContext } from './context';
|
|
120
|
+
export { defineGanttExtension } from './core/extension';
|
|
121
|
+
export type { GanttExtension, GanttExtensionContext, GanttHistoryHandler, GanttKeyHandler, } from './core/extension';
|
|
122
|
+
export { ganttLocales, useGanttMessages } from './locale';
|
|
123
|
+
export type { GanttMessages, GanttMessagesOverride } from './locale';
|
|
124
|
+
export { spanOf, writeSpan } from './core/model';
|
|
125
|
+
export type { GanttData, GanttLink, GanttLinkType, GanttTask, TaskSpan } from './core/model';
|
|
126
|
+
export type { GanttRow } from './core/tree';
|
|
127
|
+
export { resolveCalendar, workdaysBetween, workingMinutes } from './core/calendar';
|
|
128
|
+
export type { GanttCalendar, WorkCalendar } from './core/calendar';
|
|
129
|
+
export { applyGanttSteps, emptyDocument, GanttTransaction } from './core/transaction';
|
|
130
|
+
export type { GanttDocument, GanttStep, GanttTransactionMeta } from './core/transaction';
|
|
131
|
+
export { checkDocument, migrateDocument } from './core/document';
|
|
132
|
+
export type { CheckDocumentOptions, DocumentProblem } from './core/document';
|
|
133
|
+
export { baselineSpans, takeBaseline } from './core/baseline';
|
|
134
|
+
export type { GanttBaselineItem } from './core/baseline';
|
|
135
|
+
export { computeCriticalPath, computeSchedule, findBrokenLinks } from './core/schedule';
|
|
136
|
+
export type { GanttCriticalPath, GanttSchedule, GanttScheduleOptions } from './core/schedule';
|
|
137
|
+
export type { GanttMenuTarget, GanttPoint } from './core/menu';
|
|
138
|
+
export { orderBetween } from './core/order';
|
|
139
|
+
export { parseLag } from './core/links';
|
|
140
|
+
export type { GanttLag, GanttLinkRefusal } from './core/links';
|
|
141
|
+
export type { GanttScale } from './core/scale';
|
|
142
|
+
export { formatTime, parseTime } from './core/time';
|
|
143
|
+
export type { ParsedTime } from './core/time';
|
|
144
|
+
declare module 'vue' {
|
|
145
|
+
interface GlobalComponents {
|
|
146
|
+
DouGantt: typeof DouGantt;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type WorkCalendar } from './core/calendar';
|
|
2
|
+
import type { TaskSpan } from './core/model';
|
|
3
|
+
import type { TimeUnit } from './core/scale';
|
|
4
|
+
import { type GanttMessages } from './locale';
|
|
5
|
+
/** The text of a header cell for the `unit` starting at `at`. */
|
|
6
|
+
export declare function unitLabel(unit: TimeUnit, at: number, m: GanttMessages, dayWidth: number): string;
|
|
7
|
+
/** A date for reading out or for a table cell: `3月5日`, with the time when it has one. */
|
|
8
|
+
export declare function dateLabel(at: number, dateOnly: boolean, m: GanttMessages): string;
|
|
9
|
+
/**
|
|
10
|
+
* The last moment of a span as a reader expects it: a date-only span ends
|
|
11
|
+
* on its last day (a summary ending on a milestone, at noon, on that day).
|
|
12
|
+
*/
|
|
13
|
+
export declare const endLabel: (span: TaskSpan, m: GanttMessages) => string;
|
|
14
|
+
/** Working days for a date-only span, working hours otherwise. */
|
|
15
|
+
export declare function durationLabel(span: TaskSpan, calendar: WorkCalendar, m: GanttMessages): string;
|
|
16
|
+
/** A task's dates, read out: just the date for a task of one whole day. */
|
|
17
|
+
export declare function datesLabel(span: TaskSpan, m: GanttMessages): string;
|
|
18
|
+
/** The duration, read out: says so when it has no working time at all. */
|
|
19
|
+
export declare function spokenDuration(span: TaskSpan, calendar: WorkCalendar, m: GanttMessages): string;
|
|
20
|
+
/**
|
|
21
|
+
* How wide each marker label may be so it stops short of the next one to
|
|
22
|
+
* its right: `Infinity` for the last, `0` when there is no useful room.
|
|
23
|
+
*/
|
|
24
|
+
export declare function markerRoom(xs: readonly number[]): number[];
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export interface GanttMessages {
|
|
3
|
+
/** The chart's accessible name when none is given. */
|
|
4
|
+
chart: string;
|
|
5
|
+
/** Column headers. */
|
|
6
|
+
columns: {
|
|
7
|
+
title: string;
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
duration: string;
|
|
11
|
+
progress: string;
|
|
12
|
+
};
|
|
13
|
+
/** Short month names, January first. */
|
|
14
|
+
months: string[];
|
|
15
|
+
/** Short weekday names, Sunday first. */
|
|
16
|
+
weekdays: string[];
|
|
17
|
+
/** Header labels. `{year}`, `{month}` (a name from `months`), `{day}`, `{weekday}`, `{quarter}`, `{hour}`. */
|
|
18
|
+
year: string;
|
|
19
|
+
yearMonth: string;
|
|
20
|
+
month: string;
|
|
21
|
+
monthDay: string;
|
|
22
|
+
dayWithWeekday: string;
|
|
23
|
+
quarter: string;
|
|
24
|
+
halves: [string, string];
|
|
25
|
+
hour: string;
|
|
26
|
+
/** Durations; `{count}` is a number. */
|
|
27
|
+
days: string;
|
|
28
|
+
hours: string;
|
|
29
|
+
today: string;
|
|
30
|
+
expand: string;
|
|
31
|
+
collapse: string;
|
|
32
|
+
/**
|
|
33
|
+
* Read out for a task; `{title}`, `{dates}`, `{duration}` and `{progress}`
|
|
34
|
+
* are filled in. `{dates}` is `range`, or the one date of a one-day task.
|
|
35
|
+
*/
|
|
36
|
+
task: string;
|
|
37
|
+
milestone: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
unscheduled: string;
|
|
40
|
+
/** A task's dates, read out: `{start}` and `{end}`. */
|
|
41
|
+
range: string;
|
|
42
|
+
/** Read out instead of a duration when the task has no working time. */
|
|
43
|
+
offDays: string;
|
|
44
|
+
offHours: string;
|
|
45
|
+
/** `{date}` and `{time}`. */
|
|
46
|
+
dateTime: string;
|
|
47
|
+
/** Shown while dragging: `{start}`, `{end}`, `{duration}`; `{value}` is a percentage. */
|
|
48
|
+
rangeTip: string;
|
|
49
|
+
progressTip: string;
|
|
50
|
+
/** Why a link being drawn can't be made. */
|
|
51
|
+
linkRefusals: {
|
|
52
|
+
nested: string;
|
|
53
|
+
duplicate: string;
|
|
54
|
+
cycle: string;
|
|
55
|
+
};
|
|
56
|
+
/** Comparing with the `baseline`: `{duration}` is how far the end moved. */
|
|
57
|
+
baseline: {
|
|
58
|
+
late: string;
|
|
59
|
+
early: string;
|
|
60
|
+
withChange: string;
|
|
61
|
+
};
|
|
62
|
+
/** Shown when `can-move` refuses without a reason. */
|
|
63
|
+
moveRefused: string;
|
|
64
|
+
/** The handle between the list and the timeline. */
|
|
65
|
+
resizeTable: string;
|
|
66
|
+
/** A duration column's header in exported CSV, where values are bare numbers: `{title}`. */
|
|
67
|
+
daysColumn: string;
|
|
68
|
+
hoursColumn: string;
|
|
69
|
+
/** Headers of the columns `toCSV({ ids: true })` adds: the task's id and its parent's. */
|
|
70
|
+
idColumn: string;
|
|
71
|
+
parentColumn: string;
|
|
72
|
+
/** The `reason` of a `GanttCSVError` for a file without a title column: `{title}` is its header. */
|
|
73
|
+
csvNoTitle: string;
|
|
74
|
+
/** How to use the chart with keys; read out when it gets focus. */
|
|
75
|
+
keys: string;
|
|
76
|
+
/** Read out: linking by keys (`{title}` is where it starts), what was done. */
|
|
77
|
+
linkMode: string;
|
|
78
|
+
linked: string;
|
|
79
|
+
linkRemoved: string;
|
|
80
|
+
cancelled: string;
|
|
81
|
+
/** `{change}` is the task (or link) as it is afterwards. */
|
|
82
|
+
undone: string;
|
|
83
|
+
redone: string;
|
|
84
|
+
/** Said when an extension cancels a change without saying why. */
|
|
85
|
+
changeCancelled: string;
|
|
86
|
+
/** For `{change}`: a link's lag or type changed, a task was removed. */
|
|
87
|
+
linkChanged: string;
|
|
88
|
+
taskRemoved: string;
|
|
89
|
+
/** Read out when a change pushed other tasks: `{task}` is the rest, `{count}` how many. */
|
|
90
|
+
pushed: string;
|
|
91
|
+
/** Read out when a change leaves links not kept: `{task}` is the rest, `{count}` how many. */
|
|
92
|
+
broken: string;
|
|
93
|
+
/** The title of a task added from the menu. */
|
|
94
|
+
newTask: string;
|
|
95
|
+
/** The row below the table that adds a task. */
|
|
96
|
+
addRow: string;
|
|
97
|
+
/** Read out when a task is added from the row below the table. */
|
|
98
|
+
taskAdded: string;
|
|
99
|
+
/** Read out after indenting or outdenting: `{task}` moved under `{parent}`, or to the top level. */
|
|
100
|
+
movedUnder: string;
|
|
101
|
+
movedTop: string;
|
|
102
|
+
/** Read out when an edited value can't be read, so the cell keeps its value. */
|
|
103
|
+
invalidValue: string;
|
|
104
|
+
/** Read out when tasks are removed; `{titles}` joined with `listSeparator`. */
|
|
105
|
+
tasksRemoved: string;
|
|
106
|
+
listSeparator: string;
|
|
107
|
+
/** The name of a cell's editor; `{column}` is its header. */
|
|
108
|
+
editCell: string;
|
|
109
|
+
/** The built-in context menu items. */
|
|
110
|
+
menu: {
|
|
111
|
+
rename: string;
|
|
112
|
+
addAfter: string;
|
|
113
|
+
addInside: string;
|
|
114
|
+
addTask: string;
|
|
115
|
+
indent: string;
|
|
116
|
+
outdent: string;
|
|
117
|
+
removeTask: string;
|
|
118
|
+
/** `{count}` tasks. */
|
|
119
|
+
removeTasks: string;
|
|
120
|
+
removeLink: string;
|
|
121
|
+
};
|
|
122
|
+
/** Read out after `schedule()`: `{count}` tasks moved. */
|
|
123
|
+
scheduled: string;
|
|
124
|
+
/** A task on the critical path, read out: `{task}` is the rest. */
|
|
125
|
+
criticalTask: string;
|
|
126
|
+
/** The scheduler's texts. */
|
|
127
|
+
scheduler: {
|
|
128
|
+
/** Its accessible name when none is given. */
|
|
129
|
+
name: string;
|
|
130
|
+
/** The header over the resources. */
|
|
131
|
+
resource: string;
|
|
132
|
+
/** The row for tasks without a resource. */
|
|
133
|
+
unassigned: string;
|
|
134
|
+
/** How to use it with keys; read out when it gets focus. */
|
|
135
|
+
keys: string;
|
|
136
|
+
/** A task's dates: `{title}`, `{dates}`, `{duration}`. */
|
|
137
|
+
task: string;
|
|
138
|
+
/** Read out for a task: `{task}` (its dates, or the milestone text) and `{resource}`. */
|
|
139
|
+
item: string;
|
|
140
|
+
/** Read out for a resource: `{title}`, `{count}` tasks. */
|
|
141
|
+
row: string;
|
|
142
|
+
/** Added to a resource that takes more than it can at times: `{row}` is the rest. */
|
|
143
|
+
overloaded: string;
|
|
144
|
+
/** Beside an overloaded resource's name. */
|
|
145
|
+
overloadHint: string;
|
|
146
|
+
/** Read out after a task moved to another resource: `{title}`, `{resource}`. */
|
|
147
|
+
moved: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export declare const ganttLocales: Record<string, GanttMessages>;
|
|
151
|
+
/** Texts to change; nested groups are merged, so only the ones given are replaced. */
|
|
152
|
+
export type GanttMessagesOverride = {
|
|
153
|
+
[K in keyof GanttMessages]?: GanttMessages[K] extends string ? string : GanttMessages[K] extends unknown[] ? GanttMessages[K] : Partial<GanttMessages[K]>;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* The Gantt chart's texts, picked by the name of DouUI's current locale.
|
|
157
|
+
* Pass `messages` to override any of them.
|
|
158
|
+
*/
|
|
159
|
+
export declare function useGanttMessages(override?: MaybeRefOrGetter<GanttMessagesOverride | undefined>): import("vue").ComputedRef<GanttMessages>;
|
|
160
|
+
/** Fills `{name}` placeholders. */
|
|
161
|
+
export declare const format: (text: string, params: Record<string, string | number>) => string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare const DouScheduler: import("dou-ui").WithInstall<{
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types").SchedulerProps & {
|
|
3
|
+
modelValue?: import("../index.js").GanttDocument;
|
|
4
|
+
selection?: string[];
|
|
5
|
+
scale?: import("../types.js").GanttScale;
|
|
6
|
+
}> & Readonly<{
|
|
7
|
+
onTransaction?: ((tr: import("../index.js").GanttTransaction) => any) | undefined;
|
|
8
|
+
"onUpdate:modelValue"?: ((value: import("../index.js").GanttDocument) => any) | undefined;
|
|
9
|
+
onTaskClick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
10
|
+
onTaskDblclick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
11
|
+
onTaskContextmenu?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
12
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
13
|
+
"onUpdate:scale"?: ((value: import("../types.js").GanttScale | undefined) => any) | undefined;
|
|
14
|
+
onCreate?: ((range: import("./types").SchedulerRange) => any) | undefined;
|
|
15
|
+
}>, import("./types").SchedulerExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
transaction: (tr: import("../index.js").GanttTransaction) => any;
|
|
17
|
+
"update:modelValue": (value: import("../index.js").GanttDocument) => any;
|
|
18
|
+
taskClick: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
19
|
+
taskDblclick: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
20
|
+
taskContextmenu: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
21
|
+
"update:selection": (value: string[]) => any;
|
|
22
|
+
"update:scale": (value: import("../types.js").GanttScale | undefined) => any;
|
|
23
|
+
create: (range: import("./types").SchedulerRange) => any;
|
|
24
|
+
}, import("vue").PublicProps, {
|
|
25
|
+
today: boolean;
|
|
26
|
+
menu: boolean;
|
|
27
|
+
table: boolean;
|
|
28
|
+
load: boolean;
|
|
29
|
+
rowHeight: number;
|
|
30
|
+
tableWidth: number;
|
|
31
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
32
|
+
P: {};
|
|
33
|
+
B: {};
|
|
34
|
+
D: {};
|
|
35
|
+
C: {};
|
|
36
|
+
M: {};
|
|
37
|
+
Defaults: {};
|
|
38
|
+
}, Readonly<import("./types").SchedulerProps & {
|
|
39
|
+
modelValue?: import("../index.js").GanttDocument;
|
|
40
|
+
selection?: string[];
|
|
41
|
+
scale?: import("../types.js").GanttScale;
|
|
42
|
+
}> & Readonly<{
|
|
43
|
+
onTransaction?: ((tr: import("../index.js").GanttTransaction) => any) | undefined;
|
|
44
|
+
"onUpdate:modelValue"?: ((value: import("../index.js").GanttDocument) => any) | undefined;
|
|
45
|
+
onTaskClick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
46
|
+
onTaskDblclick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
47
|
+
onTaskContextmenu?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
48
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
49
|
+
"onUpdate:scale"?: ((value: import("../types.js").GanttScale | undefined) => any) | undefined;
|
|
50
|
+
onCreate?: ((range: import("./types").SchedulerRange) => any) | undefined;
|
|
51
|
+
}>, import("./types").SchedulerExpose, {}, {}, {}, {
|
|
52
|
+
today: boolean;
|
|
53
|
+
menu: boolean;
|
|
54
|
+
table: boolean;
|
|
55
|
+
load: boolean;
|
|
56
|
+
rowHeight: number;
|
|
57
|
+
tableWidth: number;
|
|
58
|
+
}>;
|
|
59
|
+
__isFragment?: never;
|
|
60
|
+
__isTeleport?: never;
|
|
61
|
+
__isSuspense?: never;
|
|
62
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types").SchedulerProps & {
|
|
63
|
+
modelValue?: import("../index.js").GanttDocument;
|
|
64
|
+
selection?: string[];
|
|
65
|
+
scale?: import("../types.js").GanttScale;
|
|
66
|
+
}> & Readonly<{
|
|
67
|
+
onTransaction?: ((tr: import("../index.js").GanttTransaction) => any) | undefined;
|
|
68
|
+
"onUpdate:modelValue"?: ((value: import("../index.js").GanttDocument) => any) | undefined;
|
|
69
|
+
onTaskClick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
70
|
+
onTaskDblclick?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
71
|
+
onTaskContextmenu?: ((task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
72
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
73
|
+
"onUpdate:scale"?: ((value: import("../types.js").GanttScale | undefined) => any) | undefined;
|
|
74
|
+
onCreate?: ((range: import("./types").SchedulerRange) => any) | undefined;
|
|
75
|
+
}>, import("./types").SchedulerExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
|
+
transaction: (tr: import("../index.js").GanttTransaction) => any;
|
|
77
|
+
"update:modelValue": (value: import("../index.js").GanttDocument) => any;
|
|
78
|
+
taskClick: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
79
|
+
taskDblclick: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
80
|
+
taskContextmenu: (task: import("../index.js").GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
81
|
+
"update:selection": (value: string[]) => any;
|
|
82
|
+
"update:scale": (value: import("../types.js").GanttScale | undefined) => any;
|
|
83
|
+
create: (range: import("./types").SchedulerRange) => any;
|
|
84
|
+
}, string, {
|
|
85
|
+
today: boolean;
|
|
86
|
+
menu: boolean;
|
|
87
|
+
table: boolean;
|
|
88
|
+
load: boolean;
|
|
89
|
+
rowHeight: number;
|
|
90
|
+
tableWidth: number;
|
|
91
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
92
|
+
$slots: import("./types").SchedulerSlots;
|
|
93
|
+
}), import("vue").HTMLAttributes>;
|
|
94
|
+
export default DouScheduler;
|
|
95
|
+
export { findConflict, groupByResource, loadSegments, packLanes } from './layout';
|
|
96
|
+
export type { SchedulerItem, SchedulerLoadSegment, SchedulerPlace, SchedulerResource, } from './layout';
|
|
97
|
+
export type { SchedulerEmits, SchedulerExpose, SchedulerMenuTarget, SchedulerMove, SchedulerProps, SchedulerRange, SchedulerSlots, } from './types';
|
|
98
|
+
declare module 'vue' {
|
|
99
|
+
interface GlobalComponents {
|
|
100
|
+
DouScheduler: typeof DouScheduler;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type GanttData, type GanttTask, type TaskSpan } from '../core/model';
|
|
2
|
+
/** A row of the scheduler: a person, a room, a machine. */
|
|
3
|
+
export interface SchedulerResource<Data extends GanttData = GanttData> {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
/** Resources with the same group are listed together under its name. */
|
|
7
|
+
group?: string;
|
|
8
|
+
/** How many tasks it can take at once; more than that shows as overloaded. Defaults to `1`. */
|
|
9
|
+
capacity?: number;
|
|
10
|
+
/** Your own fields. */
|
|
11
|
+
data?: Data;
|
|
12
|
+
}
|
|
13
|
+
/** A task placed in its row. */
|
|
14
|
+
export interface SchedulerItem {
|
|
15
|
+
task: GanttTask;
|
|
16
|
+
span: TaskSpan;
|
|
17
|
+
/** Which of the row's lanes it is drawn in, from `0`. */
|
|
18
|
+
lane: number;
|
|
19
|
+
}
|
|
20
|
+
/** A stretch of time with the same number of tasks going on. */
|
|
21
|
+
export interface SchedulerLoadSegment {
|
|
22
|
+
start: number;
|
|
23
|
+
end: number;
|
|
24
|
+
count: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Puts overlapping tasks in separate lanes: each task takes the first lane
|
|
28
|
+
* that is free when it starts. Returns the lane count.
|
|
29
|
+
*/
|
|
30
|
+
export declare function packLanes(items: {
|
|
31
|
+
span: TaskSpan;
|
|
32
|
+
lane: number;
|
|
33
|
+
}[]): number;
|
|
34
|
+
/** How many tasks are going on over time; stretches with none are left out. */
|
|
35
|
+
export declare function loadSegments(spans: Iterable<TaskSpan>): SchedulerLoadSegment[];
|
|
36
|
+
/**
|
|
37
|
+
* The tasks of each resource, packed into lanes. Tasks without a resource,
|
|
38
|
+
* or with one that isn't listed, go under `''`; tasks without dates are
|
|
39
|
+
* left out.
|
|
40
|
+
*/
|
|
41
|
+
export declare function groupByResource(tasks: readonly GanttTask[], resources: readonly SchedulerResource[]): Map<string, {
|
|
42
|
+
items: SchedulerItem[];
|
|
43
|
+
lanes: number;
|
|
44
|
+
}>;
|
|
45
|
+
/** Where a task would go: as `can-move` gets it, or a new booking. */
|
|
46
|
+
export interface SchedulerPlace {
|
|
47
|
+
/** The task being moved; it never conflicts with itself. */
|
|
48
|
+
task?: GanttTask;
|
|
49
|
+
resource?: string;
|
|
50
|
+
start: string;
|
|
51
|
+
end?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The first task on the same resource whose time overlaps `place`, or
|
|
55
|
+
* `undefined`. Tasks only touching end to start don't overlap; without a
|
|
56
|
+
* resource nothing conflicts.
|
|
57
|
+
*/
|
|
58
|
+
export declare function findConflict(tasks: readonly GanttTask[], place: SchedulerPlace): GanttTask | undefined;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type GanttTask } from '../core/model';
|
|
2
|
+
import { type GanttScale } from '../core/scale';
|
|
3
|
+
import { GanttTransaction, type GanttDocument } from '../core/transaction';
|
|
4
|
+
import type { SchedulerExpose, SchedulerProps, SchedulerRange, SchedulerSlots } from './types';
|
|
5
|
+
type __VLS_Props = SchedulerProps;
|
|
6
|
+
type __VLS_Slots = SchedulerSlots;
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
modelValue?: GanttDocument;
|
|
9
|
+
'selection'?: string[];
|
|
10
|
+
'scale'?: GanttScale;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, SchedulerExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
transaction: (tr: GanttTransaction) => any;
|
|
15
|
+
"update:modelValue": (value: GanttDocument) => any;
|
|
16
|
+
taskClick: (task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
17
|
+
taskDblclick: (task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
18
|
+
taskContextmenu: (task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any;
|
|
19
|
+
"update:selection": (value: string[]) => any;
|
|
20
|
+
"update:scale": (value: GanttScale | undefined) => any;
|
|
21
|
+
create: (range: SchedulerRange) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
onTransaction?: ((tr: GanttTransaction) => any) | undefined;
|
|
24
|
+
"onUpdate:modelValue"?: ((value: GanttDocument) => any) | undefined;
|
|
25
|
+
onTaskClick?: ((task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
26
|
+
onTaskDblclick?: ((task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
27
|
+
onTaskContextmenu?: ((task: GanttTask<import("../index.js").GanttData>, event: MouseEvent) => any) | undefined;
|
|
28
|
+
"onUpdate:selection"?: ((value: string[]) => any) | undefined;
|
|
29
|
+
"onUpdate:scale"?: ((value: GanttScale | undefined) => any) | undefined;
|
|
30
|
+
onCreate?: ((range: SchedulerRange) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
today: boolean;
|
|
33
|
+
menu: boolean;
|
|
34
|
+
table: boolean;
|
|
35
|
+
load: boolean;
|
|
36
|
+
rowHeight: number;
|
|
37
|
+
tableWidth: number;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ContextMenuItem } from 'dou-ui';
|
|
2
|
+
import type { GanttCalendar } from '../core/calendar';
|
|
3
|
+
import type { GanttTask } from '../core/model';
|
|
4
|
+
import type { GanttDocument, GanttTransaction, GanttTransactionMeta } from '../core/transaction';
|
|
5
|
+
import type { GanttMessagesOverride } from '../locale';
|
|
6
|
+
import type { GanttMarker } from '../types';
|
|
7
|
+
import type { SchedulerResource } from './layout';
|
|
8
|
+
export interface SchedulerProps {
|
|
9
|
+
/** The rows, in order. Tasks go to the row named by their `resource`. */
|
|
10
|
+
resources: SchedulerResource[];
|
|
11
|
+
/** The working calendar: workdays, days off and working hours. */
|
|
12
|
+
calendar?: GanttCalendar;
|
|
13
|
+
/** A fixed span for the time axis, `[start, end]` as dates. Without it the axis follows the tasks. */
|
|
14
|
+
range?: [string, string];
|
|
15
|
+
/** Show a line at the current time. */
|
|
16
|
+
today?: boolean;
|
|
17
|
+
/** The first day of the week; defaults to the locale's. */
|
|
18
|
+
weekStart?: 0 | 1;
|
|
19
|
+
/** Lines at given dates, such as deadlines. */
|
|
20
|
+
markers?: GanttMarker[];
|
|
21
|
+
/** Show the list of resources beside the timeline. */
|
|
22
|
+
table?: boolean;
|
|
23
|
+
/** Width of the resource list, in px. */
|
|
24
|
+
tableWidth?: number;
|
|
25
|
+
/** Height of a row with one lane, in px. Each extra lane adds 28px. */
|
|
26
|
+
rowHeight?: number;
|
|
27
|
+
/** Show how busy each resource is, under its row. */
|
|
28
|
+
load?: boolean;
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The last check before a task is moved, resized or given to another
|
|
32
|
+
* resource, by dragging or by keys. Return `true` to allow it; anything
|
|
33
|
+
* else refuses it, and a string is shown as the reason.
|
|
34
|
+
*/
|
|
35
|
+
canMove?: (move: SchedulerMove, doc: GanttDocument) => boolean | string;
|
|
36
|
+
/** The built-in context menu item: remove. Turn off to keep only `contextMenu`'s items. */
|
|
37
|
+
menu?: boolean;
|
|
38
|
+
/** Your own context menu items, shown above the built-in ones; return none to add nothing. */
|
|
39
|
+
contextMenu?: (target: SchedulerMenuTarget) => ContextMenuItem[];
|
|
40
|
+
ariaLabel?: string;
|
|
41
|
+
messages?: GanttMessagesOverride;
|
|
42
|
+
}
|
|
43
|
+
/** A change of dates or resource about to be made. */
|
|
44
|
+
export interface SchedulerMove {
|
|
45
|
+
task: GanttTask;
|
|
46
|
+
start: string;
|
|
47
|
+
end?: string;
|
|
48
|
+
/** The resource it goes to; `undefined` for the unassigned row. */
|
|
49
|
+
resource?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* What a context menu was opened on: a task, or an empty part of a row.
|
|
53
|
+
* `time` is the moment under the pointer, in minutes; from the keyboard it
|
|
54
|
+
* is the task's start.
|
|
55
|
+
*/
|
|
56
|
+
export type SchedulerMenuTarget = {
|
|
57
|
+
kind: 'task';
|
|
58
|
+
task: GanttTask;
|
|
59
|
+
resource: SchedulerResource | null;
|
|
60
|
+
time: number;
|
|
61
|
+
} | {
|
|
62
|
+
kind: 'row';
|
|
63
|
+
resource: SchedulerResource | null;
|
|
64
|
+
time: number;
|
|
65
|
+
};
|
|
66
|
+
export interface SchedulerRange {
|
|
67
|
+
/** The resource's id; `undefined` for the row of tasks without one. */
|
|
68
|
+
resource?: string;
|
|
69
|
+
/** As a task would have them: dates for whole days, else date and time. */
|
|
70
|
+
start: string;
|
|
71
|
+
end: string;
|
|
72
|
+
}
|
|
73
|
+
export interface SchedulerEmits {
|
|
74
|
+
/** After every change, including undo and redo. */
|
|
75
|
+
transaction: [tr: GanttTransaction];
|
|
76
|
+
taskClick: [task: GanttTask, event: MouseEvent];
|
|
77
|
+
taskDblclick: [task: GanttTask, event: MouseEvent];
|
|
78
|
+
/** Sent before the menu opens; `event.preventDefault()` keeps it closed. */
|
|
79
|
+
taskContextmenu: [task: GanttTask, event: MouseEvent];
|
|
80
|
+
/** A time range was drawn on an empty part of a row; add a task for it if you like. */
|
|
81
|
+
create: [range: SchedulerRange];
|
|
82
|
+
}
|
|
83
|
+
export interface SchedulerSlots {
|
|
84
|
+
/** A task's bar content. */
|
|
85
|
+
bar?: (props: {
|
|
86
|
+
task: GanttTask;
|
|
87
|
+
}) => unknown;
|
|
88
|
+
/** A resource in the list. */
|
|
89
|
+
resource?: (props: {
|
|
90
|
+
resource: SchedulerResource;
|
|
91
|
+
}) => unknown;
|
|
92
|
+
default?: () => unknown;
|
|
93
|
+
}
|
|
94
|
+
export interface SchedulerExpose {
|
|
95
|
+
/** Applies changes as one transaction, one undo step. */
|
|
96
|
+
transact(fn: (tr: GanttTransaction) => void, meta?: GanttTransactionMeta): GanttTransaction;
|
|
97
|
+
undo(): boolean;
|
|
98
|
+
redo(): boolean;
|
|
99
|
+
readonly canUndo: boolean;
|
|
100
|
+
readonly canRedo: boolean;
|
|
101
|
+
/** Zooms so that all tasks fit. */
|
|
102
|
+
fit(): void;
|
|
103
|
+
scrollToDate(date: string): void;
|
|
104
|
+
scrollToToday(): void;
|
|
105
|
+
scrollToTask(id: string): void;
|
|
106
|
+
focusTask(id: string): void;
|
|
107
|
+
zoomIn(): void;
|
|
108
|
+
zoomOut(): void;
|
|
109
|
+
}
|