@dhtmlx/trial-vue-gantt 1.1.2 → 9.1.4

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.
Files changed (46) hide show
  1. package/README.md +126 -262
  2. package/dist/dhtmlxgantt.vue.es.d.ts +352 -0
  3. package/dist/dhtmlxgantt.vue.es.js +18052 -0
  4. package/dist/vue-gantt.css +1 -0
  5. package/license.txt +43 -0
  6. package/package.json +55 -62
  7. package/whatsnew.md +1157 -0
  8. package/public/dist/gantt.js +0 -1
  9. package/src/components/Gantt.vue +0 -238
  10. package/src/components/TimeScale.vue +0 -57
  11. package/src/components/chart/Bars.vue +0 -470
  12. package/src/components/chart/CellGrid.vue +0 -22
  13. package/src/components/chart/Chart.vue +0 -236
  14. package/src/components/chart/Links.vue +0 -35
  15. package/src/components/chart/NewLink.vue +0 -39
  16. package/src/components/grid/Body.vue +0 -256
  17. package/src/components/grid/Grid.vue +0 -98
  18. package/src/components/grid/Header.vue +0 -104
  19. package/src/components/grid/actions/reorder.js +0 -193
  20. package/src/components/sidebar/Links.vue +0 -147
  21. package/src/components/sidebar/Sidebar.vue +0 -219
  22. package/src/locales/cn.js +0 -21
  23. package/src/locales/en.js +0 -21
  24. package/src/locales/ru.js +0 -21
  25. package/src/main.js +0 -46
  26. package/src/state/local.js +0 -48
  27. package/src/wx/Button.vue +0 -54
  28. package/src/wx/CNLocale.js +0 -15
  29. package/src/wx/Calendar.vue +0 -194
  30. package/src/wx/Counter.vue +0 -154
  31. package/src/wx/Datepicker.vue +0 -153
  32. package/src/wx/DefaultTheme.vue +0 -104
  33. package/src/wx/ENLocale.js +0 -15
  34. package/src/wx/IconButton.vue +0 -39
  35. package/src/wx/MaterialTheme.vue +0 -107
  36. package/src/wx/RULocale.js +0 -15
  37. package/src/wx/Select.vue +0 -75
  38. package/src/wx/Slider.vue +0 -150
  39. package/src/wx/Text.vue +0 -73
  40. package/src/wx/Textarea.vue +0 -63
  41. package/src/wx/Tooltip.vue +0 -110
  42. package/src/wx/index.js +0 -35
  43. package/src/wx/locale.js +0 -1
  44. package/src/wx/locales/cn.js +0 -39
  45. package/src/wx/locales/en.js +0 -39
  46. package/src/wx/locales/ru.js +0 -39
