@memberjunction/ng-timeline 2.43.0 → 2.45.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/README.md +171 -38
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# @memberjunction/ng-timeline
|
|
2
2
|
|
|
3
|
-
The `@memberjunction/ng-timeline` package provides a comprehensive
|
|
3
|
+
The `@memberjunction/ng-timeline` package provides a comprehensive Angular component for displaying chronological data from MemberJunction entities in a timeline format. Built on top of Kendo UI's Timeline component, it offers a flexible and intuitive way to visualize time-based data from multiple entity sources.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- Display data from multiple
|
|
8
|
-
- Support for both vertical and horizontal timeline
|
|
9
|
-
-
|
|
10
|
-
- Customizable
|
|
11
|
-
- Support for custom icons and colors for different event groups
|
|
12
|
-
- Collapsible event details
|
|
13
|
-
-
|
|
14
|
-
-
|
|
7
|
+
- **Multiple Data Sources**: Display data from multiple MemberJunction entities on a unified timeline
|
|
8
|
+
- **Flexible Orientation**: Support for both vertical and horizontal timeline layouts
|
|
9
|
+
- **Data Source Options**: Load data via entity views with filters or provide pre-loaded entity arrays
|
|
10
|
+
- **Customizable Display**: Configure title, date, and summary fields for each timeline item
|
|
11
|
+
- **Visual Customization**: Support for custom icons and colors for different event groups
|
|
12
|
+
- **Interactive UI**: Collapsible event details with alternating layout mode
|
|
13
|
+
- **Dynamic Content**: Custom summary generation via callback functions
|
|
14
|
+
- **Refresh Control**: Manual control over data loading and refresh operations
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -21,9 +21,12 @@ npm install @memberjunction/ng-timeline
|
|
|
21
21
|
|
|
22
22
|
## Requirements
|
|
23
23
|
|
|
24
|
-
- Angular 18
|
|
25
|
-
- @memberjunction/core and related packages
|
|
26
|
-
- Kendo UI Angular components
|
|
24
|
+
- Angular 18.0.2 or higher
|
|
25
|
+
- @memberjunction/core and related MemberJunction packages
|
|
26
|
+
- Kendo UI Angular components:
|
|
27
|
+
- @progress/kendo-angular-layout (v16.2.0)
|
|
28
|
+
- @progress/kendo-angular-buttons (v16.2.0)
|
|
29
|
+
- @progress/kendo-angular-indicators (v16.2.0)
|
|
27
30
|
|
|
28
31
|
## Usage
|
|
29
32
|
|
|
@@ -76,35 +79,36 @@ export class YourComponent {
|
|
|
76
79
|
|
|
77
80
|
#### Using Multiple Data Sources
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
Display data from multiple entity types on the same timeline with different visual treatments:
|
|
80
83
|
|
|
81
84
|
```typescript
|
|
82
85
|
import { TimelineGroup } from '@memberjunction/ng-timeline';
|
|
83
|
-
import {
|
|
86
|
+
import { BaseEntity } from '@memberjunction/core';
|
|
84
87
|
|
|
85
88
|
export class YourComponent implements OnInit {
|
|
86
89
|
timelineGroups: TimelineGroup[] = [];
|
|
87
90
|
|
|
88
91
|
async ngOnInit() {
|
|
89
|
-
// First group - Tasks
|
|
92
|
+
// First group - Tasks with custom icon and color
|
|
90
93
|
const tasksGroup = new TimelineGroup();
|
|
91
94
|
tasksGroup.EntityName = 'Tasks';
|
|
92
95
|
tasksGroup.DataSourceType = 'entity';
|
|
93
96
|
tasksGroup.TitleFieldName = 'Title';
|
|
94
97
|
tasksGroup.DateFieldName = 'DueDate';
|
|
98
|
+
tasksGroup.Filter = "Status = 'Active'"; // Optional filter
|
|
95
99
|
tasksGroup.DisplayIconMode = 'custom';
|
|
96
100
|
tasksGroup.DisplayIcon = 'fa fa-tasks';
|
|
97
101
|
tasksGroup.DisplayColorMode = 'manual';
|
|
98
102
|
tasksGroup.DisplayColor = '#4287f5';
|
|
99
103
|
|
|
100
|
-
// Second group - Meetings
|
|
104
|
+
// Second group - Meetings with custom summary
|
|
101
105
|
const meetingsGroup = new TimelineGroup();
|
|
102
106
|
meetingsGroup.EntityName = 'Meetings';
|
|
103
107
|
meetingsGroup.DataSourceType = 'entity';
|
|
104
108
|
meetingsGroup.TitleFieldName = 'Subject';
|
|
105
109
|
meetingsGroup.DateFieldName = 'StartTime';
|
|
106
110
|
meetingsGroup.SummaryMode = 'custom';
|
|
107
|
-
meetingsGroup.SummaryFunction = (record) => {
|
|
111
|
+
meetingsGroup.SummaryFunction = (record: BaseEntity) => {
|
|
108
112
|
return `<strong>Location:</strong> ${record.Get('Location')}<br/>
|
|
109
113
|
<strong>Duration:</strong> ${record.Get('DurationMinutes')} minutes`;
|
|
110
114
|
};
|
|
@@ -117,7 +121,7 @@ export class YourComponent implements OnInit {
|
|
|
117
121
|
|
|
118
122
|
#### Using RunView Parameters
|
|
119
123
|
|
|
120
|
-
|
|
124
|
+
Create a TimelineGroup using pre-configured RunViewParams:
|
|
121
125
|
|
|
122
126
|
```typescript
|
|
123
127
|
import { TimelineGroup } from '@memberjunction/ng-timeline';
|
|
@@ -127,25 +131,89 @@ export class YourComponent implements OnInit {
|
|
|
127
131
|
timelineGroups: TimelineGroup[] = [];
|
|
128
132
|
|
|
129
133
|
async ngOnInit() {
|
|
130
|
-
//
|
|
134
|
+
// Configure RunViewParams for data retrieval
|
|
131
135
|
const params: RunViewParams = {
|
|
132
136
|
EntityName: 'Tasks',
|
|
133
|
-
ExtraFilter: "Status = 'Open'",
|
|
137
|
+
ExtraFilter: "Status = 'Open' AND Priority = 'High'",
|
|
134
138
|
Skip: 0,
|
|
135
|
-
Take:
|
|
139
|
+
Take: 50,
|
|
136
140
|
OrderBy: 'DueDate DESC'
|
|
137
141
|
};
|
|
138
142
|
|
|
139
|
-
// Create TimelineGroup from view
|
|
143
|
+
// Create TimelineGroup from view parameters
|
|
140
144
|
const tasksGroup = await TimelineGroup.FromView(params);
|
|
141
145
|
tasksGroup.TitleFieldName = 'Title';
|
|
142
146
|
tasksGroup.DateFieldName = 'DueDate';
|
|
147
|
+
tasksGroup.DisplayIconMode = 'custom';
|
|
148
|
+
tasksGroup.DisplayIcon = 'fa fa-exclamation-circle';
|
|
143
149
|
|
|
144
150
|
this.timelineGroups.push(tasksGroup);
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
153
|
```
|
|
148
154
|
|
|
155
|
+
#### Using Pre-loaded Entity Arrays
|
|
156
|
+
|
|
157
|
+
For scenarios where you already have entity data loaded:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { TimelineGroup } from '@memberjunction/ng-timeline';
|
|
161
|
+
import { BaseEntity } from '@memberjunction/core';
|
|
162
|
+
|
|
163
|
+
export class YourComponent {
|
|
164
|
+
timelineGroups: TimelineGroup[] = [];
|
|
165
|
+
|
|
166
|
+
displayLoadedData(entities: BaseEntity[]) {
|
|
167
|
+
const group = new TimelineGroup();
|
|
168
|
+
group.EntityName = 'Custom Events';
|
|
169
|
+
group.DataSourceType = 'array'; // Use provided array instead of loading
|
|
170
|
+
group.EntityObjects = entities;
|
|
171
|
+
group.TitleFieldName = 'EventName';
|
|
172
|
+
group.DateFieldName = 'EventDate';
|
|
173
|
+
group.SummaryMode = 'field';
|
|
174
|
+
|
|
175
|
+
this.timelineGroups = [group];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### Deferred Loading
|
|
181
|
+
|
|
182
|
+
Control when the timeline loads data using the `AllowLoad` property:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import { Component, ViewChild } from '@angular/core';
|
|
186
|
+
import { TimelineComponent, TimelineGroup } from '@memberjunction/ng-timeline';
|
|
187
|
+
|
|
188
|
+
@Component({
|
|
189
|
+
template: `
|
|
190
|
+
<mj-timeline
|
|
191
|
+
#timeline
|
|
192
|
+
[Groups]="timelineGroups"
|
|
193
|
+
[AllowLoad]="false">
|
|
194
|
+
</mj-timeline>
|
|
195
|
+
<button (click)="loadTimeline()">Load Timeline Data</button>
|
|
196
|
+
`
|
|
197
|
+
})
|
|
198
|
+
export class YourComponent {
|
|
199
|
+
@ViewChild('timeline') timeline!: TimelineComponent;
|
|
200
|
+
timelineGroups: TimelineGroup[] = [];
|
|
201
|
+
|
|
202
|
+
constructor() {
|
|
203
|
+
// Configure groups but don't load yet
|
|
204
|
+
const group = new TimelineGroup();
|
|
205
|
+
group.EntityName = 'Events';
|
|
206
|
+
group.TitleFieldName = 'Name';
|
|
207
|
+
group.DateFieldName = 'EventDate';
|
|
208
|
+
this.timelineGroups = [group];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async loadTimeline() {
|
|
212
|
+
// Manually trigger data loading
|
|
213
|
+
await this.timeline.Refresh();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
149
217
|
## API Reference
|
|
150
218
|
|
|
151
219
|
### TimelineComponent
|
|
@@ -181,7 +249,8 @@ export class YourComponent implements OnInit {
|
|
|
181
249
|
| `DisplayColorMode` | `'auto' \| 'manual'` | `'auto'` | Color selection mode |
|
|
182
250
|
| `DisplayColor` | `string` | (optional) | Manual color for events |
|
|
183
251
|
| `SummaryMode` | `'field' \| 'custom' \| 'none'` | `'field'` | Mode for summary display |
|
|
184
|
-
| `
|
|
252
|
+
| `SummaryFieldName` | `string` | (optional) | Field name for summary when using 'field' mode (Note: Currently uses TitleFieldName) |
|
|
253
|
+
| `SummaryFunction` | `(record: BaseEntity) => string` | (optional) | Function for custom summary generation |
|
|
185
254
|
|
|
186
255
|
#### Static Methods
|
|
187
256
|
|
|
@@ -191,21 +260,85 @@ export class YourComponent implements OnInit {
|
|
|
191
260
|
|
|
192
261
|
## Styling
|
|
193
262
|
|
|
194
|
-
The component uses Kendo UI's styling
|
|
263
|
+
The component uses Kendo UI's Timeline styling with additional customization options:
|
|
264
|
+
|
|
265
|
+
- The timeline component automatically applies alternating layout mode for better visual separation
|
|
266
|
+
- Events are displayed with collapsible details for better space utilization
|
|
267
|
+
- Custom CSS can be applied by targeting the `.wrapper` class or Kendo UI elements
|
|
268
|
+
- Icon and color customization per group allows for visual categorization
|
|
269
|
+
|
|
270
|
+
### CSS Example
|
|
271
|
+
|
|
272
|
+
```css
|
|
273
|
+
/* Custom timeline styling */
|
|
274
|
+
mj-timeline .wrapper {
|
|
275
|
+
height: 100%;
|
|
276
|
+
padding: 20px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* Custom event styling */
|
|
280
|
+
mj-timeline .k-timeline-event {
|
|
281
|
+
/* Your custom styles */
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Integration with MemberJunction
|
|
286
|
+
|
|
287
|
+
This component is designed to work seamlessly with the MemberJunction framework:
|
|
288
|
+
|
|
289
|
+
- **Entity System**: Automatically loads and displays data from any MemberJunction entity
|
|
290
|
+
- **Metadata Integration**: Leverages MJ's metadata system for entity field access
|
|
291
|
+
- **View System**: Supports RunView parameters for flexible data retrieval
|
|
292
|
+
- **Container Directives**: Uses `mjFillContainer` directive for responsive layouts
|
|
293
|
+
- **Entity Form Dialog**: Can integrate with entity form dialogs for detailed views (future enhancement)
|
|
294
|
+
|
|
295
|
+
## Performance Considerations
|
|
296
|
+
|
|
297
|
+
- **Data Loading**: The component loads all data at once. For large datasets, consider using filters or pagination
|
|
298
|
+
- **Multiple Groups**: Each group triggers a separate data query. Consolidate groups when possible
|
|
299
|
+
- **Refresh Operations**: The `Refresh()` method reloads all groups. Use judiciously for performance
|
|
195
300
|
|
|
196
301
|
## Dependencies
|
|
197
302
|
|
|
198
|
-
|
|
199
|
-
- @
|
|
200
|
-
- @
|
|
201
|
-
- @
|
|
202
|
-
- @memberjunction/
|
|
203
|
-
- @memberjunction/
|
|
204
|
-
- @memberjunction/
|
|
205
|
-
- @
|
|
206
|
-
- @
|
|
207
|
-
- @
|
|
208
|
-
- @progress/kendo-angular-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
303
|
+
### Production Dependencies
|
|
304
|
+
- @memberjunction/core (^2.43.0)
|
|
305
|
+
- @memberjunction/core-entities (^2.43.0)
|
|
306
|
+
- @memberjunction/global (^2.43.0)
|
|
307
|
+
- @memberjunction/ng-container-directives (^2.43.0)
|
|
308
|
+
- @memberjunction/ng-entity-form-dialog (^2.43.0)
|
|
309
|
+
- @memberjunction/ng-shared (^2.43.0)
|
|
310
|
+
- @progress/kendo-angular-buttons (^16.2.0)
|
|
311
|
+
- @progress/kendo-angular-layout (^16.2.0)
|
|
312
|
+
- @progress/kendo-angular-indicators (^16.2.0)
|
|
313
|
+
- @progress/kendo-angular-scheduler (^16.2.0)
|
|
314
|
+
- tslib (^2.3.0)
|
|
315
|
+
|
|
316
|
+
### Peer Dependencies
|
|
317
|
+
- @angular/common (^18.0.2)
|
|
318
|
+
- @angular/core (^18.0.2)
|
|
319
|
+
- @angular/forms (^18.0.2)
|
|
320
|
+
- @angular/router (^18.0.2)
|
|
321
|
+
|
|
322
|
+
## Building
|
|
323
|
+
|
|
324
|
+
This package is part of the MemberJunction monorepo. To build:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# From the package directory
|
|
328
|
+
npm run build
|
|
329
|
+
|
|
330
|
+
# From the monorepo root
|
|
331
|
+
turbo build --filter="@memberjunction/ng-timeline"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Future Enhancements
|
|
335
|
+
|
|
336
|
+
- Support for pagination and virtual scrolling for large datasets
|
|
337
|
+
- Integration with entity form dialogs for inline editing
|
|
338
|
+
- Custom event templates for advanced display scenarios
|
|
339
|
+
- Export functionality for timeline data
|
|
340
|
+
- Real-time updates via entity change notifications
|
|
341
|
+
|
|
342
|
+
## License
|
|
343
|
+
|
|
344
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-timeline",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
4
4
|
"description": "MemberJunction: Timeline Display UI component",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"@angular/router": "18.0.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@memberjunction/core-entities": "2.
|
|
29
|
-
"@memberjunction/global": "2.
|
|
30
|
-
"@memberjunction/core": "2.
|
|
31
|
-
"@memberjunction/ng-container-directives": "2.
|
|
32
|
-
"@memberjunction/ng-entity-form-dialog": "2.
|
|
33
|
-
"@memberjunction/ng-shared": "2.
|
|
28
|
+
"@memberjunction/core-entities": "2.45.0",
|
|
29
|
+
"@memberjunction/global": "2.45.0",
|
|
30
|
+
"@memberjunction/core": "2.45.0",
|
|
31
|
+
"@memberjunction/ng-container-directives": "2.45.0",
|
|
32
|
+
"@memberjunction/ng-entity-form-dialog": "2.45.0",
|
|
33
|
+
"@memberjunction/ng-shared": "2.45.0",
|
|
34
34
|
"@progress/kendo-angular-buttons": "16.2.0",
|
|
35
35
|
"@progress/kendo-angular-layout": "16.2.0",
|
|
36
36
|
"@progress/kendo-angular-indicators": "16.2.0",
|