@memberjunction/ng-entity-viewer 2.131.0 → 2.133.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 +317 -124
- package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +792 -0
- package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -0
- package/dist/lib/entity-data-grid/entity-data-grid.component.js +3778 -0
- package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -0
- package/dist/lib/entity-data-grid/events/grid-events.d.ts +398 -0
- package/dist/lib/entity-data-grid/events/grid-events.d.ts.map +1 -0
- package/dist/lib/entity-data-grid/events/grid-events.js +556 -0
- package/dist/lib/entity-data-grid/events/grid-events.js.map +1 -0
- package/dist/lib/entity-data-grid/models/grid-types.d.ts +437 -0
- package/dist/lib/entity-data-grid/models/grid-types.d.ts.map +1 -0
- package/dist/lib/entity-data-grid/models/grid-types.js +37 -0
- package/dist/lib/entity-data-grid/models/grid-types.js.map +1 -0
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts +92 -2
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
- package/dist/lib/entity-viewer/entity-viewer.component.js +255 -92
- package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
- package/dist/lib/types.d.ts +14 -31
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/view-config-panel/view-config-panel.component.d.ts +363 -0
- package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -0
- package/dist/lib/view-config-panel/view-config-panel.component.js +2006 -0
- package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -0
- package/dist/module.d.ts +16 -13
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +24 -14
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +4 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +6 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +10 -6
- package/dist/lib/entity-grid/entity-grid.component.d.ts +0 -216
- package/dist/lib/entity-grid/entity-grid.component.d.ts.map +0 -1
- package/dist/lib/entity-grid/entity-grid.component.js +0 -676
- package/dist/lib/entity-grid/entity-grid.component.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# @memberjunction/ng-entity-viewer
|
|
2
2
|
|
|
3
|
-
Angular components for viewing MemberJunction entity data in multiple formats - grid and
|
|
3
|
+
Angular components for viewing MemberJunction entity data in multiple formats - grid, card, and timeline views with filtering, selection, toolbar actions, and comprehensive event handling.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Multiple View Modes**: Switch between grid (AG Grid) and
|
|
7
|
+
- **Multiple View Modes**: Switch between grid (AG Grid), card, and timeline views
|
|
8
|
+
- **Modern Data Grid**: `mj-entity-data-grid` with Before/After cancelable events, infinite scroll, state persistence
|
|
9
|
+
- **Configurable Toolbar**: Show/hide individual buttons, add custom buttons, overflow menu
|
|
8
10
|
- **Auto-Generated Layout**: Automatically structures columns/cards based on entity metadata
|
|
11
|
+
- **Server-Side Operations**: Filtering, sorting, and pagination with RunView integration
|
|
9
12
|
- **Client-Side Filtering**: SQL-style wildcard support (`%`) for consistent behavior
|
|
10
|
-
- **Selection Handling**:
|
|
11
|
-
- **
|
|
13
|
+
- **Selection Handling**: Single, multiple, and checkbox selection modes
|
|
14
|
+
- **Grid State Persistence**: Save/restore column widths, order, visibility, and sort state
|
|
12
15
|
- **Semantic Pills**: Auto-colored pills for status/type/category fields
|
|
13
16
|
|
|
14
17
|
## Installation
|
|
@@ -17,7 +20,7 @@ Angular components for viewing MemberJunction entity data in multiple formats -
|
|
|
17
20
|
npm install @memberjunction/ng-entity-viewer ag-grid-angular ag-grid-community
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
##
|
|
23
|
+
## Quick Start
|
|
21
24
|
|
|
22
25
|
### Import the Module
|
|
23
26
|
|
|
@@ -30,188 +33,377 @@ import { EntityViewerModule } from '@memberjunction/ng-entity-viewer';
|
|
|
30
33
|
export class MyModule { }
|
|
31
34
|
```
|
|
32
35
|
|
|
33
|
-
###
|
|
34
|
-
|
|
35
|
-
The main component that combines grid/cards with built-in filtering and view switching.
|
|
36
|
+
### Basic Usage
|
|
36
37
|
|
|
37
38
|
```html
|
|
38
|
-
<!--
|
|
39
|
+
<!-- Composite viewer with grid/cards/timeline toggle -->
|
|
39
40
|
<mj-entity-viewer
|
|
40
41
|
[entity]="selectedEntity"
|
|
41
42
|
(recordSelected)="onRecordSelected($event)"
|
|
42
43
|
(recordOpened)="onRecordOpened($event)">
|
|
43
44
|
</mj-entity-viewer>
|
|
44
45
|
|
|
45
|
-
<!--
|
|
46
|
-
<mj-entity-
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
defaultViewMode: 'cards',
|
|
53
|
-
pageSize: 500
|
|
54
|
-
}">
|
|
55
|
-
</mj-entity-viewer>
|
|
46
|
+
<!-- Standalone data grid with toolbar -->
|
|
47
|
+
<mj-entity-data-grid
|
|
48
|
+
[entityName]="'Contacts'"
|
|
49
|
+
[showToolbar]="true"
|
|
50
|
+
[selectionMode]="'multiple'"
|
|
51
|
+
(afterRowDoubleClick)="onRowDoubleClick($event)">
|
|
52
|
+
</mj-entity-data-grid>
|
|
56
53
|
```
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
---
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
## Components
|
|
58
|
+
|
|
59
|
+
### EntityDataGridComponent (`mj-entity-data-grid`)
|
|
60
|
+
|
|
61
|
+
Modern AG Grid-based data grid with rich event system and configurable toolbar.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<mj-entity-data-grid
|
|
65
|
+
[entityName]="'Contacts'"
|
|
66
|
+
[extraFilter]="'Status = \'Active\''"
|
|
67
|
+
[showToolbar]="true"
|
|
68
|
+
[toolbarConfig]="myToolbarConfig"
|
|
69
|
+
[selectionMode]="'multiple'"
|
|
70
|
+
[PaginationMode]="'infinite'"
|
|
71
|
+
[PageSize]="100"
|
|
72
|
+
(afterRowClick)="onRowClick($event)"
|
|
73
|
+
(afterRowDoubleClick)="onRowDoubleClick($event)"
|
|
74
|
+
(newButtonClick)="onAddNew()"
|
|
75
|
+
(exportButtonClick)="onExport()">
|
|
76
|
+
</mj-entity-data-grid>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Data Source Inputs
|
|
80
|
+
|
|
81
|
+
| Input | Type | Default | Description |
|
|
82
|
+
|-------|------|---------|-------------|
|
|
83
|
+
| `Params` | RunViewParams | - | Primary data source (supports stored views + dynamic views) |
|
|
84
|
+
| `entityName` | string | - | Entity name for dynamic views |
|
|
85
|
+
| `extraFilter` | string | - | Additional WHERE clause filter |
|
|
86
|
+
| `searchString` | string | - | User search string |
|
|
87
|
+
| `orderBy` | string | - | ORDER BY clause |
|
|
88
|
+
| `maxRows` | number | 0 | Max rows to fetch (0 = no limit) |
|
|
89
|
+
| `data` | BaseEntity[] | - | Pre-loaded data (bypasses RunView) |
|
|
90
|
+
| `AllowLoad` | boolean | true | Enable/disable data loading |
|
|
91
|
+
| `AutoRefreshOnParamsChange` | boolean | true | Auto-refresh when Params changes |
|
|
92
|
+
|
|
93
|
+
#### Pagination Inputs
|
|
94
|
+
|
|
95
|
+
| Input | Type | Default | Description |
|
|
96
|
+
|-------|------|---------|-------------|
|
|
97
|
+
| `PaginationMode` | 'client' \| 'infinite' | 'client' | Pagination strategy |
|
|
98
|
+
| `PageSize` | number | 100 | Rows per page (infinite mode) |
|
|
99
|
+
| `CacheBlockSize` | number | 100 | Cache block size (infinite mode) |
|
|
100
|
+
| `MaxBlocksInCache` | number | 10 | Max cached blocks |
|
|
101
|
+
|
|
102
|
+
#### Display Inputs
|
|
103
|
+
|
|
104
|
+
| Input | Type | Default | Description |
|
|
105
|
+
|-------|------|---------|-------------|
|
|
106
|
+
| `showToolbar` | boolean | true | Show the toolbar |
|
|
107
|
+
| `toolbarConfig` | GridToolbarConfig | - | Toolbar configuration |
|
|
108
|
+
| `selectionMode` | 'none' \| 'single' \| 'multiple' \| 'checkbox' | 'single' | Row selection mode |
|
|
109
|
+
| `height` | number \| 'auto' \| 'fit-content' | 'auto' | Grid height |
|
|
110
|
+
| `gridState` | ViewGridStateConfig | - | Column/sort state from User View |
|
|
111
|
+
| `allowSorting` | boolean | true | Enable column sorting |
|
|
112
|
+
| `allowColumnReorder` | boolean | true | Enable column reordering |
|
|
113
|
+
| `allowColumnResize` | boolean | true | Enable column resizing |
|
|
114
|
+
| `serverSideSorting` | boolean | true | Sort triggers server reload |
|
|
115
|
+
|
|
116
|
+
#### Before/After Events
|
|
117
|
+
|
|
118
|
+
The grid uses a cancelable event pattern. Before events can be canceled by setting `event.cancel = true`.
|
|
119
|
+
|
|
120
|
+
**Row Selection Events:**
|
|
121
|
+
| Event | Args Type | Description |
|
|
122
|
+
|-------|-----------|-------------|
|
|
123
|
+
| `beforeRowSelect` | BeforeRowSelectEventArgs | Before row is selected |
|
|
124
|
+
| `afterRowSelect` | AfterRowSelectEventArgs | After row is selected |
|
|
125
|
+
| `beforeRowDeselect` | BeforeRowDeselectEventArgs | Before row is deselected |
|
|
126
|
+
| `afterRowDeselect` | AfterRowDeselectEventArgs | After row is deselected |
|
|
127
|
+
|
|
128
|
+
**Row Click Events:**
|
|
129
|
+
| Event | Args Type | Description |
|
|
130
|
+
|-------|-----------|-------------|
|
|
131
|
+
| `beforeRowClick` | BeforeRowClickEventArgs | Before row click processes |
|
|
132
|
+
| `afterRowClick` | AfterRowClickEventArgs | After row click |
|
|
133
|
+
| `beforeRowDoubleClick` | BeforeRowDoubleClickEventArgs | Before double-click |
|
|
134
|
+
| `afterRowDoubleClick` | AfterRowDoubleClickEventArgs | After double-click |
|
|
135
|
+
|
|
136
|
+
**Data Events:**
|
|
137
|
+
| Event | Args Type | Description |
|
|
138
|
+
|-------|-----------|-------------|
|
|
139
|
+
| `beforeDataLoad` | BeforeDataLoadEventArgs | Before data loads |
|
|
140
|
+
| `afterDataLoad` | AfterDataLoadEventArgs | After data loads |
|
|
141
|
+
| `beforeDataRefresh` | BeforeDataRefreshEventArgs | Before refresh |
|
|
142
|
+
| `afterDataRefresh` | AfterDataRefreshEventArgs | After refresh |
|
|
143
|
+
|
|
144
|
+
**Sorting/Column Events:**
|
|
145
|
+
| Event | Args Type | Description |
|
|
146
|
+
|-------|-----------|-------------|
|
|
147
|
+
| `beforeSort` | BeforeSortEventArgs | Before sort changes |
|
|
148
|
+
| `afterSort` | AfterSortEventArgs | After sort changes |
|
|
149
|
+
| `beforeColumnReorder` | BeforeColumnReorderEventArgs | Before column move |
|
|
150
|
+
| `afterColumnReorder` | AfterColumnReorderEventArgs | After column move |
|
|
151
|
+
| `gridStateChanged` | GridStateChangedEvent | Column state changed |
|
|
152
|
+
|
|
153
|
+
**Toolbar Button Events:**
|
|
154
|
+
| Event | Args Type | Description |
|
|
155
|
+
|-------|-----------|-------------|
|
|
156
|
+
| `newButtonClick` | void | Add/New button clicked |
|
|
157
|
+
| `refreshButtonClick` | void | Refresh button clicked |
|
|
158
|
+
| `deleteButtonClick` | BaseEntity[] | Delete button clicked |
|
|
159
|
+
| `exportButtonClick` | void | Export button clicked |
|
|
160
|
+
| `compareButtonClick` | BaseEntity[] | Compare button clicked |
|
|
161
|
+
| `mergeButtonClick` | BaseEntity[] | Merge button clicked |
|
|
162
|
+
| `addToListButtonClick` | BaseEntity[] | Add to List clicked |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### GridToolbarConfig
|
|
167
|
+
|
|
168
|
+
Configure which toolbar buttons are shown and their behavior.
|
|
70
169
|
|
|
71
|
-
|
|
170
|
+
```typescript
|
|
171
|
+
const toolbarConfig: GridToolbarConfig = {
|
|
172
|
+
// Search
|
|
173
|
+
showSearch: true,
|
|
174
|
+
searchPlaceholder: 'Search records...',
|
|
175
|
+
searchDebounce: 300,
|
|
176
|
+
|
|
177
|
+
// Buttons
|
|
178
|
+
showRefresh: true,
|
|
179
|
+
showAdd: true,
|
|
180
|
+
showDelete: true,
|
|
181
|
+
showExport: true,
|
|
182
|
+
showColumnChooser: true,
|
|
183
|
+
showFilterToggle: false,
|
|
184
|
+
|
|
185
|
+
// Export options
|
|
186
|
+
exportFormats: ['excel', 'csv', 'json'],
|
|
187
|
+
|
|
188
|
+
// Display
|
|
189
|
+
showRowCount: true,
|
|
190
|
+
showSelectionCount: true,
|
|
191
|
+
position: 'top',
|
|
192
|
+
|
|
193
|
+
// Custom buttons
|
|
194
|
+
customButtons: [
|
|
195
|
+
{
|
|
196
|
+
id: 'myButton',
|
|
197
|
+
text: 'My Action',
|
|
198
|
+
icon: 'fa-solid fa-star',
|
|
199
|
+
tooltip: 'Do something custom',
|
|
200
|
+
position: 'right',
|
|
201
|
+
onClick: () => console.log('Clicked!')
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
};
|
|
205
|
+
```
|
|
72
206
|
|
|
73
|
-
|
|
207
|
+
#### GridToolbarConfig Options
|
|
208
|
+
|
|
209
|
+
| Option | Type | Default | Description |
|
|
210
|
+
|--------|------|---------|-------------|
|
|
211
|
+
| `showSearch` | boolean | true | Show search input |
|
|
212
|
+
| `searchPlaceholder` | string | 'Search...' | Search placeholder text |
|
|
213
|
+
| `searchDebounce` | number | 300 | Search debounce (ms) |
|
|
214
|
+
| `showRefresh` | boolean | true | Show refresh button |
|
|
215
|
+
| `showAdd` | boolean | true | Show add/new button |
|
|
216
|
+
| `showDelete` | boolean | true | Show delete button |
|
|
217
|
+
| `showExport` | boolean | true | Show export button |
|
|
218
|
+
| `exportFormats` | Array | ['excel'] | Available export formats |
|
|
219
|
+
| `showColumnChooser` | boolean | true | Show column chooser |
|
|
220
|
+
| `showFilterToggle` | boolean | false | Show filter toggle |
|
|
221
|
+
| `showRowCount` | boolean | true | Show total row count |
|
|
222
|
+
| `showSelectionCount` | boolean | true | Show selected count |
|
|
223
|
+
| `position` | string | 'top' | Toolbar position |
|
|
224
|
+
| `customButtons` | GridToolbarButton[] | [] | Custom buttons |
|
|
225
|
+
|
|
226
|
+
#### GridToolbarButton
|
|
227
|
+
|
|
228
|
+
| Property | Type | Description |
|
|
229
|
+
|----------|------|-------------|
|
|
230
|
+
| `id` | string | Unique button identifier |
|
|
231
|
+
| `text` | string | Button text |
|
|
232
|
+
| `icon` | string | Font Awesome icon class |
|
|
233
|
+
| `tooltip` | string | Hover tooltip |
|
|
234
|
+
| `disabled` | boolean \| () => boolean | Disabled state |
|
|
235
|
+
| `visible` | boolean \| () => boolean | Visibility |
|
|
236
|
+
| `cssClass` | string | Custom CSS class |
|
|
237
|
+
| `position` | 'left' \| 'right' | Button position |
|
|
238
|
+
| `onClick` | () => void | Click handler |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### EntityViewerComponent (`mj-entity-viewer`)
|
|
243
|
+
|
|
244
|
+
Composite component combining grid, cards, and timeline views with view switching.
|
|
74
245
|
|
|
75
246
|
```html
|
|
76
|
-
<mj-entity-
|
|
247
|
+
<mj-entity-viewer
|
|
77
248
|
[entity]="selectedEntity"
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
249
|
+
[viewEntity]="myUserView"
|
|
250
|
+
[showGridToolbar]="true"
|
|
251
|
+
[gridToolbarConfig]="toolbarConfig"
|
|
252
|
+
[gridSelectionMode]="'multiple'"
|
|
81
253
|
(recordSelected)="onRecordSelected($event)"
|
|
82
|
-
(recordOpened)="onRecordOpened($event)"
|
|
83
|
-
|
|
254
|
+
(recordOpened)="onRecordOpened($event)"
|
|
255
|
+
(addRequested)="onAddNew()"
|
|
256
|
+
(exportRequested)="onExport($event)">
|
|
257
|
+
</mj-entity-viewer>
|
|
84
258
|
```
|
|
85
259
|
|
|
86
260
|
#### Inputs
|
|
87
261
|
|
|
88
|
-
| Input | Type | Description |
|
|
89
|
-
|
|
90
|
-
| `entity` | EntityInfo | Entity metadata |
|
|
91
|
-
| `records` | BaseEntity[] |
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
262
|
+
| Input | Type | Default | Description |
|
|
263
|
+
|-------|------|---------|-------------|
|
|
264
|
+
| `entity` | EntityInfo | - | Entity metadata |
|
|
265
|
+
| `records` | BaseEntity[] | - | Pre-loaded records |
|
|
266
|
+
| `viewEntity` | UserViewEntityExtended | - | User View for filtering/sorting |
|
|
267
|
+
| `viewMode` | 'grid' \| 'cards' \| 'timeline' | 'grid' | Current view mode |
|
|
268
|
+
| `filterText` | string | - | Filter text |
|
|
269
|
+
| `sortState` | SortState | - | Sort state |
|
|
270
|
+
| `gridState` | ViewGridStateConfig | - | Grid column state |
|
|
271
|
+
| `showGridToolbar` | boolean | true | Show grid toolbar |
|
|
272
|
+
| `gridToolbarConfig` | GridToolbarConfig | - | Toolbar configuration |
|
|
273
|
+
| `gridSelectionMode` | GridSelectionMode | 'single' | Selection mode |
|
|
274
|
+
| `config` | EntityViewerConfig | - | Viewer configuration |
|
|
96
275
|
|
|
97
276
|
#### Outputs
|
|
98
277
|
|
|
99
|
-
| Output | Type | Description |
|
|
100
|
-
|
|
101
|
-
| `recordSelected` | RecordSelectedEvent |
|
|
102
|
-
| `recordOpened` | RecordOpenedEvent |
|
|
278
|
+
| Output | Event Type | Description |
|
|
279
|
+
|--------|------------|-------------|
|
|
280
|
+
| `recordSelected` | RecordSelectedEvent | Record clicked |
|
|
281
|
+
| `recordOpened` | RecordOpenedEvent | Record double-clicked |
|
|
282
|
+
| `dataLoaded` | DataLoadedEvent | Data finished loading |
|
|
283
|
+
| `viewModeChange` | EntityViewMode | View mode changed |
|
|
284
|
+
| `filterTextChange` | string | Filter text changed |
|
|
285
|
+
| `sortChanged` | SortChangedEvent | Sort changed |
|
|
286
|
+
| `gridStateChanged` | GridStateChangedEvent | Grid state changed |
|
|
287
|
+
| `addRequested` | void | Add button clicked |
|
|
288
|
+
| `deleteRequested` | { records } | Delete button clicked |
|
|
289
|
+
| `refreshRequested` | void | Refresh button clicked |
|
|
290
|
+
| `exportRequested` | { format } | Export button clicked |
|
|
291
|
+
|
|
292
|
+
---
|
|
103
293
|
|
|
104
|
-
### EntityCardsComponent
|
|
294
|
+
### EntityCardsComponent (`mj-entity-cards`)
|
|
105
295
|
|
|
106
|
-
|
|
296
|
+
Card-based view with auto-generated layout.
|
|
107
297
|
|
|
108
298
|
```html
|
|
109
299
|
<mj-entity-cards
|
|
110
300
|
[entity]="selectedEntity"
|
|
111
301
|
[records]="records"
|
|
112
302
|
[filterText]="searchFilter"
|
|
113
|
-
[
|
|
114
|
-
(recordSelected)="
|
|
115
|
-
(recordOpened)="
|
|
116
|
-
(filteredCountChanged)="onFilteredCountChanged($event)">
|
|
303
|
+
[cardTemplate]="customTemplate"
|
|
304
|
+
(recordSelected)="onSelected($event)"
|
|
305
|
+
(recordOpened)="onOpened($event)">
|
|
117
306
|
</mj-entity-cards>
|
|
118
307
|
```
|
|
119
308
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
| Input | Type | Description |
|
|
123
|
-
|-------|------|-------------|
|
|
124
|
-
| `entity` | EntityInfo | Entity metadata |
|
|
125
|
-
| `records` | BaseEntity[] | Records to display |
|
|
126
|
-
| `selectedRecordId` | string | Selected record's PK |
|
|
127
|
-
| `filterText` | string | Filter text (supports `%` wildcards) |
|
|
128
|
-
| `cardTemplate` | CardTemplate | Custom card template |
|
|
129
|
-
|
|
130
|
-
#### Outputs
|
|
131
|
-
|
|
132
|
-
| Output | Type | Description |
|
|
133
|
-
|--------|------|-------------|
|
|
134
|
-
| `recordSelected` | RecordSelectedEvent | Click on card |
|
|
135
|
-
| `recordOpened` | RecordOpenedEvent | Open button click |
|
|
136
|
-
| `filteredCountChanged` | number | Filtered count changed |
|
|
309
|
+
---
|
|
137
310
|
|
|
138
|
-
### PillComponent
|
|
311
|
+
### PillComponent (`mj-pill`)
|
|
139
312
|
|
|
140
313
|
Semantic color pill for categorical values.
|
|
141
314
|
|
|
142
315
|
```html
|
|
143
|
-
<!-- Auto-color based on value -->
|
|
144
316
|
<mj-pill [value]="record.Status"></mj-pill>
|
|
145
|
-
|
|
146
|
-
<!-- Force specific color -->
|
|
147
317
|
<mj-pill [value]="record.Type" color="info"></mj-pill>
|
|
148
318
|
```
|
|
149
319
|
|
|
150
|
-
|
|
151
|
-
- **success** (green): active, approved, complete,
|
|
152
|
-
- **warning** (yellow): pending, in progress, draft,
|
|
153
|
-
- **danger** (red): failed, error, rejected,
|
|
154
|
-
- **info** (blue): new, info, created,
|
|
320
|
+
Auto-detected colors:
|
|
321
|
+
- **success** (green): active, approved, complete, success
|
|
322
|
+
- **warning** (yellow): pending, in progress, draft, waiting
|
|
323
|
+
- **danger** (red): failed, error, rejected, cancelled
|
|
324
|
+
- **info** (blue): new, info, created, open
|
|
155
325
|
- **neutral** (gray): default
|
|
156
326
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### RecordSelectedEvent
|
|
327
|
+
---
|
|
160
328
|
|
|
161
|
-
|
|
162
|
-
interface RecordSelectedEvent {
|
|
163
|
-
record: BaseEntity; // The selected record
|
|
164
|
-
entity: EntityInfo; // Entity metadata
|
|
165
|
-
compositeKey: CompositeKey; // Record's composite key
|
|
166
|
-
}
|
|
167
|
-
```
|
|
329
|
+
## Advanced Usage
|
|
168
330
|
|
|
169
|
-
###
|
|
331
|
+
### Infinite Scroll Pagination
|
|
170
332
|
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
333
|
+
```html
|
|
334
|
+
<mj-entity-data-grid
|
|
335
|
+
[entityName]="'Contacts'"
|
|
336
|
+
[PaginationMode]="'infinite'"
|
|
337
|
+
[PageSize]="100"
|
|
338
|
+
[CacheBlockSize]="100"
|
|
339
|
+
[MaxBlocksInCache]="10">
|
|
340
|
+
</mj-entity-data-grid>
|
|
177
341
|
```
|
|
178
342
|
|
|
179
|
-
|
|
343
|
+
### State Persistence with User Views
|
|
180
344
|
|
|
181
|
-
|
|
345
|
+
```html
|
|
346
|
+
<mj-entity-data-grid
|
|
347
|
+
[Params]="{ ViewID: myUserView.ID }"
|
|
348
|
+
[AutoPersistState]="true"
|
|
349
|
+
[StatePersistDebounce]="5000">
|
|
350
|
+
</mj-entity-data-grid>
|
|
351
|
+
```
|
|
182
352
|
|
|
183
|
-
|
|
184
|
-
- `hub%updat%comp` - matches "hubspot update company"
|
|
185
|
-
- `%comp` - matches "my company"
|
|
353
|
+
### Cancelable Events
|
|
186
354
|
|
|
187
|
-
|
|
355
|
+
```typescript
|
|
356
|
+
onBeforeRowSelect(event: BeforeRowSelectEventArgs) {
|
|
357
|
+
// Prevent selecting certain rows
|
|
358
|
+
if (event.row.Get('Status') === 'Locked') {
|
|
359
|
+
event.cancel = true;
|
|
360
|
+
event.cancelReason = 'Cannot select locked records';
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
```
|
|
188
364
|
|
|
189
|
-
###
|
|
365
|
+
### Custom Export Handler
|
|
190
366
|
|
|
191
367
|
```typescript
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
368
|
+
onExportRequested(event: { format: 'excel' | 'csv' | 'json' }) {
|
|
369
|
+
// Custom export logic
|
|
370
|
+
if (event.format === 'excel') {
|
|
371
|
+
this.exportService.exportToExcel(this.records);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
197
374
|
```
|
|
198
375
|
|
|
199
|
-
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Type Exports
|
|
200
379
|
|
|
201
380
|
```typescript
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
};
|
|
381
|
+
// Types
|
|
382
|
+
import {
|
|
383
|
+
GridToolbarConfig,
|
|
384
|
+
GridToolbarButton,
|
|
385
|
+
GridSelectionMode,
|
|
386
|
+
GridColumnConfig,
|
|
387
|
+
ViewGridStateConfig,
|
|
388
|
+
DataGridSortState,
|
|
389
|
+
RecordSelectedEvent,
|
|
390
|
+
RecordOpenedEvent
|
|
391
|
+
} from '@memberjunction/ng-entity-viewer';
|
|
392
|
+
|
|
393
|
+
// Event Args
|
|
394
|
+
import {
|
|
395
|
+
BeforeRowSelectEventArgs,
|
|
396
|
+
AfterRowSelectEventArgs,
|
|
397
|
+
BeforeRowClickEventArgs,
|
|
398
|
+
AfterRowClickEventArgs,
|
|
399
|
+
BeforeDataLoadEventArgs,
|
|
400
|
+
AfterDataLoadEventArgs,
|
|
401
|
+
AfterSortEventArgs
|
|
402
|
+
} from '@memberjunction/ng-entity-viewer';
|
|
213
403
|
```
|
|
214
404
|
|
|
405
|
+
---
|
|
406
|
+
|
|
215
407
|
## Dependencies
|
|
216
408
|
|
|
217
409
|
- `@angular/core` ^18.0.0
|
|
@@ -220,6 +412,7 @@ const template: CardTemplate = {
|
|
|
220
412
|
- `ag-grid-angular` ^34.0.0
|
|
221
413
|
- `ag-grid-community` ^34.0.0
|
|
222
414
|
- `@memberjunction/core` ^2.0.0
|
|
415
|
+
- `@memberjunction/core-entities` ^2.0.0
|
|
223
416
|
|
|
224
417
|
## License
|
|
225
418
|
|