@memberjunction/ng-timeline 2.32.2 → 2.33.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.
Files changed (2) hide show
  1. package/README.md +211 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,211 @@
1
+ # @memberjunction/ng-timeline
2
+
3
+ The `@memberjunction/ng-timeline` package provides a comprehensive timeline component for chronological display of data from MemberJunction entities. The component leverages Kendo UI's Timeline component to render events in either horizontal or vertical orientation.
4
+
5
+ ## Features
6
+
7
+ - Display data from multiple entity sources on a unified timeline
8
+ - Support for both vertical and horizontal timeline orientations
9
+ - Configurable data sources via entity views or direct entity arrays
10
+ - Customizable event display with title, summary, and date fields
11
+ - Support for custom icons and colors for different event groups
12
+ - Collapsible event details
13
+ - Ability to customize summary display with field values or custom functions
14
+ - Dynamic refresh and loading control
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @memberjunction/ng-timeline
20
+ ```
21
+
22
+ ## Requirements
23
+
24
+ - Angular 18+
25
+ - @memberjunction/core and related packages
26
+ - Kendo UI Angular components (Layout, Buttons, Indicators)
27
+
28
+ ## Usage
29
+
30
+ ### Basic Usage
31
+
32
+ First, import the TimelineModule in your module:
33
+
34
+ ```typescript
35
+ import { TimelineModule } from '@memberjunction/ng-timeline';
36
+
37
+ @NgModule({
38
+ imports: [
39
+ // other imports...
40
+ TimelineModule
41
+ ],
42
+ })
43
+ export class YourModule { }
44
+ ```
45
+
46
+ Then, use the component in your template:
47
+
48
+ ```html
49
+ <mj-timeline [Groups]="timelineGroups" [DisplayOrientation]="'vertical'"></mj-timeline>
50
+ ```
51
+
52
+ In your component file:
53
+
54
+ ```typescript
55
+ import { TimelineGroup } from '@memberjunction/ng-timeline';
56
+
57
+ export class YourComponent {
58
+ timelineGroups: TimelineGroup[] = [];
59
+
60
+ constructor() {
61
+ // Create a timeline group using entity data
62
+ const tasksGroup = new TimelineGroup();
63
+ tasksGroup.EntityName = 'Tasks';
64
+ tasksGroup.DataSourceType = 'entity';
65
+ tasksGroup.TitleFieldName = 'Title';
66
+ tasksGroup.DateFieldName = 'DueDate';
67
+ tasksGroup.Filter = "Status = 'Open'";
68
+
69
+ // Add the group to the array
70
+ this.timelineGroups.push(tasksGroup);
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Advanced Usage
76
+
77
+ #### Using Multiple Data Sources
78
+
79
+ You can display data from multiple entity types on the same timeline:
80
+
81
+ ```typescript
82
+ import { TimelineGroup } from '@memberjunction/ng-timeline';
83
+ import { RunViewParams } from '@memberjunction/core';
84
+
85
+ export class YourComponent implements OnInit {
86
+ timelineGroups: TimelineGroup[] = [];
87
+
88
+ async ngOnInit() {
89
+ // First group - Tasks
90
+ const tasksGroup = new TimelineGroup();
91
+ tasksGroup.EntityName = 'Tasks';
92
+ tasksGroup.DataSourceType = 'entity';
93
+ tasksGroup.TitleFieldName = 'Title';
94
+ tasksGroup.DateFieldName = 'DueDate';
95
+ tasksGroup.DisplayIconMode = 'custom';
96
+ tasksGroup.DisplayIcon = 'fa fa-tasks';
97
+ tasksGroup.DisplayColorMode = 'manual';
98
+ tasksGroup.DisplayColor = '#4287f5';
99
+
100
+ // Second group - Meetings
101
+ const meetingsGroup = new TimelineGroup();
102
+ meetingsGroup.EntityName = 'Meetings';
103
+ meetingsGroup.DataSourceType = 'entity';
104
+ meetingsGroup.TitleFieldName = 'Subject';
105
+ meetingsGroup.DateFieldName = 'StartTime';
106
+ meetingsGroup.SummaryMode = 'custom';
107
+ meetingsGroup.SummaryFunction = (record) => {
108
+ return `<strong>Location:</strong> ${record.Get('Location')}<br/>
109
+ <strong>Duration:</strong> ${record.Get('DurationMinutes')} minutes`;
110
+ };
111
+
112
+ // Add groups to array
113
+ this.timelineGroups.push(tasksGroup, meetingsGroup);
114
+ }
115
+ }
116
+ ```
117
+
118
+ #### Using RunView Parameters
119
+
120
+ You can create a TimelineGroup using the static FromView method:
121
+
122
+ ```typescript
123
+ import { TimelineGroup } from '@memberjunction/ng-timeline';
124
+ import { RunViewParams } from '@memberjunction/core';
125
+
126
+ export class YourComponent implements OnInit {
127
+ timelineGroups: TimelineGroup[] = [];
128
+
129
+ async ngOnInit() {
130
+ // Create RunViewParams
131
+ const params: RunViewParams = {
132
+ EntityName: 'Tasks',
133
+ ExtraFilter: "Status = 'Open'",
134
+ Skip: 0,
135
+ Take: 25,
136
+ OrderBy: 'DueDate DESC'
137
+ };
138
+
139
+ // Create TimelineGroup from view
140
+ const tasksGroup = await TimelineGroup.FromView(params);
141
+ tasksGroup.TitleFieldName = 'Title';
142
+ tasksGroup.DateFieldName = 'DueDate';
143
+
144
+ this.timelineGroups.push(tasksGroup);
145
+ }
146
+ }
147
+ ```
148
+
149
+ ## API Reference
150
+
151
+ ### TimelineComponent
152
+
153
+ #### Inputs
154
+
155
+ | Name | Type | Default | Description |
156
+ |------|------|---------|-------------|
157
+ | `DisplayOrientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Orientation of the timeline |
158
+ | `Groups` | `TimelineGroup[]` | `[]` | Array of groups to display on the timeline |
159
+ | `AllowLoad` | `boolean` | `true` | Whether to load data automatically |
160
+
161
+ #### Methods
162
+
163
+ | Name | Parameters | Return Type | Description |
164
+ |------|------------|-------------|-------------|
165
+ | `Refresh` | None | `Promise<void>` | Refreshes the timeline with current group data |
166
+
167
+ ### TimelineGroup Class
168
+
169
+ #### Properties
170
+
171
+ | Name | Type | Default | Description |
172
+ |------|------|---------|-------------|
173
+ | `EntityName` | `string` | (required) | Entity name for the records to display |
174
+ | `DataSourceType` | `'array' \| 'entity'` | `'entity'` | Specifies data source type |
175
+ | `Filter` | `string` | (optional) | Filter to apply when loading entity data |
176
+ | `EntityObjects` | `BaseEntity[]` | `[]` | Array of entities when using 'array' data source |
177
+ | `TitleFieldName` | `string` | (required) | Field name for event titles |
178
+ | `DateFieldName` | `string` | (required) | Field name for event dates |
179
+ | `DisplayIconMode` | `'standard' \| 'custom'` | `'standard'` | Icon display mode |
180
+ | `DisplayIcon` | `string` | (optional) | Custom icon class for events |
181
+ | `DisplayColorMode` | `'auto' \| 'manual'` | `'auto'` | Color selection mode |
182
+ | `DisplayColor` | `string` | (optional) | Manual color for events |
183
+ | `SummaryMode` | `'field' \| 'custom' \| 'none'` | `'field'` | Mode for summary display |
184
+ | `SummaryFunction` | `(record: any) => string` | (optional) | Function for custom summary generation |
185
+
186
+ #### Static Methods
187
+
188
+ | Name | Parameters | Return Type | Description |
189
+ |------|------------|-------------|-------------|
190
+ | `FromView` | `RunViewParams` | `Promise<TimelineGroup>` | Creates a TimelineGroup from RunViewParams |
191
+
192
+ ## Styling
193
+
194
+ The component uses Kendo UI's styling for the timeline display. You can customize the appearance by targeting the Kendo UI elements or creating custom CSS for your implementation.
195
+
196
+ ## Dependencies
197
+
198
+ - @angular/common
199
+ - @angular/core
200
+ - @angular/forms
201
+ - @angular/router
202
+ - @memberjunction/core
203
+ - @memberjunction/core-entities
204
+ - @memberjunction/global
205
+ - @memberjunction/ng-container-directives
206
+ - @memberjunction/ng-entity-form-dialog
207
+ - @memberjunction/ng-shared
208
+ - @progress/kendo-angular-buttons
209
+ - @progress/kendo-angular-layout
210
+ - @progress/kendo-angular-indicators
211
+ - @progress/kendo-angular-scheduler
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-timeline",
3
- "version": "2.32.2",
3
+ "version": "2.33.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.32.2",
29
- "@memberjunction/global": "2.32.2",
30
- "@memberjunction/core": "2.32.2",
31
- "@memberjunction/ng-container-directives": "2.32.2",
32
- "@memberjunction/ng-entity-form-dialog": "2.32.2",
33
- "@memberjunction/ng-shared": "2.32.2",
28
+ "@memberjunction/core-entities": "2.33.0",
29
+ "@memberjunction/global": "2.33.0",
30
+ "@memberjunction/core": "2.33.0",
31
+ "@memberjunction/ng-container-directives": "2.33.0",
32
+ "@memberjunction/ng-entity-form-dialog": "2.33.0",
33
+ "@memberjunction/ng-shared": "2.33.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",