@@ -0,0 +1,352 @@
1
+ import * as vue from 'vue';
2
+ import { VNode, Component, Ref, MaybeRef } from 'vue';
3
+ import { Task, Link, GanttStatic, RouterFunction, Baseline, CalendarConfig, GanttConfigOptions, GanttPlugins, GanttTemplates } from '@dhx/gantt';
4
+ export * from '@dhx/gantt';
5
+
6
+ interface VueKnownGanttEvents {
7
+ onBeforeLightbox?: (taskId: string | number) => boolean | void;
8
+ onTaskCreated?: (task: Task) => boolean | void;
9
+ onAfterTaskAdd?: (id: string | number, task: Task) => void;
10
+ onAfterTaskUpdate?: (id: string | number, task: Task) => void;
11
+ onAfterTaskDelete?: (id: string | number, task: Task) => void;
12
+ onAfterLinkAdd?: (id: string | number, link: Link) => void;
13
+ onAfterLinkUpdate?: (id: string | number, link: Link) => void;
14
+ onAfterLinkDelete?: (id: string | number, link: Link) => void;
15
+ }
16
+ type VueGanttEvents = VueKnownGanttEvents & Record<string, (...args: any[]) => any>;
17
+ interface VueGanttExpose {
18
+ instance: GanttStatic | null;
19
+ }
20
+ interface VueGanttRef {
21
+ instance: GanttStatic | null;
22
+ }
23
+ interface VueGanttEmits {
24
+ ready: (instance: GanttStatic) => void;
25
+ }
26
+ interface DataCallbackChange {
27
+ entity: string;
28
+ action: string;
29
+ data: any;
30
+ id: number | string;
31
+ }
32
+ interface BatchChanges {
33
+ tasks?: DataCallbackChange[];
34
+ links?: DataCallbackChange[];
35
+ resources?: DataCallbackChange[];
36
+ resourceAssignments?: DataCallbackChange[];
37
+ }
38
+ interface DataSet {
39
+ tasks?: Array<Task | SerializedTask>;
40
+ links?: Array<Link | SerializedLink>;
41
+ resources?: any[];
42
+ resourceAssignments?: any[];
43
+ baselines?: any[];
44
+ }
45
+ interface VueGanttDataConfig {
46
+ load?: string | ((gantt: GanttStatic) => DataSet | Promise<DataSet>);
47
+ save?: string | RouterFunction;
48
+ batchSave?: (changes: BatchChanges) => void;
49
+ }
50
+ interface OnBeforeTaskDeleteConfirmArgs {
51
+ task: Task;
52
+ callback: () => void;
53
+ message: string;
54
+ title: string;
55
+ ganttInstance: GanttStatic;
56
+ }
57
+ interface OnBeforeLinkDeleteConfirmArgs {
58
+ link: Link;
59
+ callback: () => void;
60
+ message: string;
61
+ title: string;
62
+ ganttInstance: GanttStatic;
63
+ }
64
+ interface GanttModals {
65
+ onBeforeTaskDelete?: (args: OnBeforeTaskDeleteConfirmArgs) => void;
66
+ onBeforeLinkDelete?: (args: OnBeforeLinkDeleteConfirmArgs) => void;
67
+ }
68
+ interface Marker {
69
+ id?: string | number;
70
+ start_date: Date;
71
+ end_date?: Date;
72
+ css?: string;
73
+ text?: string | number | VNode | (() => VNode);
74
+ title?: string | number;
75
+ }
76
+ interface SerializedTask {
77
+ /** Task id, auto-generated if not set */
78
+ id: string | number;
79
+ /** Scheduled start. Accepts Date or a date string matching date_format. */
80
+ start_date?: Date | string;
81
+ /** Scheduled end. Accepts Date or a date string matching date_format. */
82
+ end_date?: Date | string;
83
+ /** Task duration (working-time units). */
84
+ duration?: number;
85
+ /** Task display name. */
86
+ text?: any;
87
+ /** "task" | "project" | "milestone" */
88
+ type?: string;
89
+ /** Parent task id. */
90
+ parent?: number | string;
91
+ /** Progress 0-1. */
92
+ progress?: number;
93
+ /** Whether the branch is initially open. */
94
+ open?: boolean;
95
+ auto_scheduling?: boolean;
96
+ unscheduled?: boolean;
97
+ constraint_date?: Date | string;
98
+ constraint_type?: string;
99
+ deadline?: Date | string;
100
+ color?: string;
101
+ textColor?: string;
102
+ progressColor?: string;
103
+ bar_height?: number;
104
+ row_height?: number;
105
+ hide_bar?: boolean;
106
+ baselines?: Baseline[];
107
+ calendar_id?: number | string;
108
+ editable?: boolean;
109
+ readonly?: boolean;
110
+ render?: string;
111
+ split_placement?: "inline" | "subrow" | "auto" | null | undefined;
112
+ resource?: Array<string>;
113
+ rollup?: boolean;
114
+ group_id?: string | number;
115
+ key?: string | number;
116
+ label?: string;
117
+ target?: string;
118
+ [customProperty: string]: any;
119
+ }
120
+ interface SerializedLink {
121
+ /** Link id. */
122
+ id: string | number;
123
+ /** Source (predecessor) task id. */
124
+ source: string | number;
125
+ /** Target (successor) task id. */
126
+ target: string | number;
127
+ /**
128
+ * Dependency type.
129
+ * "0" = finish-to-start, "1" = start-to-start,
130
+ * "2" = finish-to-finish, "3" = start-to-finish
131
+ */
132
+ type: string;
133
+ /** Lag (in duration units). */
134
+ lag?: number;
135
+ editable?: boolean;
136
+ readonly?: boolean;
137
+ [customProperty: string]: any;
138
+ }
139
+ interface WrapperCalendar {
140
+ id: string;
141
+ hours?: string[];
142
+ days?: {
143
+ weekdays?: Partial<Record<0 | 1 | 2 | 3 | 4 | 5 | 6, string[] | boolean>>;
144
+ dates?: Record<string, string[] | boolean>;
145
+ };
146
+ customWeeks?: Record<string, {
147
+ from: Date;
148
+ to: Date;
149
+ hours?: string[];
150
+ days?: {
151
+ weekdays?: Partial<Record<0 | 1 | 2 | 3 | 4 | 5 | 6, string[] | boolean>>;
152
+ dates?: Record<string, string[] | boolean>;
153
+ };
154
+ }>;
155
+ }
156
+ type TaskFilter = ((task: Task) => boolean) | null;
157
+ type ResourceFilter = ((resource: any) => boolean) | null;
158
+ interface WrapperInlineEditorMethods {
159
+ focus?: () => void;
160
+ save?: () => void;
161
+ setValue?: (value: any) => void;
162
+ getValue?: () => any;
163
+ isChanged?: (value: any) => boolean;
164
+ isValid?: () => boolean;
165
+ }
166
+ interface InlineEditorComponentProps {
167
+ initialValue: any;
168
+ task: Task;
169
+ save: () => void;
170
+ cancel: () => void;
171
+ ganttInstance: GanttStatic;
172
+ }
173
+ interface ActiveInlineEditor {
174
+ id: string;
175
+ placeholder: HTMLElement;
176
+ editorType: string;
177
+ initialValue: any;
178
+ task: Task;
179
+ onMount?: () => void;
180
+ }
181
+ interface CustomLightboxProps {
182
+ data: any;
183
+ onSave: (updatedTask: any) => void;
184
+ onCancel: () => void;
185
+ onDelete: () => void;
186
+ ganttInstance: GanttStatic;
187
+ }
188
+ type TemplateWrapper = (node: VNode) => VNode;
189
+ type GroupTasks = any;
190
+ interface VueGanttProps {
191
+ tasks?: Array<Task | SerializedTask>;
192
+ links?: Array<Link | SerializedLink>;
193
+ resources?: any[] | null;
194
+ resourceAssignments?: any[] | null;
195
+ baselines?: any[] | null;
196
+ markers?: Marker[] | null;
197
+ calendars?: (WrapperCalendar | CalendarConfig)[] | null;
198
+ data?: VueGanttDataConfig | null;
199
+ config?: Partial<GanttConfigOptions>;
200
+ plugins?: GanttPlugins;
201
+ templates?: Partial<GanttTemplates>;
202
+ locale?: string | Record<string, any>;
203
+ theme?: string;
204
+ filter?: TaskFilter;
205
+ resourceFilter?: ResourceFilter;
206
+ modals?: GanttModals | null;
207
+ groupTasks?: GroupTasks;
208
+ inlineEditors?: Record<string, Component>;
209
+ customLightbox?: Component | null;
210
+ templateWrapper?: TemplateWrapper | null;
211
+ events?: VueGanttEvents;
212
+ [key: string]: any;
213
+ }
214
+
215
+ declare const VueGantt: vue.DefineComponent<{
216
+ [x: string]: /*elided*/ any;
217
+ tasks?: Array<Task | SerializedTask>;
218
+ links?: Array<Link | SerializedLink>;
219
+ resources?: any[] | null;
220
+ resourceAssignments?: any[] | null;
221
+ baselines?: any[] | null;
222
+ markers?: Marker[] | null;
223
+ calendars?: (WrapperCalendar | CalendarConfig)[] | null;
224
+ data?: VueGanttDataConfig | null;
225
+ config?: Partial<GanttConfigOptions>;
226
+ plugins?: GanttPlugins;
227
+ templates?: Partial<GanttTemplates>;
228
+ locale?: string | Record<string, any>;
229
+ theme?: string;
230
+ filter?: TaskFilter;
231
+ resourceFilter?: ResourceFilter;
232
+ modals?: GanttModals | null;
233
+ groupTasks?: GroupTasks;
234
+ inlineEditors?: Record<string, Component>;
235
+ customLightbox?: Component | null;
236
+ templateWrapper?: TemplateWrapper | null;
237
+ events?: VueKnownGanttEvents & Record<string, (...args: any[]) => any>;
238
+ }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
239
+ [key: string]: any;
240
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
241
+ ready: (instance: GanttStatic) => boolean;
242
+ }, string, vue.PublicProps, Readonly<{
243
+ [x: string]: /*elided*/ any;
244
+ tasks?: Array<Task | SerializedTask>;
245
+ links?: Array<Link | SerializedLink>;
246
+ resources?: any[] | null;
247
+ resourceAssignments?: any[] | null;
248
+ baselines?: any[] | null;
249
+ markers?: Marker[] | null;
250
+ calendars?: (WrapperCalendar | CalendarConfig)[] | null;
251
+ data?: VueGanttDataConfig | null;
252
+ config?: Partial<GanttConfigOptions>;
253
+ plugins?: GanttPlugins;
254
+ templates?: Partial<GanttTemplates>;
255
+ locale?: string | Record<string, any>;
256
+ theme?: string;
257
+ filter?: TaskFilter;
258
+ resourceFilter?: ResourceFilter;
259
+ modals?: GanttModals | null;
260
+ groupTasks?: GroupTasks;
261
+ inlineEditors?: Record<string, Component>;
262
+ customLightbox?: Component | null;
263
+ templateWrapper?: TemplateWrapper | null;
264
+ events?: VueKnownGanttEvents & Record<string, (...args: any[]) => any>;
265
+ }> & Readonly<{
266
+ onReady?: (instance: GanttStatic) => any;
267
+ }>, {
268
+ baselines: any[];
269
+ tasks: (Task | SerializedTask)[];
270
+ links: (Link | SerializedLink)[];
271
+ resources: any[];
272
+ resourceAssignments: any[];
273
+ markers: Marker[];
274
+ calendars: any[];
275
+ data: VueGanttDataConfig;
276
+ config: Partial<GanttConfigOptions>;
277
+ plugins: GanttPlugins;
278
+ templates: Partial<GanttTemplates>;
279
+ locale: string | Record<string, any>;
280
+ theme: string;
281
+ filter: (task: Task) => boolean;
282
+ resourceFilter: (resource: any) => boolean;
283
+ modals: GanttModals;
284
+ groupTasks: any;
285
+ inlineEditors: Record<string, Component>;
286
+ customLightbox: any;
287
+ templateWrapper: TemplateWrapper;
288
+ events: VueGanttEvents;
289
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
290
+
291
+ declare function useWorkTime(ganttRef: Ref<VueGanttRef | null>): vue.ComputedRef<{
292
+ isWorkTime: ({ date, task, unit }: {
293
+ date: Date;
294
+ task?: Task | null;
295
+ unit?: string;
296
+ }) => boolean;
297
+ calculateEndDate: ({ start, duration, unit, task }: {
298
+ start: Date;
299
+ duration: number;
300
+ unit?: string;
301
+ task?: Task;
302
+ }) => Date;
303
+ calculateDuration: ({ start, end, task }: {
304
+ start: Date;
305
+ end: Date;
306
+ task?: Task;
307
+ }) => number;
308
+ getClosestWorkTime: ({ date, task, unit, dir }: {
309
+ date: Date;
310
+ task?: Task | null;
311
+ unit: string;
312
+ dir?: string;
313
+ }) => Date;
314
+ }>;
315
+
316
+ declare function useResourceAssignments(ganttRef: Ref<VueGanttRef | null>): vue.ComputedRef<{
317
+ getResourceAssignments(resourceId: string | number, taskId?: string | number): any;
318
+ getTaskResources(taskId: string | number): any;
319
+ }>;
320
+
321
+ declare function useGanttDatastore<T>(ganttRef: Ref<VueGanttRef | null>, storeName: string): vue.ComputedRef<{
322
+ getItem(id: string | number): T | null;
323
+ getItems(): T[];
324
+ hasChild(id: string | number): boolean;
325
+ getChildren(id: string | number): (string | number)[];
326
+ }>;
327
+
328
+ interface ExportToExcelConfig {
329
+ [key: string]: any;
330
+ }
331
+ declare function useGanttActions(ganttRef: Ref<VueGanttRef | null | undefined>): {
332
+ undo(): void;
333
+ redo(): void;
334
+ render(): void;
335
+ exportToPDF(): void;
336
+ exportToPNG(): void;
337
+ exportToExcel(config?: ExportToExcelConfig): void;
338
+ exportToMSProject(): void;
339
+ };
340
+
341
+ type EventHandler = (...args: any[]) => any;
342
+ declare function useGanttEvent(ganttRef: Ref<VueGanttRef | null | undefined>, eventName: MaybeRef<string>, handler: MaybeRef<EventHandler | null | undefined>): {
343
+ detach: () => void;
344
+ };
345
+
346
+ declare function defineGanttConfig<T extends Partial<GanttConfigOptions>>(config: T): T;
347
+ declare function defineGanttTemplates<T extends Partial<GanttTemplates>>(templates: T): T;
348
+ declare function defineGanttEvents<T extends VueGanttEvents>(events: T): T;
349
+ declare function defineInlineEditors<T extends Record<string, Component>>(inlineEditors: T): T;
350
+
351
+ export { VueGantt, VueGantt as default, defineGanttConfig, defineGanttEvents, defineGanttTemplates, defineInlineEditors, useGanttActions, useGanttDatastore, useGanttEvent, useResourceAssignments, useWorkTime };
352
+ export type { ActiveInlineEditor, BatchChanges, CustomLightboxProps, DataCallbackChange, DataSet, GanttModals, GroupTasks, InlineEditorComponentProps, Marker, OnBeforeLinkDeleteConfirmArgs, OnBeforeTaskDeleteConfirmArgs, ResourceFilter, SerializedLink, SerializedTask, TaskFilter, TemplateWrapper, VueGanttDataConfig, VueGanttEmits, VueGanttEvents, VueGanttExpose, VueGanttProps, VueGanttRef, VueKnownGanttEvents, WrapperCalendar, WrapperInlineEditorMethods };