@timelinekit/angular 1.0.8 → 1.0.10
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/README.md +20 -20
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,17 @@ All components are standalone. All types from `@timelinekit/core` are re-exporte
|
|
|
28
28
|
|
|
29
29
|
```typescript
|
|
30
30
|
import { Component, ViewChild, AfterViewInit } from '@angular/core';
|
|
31
|
-
import { GanttChart
|
|
31
|
+
import { GanttChart } from '@timelinekit/angular';
|
|
32
|
+
|
|
33
|
+
const data = {
|
|
34
|
+
tasks: [
|
|
35
|
+
{ id: '1', name: 'Design', startTime: '2027-01-05', endTime: '2027-01-09', type: 'task', progress: 100 },
|
|
36
|
+
{ id: '2', name: 'Development', startTime: '2027-01-12', endTime: '2027-01-23', type: 'task' },
|
|
37
|
+
],
|
|
38
|
+
links: [
|
|
39
|
+
{ id: 'l1', from: '1', to: '2', type: 'finishToStart' },
|
|
40
|
+
],
|
|
41
|
+
};
|
|
32
42
|
|
|
33
43
|
@Component({
|
|
34
44
|
selector: 'app-root',
|
|
@@ -43,9 +53,7 @@ export class AppComponent implements AfterViewInit {
|
|
|
43
53
|
@ViewChild('gantt') gantt!: GanttChart;
|
|
44
54
|
|
|
45
55
|
ngAfterViewInit() {
|
|
46
|
-
|
|
47
|
-
const taskB = this.gantt.list.addTask(new Task({ id: '2', name: 'Development', startTime: '2027-01-12', endTime: '2027-01-23' }));
|
|
48
|
-
this.gantt.list.addLink(new TaskLink({ id: 'l1', from: taskA, to: taskB, type: 'finishToStart' }));
|
|
56
|
+
this.gantt.load(JSON.stringify(data));
|
|
49
57
|
this.gantt.zoomToFit();
|
|
50
58
|
}
|
|
51
59
|
}
|
|
@@ -79,14 +87,8 @@ export class AppComponent implements AfterViewInit {
|
|
|
79
87
|
@ViewChild('scheduler') scheduler!: ResourceScheduler;
|
|
80
88
|
|
|
81
89
|
ngAfterViewInit() {
|
|
82
|
-
|
|
83
|
-
this.scheduler.data.addEvent(new SchedulerEvent(
|
|
84
|
-
id: 'e1',
|
|
85
|
-
resourceId: resource.id,
|
|
86
|
-
name: 'Meeting',
|
|
87
|
-
startTime: '2027-01-05T09:00',
|
|
88
|
-
endTime: '2027-01-05T10:30',
|
|
89
|
-
}));
|
|
90
|
+
this.scheduler.data.addResource(new SchedulerResource('1', 'Room A'));
|
|
91
|
+
this.scheduler.data.addEvent(new SchedulerEvent('e1', '1', 'Meeting', new Date('2027-01-05T09:00'), new Date('2027-01-05T10:30')));
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
```
|
|
@@ -102,7 +104,7 @@ export class AppComponent implements AfterViewInit {
|
|
|
102
104
|
|
|
103
105
|
```typescript
|
|
104
106
|
import { Component, ViewChild, AfterViewInit } from '@angular/core';
|
|
105
|
-
import { EventCalendar
|
|
107
|
+
import { EventCalendar } from '@timelinekit/angular';
|
|
106
108
|
|
|
107
109
|
@Component({
|
|
108
110
|
selector: 'app-root',
|
|
@@ -117,12 +119,10 @@ export class AppComponent implements AfterViewInit {
|
|
|
117
119
|
@ViewChild('calendar') calendar!: EventCalendar;
|
|
118
120
|
|
|
119
121
|
ngAfterViewInit() {
|
|
120
|
-
this.calendar.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
endTime: '2027-01-05T09:30',
|
|
125
|
-
type: 'Meeting',
|
|
122
|
+
this.calendar.load(JSON.stringify({
|
|
123
|
+
items: [
|
|
124
|
+
{ id: '1', name: 'Team Standup', startTime: '2027-01-05T09:00', endTime: '2027-01-05T09:30', type: 'Meeting' },
|
|
125
|
+
],
|
|
126
126
|
}));
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -143,7 +143,7 @@ Access the component API via `@ViewChild`:
|
|
|
143
143
|
@ViewChild('gantt') gantt!: GanttChart;
|
|
144
144
|
|
|
145
145
|
ngAfterViewInit() {
|
|
146
|
-
this.gantt.
|
|
146
|
+
this.gantt.load(JSON.stringify(data));
|
|
147
147
|
this.gantt.zoomIn();
|
|
148
148
|
this.gantt.undo();
|
|
149
149
|
this.gantt.exportToImage();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timelinekit/angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/core": ">=19.0.0",
|
|
7
|
-
"@timelinekit/core": ">=1.0.
|
|
7
|
+
"@timelinekit/core": ">=1.0.10"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"fesm2022",
|