@memberjunction/ng-treelist 2.32.2 → 2.34.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 +221 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,221 @@
1
+ # @memberjunction/ng-treelist
2
+
3
+ The `@memberjunction/ng-treelist` package provides a calendar-like visualization component using Kendo UI's Scheduler for displaying MemberJunction entity data in a timeline format. This component allows for chronological display of entity records with time-based properties.
4
+
5
+ ## Features
6
+
7
+ - Calendar-style visualization of MemberJunction entity data
8
+ - Week view display of timeline events
9
+ - Support for entity data sources through TimelineGroup configuration
10
+ - Customizable event display with title, date, and summary information
11
+ - Event styling with custom colors and icons
12
+ - Auto-refresh when data sources change
13
+ - Optional custom summary generation with configurable functions
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @memberjunction/ng-treelist
19
+ ```
20
+
21
+ ## Requirements
22
+
23
+ - Angular 18+
24
+ - @memberjunction/core and related packages
25
+ - Kendo UI Angular components (Scheduler, Layout, Buttons, Indicators)
26
+
27
+ ## Usage
28
+
29
+ ### Basic Usage
30
+
31
+ First, import the TimelineModule in your module:
32
+
33
+ ```typescript
34
+ import { TimelineModule } from '@memberjunction/ng-treelist';
35
+
36
+ @NgModule({
37
+ imports: [
38
+ // other imports...
39
+ TimelineModule
40
+ ],
41
+ })
42
+ export class YourModule { }
43
+ ```
44
+
45
+ Then, use the component in your template:
46
+
47
+ ```html
48
+ <mj-timeline [Groups]="timelineGroups"></mj-timeline>
49
+ ```
50
+
51
+ In your component file:
52
+
53
+ ```typescript
54
+ import { TimelineGroup } from '@memberjunction/ng-treelist';
55
+ import { RunView } from '@memberjunction/core';
56
+
57
+ export class YourComponent implements OnInit {
58
+ timelineGroups: TimelineGroup[] = [];
59
+
60
+ async ngOnInit() {
61
+ // Create a timeline group for tasks
62
+ const tasksGroup = new TimelineGroup();
63
+ tasksGroup.EntityName = 'Tasks';
64
+ tasksGroup.TitleFieldName = 'Title';
65
+ tasksGroup.DateFieldName = 'DueDate';
66
+
67
+ // Load data into the group
68
+ const rv = new RunView();
69
+ const result = await rv.RunView({
70
+ EntityName: 'Tasks',
71
+ ResultType: 'entity_object'
72
+ });
73
+
74
+ if (result && result.Success) {
75
+ tasksGroup.EntityObjects = result.Results;
76
+ this.timelineGroups.push(tasksGroup);
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ ### Advanced Usage
83
+
84
+ #### Custom Styling and Summary Functions
85
+
86
+ You can customize the appearance and content of timeline events:
87
+
88
+ ```typescript
89
+ import { TimelineGroup } from '@memberjunction/ng-treelist';
90
+ import { BaseEntity } from '@memberjunction/core';
91
+
92
+ export class YourComponent implements OnInit {
93
+ timelineGroups: TimelineGroup[] = [];
94
+
95
+ async ngOnInit() {
96
+ // Create a meeting events timeline group
97
+ const meetingsGroup = new TimelineGroup();
98
+ meetingsGroup.EntityName = 'Meetings';
99
+ meetingsGroup.TitleFieldName = 'Subject';
100
+ meetingsGroup.DateFieldName = 'StartTime';
101
+
102
+ // Custom styling
103
+ meetingsGroup.DisplayIconMode = 'custom';
104
+ meetingsGroup.DisplayIcon = 'fa fa-calendar-check';
105
+ meetingsGroup.DisplayColorMode = 'manual';
106
+ meetingsGroup.DisplayColor = '#4287f5';
107
+
108
+ // Custom summary function
109
+ meetingsGroup.SummaryMode = 'custom';
110
+ meetingsGroup.SummaryFunction = (record: BaseEntity) => {
111
+ return `<strong>Location:</strong> ${record.Get('Location')}<br>
112
+ <strong>Duration:</strong> ${record.Get('DurationMinutes')} minutes<br>
113
+ <strong>Attendees:</strong> ${record.Get('AttendeeCount')}`;
114
+ };
115
+
116
+ // Load data and add to groups
117
+ const rv = new RunView();
118
+ const result = await rv.RunView({
119
+ EntityName: 'Meetings',
120
+ ResultType: 'entity_object'
121
+ });
122
+
123
+ if (result && result.Success) {
124
+ meetingsGroup.EntityObjects = result.Results;
125
+ this.timelineGroups.push(meetingsGroup);
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ #### Using RunView Parameters
132
+
133
+ You can create a TimelineGroup using the static FromView method:
134
+
135
+ ```typescript
136
+ import { TimelineGroup } from '@memberjunction/ng-treelist';
137
+ import { RunViewParams } from '@memberjunction/core';
138
+
139
+ export class YourComponent implements OnInit {
140
+ timelineGroups: TimelineGroup[] = [];
141
+
142
+ async ngOnInit() {
143
+ // Create params for the view
144
+ const params: RunViewParams = {
145
+ EntityName: 'Appointments',
146
+ ExtraFilter: "Status = 'Confirmed'",
147
+ Skip: 0,
148
+ Take: 50,
149
+ OrderBy: 'AppointmentDate DESC'
150
+ };
151
+
152
+ // Create group from view
153
+ const appointmentsGroup = await TimelineGroup.FromView(params);
154
+ appointmentsGroup.TitleFieldName = 'Title';
155
+ appointmentsGroup.DateFieldName = 'AppointmentDate';
156
+
157
+ this.timelineGroups.push(appointmentsGroup);
158
+ }
159
+ }
160
+ ```
161
+
162
+ ## API Reference
163
+
164
+ ### TimelineComponent
165
+
166
+ #### Inputs
167
+
168
+ | Name | Type | Default | Description |
169
+ |------|------|---------|-------------|
170
+ | `Groups` | `TimelineGroup[]` | `[]` | Array of groups to display on the timeline |
171
+ | `AllowLoad` | `boolean` | `true` | Whether to load data automatically |
172
+
173
+ #### Methods
174
+
175
+ | Name | Parameters | Return Type | Description |
176
+ |------|------------|-------------|-------------|
177
+ | `Refresh` | None | `void` | Refreshes the timeline with current group data |
178
+
179
+ ### TimelineGroup Class
180
+
181
+ #### Properties
182
+
183
+ | Name | Type | Default | Description |
184
+ |------|------|---------|-------------|
185
+ | `EntityName` | `string` | (required) | Entity name for the records to display |
186
+ | `EntityObjects` | `BaseEntity[]` | `[]` | Array of entity objects to display |
187
+ | `TitleFieldName` | `string` | (required) | Field name for event titles |
188
+ | `DateFieldName` | `string` | (required) | Field name for event dates |
189
+ | `DisplayIconMode` | `'standard' \| 'custom'` | `'standard'` | Icon display mode |
190
+ | `DisplayIcon` | `string` | (optional) | Custom icon class for events |
191
+ | `DisplayColorMode` | `'auto' \| 'manual'` | `'auto'` | Color selection mode |
192
+ | `DisplayColor` | `string` | (optional) | Manual color for events |
193
+ | `SummaryMode` | `'field' \| 'custom' \| 'none'` | `'field'` | Mode for summary display |
194
+ | `SummaryFunction` | `(record: BaseEntity) => string` | (optional) | Function for custom summary generation |
195
+
196
+ #### Static Methods
197
+
198
+ | Name | Parameters | Return Type | Description |
199
+ |------|------------|-------------|-------------|
200
+ | `FromView` | `RunViewParams` | `Promise<TimelineGroup>` | Creates a TimelineGroup from RunViewParams |
201
+
202
+ ## Styling
203
+
204
+ The component uses Kendo UI's styling for the scheduler display. You can customize the appearance by targeting the Kendo UI scheduler elements in your CSS.
205
+
206
+ ## Dependencies
207
+
208
+ - @angular/common
209
+ - @angular/core
210
+ - @angular/forms
211
+ - @angular/router
212
+ - @memberjunction/core
213
+ - @memberjunction/core-entities
214
+ - @memberjunction/global
215
+ - @memberjunction/ng-container-directives
216
+ - @memberjunction/ng-entity-form-dialog
217
+ - @memberjunction/ng-shared
218
+ - @progress/kendo-angular-buttons
219
+ - @progress/kendo-angular-layout
220
+ - @progress/kendo-angular-indicators
221
+ - @progress/kendo-angular-scheduler
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-treelist",
3
- "version": "2.32.2",
3
+ "version": "2.34.0",
4
4
  "description": "MemberJunction: Treelist 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.34.0",
29
+ "@memberjunction/global": "2.34.0",
30
+ "@memberjunction/core": "2.34.0",
31
+ "@memberjunction/ng-container-directives": "2.34.0",
32
+ "@memberjunction/ng-entity-form-dialog": "2.34.0",
33
+ "@memberjunction/ng-shared": "2.34.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",