@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.
Files changed (2) hide show
  1. package/README.md +20 -20
  2. 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, Task, TaskLink } from '@timelinekit/angular';
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
- const taskA = this.gantt.list.addTask(new Task({ id: '1', name: 'Design', startTime: '2027-01-05', endTime: '2027-01-09' }));
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
- const resource = this.scheduler.data.addResource(new SchedulerResource({ id: '1', name: 'Room A' }));
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, CalendarItem } from '@timelinekit/angular';
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.data.addItem(new CalendarItem({
121
- id: '1',
122
- name: 'Team Standup',
123
- startTime: '2027-01-05T09:00',
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.list.addTask(...);
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.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/core": ">=19.0.0",
7
- "@timelinekit/core": ">=1.0.8"
7
+ "@timelinekit/core": ">=1.0.10"
8
8
  },
9
9
  "files": [
10
10
  "fesm2022",